@chewel611/naive-ui-plus 0.0.1

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 (129) hide show
  1. package/README.md +73 -0
  2. package/dist/index.js +1377 -0
  3. package/dist/index.umd.cjs +1 -0
  4. package/dist/style.css +1 -0
  5. package/es/_virtual/_plugin-vue_export-helper.js +9 -0
  6. package/es/application/PApplication.d.ts +23 -0
  7. package/es/application/PApplication.vue.js +53 -0
  8. package/es/application/PApplication.vue2.js +4 -0
  9. package/es/application/index.d.ts +33 -0
  10. package/es/application/index.js +6 -0
  11. package/es/components.d.ts +5 -0
  12. package/es/components.js +12 -0
  13. package/es/index.d.ts +9 -0
  14. package/es/index.js +24 -0
  15. package/es/languages/PLanguage.d.ts +2 -0
  16. package/es/languages/PLanguage.vue.js +69 -0
  17. package/es/languages/PLanguage.vue2.js +4 -0
  18. package/es/languages/index.d.ts +16 -0
  19. package/es/languages/index.js +7 -0
  20. package/es/languages/store.d.ts +137 -0
  21. package/es/languages/store.js +53 -0
  22. package/es/languages/typing.d.ts +14 -0
  23. package/es/layout/PLayout.css +1 -0
  24. package/es/layout/PLayout.d.ts +2 -0
  25. package/es/layout/PLayout.vue.js +7 -0
  26. package/es/layout/PLayout.vue2.js +80 -0
  27. package/es/layout/content/PContent.d.ts +7 -0
  28. package/es/layout/content/PContent.vue.js +27 -0
  29. package/es/layout/content/PContent.vue2.js +4 -0
  30. package/es/layout/content/PTabs.css +1 -0
  31. package/es/layout/content/PTabs.d.ts +5 -0
  32. package/es/layout/content/PTabs.vue.js +7 -0
  33. package/es/layout/content/PTabs.vue2.js +281 -0
  34. package/es/layout/header/PHeader.css +1 -0
  35. package/es/layout/header/PHeader.d.ts +2 -0
  36. package/es/layout/header/PHeader.vue.js +7 -0
  37. package/es/layout/header/PHeader.vue2.js +188 -0
  38. package/es/layout/index.d.ts +15 -0
  39. package/es/layout/index.js +6 -0
  40. package/es/layout/layout.d.ts +21002 -0
  41. package/es/layout/layout.js +74 -0
  42. package/es/layout/sider/PLogo.css +1 -0
  43. package/es/layout/sider/PLogo.d.ts +2 -0
  44. package/es/layout/sider/PLogo.vue.js +7 -0
  45. package/es/layout/sider/PLogo.vue2.js +23 -0
  46. package/es/layout/sider/PMenus.d.ts +2 -0
  47. package/es/layout/sider/PMenus.vue.js +90 -0
  48. package/es/layout/sider/PMenus.vue2.js +4 -0
  49. package/es/modal/PModal.d.ts +4173 -0
  50. package/es/modal/PModal.vue.js +106 -0
  51. package/es/modal/PModal.vue2.js +4 -0
  52. package/es/modal/index.d.ts +2116 -0
  53. package/es/modal/index.js +6 -0
  54. package/es/modal/typing.d.ts +12 -0
  55. package/es/table/PTable.d.ts +37 -0
  56. package/es/table/PTable.vue.js +384 -0
  57. package/es/table/PTable.vue2.js +4 -0
  58. package/es/table/index.d.ts +61 -0
  59. package/es/table/index.js +6 -0
  60. package/es/table/typing.d.ts +41 -0
  61. package/es/typing.d.ts +5 -0
  62. package/es/utils/install.d.ts +2 -0
  63. package/es/utils/install.js +9 -0
  64. package/es/utils/plus.d.ts +6 -0
  65. package/es/utils/resolver.d.ts +7 -0
  66. package/es/utils/storage.d.ts +7 -0
  67. package/lib/_virtual/_plugin-vue_export-helper.cjs +1 -0
  68. package/lib/application/PApplication.d.ts +23 -0
  69. package/lib/application/PApplication.vue.cjs +1 -0
  70. package/lib/application/PApplication.vue2.cjs +1 -0
  71. package/lib/application/index.cjs +1 -0
  72. package/lib/application/index.d.ts +33 -0
  73. package/lib/components.cjs +1 -0
  74. package/lib/components.d.ts +5 -0
  75. package/lib/index.cjs +1 -0
  76. package/lib/index.d.ts +9 -0
  77. package/lib/languages/PLanguage.d.ts +2 -0
  78. package/lib/languages/PLanguage.vue.cjs +1 -0
  79. package/lib/languages/PLanguage.vue2.cjs +1 -0
  80. package/lib/languages/index.cjs +1 -0
  81. package/lib/languages/index.d.ts +16 -0
  82. package/lib/languages/store.cjs +1 -0
  83. package/lib/languages/store.d.ts +137 -0
  84. package/lib/languages/typing.d.ts +14 -0
  85. package/lib/layout/PLayout.css +1 -0
  86. package/lib/layout/PLayout.d.ts +2 -0
  87. package/lib/layout/PLayout.vue.cjs +1 -0
  88. package/lib/layout/PLayout.vue2.cjs +1 -0
  89. package/lib/layout/content/PContent.d.ts +7 -0
  90. package/lib/layout/content/PContent.vue.cjs +1 -0
  91. package/lib/layout/content/PContent.vue2.cjs +1 -0
  92. package/lib/layout/content/PTabs.css +1 -0
  93. package/lib/layout/content/PTabs.d.ts +5 -0
  94. package/lib/layout/content/PTabs.vue.cjs +1 -0
  95. package/lib/layout/content/PTabs.vue2.cjs +1 -0
  96. package/lib/layout/header/PHeader.css +1 -0
  97. package/lib/layout/header/PHeader.d.ts +2 -0
  98. package/lib/layout/header/PHeader.vue.cjs +1 -0
  99. package/lib/layout/header/PHeader.vue2.cjs +1 -0
  100. package/lib/layout/index.cjs +1 -0
  101. package/lib/layout/index.d.ts +15 -0
  102. package/lib/layout/layout.cjs +1 -0
  103. package/lib/layout/layout.d.ts +21002 -0
  104. package/lib/layout/sider/PLogo.css +1 -0
  105. package/lib/layout/sider/PLogo.d.ts +2 -0
  106. package/lib/layout/sider/PLogo.vue.cjs +1 -0
  107. package/lib/layout/sider/PLogo.vue2.cjs +1 -0
  108. package/lib/layout/sider/PMenus.d.ts +2 -0
  109. package/lib/layout/sider/PMenus.vue.cjs +1 -0
  110. package/lib/layout/sider/PMenus.vue2.cjs +1 -0
  111. package/lib/modal/PModal.d.ts +4173 -0
  112. package/lib/modal/PModal.vue.cjs +1 -0
  113. package/lib/modal/PModal.vue2.cjs +1 -0
  114. package/lib/modal/index.cjs +1 -0
  115. package/lib/modal/index.d.ts +2116 -0
  116. package/lib/modal/typing.d.ts +12 -0
  117. package/lib/table/PTable.d.ts +37 -0
  118. package/lib/table/PTable.vue.cjs +1 -0
  119. package/lib/table/PTable.vue2.cjs +1 -0
  120. package/lib/table/index.cjs +1 -0
  121. package/lib/table/index.d.ts +61 -0
  122. package/lib/table/typing.d.ts +41 -0
  123. package/lib/typing.d.ts +5 -0
  124. package/lib/utils/install.cjs +1 -0
  125. package/lib/utils/install.d.ts +2 -0
  126. package/lib/utils/plus.d.ts +6 -0
  127. package/lib/utils/resolver.d.ts +7 -0
  128. package/lib/utils/storage.d.ts +7 -0
  129. package/package.json +103 -0
