@scalar/api-client 2.0.4 → 2.0.6
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/CHANGELOG.md +30 -0
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/App.vue.js +15 -15
- package/dist/Modal/ApiClientModal.vue.d.ts +1 -1
- package/dist/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/Modal/ApiClientModal.vue.js +1 -1
- package/dist/Modal/ApiClientModal.vue2.js +16 -15
- package/dist/Modal/api-client-modal.d.ts +1 -1
- package/dist/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/Modal/api-client-modal.js +43 -43
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +2 -2
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +8 -8
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -0
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/DataTable/DataTableInput.vue2.js +44 -37
- package/dist/components/DataTable/DataTableInputEnumSelect.vue.d.ts +22 -0
- package/dist/components/DataTable/DataTableInputEnumSelect.vue.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableInputEnumSelect.vue.js +102 -0
- package/dist/components/DataTable/DataTableInputEnumSelect.vue2.js +4 -0
- package/dist/components/SideNav/SideNavLink.vue.js +2 -2
- package/dist/constants.js +1 -1
- package/dist/store/workspace.d.ts +75 -12
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +113 -109
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +13 -11
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +33 -30
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +10 -10
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +24 -23
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +12 -11
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +6 -6
- package/package.json +8 -8
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as B, ref as s, computed as q, openBlock as r, createBlock as d, normalizeClass as p, withCtx as $, createElementBlock as m, renderSlot as f, createCommentVNode as c, createElementVNode as x, mergeProps as C, unref as S, createVNode as D } from "vue";
|
|
2
2
|
import I from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
|
|
3
3
|
import { ScalarIconButton as M } from "@scalar/components";
|
|
4
4
|
import O from "./DataTableCell.vue.js";
|
|
5
|
-
|
|
5
|
+
import F from "./DataTableInputEnumSelect.vue.js";
|
|
6
|
+
const N = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "text-c-2 flex min-w-[100px] items-center border-r-1/2 pl-2 pr-0"
|
|
8
|
-
},
|
|
9
|
+
}, P = ["id", "readOnly", "required", "type", "value"], z = /* @__PURE__ */ B({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "DataTableInput",
|
|
11
12
|
props: {
|
|
@@ -14,37 +15,43 @@ const F = {
|
|
|
14
15
|
containerClass: {},
|
|
15
16
|
required: { type: Boolean, default: !1 },
|
|
16
17
|
modelValue: {},
|
|
17
|
-
readOnly: { type: Boolean, default: !1 }
|
|
18
|
+
readOnly: { type: Boolean, default: !1 },
|
|
19
|
+
enum: {}
|
|
18
20
|
},
|
|
19
21
|
emits: ["update:modelValue", "inputFocus", "inputBlur", "selectVariable"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
() =>
|
|
25
|
-
),
|
|
22
|
+
setup(v, { emit: y }) {
|
|
23
|
+
const o = v, l = y, a = s(!0), i = s(""), n = s(!1), w = () => {
|
|
24
|
+
n.value || l("inputBlur");
|
|
25
|
+
}, h = q(
|
|
26
|
+
() => o.type === "password" ? a.value ? "password" : "text" : o.type ?? "text"
|
|
27
|
+
), V = (e) => {
|
|
26
28
|
const t = e.target;
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
29
|
+
i.value = t.value, l("update:modelValue", t.value);
|
|
30
|
+
}, k = (e) => {
|
|
31
|
+
l("update:modelValue", e);
|
|
32
|
+
}, b = () => {
|
|
33
|
+
n.value = !0;
|
|
32
34
|
}, g = () => {
|
|
33
|
-
|
|
35
|
+
n.value = !1;
|
|
34
36
|
};
|
|
35
|
-
return (e, t) => (
|
|
36
|
-
class:
|
|
37
|
+
return (e, t) => (r(), d(O, {
|
|
38
|
+
class: p(["relative row", e.containerClass])
|
|
37
39
|
}, {
|
|
38
40
|
default: $(() => [
|
|
39
|
-
e.$slots.default ? (
|
|
40
|
-
|
|
41
|
+
e.$slots.default ? (r(), m("div", N, [
|
|
42
|
+
f(e.$slots, "default", {}, void 0, !0)
|
|
41
43
|
])) : c("", !0),
|
|
42
|
-
|
|
43
|
-
class:
|
|
44
|
-
"relative after:absolute after:
|
|
44
|
+
x("div", {
|
|
45
|
+
class: p(["group row-1", {
|
|
46
|
+
"relative required after:absolute after:centered-y after:right-0 after:pt-px after:pr-2 after:text-xxs after:font-medium after:text-c-3 after:bg-b-1 after:shadow-[-8px_0_4px_var(--scalar-background-1)] group-has-[:focus]:after:hidden": e.required
|
|
45
47
|
}])
|
|
46
48
|
}, [
|
|
47
|
-
|
|
49
|
+
o.enum && o.enum.length ? (r(), d(F, {
|
|
50
|
+
key: 0,
|
|
51
|
+
enum: o.enum,
|
|
52
|
+
modelValue: o.modelValue,
|
|
53
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => l("update:modelValue", u))
|
|
54
|
+
}, null, 8, ["enum", "modelValue"])) : (r(), m("input", C({ key: 1 }, e.$attrs, {
|
|
48
55
|
id: e.id,
|
|
49
56
|
autocomplete: "off",
|
|
50
57
|
class: "border-none focus:text-c-1 text-c-2 min-w-0 w-full px-2 py-1.5 outline-none",
|
|
@@ -52,26 +59,26 @@ const F = {
|
|
|
52
59
|
readOnly: e.readOnly,
|
|
53
60
|
required: e.required,
|
|
54
61
|
spellcheck: "false",
|
|
55
|
-
type:
|
|
62
|
+
type: h.value,
|
|
56
63
|
value: e.modelValue,
|
|
57
64
|
onBlur: w,
|
|
58
|
-
onFocus: t[
|
|
59
|
-
onInput:
|
|
60
|
-
}), null, 16,
|
|
65
|
+
onFocus: t[1] || (t[1] = (u) => l("inputFocus")),
|
|
66
|
+
onInput: V
|
|
67
|
+
}), null, 16, P))
|
|
61
68
|
], 2),
|
|
62
|
-
|
|
63
|
-
e.type === "password" ? (
|
|
69
|
+
f(e.$slots, "icon", {}, void 0, !0),
|
|
70
|
+
e.type === "password" ? (r(), d(S(M), {
|
|
64
71
|
key: 1,
|
|
65
72
|
class: "-ml-.5 mr-1 h-6 w-6 self-center p-1.5",
|
|
66
|
-
icon:
|
|
67
|
-
label:
|
|
68
|
-
onClick: t[
|
|
73
|
+
icon: a.value ? "Show" : "Hide",
|
|
74
|
+
label: a.value ? "Show Password" : "Hide Password",
|
|
75
|
+
onClick: t[2] || (t[2] = (u) => a.value = !a.value)
|
|
69
76
|
}, null, 8, ["icon", "label"])) : c("", !0),
|
|
70
77
|
D(I, {
|
|
71
|
-
query:
|
|
72
|
-
onMousedown:
|
|
78
|
+
query: i.value,
|
|
79
|
+
onMousedown: b,
|
|
73
80
|
onMouseup: g,
|
|
74
|
-
onSelect:
|
|
81
|
+
onSelect: k
|
|
75
82
|
}, null, 8, ["query"])
|
|
76
83
|
]),
|
|
77
84
|
_: 3
|
|
@@ -79,5 +86,5 @@ const F = {
|
|
|
79
86
|
}
|
|
80
87
|
});
|
|
81
88
|
export {
|
|
82
|
-
|
|
89
|
+
z as default
|
|
83
90
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
|
+
modelValue: string | number;
|
|
3
|
+
enum?: string[];
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"update:modelValue": (v: string) => void;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
7
|
+
modelValue: string | number;
|
|
8
|
+
enum?: string[];
|
|
9
|
+
}>>> & {
|
|
10
|
+
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToOption<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=DataTableInputEnumSelect.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTableInputEnumSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableInputEnumSelect.vue"],"names":[],"mappings":";gBA+Hc,MAAM,GAAG,MAAM;WACpB,MAAM,EAAE;;;;gBADH,MAAM,GAAG,MAAM;WACpB,MAAM,EAAE;;;;AA4SjB,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { defineComponent as D, computed as b, ref as d, watch as B, openBlock as o, createElementBlock as m, withDirectives as z, withKeys as N, vModelText as j, createBlock as p, unref as t, withCtx as u, Fragment as E, renderList as I, createElementVNode as i, normalizeClass as T, createVNode as s, createTextVNode as A, toDisplayString as w, createCommentVNode as K } from "vue";
|
|
2
|
+
import { ScalarDropdown as $, ScalarDropdownItem as V, ScalarIcon as v, ScalarDropdownDivider as F, ScalarButton as L } from "@scalar/components";
|
|
3
|
+
const M = { class: "w-full" }, U = { class: "flex items-center justify-center h-4 w-4" }, W = /* @__PURE__ */ i("span", null, "Add value", -1), J = /* @__PURE__ */ D({
|
|
4
|
+
__name: "DataTableInputEnumSelect",
|
|
5
|
+
props: {
|
|
6
|
+
modelValue: {},
|
|
7
|
+
enum: {}
|
|
8
|
+
},
|
|
9
|
+
emits: ["update:modelValue"],
|
|
10
|
+
setup(k, { emit: y }) {
|
|
11
|
+
const f = k, x = y, _ = b(() => f.enum ?? []), n = d(f.modelValue.toString()), r = d(!1), l = d("");
|
|
12
|
+
B(l, (a) => {
|
|
13
|
+
x("update:modelValue", a);
|
|
14
|
+
});
|
|
15
|
+
const h = (a) => {
|
|
16
|
+
n.value = a, x("update:modelValue", a), r.value = !1;
|
|
17
|
+
}, g = () => {
|
|
18
|
+
l.value.trim() && (h(l.value), l.value = "");
|
|
19
|
+
}, C = () => {
|
|
20
|
+
l.value.trim() || (n.value = "", r.value = !1);
|
|
21
|
+
}, S = (a) => n.value === a;
|
|
22
|
+
return (a, c) => (o(), m("div", M, [
|
|
23
|
+
r.value ? z((o(), m("input", {
|
|
24
|
+
key: 0,
|
|
25
|
+
"onUpdate:modelValue": c[0] || (c[0] = (e) => l.value = e),
|
|
26
|
+
class: "border-none focus:text-c-1 text-c-2 min-w-0 w-full px-2 py-1.5 outline-none",
|
|
27
|
+
placeholder: "Value",
|
|
28
|
+
type: "text",
|
|
29
|
+
onBlur: C,
|
|
30
|
+
onKeyup: N(g, ["enter"])
|
|
31
|
+
}, null, 544)), [
|
|
32
|
+
[j, l.value]
|
|
33
|
+
]) : (o(), p(t($), {
|
|
34
|
+
key: 1,
|
|
35
|
+
resize: "",
|
|
36
|
+
value: n.value
|
|
37
|
+
}, {
|
|
38
|
+
items: u(() => [
|
|
39
|
+
(o(!0), m(E, null, I(_.value, (e) => (o(), p(t(V), {
|
|
40
|
+
key: e,
|
|
41
|
+
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
|
|
42
|
+
value: e,
|
|
43
|
+
onClick: (q) => h(e)
|
|
44
|
+
}, {
|
|
45
|
+
default: u(() => [
|
|
46
|
+
i("div", {
|
|
47
|
+
class: T([
|
|
48
|
+
"flex items-center justify-center rounded-full p-[3px] group-hover/item:shadow-border",
|
|
49
|
+
S(e) ? "bg-blue text-b-1" : "text-transparent"
|
|
50
|
+
])
|
|
51
|
+
}, [
|
|
52
|
+
s(t(v), {
|
|
53
|
+
class: "size-2.5 stroke-[1.75]",
|
|
54
|
+
icon: "Checkmark"
|
|
55
|
+
})
|
|
56
|
+
], 2),
|
|
57
|
+
A(" " + w(e), 1)
|
|
58
|
+
]),
|
|
59
|
+
_: 2
|
|
60
|
+
}, 1032, ["value", "onClick"]))), 128)),
|
|
61
|
+
s(t(F)),
|
|
62
|
+
s(t(V), {
|
|
63
|
+
class: "flex items-center gap-1.5",
|
|
64
|
+
onClick: c[1] || (c[1] = (e) => r.value = !0)
|
|
65
|
+
}, {
|
|
66
|
+
default: u(() => [
|
|
67
|
+
i("div", U, [
|
|
68
|
+
s(t(v), {
|
|
69
|
+
class: "h-2.5",
|
|
70
|
+
icon: "Add"
|
|
71
|
+
})
|
|
72
|
+
]),
|
|
73
|
+
W
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
})
|
|
77
|
+
]),
|
|
78
|
+
default: u(() => [
|
|
79
|
+
s(t(L), {
|
|
80
|
+
class: "gap-1.5 font-normal h-full justify-start px-2 py-1.5",
|
|
81
|
+
fullWidth: "",
|
|
82
|
+
variant: "ghost"
|
|
83
|
+
}, {
|
|
84
|
+
default: u(() => [
|
|
85
|
+
i("span", null, w(n.value || "Select a value"), 1),
|
|
86
|
+
n.value ? K("", !0) : (o(), p(t(v), {
|
|
87
|
+
key: 0,
|
|
88
|
+
icon: "ChevronDown",
|
|
89
|
+
size: "xs"
|
|
90
|
+
}))
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
})
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
}, 8, ["value"]))
|
|
97
|
+
]));
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
export {
|
|
101
|
+
J as default
|
|
102
|
+
};
|
|
@@ -12,12 +12,12 @@ const d = { class: "sr-only" }, k = /* @__PURE__ */ t({
|
|
|
12
12
|
const o = n("router-link");
|
|
13
13
|
return r(), s(o, {
|
|
14
14
|
activeClass: "active-link",
|
|
15
|
-
class: a(["w-[37px] hover:text-c-1 flex items-center justify-center rounded-lg p-
|
|
15
|
+
class: a(["w-[37px] hover:text-c-1 flex items-center justify-center rounded-lg p-[7px]", { "bg-b-2 transition-none hover:cursor-auto text-c-1": e.active }]),
|
|
16
16
|
to: e.path
|
|
17
17
|
}, {
|
|
18
18
|
default: c(() => [
|
|
19
19
|
l(i(m), {
|
|
20
|
-
class: "stroke-[
|
|
20
|
+
class: "stroke-[1.5]",
|
|
21
21
|
icon: e.icon
|
|
22
22
|
}, null, 8, ["icon"]),
|
|
23
23
|
p("span", d, [
|
package/dist/constants.js
CHANGED
|
@@ -2,7 +2,7 @@ const e = [
|
|
|
2
2
|
{ label: "Requests", icon: "ExternalLink", path: "/request" },
|
|
3
3
|
{ label: "Cookies", icon: "Cookie", path: "/cookies" },
|
|
4
4
|
{ label: "Environment", icon: "Brackets", path: "/environment" },
|
|
5
|
-
{ label: "Servers", icon: "
|
|
5
|
+
{ label: "Servers", icon: "Server", path: "/servers" }
|
|
6
6
|
// { label: 'Git Sync', icon: 'Branch', path: '/git-sync' },
|
|
7
7
|
];
|
|
8
8
|
export {
|