@scalar/components 0.4.10 → 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 +302 -296
- package/dist/main.css +1 -1
- package/package.json +12 -11
package/dist/index.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { defineConfig as
|
|
4
|
-
import { extendTailwindMerge as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
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
|
+
import _ from "prismjs";
|
|
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({
|
|
10
11
|
extend: {
|
|
11
12
|
classGroups: {
|
|
12
13
|
// Add the scalar class prefix as a custom class to be deduped by tailwind-merge
|
|
13
14
|
[O]: [O]
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
|
-
}), { cva: I, cx: S, compose:
|
|
17
|
+
}), { cva: I, cx: S, compose: Ge } = ae({
|
|
17
18
|
hooks: {
|
|
18
|
-
onComplete: (r) => `${
|
|
19
|
+
onComplete: (r) => `${pe(r, O)}`
|
|
19
20
|
}
|
|
20
|
-
}),
|
|
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 = {
|
|
21
22
|
key: 0,
|
|
22
23
|
class: "circular-loader"
|
|
23
24
|
};
|
|
24
|
-
function
|
|
25
|
-
return
|
|
25
|
+
function Fe() {
|
|
26
|
+
return $({
|
|
26
27
|
isValid: !1,
|
|
27
28
|
isInvalid: !1,
|
|
28
29
|
isLoading: !1,
|
|
@@ -34,54 +35,54 @@ function Me() {
|
|
|
34
35
|
},
|
|
35
36
|
validate(r = 800) {
|
|
36
37
|
this.isValid = !0;
|
|
37
|
-
const
|
|
38
|
+
const a = r - 300;
|
|
38
39
|
return new Promise(
|
|
39
|
-
(e) => setTimeout(() => this.clear().then(() => e(!0)),
|
|
40
|
+
(e) => setTimeout(() => this.clear().then(() => e(!0)), a)
|
|
40
41
|
);
|
|
41
42
|
},
|
|
42
43
|
invalidate(r = 1100) {
|
|
43
44
|
this.isInvalid = !0;
|
|
44
|
-
const
|
|
45
|
+
const a = r - 300;
|
|
45
46
|
return new Promise(
|
|
46
|
-
(e) => setTimeout(() => this.clear().then(() => e(!0)),
|
|
47
|
+
(e) => setTimeout(() => this.clear().then(() => e(!0)), a)
|
|
47
48
|
);
|
|
48
49
|
},
|
|
49
50
|
clear(r = 300) {
|
|
50
|
-
return this.isValid = !1, this.isInvalid = !1, this.isLoading = !1, new Promise((
|
|
51
|
+
return this.isValid = !1, this.isInvalid = !1, this.isLoading = !1, new Promise((a) => {
|
|
51
52
|
setTimeout(() => {
|
|
52
|
-
|
|
53
|
+
a(!0);
|
|
53
54
|
}, r);
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
|
-
const
|
|
59
|
+
const me = /* @__PURE__ */ y({
|
|
59
60
|
__name: "ScalarLoading",
|
|
60
61
|
props: {
|
|
61
62
|
loadingState: {},
|
|
62
63
|
size: { default: "24px" }
|
|
63
64
|
},
|
|
64
65
|
setup(r) {
|
|
65
|
-
return W((
|
|
66
|
-
|
|
67
|
-
})), (
|
|
66
|
+
return W((a) => ({
|
|
67
|
+
d6cae758: a.size
|
|
68
|
+
})), (a, e) => a.loadingState ? (g(), v("div", {
|
|
68
69
|
key: 0,
|
|
69
|
-
class:
|
|
70
|
+
class: h(d(S)("loader-wrapper"))
|
|
70
71
|
}, [
|
|
71
72
|
(g(), v("svg", {
|
|
72
|
-
class:
|
|
73
|
-
"icon-is-valid":
|
|
74
|
-
"icon-is-invalid":
|
|
73
|
+
class: h(["svg-loader", {
|
|
74
|
+
"icon-is-valid": a.loadingState.isValid,
|
|
75
|
+
"icon-is-invalid": a.loadingState.isInvalid
|
|
75
76
|
}]),
|
|
76
77
|
viewBox: "0 0 100 100",
|
|
77
78
|
xmlns: "http://www.w3.org/2000/svg",
|
|
78
79
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
79
80
|
}, [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
class:
|
|
84
|
-
"loader-path-off":
|
|
81
|
+
ue,
|
|
82
|
+
a.loadingState.isLoading ? (g(), v("g", ge, [
|
|
83
|
+
k("circle", {
|
|
84
|
+
class: h(["loader-path", {
|
|
85
|
+
"loader-path-off": a.loadingState.isValid || a.loadingState.isInvalid
|
|
85
86
|
}]),
|
|
86
87
|
cx: "50",
|
|
87
88
|
cy: "50",
|
|
@@ -93,12 +94,12 @@ const ue = /* @__PURE__ */ k({
|
|
|
93
94
|
], 2))
|
|
94
95
|
], 2)) : E("", !0);
|
|
95
96
|
}
|
|
96
|
-
}), D = (r,
|
|
97
|
+
}), D = (r, a) => {
|
|
97
98
|
const e = r.__vccOpts || r;
|
|
98
|
-
for (const [
|
|
99
|
-
e[
|
|
99
|
+
for (const [i, m] of a)
|
|
100
|
+
e[i] = m;
|
|
100
101
|
return e;
|
|
101
|
-
}, U = /* @__PURE__ */ D(
|
|
102
|
+
}, U = /* @__PURE__ */ D(me, [["__scopeId", "data-v-47faceda"]]), V = {
|
|
102
103
|
solid: [
|
|
103
104
|
"scalar-button-solid",
|
|
104
105
|
"bg-back-btn-1 text-fore-btn-1 shadow-sm active:bg-back-btn-1 active:shadow-none hocus:bg-hover-btn-1"
|
|
@@ -115,7 +116,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
115
116
|
"scalar-button-danger",
|
|
116
117
|
"bg-error text-white active:brightness-90 hocus:brightness-90"
|
|
117
118
|
]
|
|
118
|
-
},
|
|
119
|
+
}, he = I({
|
|
119
120
|
base: "scalar-button row cursor-pointer items-center justify-center rounded font-medium",
|
|
120
121
|
variants: {
|
|
121
122
|
disabled: {
|
|
@@ -132,13 +133,13 @@ const ue = /* @__PURE__ */ k({
|
|
|
132
133
|
class: "bg-transparent text-ghost"
|
|
133
134
|
}
|
|
134
135
|
]
|
|
135
|
-
}),
|
|
136
|
+
}), fe = ["ariaDisabled"], ve = {
|
|
136
137
|
key: 0,
|
|
137
138
|
class: "mr-2 h-4 w-4"
|
|
138
|
-
},
|
|
139
|
+
}, be = {
|
|
139
140
|
key: 1,
|
|
140
141
|
class: "ml-2"
|
|
141
|
-
},
|
|
142
|
+
}, Se = /* @__PURE__ */ y({
|
|
142
143
|
inheritAttrs: !1,
|
|
143
144
|
__name: "ScalarButton",
|
|
144
145
|
props: {
|
|
@@ -149,44 +150,44 @@ const ue = /* @__PURE__ */ k({
|
|
|
149
150
|
variant: { default: "solid" }
|
|
150
151
|
},
|
|
151
152
|
setup(r) {
|
|
152
|
-
const
|
|
153
|
-
const { class: e, ...
|
|
154
|
-
return { className: e || "", rest:
|
|
153
|
+
const a = z(() => {
|
|
154
|
+
const { class: e, ...i } = H();
|
|
155
|
+
return { className: e || "", rest: i };
|
|
155
156
|
});
|
|
156
|
-
return (e,
|
|
157
|
+
return (e, i) => (g(), v("button", M(a.value.rest, {
|
|
157
158
|
ariaDisabled: e.disabled || void 0,
|
|
158
|
-
class:
|
|
159
|
-
|
|
159
|
+
class: d(S)(
|
|
160
|
+
d(he)({ fullWidth: e.fullWidth, disabled: e.disabled, size: e.size, variant: e.variant }),
|
|
160
161
|
{ "pl-9 pr-3": e.loading },
|
|
161
|
-
`${
|
|
162
|
+
`${a.value.className}`
|
|
162
163
|
),
|
|
163
164
|
type: "button"
|
|
164
165
|
}), [
|
|
165
|
-
e.$slots.icon ? (g(), v("div",
|
|
166
|
-
|
|
166
|
+
e.$slots.icon ? (g(), v("div", ve, [
|
|
167
|
+
T(e.$slots, "icon")
|
|
167
168
|
])) : E("", !0),
|
|
168
|
-
|
|
169
|
-
e.loading ? (g(), v("div",
|
|
170
|
-
C(
|
|
169
|
+
T(e.$slots, "default"),
|
|
170
|
+
e.loading ? (g(), v("div", be, [
|
|
171
|
+
C(d(U), {
|
|
171
172
|
loadingState: e.loading,
|
|
172
173
|
size: "20px"
|
|
173
174
|
}, null, 8, ["loadingState"])
|
|
174
175
|
])) : E("", !0)
|
|
175
|
-
], 16,
|
|
176
|
+
], 16, fe));
|
|
176
177
|
}
|
|
177
178
|
});
|
|
178
179
|
(function(r) {
|
|
179
|
-
var
|
|
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 = {
|
|
180
181
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
181
182
|
lookbehind: !0,
|
|
182
183
|
alias: "punctuation",
|
|
183
184
|
// this looks reasonably well in all themes
|
|
184
185
|
inside: null
|
|
185
186
|
// see below
|
|
186
|
-
},
|
|
187
|
+
}, i = {
|
|
187
188
|
bash: e,
|
|
188
189
|
environment: {
|
|
189
|
-
pattern: RegExp("\\$" +
|
|
190
|
+
pattern: RegExp("\\$" + a),
|
|
190
191
|
alias: "constant"
|
|
191
192
|
},
|
|
192
193
|
variable: [
|
|
@@ -226,7 +227,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
226
227
|
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
227
228
|
punctuation: /[\[\]]/,
|
|
228
229
|
environment: {
|
|
229
|
-
pattern: RegExp("(\\{)" +
|
|
230
|
+
pattern: RegExp("(\\{)" + a),
|
|
230
231
|
lookbehind: !0,
|
|
231
232
|
alias: "constant"
|
|
232
233
|
}
|
|
@@ -275,7 +276,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
275
276
|
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
|
276
277
|
inside: {
|
|
277
278
|
environment: {
|
|
278
|
-
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" +
|
|
279
|
+
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + a),
|
|
279
280
|
lookbehind: !0,
|
|
280
281
|
alias: "constant"
|
|
281
282
|
}
|
|
@@ -295,7 +296,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
295
296
|
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
296
297
|
lookbehind: !0,
|
|
297
298
|
greedy: !0,
|
|
298
|
-
inside:
|
|
299
|
+
inside: i
|
|
299
300
|
},
|
|
300
301
|
// Here-document with quotes around the tag
|
|
301
302
|
// → No expansion (so no “inside”).
|
|
@@ -313,7 +314,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
313
314
|
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
314
315
|
lookbehind: !0,
|
|
315
316
|
greedy: !0,
|
|
316
|
-
inside:
|
|
317
|
+
inside: i
|
|
317
318
|
},
|
|
318
319
|
{
|
|
319
320
|
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
@@ -326,15 +327,15 @@ const ue = /* @__PURE__ */ k({
|
|
|
326
327
|
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
327
328
|
greedy: !0,
|
|
328
329
|
inside: {
|
|
329
|
-
entity:
|
|
330
|
+
entity: i.entity
|
|
330
331
|
}
|
|
331
332
|
}
|
|
332
333
|
],
|
|
333
334
|
environment: {
|
|
334
|
-
pattern: RegExp("\\$?" +
|
|
335
|
+
pattern: RegExp("\\$?" + a),
|
|
335
336
|
alias: "constant"
|
|
336
337
|
},
|
|
337
|
-
variable:
|
|
338
|
+
variable: i.variable,
|
|
338
339
|
function: {
|
|
339
340
|
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
|
340
341
|
lookbehind: !0
|
|
@@ -374,7 +375,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
374
375
|
lookbehind: !0
|
|
375
376
|
}
|
|
376
377
|
}, e.inside = r.languages.bash;
|
|
377
|
-
for (var
|
|
378
|
+
for (var m = [
|
|
378
379
|
"comment",
|
|
379
380
|
"function-name",
|
|
380
381
|
"for-or-select",
|
|
@@ -390,8 +391,8 @@ const ue = /* @__PURE__ */ k({
|
|
|
390
391
|
"operator",
|
|
391
392
|
"punctuation",
|
|
392
393
|
"number"
|
|
393
|
-
],
|
|
394
|
-
|
|
394
|
+
], b = i.variable[1].inside, s = 0; s < m.length; s++)
|
|
395
|
+
b[m[s]] = r.languages.bash[m[s]];
|
|
395
396
|
r.languages.sh = r.languages.bash, r.languages.shell = r.languages.bash;
|
|
396
397
|
})(Prism);
|
|
397
398
|
Prism.languages.json = {
|
|
@@ -422,7 +423,7 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
422
423
|
(function() {
|
|
423
424
|
if (typeof Prism > "u" || typeof document > "u")
|
|
424
425
|
return;
|
|
425
|
-
var r = "line-numbers",
|
|
426
|
+
var r = "line-numbers", a = /\n(?!$)/g, e = Prism.plugins.lineNumbers = {
|
|
426
427
|
/**
|
|
427
428
|
* Get node for provided line number
|
|
428
429
|
*
|
|
@@ -430,14 +431,14 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
430
431
|
* @param {number} number line number
|
|
431
432
|
* @returns {Element|undefined}
|
|
432
433
|
*/
|
|
433
|
-
getLine: function(
|
|
434
|
-
if (!(
|
|
435
|
-
var
|
|
436
|
-
if (
|
|
437
|
-
var
|
|
438
|
-
|
|
439
|
-
var
|
|
440
|
-
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];
|
|
441
442
|
}
|
|
442
443
|
}
|
|
443
444
|
},
|
|
@@ -449,8 +450,8 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
449
450
|
* @param {HTMLElement} element A `<pre>` element with line numbers.
|
|
450
451
|
* @returns {void}
|
|
451
452
|
*/
|
|
452
|
-
resize: function(
|
|
453
|
-
|
|
453
|
+
resize: function(s) {
|
|
454
|
+
i([s]);
|
|
454
455
|
},
|
|
455
456
|
/**
|
|
456
457
|
* Whether the plugin can assume that the units font sizes and margins are not depended on the size of
|
|
@@ -464,72 +465,72 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
464
465
|
*/
|
|
465
466
|
assumeViewportIndependence: !0
|
|
466
467
|
};
|
|
467
|
-
function
|
|
468
|
-
if (
|
|
469
|
-
var
|
|
468
|
+
function i(s) {
|
|
469
|
+
if (s = s.filter(function(n) {
|
|
470
|
+
var l = m(n), p = l["white-space"];
|
|
470
471
|
return p === "pre-wrap" || p === "pre-line";
|
|
471
|
-
}),
|
|
472
|
-
var
|
|
473
|
-
var
|
|
474
|
-
if (!(!
|
|
475
|
-
var
|
|
476
|
-
|
|
477
|
-
var
|
|
478
|
-
return
|
|
479
|
-
element:
|
|
480
|
-
lines:
|
|
472
|
+
}), s.length != 0) {
|
|
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,
|
|
481
482
|
lineHeights: [],
|
|
482
|
-
oneLinerHeight:
|
|
483
|
-
sizer:
|
|
483
|
+
oneLinerHeight: o,
|
|
484
|
+
sizer: t
|
|
484
485
|
};
|
|
485
486
|
}
|
|
486
487
|
}).filter(Boolean);
|
|
487
|
-
|
|
488
|
-
var
|
|
489
|
-
|
|
490
|
-
if (
|
|
491
|
-
var
|
|
492
|
-
|
|
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
|
+
var w = l.appendChild(document.createElement("span"));
|
|
493
|
+
w.style.display = "block", w.textContent = o;
|
|
493
494
|
} else
|
|
494
|
-
|
|
495
|
+
t[f] = u;
|
|
495
496
|
});
|
|
496
|
-
}),
|
|
497
|
-
for (var
|
|
498
|
-
p[
|
|
499
|
-
}),
|
|
500
|
-
var
|
|
501
|
-
|
|
502
|
-
p.children[
|
|
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";
|
|
503
504
|
});
|
|
504
505
|
});
|
|
505
506
|
}
|
|
506
507
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
508
|
+
function m(s) {
|
|
509
|
+
return s ? window.getComputedStyle ? getComputedStyle(s) : s.currentStyle || null : null;
|
|
509
510
|
}
|
|
510
|
-
var
|
|
511
|
+
var b = void 0;
|
|
511
512
|
window.addEventListener("resize", function() {
|
|
512
|
-
e.assumeViewportIndependence &&
|
|
513
|
-
}), Prism.hooks.add("complete", function(
|
|
514
|
-
if (
|
|
515
|
-
var
|
|
513
|
+
e.assumeViewportIndependence && b === window.innerWidth || (b = window.innerWidth, i(Array.prototype.slice.call(document.querySelectorAll("pre." + r))));
|
|
514
|
+
}), Prism.hooks.add("complete", function(s) {
|
|
515
|
+
if (s.code) {
|
|
516
|
+
var c = (
|
|
516
517
|
/** @type {Element} */
|
|
517
|
-
|
|
518
|
-
),
|
|
518
|
+
s.element
|
|
519
|
+
), n = (
|
|
519
520
|
/** @type {HTMLElement} */
|
|
520
|
-
|
|
521
|
+
c.parentNode
|
|
521
522
|
);
|
|
522
|
-
if (!(!
|
|
523
|
-
|
|
524
|
-
var
|
|
525
|
-
|
|
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);
|
|
526
527
|
}
|
|
527
528
|
}
|
|
528
|
-
}), Prism.hooks.add("line-numbers", function(
|
|
529
|
-
|
|
529
|
+
}), Prism.hooks.add("line-numbers", function(s) {
|
|
530
|
+
s.plugins = s.plugins || {}, s.plugins.lineNumbers = !0;
|
|
530
531
|
});
|
|
531
532
|
})();
|
|
532
|
-
const
|
|
533
|
+
const we = ["innerHTML"], Ue = /* @__PURE__ */ y({
|
|
533
534
|
__name: "ScalarCodeBlock",
|
|
534
535
|
props: {
|
|
535
536
|
content: {},
|
|
@@ -538,78 +539,83 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
538
539
|
hideCredentials: {}
|
|
539
540
|
},
|
|
540
541
|
setup(r) {
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
|
|
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)
|
|
544
547
|
return;
|
|
545
|
-
let
|
|
546
|
-
typeof
|
|
547
|
-
(
|
|
548
|
-
)),
|
|
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(
|
|
549
552
|
/<span class="credentials">.*?<\/span>/g,
|
|
550
|
-
(
|
|
551
|
-
),
|
|
553
|
+
(o) => o.replace(/<span class="credentials">|<\/span>/g, "")
|
|
554
|
+
), t.content = t.content.replace(
|
|
552
555
|
new RegExp(
|
|
553
|
-
typeof
|
|
556
|
+
typeof a.hideCredentials == "string" ? a.hideCredentials : a.hideCredentials.join("|"),
|
|
554
557
|
"g"
|
|
555
558
|
),
|
|
556
|
-
(
|
|
559
|
+
(o) => `<span class="credentials">${o}</span>`
|
|
557
560
|
));
|
|
558
561
|
});
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
() =>
|
|
562
|
+
const s = x(null), c = x(ne[i] ?? ""), n = z(() => a.lang === "node" ? "js" : a.lang), l = a.lang;
|
|
563
|
+
q(
|
|
564
|
+
[() => a.lang, () => a.content, s],
|
|
562
565
|
() => {
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
566
|
+
s.value && a.content && (!c.value || a.lang !== l) && (c.value = "", K(() => b(s.value)));
|
|
567
|
+
},
|
|
568
|
+
{ immediate: !0 }
|
|
569
|
+
);
|
|
570
|
+
const p = /\n(?!$)/g;
|
|
571
|
+
return Y(async () => {
|
|
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
|
+
});
|
|
577
|
+
const u = _.highlight(
|
|
578
|
+
typeof a.content == "object" ? JSON.stringify(a.content) : a.content,
|
|
579
|
+
_.languages[n.value],
|
|
580
|
+
n.value
|
|
570
581
|
);
|
|
571
|
-
|
|
582
|
+
if (c.value = u + t, e !== 0) {
|
|
583
|
+
const o = J();
|
|
584
|
+
o.payload.data[i] = u + t;
|
|
585
|
+
}
|
|
572
586
|
}), B(async () => {
|
|
573
|
-
|
|
574
|
-
}), (
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
`scalar-component scalar-codeblock-pre language-${a.value}`,
|
|
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
|
+
class: h([
|
|
590
|
+
`scalar-component scalar-codeblock-pre language-${n.value}`,
|
|
578
591
|
{
|
|
579
|
-
"line-numbers":
|
|
592
|
+
"line-numbers": t.lineNumbers
|
|
580
593
|
}
|
|
581
594
|
])
|
|
582
595
|
}, [
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
], 2)) : (g(), v("pre", {
|
|
590
|
-
key: 1,
|
|
591
|
-
class: m(["scalar-component scalar-codeblock-pre", {
|
|
592
|
-
"line-numbers": n.lineNumbers
|
|
593
|
-
}])
|
|
594
|
-
}, [
|
|
595
|
-
w("code", {
|
|
596
|
+
c.value ? (g(), v("code", {
|
|
597
|
+
key: 0,
|
|
598
|
+
class: h(`scalar-codeblock-code language-${n.value}`),
|
|
599
|
+
innerHTML: c.value
|
|
600
|
+
}, null, 10, we)) : (g(), v("code", {
|
|
601
|
+
key: 1,
|
|
596
602
|
ref_key: "el",
|
|
597
|
-
ref:
|
|
598
|
-
class:
|
|
599
|
-
},
|
|
603
|
+
ref: s,
|
|
604
|
+
class: h(`scalar-codeblock-code language-${n.value}`)
|
|
605
|
+
}, N(t.content), 3))
|
|
600
606
|
], 2));
|
|
601
607
|
}
|
|
602
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) => {
|
|
603
|
-
const
|
|
604
|
-
return R[
|
|
605
|
-
},
|
|
609
|
+
const a = `./${r}.svg`;
|
|
610
|
+
return R[a] ? Z(R[a]) : (console.warn(`Could not find icon: ${r}`), null);
|
|
611
|
+
}, ye = ["src"], j = /* @__PURE__ */ y({
|
|
606
612
|
__name: "ScalarIcon",
|
|
607
613
|
props: {
|
|
608
614
|
icon: {},
|
|
609
615
|
size: {}
|
|
610
616
|
},
|
|
611
617
|
setup(r) {
|
|
612
|
-
const
|
|
618
|
+
const a = r, e = I({
|
|
613
619
|
variants: {
|
|
614
620
|
size: {
|
|
615
621
|
xs: "h-3 w-3",
|
|
@@ -623,16 +629,16 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
623
629
|
defaultVariants: {
|
|
624
630
|
size: "full"
|
|
625
631
|
}
|
|
626
|
-
}),
|
|
627
|
-
return (
|
|
632
|
+
}), i = P(a.icon);
|
|
633
|
+
return (m, b) => d(i) ? (g(), L(G(d(P)(m.icon)), {
|
|
628
634
|
key: 0,
|
|
629
|
-
class:
|
|
635
|
+
class: h(d(S)("scalar-icon", d(e)({ size: m.size })))
|
|
630
636
|
}, null, 8, ["class"])) : (g(), v("img", {
|
|
631
637
|
key: 1,
|
|
632
|
-
src:
|
|
633
|
-
}, null, 8,
|
|
638
|
+
src: m.icon
|
|
639
|
+
}, null, 8, ye));
|
|
634
640
|
}
|
|
635
|
-
}),
|
|
641
|
+
}), ke = ["ariaDisabled"], Ee = { class: "sr-only" }, _e = /* @__PURE__ */ y({
|
|
636
642
|
__name: "ScalarIconButton",
|
|
637
643
|
props: {
|
|
638
644
|
label: {},
|
|
@@ -642,7 +648,7 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
642
648
|
size: { default: "md" }
|
|
643
649
|
},
|
|
644
650
|
setup(r) {
|
|
645
|
-
const
|
|
651
|
+
const a = I({
|
|
646
652
|
base: "scalar-icon-button grid aspect-square cursor-pointer rounded",
|
|
647
653
|
variants: {
|
|
648
654
|
size: {
|
|
@@ -657,16 +663,16 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
657
663
|
variant: V
|
|
658
664
|
}
|
|
659
665
|
});
|
|
660
|
-
return (e,
|
|
666
|
+
return (e, i) => (g(), v("button", {
|
|
661
667
|
ariaDisabled: e.disabled || void 0,
|
|
662
|
-
class:
|
|
668
|
+
class: h(d(S)(d(a)({ size: e.size, variant: e.variant, disabled: e.disabled }))),
|
|
663
669
|
type: "button"
|
|
664
670
|
}, [
|
|
665
|
-
C(
|
|
666
|
-
|
|
667
|
-
], 10,
|
|
671
|
+
C(d(j), { icon: e.icon }, null, 8, ["icon"]),
|
|
672
|
+
k("span", Ee, N(e.label), 1)
|
|
673
|
+
], 10, ke));
|
|
668
674
|
}
|
|
669
|
-
}),
|
|
675
|
+
}), Ve = () => $({
|
|
670
676
|
open: !1,
|
|
671
677
|
show() {
|
|
672
678
|
this.open = !0;
|
|
@@ -674,7 +680,7 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
674
680
|
hide() {
|
|
675
681
|
this.open = !1;
|
|
676
682
|
}
|
|
677
|
-
}),
|
|
683
|
+
}), Ne = /* @__PURE__ */ y({
|
|
678
684
|
__name: "ScalarModal",
|
|
679
685
|
props: {
|
|
680
686
|
state: {},
|
|
@@ -685,7 +691,7 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
685
691
|
variant: {}
|
|
686
692
|
},
|
|
687
693
|
setup(r) {
|
|
688
|
-
const
|
|
694
|
+
const a = I({
|
|
689
695
|
base: [
|
|
690
696
|
"scalar-modal",
|
|
691
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"
|
|
@@ -703,46 +709,46 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
703
709
|
}
|
|
704
710
|
}
|
|
705
711
|
});
|
|
706
|
-
return (e,
|
|
712
|
+
return (e, i) => (g(), L(d(oe), {
|
|
707
713
|
open: e.state.open,
|
|
708
|
-
onClose:
|
|
714
|
+
onClose: i[0] || (i[0] = (m) => e.state.hide())
|
|
709
715
|
}, {
|
|
710
|
-
default:
|
|
711
|
-
|
|
712
|
-
class:
|
|
713
|
-
|
|
716
|
+
default: A(() => [
|
|
717
|
+
k("div", {
|
|
718
|
+
class: h(
|
|
719
|
+
d(S)(
|
|
714
720
|
"scalar-modal-layout fixed left-0 top-0",
|
|
715
721
|
"z-[1001] h-[100dvh] w-[100dvw]",
|
|
716
722
|
"bg-backdrop p-5 opacity-0"
|
|
717
723
|
)
|
|
718
724
|
)
|
|
719
725
|
}, [
|
|
720
|
-
C(
|
|
721
|
-
class:
|
|
726
|
+
C(d(se), {
|
|
727
|
+
class: h(d(a)({ size: e.size, variant: e.variant })),
|
|
722
728
|
style: F({ maxWidth: e.maxWidth })
|
|
723
729
|
}, {
|
|
724
|
-
default:
|
|
725
|
-
e.title ? (g(), L(
|
|
730
|
+
default: A(() => [
|
|
731
|
+
e.title ? (g(), L(d(ie), {
|
|
726
732
|
key: 0,
|
|
727
|
-
class:
|
|
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" }])
|
|
728
734
|
}, {
|
|
729
|
-
default:
|
|
730
|
-
|
|
735
|
+
default: A(() => [
|
|
736
|
+
Q(N(e.title), 1)
|
|
731
737
|
]),
|
|
732
738
|
_: 1
|
|
733
739
|
}, 8, ["class"])) : E("", !0),
|
|
734
|
-
C(
|
|
735
|
-
class:
|
|
740
|
+
C(d(le), {
|
|
741
|
+
class: h([
|
|
736
742
|
"scalar-modal-body relative max-h-[calc(100dvh-240px)] overflow-y-auto rounded-lg bg-back-1 px-6 pb-4 pt-6",
|
|
737
|
-
|
|
743
|
+
d(S)(
|
|
738
744
|
e.bodyClass,
|
|
739
745
|
e.variant === "history" && "pt-3",
|
|
740
746
|
e.variant === "search" && "col max-h-[440px] overflow-hidden p-0"
|
|
741
747
|
)
|
|
742
748
|
])
|
|
743
749
|
}, {
|
|
744
|
-
default:
|
|
745
|
-
|
|
750
|
+
default: A(() => [
|
|
751
|
+
T(e.$slots, "default", {}, void 0, !0)
|
|
746
752
|
]),
|
|
747
753
|
_: 3
|
|
748
754
|
}, 8, ["class"])
|
|
@@ -754,13 +760,13 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
754
760
|
_: 3
|
|
755
761
|
}, 8, ["open"]));
|
|
756
762
|
}
|
|
757
|
-
}),
|
|
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({
|
|
758
764
|
__name: "ScalarTextField",
|
|
759
765
|
props: {
|
|
760
766
|
modelValue: {},
|
|
761
767
|
placeholder: {},
|
|
762
768
|
label: {},
|
|
763
|
-
labelShadowColor: { default: "var(--
|
|
769
|
+
labelShadowColor: { default: "var(--scalar-background-2)" },
|
|
764
770
|
error: { type: Boolean },
|
|
765
771
|
isMultiline: { type: Boolean },
|
|
766
772
|
helperText: {},
|
|
@@ -770,8 +776,8 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
770
776
|
disableTrim: { type: Boolean, default: !1 }
|
|
771
777
|
},
|
|
772
778
|
emits: ["submit", "update:modelValue"],
|
|
773
|
-
setup(r, { emit:
|
|
774
|
-
const e = r,
|
|
779
|
+
setup(r, { emit: a }) {
|
|
780
|
+
const e = r, i = a, m = I({
|
|
775
781
|
base: "scalar-input-wrapper relative flex items-center rounded border border-solid border-border",
|
|
776
782
|
variants: {
|
|
777
783
|
focus: {
|
|
@@ -779,129 +785,129 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
779
785
|
},
|
|
780
786
|
error: { true: "scalar-input-wrapper-error border-error" }
|
|
781
787
|
}
|
|
782
|
-
}),
|
|
783
|
-
let
|
|
788
|
+
}), b = H(), s = b.id || `id-${de()}`, c = x(), n = x(!1);
|
|
789
|
+
let l;
|
|
784
790
|
if (e.isMultiline) {
|
|
785
|
-
const { triggerResize:
|
|
786
|
-
element:
|
|
791
|
+
const { triggerResize: o } = ce({
|
|
792
|
+
element: c,
|
|
787
793
|
input: e.modelValue
|
|
788
794
|
});
|
|
789
|
-
|
|
795
|
+
l = o;
|
|
790
796
|
}
|
|
791
|
-
function p(
|
|
792
|
-
const
|
|
793
|
-
e.isMultiline &&
|
|
797
|
+
function p(o) {
|
|
798
|
+
const f = o.target.value;
|
|
799
|
+
e.isMultiline && l(), e.handleFieldChange ? e.handleFieldChange(f) : i("update:modelValue", f);
|
|
794
800
|
}
|
|
795
|
-
function
|
|
796
|
-
const
|
|
797
|
-
e.handleFieldSubmit ? e.handleFieldSubmit(
|
|
801
|
+
function t(o) {
|
|
802
|
+
const f = o.target, w = e.disableTrim || e.isMultiline ? f.value : f.value.trim();
|
|
803
|
+
e.handleFieldSubmit ? e.handleFieldSubmit(w) : i("submit", w);
|
|
798
804
|
}
|
|
799
|
-
function
|
|
800
|
-
|
|
805
|
+
function u(o) {
|
|
806
|
+
n.value = !1, e.emitOnBlur && e.modelValue && t(o);
|
|
801
807
|
}
|
|
802
808
|
return B(() => {
|
|
803
|
-
var
|
|
804
|
-
Object.prototype.hasOwnProperty.call(
|
|
805
|
-
}), (
|
|
806
|
-
|
|
807
|
-
class:
|
|
809
|
+
var o;
|
|
810
|
+
Object.prototype.hasOwnProperty.call(b, "autofocus") && ((o = c.value) == null || o.focus());
|
|
811
|
+
}), (o, f) => (g(), v("div", Ae, [
|
|
812
|
+
k("div", {
|
|
813
|
+
class: h(d(m)({ error: o.error, focus: n.value }))
|
|
808
814
|
}, [
|
|
809
|
-
(g(), L(G(
|
|
815
|
+
(g(), L(G(o.isMultiline ? "textarea" : "input"), M({ id: d(s) }, o.$attrs, {
|
|
810
816
|
ref_key: "input",
|
|
811
|
-
ref:
|
|
817
|
+
ref: c,
|
|
812
818
|
class: [
|
|
813
819
|
"scalar-input",
|
|
814
|
-
|
|
815
|
-
{ "min-h-[77px]":
|
|
820
|
+
d(S)(
|
|
821
|
+
{ "min-h-[77px]": o.isMultiline },
|
|
816
822
|
"z-10 w-full resize-none appearance-none border-0 bg-transparent p-3 text-sm text-fore-1",
|
|
817
823
|
"outline-none transition-opacity"
|
|
818
824
|
)
|
|
819
825
|
],
|
|
820
|
-
placeholder:
|
|
821
|
-
value:
|
|
822
|
-
onBlur:
|
|
823
|
-
onFocus:
|
|
826
|
+
placeholder: o.placeholder,
|
|
827
|
+
value: o.modelValue,
|
|
828
|
+
onBlur: u,
|
|
829
|
+
onFocus: f[0] || (f[0] = (w) => n.value = !0),
|
|
824
830
|
onInput: p,
|
|
825
|
-
onKeyup:
|
|
831
|
+
onKeyup: ee(t, ["enter"])
|
|
826
832
|
}), null, 16, ["id", "class", "placeholder", "value"])),
|
|
827
|
-
|
|
833
|
+
o.label ? (g(), v("label", {
|
|
828
834
|
key: 0,
|
|
829
|
-
class:
|
|
830
|
-
|
|
835
|
+
class: h(
|
|
836
|
+
d(S)(
|
|
831
837
|
"scalar-input-label pointer-events-none absolute left-0 top-0 mx-2 my-3 px-1 text-xs",
|
|
832
838
|
"shadow-current z-10 origin-top-left rounded text-fore-3 transition-transform"
|
|
833
839
|
)
|
|
834
840
|
),
|
|
835
|
-
for:
|
|
841
|
+
for: d(s),
|
|
836
842
|
style: F({
|
|
837
|
-
"box-shadow": `0 0 4px 4px ${
|
|
838
|
-
"background-color":
|
|
843
|
+
"box-shadow": `0 0 4px 4px ${o.labelShadowColor}`,
|
|
844
|
+
"background-color": o.labelShadowColor
|
|
839
845
|
})
|
|
840
|
-
},
|
|
841
|
-
|
|
842
|
-
|
|
846
|
+
}, N(o.label), 15, Te)) : E("", !0),
|
|
847
|
+
k("div", Ce, [
|
|
848
|
+
T(o.$slots, "default", {}, void 0, !0)
|
|
843
849
|
])
|
|
844
850
|
], 2),
|
|
845
|
-
|
|
846
|
-
class:
|
|
847
|
-
|
|
851
|
+
k("span", {
|
|
852
|
+
class: h(
|
|
853
|
+
d(S)(
|
|
848
854
|
"helper-text before:rounded-full mt-1.5 flex items-center text-xs text-error before:font-black",
|
|
849
855
|
"before:mr-1.5 before:block before:h-4 before:w-4 before:text-center before:text-xxs before:leading-4",
|
|
850
856
|
"before:bg-error before:text-white before:content-['!'] empty:hidden"
|
|
851
857
|
)
|
|
852
858
|
)
|
|
853
|
-
},
|
|
859
|
+
}, N(o.helperText), 3)
|
|
854
860
|
]));
|
|
855
861
|
}
|
|
856
|
-
}),
|
|
862
|
+
}), Le = /* @__PURE__ */ D(xe, [["__scopeId", "data-v-4fc2339e"]]), je = {
|
|
857
863
|
boxShadow: {
|
|
858
|
-
DEFAULT: "var(--
|
|
859
|
-
md: "var(--
|
|
864
|
+
DEFAULT: "var(--scalar-shadow-1)",
|
|
865
|
+
md: "var(--scalar-shadow-2)",
|
|
860
866
|
sm: "rgba(0, 0, 0, 0.09) 0px 1px 4px",
|
|
861
867
|
none: "0 0 #0000"
|
|
862
868
|
},
|
|
863
869
|
colors: {
|
|
864
|
-
"fore-1": "var(--
|
|
865
|
-
"fore-2": "var(--
|
|
866
|
-
"fore-3": "var(--
|
|
867
|
-
accent: "var(--
|
|
868
|
-
"back-1": "var(--
|
|
869
|
-
"back-2": "var(--
|
|
870
|
-
"back-3": "var(--
|
|
871
|
-
"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)",
|
|
872
878
|
backdrop: "rgba(0, 0, 0, 0.44)",
|
|
873
|
-
border: "var(--
|
|
874
|
-
"back-btn-1": "var(--
|
|
875
|
-
"fore-btn-1": "var(--
|
|
876
|
-
"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)",
|
|
877
883
|
white: "#FFF",
|
|
878
|
-
green: "var(--
|
|
879
|
-
red: "var(--
|
|
880
|
-
yellow: "var(--
|
|
881
|
-
blue: "var(--
|
|
882
|
-
orange: "var(--
|
|
883
|
-
purple: "var(--
|
|
884
|
-
error: "var(--
|
|
885
|
-
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)",
|
|
886
892
|
transparent: "transparent"
|
|
887
893
|
}
|
|
888
|
-
},
|
|
894
|
+
}, We = {
|
|
889
895
|
borderRadius: {
|
|
890
|
-
DEFAULT: "var(--
|
|
891
|
-
md: "var(--
|
|
892
|
-
lg: "var(--
|
|
893
|
-
xl: "var(--
|
|
896
|
+
DEFAULT: "var(--scalar-radius)",
|
|
897
|
+
md: "var(--scalar-radius)",
|
|
898
|
+
lg: "var(--scalar-radius-lg)",
|
|
899
|
+
xl: "var(--scalar-radius-xl)"
|
|
894
900
|
},
|
|
895
901
|
fontSize: {
|
|
896
|
-
xxs: "var(--
|
|
897
|
-
xs: "var(--
|
|
898
|
-
sm: "var(--
|
|
899
|
-
base: "var(--
|
|
900
|
-
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)"
|
|
901
907
|
},
|
|
902
908
|
fontWeight: {
|
|
903
|
-
medium: "var(--
|
|
904
|
-
bold: "var(--
|
|
909
|
+
medium: "var(--scalar-font-medium)",
|
|
910
|
+
bold: "var(--scalar-font-bold)"
|
|
905
911
|
},
|
|
906
912
|
maxWidth: {
|
|
907
913
|
"screen-xs": "480px",
|
|
@@ -909,22 +915,22 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
909
915
|
"screen-md": "640px",
|
|
910
916
|
"screen-lg": "800px"
|
|
911
917
|
}
|
|
912
|
-
},
|
|
918
|
+
}, Xe = {
|
|
913
919
|
install: (r) => {
|
|
914
|
-
r.component("ScalarButton",
|
|
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);
|
|
915
921
|
}
|
|
916
922
|
};
|
|
917
923
|
export {
|
|
918
|
-
|
|
919
|
-
|
|
924
|
+
Se as ScalarButton,
|
|
925
|
+
Ue as ScalarCodeBlock,
|
|
920
926
|
j as ScalarIcon,
|
|
921
|
-
|
|
927
|
+
_e as ScalarIconButton,
|
|
922
928
|
U as ScalarLoading,
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
929
|
+
Ie as ScalarModal,
|
|
930
|
+
Le as ScalarTextField,
|
|
931
|
+
Xe as default,
|
|
932
|
+
We as extend,
|
|
933
|
+
je as theme,
|
|
934
|
+
Fe as useLoadingState,
|
|
935
|
+
Ve as useModal
|
|
930
936
|
};
|