@@ -0,0 +1,74 @@
1
+ import { defineStore as o } from "pinia";
2
+ import { reactive as i } from "vue";
3
+ const n = ["Redirect", "RedirectSon", "login"], R = o("p-layout", () => {
4
+ const s = i({
5
+ collapsed: !1,
6
+ title: "输入项目名称",
7
+ logo: "https://picsum.photos/id/1/100/100",
8
+ avatar: "",
9
+ uid: "",
10
+ uname: "",
11
+ tabs: [],
12
+ cacheTabs: !1
13
+ });
14
+ return {
15
+ state: s,
16
+ initTabs: (t) => {
17
+ t.sort((e, a) => (a.meta.affix ? 1 : 0) - (e.meta.affix ? 1 : 0)), s.tabs = t;
18
+ },
19
+ addTab: (t) => n.includes(t.name) ? !1 : (s.tabs?.some(
20
+ (a) => a.fullPath == t.fullPath
21
+ ) || s.tabs?.push(t), !0),
22
+ closeCurrentTab: (t) => {
23
+ const e = s.tabs.findIndex(
24
+ (a) => a.fullPath == t.fullPath
25
+ );
26
+ s.tabs.splice(e, 1);
27
+ },
28
+ closeAllTabs: () => {
29
+ s.tabs = s.tabs.filter((t) => t?.meta?.affix ?? !1);
30
+ },
31
+ closeOtherTabs: (t) => {
32
+ s.tabs = s.tabs.filter(
33
+ (e) => e.fullPath == t.fullPath || (e?.meta?.affix ?? !1)
34
+ );
35
+ },
36
+ closeLeftTabs: (t) => {
37
+ const e = s.tabs.findIndex(
38
+ (a) => a.fullPath == t.fullPath
39
+ );
40
+ s.tabs = s.tabs.filter(
41
+ (a, l) => l >= e || (a?.meta?.affix ?? !1)
42
+ );
43
+ },
44
+ closeRightTabs: (t) => {
45
+ const e = s.tabs.findIndex(
46
+ (a) => a.fullPath == t.fullPath
47
+ );
48
+ s.tabs = s.tabs.filter(
49
+ (a, l) => l <= e || (a?.meta?.affix ?? !1)
50
+ );
51
+ },
52
+ collapse: () => {
53
+ s.collapsed = !s.collapsed;
54
+ },
55
+ setTitle: (t) => {
56
+ s.title = t;
57
+ },
58
+ setLogo: (t) => {
59
+ s.logo = t;
60
+ },
61
+ setUser: (t, e) => {
62
+ s.uid = t, s.uname = e;
63
+ },
64
+ setSettingPages: (t) => {
65
+ s.settingPages = t;
66
+ },
67
+ setLogout: (t) => {
68
+ s.logout = t;
69
+ }
70
+ };
71
+ });
72
+ export {
73
+ R as usePLayoutStore
74
+ };
@@ -0,0 +1 @@
1
+ .logo[data-v-c9496d2e]{display:flex;align-items:center;justify-content:start;padding-left:16px;height:64px;line-height:64px;overflow:hidden;white-space:nowrap}.logo-size[data-v-c9496d2e]{font-size:20px}
@@ -0,0 +1,2 @@
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>;
2
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./PLogo.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c9496d2e"]]);
5
+ export {
6
+ _ as default
7
+ };
@@ -0,0 +1,23 @@
1
+ import { defineComponent as t, createElementBlock as s, openBlock as r, createVNode as l, withDirectives as a, unref as o, normalizeClass as c, createElementVNode as n, toDisplayString as i, vShow as m } from "vue";
2
+ import { usePLayoutStore as p } from "../layout.js";
3
+ import { NAvatar as _ } from "naive-ui";
4
+ const d = { class: "logo" }, N = /* @__PURE__ */ t({
5
+ __name: "PLogo",
6
+ setup(u) {
7
+ const e = p();
8
+ return (f, g) => (r(), s("div", d, [
9
+ l(o(_), {
10
+ color: "var(--color-logo)",
11
+ size: 32,
12
+ src: o(e).state.logo,
13
+ class: c({ "mr-2": !o(e).state.collapsed })
14
+ }, null, 8, ["src", "class"]),
15
+ a(n("h1", { class: "font-bold ease-in-out ml-2 logo-size" }, i(o(e).state.title), 513), [
16
+ [m, !o(e).state.collapsed]
17
+ ])
18
+ ]));
19
+ }
20
+ });
21
+ export {
22
+ N as default
23
+ };
@@ -0,0 +1,2 @@
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>;
2
+ export default _default;
@@ -0,0 +1,90 @@
1
+ import { defineComponent as k, ref as d, watch as B, onMounted as P, createBlock as S, openBlock as y, unref as v } from "vue";
2
+ import { NMenu as O } from "naive-ui";
3
+ import { useRoute as U, useRouter as b } from "vue-router";
4
+ import { usePLayoutStore as z } from "../layout.js";
5
+ const j = /* @__PURE__ */ k({
6
+ __name: "PMenus",
7
+ setup(C) {
8
+ const a = U(), u = b(), g = z(), m = d(a.name), r = d(
9
+ a.matched && a.matched.length ? a.matched.map((t) => t.name) : []
10
+ ), h = d([]), M = (t) => {
11
+ /http(s)?:/.test(t) ? window.open(t) : u.push({ name: t });
12
+ }, _ = (t) => {
13
+ if (!t) return;
14
+ const n = t.find((c) => r.value.indexOf(c) === -1);
15
+ r.value = n ? [n] : [];
16
+ }, p = () => {
17
+ const t = a.matched;
18
+ r.value = t.map((c) => c.name);
19
+ const n = a.meta?.activeMenu || "";
20
+ m.value = n || a.name;
21
+ }, s = (t, n = [], c = !1) => {
22
+ const i = [], R = [
23
+ "/:path(.*)*",
24
+ "/redirect",
25
+ "/redirect/:path(.*)",
26
+ "/login",
27
+ "/oidc-callback"
28
+ ];
29
+ if (!t || t.length === 0)
30
+ return i;
31
+ t = t.sort((e, l) => {
32
+ let o = (l.children?.length ? 1 : 0) - (e.children?.length ? 1 : 0);
33
+ return o === 0 && (o = (e.meta?.sort ?? 0) - (l.meta?.sort ?? 0)), o;
34
+ });
35
+ for (const e of t) {
36
+ if (c || (e.meta?.hidden || !1) == !0 || R.includes(e.path)) {
37
+ n.push(e.name), e.children && e.children.length > 0 && s(e.children, n, !0);
38
+ continue;
39
+ }
40
+ const l = e.meta?.alwaysShow != !0 && e?.children?.filter((x) => !x?.meta?.hidden)?.length === 1, o = l ? e.children[0] : e, f = {
41
+ key: o.name,
42
+ label: o.meta?.title,
43
+ affix: o.meta?.affix,
44
+ sort: o.meta?.sort,
45
+ path: o.path,
46
+ redirect: o.redirect,
47
+ icon: l ? e.meta?.icon : o.meta?.icon,
48
+ permissions: o.meta?.permissions,
49
+ meta: o.meta,
50
+ children: void 0
51
+ };
52
+ if (!n.includes(e.name)) {
53
+ if (i.push(f), n.push(e.name), l) {
54
+ s(e.children, n, c);
55
+ continue;
56
+ }
57
+ e.children && e.children.length > 0 && (f.children = s(e.children, n, c));
58
+ }
59
+ }
60
+ return i;
61
+ }, w = () => {
62
+ const t = u.getRoutes();
63
+ h.value = s(t);
64
+ };
65
+ return B(
66
+ () => a.fullPath,
67
+ () => {
68
+ p();
69
+ }
70
+ ), P(() => {
71
+ w(), p();
72
+ }), (t, n) => (y(), S(v(O), {
73
+ class: "h-full",
74
+ inverted: "",
75
+ mode: "vertical",
76
+ options: h.value,
77
+ collapsed: v(g).state.collapsed,
78
+ "collapsed-width": 64,
79
+ "collapsed-icon-size": 20,
80
+ indent: 24,
81
+ "expanded-keys": r.value,
82
+ value: m.value,
83
+ "onUpdate:value": M,
84
+ "onUpdate:expandedKeys": _
85
+ }, null, 8, ["options", "collapsed", "expanded-keys", "value"]));
86
+ }
87
+ });
88
+ export {
89
+ j as default
90
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./PMenus.vue.js";
2
+ export {
3
+ f as default
4
+ };