@scalar/components 0.4.11 → 0.5.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.
- package/README.md +35 -35
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +33 -33
- package/dist/index.js +255 -255
- package/dist/main.css +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineComponent as y, useCssVars as W, openBlock as
|
|
3
|
-
import { defineConfig as
|
|
4
|
-
import { extendTailwindMerge as
|
|
5
|
-
import { createHash as
|
|
1
|
+
import './main.css';
|
|
2
|
+
import { defineComponent as y, useCssVars as W, openBlock as g, createElementBlock as v, normalizeClass as h, unref as d, createElementVNode as k, createCommentVNode as E, createStaticVNode as X, reactive as $, computed as z, useAttrs as H, mergeProps as M, renderSlot as T, createVNode as C, ref as x, watch as q, nextTick as K, onServerPrefetch as Y, useSSRContext as J, onMounted as B, toDisplayString as N, defineAsyncComponent as Z, createBlock as L, resolveDynamicComponent as G, withCtx as A, normalizeStyle as F, createTextVNode as Q, withKeys as ee } from "vue";
|
|
3
|
+
import { defineConfig as ae } from "cva";
|
|
4
|
+
import { extendTailwindMerge as re } from "tailwind-merge";
|
|
5
|
+
import { createHash as te, ssrState as ne } from "@scalar/oas-utils";
|
|
6
6
|
import _ from "prismjs";
|
|
7
|
-
import { Dialog as
|
|
8
|
-
import { useTextareaAutosize as
|
|
9
|
-
import { nanoid as
|
|
10
|
-
const O = "scalar-component",
|
|
7
|
+
import { Dialog as oe, DialogPanel as se, DialogTitle as ie, DialogDescription as le } from "@headlessui/vue";
|
|
8
|
+
import { useTextareaAutosize as ce } from "@vueuse/core";
|
|
9
|
+
import { nanoid as de } from "nanoid";
|
|
10
|
+
const O = "scalar-component", pe = re({
|
|
11
11
|
extend: {
|
|
12
12
|
classGroups: {
|
|
13
13
|
// Add the scalar class prefix as a custom class to be deduped by tailwind-merge
|
|
14
14
|
[O]: [O]
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
}), { cva: I, cx: S, compose:
|
|
17
|
+
}), { cva: I, cx: S, compose: Ge } = ae({
|
|
18
18
|
hooks: {
|
|
19
|
-
onComplete: (
|
|
19
|
+
onComplete: (r) => `${pe(r, O)}`
|
|
20
20
|
}
|
|
21
|
-
}),
|
|
21
|
+
}), ue = /* @__PURE__ */ X('<path class="svg-path svg-check-mark" d="m 0 60 l 30 30 l 70 -80" data-v-47faceda></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 -40" data-v-47faceda></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 40" data-v-47faceda></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 -40" data-v-47faceda></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 40" data-v-47faceda></path>', 5), ge = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "circular-loader"
|
|
24
24
|
};
|
|
25
|
-
function
|
|
26
|
-
return
|
|
25
|
+
function Fe() {
|
|
26
|
+
return $({
|
|
27
27
|
isValid: !1,
|
|
28
28
|
isInvalid: !1,
|
|
29
29
|
isLoading: !1,
|
|
@@ -33,56 +33,56 @@ function Ue() {
|
|
|
33
33
|
stopLoading() {
|
|
34
34
|
this.isLoading = !1;
|
|
35
35
|
},
|
|
36
|
-
validate(
|
|
36
|
+
validate(r = 800) {
|
|
37
37
|
this.isValid = !0;
|
|
38
|
-
const
|
|
38
|
+
const a = r - 300;
|
|
39
39
|
return new Promise(
|
|
40
|
-
(e) => setTimeout(() => this.clear().then(() => e(!0)),
|
|
40
|
+
(e) => setTimeout(() => this.clear().then(() => e(!0)), a)
|
|
41
41
|
);
|
|
42
42
|
},
|
|
43
|
-
invalidate(
|
|
43
|
+
invalidate(r = 1100) {
|
|
44
44
|
this.isInvalid = !0;
|
|
45
|
-
const
|
|
45
|
+
const a = r - 300;
|
|
46
46
|
return new Promise(
|
|
47
|
-
(e) => setTimeout(() => this.clear().then(() => e(!0)),
|
|
47
|
+
(e) => setTimeout(() => this.clear().then(() => e(!0)), a)
|
|
48
48
|
);
|
|
49
49
|
},
|
|
50
|
-
clear(
|
|
51
|
-
return this.isValid = !1, this.isInvalid = !1, this.isLoading = !1, new Promise((
|
|
50
|
+
clear(r = 300) {
|
|
51
|
+
return this.isValid = !1, this.isInvalid = !1, this.isLoading = !1, new Promise((a) => {
|
|
52
52
|
setTimeout(() => {
|
|
53
|
-
|
|
54
|
-
},
|
|
53
|
+
a(!0);
|
|
54
|
+
}, r);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
const
|
|
59
|
+
const me = /* @__PURE__ */ y({
|
|
60
60
|
__name: "ScalarLoading",
|
|
61
61
|
props: {
|
|
62
62
|
loadingState: {},
|
|
63
63
|
size: { default: "24px" }
|
|
64
64
|
},
|
|
65
|
-
setup(
|
|
66
|
-
return W((
|
|
67
|
-
|
|
68
|
-
})), (
|
|
65
|
+
setup(r) {
|
|
66
|
+
return W((a) => ({
|
|
67
|
+
d6cae758: a.size
|
|
68
|
+
})), (a, e) => a.loadingState ? (g(), v("div", {
|
|
69
69
|
key: 0,
|
|
70
|
-
class: h(
|
|
70
|
+
class: h(d(S)("loader-wrapper"))
|
|
71
71
|
}, [
|
|
72
|
-
(
|
|
72
|
+
(g(), v("svg", {
|
|
73
73
|
class: h(["svg-loader", {
|
|
74
|
-
"icon-is-valid":
|
|
75
|
-
"icon-is-invalid":
|
|
74
|
+
"icon-is-valid": a.loadingState.isValid,
|
|
75
|
+
"icon-is-invalid": a.loadingState.isInvalid
|
|
76
76
|
}]),
|
|
77
77
|
viewBox: "0 0 100 100",
|
|
78
78
|
xmlns: "http://www.w3.org/2000/svg",
|
|
79
79
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
80
80
|
}, [
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
ue,
|
|
82
|
+
a.loadingState.isLoading ? (g(), v("g", ge, [
|
|
83
83
|
k("circle", {
|
|
84
84
|
class: h(["loader-path", {
|
|
85
|
-
"loader-path-off":
|
|
85
|
+
"loader-path-off": a.loadingState.isValid || a.loadingState.isInvalid
|
|
86
86
|
}]),
|
|
87
87
|
cx: "50",
|
|
88
88
|
cy: "50",
|
|
@@ -94,12 +94,12 @@ const ge = /* @__PURE__ */ y({
|
|
|
94
94
|
], 2))
|
|
95
95
|
], 2)) : E("", !0);
|
|
96
96
|
}
|
|
97
|
-
}), D = (
|
|
98
|
-
const e =
|
|
99
|
-
for (const [i,
|
|
100
|
-
e[i] =
|
|
97
|
+
}), D = (r, a) => {
|
|
98
|
+
const e = r.__vccOpts || r;
|
|
99
|
+
for (const [i, m] of a)
|
|
100
|
+
e[i] = m;
|
|
101
101
|
return e;
|
|
102
|
-
}, U = /* @__PURE__ */ D(
|
|
102
|
+
}, U = /* @__PURE__ */ D(me, [["__scopeId", "data-v-47faceda"]]), V = {
|
|
103
103
|
solid: [
|
|
104
104
|
"scalar-button-solid",
|
|
105
105
|
"bg-back-btn-1 text-fore-btn-1 shadow-sm active:bg-back-btn-1 active:shadow-none hocus:bg-hover-btn-1"
|
|
@@ -149,26 +149,26 @@ const ge = /* @__PURE__ */ y({
|
|
|
149
149
|
size: { default: "md" },
|
|
150
150
|
variant: { default: "solid" }
|
|
151
151
|
},
|
|
152
|
-
setup(
|
|
153
|
-
const
|
|
152
|
+
setup(r) {
|
|
153
|
+
const a = z(() => {
|
|
154
154
|
const { class: e, ...i } = H();
|
|
155
155
|
return { className: e || "", rest: i };
|
|
156
156
|
});
|
|
157
|
-
return (e, i) => (
|
|
157
|
+
return (e, i) => (g(), v("button", M(a.value.rest, {
|
|
158
158
|
ariaDisabled: e.disabled || void 0,
|
|
159
|
-
class:
|
|
160
|
-
|
|
159
|
+
class: d(S)(
|
|
160
|
+
d(he)({ fullWidth: e.fullWidth, disabled: e.disabled, size: e.size, variant: e.variant }),
|
|
161
161
|
{ "pl-9 pr-3": e.loading },
|
|
162
|
-
`${
|
|
162
|
+
`${a.value.className}`
|
|
163
163
|
),
|
|
164
164
|
type: "button"
|
|
165
165
|
}), [
|
|
166
|
-
e.$slots.icon ? (
|
|
166
|
+
e.$slots.icon ? (g(), v("div", ve, [
|
|
167
167
|
T(e.$slots, "icon")
|
|
168
168
|
])) : E("", !0),
|
|
169
169
|
T(e.$slots, "default"),
|
|
170
|
-
e.loading ? (
|
|
171
|
-
|
|
170
|
+
e.loading ? (g(), v("div", be, [
|
|
171
|
+
C(d(U), {
|
|
172
172
|
loadingState: e.loading,
|
|
173
173
|
size: "20px"
|
|
174
174
|
}, null, 8, ["loadingState"])
|
|
@@ -176,8 +176,8 @@ const ge = /* @__PURE__ */ y({
|
|
|
176
176
|
], 16, fe));
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
|
-
(function(
|
|
180
|
-
var
|
|
179
|
+
(function(r) {
|
|
180
|
+
var a = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", e = {
|
|
181
181
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
182
182
|
lookbehind: !0,
|
|
183
183
|
alias: "punctuation",
|
|
@@ -187,7 +187,7 @@ const ge = /* @__PURE__ */ y({
|
|
|
187
187
|
}, i = {
|
|
188
188
|
bash: e,
|
|
189
189
|
environment: {
|
|
190
|
-
pattern: RegExp("\\$" +
|
|
190
|
+
pattern: RegExp("\\$" + a),
|
|
191
191
|
alias: "constant"
|
|
192
192
|
},
|
|
193
193
|
variable: [
|
|
@@ -227,7 +227,7 @@ const ge = /* @__PURE__ */ y({
|
|
|
227
227
|
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
228
228
|
punctuation: /[\[\]]/,
|
|
229
229
|
environment: {
|
|
230
|
-
pattern: RegExp("(\\{)" +
|
|
230
|
+
pattern: RegExp("(\\{)" + a),
|
|
231
231
|
lookbehind: !0,
|
|
232
232
|
alias: "constant"
|
|
233
233
|
}
|
|
@@ -238,7 +238,7 @@ const ge = /* @__PURE__ */ y({
|
|
|
238
238
|
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
239
239
|
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
240
240
|
};
|
|
241
|
-
|
|
241
|
+
r.languages.bash = {
|
|
242
242
|
shebang: {
|
|
243
243
|
pattern: /^#!\s*\/.*/,
|
|
244
244
|
alias: "important"
|
|
@@ -276,7 +276,7 @@ const ge = /* @__PURE__ */ y({
|
|
|
276
276
|
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
|
277
277
|
inside: {
|
|
278
278
|
environment: {
|
|
279
|
-
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" +
|
|
279
|
+
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + a),
|
|
280
280
|
lookbehind: !0,
|
|
281
281
|
alias: "constant"
|
|
282
282
|
}
|
|
@@ -332,7 +332,7 @@ const ge = /* @__PURE__ */ y({
|
|
|
332
332
|
}
|
|
333
333
|
],
|
|
334
334
|
environment: {
|
|
335
|
-
pattern: RegExp("\\$?" +
|
|
335
|
+
pattern: RegExp("\\$?" + a),
|
|
336
336
|
alias: "constant"
|
|
337
337
|
},
|
|
338
338
|
variable: i.variable,
|
|
@@ -374,8 +374,8 @@ const ge = /* @__PURE__ */ y({
|
|
|
374
374
|
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
375
375
|
lookbehind: !0
|
|
376
376
|
}
|
|
377
|
-
}, e.inside =
|
|
378
|
-
for (var
|
|
377
|
+
}, e.inside = r.languages.bash;
|
|
378
|
+
for (var m = [
|
|
379
379
|
"comment",
|
|
380
380
|
"function-name",
|
|
381
381
|
"for-or-select",
|
|
@@ -391,9 +391,9 @@ const ge = /* @__PURE__ */ y({
|
|
|
391
391
|
"operator",
|
|
392
392
|
"punctuation",
|
|
393
393
|
"number"
|
|
394
|
-
], b = i.variable[1].inside, s = 0; s <
|
|
395
|
-
b[
|
|
396
|
-
|
|
394
|
+
], b = i.variable[1].inside, s = 0; s < m.length; s++)
|
|
395
|
+
b[m[s]] = r.languages.bash[m[s]];
|
|
396
|
+
r.languages.sh = r.languages.bash, r.languages.shell = r.languages.bash;
|
|
397
397
|
})(Prism);
|
|
398
398
|
Prism.languages.json = {
|
|
399
399
|
property: {
|
|
@@ -423,7 +423,7 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
423
423
|
(function() {
|
|
424
424
|
if (typeof Prism > "u" || typeof document > "u")
|
|
425
425
|
return;
|
|
426
|
-
var
|
|
426
|
+
var r = "line-numbers", a = /\n(?!$)/g, e = Prism.plugins.lineNumbers = {
|
|
427
427
|
/**
|
|
428
428
|
* Get node for provided line number
|
|
429
429
|
*
|
|
@@ -431,14 +431,14 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
431
431
|
* @param {number} number line number
|
|
432
432
|
* @returns {Element|undefined}
|
|
433
433
|
*/
|
|
434
|
-
getLine: function(s,
|
|
435
|
-
if (!(s.tagName !== "PRE" || !s.classList.contains(
|
|
436
|
-
var
|
|
437
|
-
if (
|
|
438
|
-
var l = parseInt(s.getAttribute("data-start"), 10) || 1,
|
|
439
|
-
|
|
440
|
-
var
|
|
441
|
-
return
|
|
434
|
+
getLine: function(s, c) {
|
|
435
|
+
if (!(s.tagName !== "PRE" || !s.classList.contains(r))) {
|
|
436
|
+
var n = s.querySelector(".line-numbers-rows");
|
|
437
|
+
if (n) {
|
|
438
|
+
var l = parseInt(s.getAttribute("data-start"), 10) || 1, p = l + (n.children.length - 1);
|
|
439
|
+
c < l && (c = l), c > p && (c = p);
|
|
440
|
+
var t = c - l;
|
|
441
|
+
return n.children[t];
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
},
|
|
@@ -466,71 +466,71 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
466
466
|
assumeViewportIndependence: !0
|
|
467
467
|
};
|
|
468
468
|
function i(s) {
|
|
469
|
-
if (s = s.filter(function(
|
|
470
|
-
var l =
|
|
471
|
-
return
|
|
469
|
+
if (s = s.filter(function(n) {
|
|
470
|
+
var l = m(n), p = l["white-space"];
|
|
471
|
+
return p === "pre-wrap" || p === "pre-line";
|
|
472
472
|
}), s.length != 0) {
|
|
473
|
-
var
|
|
474
|
-
var l =
|
|
475
|
-
if (!(!l || !
|
|
476
|
-
var
|
|
477
|
-
|
|
478
|
-
var
|
|
479
|
-
return
|
|
480
|
-
element:
|
|
481
|
-
lines:
|
|
473
|
+
var c = s.map(function(n) {
|
|
474
|
+
var l = n.querySelector("code"), p = n.querySelector(".line-numbers-rows");
|
|
475
|
+
if (!(!l || !p)) {
|
|
476
|
+
var t = n.querySelector(".line-numbers-sizer"), u = l.textContent.split(a);
|
|
477
|
+
t || (t = document.createElement("span"), t.className = "line-numbers-sizer", l.appendChild(t)), t.innerHTML = "0", t.style.display = "block";
|
|
478
|
+
var o = t.getBoundingClientRect().height;
|
|
479
|
+
return t.innerHTML = "", {
|
|
480
|
+
element: n,
|
|
481
|
+
lines: u,
|
|
482
482
|
lineHeights: [],
|
|
483
|
-
oneLinerHeight:
|
|
484
|
-
sizer:
|
|
483
|
+
oneLinerHeight: o,
|
|
484
|
+
sizer: t
|
|
485
485
|
};
|
|
486
486
|
}
|
|
487
487
|
}).filter(Boolean);
|
|
488
|
-
|
|
489
|
-
var l =
|
|
490
|
-
|
|
491
|
-
if (
|
|
488
|
+
c.forEach(function(n) {
|
|
489
|
+
var l = n.sizer, p = n.lines, t = n.lineHeights, u = n.oneLinerHeight;
|
|
490
|
+
t[p.length - 1] = void 0, p.forEach(function(o, f) {
|
|
491
|
+
if (o && o.length > 1) {
|
|
492
492
|
var w = l.appendChild(document.createElement("span"));
|
|
493
|
-
w.style.display = "block", w.textContent =
|
|
493
|
+
w.style.display = "block", w.textContent = o;
|
|
494
494
|
} else
|
|
495
|
-
|
|
495
|
+
t[f] = u;
|
|
496
496
|
});
|
|
497
|
-
}),
|
|
498
|
-
for (var l =
|
|
499
|
-
u
|
|
500
|
-
}),
|
|
501
|
-
var l =
|
|
502
|
-
l.style.display = "none", l.innerHTML = "",
|
|
503
|
-
|
|
497
|
+
}), c.forEach(function(n) {
|
|
498
|
+
for (var l = n.sizer, p = n.lineHeights, t = 0, u = 0; u < p.length; u++)
|
|
499
|
+
p[u] === void 0 && (p[u] = l.children[t++].getBoundingClientRect().height);
|
|
500
|
+
}), c.forEach(function(n) {
|
|
501
|
+
var l = n.sizer, p = n.element.querySelector(".line-numbers-rows");
|
|
502
|
+
l.style.display = "none", l.innerHTML = "", n.lineHeights.forEach(function(t, u) {
|
|
503
|
+
p.children[u].style.height = t + "px";
|
|
504
504
|
});
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function m(s) {
|
|
509
509
|
return s ? window.getComputedStyle ? getComputedStyle(s) : s.currentStyle || null : null;
|
|
510
510
|
}
|
|
511
511
|
var b = void 0;
|
|
512
512
|
window.addEventListener("resize", function() {
|
|
513
|
-
e.assumeViewportIndependence && b === window.innerWidth || (b = window.innerWidth, i(Array.prototype.slice.call(document.querySelectorAll("pre." +
|
|
513
|
+
e.assumeViewportIndependence && b === window.innerWidth || (b = window.innerWidth, i(Array.prototype.slice.call(document.querySelectorAll("pre." + r))));
|
|
514
514
|
}), Prism.hooks.add("complete", function(s) {
|
|
515
515
|
if (s.code) {
|
|
516
|
-
var
|
|
516
|
+
var c = (
|
|
517
517
|
/** @type {Element} */
|
|
518
518
|
s.element
|
|
519
|
-
),
|
|
519
|
+
), n = (
|
|
520
520
|
/** @type {HTMLElement} */
|
|
521
|
-
|
|
521
|
+
c.parentNode
|
|
522
522
|
);
|
|
523
|
-
if (!(!
|
|
524
|
-
|
|
525
|
-
var l = s.code.match(
|
|
526
|
-
|
|
523
|
+
if (!(!n || !/pre/i.test(n.nodeName)) && !c.querySelector(".line-numbers-rows") && Prism.util.isActive(c, r)) {
|
|
524
|
+
c.classList.remove(r), n.classList.add(r);
|
|
525
|
+
var l = s.code.match(a), p = l ? l.length + 1 : 1, t, u = new Array(p + 1).join("<span></span>");
|
|
526
|
+
t = document.createElement("span"), t.setAttribute("aria-hidden", "true"), t.className = "line-numbers-rows", t.innerHTML = u, n.hasAttribute("data-start") && (n.style.counterReset = "linenumber " + (parseInt(n.getAttribute("data-start"), 10) - 1)), s.element.appendChild(t), i([n]), Prism.hooks.run("line-numbers", s);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
529
|
}), Prism.hooks.add("line-numbers", function(s) {
|
|
530
530
|
s.plugins = s.plugins || {}, s.plugins.lineNumbers = !0;
|
|
531
531
|
});
|
|
532
532
|
})();
|
|
533
|
-
const we = ["innerHTML"],
|
|
533
|
+
const we = ["innerHTML"], Ue = /* @__PURE__ */ y({
|
|
534
534
|
__name: "ScalarCodeBlock",
|
|
535
535
|
props: {
|
|
536
536
|
content: {},
|
|
@@ -538,84 +538,84 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
538
538
|
lineNumbers: { type: Boolean, default: !1 },
|
|
539
539
|
hideCredentials: {}
|
|
540
540
|
},
|
|
541
|
-
setup(
|
|
542
|
-
const
|
|
543
|
-
typeof
|
|
544
|
-
), i = `components-scalar-code-block${e}`, { plugins:
|
|
545
|
-
|
|
546
|
-
if (!
|
|
541
|
+
setup(r) {
|
|
542
|
+
const a = r, e = te(
|
|
543
|
+
typeof a.content == "object" ? JSON.stringify(a.content) : a.content
|
|
544
|
+
), i = `components-scalar-code-block${e}`, { plugins: m, highlightElement: b } = _;
|
|
545
|
+
a.hideCredentials && _.hooks.add("wrap", function(t) {
|
|
546
|
+
if (!a.hideCredentials)
|
|
547
547
|
return;
|
|
548
|
-
let
|
|
549
|
-
typeof
|
|
550
|
-
(
|
|
551
|
-
)),
|
|
548
|
+
let u = !1;
|
|
549
|
+
typeof a.hideCredentials == "string" ? t.content.includes(a.hideCredentials) && (u = !0) : Array.isArray(a.hideCredentials) && (u = a.hideCredentials.some(
|
|
550
|
+
(o) => t.content.includes(o)
|
|
551
|
+
)), u && (t.content = t.content.replace(
|
|
552
552
|
/<span class="credentials">.*?<\/span>/g,
|
|
553
|
-
(
|
|
554
|
-
),
|
|
553
|
+
(o) => o.replace(/<span class="credentials">|<\/span>/g, "")
|
|
554
|
+
), t.content = t.content.replace(
|
|
555
555
|
new RegExp(
|
|
556
|
-
typeof
|
|
556
|
+
typeof a.hideCredentials == "string" ? a.hideCredentials : a.hideCredentials.join("|"),
|
|
557
557
|
"g"
|
|
558
558
|
),
|
|
559
|
-
(
|
|
559
|
+
(o) => `<span class="credentials">${o}</span>`
|
|
560
560
|
));
|
|
561
561
|
});
|
|
562
|
-
const s =
|
|
562
|
+
const s = x(null), c = x(ne[i] ?? ""), n = z(() => a.lang === "node" ? "js" : a.lang), l = a.lang;
|
|
563
563
|
q(
|
|
564
|
-
[() =>
|
|
564
|
+
[() => a.lang, () => a.content, s],
|
|
565
565
|
() => {
|
|
566
|
-
s.value &&
|
|
566
|
+
s.value && a.content && (!c.value || a.lang !== l) && (c.value = "", K(() => b(s.value)));
|
|
567
567
|
},
|
|
568
568
|
{ immediate: !0 }
|
|
569
569
|
);
|
|
570
|
-
const
|
|
570
|
+
const p = /\n(?!$)/g;
|
|
571
571
|
return Y(async () => {
|
|
572
|
-
let
|
|
573
|
-
|
|
574
|
-
const f =
|
|
575
|
-
|
|
572
|
+
let t = "";
|
|
573
|
+
a.lineNumbers && _.hooks.add("after-tokenize", (o) => {
|
|
574
|
+
const f = o.code.match(p), w = f ? f.length + 1 : 1;
|
|
575
|
+
t = `<span aria-hidden="true" class="line-numbers-rows">${new Array(w + 1).join("<span></span>")}</span>`;
|
|
576
576
|
});
|
|
577
|
-
const
|
|
578
|
-
typeof
|
|
579
|
-
_.languages[
|
|
580
|
-
|
|
577
|
+
const u = _.highlight(
|
|
578
|
+
typeof a.content == "object" ? JSON.stringify(a.content) : a.content,
|
|
579
|
+
_.languages[n.value],
|
|
580
|
+
n.value
|
|
581
581
|
);
|
|
582
|
-
if (
|
|
583
|
-
const
|
|
584
|
-
|
|
582
|
+
if (c.value = u + t, e !== 0) {
|
|
583
|
+
const o = J();
|
|
584
|
+
o.payload.data[i] = u + t;
|
|
585
585
|
}
|
|
586
586
|
}), B(async () => {
|
|
587
|
-
await import("./prism-autoloader-Dlh8Vzlw.js"),
|
|
588
|
-
}), (
|
|
587
|
+
await import("./prism-autoloader-Dlh8Vzlw.js"), m.autoloader.languages_path = "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/";
|
|
588
|
+
}), (t, u) => (g(), v("pre", {
|
|
589
589
|
class: h([
|
|
590
|
-
`scalar-component scalar-codeblock-pre language-${
|
|
590
|
+
`scalar-component scalar-codeblock-pre language-${n.value}`,
|
|
591
591
|
{
|
|
592
|
-
"line-numbers":
|
|
592
|
+
"line-numbers": t.lineNumbers
|
|
593
593
|
}
|
|
594
594
|
])
|
|
595
595
|
}, [
|
|
596
|
-
|
|
596
|
+
c.value ? (g(), v("code", {
|
|
597
597
|
key: 0,
|
|
598
|
-
class: h(`scalar-codeblock-code language-${
|
|
599
|
-
innerHTML:
|
|
600
|
-
}, null, 10, we)) : (
|
|
598
|
+
class: h(`scalar-codeblock-code language-${n.value}`),
|
|
599
|
+
innerHTML: c.value
|
|
600
|
+
}, null, 10, we)) : (g(), v("code", {
|
|
601
601
|
key: 1,
|
|
602
602
|
ref_key: "el",
|
|
603
603
|
ref: s,
|
|
604
|
-
class: h(`scalar-codeblock-code language-${
|
|
605
|
-
}, N(
|
|
604
|
+
class: h(`scalar-codeblock-code language-${n.value}`)
|
|
605
|
+
}, N(t.content), 3))
|
|
606
606
|
], 2));
|
|
607
607
|
}
|
|
608
|
-
}), R = /* @__PURE__ */ Object.assign({ "./Add.svg": () => import("./Add-MwmVL5-v.js"), "./CheckMark.svg": () => import("./CheckMark-t0gl4N9U.js"), "./ChevronDown.svg": () => import("./ChevronDown-BfsntkAH.js"), "./ChevronLeft.svg": () => import("./ChevronLeft-gsLd5xOQ.js"), "./ChevronRight.svg": () => import("./ChevronRight-CI_7n_av.js"), "./ChevronUp.svg": () => import("./ChevronUp-CjHRmG59.js"), "./Clipboard.svg": () => import("./Clipboard-CU_KxGEv.js"), "./Close.svg": () => import("./Close-DFM1qMQH.js"), "./DarkMode.svg": () => import("./DarkMode-CBsV8Q_I.js"), "./Ellipses.svg": () => import("./Ellipses-Bo_X36Hx.js"), "./ExternalLink.svg": () => import("./ExternalLink-D5zCsWas.js"), "./GitHub.svg": () => import("./GitHub-NdE6Zs9k.js"), "./LightDarkModeToggle.svg": () => import("./LightDarkModeToggle-BkvMimDa.js"), "./LightMode.svg": () => import("./LightMode-Btz6vyT_.js"), "./Logo.svg": () => import("./Logo-mtzeKD8M.js"), "./LogoAPI.svg": () => import("./LogoAPI-CaU5E6FK.js"), "./LogoClient.svg": () => import("./LogoClient-DdC-t_7P.js"), "./LogoMarket.svg": () => import("./LogoMarket-DwlApcab.js"), "./LogoSwagger.svg": () => import("./LogoSwagger-CH60H5qW.js"), "./Menu.svg": () => import("./Menu-DFi9Laso.js"), "./PaperAirplane.svg": () => import("./PaperAirplane-BC-4mGEB.js"), "./Search.svg": () => import("./Search-DqtlswRG.js"), "./arrow-chevron-down.svg": () => import("./arrow-chevron-down-C8nXK33Q.js"), "./arrow-chevron-left.svg": () => import("./arrow-chevron-left-BXUhHSEc.js"), "./arrow-chevron-right.svg": () => import("./arrow-chevron-right-CSqjaNKG.js"), "./arrow-chevron-up.svg": () => import("./arrow-chevron-up-Dr-W1IfM.js"), "./arrow-down.svg": () => import("./arrow-down-rfW-r_qd.js"), "./arrow-left.svg": () => import("./arrow-left-DDkHt-xN.js"), "./arrow-right.svg": () => import("./arrow-right-17dZkGZR.js"), "./arrow-up.svg": () => import("./arrow-up-CexG2Ble.js"), "./brand-software-development-github.svg": () => import("./brand-software-development-github-ZQnPxpDg.js"), "./interface-add.svg": () => import("./interface-add-Bthe4y9O.js"), "./interface-close.svg": () => import("./interface-close-WpJOu-2h.js"), "./programming-framework-angular.svg": () => import("./programming-framework-angular-DD4Vjgbk.js"), "./programming-framework-astro.svg": () => import("./programming-framework-astro-CLfrRt19.js"), "./programming-framework-laravel.svg": () => import("./programming-framework-laravel-kAy2wVLy.js"), "./programming-framework-nextdotjs.svg": () => import("./programming-framework-nextdotjs-BKdd_DY_.js"), "./programming-framework-react.svg": () => import("./programming-framework-react-PDgmtZuN.js"), "./programming-framework-vuedotjs.svg": () => import("./programming-framework-vuedotjs-Cv46W2aB.js"), "./programming-language-c.svg": () => import("./programming-language-c-hPGu2Zvg.js"), "./programming-language-clojure.svg": () => import("./programming-language-clojure-Cvmzky8x.js"), "./programming-language-csharp.svg": () => import("./programming-language-csharp-lqX1oWgb.js"), "./programming-language-css3.svg": () => import("./programming-language-css3-Dpp4Cr6b.js"), "./programming-language-go.svg": () => import("./programming-language-go-DoJxWwT6.js"), "./programming-language-html5.svg": () => import("./programming-language-html5-DlqJK4EL.js"), "./programming-language-http.svg": () => import("./programming-language-http-wMYwFS1I.js"), "./programming-language-java.svg": () => import("./programming-language-java-BCxG2T_w.js"), "./programming-language-javascript.svg": () => import("./programming-language-javascript-VxLvi1QG.js"), "./programming-language-json.svg": () => import("./programming-language-json-vEX_g7Zi.js"), "./programming-language-kotlin.svg": () => import("./programming-language-kotlin-DKV8vP9h.js"), "./programming-language-node.svg": () => import("./programming-language-node-Xsgx38lm.js"), "./programming-language-objc.svg": () => import("./programming-language-objc-BQXSOBsX.js"), "./programming-language-ocaml.svg": () => import("./programming-language-ocaml-BEz7gGv7.js"), "./programming-language-php.svg": () => import("./programming-language-php-GY38f8r4.js"), "./programming-language-powershell.svg": () => import("./programming-language-powershell-C9DkSp36.js"), "./programming-language-python.svg": () => import("./programming-language-python-Ct-_kNjo.js"), "./programming-language-r.svg": () => import("./programming-language-r-BGoKwua9.js"), "./programming-language-ruby.svg": () => import("./programming-language-ruby-DhdM4d7g.js"), "./programming-language-scala.svg": () => import("./programming-language-scala-BVg0dToJ.js"), "./programming-language-shell.svg": () => import("./programming-language-shell-BsTa1xI7.js"), "./programming-language-swift.svg": () => import("./programming-language-swift-Dn72xPjg.js"), "./programming-language-typescript.svg": () => import("./programming-language-typescript-CdF-HuRi.js"), "./programming-script-code.svg": () => import("./programming-script-code-DQN1veb2.js"), "./programming-tool-git.svg": () => import("./programming-tool-git-DDnQ1zGD.js"), "./programming-tool-tailwindcss.svg": () => import("./programming-tool-tailwindcss-xjXi0E6g.js") }), P = (
|
|
609
|
-
const
|
|
610
|
-
return R[
|
|
608
|
+
}), R = /* @__PURE__ */ Object.assign({ "./Add.svg": () => import("./Add-MwmVL5-v.js"), "./CheckMark.svg": () => import("./CheckMark-t0gl4N9U.js"), "./ChevronDown.svg": () => import("./ChevronDown-BfsntkAH.js"), "./ChevronLeft.svg": () => import("./ChevronLeft-gsLd5xOQ.js"), "./ChevronRight.svg": () => import("./ChevronRight-CI_7n_av.js"), "./ChevronUp.svg": () => import("./ChevronUp-CjHRmG59.js"), "./Clipboard.svg": () => import("./Clipboard-CU_KxGEv.js"), "./Close.svg": () => import("./Close-DFM1qMQH.js"), "./DarkMode.svg": () => import("./DarkMode-CBsV8Q_I.js"), "./Ellipses.svg": () => import("./Ellipses-Bo_X36Hx.js"), "./ExternalLink.svg": () => import("./ExternalLink-D5zCsWas.js"), "./GitHub.svg": () => import("./GitHub-NdE6Zs9k.js"), "./LightDarkModeToggle.svg": () => import("./LightDarkModeToggle-BkvMimDa.js"), "./LightMode.svg": () => import("./LightMode-Btz6vyT_.js"), "./Logo.svg": () => import("./Logo-mtzeKD8M.js"), "./LogoAPI.svg": () => import("./LogoAPI-CaU5E6FK.js"), "./LogoClient.svg": () => import("./LogoClient-DdC-t_7P.js"), "./LogoMarket.svg": () => import("./LogoMarket-DwlApcab.js"), "./LogoSwagger.svg": () => import("./LogoSwagger-CH60H5qW.js"), "./Menu.svg": () => import("./Menu-DFi9Laso.js"), "./PaperAirplane.svg": () => import("./PaperAirplane-BC-4mGEB.js"), "./Search.svg": () => import("./Search-DqtlswRG.js"), "./arrow-chevron-down.svg": () => import("./arrow-chevron-down-C8nXK33Q.js"), "./arrow-chevron-left.svg": () => import("./arrow-chevron-left-BXUhHSEc.js"), "./arrow-chevron-right.svg": () => import("./arrow-chevron-right-CSqjaNKG.js"), "./arrow-chevron-up.svg": () => import("./arrow-chevron-up-Dr-W1IfM.js"), "./arrow-down.svg": () => import("./arrow-down-rfW-r_qd.js"), "./arrow-left.svg": () => import("./arrow-left-DDkHt-xN.js"), "./arrow-right.svg": () => import("./arrow-right-17dZkGZR.js"), "./arrow-up.svg": () => import("./arrow-up-CexG2Ble.js"), "./brand-software-development-github.svg": () => import("./brand-software-development-github-ZQnPxpDg.js"), "./interface-add.svg": () => import("./interface-add-Bthe4y9O.js"), "./interface-close.svg": () => import("./interface-close-WpJOu-2h.js"), "./programming-framework-angular.svg": () => import("./programming-framework-angular-DD4Vjgbk.js"), "./programming-framework-astro.svg": () => import("./programming-framework-astro-CLfrRt19.js"), "./programming-framework-laravel.svg": () => import("./programming-framework-laravel-kAy2wVLy.js"), "./programming-framework-nextdotjs.svg": () => import("./programming-framework-nextdotjs-BKdd_DY_.js"), "./programming-framework-react.svg": () => import("./programming-framework-react-PDgmtZuN.js"), "./programming-framework-vuedotjs.svg": () => import("./programming-framework-vuedotjs-Cv46W2aB.js"), "./programming-language-c.svg": () => import("./programming-language-c-hPGu2Zvg.js"), "./programming-language-clojure.svg": () => import("./programming-language-clojure-Cvmzky8x.js"), "./programming-language-csharp.svg": () => import("./programming-language-csharp-lqX1oWgb.js"), "./programming-language-css3.svg": () => import("./programming-language-css3-Dpp4Cr6b.js"), "./programming-language-go.svg": () => import("./programming-language-go-DoJxWwT6.js"), "./programming-language-html5.svg": () => import("./programming-language-html5-DlqJK4EL.js"), "./programming-language-http.svg": () => import("./programming-language-http-wMYwFS1I.js"), "./programming-language-java.svg": () => import("./programming-language-java-BCxG2T_w.js"), "./programming-language-javascript.svg": () => import("./programming-language-javascript-VxLvi1QG.js"), "./programming-language-json.svg": () => import("./programming-language-json-vEX_g7Zi.js"), "./programming-language-kotlin.svg": () => import("./programming-language-kotlin-DKV8vP9h.js"), "./programming-language-node.svg": () => import("./programming-language-node-Xsgx38lm.js"), "./programming-language-objc.svg": () => import("./programming-language-objc-BQXSOBsX.js"), "./programming-language-ocaml.svg": () => import("./programming-language-ocaml-BEz7gGv7.js"), "./programming-language-php.svg": () => import("./programming-language-php-GY38f8r4.js"), "./programming-language-powershell.svg": () => import("./programming-language-powershell-C9DkSp36.js"), "./programming-language-python.svg": () => import("./programming-language-python-Ct-_kNjo.js"), "./programming-language-r.svg": () => import("./programming-language-r-BGoKwua9.js"), "./programming-language-ruby.svg": () => import("./programming-language-ruby-DhdM4d7g.js"), "./programming-language-scala.svg": () => import("./programming-language-scala-BVg0dToJ.js"), "./programming-language-shell.svg": () => import("./programming-language-shell-BsTa1xI7.js"), "./programming-language-swift.svg": () => import("./programming-language-swift-Dn72xPjg.js"), "./programming-language-typescript.svg": () => import("./programming-language-typescript-CdF-HuRi.js"), "./programming-script-code.svg": () => import("./programming-script-code-DQN1veb2.js"), "./programming-tool-git.svg": () => import("./programming-tool-git-DDnQ1zGD.js"), "./programming-tool-tailwindcss.svg": () => import("./programming-tool-tailwindcss-xjXi0E6g.js") }), P = (r) => {
|
|
609
|
+
const a = `./${r}.svg`;
|
|
610
|
+
return R[a] ? Z(R[a]) : (console.warn(`Could not find icon: ${r}`), null);
|
|
611
611
|
}, ye = ["src"], j = /* @__PURE__ */ y({
|
|
612
612
|
__name: "ScalarIcon",
|
|
613
613
|
props: {
|
|
614
614
|
icon: {},
|
|
615
615
|
size: {}
|
|
616
616
|
},
|
|
617
|
-
setup(
|
|
618
|
-
const
|
|
617
|
+
setup(r) {
|
|
618
|
+
const a = r, e = I({
|
|
619
619
|
variants: {
|
|
620
620
|
size: {
|
|
621
621
|
xs: "h-3 w-3",
|
|
@@ -629,13 +629,13 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
629
629
|
defaultVariants: {
|
|
630
630
|
size: "full"
|
|
631
631
|
}
|
|
632
|
-
}), i = P(
|
|
633
|
-
return (
|
|
632
|
+
}), i = P(a.icon);
|
|
633
|
+
return (m, b) => d(i) ? (g(), L(G(d(P)(m.icon)), {
|
|
634
634
|
key: 0,
|
|
635
|
-
class: h(
|
|
636
|
-
}, null, 8, ["class"])) : (
|
|
635
|
+
class: h(d(S)("scalar-icon", d(e)({ size: m.size })))
|
|
636
|
+
}, null, 8, ["class"])) : (g(), v("img", {
|
|
637
637
|
key: 1,
|
|
638
|
-
src:
|
|
638
|
+
src: m.icon
|
|
639
639
|
}, null, 8, ye));
|
|
640
640
|
}
|
|
641
641
|
}), ke = ["ariaDisabled"], Ee = { class: "sr-only" }, _e = /* @__PURE__ */ y({
|
|
@@ -647,8 +647,8 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
647
647
|
variant: { default: "ghost" },
|
|
648
648
|
size: { default: "md" }
|
|
649
649
|
},
|
|
650
|
-
setup(
|
|
651
|
-
const
|
|
650
|
+
setup(r) {
|
|
651
|
+
const a = I({
|
|
652
652
|
base: "scalar-icon-button grid aspect-square cursor-pointer rounded",
|
|
653
653
|
variants: {
|
|
654
654
|
size: {
|
|
@@ -663,16 +663,16 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
663
663
|
variant: V
|
|
664
664
|
}
|
|
665
665
|
});
|
|
666
|
-
return (e, i) => (
|
|
666
|
+
return (e, i) => (g(), v("button", {
|
|
667
667
|
ariaDisabled: e.disabled || void 0,
|
|
668
|
-
class: h(
|
|
668
|
+
class: h(d(S)(d(a)({ size: e.size, variant: e.variant, disabled: e.disabled }))),
|
|
669
669
|
type: "button"
|
|
670
670
|
}, [
|
|
671
|
-
|
|
671
|
+
C(d(j), { icon: e.icon }, null, 8, ["icon"]),
|
|
672
672
|
k("span", Ee, N(e.label), 1)
|
|
673
673
|
], 10, ke));
|
|
674
674
|
}
|
|
675
|
-
}),
|
|
675
|
+
}), Ve = () => $({
|
|
676
676
|
open: !1,
|
|
677
677
|
show() {
|
|
678
678
|
this.open = !0;
|
|
@@ -690,8 +690,8 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
690
690
|
size: { default: "md" },
|
|
691
691
|
variant: {}
|
|
692
692
|
},
|
|
693
|
-
setup(
|
|
694
|
-
const
|
|
693
|
+
setup(r) {
|
|
694
|
+
const a = I({
|
|
695
695
|
base: [
|
|
696
696
|
"scalar-modal",
|
|
697
697
|
"col leading-snug relative mx-auto mb-0 mt-20 w-full rounded-lg bg-back-2 text-left text-fore-1 opacity-0"
|
|
@@ -709,26 +709,26 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
711
|
});
|
|
712
|
-
return (e, i) => (
|
|
712
|
+
return (e, i) => (g(), L(d(oe), {
|
|
713
713
|
open: e.state.open,
|
|
714
|
-
onClose: i[0] || (i[0] = (
|
|
714
|
+
onClose: i[0] || (i[0] = (m) => e.state.hide())
|
|
715
715
|
}, {
|
|
716
716
|
default: A(() => [
|
|
717
717
|
k("div", {
|
|
718
718
|
class: h(
|
|
719
|
-
|
|
719
|
+
d(S)(
|
|
720
720
|
"scalar-modal-layout fixed left-0 top-0",
|
|
721
721
|
"z-[1001] h-[100dvh] w-[100dvw]",
|
|
722
722
|
"bg-backdrop p-5 opacity-0"
|
|
723
723
|
)
|
|
724
724
|
)
|
|
725
725
|
}, [
|
|
726
|
-
|
|
727
|
-
class: h(
|
|
726
|
+
C(d(se), {
|
|
727
|
+
class: h(d(a)({ size: e.size, variant: e.variant })),
|
|
728
728
|
style: F({ maxWidth: e.maxWidth })
|
|
729
729
|
}, {
|
|
730
730
|
default: A(() => [
|
|
731
|
-
e.title ? (
|
|
731
|
+
e.title ? (g(), L(d(ie), {
|
|
732
732
|
key: 0,
|
|
733
733
|
class: h(["scalar-modal-header font-semiBold m-0 rounded-lg px-6 py-3 text-left text-xs text-fore-1", { "pb-0 pt-6": e.variant === "history" }])
|
|
734
734
|
}, {
|
|
@@ -737,10 +737,10 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
737
737
|
]),
|
|
738
738
|
_: 1
|
|
739
739
|
}, 8, ["class"])) : E("", !0),
|
|
740
|
-
|
|
740
|
+
C(d(le), {
|
|
741
741
|
class: h([
|
|
742
742
|
"scalar-modal-body relative max-h-[calc(100dvh-240px)] overflow-y-auto rounded-lg bg-back-1 px-6 pb-4 pt-6",
|
|
743
|
-
|
|
743
|
+
d(S)(
|
|
744
744
|
e.bodyClass,
|
|
745
745
|
e.variant === "history" && "pt-3",
|
|
746
746
|
e.variant === "search" && "col max-h-[440px] overflow-hidden p-0"
|
|
@@ -760,13 +760,13 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
760
760
|
_: 3
|
|
761
761
|
}, 8, ["open"]));
|
|
762
762
|
}
|
|
763
|
-
}), Ie = /* @__PURE__ */ D(Ne, [["__scopeId", "data-v-ff85ced0"]]), Ae = { class: "scalar-input-container relative" }, Te = ["for"],
|
|
763
|
+
}), Ie = /* @__PURE__ */ D(Ne, [["__scopeId", "data-v-ff85ced0"]]), Ae = { class: "scalar-input-container relative" }, Te = ["for"], Ce = { class: "icon-slot cursor-pointer text-ghost hover:text-fore-1 !empty:flex !empty:w-7 !empty:items-center !empty:pr-3" }, xe = /* @__PURE__ */ y({
|
|
764
764
|
__name: "ScalarTextField",
|
|
765
765
|
props: {
|
|
766
766
|
modelValue: {},
|
|
767
767
|
placeholder: {},
|
|
768
768
|
label: {},
|
|
769
|
-
labelShadowColor: { default: "var(--
|
|
769
|
+
labelShadowColor: { default: "var(--scalar-background-2)" },
|
|
770
770
|
error: { type: Boolean },
|
|
771
771
|
isMultiline: { type: Boolean },
|
|
772
772
|
helperText: {},
|
|
@@ -776,8 +776,8 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
776
776
|
disableTrim: { type: Boolean, default: !1 }
|
|
777
777
|
},
|
|
778
778
|
emits: ["submit", "update:modelValue"],
|
|
779
|
-
setup(
|
|
780
|
-
const e =
|
|
779
|
+
setup(r, { emit: a }) {
|
|
780
|
+
const e = r, i = a, m = I({
|
|
781
781
|
base: "scalar-input-wrapper relative flex items-center rounded border border-solid border-border",
|
|
782
782
|
variants: {
|
|
783
783
|
focus: {
|
|
@@ -785,129 +785,129 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
785
785
|
},
|
|
786
786
|
error: { true: "scalar-input-wrapper-error border-error" }
|
|
787
787
|
}
|
|
788
|
-
}), b = H(), s = b.id || `id-${
|
|
788
|
+
}), b = H(), s = b.id || `id-${de()}`, c = x(), n = x(!1);
|
|
789
789
|
let l;
|
|
790
790
|
if (e.isMultiline) {
|
|
791
|
-
const { triggerResize:
|
|
792
|
-
element:
|
|
791
|
+
const { triggerResize: o } = ce({
|
|
792
|
+
element: c,
|
|
793
793
|
input: e.modelValue
|
|
794
794
|
});
|
|
795
|
-
l =
|
|
795
|
+
l = o;
|
|
796
796
|
}
|
|
797
|
-
function
|
|
798
|
-
const f =
|
|
797
|
+
function p(o) {
|
|
798
|
+
const f = o.target.value;
|
|
799
799
|
e.isMultiline && l(), e.handleFieldChange ? e.handleFieldChange(f) : i("update:modelValue", f);
|
|
800
800
|
}
|
|
801
|
-
function
|
|
802
|
-
const f =
|
|
801
|
+
function t(o) {
|
|
802
|
+
const f = o.target, w = e.disableTrim || e.isMultiline ? f.value : f.value.trim();
|
|
803
803
|
e.handleFieldSubmit ? e.handleFieldSubmit(w) : i("submit", w);
|
|
804
804
|
}
|
|
805
|
-
function
|
|
806
|
-
|
|
805
|
+
function u(o) {
|
|
806
|
+
n.value = !1, e.emitOnBlur && e.modelValue && t(o);
|
|
807
807
|
}
|
|
808
808
|
return B(() => {
|
|
809
|
-
var
|
|
810
|
-
Object.prototype.hasOwnProperty.call(b, "autofocus") && ((
|
|
811
|
-
}), (
|
|
809
|
+
var o;
|
|
810
|
+
Object.prototype.hasOwnProperty.call(b, "autofocus") && ((o = c.value) == null || o.focus());
|
|
811
|
+
}), (o, f) => (g(), v("div", Ae, [
|
|
812
812
|
k("div", {
|
|
813
|
-
class: h(
|
|
813
|
+
class: h(d(m)({ error: o.error, focus: n.value }))
|
|
814
814
|
}, [
|
|
815
|
-
(
|
|
815
|
+
(g(), L(G(o.isMultiline ? "textarea" : "input"), M({ id: d(s) }, o.$attrs, {
|
|
816
816
|
ref_key: "input",
|
|
817
|
-
ref:
|
|
817
|
+
ref: c,
|
|
818
818
|
class: [
|
|
819
819
|
"scalar-input",
|
|
820
|
-
|
|
821
|
-
{ "min-h-[77px]":
|
|
820
|
+
d(S)(
|
|
821
|
+
{ "min-h-[77px]": o.isMultiline },
|
|
822
822
|
"z-10 w-full resize-none appearance-none border-0 bg-transparent p-3 text-sm text-fore-1",
|
|
823
823
|
"outline-none transition-opacity"
|
|
824
824
|
)
|
|
825
825
|
],
|
|
826
|
-
placeholder:
|
|
827
|
-
value:
|
|
828
|
-
onBlur:
|
|
829
|
-
onFocus: f[0] || (f[0] = (w) =>
|
|
830
|
-
onInput:
|
|
831
|
-
onKeyup: ee(
|
|
826
|
+
placeholder: o.placeholder,
|
|
827
|
+
value: o.modelValue,
|
|
828
|
+
onBlur: u,
|
|
829
|
+
onFocus: f[0] || (f[0] = (w) => n.value = !0),
|
|
830
|
+
onInput: p,
|
|
831
|
+
onKeyup: ee(t, ["enter"])
|
|
832
832
|
}), null, 16, ["id", "class", "placeholder", "value"])),
|
|
833
|
-
|
|
833
|
+
o.label ? (g(), v("label", {
|
|
834
834
|
key: 0,
|
|
835
835
|
class: h(
|
|
836
|
-
|
|
836
|
+
d(S)(
|
|
837
837
|
"scalar-input-label pointer-events-none absolute left-0 top-0 mx-2 my-3 px-1 text-xs",
|
|
838
838
|
"shadow-current z-10 origin-top-left rounded text-fore-3 transition-transform"
|
|
839
839
|
)
|
|
840
840
|
),
|
|
841
|
-
for:
|
|
841
|
+
for: d(s),
|
|
842
842
|
style: F({
|
|
843
|
-
"box-shadow": `0 0 4px 4px ${
|
|
844
|
-
"background-color":
|
|
843
|
+
"box-shadow": `0 0 4px 4px ${o.labelShadowColor}`,
|
|
844
|
+
"background-color": o.labelShadowColor
|
|
845
845
|
})
|
|
846
|
-
}, N(
|
|
847
|
-
k("div",
|
|
848
|
-
T(
|
|
846
|
+
}, N(o.label), 15, Te)) : E("", !0),
|
|
847
|
+
k("div", Ce, [
|
|
848
|
+
T(o.$slots, "default", {}, void 0, !0)
|
|
849
849
|
])
|
|
850
850
|
], 2),
|
|
851
851
|
k("span", {
|
|
852
852
|
class: h(
|
|
853
|
-
|
|
853
|
+
d(S)(
|
|
854
854
|
"helper-text before:rounded-full mt-1.5 flex items-center text-xs text-error before:font-black",
|
|
855
855
|
"before:mr-1.5 before:block before:h-4 before:w-4 before:text-center before:text-xxs before:leading-4",
|
|
856
856
|
"before:bg-error before:text-white before:content-['!'] empty:hidden"
|
|
857
857
|
)
|
|
858
858
|
)
|
|
859
|
-
}, N(
|
|
859
|
+
}, N(o.helperText), 3)
|
|
860
860
|
]));
|
|
861
861
|
}
|
|
862
|
-
}), Le = /* @__PURE__ */ D(
|
|
862
|
+
}), Le = /* @__PURE__ */ D(xe, [["__scopeId", "data-v-4fc2339e"]]), je = {
|
|
863
863
|
boxShadow: {
|
|
864
|
-
DEFAULT: "var(--
|
|
865
|
-
md: "var(--
|
|
864
|
+
DEFAULT: "var(--scalar-shadow-1)",
|
|
865
|
+
md: "var(--scalar-shadow-2)",
|
|
866
866
|
sm: "rgba(0, 0, 0, 0.09) 0px 1px 4px",
|
|
867
867
|
none: "0 0 #0000"
|
|
868
868
|
},
|
|
869
869
|
colors: {
|
|
870
|
-
"fore-1": "var(--
|
|
871
|
-
"fore-2": "var(--
|
|
872
|
-
"fore-3": "var(--
|
|
873
|
-
accent: "var(--
|
|
874
|
-
"back-1": "var(--
|
|
875
|
-
"back-2": "var(--
|
|
876
|
-
"back-3": "var(--
|
|
877
|
-
"back-accent": "var(--
|
|
870
|
+
"fore-1": "var(--scalar-color-1)",
|
|
871
|
+
"fore-2": "var(--scalar-color-2)",
|
|
872
|
+
"fore-3": "var(--scalar-color-3)",
|
|
873
|
+
accent: "var(--scalar-color-accent)",
|
|
874
|
+
"back-1": "var(--scalar-background-1)",
|
|
875
|
+
"back-2": "var(--scalar-background-2)",
|
|
876
|
+
"back-3": "var(--scalar-background-3)",
|
|
877
|
+
"back-accent": "var(--scalar-background-accent)",
|
|
878
878
|
backdrop: "rgba(0, 0, 0, 0.44)",
|
|
879
|
-
border: "var(--
|
|
880
|
-
"back-btn-1": "var(--
|
|
881
|
-
"fore-btn-1": "var(--
|
|
882
|
-
"hover-btn-1": "var(--
|
|
879
|
+
border: "var(--scalar-border-color)",
|
|
880
|
+
"back-btn-1": "var(--scalar-button-1)",
|
|
881
|
+
"fore-btn-1": "var(--scalar-button-1-color)",
|
|
882
|
+
"hover-btn-1": "var(--scalar-button-1-hover)",
|
|
883
883
|
white: "#FFF",
|
|
884
|
-
green: "var(--
|
|
885
|
-
red: "var(--
|
|
886
|
-
yellow: "var(--
|
|
887
|
-
blue: "var(--
|
|
888
|
-
orange: "var(--
|
|
889
|
-
purple: "var(--
|
|
890
|
-
error: "var(--
|
|
891
|
-
ghost: "var(--
|
|
884
|
+
green: "var(--scalar-color-green)",
|
|
885
|
+
red: "var(--scalar-color-red)",
|
|
886
|
+
yellow: "var(--scalar-color-yellow)",
|
|
887
|
+
blue: "var(--scalar-color-blue)",
|
|
888
|
+
orange: "var(--scalar-color-orange)",
|
|
889
|
+
purple: "var(--scalar-color-purple)",
|
|
890
|
+
error: "var(--scalar-error-color)",
|
|
891
|
+
ghost: "var(--scalar-color-ghost)",
|
|
892
892
|
transparent: "transparent"
|
|
893
893
|
}
|
|
894
|
-
},
|
|
894
|
+
}, We = {
|
|
895
895
|
borderRadius: {
|
|
896
|
-
DEFAULT: "var(--
|
|
897
|
-
md: "var(--
|
|
898
|
-
lg: "var(--
|
|
899
|
-
xl: "var(--
|
|
896
|
+
DEFAULT: "var(--scalar-radius)",
|
|
897
|
+
md: "var(--scalar-radius)",
|
|
898
|
+
lg: "var(--scalar-radius-lg)",
|
|
899
|
+
xl: "var(--scalar-radius-xl)"
|
|
900
900
|
},
|
|
901
901
|
fontSize: {
|
|
902
|
-
xxs: "var(--
|
|
903
|
-
xs: "var(--
|
|
904
|
-
sm: "var(--
|
|
905
|
-
base: "var(--
|
|
906
|
-
lg: "var(--
|
|
902
|
+
xxs: "var(--scalar-micro, var(--scalar-font-size-5))",
|
|
903
|
+
xs: "var(--scalar-mini, var(--scalar-font-size-4))",
|
|
904
|
+
sm: "var(--scalar-small,var(--scalar-font-size-3))",
|
|
905
|
+
base: "var(--scalar-paragraph, var(--scalar-font-size-2))",
|
|
906
|
+
lg: "var(--scalar-font-size-1)"
|
|
907
907
|
},
|
|
908
908
|
fontWeight: {
|
|
909
|
-
medium: "var(--
|
|
910
|
-
bold: "var(--
|
|
909
|
+
medium: "var(--scalar-font-medium)",
|
|
910
|
+
bold: "var(--scalar-font-bold)"
|
|
911
911
|
},
|
|
912
912
|
maxWidth: {
|
|
913
913
|
"screen-xs": "480px",
|
|
@@ -915,22 +915,22 @@ const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
|
915
915
|
"screen-md": "640px",
|
|
916
916
|
"screen-lg": "800px"
|
|
917
917
|
}
|
|
918
|
-
},
|
|
919
|
-
install: (
|
|
920
|
-
|
|
918
|
+
}, Xe = {
|
|
919
|
+
install: (r) => {
|
|
920
|
+
r.component("ScalarButton", Se), r.component("ScalarIcon", j), r.component("ScalarIconButton", _e), r.component("ScalarLoading", U), r.component("ScalarModal", Ie), r.component("ScalarTextField", Le);
|
|
921
921
|
}
|
|
922
922
|
};
|
|
923
923
|
export {
|
|
924
924
|
Se as ScalarButton,
|
|
925
|
-
|
|
925
|
+
Ue as ScalarCodeBlock,
|
|
926
926
|
j as ScalarIcon,
|
|
927
927
|
_e as ScalarIconButton,
|
|
928
928
|
U as ScalarLoading,
|
|
929
929
|
Ie as ScalarModal,
|
|
930
930
|
Le as ScalarTextField,
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
931
|
+
Xe as default,
|
|
932
|
+
We as extend,
|
|
933
|
+
je as theme,
|
|
934
|
+
Fe as useLoadingState,
|
|
935
|
+
Ve as useModal
|
|
936
936
|
};
|