naive-ui-x 0.0.2 → 0.0.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.
- package/dist/es/index.js +291 -291
- package/dist/js/naive-ui.esm.js +24945 -22261
- package/dist/js/naive-ui.js +1729 -1724
- package/dist/types/components/n-view-provider/n-view-provider.vue.d.ts +63 -0
- package/dist/types/lib/cdn.d.ts +3 -0
- package/dist/types/lib/index.d.ts +3 -0
- package/dist/types/lib/sdk.d.ts +4 -0
- package/dist/types/utils/NaiveComponents.d.ts +97 -0
- package/package.json +27 -21
- package/dist/index.d.ts +0 -117
package/dist/es/index.js
CHANGED
|
@@ -1,361 +1,361 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { dateZhCN as
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
return
|
|
8
|
-
const
|
|
9
|
-
let { windowInstance:
|
|
1
|
+
import { defineComponent as K, computed as k, ref as H, onMounted as Q, openBlock as G, createBlock as U, unref as E, withCtx as A, createCommentVNode as W, createVNode as S, renderSlot as X } from "vue";
|
|
2
|
+
import { dateZhCN as Y, zhCN as ee, darkTheme as te, lightTheme as ne, useNotification as J, useMessage as Z, NConfigProvider as oe, NGlobalStyle as ae, NEl as re, NMessageProvider as le, NNotificationProvider as ie, NModalProvider as se, NDialogProvider as ce } from "naive-ui";
|
|
3
|
+
const x = "iframe", M = "window";
|
|
4
|
+
let D = null;
|
|
5
|
+
function ue() {
|
|
6
|
+
if (D)
|
|
7
|
+
return D;
|
|
8
|
+
const n = /* @__PURE__ */ new Map();
|
|
9
|
+
let { windowInstance: i, mode: s } = window.opener ? {
|
|
10
10
|
windowInstance: window.opener,
|
|
11
|
-
mode:
|
|
11
|
+
mode: M
|
|
12
12
|
} : {
|
|
13
13
|
windowInstance: window.parent,
|
|
14
|
-
mode:
|
|
14
|
+
mode: x
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const N = fe(f, p, v, w);
|
|
17
|
+
function w() {
|
|
18
|
+
return i;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
return t
|
|
20
|
+
function h(t = !1) {
|
|
21
|
+
return t && (!i || i === window.self) ? null : i;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
23
|
+
function F(t = !1) {
|
|
24
|
+
return t && (!i || i === window.self) ? null : s;
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
if (
|
|
26
|
+
function y(t) {
|
|
27
|
+
if (t?.source !== i)
|
|
27
28
|
return;
|
|
28
|
-
const { event:
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const { event: e, data: a } = t.data;
|
|
30
|
+
e && n.has(e) && n.get(e).forEach((l) => {
|
|
31
|
+
l.once && v(l);
|
|
31
32
|
try {
|
|
32
|
-
|
|
33
|
+
l.callback(a);
|
|
33
34
|
} catch {
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
function f(t, e, a = !1) {
|
|
39
|
+
n.has(t) || n.set(t, []);
|
|
40
|
+
const l = { event: t, callback: e, once: a };
|
|
41
|
+
return n.get(t).push(l), l;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
if (typeof
|
|
44
|
-
return
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
return
|
|
43
|
+
function v(t) {
|
|
44
|
+
if (typeof t == "string")
|
|
45
|
+
return n.has(t) ? (n.delete(t), !0) : !1;
|
|
46
|
+
if (n.has(t.event)) {
|
|
47
|
+
const e = n.get(t.event).indexOf(t);
|
|
48
|
+
if (e !== -1)
|
|
49
|
+
return n.get(t.event).splice(e, 1), !0;
|
|
49
50
|
}
|
|
50
51
|
return !1;
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
53
|
+
function g(t, e) {
|
|
54
|
+
return f(t, e, !0);
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
return !
|
|
56
|
+
function p(t, e = null) {
|
|
57
|
+
return !i || i === window ? !1 : (e && O(e) && (e = T(e)), i.postMessage({ event: t, data: e }, "*"), !0);
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
else
|
|
67
|
-
try {
|
|
68
|
-
let a = r(c);
|
|
69
|
-
a && V(a) && (a = y(a)), _(l, {
|
|
70
|
-
data: a,
|
|
71
|
-
error: null
|
|
59
|
+
function m(t, e) {
|
|
60
|
+
return f(t, ({ event: a, data: l }) => {
|
|
61
|
+
if (typeof e == "function")
|
|
62
|
+
if (e.constructor.name === "AsyncFunction")
|
|
63
|
+
e(l).then((o) => {
|
|
64
|
+
o && O(o) && (o = T(o)), p(a, { _data: o, error: null });
|
|
65
|
+
}).catch((o) => {
|
|
66
|
+
p(a, { data: null, error: o });
|
|
72
67
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
else
|
|
69
|
+
try {
|
|
70
|
+
let o = e(l);
|
|
71
|
+
o && O(o) && (o = T(o)), p(a, {
|
|
72
|
+
data: o,
|
|
73
|
+
error: null
|
|
74
|
+
});
|
|
75
|
+
} catch (o) {
|
|
76
|
+
p(a, { data: null, error: o });
|
|
77
|
+
}
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
|
-
async function
|
|
79
|
-
if ((!
|
|
80
|
+
async function L(t, e = null, a = 5e3, l = 100) {
|
|
81
|
+
if ((!a || a <= 0) && (a = 5e3), (!a || a <= 0) && (a = 5e3), (!l || l < 0) && (l = 100), !i || i === window)
|
|
80
82
|
return Promise.reject("No window instance");
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
e && O(e) && (e = T(e));
|
|
84
|
+
const o = Date.now(), P = Math.random().toString(), C = `callback_event_${t}${o}_${P}`;
|
|
85
|
+
i.postMessage({ event: t, data: { event: C, data: e } }, "*");
|
|
86
|
+
let I = "__null__", $ = null;
|
|
87
|
+
f(C, ({ data: j, error: z }) => {
|
|
88
|
+
I = j, $ = z;
|
|
87
89
|
}, !0);
|
|
88
|
-
const
|
|
89
|
-
return new Promise((
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
},
|
|
90
|
+
const q = Date.now() + a;
|
|
91
|
+
return new Promise((j, z) => {
|
|
92
|
+
const B = setInterval(() => {
|
|
93
|
+
$ ? (clearInterval(B), z($)) : I !== "__null__" ? (clearInterval(B), j(I)) : Date.now() >= q && (clearInterval(B), z("Call timed out " + a + "ms"));
|
|
94
|
+
}, l);
|
|
93
95
|
});
|
|
94
96
|
}
|
|
95
|
-
function
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
function b(t) {
|
|
98
|
+
if (typeof t != "function")
|
|
99
|
+
return () => {
|
|
100
|
+
};
|
|
101
|
+
let e = null, a = null;
|
|
102
|
+
return s === M && (t.constructor.name === "AsyncFunction" ? e = async function(l) {
|
|
103
|
+
const o = await t();
|
|
104
|
+
if (o)
|
|
105
|
+
return l.preventDefault(), l.returnValue = o, o;
|
|
106
|
+
} : e = function(l) {
|
|
102
107
|
try {
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
105
|
-
return
|
|
108
|
+
const o = t();
|
|
109
|
+
if (o)
|
|
110
|
+
return l.preventDefault(), l.returnValue = o, o;
|
|
106
111
|
} catch {
|
|
107
112
|
}
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
}, window.history.pushState({}, "", ""), window.addEventListener("popstate",
|
|
111
|
-
|
|
113
|
+
}, a = function() {
|
|
114
|
+
s === M && window.history.length === 2 && (window.history.pushState({}, "", ""), _());
|
|
115
|
+
}, window.history.pushState({}, "", ""), window.addEventListener("popstate", a), window.addEventListener("beforeunload", e)), s === x && (e = m("close", t)), () => {
|
|
116
|
+
s === M && e && window.removeEventListener("beforeunload", e), s === x && e && v(e), a && window.removeEventListener("popstate", a);
|
|
112
117
|
};
|
|
113
118
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
v && (clearTimeout(v), v = null), v = setTimeout(() => {
|
|
117
|
-
n === T && window.close(), n === C && _("onClose"), v = null;
|
|
118
|
-
}, i);
|
|
119
|
+
function V(t) {
|
|
120
|
+
return b(t);
|
|
119
121
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
let R = null;
|
|
123
|
+
function _(t = 300) {
|
|
124
|
+
R && (clearTimeout(R), R = null), R = setTimeout(() => {
|
|
125
|
+
s === M && window.close(), s === x && p("onClose"), R = null;
|
|
126
|
+
}, t);
|
|
122
127
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
function V(e) {
|
|
126
|
-
return typeof e != "object" ? !1 : (e == null ? void 0 : e.__v_raw) !== void 0 || (e == null ? void 0 : e.__v_isRef) !== void 0 || (e == null ? void 0 : e.__v_isShallow) !== void 0 || (e == null ? void 0 : e.__v_isReadonly) !== void 0 || (e == null ? void 0 : e.__ob__) !== void 0;
|
|
127
|
-
}
|
|
128
|
-
function y(e) {
|
|
129
|
-
if (e === null || typeof e != "object")
|
|
130
|
-
return e;
|
|
131
|
-
let t;
|
|
132
|
-
if (Array.isArray(e)) {
|
|
133
|
-
t = [];
|
|
134
|
-
for (let n = 0, u = e.length; n < u; n++)
|
|
135
|
-
t[n] = y(e[n]);
|
|
136
|
-
} else {
|
|
137
|
-
t = {};
|
|
138
|
-
for (let n in e)
|
|
139
|
-
e.hasOwnProperty(n) && (t[n] = y(e[n]));
|
|
128
|
+
function u() {
|
|
129
|
+
N.destroy(), window.removeEventListener("message", y), D = null, n?.clear && n.clear();
|
|
140
130
|
}
|
|
141
|
-
|
|
131
|
+
const { sendFile: r, onReceiveFile: c, manageFiles: d } = N;
|
|
132
|
+
return window.addEventListener("message", y), D = { on: f, ononce: g, onclose: b, onClose: V, off: v, emit: p, register: m, call: L, close: _, destroy: u, getWindow: w, getMode: F, getParent: h, sendFile: r, onReceiveFile: c, manageFiles: d }, D;
|
|
142
133
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return L;
|
|
134
|
+
function de() {
|
|
135
|
+
return ue();
|
|
146
136
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
149
|
-
let
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
u
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
137
|
+
function fe(n, i, s, N) {
|
|
138
|
+
const w = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Set(), F = 1e4, y = 6e4;
|
|
139
|
+
let f = null, v = !1, g = [];
|
|
140
|
+
const p = () => {
|
|
141
|
+
if (v) return;
|
|
142
|
+
v = !0;
|
|
143
|
+
const _ = () => {
|
|
144
|
+
f || (f = setInterval(() => {
|
|
145
|
+
const u = Date.now();
|
|
146
|
+
for (const [r, c] of w)
|
|
147
|
+
u - c.lastActive > y && w.delete(r);
|
|
148
|
+
w.size === 0 && (clearInterval(f), f = null);
|
|
149
|
+
}, F));
|
|
150
|
+
};
|
|
151
|
+
g.push(n("__FILE_TRANSFER_START__", (u) => {
|
|
152
|
+
w.set(u.id, {
|
|
153
|
+
chunks: new Array(u.totalChunks),
|
|
154
|
+
received: 0,
|
|
155
|
+
metadata: u,
|
|
156
|
+
lastActive: Date.now()
|
|
157
|
+
}), _();
|
|
158
|
+
})), g.push(n("__FILE_TRANSFER_CHUNK__", ({ id: u, index: r, data: c }) => {
|
|
159
|
+
const d = w.get(u);
|
|
160
|
+
d && (d.chunks[r] = c, d.received++, d.lastActive = Date.now());
|
|
161
|
+
})), g.push(n("__FILE_TRANSFER_END__", async ({ id: u }) => {
|
|
162
|
+
const r = w.get(u);
|
|
163
|
+
if (r && r.received === r.metadata.totalChunks)
|
|
164
|
+
try {
|
|
165
|
+
const c = new File(r.chunks, r.metadata.name, { type: r.metadata.type });
|
|
166
|
+
for (const d of h)
|
|
167
|
+
try {
|
|
168
|
+
d && typeof d == "function" && (d.constructor.name === "AsyncFunction" ? await d(c, r.metadata) : d(c, r.metadata));
|
|
169
|
+
} catch {
|
|
170
|
+
}
|
|
171
|
+
} finally {
|
|
172
|
+
w.delete(u);
|
|
173
|
+
}
|
|
174
|
+
})), g.push(n("__FILE_TRANSFER_ERROR__", ({ id: u }) => {
|
|
175
|
+
w.delete(u);
|
|
176
|
+
}));
|
|
177
|
+
}, m = () => {
|
|
178
|
+
v && (g.forEach((_) => s(_)), g = [], v = !1, f && (clearInterval(f), f = null), w.clear());
|
|
168
179
|
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return u.size > 0 ? o + "?" + u.toString() : o;
|
|
176
|
-
} catch {
|
|
177
|
-
return u.size > 0 ? e + "?" + u.toString() : e;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function fe(e) {
|
|
181
|
-
var t, n;
|
|
182
|
-
if (window.opener) {
|
|
183
|
-
if ((e == null ? void 0 : e.duration) === 0)
|
|
184
|
-
return;
|
|
185
|
-
if ((!(e != null && e.duration) || (e == null ? void 0 : e.duration) <= 0) && (e.duration = 2e3), !(e != null && e.type)) {
|
|
186
|
-
if (!((t = window == null ? void 0 : window.naive) != null && t.message)) {
|
|
187
|
-
setTimeout(() => {
|
|
188
|
-
window.naive.message.destroyAll();
|
|
189
|
-
}, 100);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
window.naive.message.destroyAll();
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (e.type !== "info" && e.type !== "warning" && e.type !== "error" && e.type !== "success")
|
|
196
|
-
return;
|
|
180
|
+
async function L(_, u = null, r = 1024 * 1024) {
|
|
181
|
+
const c = N();
|
|
182
|
+
if (!c || c === window)
|
|
183
|
+
return Promise.reject("No window instance");
|
|
184
|
+
const d = Math.random().toString(36).substring(2) + Date.now(), t = _.name || "blob", e = _.type, a = _.size, l = Math.ceil(a / r);
|
|
185
|
+
i("__FILE_TRANSFER_START__", { id: d, name: t, type: e, size: a, totalChunks: l });
|
|
197
186
|
try {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
187
|
+
for (let o = 0; o < l; o++) {
|
|
188
|
+
const P = o * r, C = Math.min(P + r, a), I = await _.slice(P, C).arrayBuffer();
|
|
189
|
+
if (c.postMessage({
|
|
190
|
+
event: "__FILE_TRANSFER_CHUNK__",
|
|
191
|
+
data: { id: d, index: o, data: I }
|
|
192
|
+
}, "*", [I]), u && typeof u == "function")
|
|
193
|
+
try {
|
|
194
|
+
u.constructor.name === "AsyncFunction" ? await u((o + 1) / l, d) : u((o + 1) / l, d);
|
|
195
|
+
} catch {
|
|
196
|
+
}
|
|
203
197
|
}
|
|
204
|
-
|
|
205
|
-
} catch {
|
|
198
|
+
return i("__FILE_TRANSFER_END__", { id: d }), d;
|
|
199
|
+
} catch (o) {
|
|
200
|
+
throw i("__FILE_TRANSFER_ERROR__", { id: d, error: o.message || o.toString() }), o;
|
|
206
201
|
}
|
|
207
|
-
return;
|
|
208
202
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
return;
|
|
203
|
+
function b(_) {
|
|
204
|
+
return typeof _ != "function" ? () => {
|
|
205
|
+
} : (h.add(_), p(), () => {
|
|
206
|
+
h.delete(_), h.size === 0 && m();
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
function V(_ = 3e4, u = 1e4) {
|
|
210
|
+
const r = /* @__PURE__ */ new Map();
|
|
211
|
+
let c = null;
|
|
212
|
+
const d = () => {
|
|
213
|
+
c || (c = setInterval(() => {
|
|
214
|
+
const e = Date.now();
|
|
215
|
+
for (const [a, l] of r)
|
|
216
|
+
e - l.timestamp > _ && r.delete(a);
|
|
217
|
+
r.size === 0 && (clearInterval(c), c = null);
|
|
218
|
+
}, u));
|
|
219
|
+
}, t = b((e, a) => {
|
|
220
|
+
r.set(a.id, {
|
|
221
|
+
file: e,
|
|
222
|
+
timestamp: Date.now()
|
|
223
|
+
}), d();
|
|
224
|
+
});
|
|
225
|
+
return {
|
|
226
|
+
get: (e) => r.get(e)?.file || null,
|
|
227
|
+
take: (e) => {
|
|
228
|
+
const a = r.get(e);
|
|
229
|
+
return a ? (r.delete(e), r.size === 0 && c && (clearInterval(c), c = null), a.file) : null;
|
|
230
|
+
},
|
|
231
|
+
has: (e) => r.has(e),
|
|
232
|
+
destroy: () => {
|
|
233
|
+
c && (clearInterval(c), c = null), t(), r.clear();
|
|
236
234
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function R() {
|
|
238
|
+
f && (clearInterval(f), f = null), w.clear(), h.clear();
|
|
241
239
|
}
|
|
242
|
-
L
|
|
243
|
-
}).catch(() => {
|
|
244
|
-
});
|
|
240
|
+
return { sendFile: L, onReceiveFile: b, manageFiles: V, destroy: R };
|
|
245
241
|
}
|
|
246
|
-
function
|
|
247
|
-
return
|
|
242
|
+
function O(n) {
|
|
243
|
+
return typeof n != "object" ? !1 : n?.__v_raw !== void 0 || n?.__v_isRef !== void 0 || n?.__v_isShallow !== void 0 || n?.__v_isReadonly !== void 0 || n?.__ob__ !== void 0;
|
|
248
244
|
}
|
|
249
|
-
function
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
245
|
+
function T(n) {
|
|
246
|
+
if (n === null || typeof n != "object")
|
|
247
|
+
return n;
|
|
248
|
+
let i;
|
|
249
|
+
if (Array.isArray(n)) {
|
|
250
|
+
i = [];
|
|
251
|
+
for (let s = 0, N = n.length; s < N; s++)
|
|
252
|
+
i[s] = T(n[s]);
|
|
253
|
+
} else {
|
|
254
|
+
i = {};
|
|
255
|
+
for (let s in n)
|
|
256
|
+
n.hasOwnProperty(s) && (i[s] = T(n[s]));
|
|
257
|
+
}
|
|
258
|
+
return i;
|
|
253
259
|
}
|
|
254
|
-
const
|
|
260
|
+
const we = de();
|
|
261
|
+
function _e() {
|
|
262
|
+
return we;
|
|
263
|
+
}
|
|
264
|
+
const he = /* @__PURE__ */ K({
|
|
255
265
|
__name: "n-view-provider",
|
|
256
266
|
props: {
|
|
257
|
-
locale: { default:
|
|
258
|
-
dateLocale: { default:
|
|
267
|
+
locale: { default: ee },
|
|
268
|
+
dateLocale: { default: Y },
|
|
259
269
|
breakpoints: { default: null }
|
|
260
270
|
},
|
|
261
271
|
emits: ["init", "theme"],
|
|
262
|
-
setup(
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
mode:
|
|
267
|
-
view:
|
|
268
|
-
theme_style:
|
|
269
|
-
theme_name:
|
|
270
|
-
theme_overrides:
|
|
272
|
+
setup(n, { emit: i }) {
|
|
273
|
+
const s = n, N = i, w = k(() => window.opener ? "window" : "iframe"), h = H("light"), F = H(!0), y = _e(), f = k(() => h.value === "dark" ? te : ne), v = H({});
|
|
274
|
+
y.on("onTheme", (m) => {
|
|
275
|
+
h.value = m.name, v.value = m.overrides, N("theme", {
|
|
276
|
+
mode: w,
|
|
277
|
+
view: y,
|
|
278
|
+
theme_style: f,
|
|
279
|
+
theme_name: k(() => h.value),
|
|
280
|
+
theme_overrides: k(() => v.value)
|
|
271
281
|
});
|
|
272
282
|
});
|
|
273
|
-
const
|
|
283
|
+
const g = K({
|
|
274
284
|
name: "NPreViewProvider",
|
|
275
285
|
setup() {
|
|
276
|
-
return window.naive ? (window.naive.message =
|
|
277
|
-
message:
|
|
278
|
-
notification:
|
|
286
|
+
return window.naive ? (window.naive.message = Z(), window.naive.notification = J()) : window.naive = {
|
|
287
|
+
message: Z(),
|
|
288
|
+
notification: J()
|
|
279
289
|
}, {};
|
|
280
290
|
},
|
|
281
291
|
render() {
|
|
282
292
|
return null;
|
|
283
293
|
}
|
|
284
294
|
});
|
|
285
|
-
function
|
|
286
|
-
|
|
287
|
-
let
|
|
288
|
-
if (
|
|
295
|
+
function p() {
|
|
296
|
+
h.value = window.localStorage.getItem("theme") || "light";
|
|
297
|
+
let m = window.localStorage.getItem("themeOverrides");
|
|
298
|
+
if (m)
|
|
289
299
|
try {
|
|
290
|
-
|
|
300
|
+
v.value = JSON.parse(m);
|
|
291
301
|
} catch {
|
|
292
302
|
}
|
|
293
|
-
|
|
303
|
+
F.value = !1;
|
|
294
304
|
}
|
|
295
|
-
return
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}).catch((
|
|
299
|
-
|
|
300
|
-
}) :
|
|
301
|
-
mode:
|
|
302
|
-
view:
|
|
303
|
-
theme_style:
|
|
304
|
-
theme_name:
|
|
305
|
-
theme_overrides:
|
|
305
|
+
return Q(() => {
|
|
306
|
+
y.getParent() ? y.call("getTheme", null, 500).then((m) => {
|
|
307
|
+
h.value = m.name, v.value = m.overrides, F.value = !1;
|
|
308
|
+
}).catch((m) => {
|
|
309
|
+
p();
|
|
310
|
+
}) : p(), N("init", {
|
|
311
|
+
mode: w,
|
|
312
|
+
view: y,
|
|
313
|
+
theme_style: f,
|
|
314
|
+
theme_name: k(() => h.value),
|
|
315
|
+
theme_overrides: k(() => v.value)
|
|
306
316
|
});
|
|
307
|
-
}), (
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
default
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
_: 3
|
|
348
|
-
}, 8, ["theme", "theme-overrides", "locale", "date-locale", "breakpoints"]));
|
|
349
|
-
};
|
|
317
|
+
}), (m, L) => F.value ? W("", !0) : (G(), U(E(oe), {
|
|
318
|
+
key: 0,
|
|
319
|
+
theme: f.value,
|
|
320
|
+
"theme-overrides": v.value,
|
|
321
|
+
locale: s.locale,
|
|
322
|
+
"date-locale": s.dateLocale,
|
|
323
|
+
breakpoints: s.breakpoints
|
|
324
|
+
}, {
|
|
325
|
+
default: A(() => [
|
|
326
|
+
w.value == "window" ? (G(), U(E(ae), { key: 0 })) : W("", !0),
|
|
327
|
+
S(E(re), null, {
|
|
328
|
+
default: A(() => [
|
|
329
|
+
S(E(le), null, {
|
|
330
|
+
default: A(() => [
|
|
331
|
+
S(E(ie), null, {
|
|
332
|
+
default: A(() => [
|
|
333
|
+
S(E(se), null, {
|
|
334
|
+
default: A(() => [
|
|
335
|
+
S(E(ce), null, {
|
|
336
|
+
default: A(() => [
|
|
337
|
+
S(E(g)),
|
|
338
|
+
X(m.$slots, "default")
|
|
339
|
+
]),
|
|
340
|
+
_: 3
|
|
341
|
+
})
|
|
342
|
+
]),
|
|
343
|
+
_: 3
|
|
344
|
+
})
|
|
345
|
+
]),
|
|
346
|
+
_: 3
|
|
347
|
+
})
|
|
348
|
+
]),
|
|
349
|
+
_: 3
|
|
350
|
+
})
|
|
351
|
+
]),
|
|
352
|
+
_: 3
|
|
353
|
+
})
|
|
354
|
+
]),
|
|
355
|
+
_: 3
|
|
356
|
+
}, 8, ["theme", "theme-overrides", "locale", "date-locale", "breakpoints"]));
|
|
350
357
|
}
|
|
351
358
|
});
|
|
352
359
|
export {
|
|
353
|
-
|
|
354
|
-
se as deepClone,
|
|
355
|
-
ie as deepMerge,
|
|
356
|
-
ce as getRequestBaseURL,
|
|
357
|
-
fe as message,
|
|
358
|
-
oe as notification,
|
|
359
|
-
ue as useOnline,
|
|
360
|
-
te as useViewEvent
|
|
360
|
+
he as NViewProvider
|
|
361
361
|
};
|