@cnc_cbz/usefultools-plugin-official 1.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.
- package/README.md +56 -0
- package/dist/base-converter.mjs +333 -0
- package/dist/case-converter.mjs +142 -0
- package/dist/chmod-calculator.mjs +286 -0
- package/dist/color-converter.mjs +211 -0
- package/dist/cron-expression.mjs +487 -0
- package/dist/cyber-chef.mjs +24885 -0
- package/dist/hash-generator.mjs +239 -0
- package/dist/html-entity.mjs +187 -0
- package/dist/image-compressor.mjs +337 -0
- package/dist/ip-subnet.mjs +222 -0
- package/dist/js-runner.mjs +39973 -0
- package/dist/json-diff.mjs +704 -0
- package/dist/json-formatter.mjs +1138 -0
- package/dist/json-yaml.mjs +256 -0
- package/dist/jwt-parser.mjs +405 -0
- package/dist/lorem-ipsum.mjs +246 -0
- package/dist/markdown-preview.mjs +184 -0
- package/dist/password-generator.mjs +254 -0
- package/dist/qr-generator.mjs +238 -0
- package/dist/regex-tester.mjs +424 -0
- package/dist/sql-formatter.mjs +242 -0
- package/dist/text-diff.mjs +940 -0
- package/dist/text-stats.mjs +205 -0
- package/dist/timestamp-converter.mjs +339 -0
- package/dist/translator.mjs +667 -0
- package/dist/url-codec.mjs +179 -0
- package/dist/uuid-generator.mjs +165 -0
- package/package.json +56 -0
- package/plugin.json +31 -0
|
@@ -0,0 +1,1138 @@
|
|
|
1
|
+
import * as e from "vue";
|
|
2
|
+
import { defineComponent, ref, computed, openBlock, createElementBlock, createCommentVNode, createElementVNode, createTextVNode, toDisplayString, withDirectives, vModelText, vModelCheckbox, vModelSelect, createBlock, unref } from "vue";
|
|
3
|
+
var t = { 207: (e2, t2, n2) => {
|
|
4
|
+
e2.exports = n2(452);
|
|
5
|
+
}, 452: (e2) => {
|
|
6
|
+
var t2 = (function(e3) {
|
|
7
|
+
var t3, n2 = Object.prototype, r2 = n2.hasOwnProperty, o2 = "function" == typeof Symbol ? Symbol : {}, a2 = o2.iterator || "@@iterator", i2 = o2.asyncIterator || "@@asyncIterator", c2 = o2.toStringTag || "@@toStringTag";
|
|
8
|
+
function l2(e4, t4, n3) {
|
|
9
|
+
return Object.defineProperty(e4, t4, { value: n3, enumerable: true, configurable: true, writable: true }), e4[t4];
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
l2({}, "");
|
|
13
|
+
} catch (e4) {
|
|
14
|
+
l2 = function(e5, t4, n3) {
|
|
15
|
+
return e5[t4] = n3;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function u2(e4, t4, n3, r3) {
|
|
19
|
+
var o3 = t4 && t4.prototype instanceof y2 ? t4 : y2, a3 = Object.create(o3.prototype), i3 = new V2(r3 || []);
|
|
20
|
+
return a3._invoke = /* @__PURE__ */ (function(e5, t5, n4) {
|
|
21
|
+
var r4 = s2;
|
|
22
|
+
return function(o4, a4) {
|
|
23
|
+
if (r4 === f2) throw new Error("Generator is already running");
|
|
24
|
+
if (r4 === p2) {
|
|
25
|
+
if ("throw" === o4) throw a4;
|
|
26
|
+
return P2();
|
|
27
|
+
}
|
|
28
|
+
for (n4.method = o4, n4.arg = a4; ; ) {
|
|
29
|
+
var i4 = n4.delegate;
|
|
30
|
+
if (i4) {
|
|
31
|
+
var c3 = j2(i4, n4);
|
|
32
|
+
if (c3) {
|
|
33
|
+
if (c3 === v2) continue;
|
|
34
|
+
return c3;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if ("next" === n4.method) n4.sent = n4._sent = n4.arg;
|
|
38
|
+
else if ("throw" === n4.method) {
|
|
39
|
+
if (r4 === s2) throw r4 = p2, n4.arg;
|
|
40
|
+
n4.dispatchException(n4.arg);
|
|
41
|
+
} else "return" === n4.method && n4.abrupt("return", n4.arg);
|
|
42
|
+
r4 = f2;
|
|
43
|
+
var l3 = d2(e5, t5, n4);
|
|
44
|
+
if ("normal" === l3.type) {
|
|
45
|
+
if (r4 = n4.done ? p2 : h2, l3.arg === v2) continue;
|
|
46
|
+
return { value: l3.arg, done: n4.done };
|
|
47
|
+
}
|
|
48
|
+
"throw" === l3.type && (r4 = p2, n4.method = "throw", n4.arg = l3.arg);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
})(e4, n3, i3), a3;
|
|
52
|
+
}
|
|
53
|
+
function d2(e4, t4, n3) {
|
|
54
|
+
try {
|
|
55
|
+
return { type: "normal", arg: e4.call(t4, n3) };
|
|
56
|
+
} catch (e5) {
|
|
57
|
+
return { type: "throw", arg: e5 };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
e3.wrap = u2;
|
|
61
|
+
var s2 = "suspendedStart", h2 = "suspendedYield", f2 = "executing", p2 = "completed", v2 = {};
|
|
62
|
+
function y2() {
|
|
63
|
+
}
|
|
64
|
+
function g2() {
|
|
65
|
+
}
|
|
66
|
+
function m2() {
|
|
67
|
+
}
|
|
68
|
+
var b2 = {};
|
|
69
|
+
l2(b2, a2, (function() {
|
|
70
|
+
return this;
|
|
71
|
+
}));
|
|
72
|
+
var w2 = Object.getPrototypeOf, N2 = w2 && w2(w2(L2([])));
|
|
73
|
+
N2 && N2 !== n2 && r2.call(N2, a2) && (b2 = N2);
|
|
74
|
+
var k2 = m2.prototype = y2.prototype = Object.create(b2);
|
|
75
|
+
function C2(e4) {
|
|
76
|
+
["next", "throw", "return"].forEach((function(t4) {
|
|
77
|
+
l2(e4, t4, (function(e5) {
|
|
78
|
+
return this._invoke(t4, e5);
|
|
79
|
+
}));
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
function x2(e4, t4) {
|
|
83
|
+
function n3(o4, a3, i3, c3) {
|
|
84
|
+
var l3 = d2(e4[o4], e4, a3);
|
|
85
|
+
if ("throw" !== l3.type) {
|
|
86
|
+
var u3 = l3.arg, s3 = u3.value;
|
|
87
|
+
return s3 && "object" == typeof s3 && r2.call(s3, "__await") ? t4.resolve(s3.__await).then((function(e5) {
|
|
88
|
+
n3("next", e5, i3, c3);
|
|
89
|
+
}), (function(e5) {
|
|
90
|
+
n3("throw", e5, i3, c3);
|
|
91
|
+
})) : t4.resolve(s3).then((function(e5) {
|
|
92
|
+
u3.value = e5, i3(u3);
|
|
93
|
+
}), (function(e5) {
|
|
94
|
+
return n3("throw", e5, i3, c3);
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
c3(l3.arg);
|
|
98
|
+
}
|
|
99
|
+
var o3;
|
|
100
|
+
this._invoke = function(e5, r3) {
|
|
101
|
+
function a3() {
|
|
102
|
+
return new t4((function(t5, o4) {
|
|
103
|
+
n3(e5, r3, t5, o4);
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
return o3 = o3 ? o3.then(a3, a3) : a3();
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function j2(e4, n3) {
|
|
110
|
+
var r3 = e4.iterator[n3.method];
|
|
111
|
+
if (r3 === t3) {
|
|
112
|
+
if (n3.delegate = null, "throw" === n3.method) {
|
|
113
|
+
if (e4.iterator.return && (n3.method = "return", n3.arg = t3, j2(e4, n3), "throw" === n3.method)) return v2;
|
|
114
|
+
n3.method = "throw", n3.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
115
|
+
}
|
|
116
|
+
return v2;
|
|
117
|
+
}
|
|
118
|
+
var o3 = d2(r3, e4.iterator, n3.arg);
|
|
119
|
+
if ("throw" === o3.type) return n3.method = "throw", n3.arg = o3.arg, n3.delegate = null, v2;
|
|
120
|
+
var a3 = o3.arg;
|
|
121
|
+
return a3 ? a3.done ? (n3[e4.resultName] = a3.value, n3.next = e4.nextLoc, "return" !== n3.method && (n3.method = "next", n3.arg = t3), n3.delegate = null, v2) : a3 : (n3.method = "throw", n3.arg = new TypeError("iterator result is not an object"), n3.delegate = null, v2);
|
|
122
|
+
}
|
|
123
|
+
function S2(e4) {
|
|
124
|
+
var t4 = { tryLoc: e4[0] };
|
|
125
|
+
1 in e4 && (t4.catchLoc = e4[1]), 2 in e4 && (t4.finallyLoc = e4[2], t4.afterLoc = e4[3]), this.tryEntries.push(t4);
|
|
126
|
+
}
|
|
127
|
+
function O2(e4) {
|
|
128
|
+
var t4 = e4.completion || {};
|
|
129
|
+
t4.type = "normal", delete t4.arg, e4.completion = t4;
|
|
130
|
+
}
|
|
131
|
+
function V2(e4) {
|
|
132
|
+
this.tryEntries = [{ tryLoc: "root" }], e4.forEach(S2, this), this.reset(true);
|
|
133
|
+
}
|
|
134
|
+
function L2(e4) {
|
|
135
|
+
if (e4) {
|
|
136
|
+
var n3 = e4[a2];
|
|
137
|
+
if (n3) return n3.call(e4);
|
|
138
|
+
if ("function" == typeof e4.next) return e4;
|
|
139
|
+
if (!isNaN(e4.length)) {
|
|
140
|
+
var o3 = -1, i3 = function n4() {
|
|
141
|
+
for (; ++o3 < e4.length; ) if (r2.call(e4, o3)) return n4.value = e4[o3], n4.done = false, n4;
|
|
142
|
+
return n4.value = t3, n4.done = true, n4;
|
|
143
|
+
};
|
|
144
|
+
return i3.next = i3;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return { next: P2 };
|
|
148
|
+
}
|
|
149
|
+
function P2() {
|
|
150
|
+
return { value: t3, done: true };
|
|
151
|
+
}
|
|
152
|
+
return g2.prototype = m2, l2(k2, "constructor", m2), l2(m2, "constructor", g2), g2.displayName = l2(m2, c2, "GeneratorFunction"), e3.isGeneratorFunction = function(e4) {
|
|
153
|
+
var t4 = "function" == typeof e4 && e4.constructor;
|
|
154
|
+
return !!t4 && (t4 === g2 || "GeneratorFunction" === (t4.displayName || t4.name));
|
|
155
|
+
}, e3.mark = function(e4) {
|
|
156
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e4, m2) : (e4.__proto__ = m2, l2(e4, c2, "GeneratorFunction")), e4.prototype = Object.create(k2), e4;
|
|
157
|
+
}, e3.awrap = function(e4) {
|
|
158
|
+
return { __await: e4 };
|
|
159
|
+
}, C2(x2.prototype), l2(x2.prototype, i2, (function() {
|
|
160
|
+
return this;
|
|
161
|
+
})), e3.AsyncIterator = x2, e3.async = function(t4, n3, r3, o3, a3) {
|
|
162
|
+
void 0 === a3 && (a3 = Promise);
|
|
163
|
+
var i3 = new x2(u2(t4, n3, r3, o3), a3);
|
|
164
|
+
return e3.isGeneratorFunction(n3) ? i3 : i3.next().then((function(e4) {
|
|
165
|
+
return e4.done ? e4.value : i3.next();
|
|
166
|
+
}));
|
|
167
|
+
}, C2(k2), l2(k2, c2, "Generator"), l2(k2, a2, (function() {
|
|
168
|
+
return this;
|
|
169
|
+
})), l2(k2, "toString", (function() {
|
|
170
|
+
return "[object Generator]";
|
|
171
|
+
})), e3.keys = function(e4) {
|
|
172
|
+
var t4 = [];
|
|
173
|
+
for (var n3 in e4) t4.push(n3);
|
|
174
|
+
return t4.reverse(), function n4() {
|
|
175
|
+
for (; t4.length; ) {
|
|
176
|
+
var r3 = t4.pop();
|
|
177
|
+
if (r3 in e4) return n4.value = r3, n4.done = false, n4;
|
|
178
|
+
}
|
|
179
|
+
return n4.done = true, n4;
|
|
180
|
+
};
|
|
181
|
+
}, e3.values = L2, V2.prototype = { constructor: V2, reset: function(e4) {
|
|
182
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t3, this.done = false, this.delegate = null, this.method = "next", this.arg = t3, this.tryEntries.forEach(O2), !e4) for (var n3 in this) "t" === n3.charAt(0) && r2.call(this, n3) && !isNaN(+n3.slice(1)) && (this[n3] = t3);
|
|
183
|
+
}, stop: function() {
|
|
184
|
+
this.done = true;
|
|
185
|
+
var e4 = this.tryEntries[0].completion;
|
|
186
|
+
if ("throw" === e4.type) throw e4.arg;
|
|
187
|
+
return this.rval;
|
|
188
|
+
}, dispatchException: function(e4) {
|
|
189
|
+
if (this.done) throw e4;
|
|
190
|
+
var n3 = this;
|
|
191
|
+
function o3(r3, o4) {
|
|
192
|
+
return c3.type = "throw", c3.arg = e4, n3.next = r3, o4 && (n3.method = "next", n3.arg = t3), !!o4;
|
|
193
|
+
}
|
|
194
|
+
for (var a3 = this.tryEntries.length - 1; a3 >= 0; --a3) {
|
|
195
|
+
var i3 = this.tryEntries[a3], c3 = i3.completion;
|
|
196
|
+
if ("root" === i3.tryLoc) return o3("end");
|
|
197
|
+
if (i3.tryLoc <= this.prev) {
|
|
198
|
+
var l3 = r2.call(i3, "catchLoc"), u3 = r2.call(i3, "finallyLoc");
|
|
199
|
+
if (l3 && u3) {
|
|
200
|
+
if (this.prev < i3.catchLoc) return o3(i3.catchLoc, true);
|
|
201
|
+
if (this.prev < i3.finallyLoc) return o3(i3.finallyLoc);
|
|
202
|
+
} else if (l3) {
|
|
203
|
+
if (this.prev < i3.catchLoc) return o3(i3.catchLoc, true);
|
|
204
|
+
} else {
|
|
205
|
+
if (!u3) throw new Error("try statement without catch or finally");
|
|
206
|
+
if (this.prev < i3.finallyLoc) return o3(i3.finallyLoc);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}, abrupt: function(e4, t4) {
|
|
211
|
+
for (var n3 = this.tryEntries.length - 1; n3 >= 0; --n3) {
|
|
212
|
+
var o3 = this.tryEntries[n3];
|
|
213
|
+
if (o3.tryLoc <= this.prev && r2.call(o3, "finallyLoc") && this.prev < o3.finallyLoc) {
|
|
214
|
+
var a3 = o3;
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
a3 && ("break" === e4 || "continue" === e4) && a3.tryLoc <= t4 && t4 <= a3.finallyLoc && (a3 = null);
|
|
219
|
+
var i3 = a3 ? a3.completion : {};
|
|
220
|
+
return i3.type = e4, i3.arg = t4, a3 ? (this.method = "next", this.next = a3.finallyLoc, v2) : this.complete(i3);
|
|
221
|
+
}, complete: function(e4, t4) {
|
|
222
|
+
if ("throw" === e4.type) throw e4.arg;
|
|
223
|
+
return "break" === e4.type || "continue" === e4.type ? this.next = e4.arg : "return" === e4.type ? (this.rval = this.arg = e4.arg, this.method = "return", this.next = "end") : "normal" === e4.type && t4 && (this.next = t4), v2;
|
|
224
|
+
}, finish: function(e4) {
|
|
225
|
+
for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
|
|
226
|
+
var n3 = this.tryEntries[t4];
|
|
227
|
+
if (n3.finallyLoc === e4) return this.complete(n3.completion, n3.afterLoc), O2(n3), v2;
|
|
228
|
+
}
|
|
229
|
+
}, catch: function(e4) {
|
|
230
|
+
for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
|
|
231
|
+
var n3 = this.tryEntries[t4];
|
|
232
|
+
if (n3.tryLoc === e4) {
|
|
233
|
+
var r3 = n3.completion;
|
|
234
|
+
if ("throw" === r3.type) {
|
|
235
|
+
var o3 = r3.arg;
|
|
236
|
+
O2(n3);
|
|
237
|
+
}
|
|
238
|
+
return o3;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
throw new Error("illegal catch attempt");
|
|
242
|
+
}, delegateYield: function(e4, n3, r3) {
|
|
243
|
+
return this.delegate = { iterator: L2(e4), resultName: n3, nextLoc: r3 }, "next" === this.method && (this.arg = t3), v2;
|
|
244
|
+
} }, e3;
|
|
245
|
+
})(e2.exports);
|
|
246
|
+
try {
|
|
247
|
+
regeneratorRuntime = t2;
|
|
248
|
+
} catch (e3) {
|
|
249
|
+
"object" == typeof globalThis ? globalThis.regeneratorRuntime = t2 : Function("r", "regeneratorRuntime = r")(t2);
|
|
250
|
+
}
|
|
251
|
+
} }, n = {};
|
|
252
|
+
function r(e2) {
|
|
253
|
+
var o2 = n[e2];
|
|
254
|
+
if (void 0 !== o2) return o2.exports;
|
|
255
|
+
var a2 = n[e2] = { exports: {} };
|
|
256
|
+
return t[e2](a2, a2.exports, r), a2.exports;
|
|
257
|
+
}
|
|
258
|
+
r.n = (e2) => {
|
|
259
|
+
var t2 = e2 && e2.__esModule ? () => e2.default : () => e2;
|
|
260
|
+
return r.d(t2, { a: t2 }), t2;
|
|
261
|
+
}, r.d = (e2, t2) => {
|
|
262
|
+
for (var n2 in t2) r.o(t2, n2) && !r.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: t2[n2] });
|
|
263
|
+
}, r.o = (e2, t2) => Object.prototype.hasOwnProperty.call(e2, t2);
|
|
264
|
+
var o = {};
|
|
265
|
+
function a(e2, t2) {
|
|
266
|
+
(null == t2 || t2 > e2.length) && (t2 = e2.length);
|
|
267
|
+
for (var n2 = 0, r2 = new Array(t2); n2 < t2; n2++) r2[n2] = e2[n2];
|
|
268
|
+
return r2;
|
|
269
|
+
}
|
|
270
|
+
function i(e2, t2) {
|
|
271
|
+
if (e2) {
|
|
272
|
+
if ("string" == typeof e2) return a(e2, t2);
|
|
273
|
+
var n2 = Object.prototype.toString.call(e2).slice(8, -1);
|
|
274
|
+
return "Object" === n2 && e2.constructor && (n2 = e2.constructor.name), "Map" === n2 || "Set" === n2 ? Array.from(e2) : "Arguments" === n2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2) ? a(e2, t2) : void 0;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function c(e2) {
|
|
278
|
+
return (function(e3) {
|
|
279
|
+
if (Array.isArray(e3)) return a(e3);
|
|
280
|
+
})(e2) || (function(e3) {
|
|
281
|
+
if ("undefined" != typeof Symbol && null != e3[Symbol.iterator] || null != e3["@@iterator"]) return Array.from(e3);
|
|
282
|
+
})(e2) || i(e2) || (function() {
|
|
283
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
284
|
+
})();
|
|
285
|
+
}
|
|
286
|
+
function l(e2, t2, n2) {
|
|
287
|
+
return t2 in e2 ? Object.defineProperty(e2, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e2[t2] = n2, e2;
|
|
288
|
+
}
|
|
289
|
+
r.d(o, { A: () => L });
|
|
290
|
+
const u = (f = { Fragment: () => e.Fragment, computed: () => e.computed, createTextVNode: () => e.createTextVNode, createVNode: () => e.createVNode, defineComponent: () => e.defineComponent, nextTick: () => e.nextTick, reactive: () => e.reactive, ref: () => e.ref, watch: () => e.watch, watchEffect: () => e.watchEffect }, p = {}, r.d(p, f), p), d = (0, u.defineComponent)({ props: { data: { required: true, type: String }, onClick: Function }, render: function() {
|
|
291
|
+
var e2 = this.data, t2 = this.onClick;
|
|
292
|
+
return (0, u.createVNode)("span", { class: "vjs-tree-brackets", onClick: t2 }, [e2]);
|
|
293
|
+
} }), s = (0, u.defineComponent)({ emits: ["change", "update:modelValue"], props: { checked: { type: Boolean, default: false }, isMultiple: Boolean, onChange: Function }, setup: function(e2, t2) {
|
|
294
|
+
var n2 = t2.emit;
|
|
295
|
+
return { uiType: (0, u.computed)((function() {
|
|
296
|
+
return e2.isMultiple ? "checkbox" : "radio";
|
|
297
|
+
})), model: (0, u.computed)({ get: function() {
|
|
298
|
+
return e2.checked;
|
|
299
|
+
}, set: function(e3) {
|
|
300
|
+
return n2("update:modelValue", e3);
|
|
301
|
+
} }) };
|
|
302
|
+
}, render: function() {
|
|
303
|
+
var e2 = this.uiType, t2 = this.model, n2 = this.$emit;
|
|
304
|
+
return (0, u.createVNode)("label", { class: ["vjs-check-controller", t2 ? "is-checked" : ""], onClick: function(e3) {
|
|
305
|
+
return e3.stopPropagation();
|
|
306
|
+
} }, [(0, u.createVNode)("span", { class: "vjs-check-controller-inner is-".concat(e2) }, null), (0, u.createVNode)("input", { checked: t2, class: "vjs-check-controller-original is-".concat(e2), type: e2, onChange: function() {
|
|
307
|
+
return n2("change", t2);
|
|
308
|
+
} }, null)]);
|
|
309
|
+
} }), h = (0, u.defineComponent)({ props: { nodeType: { required: true, type: String }, onClick: Function }, render: function() {
|
|
310
|
+
var e2 = this.nodeType, t2 = this.onClick, n2 = "objectStart" === e2 || "arrayStart" === e2;
|
|
311
|
+
return n2 || "objectCollapsed" === e2 || "arrayCollapsed" === e2 ? (0, u.createVNode)("span", { class: "vjs-carets vjs-carets-".concat(n2 ? "open" : "close"), onClick: t2 }, [(0, u.createVNode)("svg", { viewBox: "0 0 1024 1024", focusable: "false", "data-icon": "caret-down", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" }, [(0, u.createVNode)("path", { d: "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" }, null)])]) : null;
|
|
312
|
+
} });
|
|
313
|
+
var f, p;
|
|
314
|
+
function v(e2) {
|
|
315
|
+
return v = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e3) {
|
|
316
|
+
return typeof e3;
|
|
317
|
+
} : function(e3) {
|
|
318
|
+
return e3 && "function" == typeof Symbol && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3;
|
|
319
|
+
}, v(e2);
|
|
320
|
+
}
|
|
321
|
+
function y(e2) {
|
|
322
|
+
return Object.prototype.toString.call(e2).slice(8, -1).toLowerCase();
|
|
323
|
+
}
|
|
324
|
+
function g(e2) {
|
|
325
|
+
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "root", n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r2 = (arguments.length > 3 ? arguments[3] : void 0) || {}, o2 = r2.key, a2 = r2.index, i2 = r2.type, c2 = void 0 === i2 ? "content" : i2, l2 = r2.showComma, u2 = void 0 !== l2 && l2, d2 = r2.length, s2 = void 0 === d2 ? 1 : d2, h2 = y(e2);
|
|
326
|
+
if ("array" === h2) {
|
|
327
|
+
var f2 = m(e2.map((function(e3, r3, o3) {
|
|
328
|
+
return g(e3, "".concat(t2, "[").concat(r3, "]"), n2 + 1, { index: r3, showComma: r3 !== o3.length - 1, length: s2, type: c2 });
|
|
329
|
+
})));
|
|
330
|
+
return [g("[", t2, n2, { showComma: false, key: o2, length: e2.length, type: "arrayStart" })[0]].concat(f2, g("]", t2, n2, { showComma: u2, length: e2.length, type: "arrayEnd" })[0]);
|
|
331
|
+
}
|
|
332
|
+
if ("object" === h2) {
|
|
333
|
+
var p2 = Object.keys(e2), v2 = m(p2.map((function(r3, o3, a3) {
|
|
334
|
+
return g(e2[r3], /^[a-zA-Z_]\w*$/.test(r3) ? "".concat(t2, ".").concat(r3) : "".concat(t2, '["').concat(r3, '"]'), n2 + 1, { key: r3, showComma: o3 !== a3.length - 1, length: s2, type: c2 });
|
|
335
|
+
})));
|
|
336
|
+
return [g("{", t2, n2, { showComma: false, key: o2, index: a2, length: p2.length, type: "objectStart" })[0]].concat(v2, g("}", t2, n2, { showComma: u2, length: p2.length, type: "objectEnd" })[0]);
|
|
337
|
+
}
|
|
338
|
+
return [{ content: e2, level: n2, key: o2, index: a2, path: t2, showComma: u2, length: s2, type: c2 }];
|
|
339
|
+
}
|
|
340
|
+
function m(e2) {
|
|
341
|
+
if ("function" == typeof Array.prototype.flat) return e2.flat();
|
|
342
|
+
for (var t2 = c(e2), n2 = []; t2.length; ) {
|
|
343
|
+
var r2 = t2.shift();
|
|
344
|
+
Array.isArray(r2) ? t2.unshift.apply(t2, c(r2)) : n2.push(r2);
|
|
345
|
+
}
|
|
346
|
+
return n2;
|
|
347
|
+
}
|
|
348
|
+
function b(e2) {
|
|
349
|
+
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : /* @__PURE__ */ new WeakMap();
|
|
350
|
+
if (null == e2) return e2;
|
|
351
|
+
if (e2 instanceof Date) return new Date(e2);
|
|
352
|
+
if (e2 instanceof RegExp) return new RegExp(e2);
|
|
353
|
+
if ("object" !== v(e2)) return e2;
|
|
354
|
+
if (t2.get(e2)) return t2.get(e2);
|
|
355
|
+
if (Array.isArray(e2)) {
|
|
356
|
+
var n2 = e2.map((function(e3) {
|
|
357
|
+
return b(e3, t2);
|
|
358
|
+
}));
|
|
359
|
+
return t2.set(e2, n2), n2;
|
|
360
|
+
}
|
|
361
|
+
var r2 = {};
|
|
362
|
+
for (var o2 in e2) r2[o2] = b(e2[o2], t2);
|
|
363
|
+
return t2.set(e2, r2), r2;
|
|
364
|
+
}
|
|
365
|
+
function w(e2, t2, n2, r2, o2, a2, i2) {
|
|
366
|
+
try {
|
|
367
|
+
var c2 = e2[a2](i2), l2 = c2.value;
|
|
368
|
+
} catch (e3) {
|
|
369
|
+
return void n2(e3);
|
|
370
|
+
}
|
|
371
|
+
c2.done ? t2(l2) : Promise.resolve(l2).then(r2, o2);
|
|
372
|
+
}
|
|
373
|
+
var N = r(207), k = r.n(N);
|
|
374
|
+
function C(e2, t2) {
|
|
375
|
+
var n2 = Object.keys(e2);
|
|
376
|
+
if (Object.getOwnPropertySymbols) {
|
|
377
|
+
var r2 = Object.getOwnPropertySymbols(e2);
|
|
378
|
+
t2 && (r2 = r2.filter((function(t3) {
|
|
379
|
+
return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
|
|
380
|
+
}))), n2.push.apply(n2, r2);
|
|
381
|
+
}
|
|
382
|
+
return n2;
|
|
383
|
+
}
|
|
384
|
+
function x(e2) {
|
|
385
|
+
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
386
|
+
var n2 = null != arguments[t2] ? arguments[t2] : {};
|
|
387
|
+
t2 % 2 ? C(Object(n2), true).forEach((function(t3) {
|
|
388
|
+
l(e2, t3, n2[t3]);
|
|
389
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(n2)) : C(Object(n2)).forEach((function(t3) {
|
|
390
|
+
Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(n2, t3));
|
|
391
|
+
}));
|
|
392
|
+
}
|
|
393
|
+
return e2;
|
|
394
|
+
}
|
|
395
|
+
var j = { data: { type: [String, Number, Boolean, Array, Object], default: null }, rootPath: { type: String, default: "root" }, indent: { type: Number, default: 2 }, showLength: { type: Boolean, default: false }, showDoubleQuotes: { type: Boolean, default: true }, renderNodeKey: Function, renderNodeValue: Function, renderNodeActions: { type: [Boolean, Function], default: void 0 }, selectableType: String, showSelectController: { type: Boolean, default: false }, showLine: { type: Boolean, default: true }, showLineNumber: { type: Boolean, default: false }, selectOnClickNode: { type: Boolean, default: true }, nodeSelectable: { type: Function, default: function() {
|
|
396
|
+
return true;
|
|
397
|
+
} }, highlightSelectedNode: { type: Boolean, default: true }, showIcon: { type: Boolean, default: false }, theme: { type: String, default: "light" }, showKeyValueSpace: { type: Boolean, default: true }, editable: { type: Boolean, default: false }, editableTrigger: { type: String, default: "click" }, onNodeClick: { type: Function }, onNodeMouseover: { type: Function }, onBracketsClick: { type: Function }, onIconClick: { type: Function }, onValueChange: { type: Function } };
|
|
398
|
+
const S = (0, u.defineComponent)({ name: "TreeNode", props: x(x({}, j), {}, { node: { type: Object, required: true }, collapsed: Boolean, checked: Boolean, style: Object, onSelectedChange: { type: Function } }), emits: ["nodeClick", "nodeMouseover", "bracketsClick", "iconClick", "selectedChange", "valueChange"], setup: function(e2, t2) {
|
|
399
|
+
var n2 = t2.emit, r2 = (0, u.computed)((function() {
|
|
400
|
+
return y(e2.node.content);
|
|
401
|
+
})), o2 = (0, u.computed)((function() {
|
|
402
|
+
return "vjs-value vjs-value-".concat(r2.value);
|
|
403
|
+
})), a2 = (0, u.computed)((function() {
|
|
404
|
+
return e2.showDoubleQuotes ? '"'.concat(e2.node.key, '"') : e2.node.key;
|
|
405
|
+
})), i2 = (0, u.computed)((function() {
|
|
406
|
+
return "multiple" === e2.selectableType;
|
|
407
|
+
})), c2 = (0, u.computed)((function() {
|
|
408
|
+
return "single" === e2.selectableType;
|
|
409
|
+
})), f2 = (0, u.computed)((function() {
|
|
410
|
+
return e2.nodeSelectable(e2.node) && (i2.value || c2.value);
|
|
411
|
+
})), p2 = (0, u.reactive)({ editing: false }), v2 = function(t3) {
|
|
412
|
+
var r3, o3, a3 = "null" === (o3 = null === (r3 = t3.target) || void 0 === r3 ? void 0 : r3.value) ? null : "undefined" === o3 ? void 0 : "true" === o3 || "false" !== o3 && (o3[0] + o3[o3.length - 1] === '""' || o3[0] + o3[o3.length - 1] === "''" ? o3.slice(1, -1) : "number" == typeof Number(o3) && !isNaN(Number(o3)) || "NaN" === o3 ? Number(o3) : o3);
|
|
413
|
+
n2("valueChange", a3, e2.node.path);
|
|
414
|
+
}, g2 = (0, u.computed)((function() {
|
|
415
|
+
var t3, n3 = null === (t3 = e2.node) || void 0 === t3 ? void 0 : t3.content;
|
|
416
|
+
return null === n3 ? n3 = "null" : void 0 === n3 && (n3 = "undefined"), "string" === r2.value ? '"'.concat(n3, '"') : n3 + "";
|
|
417
|
+
})), m2 = function() {
|
|
418
|
+
var t3 = e2.renderNodeValue;
|
|
419
|
+
return t3 ? t3({ node: e2.node, defaultValue: g2.value }) : g2.value;
|
|
420
|
+
}, b2 = function() {
|
|
421
|
+
n2("bracketsClick", !e2.collapsed, e2.node);
|
|
422
|
+
}, N2 = function() {
|
|
423
|
+
n2("iconClick", !e2.collapsed, e2.node);
|
|
424
|
+
}, C2 = function() {
|
|
425
|
+
n2("selectedChange", e2.node);
|
|
426
|
+
}, x2 = function() {
|
|
427
|
+
n2("nodeClick", e2.node), f2.value && e2.selectOnClickNode && n2("selectedChange", e2.node);
|
|
428
|
+
}, j2 = function() {
|
|
429
|
+
n2("nodeMouseover", e2.node);
|
|
430
|
+
}, S2 = function(t3) {
|
|
431
|
+
if (e2.editable && !p2.editing) {
|
|
432
|
+
p2.editing = true;
|
|
433
|
+
var n3 = function e3(n4) {
|
|
434
|
+
var r3;
|
|
435
|
+
n4.target !== t3.target && (null === (r3 = n4.target) || void 0 === r3 ? void 0 : r3.parentElement) !== t3.target && (p2.editing = false, document.removeEventListener("click", e3));
|
|
436
|
+
};
|
|
437
|
+
document.removeEventListener("click", n3), document.addEventListener("click", n3);
|
|
438
|
+
}
|
|
439
|
+
}, O2 = (function() {
|
|
440
|
+
var e3 = (0, u.ref)(false), t3 = (function() {
|
|
441
|
+
var t4, n3 = (t4 = k().mark((function t5(n4) {
|
|
442
|
+
return k().wrap((function(t6) {
|
|
443
|
+
for (; ; ) switch (t6.prev = t6.next) {
|
|
444
|
+
case 0:
|
|
445
|
+
return t6.prev = 0, t6.next = 3, navigator.clipboard.writeText(n4);
|
|
446
|
+
case 3:
|
|
447
|
+
e3.value = true, setTimeout((function() {
|
|
448
|
+
e3.value = false;
|
|
449
|
+
}), 300), t6.next = 10;
|
|
450
|
+
break;
|
|
451
|
+
case 7:
|
|
452
|
+
t6.prev = 7, t6.t0 = t6.catch(0), console.error("[vue-json-pretty] Copy failed: ", t6.t0);
|
|
453
|
+
case 10:
|
|
454
|
+
case "end":
|
|
455
|
+
return t6.stop();
|
|
456
|
+
}
|
|
457
|
+
}), t5, null, [[0, 7]]);
|
|
458
|
+
})), function() {
|
|
459
|
+
var e4 = this, n4 = arguments;
|
|
460
|
+
return new Promise((function(r3, o3) {
|
|
461
|
+
var a3 = t4.apply(e4, n4);
|
|
462
|
+
function i3(e5) {
|
|
463
|
+
w(a3, r3, o3, i3, c3, "next", e5);
|
|
464
|
+
}
|
|
465
|
+
function c3(e5) {
|
|
466
|
+
w(a3, r3, o3, i3, c3, "throw", e5);
|
|
467
|
+
}
|
|
468
|
+
i3(void 0);
|
|
469
|
+
}));
|
|
470
|
+
});
|
|
471
|
+
return function(e4) {
|
|
472
|
+
return n3.apply(this, arguments);
|
|
473
|
+
};
|
|
474
|
+
})();
|
|
475
|
+
return { copy: t3 };
|
|
476
|
+
})().copy, V2 = function() {
|
|
477
|
+
var t3 = e2.node, n3 = t3.key, r3 = t3.path, o3 = e2.rootPath, a3 = new Function("data", "return data".concat(r3.slice(o3.length)))(e2.data), i3 = JSON.stringify(n3 ? l({}, n3, a3) : a3, null, 2);
|
|
478
|
+
O2(i3);
|
|
479
|
+
}, L2 = function() {
|
|
480
|
+
var t3 = e2.renderNodeActions;
|
|
481
|
+
if (!t3) return null;
|
|
482
|
+
var n3 = { copy: V2 };
|
|
483
|
+
return "function" == typeof t3 ? t3({ node: e2.node, defaultActions: n3 }) : (0, u.createVNode)("span", { onClick: V2, class: "vjs-tree-node-actions-item" }, [(0, u.createTextVNode)("copy")]);
|
|
484
|
+
};
|
|
485
|
+
return function() {
|
|
486
|
+
var t3, n3 = e2.node;
|
|
487
|
+
return (0, u.createVNode)("div", { class: { "vjs-tree-node": true, "has-selector": e2.showSelectController, "has-carets": e2.showIcon, "is-highlight": e2.highlightSelectedNode && e2.checked, dark: "dark" === e2.theme }, onClick: x2, onMouseover: j2, style: e2.style }, [e2.showLineNumber && (0, u.createVNode)("span", { class: "vjs-node-index" }, [n3.id + 1]), e2.showSelectController && f2.value && "objectEnd" !== n3.type && "arrayEnd" !== n3.type && (0, u.createVNode)(s, { isMultiple: i2.value, checked: e2.checked, onChange: C2 }, null), (0, u.createVNode)("div", { class: "vjs-indent" }, [Array.from(Array(n3.level)).map((function(t4, n4) {
|
|
488
|
+
return (0, u.createVNode)("div", { key: n4, class: { "vjs-indent-unit": true, "has-line": e2.showLine } }, [Array.from(Array(e2.indent)).map((function() {
|
|
489
|
+
return (0, u.createVNode)(u.Fragment, null, [(0, u.createTextVNode)(" ")]);
|
|
490
|
+
}))]);
|
|
491
|
+
})), e2.showIcon && (0, u.createVNode)(h, { nodeType: n3.type, onClick: N2 }, null)]), n3.key && (0, u.createVNode)("span", { class: "vjs-key" }, [(t3 = e2.renderNodeKey, t3 ? t3({ node: e2.node, defaultKey: a2.value || "" }) : a2.value), (0, u.createVNode)("span", { class: "vjs-colon" }, [":".concat(e2.showKeyValueSpace ? " " : "")])]), (0, u.createVNode)("span", null, ["content" !== n3.type && n3.content ? (0, u.createVNode)(d, { data: n3.content.toString(), onClick: b2 }, null) : (0, u.createVNode)("span", { class: o2.value, onClick: !e2.editable || e2.editableTrigger && "click" !== e2.editableTrigger ? void 0 : S2, onDblclick: e2.editable && "dblclick" === e2.editableTrigger ? S2 : void 0 }, [e2.editable && p2.editing ? (0, u.createVNode)("input", { value: g2.value, onChange: v2, style: { padding: "3px 8px", border: "1px solid #eee", boxShadow: "none", boxSizing: "border-box", borderRadius: 5, fontFamily: "inherit" } }, null) : m2()]), n3.showComma && (0, u.createVNode)("span", null, [","]), e2.showLength && e2.collapsed && (0, u.createVNode)("span", { class: "vjs-comment" }, [(0, u.createTextVNode)(" // "), n3.length, (0, u.createTextVNode)(" items ")])]), e2.renderNodeActions && (0, u.createVNode)("span", { class: "vjs-tree-node-actions" }, [L2()])]);
|
|
492
|
+
};
|
|
493
|
+
} });
|
|
494
|
+
function O(e2, t2) {
|
|
495
|
+
var n2 = Object.keys(e2);
|
|
496
|
+
if (Object.getOwnPropertySymbols) {
|
|
497
|
+
var r2 = Object.getOwnPropertySymbols(e2);
|
|
498
|
+
t2 && (r2 = r2.filter((function(t3) {
|
|
499
|
+
return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
|
|
500
|
+
}))), n2.push.apply(n2, r2);
|
|
501
|
+
}
|
|
502
|
+
return n2;
|
|
503
|
+
}
|
|
504
|
+
function V(e2) {
|
|
505
|
+
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
506
|
+
var n2 = null != arguments[t2] ? arguments[t2] : {};
|
|
507
|
+
t2 % 2 ? O(Object(n2), true).forEach((function(t3) {
|
|
508
|
+
l(e2, t3, n2[t3]);
|
|
509
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(n2)) : O(Object(n2)).forEach((function(t3) {
|
|
510
|
+
Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(n2, t3));
|
|
511
|
+
}));
|
|
512
|
+
}
|
|
513
|
+
return e2;
|
|
514
|
+
}
|
|
515
|
+
const L = (0, u.defineComponent)({ name: "Tree", props: V(V({}, j), {}, { collapsedNodeLength: { type: Number, default: 1 / 0 }, deep: { type: Number, default: 1 / 0 }, pathCollapsible: { type: Function, default: function() {
|
|
516
|
+
return false;
|
|
517
|
+
} }, virtual: { type: Boolean, default: false }, height: { type: Number, default: 400 }, itemHeight: { type: Number, default: 20 }, dynamicHeight: { type: Boolean, default: true }, selectedValue: { type: [String, Array], default: function() {
|
|
518
|
+
return "";
|
|
519
|
+
} }, collapsedOnClickBrackets: { type: Boolean, default: true }, style: Object, onSelectedChange: { type: Function }, theme: { type: String, default: "light" } }), slots: ["renderNodeKey", "renderNodeValue", "renderNodeActions"], emits: ["nodeClick", "nodeMouseover", "bracketsClick", "iconClick", "selectedChange", "update:selectedValue", "update:data"], setup: function(e2, t2) {
|
|
520
|
+
var n2 = t2.emit, r2 = t2.slots, o2 = (0, u.ref)(), a2 = (0, u.computed)((function() {
|
|
521
|
+
return g(e2.data, e2.rootPath);
|
|
522
|
+
})), d2 = function(t3, n3) {
|
|
523
|
+
return a2.value.reduce((function(r3, o3) {
|
|
524
|
+
var a3, i2 = o3.level >= t3 || o3.length >= n3, c2 = null === (a3 = e2.pathCollapsible) || void 0 === a3 ? void 0 : a3.call(e2, o3);
|
|
525
|
+
return "objectStart" !== o3.type && "arrayStart" !== o3.type || !i2 && !c2 ? r3 : V(V({}, r3), {}, l({}, o3.path, 1));
|
|
526
|
+
}), {});
|
|
527
|
+
}, s2 = (0, u.reactive)({ translateY: 0, visibleData: null, hiddenPaths: d2(e2.deep, e2.collapsedNodeLength), startIndex: 0, endIndex: 0 }), h2 = [], f2 = [], p2 = 0, v2 = {}, y2 = function(t3) {
|
|
528
|
+
h2 = Array(t3).fill(0).map((function() {
|
|
529
|
+
return e2.itemHeight || 20;
|
|
530
|
+
})), (f2 = new Array(t3 + 1))[0] = 0;
|
|
531
|
+
for (var n3 = 0; n3 < t3; n3++) f2[n3 + 1] = f2[n3] + h2[n3];
|
|
532
|
+
p2 = f2[t3] || 0;
|
|
533
|
+
}, m2 = function(e3) {
|
|
534
|
+
var t3 = h2.length;
|
|
535
|
+
e3 < 0 && (e3 = 0), e3 > t3 && (e3 = t3);
|
|
536
|
+
for (var n3 = e3; n3 < t3; n3++) f2[n3 + 1] = f2[n3] + h2[n3];
|
|
537
|
+
p2 = f2[t3] || 0;
|
|
538
|
+
}, w2 = function(e3, t3) {
|
|
539
|
+
for (var n3 = 0, r3 = e3.length - 1; n3 < r3; ) {
|
|
540
|
+
var o3 = n3 + r3 >>> 1;
|
|
541
|
+
e3[o3] < t3 ? n3 = o3 + 1 : r3 = o3;
|
|
542
|
+
}
|
|
543
|
+
return n3;
|
|
544
|
+
}, N2 = (0, u.computed)((function() {
|
|
545
|
+
for (var e3 = null, t3 = [], n3 = a2.value.length, r3 = 0; r3 < n3; r3++) {
|
|
546
|
+
var o3 = V(V({}, a2.value[r3]), {}, { id: r3 }), i2 = s2.hiddenPaths[o3.path];
|
|
547
|
+
if (e3 && e3.path === o3.path) {
|
|
548
|
+
var c2 = "objectStart" === e3.type, l2 = V(V(V({}, o3), e3), {}, { showComma: o3.showComma, content: c2 ? "{...}" : "[...]", type: c2 ? "objectCollapsed" : "arrayCollapsed" });
|
|
549
|
+
e3 = null, t3.push(l2);
|
|
550
|
+
} else {
|
|
551
|
+
if (i2 && !e3) {
|
|
552
|
+
e3 = o3;
|
|
553
|
+
continue;
|
|
554
|
+
}
|
|
555
|
+
if (e3) continue;
|
|
556
|
+
t3.push(o3);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
return t3;
|
|
560
|
+
})), k2 = (0, u.computed)((function() {
|
|
561
|
+
var t3 = e2.selectedValue;
|
|
562
|
+
return t3 && "multiple" === e2.selectableType && Array.isArray(t3) ? t3 : [t3];
|
|
563
|
+
})), C2 = (0, u.computed)((function() {
|
|
564
|
+
return !e2.selectableType || e2.selectOnClickNode || e2.showSelectController ? "" : "When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail.";
|
|
565
|
+
})), x2 = (0, u.computed)((function() {
|
|
566
|
+
return e2.dynamicHeight ? p2 || 0 : N2.value.length * e2.itemHeight;
|
|
567
|
+
})), j2 = function t3() {
|
|
568
|
+
var n3 = N2.value;
|
|
569
|
+
if (n3) if (e2.virtual) {
|
|
570
|
+
var r3, a3 = (null === (r3 = o2.value) || void 0 === r3 ? void 0 : r3.scrollTop) || 0;
|
|
571
|
+
if (e2.dynamicHeight) {
|
|
572
|
+
h2.length !== n3.length && y2(n3.length);
|
|
573
|
+
var i2 = (function(e3) {
|
|
574
|
+
var t4 = w2(f2, e3 + 1e-4);
|
|
575
|
+
return Math.max(0, Math.min(t4 - 1, h2.length - 1));
|
|
576
|
+
})(a3), c2 = (function(e3, t4) {
|
|
577
|
+
var n4 = w2(f2, e3 + t4);
|
|
578
|
+
return Math.max(0, Math.min(n4 + 1, h2.length));
|
|
579
|
+
})(a3, e2.height), l2 = Math.max(0, i2 - 5), d3 = Math.min(n3.length, c2 + 5);
|
|
580
|
+
s2.startIndex = l2, s2.endIndex = d3, s2.translateY = f2[l2] || 0, s2.visibleData = n3.slice(l2, d3), (0, u.nextTick)().then((function() {
|
|
581
|
+
for (var e3 = false, n4 = s2.startIndex; n4 < s2.endIndex; n4++) {
|
|
582
|
+
var r4 = v2[n4];
|
|
583
|
+
if (r4) {
|
|
584
|
+
var o3 = r4.offsetHeight;
|
|
585
|
+
o3 && h2[n4] !== o3 && (h2[n4] = o3, f2[n4 + 1] = f2[n4] + h2[n4], m2(n4 + 1), e3 = true);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
e3 && t3();
|
|
589
|
+
}));
|
|
590
|
+
} else {
|
|
591
|
+
var p3 = e2.height / e2.itemHeight, g2 = Math.floor(a3 / e2.itemHeight), b2 = g2 < 0 ? 0 : g2 + p3 > n3.length ? n3.length - p3 : g2;
|
|
592
|
+
b2 < 0 && (b2 = 0);
|
|
593
|
+
var k3 = b2 + p3;
|
|
594
|
+
s2.translateY = b2 * e2.itemHeight, s2.startIndex = b2, s2.endIndex = k3, s2.visibleData = n3.slice(b2, k3);
|
|
595
|
+
}
|
|
596
|
+
} else s2.translateY = 0, s2.startIndex = 0, s2.endIndex = n3.length, s2.visibleData = n3;
|
|
597
|
+
}, O2 = null, L2 = function() {
|
|
598
|
+
O2 && cancelAnimationFrame(O2), O2 = requestAnimationFrame((function() {
|
|
599
|
+
j2();
|
|
600
|
+
}));
|
|
601
|
+
}, P2 = function(t3) {
|
|
602
|
+
var r3, o3, a3 = t3.path, l2 = e2.selectableType;
|
|
603
|
+
if ("multiple" === l2) {
|
|
604
|
+
var u2 = k2.value.findIndex((function(e3) {
|
|
605
|
+
return e3 === a3;
|
|
606
|
+
})), d3 = c(k2.value);
|
|
607
|
+
-1 !== u2 ? d3.splice(u2, 1) : d3.push(a3), n2("update:selectedValue", d3), n2("selectedChange", d3, c(k2.value));
|
|
608
|
+
} else if ("single" === l2 && k2.value[0] !== a3) {
|
|
609
|
+
var s3 = (r3 = k2.value, o3 = 1, (function(e3) {
|
|
610
|
+
if (Array.isArray(e3)) return e3;
|
|
611
|
+
})(r3) || (function(e3, t4) {
|
|
612
|
+
var n3 = null == e3 ? null : "undefined" != typeof Symbol && e3[Symbol.iterator] || e3["@@iterator"];
|
|
613
|
+
if (null != n3) {
|
|
614
|
+
var r4, o4, a4 = [], i2 = true, c2 = false;
|
|
615
|
+
try {
|
|
616
|
+
for (n3 = n3.call(e3); !(i2 = (r4 = n3.next()).done) && (a4.push(r4.value), !t4 || a4.length !== t4); i2 = true) ;
|
|
617
|
+
} catch (e4) {
|
|
618
|
+
c2 = true, o4 = e4;
|
|
619
|
+
} finally {
|
|
620
|
+
try {
|
|
621
|
+
i2 || null == n3.return || n3.return();
|
|
622
|
+
} finally {
|
|
623
|
+
if (c2) throw o4;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
return a4;
|
|
627
|
+
}
|
|
628
|
+
})(r3, o3) || i(r3, o3) || (function() {
|
|
629
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
630
|
+
})())[0], h3 = a3;
|
|
631
|
+
n2("update:selectedValue", h3), n2("selectedChange", h3, s3);
|
|
632
|
+
}
|
|
633
|
+
}, T = function(e3) {
|
|
634
|
+
n2("nodeClick", e3);
|
|
635
|
+
}, E = function(e3) {
|
|
636
|
+
n2("nodeMouseover", e3);
|
|
637
|
+
}, A = function(e3, t3) {
|
|
638
|
+
if (e3) s2.hiddenPaths = V(V({}, s2.hiddenPaths), {}, l({}, t3, 1));
|
|
639
|
+
else {
|
|
640
|
+
var n3 = V({}, s2.hiddenPaths);
|
|
641
|
+
delete n3[t3], s2.hiddenPaths = n3;
|
|
642
|
+
}
|
|
643
|
+
}, F = function(t3, r3) {
|
|
644
|
+
e2.collapsedOnClickBrackets && A(t3, r3.path), n2("bracketsClick", t3, r3);
|
|
645
|
+
}, I = function(e3, t3) {
|
|
646
|
+
A(e3, t3.path), n2("iconClick", e3, t3);
|
|
647
|
+
}, B = function(t3, r3) {
|
|
648
|
+
var o3 = b(e2.data), a3 = e2.rootPath;
|
|
649
|
+
new Function("data", "val", "data".concat(r3.slice(a3.length), "=val"))(o3, t3), n2("update:data", o3);
|
|
650
|
+
};
|
|
651
|
+
return (0, u.watchEffect)((function() {
|
|
652
|
+
C2.value && (function(e3) {
|
|
653
|
+
throw new Error("[VueJSONPretty] ".concat(e3));
|
|
654
|
+
})(C2.value);
|
|
655
|
+
})), (0, u.watchEffect)((function() {
|
|
656
|
+
N2.value && (e2.virtual && e2.dynamicHeight && h2.length !== N2.value.length && y2(N2.value.length), j2());
|
|
657
|
+
})), (0, u.watch)((function() {
|
|
658
|
+
return [e2.dynamicHeight, e2.itemHeight, a2.value.length];
|
|
659
|
+
}), (function() {
|
|
660
|
+
e2.virtual && e2.dynamicHeight && (y2(N2.value.length), (0, u.nextTick)(j2));
|
|
661
|
+
})), (0, u.watch)((function() {
|
|
662
|
+
return e2.deep;
|
|
663
|
+
}), (function(t3) {
|
|
664
|
+
t3 && (s2.hiddenPaths = d2(t3, e2.collapsedNodeLength));
|
|
665
|
+
})), (0, u.watch)((function() {
|
|
666
|
+
return e2.collapsedNodeLength;
|
|
667
|
+
}), (function(t3) {
|
|
668
|
+
t3 && (s2.hiddenPaths = d2(e2.deep, t3));
|
|
669
|
+
})), function() {
|
|
670
|
+
var t3, n3, i2, c2, l2, d3 = null !== (t3 = e2.renderNodeKey) && void 0 !== t3 ? t3 : r2.renderNodeKey, h3 = null !== (n3 = e2.renderNodeValue) && void 0 !== n3 ? n3 : r2.renderNodeValue, f3 = null !== (i2 = null !== (c2 = e2.renderNodeActions) && void 0 !== c2 ? c2 : r2.renderNodeActions) && void 0 !== i2 && i2, p3 = null === (l2 = s2.visibleData) || void 0 === l2 ? void 0 : l2.map((function(t4, n4) {
|
|
671
|
+
var r3 = s2.startIndex + n4;
|
|
672
|
+
return (0, u.createVNode)("div", { key: t4.id, ref: function(e3) {
|
|
673
|
+
return (function(e4, t5) {
|
|
674
|
+
t5 ? v2[e4] = t5 : delete v2[e4];
|
|
675
|
+
})(r3, e3 || null);
|
|
676
|
+
} }, [(0, u.createVNode)(S, { data: e2.data, rootPath: e2.rootPath, indent: e2.indent, node: t4, collapsed: !!s2.hiddenPaths[t4.path], theme: e2.theme, showDoubleQuotes: e2.showDoubleQuotes, showLength: e2.showLength, checked: k2.value.includes(t4.path), selectableType: e2.selectableType, showLine: e2.showLine, showLineNumber: e2.showLineNumber, showSelectController: e2.showSelectController, selectOnClickNode: e2.selectOnClickNode, nodeSelectable: e2.nodeSelectable, highlightSelectedNode: e2.highlightSelectedNode, editable: e2.editable, editableTrigger: e2.editableTrigger, showIcon: e2.showIcon, showKeyValueSpace: e2.showKeyValueSpace, renderNodeKey: d3, renderNodeValue: h3, renderNodeActions: f3, onNodeClick: T, onNodeMouseover: E, onBracketsClick: F, onIconClick: I, onSelectedChange: P2, onValueChange: B, class: e2.dynamicHeight ? "dynamic-height" : void 0, style: e2.dynamicHeight ? {} : e2.itemHeight && 20 !== e2.itemHeight ? { lineHeight: "".concat(e2.itemHeight, "px") } : {} }, null)]);
|
|
677
|
+
}));
|
|
678
|
+
return (0, u.createVNode)("div", { ref: o2, class: { "vjs-tree": true, "is-virtual": e2.virtual, dark: "dark" === e2.theme }, onScroll: e2.virtual ? L2 : void 0, style: e2.showLineNumber ? V({ paddingLeft: "".concat(12 * Number(a2.value.length.toString().length), "px") }, e2.style) : e2.style }, [e2.virtual ? (0, u.createVNode)("div", { class: "vjs-tree-list", style: { height: "".concat(e2.height, "px") } }, [(0, u.createVNode)("div", { class: "vjs-tree-list-holder", style: { height: "".concat(x2.value, "px") } }, [(0, u.createVNode)("div", { class: "vjs-tree-list-holder-inner", style: { transform: "translateY(".concat(s2.translateY, "px)") } }, [p3])])]) : p3]);
|
|
679
|
+
};
|
|
680
|
+
} });
|
|
681
|
+
var P = o.A;
|
|
682
|
+
const _hoisted_1 = { class: "flex flex-col h-full gap-4" };
|
|
683
|
+
const _hoisted_2 = { class: "flex flex-wrap items-center gap-3" };
|
|
684
|
+
const _hoisted_3 = { class: "material-icons text-lg" };
|
|
685
|
+
const _hoisted_4 = {
|
|
686
|
+
key: 0,
|
|
687
|
+
class: "px-4 py-2 bg-coral-red/20 border-2 border-coral-red rounded flex items-center gap-2 text-coral-red font-bold text-sm"
|
|
688
|
+
};
|
|
689
|
+
const _hoisted_5 = { class: "flex-1 grid grid-cols-1 lg:grid-cols-2 gap-4 min-h-0" };
|
|
690
|
+
const _hoisted_6 = { class: "flex flex-col min-h-0" };
|
|
691
|
+
const _hoisted_7 = { class: "flex flex-col min-h-0" };
|
|
692
|
+
const _hoisted_8 = { class: "flex items-center gap-2 mb-2" };
|
|
693
|
+
const _hoisted_9 = { class: "ml-auto flex items-center gap-3 text-xs text-gray-500" };
|
|
694
|
+
const _hoisted_10 = { class: "flex items-center gap-1 cursor-pointer select-none" };
|
|
695
|
+
const _hoisted_11 = { class: "flex items-center gap-1 select-none" };
|
|
696
|
+
const _hoisted_12 = { class: "json-viewer-panel flex-1 w-full bg-deep-charcoal border-4 border-black rounded-xl p-4 overflow-auto shadow-hard min-h-[200px]" };
|
|
697
|
+
const _hoisted_13 = {
|
|
698
|
+
key: 1,
|
|
699
|
+
class: "text-gray-600 font-mono text-sm"
|
|
700
|
+
};
|
|
701
|
+
const _hoisted_14 = {
|
|
702
|
+
key: 2,
|
|
703
|
+
class: "text-coral-red font-mono text-sm"
|
|
704
|
+
};
|
|
705
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
706
|
+
__name: "index",
|
|
707
|
+
setup(__props) {
|
|
708
|
+
const inputJson = ref("");
|
|
709
|
+
const errorMsg = ref("");
|
|
710
|
+
const deepLevel = ref(Infinity);
|
|
711
|
+
const showLineNumber = ref(false);
|
|
712
|
+
const copySuccess = ref(false);
|
|
713
|
+
const parsedData = computed(() => {
|
|
714
|
+
if (!inputJson.value.trim()) {
|
|
715
|
+
errorMsg.value = "";
|
|
716
|
+
return void 0;
|
|
717
|
+
}
|
|
718
|
+
try {
|
|
719
|
+
const parsed = JSON.parse(inputJson.value);
|
|
720
|
+
errorMsg.value = "";
|
|
721
|
+
return parsed;
|
|
722
|
+
} catch (e2) {
|
|
723
|
+
errorMsg.value = e2.message || "无效的 JSON";
|
|
724
|
+
return void 0;
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
const formattedJson = computed(() => {
|
|
728
|
+
if (parsedData.value === void 0) return "";
|
|
729
|
+
return JSON.stringify(parsedData.value, null, 2);
|
|
730
|
+
});
|
|
731
|
+
function handleFormat() {
|
|
732
|
+
if (formattedJson.value) {
|
|
733
|
+
inputJson.value = formattedJson.value;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
function handleCompress() {
|
|
737
|
+
if (!inputJson.value.trim()) return;
|
|
738
|
+
try {
|
|
739
|
+
const parsed = JSON.parse(inputJson.value);
|
|
740
|
+
inputJson.value = JSON.stringify(parsed);
|
|
741
|
+
errorMsg.value = "";
|
|
742
|
+
} catch (e2) {
|
|
743
|
+
errorMsg.value = e2.message || "无效的 JSON";
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
function handleClear() {
|
|
747
|
+
inputJson.value = "";
|
|
748
|
+
errorMsg.value = "";
|
|
749
|
+
}
|
|
750
|
+
async function handleCopy() {
|
|
751
|
+
if (formattedJson.value) {
|
|
752
|
+
await navigator.clipboard.writeText(formattedJson.value);
|
|
753
|
+
copySuccess.value = true;
|
|
754
|
+
setTimeout(() => {
|
|
755
|
+
copySuccess.value = false;
|
|
756
|
+
}, 1500);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
function handlePaste() {
|
|
760
|
+
navigator.clipboard.readText().then((text) => {
|
|
761
|
+
inputJson.value = text;
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
function loadSample() {
|
|
765
|
+
inputJson.value = JSON.stringify({
|
|
766
|
+
name: "UsefulTools",
|
|
767
|
+
version: "1.0.0",
|
|
768
|
+
description: "一个实用工具集合",
|
|
769
|
+
features: ["JSON格式化", "代码高亮", "数据转换"],
|
|
770
|
+
nested: {
|
|
771
|
+
level1: {
|
|
772
|
+
level2: {
|
|
773
|
+
level3: { deep: true, value: 42 }
|
|
774
|
+
},
|
|
775
|
+
list: [1, 2, 3, { key: "val" }]
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
author: { name: "开发者", email: "dev@example.com" },
|
|
779
|
+
config: { theme: "dark", language: "zh-CN", autoSave: true },
|
|
780
|
+
tags: ["tool", "json", "formatter", "visualizer"],
|
|
781
|
+
count: 1024,
|
|
782
|
+
active: true,
|
|
783
|
+
nullable: null
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
return (_ctx, _cache) => {
|
|
787
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
788
|
+
createCommentVNode(" Toolbar "),
|
|
789
|
+
createElementVNode("div", _hoisted_2, [
|
|
790
|
+
createElementVNode("button", {
|
|
791
|
+
class: "h-9 px-4 bg-primary text-black font-bold border-2 border-black rounded shadow-hard-sm hover:shadow-none hover:translate-x-0.5 hover:translate-y-0.5 transition-all flex items-center gap-1.5 text-sm",
|
|
792
|
+
onClick: handleFormat
|
|
793
|
+
}, [..._cache[3] || (_cache[3] = [
|
|
794
|
+
createElementVNode(
|
|
795
|
+
"span",
|
|
796
|
+
{ class: "material-icons text-lg" },
|
|
797
|
+
"auto_fix_high",
|
|
798
|
+
-1
|
|
799
|
+
/* CACHED */
|
|
800
|
+
),
|
|
801
|
+
createTextVNode(
|
|
802
|
+
" 格式化 ",
|
|
803
|
+
-1
|
|
804
|
+
/* CACHED */
|
|
805
|
+
)
|
|
806
|
+
])]),
|
|
807
|
+
createElementVNode("button", {
|
|
808
|
+
class: "h-9 px-4 bg-white text-black font-bold border-2 border-black rounded shadow-hard-sm hover:shadow-none hover:translate-x-0.5 hover:translate-y-0.5 transition-all flex items-center gap-1.5 text-sm",
|
|
809
|
+
onClick: handleCompress
|
|
810
|
+
}, [..._cache[4] || (_cache[4] = [
|
|
811
|
+
createElementVNode(
|
|
812
|
+
"span",
|
|
813
|
+
{ class: "material-icons text-lg" },
|
|
814
|
+
"compress",
|
|
815
|
+
-1
|
|
816
|
+
/* CACHED */
|
|
817
|
+
),
|
|
818
|
+
createTextVNode(
|
|
819
|
+
" 压缩 ",
|
|
820
|
+
-1
|
|
821
|
+
/* CACHED */
|
|
822
|
+
)
|
|
823
|
+
])]),
|
|
824
|
+
createElementVNode("button", {
|
|
825
|
+
class: "h-9 px-4 bg-white text-black font-bold border-2 border-black rounded shadow-hard-sm hover:shadow-none hover:translate-x-0.5 hover:translate-y-0.5 transition-all flex items-center gap-1.5 text-sm",
|
|
826
|
+
onClick: handleCopy
|
|
827
|
+
}, [
|
|
828
|
+
createElementVNode(
|
|
829
|
+
"span",
|
|
830
|
+
_hoisted_3,
|
|
831
|
+
toDisplayString(copySuccess.value ? "check_circle" : "content_copy"),
|
|
832
|
+
1
|
|
833
|
+
/* TEXT */
|
|
834
|
+
),
|
|
835
|
+
createTextVNode(
|
|
836
|
+
" " + toDisplayString(copySuccess.value ? "已复制" : "复制"),
|
|
837
|
+
1
|
|
838
|
+
/* TEXT */
|
|
839
|
+
)
|
|
840
|
+
]),
|
|
841
|
+
createElementVNode("button", {
|
|
842
|
+
class: "h-9 px-4 bg-white text-black font-bold border-2 border-black rounded shadow-hard-sm hover:shadow-none hover:translate-x-0.5 hover:translate-y-0.5 transition-all flex items-center gap-1.5 text-sm",
|
|
843
|
+
onClick: handlePaste
|
|
844
|
+
}, [..._cache[5] || (_cache[5] = [
|
|
845
|
+
createElementVNode(
|
|
846
|
+
"span",
|
|
847
|
+
{ class: "material-icons text-lg" },
|
|
848
|
+
"content_paste",
|
|
849
|
+
-1
|
|
850
|
+
/* CACHED */
|
|
851
|
+
),
|
|
852
|
+
createTextVNode(
|
|
853
|
+
" 粘贴 ",
|
|
854
|
+
-1
|
|
855
|
+
/* CACHED */
|
|
856
|
+
)
|
|
857
|
+
])]),
|
|
858
|
+
createElementVNode("button", {
|
|
859
|
+
class: "h-9 px-4 bg-coral-red text-white font-bold border-2 border-black rounded shadow-hard-sm hover:shadow-none hover:translate-x-0.5 hover:translate-y-0.5 transition-all flex items-center gap-1.5 text-sm",
|
|
860
|
+
onClick: handleClear
|
|
861
|
+
}, [..._cache[6] || (_cache[6] = [
|
|
862
|
+
createElementVNode(
|
|
863
|
+
"span",
|
|
864
|
+
{ class: "material-icons text-lg" },
|
|
865
|
+
"delete_outline",
|
|
866
|
+
-1
|
|
867
|
+
/* CACHED */
|
|
868
|
+
),
|
|
869
|
+
createTextVNode(
|
|
870
|
+
" 清空 ",
|
|
871
|
+
-1
|
|
872
|
+
/* CACHED */
|
|
873
|
+
)
|
|
874
|
+
])]),
|
|
875
|
+
createElementVNode("div", { class: "ml-auto flex items-center gap-2" }, [
|
|
876
|
+
createElementVNode("button", {
|
|
877
|
+
class: "h-9 px-3 bg-deep-charcoal text-gray-300 font-bold border-2 border-white/20 rounded hover:border-primary hover:text-primary transition-all text-sm flex items-center gap-1.5",
|
|
878
|
+
onClick: loadSample
|
|
879
|
+
}, [..._cache[7] || (_cache[7] = [
|
|
880
|
+
createElementVNode(
|
|
881
|
+
"span",
|
|
882
|
+
{ class: "material-icons text-lg" },
|
|
883
|
+
"science",
|
|
884
|
+
-1
|
|
885
|
+
/* CACHED */
|
|
886
|
+
),
|
|
887
|
+
createTextVNode(
|
|
888
|
+
" 示例 ",
|
|
889
|
+
-1
|
|
890
|
+
/* CACHED */
|
|
891
|
+
)
|
|
892
|
+
])])
|
|
893
|
+
])
|
|
894
|
+
]),
|
|
895
|
+
createCommentVNode(" Error bar "),
|
|
896
|
+
errorMsg.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
897
|
+
_cache[8] || (_cache[8] = createElementVNode(
|
|
898
|
+
"span",
|
|
899
|
+
{ class: "material-icons text-lg" },
|
|
900
|
+
"error_outline",
|
|
901
|
+
-1
|
|
902
|
+
/* CACHED */
|
|
903
|
+
)),
|
|
904
|
+
createTextVNode(
|
|
905
|
+
" " + toDisplayString(errorMsg.value),
|
|
906
|
+
1
|
|
907
|
+
/* TEXT */
|
|
908
|
+
)
|
|
909
|
+
])) : createCommentVNode("v-if", true),
|
|
910
|
+
createCommentVNode(" Editor panels "),
|
|
911
|
+
createElementVNode("div", _hoisted_5, [
|
|
912
|
+
createCommentVNode(" Input "),
|
|
913
|
+
createElementVNode("div", _hoisted_6, [
|
|
914
|
+
_cache[9] || (_cache[9] = createElementVNode(
|
|
915
|
+
"div",
|
|
916
|
+
{ class: "flex items-center gap-2 mb-2" },
|
|
917
|
+
[
|
|
918
|
+
createElementVNode("span", { class: "material-icons text-primary text-lg" }, "edit_note"),
|
|
919
|
+
createElementVNode("span", { class: "text-sm font-bold text-gray-400 uppercase tracking-wider" }, "输入")
|
|
920
|
+
],
|
|
921
|
+
-1
|
|
922
|
+
/* CACHED */
|
|
923
|
+
)),
|
|
924
|
+
withDirectives(createElementVNode(
|
|
925
|
+
"textarea",
|
|
926
|
+
{
|
|
927
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputJson.value = $event),
|
|
928
|
+
placeholder: "在此粘贴或输入 JSON...",
|
|
929
|
+
spellcheck: "false",
|
|
930
|
+
class: "flex-1 w-full bg-deep-charcoal text-gray-100 border-4 border-black rounded-xl p-4 font-mono text-sm leading-relaxed resize-none shadow-hard focus:border-primary focus:shadow-none focus:translate-x-[4px] focus:translate-y-[4px] transition-all outline-none placeholder-gray-600 min-h-[200px]"
|
|
931
|
+
},
|
|
932
|
+
null,
|
|
933
|
+
512
|
|
934
|
+
/* NEED_PATCH */
|
|
935
|
+
), [
|
|
936
|
+
[vModelText, inputJson.value]
|
|
937
|
+
])
|
|
938
|
+
]),
|
|
939
|
+
createCommentVNode(" Visual Output "),
|
|
940
|
+
createElementVNode("div", _hoisted_7, [
|
|
941
|
+
createElementVNode("div", _hoisted_8, [
|
|
942
|
+
_cache[13] || (_cache[13] = createElementVNode(
|
|
943
|
+
"span",
|
|
944
|
+
{ class: "material-icons text-neon-green text-lg" },
|
|
945
|
+
"account_tree",
|
|
946
|
+
-1
|
|
947
|
+
/* CACHED */
|
|
948
|
+
)),
|
|
949
|
+
_cache[14] || (_cache[14] = createElementVNode(
|
|
950
|
+
"span",
|
|
951
|
+
{ class: "text-sm font-bold text-gray-400 uppercase tracking-wider" },
|
|
952
|
+
"可视化",
|
|
953
|
+
-1
|
|
954
|
+
/* CACHED */
|
|
955
|
+
)),
|
|
956
|
+
createElementVNode("div", _hoisted_9, [
|
|
957
|
+
createElementVNode("label", _hoisted_10, [
|
|
958
|
+
withDirectives(createElementVNode(
|
|
959
|
+
"input",
|
|
960
|
+
{
|
|
961
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => showLineNumber.value = $event),
|
|
962
|
+
type: "checkbox",
|
|
963
|
+
class: "accent-primary w-3.5 h-3.5"
|
|
964
|
+
},
|
|
965
|
+
null,
|
|
966
|
+
512
|
|
967
|
+
/* NEED_PATCH */
|
|
968
|
+
), [
|
|
969
|
+
[vModelCheckbox, showLineNumber.value]
|
|
970
|
+
]),
|
|
971
|
+
_cache[10] || (_cache[10] = createTextVNode(
|
|
972
|
+
" 行号 ",
|
|
973
|
+
-1
|
|
974
|
+
/* CACHED */
|
|
975
|
+
))
|
|
976
|
+
]),
|
|
977
|
+
createElementVNode("label", _hoisted_11, [
|
|
978
|
+
_cache[12] || (_cache[12] = createTextVNode(
|
|
979
|
+
" 深度 ",
|
|
980
|
+
-1
|
|
981
|
+
/* CACHED */
|
|
982
|
+
)),
|
|
983
|
+
withDirectives(createElementVNode(
|
|
984
|
+
"select",
|
|
985
|
+
{
|
|
986
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => deepLevel.value = $event),
|
|
987
|
+
class: "bg-deep-charcoal text-white border border-white/20 rounded px-1.5 py-0.5 text-xs focus:border-primary outline-none"
|
|
988
|
+
},
|
|
989
|
+
[..._cache[11] || (_cache[11] = [
|
|
990
|
+
createElementVNode(
|
|
991
|
+
"option",
|
|
992
|
+
{ value: 1 },
|
|
993
|
+
"1",
|
|
994
|
+
-1
|
|
995
|
+
/* CACHED */
|
|
996
|
+
),
|
|
997
|
+
createElementVNode(
|
|
998
|
+
"option",
|
|
999
|
+
{ value: 2 },
|
|
1000
|
+
"2",
|
|
1001
|
+
-1
|
|
1002
|
+
/* CACHED */
|
|
1003
|
+
),
|
|
1004
|
+
createElementVNode(
|
|
1005
|
+
"option",
|
|
1006
|
+
{ value: 3 },
|
|
1007
|
+
"3",
|
|
1008
|
+
-1
|
|
1009
|
+
/* CACHED */
|
|
1010
|
+
),
|
|
1011
|
+
createElementVNode(
|
|
1012
|
+
"option",
|
|
1013
|
+
{ value: 5 },
|
|
1014
|
+
"5",
|
|
1015
|
+
-1
|
|
1016
|
+
/* CACHED */
|
|
1017
|
+
),
|
|
1018
|
+
createElementVNode(
|
|
1019
|
+
"option",
|
|
1020
|
+
{ value: Infinity },
|
|
1021
|
+
"全部",
|
|
1022
|
+
-1
|
|
1023
|
+
/* CACHED */
|
|
1024
|
+
)
|
|
1025
|
+
])],
|
|
1026
|
+
512
|
|
1027
|
+
/* NEED_PATCH */
|
|
1028
|
+
), [
|
|
1029
|
+
[vModelSelect, deepLevel.value]
|
|
1030
|
+
])
|
|
1031
|
+
])
|
|
1032
|
+
])
|
|
1033
|
+
]),
|
|
1034
|
+
createElementVNode("div", _hoisted_12, [
|
|
1035
|
+
parsedData.value !== void 0 ? (openBlock(), createBlock(unref(P), {
|
|
1036
|
+
key: 0,
|
|
1037
|
+
data: parsedData.value,
|
|
1038
|
+
deep: deepLevel.value,
|
|
1039
|
+
"show-line-number": showLineNumber.value,
|
|
1040
|
+
"show-length": true,
|
|
1041
|
+
"show-icon": true,
|
|
1042
|
+
"show-double-quotes": true,
|
|
1043
|
+
"collapsed-on-click-brackets": true,
|
|
1044
|
+
theme: "dark"
|
|
1045
|
+
}, null, 8, ["data", "deep", "show-line-number"])) : !errorMsg.value ? (openBlock(), createElementBlock("div", _hoisted_13, " 可视化结果将显示在这里... ")) : (openBlock(), createElementBlock("div", _hoisted_14, " JSON 解析失败,请检查输入 "))
|
|
1046
|
+
])
|
|
1047
|
+
])
|
|
1048
|
+
])
|
|
1049
|
+
]);
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1053
|
+
const _export_sfc = (sfc, props) => {
|
|
1054
|
+
const target = sfc.__vccOpts || sfc;
|
|
1055
|
+
for (const [key, val] of props) {
|
|
1056
|
+
target[key] = val;
|
|
1057
|
+
}
|
|
1058
|
+
return target;
|
|
1059
|
+
};
|
|
1060
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-306b8d9e"]]);
|
|
1061
|
+
export {
|
|
1062
|
+
index as default
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1065
|
+
;(function(){var s=document.createElement("style");s.textContent=`.vjs-tree-brackets{cursor:pointer}.vjs-tree-brackets:hover{color:#1890ff}.vjs-check-controller{position:absolute;left:0}.vjs-check-controller.is-checked .vjs-check-controller-inner{background-color:#1890ff;border-color:#0076e4}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-checkbox:after{transform:rotate(45deg) scaleY(1)}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-radio:after{transform:translate(-50%,-50%) scale(1)}.vjs-check-controller .vjs-check-controller-inner{display:inline-block;position:relative;border:1px solid #bfcbd9;border-radius:2px;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;background-color:#fff;z-index:1;cursor:pointer;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.vjs-check-controller .vjs-check-controller-inner:after{box-sizing:content-box;content:"";border:2px solid #fff;border-left:0;border-top:0;height:8px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:4px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;transform-origin:center}.vjs-check-controller .vjs-check-controller-inner.is-radio{border-radius:100%}.vjs-check-controller .vjs-check-controller-inner.is-radio:after{border-radius:100%;height:4px;background-color:#fff;left:50%;top:50%}.vjs-check-controller .vjs-check-controller-original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.vjs-carets{position:absolute;right:0;cursor:pointer}.vjs-carets svg{transition:transform .3s}.vjs-carets:hover{color:#1890ff}.vjs-carets-close{transform:rotate(-90deg)}.vjs-tree-node{display:flex;position:relative;line-height:20px}.vjs-tree-node.has-carets{padding-left:15px}.vjs-tree-node.has-carets.has-selector,.vjs-tree-node.has-selector{padding-left:30px}.vjs-tree-node.is-highlight,.vjs-tree-node:hover{background-color:#e6f7ff;border-radius:4px}.vjs-tree-node.is-highlight .vjs-tree-node-actions,.vjs-tree-node:hover .vjs-tree-node-actions{display:block}.vjs-tree-node .vjs-indent{display:flex;position:relative}.vjs-tree-node .vjs-indent-unit.has-line{border-left:1px dashed #bfcbd9}.vjs-tree-node .vjs-tree-node-actions{display:none;position:absolute;right:0;top:0;padding:0 4px;background-color:#e6f7ff;border-radius:4px}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item{cursor:pointer}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item:hover{color:#1890ff}.vjs-tree-node.dark.is-highlight,.vjs-tree-node.dark .vjs-tree-node-actions,.vjs-tree-node.dark:hover{background-color:#2e4558}.vjs-node-index{position:absolute;right:100%;margin-right:4px;user-select:none}.vjs-colon{white-space:pre}.vjs-comment{color:#bfcbd9}.vjs-key{white-space:nowrap}.vjs-value{word-break:break-word}.vjs-tree-node.dynamic-height .vjs-value{white-space:pre-wrap}.vjs-value-null,.vjs-value-undefined{color:#d55fde}.vjs-value-boolean,.vjs-value-number{color:#1d8ce0}.vjs-value-string{color:#13ce66}.vjs-tree{font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px;text-align:left}.vjs-tree.is-virtual{overflow:auto}.vjs-tree.is-virtual .vjs-tree-node{white-space:nowrap}
|
|
1066
|
+
/* vue-json-pretty 深色主题覆盖 */
|
|
1067
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-tree {
|
|
1068
|
+
font-family: 'Space Grotesk', ui-monospace, monospace;
|
|
1069
|
+
font-size: 13px;
|
|
1070
|
+
color: #e5e7eb;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
/* 节点行高 + 垂直间距 */
|
|
1074
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-tree-node {
|
|
1075
|
+
line-height: 28px;
|
|
1076
|
+
padding: 2px 0;
|
|
1077
|
+
}
|
|
1078
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-tree-node:hover,
|
|
1079
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-tree-node.dark:hover {
|
|
1080
|
+
background-color: rgba(249, 177, 31, 0.08);
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/* 层级缩进加宽 */
|
|
1084
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-indent-unit {
|
|
1085
|
+
width: 24px;
|
|
1086
|
+
}
|
|
1087
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-indent-unit.has-line {
|
|
1088
|
+
border-left: 1px dashed #374151;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
/* key */
|
|
1092
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-key {
|
|
1093
|
+
color: #f9b11f;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
/* 值类型颜色 */
|
|
1097
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-value-string {
|
|
1098
|
+
color: #84cc16;
|
|
1099
|
+
}
|
|
1100
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-value-number {
|
|
1101
|
+
color: #3b82f6;
|
|
1102
|
+
}
|
|
1103
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-value-boolean {
|
|
1104
|
+
color: #a855f7;
|
|
1105
|
+
}
|
|
1106
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-value-null,
|
|
1107
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-value-undefined {
|
|
1108
|
+
color: #6b7280;
|
|
1109
|
+
font-style: italic;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/* 括号 */
|
|
1113
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-tree-brackets {
|
|
1114
|
+
color: #9ca3af;
|
|
1115
|
+
}
|
|
1116
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-tree-brackets:hover {
|
|
1117
|
+
color: #f9b11f;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/* 折叠箭头 */
|
|
1121
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-carets {
|
|
1122
|
+
color: #6b7280;
|
|
1123
|
+
}
|
|
1124
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-carets:hover {
|
|
1125
|
+
color: #f9b11f;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
/* 长度提示 */
|
|
1129
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-comment {
|
|
1130
|
+
color: #6b7280;
|
|
1131
|
+
font-style: italic;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/* 行号 */
|
|
1135
|
+
.json-viewer-panel[data-v-306b8d9e] .vjs-node-index {
|
|
1136
|
+
color: #4b5563;
|
|
1137
|
+
}
|
|
1138
|
+
`;document.head.appendChild(s)})();
|