@duxweb/dvha-naiveui 0.0.4 → 1.0.0

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.
@@ -0,0 +1,86 @@
1
+ /**
2
+ * @vue/shared v3.5.14
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/
6
+ /*! #__NO_SIDE_EFFECTS__ */
7
+ // @__NO_SIDE_EFFECTS__
8
+ function S(t) {
9
+ const e = /* @__PURE__ */ Object.create(null);
10
+ for (const n of t.split(",")) e[n] = 1;
11
+ return (n) => n in e;
12
+ }
13
+ const E = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
14
+ process.env.NODE_ENV !== "production" && Object.freeze([]);
15
+ const w = () => {
16
+ }, A = (t) => t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && // uppercase letter
17
+ (t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97), C = Object.assign, b = Object.prototype.hasOwnProperty, T = (t, e) => b.call(t, e), a = Array.isArray, z = (t) => s(t) === "[object Map]", N = (t) => s(t) === "[object Set]", i = (t) => typeof t == "function", c = (t) => typeof t == "string", P = (t) => typeof t == "symbol", l = (t) => t !== null && typeof t == "object", D = (t) => (l(t) || i(t)) && i(t.then) && i(t.catch), h = Object.prototype.toString, s = (t) => h.call(t), M = (t) => s(t).slice(8, -1), R = (t) => s(t) === "[object Object]", _ = (t) => c(t) && t !== "NaN" && t[0] !== "-" && "" + parseInt(t, 10) === t, g = (t) => {
18
+ const e = /* @__PURE__ */ Object.create(null);
19
+ return (n) => e[n] || (e[n] = t(n));
20
+ }, x = g((t) => t.charAt(0).toUpperCase() + t.slice(1)), F = (t, e) => !Object.is(t, e);
21
+ let p;
22
+ const I = () => p || (p = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
23
+ function d(t) {
24
+ if (a(t)) {
25
+ const e = {};
26
+ for (let n = 0; n < t.length; n++) {
27
+ const o = t[n], r = c(o) ? j(o) : d(o);
28
+ if (r)
29
+ for (const f in r)
30
+ e[f] = r[f];
31
+ }
32
+ return e;
33
+ } else if (c(t) || l(t))
34
+ return t;
35
+ }
36
+ const O = /;(?![^(]*\))/g, y = /:([^]+)/, m = /\/\*[^]*?\*\//g;
37
+ function j(t) {
38
+ const e = {};
39
+ return t.replace(m, "").split(O).forEach((n) => {
40
+ if (n) {
41
+ const o = n.split(y);
42
+ o.length > 1 && (e[o[0].trim()] = o[1].trim());
43
+ }
44
+ }), e;
45
+ }
46
+ function u(t) {
47
+ let e = "";
48
+ if (c(t))
49
+ e = t;
50
+ else if (a(t))
51
+ for (let n = 0; n < t.length; n++) {
52
+ const o = u(t[n]);
53
+ o && (e += o + " ");
54
+ }
55
+ else if (l(t))
56
+ for (const n in t)
57
+ t[n] && (e += n + " ");
58
+ return e.trim();
59
+ }
60
+ export {
61
+ E as EMPTY_OBJ,
62
+ w as NOOP,
63
+ x as capitalize,
64
+ C as extend,
65
+ I as getGlobalThis,
66
+ F as hasChanged,
67
+ T as hasOwn,
68
+ a as isArray,
69
+ i as isFunction,
70
+ _ as isIntegerKey,
71
+ z as isMap,
72
+ l as isObject,
73
+ A as isOn,
74
+ R as isPlainObject,
75
+ D as isPromise,
76
+ N as isSet,
77
+ c as isString,
78
+ P as isSymbol,
79
+ S as makeMap,
80
+ u as normalizeClass,
81
+ d as normalizeStyle,
82
+ h as objectToString,
83
+ j as parseStringStyle,
84
+ M as toRawType,
85
+ s as toTypeString
86
+ };
@@ -0,0 +1,37 @@
1
+ import { initCustomFormatter as e } from "../../@vue/runtime-core/dist/runtime-core.esm-bundler.js";
2
+ import { Comment as i, Fragment as c, Text as s, callWithAsyncErrorHandling as a, callWithErrorHandling as d, cloneVNode as m, computed as l, createElementVNode as u, createTextVNode as p, createVNode as f, defineComponent as C, getCurrentInstance as E, guardReactiveProps as N, h as g, handleError as h, inject as x, isVNode as V, mergeProps as v, queuePostFlushCb as F, setTransitionHooks as H, ssrContextKey as P, useSSRContext as T, watchEffect as y } from "../../@vue/runtime-core/dist/runtime-core.esm-bundler.js";
3
+ /**
4
+ * vue v3.5.14
5
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
6
+ * @license MIT
7
+ **/
8
+ function t() {
9
+ e();
10
+ }
11
+ process.env.NODE_ENV !== "production" && t();
12
+ export {
13
+ i as Comment,
14
+ c as Fragment,
15
+ s as Text,
16
+ a as callWithAsyncErrorHandling,
17
+ d as callWithErrorHandling,
18
+ m as cloneVNode,
19
+ l as computed,
20
+ u as createElementVNode,
21
+ p as createTextVNode,
22
+ f as createVNode,
23
+ C as defineComponent,
24
+ E as getCurrentInstance,
25
+ N as guardReactiveProps,
26
+ g as h,
27
+ h as handleError,
28
+ e as initCustomFormatter,
29
+ x as inject,
30
+ V as isVNode,
31
+ v as mergeProps,
32
+ F as queuePostFlushCb,
33
+ H as setTransitionHooks,
34
+ P as ssrContextKey,
35
+ T as useSSRContext,
36
+ y as watchEffect
37
+ };
@@ -0,0 +1,193 @@
1
+ import "../../vue/dist/vue.runtime.esm-bundler.js";
2
+ import { inject as v, defineComponent as N, computed as a, h as D, getCurrentInstance as L, watchEffect as I } from "../../@vue/runtime-core/dist/runtime-core.esm-bundler.js";
3
+ import { reactive as P, unref as f } from "../../@vue/reactivity/dist/reactivity.esm-bundler.js";
4
+ /*!
5
+ * vue-router v4.5.1
6
+ * (c) 2025 Eduardo San Martin Morote
7
+ * @license MIT
8
+ */
9
+ const K = typeof document < "u", j = () => {
10
+ }, d = Array.isArray;
11
+ function k(t) {
12
+ const e = Array.from(arguments).slice(1);
13
+ console.warn.apply(console, ["[Vue Router warn]: " + t].concat(e));
14
+ }
15
+ function A(t, e) {
16
+ return (t.aliasOf || t) === (e.aliasOf || e);
17
+ }
18
+ function B(t, e) {
19
+ if (Object.keys(t).length !== Object.keys(e).length)
20
+ return !1;
21
+ for (const n in t)
22
+ if (!T(t[n], e[n]))
23
+ return !1;
24
+ return !0;
25
+ }
26
+ function T(t, e) {
27
+ return d(t) ? _(t, e) : d(e) ? _(e, t) : t === e;
28
+ }
29
+ function _(t, e) {
30
+ return d(e) ? t.length === e.length && t.every((n, o) => n === e[o]) : t.length === 1 && t[0] === e;
31
+ }
32
+ var O;
33
+ (function(t) {
34
+ t.pop = "pop", t.push = "push";
35
+ })(O || (O = {}));
36
+ var V;
37
+ (function(t) {
38
+ t.back = "back", t.forward = "forward", t.unknown = "";
39
+ })(V || (V = {}));
40
+ function w(t) {
41
+ return typeof t == "string" || t && typeof t == "object";
42
+ }
43
+ Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
44
+ var x;
45
+ (function(t) {
46
+ t[t.aborted = 4] = "aborted", t[t.cancelled = 8] = "cancelled", t[t.duplicated = 16] = "duplicated";
47
+ })(x || (x = {}));
48
+ Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
49
+ Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
50
+ const y = Symbol(process.env.NODE_ENV !== "production" ? "router" : ""), M = Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
51
+ Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
52
+ function b(t) {
53
+ const e = v(y), n = v(M);
54
+ let o = !1, c = null;
55
+ const u = a(() => {
56
+ const r = f(t.to);
57
+ return process.env.NODE_ENV !== "production" && (!o || r !== c) && (w(r) || (o ? k(`Invalid value for prop "to" in useLink()
58
+ - to:`, r, `
59
+ - previous to:`, c, `
60
+ - props:`, t) : k(`Invalid value for prop "to" in useLink()
61
+ - to:`, r, `
62
+ - props:`, t)), c = r, o = !0), e.resolve(r);
63
+ }), s = a(() => {
64
+ const { matched: r } = u.value, { length: i } = r, h = r[i - 1], l = n.matched;
65
+ if (!h || !l.length)
66
+ return -1;
67
+ const g = l.findIndex(A.bind(null, h));
68
+ if (g > -1)
69
+ return g;
70
+ const E = S(r[i - 2]);
71
+ return (
72
+ // we are dealing with nested routes
73
+ i > 1 && // if the parent and matched route have the same path, this link is
74
+ // referring to the empty child. Or we currently are on a different
75
+ // child of the same parent
76
+ S(h) === E && // avoid comparing the child with its parent
77
+ l[l.length - 1].path !== E ? l.findIndex(A.bind(null, r[i - 2])) : g
78
+ );
79
+ }), p = a(() => s.value > -1 && H(n.params, u.value.params)), m = a(() => s.value > -1 && s.value === n.matched.length - 1 && B(n.params, u.value.params));
80
+ function R(r = {}) {
81
+ if (G(r)) {
82
+ const i = e[f(t.replace) ? "replace" : "push"](
83
+ f(t.to)
84
+ // avoid uncaught errors are they are logged anyway
85
+ ).catch(j);
86
+ return t.viewTransition && typeof document < "u" && "startViewTransition" in document && document.startViewTransition(() => i), i;
87
+ }
88
+ return Promise.resolve();
89
+ }
90
+ if (process.env.NODE_ENV !== "production" && K) {
91
+ const r = L();
92
+ if (r) {
93
+ const i = {
94
+ route: u.value,
95
+ isActive: p.value,
96
+ isExactActive: m.value,
97
+ error: null
98
+ };
99
+ r.__vrl_devtools = r.__vrl_devtools || [], r.__vrl_devtools.push(i), I(() => {
100
+ i.route = u.value, i.isActive = p.value, i.isExactActive = m.value, i.error = w(f(t.to)) ? null : 'Invalid "to" value';
101
+ }, { flush: "post" });
102
+ }
103
+ }
104
+ return {
105
+ route: u,
106
+ href: a(() => u.value.href),
107
+ isActive: p,
108
+ isExactActive: m,
109
+ navigate: R
110
+ };
111
+ }
112
+ function q(t) {
113
+ return t.length === 1 ? t[0] : t;
114
+ }
115
+ const z = /* @__PURE__ */ N({
116
+ name: "RouterLink",
117
+ compatConfig: { MODE: 3 },
118
+ props: {
119
+ to: {
120
+ type: [String, Object],
121
+ required: !0
122
+ },
123
+ replace: Boolean,
124
+ activeClass: String,
125
+ // inactiveClass: String,
126
+ exactActiveClass: String,
127
+ custom: Boolean,
128
+ ariaCurrentValue: {
129
+ type: String,
130
+ default: "page"
131
+ },
132
+ viewTransition: Boolean
133
+ },
134
+ useLink: b,
135
+ setup(t, { slots: e }) {
136
+ const n = P(b(t)), { options: o } = v(y), c = a(() => ({
137
+ [C(t.activeClass, o.linkActiveClass, "router-link-active")]: n.isActive,
138
+ // [getLinkClass(
139
+ // props.inactiveClass,
140
+ // options.linkInactiveClass,
141
+ // 'router-link-inactive'
142
+ // )]: !link.isExactActive,
143
+ [C(t.exactActiveClass, o.linkExactActiveClass, "router-link-exact-active")]: n.isExactActive
144
+ }));
145
+ return () => {
146
+ const u = e.default && q(e.default(n));
147
+ return t.custom ? u : D("a", {
148
+ "aria-current": n.isExactActive ? t.ariaCurrentValue : null,
149
+ href: n.href,
150
+ // this would override user added attrs but Vue will still add
151
+ // the listener, so we end up triggering both
152
+ onClick: n.navigate,
153
+ class: c.value
154
+ }, u);
155
+ };
156
+ }
157
+ }), W = z;
158
+ function G(t) {
159
+ if (!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey) && !t.defaultPrevented && !(t.button !== void 0 && t.button !== 0)) {
160
+ if (t.currentTarget && t.currentTarget.getAttribute) {
161
+ const e = t.currentTarget.getAttribute("target");
162
+ if (/\b_blank\b/i.test(e))
163
+ return;
164
+ }
165
+ return t.preventDefault && t.preventDefault(), !0;
166
+ }
167
+ }
168
+ function H(t, e) {
169
+ for (const n in e) {
170
+ const o = e[n], c = t[n];
171
+ if (typeof o == "string") {
172
+ if (o !== c)
173
+ return !1;
174
+ } else if (!d(c) || c.length !== o.length || o.some((u, s) => u !== c[s]))
175
+ return !1;
176
+ }
177
+ return !0;
178
+ }
179
+ function S(t) {
180
+ return t ? t.aliasOf ? t.aliasOf.path : t.path : "";
181
+ }
182
+ const C = (t, e, n) => t ?? e ?? n;
183
+ function X() {
184
+ return v(y);
185
+ }
186
+ export {
187
+ x as NavigationFailureType,
188
+ W as RouterLink,
189
+ M as routeLocationKey,
190
+ y as routerKey,
191
+ b as useLink,
192
+ X as useRouter
193
+ };
@@ -0,0 +1,2 @@
1
+ export * from './menu';
2
+ export * from './tab';
@@ -0,0 +1,15 @@
1
+ import type { UseMenuProps } from '@duxweb/dvha-core';
2
+ import type { MenuOption } from 'naive-ui';
3
+ export declare function useNaiveMenu(props?: UseMenuProps): {
4
+ data: import("vue").ComputedRef<Record<string, any>[]>;
5
+ originalData: import("vue").ComputedRef<Record<string, any>[]>;
6
+ getMenu: (hidden?: boolean) => import("@duxweb/dvha-core").IMenu[];
7
+ mainMenu: import("vue").ComputedRef<Record<string, any>[]>;
8
+ subMenu: import("vue").ComputedRef<any>;
9
+ isSubMenu: import("vue").ComputedRef<true>;
10
+ crumbs: import("vue").ComputedRef<any>;
11
+ active: import("vue").Ref<import("vue-router").RouteRecordNameGeneric, import("vue-router").RouteRecordNameGeneric>;
12
+ appActive: import("vue").Ref<import("vue-router").RouteRecordNameGeneric, import("vue-router").RouteRecordNameGeneric>;
13
+ subActive: import("vue").Ref<import("vue-router").RouteRecordNameGeneric, import("vue-router").RouteRecordNameGeneric>;
14
+ options: import("vue").ComputedRef<MenuOption[]>;
15
+ };