@scalar/api-client 2.0.26 → 2.0.27
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 +13 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +48 -46
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +23 -30
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts +20 -0
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -0
- package/dist/components/Sidebar/SidebarToggle.vue.js +48 -0
- package/dist/components/Sidebar/SidebarToggle.vue2.js +4 -0
- package/dist/style.css +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +32 -30
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +83 -88
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +155 -125
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +0 -5
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +24 -113
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.0.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 19d8b6a: feat: animate sidebar icon
|
|
8
|
+
- c112f24: fix: remove ScalarCodeBlock that freezes browser in response preview
|
|
9
|
+
- 83fc241: fix: constantly adding empty header
|
|
10
|
+
- 2e1ef12: fix: set content type on body change and add proper header
|
|
11
|
+
- Updated dependencies [19d8b6a]
|
|
12
|
+
- Updated dependencies [c112f24]
|
|
13
|
+
- @scalar/components@0.12.18
|
|
14
|
+
- @scalar/use-codemirror@0.11.8
|
|
15
|
+
|
|
3
16
|
## 2.0.26
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OA0RO,EAGL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;;kBAeb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;kBAlBP,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;cAFV,OAAO;iBAEJ,OAAO;iBAlBP,OAAO;gBAGR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;mBAId,OAAO;;qBA2PG,GAAG;kBACN,GAAG;;AAhR9B,wBAmTC;AAMD,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,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"}
|
|
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5c9fc64f"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
c as default
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAqH/B,eAAO,MAAM,UAAU;iBAEN,aAAa;mBAMX,UAAU;2BAMF,UAAU;EA6BpC,CAAA;AAED,eAAO,MAAM,gBAAgB,uCAmB3B,CAAA"}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
var u = Object.defineProperty;
|
|
2
|
-
var f = (
|
|
3
|
-
var c = (
|
|
2
|
+
var f = (e, n, t) => n in e ? u(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var c = (e, n, t) => f(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
4
|
import { useWorkspace as v } from "../../store/workspace.js";
|
|
5
|
-
import { ScalarButton as
|
|
5
|
+
import { ScalarButton as g, ScalarIcon as b, ScalarTooltip as h } from "@scalar/components";
|
|
6
6
|
import { ViewPlugin as x, RangeSetBuilder as w, Decoration as N, EditorView as y, WidgetType as C } from "@scalar/use-codemirror";
|
|
7
|
-
import { defineComponent as
|
|
8
|
-
const { activeParsedEnvironments:
|
|
7
|
+
import { defineComponent as E, h as s, createApp as k } from "vue";
|
|
8
|
+
const { activeParsedEnvironments: D, isReadOnly: S, environments: $ } = v(), A = (e) => "_scalarEnvId" in e ? `bg-${$[e._scalarEnvId].color}` : "bg-grey";
|
|
9
9
|
class l extends C {
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(t) {
|
|
11
11
|
super();
|
|
12
12
|
c(this, "app");
|
|
13
|
-
this.variableName =
|
|
13
|
+
this.variableName = t;
|
|
14
14
|
}
|
|
15
15
|
toDOM() {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const
|
|
16
|
+
const t = document.createElement("span");
|
|
17
|
+
t.className = "cm-pill", t.textContent = `${this.variableName}`;
|
|
18
|
+
const a = E({
|
|
19
19
|
props: ["variableName"],
|
|
20
20
|
render() {
|
|
21
|
-
const
|
|
21
|
+
const o = D.value.find(
|
|
22
22
|
(i) => i.key === this.variableName
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
);
|
|
24
|
+
o && (t.className += ` ${A(o)}`);
|
|
25
|
+
const r = o ? s("div", { class: "p-2" }, o.value) : s("div", { class: "divide-y divide-1/2 grid" }, [
|
|
26
|
+
s("span", { class: "p-2" }, "Variable not found"),
|
|
27
|
+
!S.value && s("div", { class: "p-1" }, [
|
|
28
|
+
s(
|
|
29
|
+
g,
|
|
28
30
|
{
|
|
29
31
|
class: "gap-1.5 justify-start font-normal px-1 py-1.5 h-auto transition-colors rounded no-underline text-xxs w-full hover:bg-b-2",
|
|
30
32
|
variant: "ghost",
|
|
@@ -33,14 +35,14 @@ class l extends C {
|
|
|
33
35
|
}
|
|
34
36
|
},
|
|
35
37
|
[
|
|
36
|
-
|
|
38
|
+
s(b, { class: "w-2", icon: "Add", size: "xs" }),
|
|
37
39
|
"Add variable"
|
|
38
40
|
]
|
|
39
41
|
)
|
|
40
42
|
])
|
|
41
43
|
]);
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
+
return s(
|
|
45
|
+
h,
|
|
44
46
|
{
|
|
45
47
|
align: "start",
|
|
46
48
|
class: "bg-b-1 w-full",
|
|
@@ -49,8 +51,8 @@ class l extends C {
|
|
|
49
51
|
sideOffset: 6
|
|
50
52
|
},
|
|
51
53
|
{
|
|
52
|
-
trigger: () =>
|
|
53
|
-
content: () =>
|
|
54
|
+
trigger: () => s("span", `${this.variableName}`),
|
|
55
|
+
content: () => s(
|
|
54
56
|
"div",
|
|
55
57
|
{
|
|
56
58
|
class: "w-content shadow-lg rounded bg-b-1 text-xxs leading-5 text-c-1"
|
|
@@ -61,35 +63,35 @@ class l extends C {
|
|
|
61
63
|
);
|
|
62
64
|
}
|
|
63
65
|
});
|
|
64
|
-
return this.app =
|
|
66
|
+
return this.app = k(a, { variableName: this.variableName }), this.app.mount(t), t;
|
|
65
67
|
}
|
|
66
68
|
destroy() {
|
|
67
69
|
this.app && this.app.unmount();
|
|
68
70
|
}
|
|
69
|
-
eq(
|
|
70
|
-
return
|
|
71
|
+
eq(t) {
|
|
72
|
+
return t instanceof l && t.variableName === this.variableName;
|
|
71
73
|
}
|
|
72
|
-
ignoreEvent(
|
|
74
|
+
ignoreEvent(t) {
|
|
73
75
|
return !1;
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
const V = x.fromClass(
|
|
77
79
|
class {
|
|
78
|
-
constructor(
|
|
80
|
+
constructor(e) {
|
|
79
81
|
c(this, "decorations");
|
|
80
|
-
this.decorations = this.buildDecorations(
|
|
82
|
+
this.decorations = this.buildDecorations(e);
|
|
81
83
|
}
|
|
82
|
-
update(
|
|
83
|
-
(
|
|
84
|
+
update(e) {
|
|
85
|
+
(e.docChanged || e.viewportChanged) && (this.decorations = this.buildDecorations(e.view));
|
|
84
86
|
}
|
|
85
|
-
buildDecorations(
|
|
86
|
-
const
|
|
87
|
-
for (const { from:
|
|
88
|
-
const
|
|
87
|
+
buildDecorations(e) {
|
|
88
|
+
const n = new w();
|
|
89
|
+
for (const { from: t, to: a } of e.visibleRanges) {
|
|
90
|
+
const o = e.state.doc.sliceString(t, a), r = /{{(.*?)}}/g;
|
|
89
91
|
let i;
|
|
90
|
-
for (; (i = r.exec(
|
|
91
|
-
const d =
|
|
92
|
-
|
|
92
|
+
for (; (i = r.exec(o)) !== null; ) {
|
|
93
|
+
const d = t + i.index, p = d + i[0].length, m = i[1];
|
|
94
|
+
n.add(
|
|
93
95
|
d,
|
|
94
96
|
p,
|
|
95
97
|
N.widget({
|
|
@@ -99,21 +101,21 @@ const V = x.fromClass(
|
|
|
99
101
|
);
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
|
-
return
|
|
104
|
+
return n.finish();
|
|
103
105
|
}
|
|
104
106
|
},
|
|
105
107
|
{
|
|
106
|
-
decorations: (
|
|
108
|
+
decorations: (e) => e.decorations
|
|
107
109
|
}
|
|
108
110
|
), T = y.domEventHandlers({
|
|
109
|
-
keydown(
|
|
110
|
-
if (
|
|
111
|
-
const { state:
|
|
112
|
-
if (
|
|
113
|
-
return
|
|
114
|
-
changes: { from:
|
|
115
|
-
selection: { anchor:
|
|
116
|
-
}),
|
|
111
|
+
keydown(e, n) {
|
|
112
|
+
if (e.key === "Backspace") {
|
|
113
|
+
const { state: t } = n, { from: a, to: o } = t.selection.main;
|
|
114
|
+
if (a === o && a > 0 && t.doc.sliceString(a - 2, a) === "}}")
|
|
115
|
+
return n.dispatch({
|
|
116
|
+
changes: { from: a - 2, to: o },
|
|
117
|
+
selection: { anchor: a - 2 }
|
|
118
|
+
}), e.preventDefault(), !0;
|
|
117
119
|
}
|
|
118
120
|
return !1;
|
|
119
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/HttpMethod.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/HttpMethod.vue"],"names":[],"mappings":";eAoGe,OAAO;YACV,MAAM;iBACD,OAAO;;;;;;;;eAFT,OAAO;YACV,MAAM;iBACD,OAAO;;;;;;;;cAFT,OAAO;gBAEL,OAAO;;AAkJxB,wBAOG;AAOH,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
1
|
+
import { defineComponent as g, computed as s, openBlock as i, createBlock as m, unref as t, withCtx as y, createElementVNode as r, normalizeClass as l, toDisplayString as p, createCommentVNode as q, createElementBlock as k } from "vue";
|
|
2
|
+
import { ScalarListbox as C, ScalarIcon as x } from "@scalar/components";
|
|
3
3
|
import { getRequest as B, REQUEST_METHODS as V } from "@scalar/oas-utils/helpers";
|
|
4
|
-
import { cva as
|
|
5
|
-
const z = /* @__PURE__ */
|
|
4
|
+
import { cva as w, cx as f } from "cva";
|
|
5
|
+
const z = /* @__PURE__ */ g({
|
|
6
6
|
__name: "HttpMethod",
|
|
7
7
|
props: {
|
|
8
8
|
isSquare: { type: Boolean, default: !1 },
|
|
@@ -10,17 +10,17 @@ const z = /* @__PURE__ */ S({
|
|
|
10
10
|
isEditable: { type: Boolean, default: !1 }
|
|
11
11
|
},
|
|
12
12
|
emits: ["change"],
|
|
13
|
-
setup(
|
|
14
|
-
const n =
|
|
15
|
-
([e, { short:
|
|
13
|
+
setup(b, { emit: v }) {
|
|
14
|
+
const n = b, h = v, o = s(() => B(n.method)), u = Object.entries(V).map(
|
|
15
|
+
([e, { short: a }]) => ({ id: e, label: a })
|
|
16
16
|
), d = s({
|
|
17
17
|
get: () => u.find(({ id: e }) => e === n.method),
|
|
18
18
|
set: (e) => (e == null ? void 0 : e.id) && h("change", e.id)
|
|
19
|
-
}),
|
|
19
|
+
}), c = w({
|
|
20
20
|
base: "text-center font-code text-3xs justify-center items-center flex",
|
|
21
21
|
variants: {
|
|
22
22
|
isSquare: {
|
|
23
|
-
true: "px-2.5 rounded-md
|
|
23
|
+
true: "px-2.5 rounded-md shadow-border",
|
|
24
24
|
false: "rounded-full"
|
|
25
25
|
},
|
|
26
26
|
isEditable: {
|
|
@@ -28,32 +28,25 @@ const z = /* @__PURE__ */ S({
|
|
|
28
28
|
false: "cusor-pointer"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
}), E = s(() =>
|
|
32
|
-
return (e,
|
|
31
|
+
}), E = s(() => o.value.short);
|
|
32
|
+
return (e, a) => e.isEditable ? (i(), m(t(C), {
|
|
33
33
|
key: 0,
|
|
34
34
|
modelValue: d.value,
|
|
35
|
-
"onUpdate:modelValue":
|
|
36
|
-
options:
|
|
35
|
+
"onUpdate:modelValue": a[0] || (a[0] = (S) => d.value = S),
|
|
36
|
+
options: t(u)
|
|
37
37
|
}, {
|
|
38
|
-
default:
|
|
38
|
+
default: y(() => [
|
|
39
39
|
r("div", {
|
|
40
40
|
class: l(["h-full", { "pointer-events-none": !e.isEditable }])
|
|
41
41
|
}, [
|
|
42
42
|
r("button", {
|
|
43
|
-
class: l([
|
|
44
|
-
"relative h-full gap-1",
|
|
45
|
-
a(b)(
|
|
46
|
-
a(m)({ isSquare: e.isSquare, isEditable: e.isEditable }),
|
|
47
|
-
t.value.color,
|
|
48
|
-
e.isSquare && t.value.backgroundColor
|
|
49
|
-
)
|
|
50
|
-
]),
|
|
43
|
+
class: l(["relative h-full gap-1", t(f)(t(c)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
|
|
51
44
|
type: "button"
|
|
52
45
|
}, [
|
|
53
46
|
r("span", null, p(E.value), 1),
|
|
54
|
-
e.isEditable ? (i(),
|
|
47
|
+
e.isEditable ? (i(), m(t(x), {
|
|
55
48
|
key: 0,
|
|
56
|
-
class: l(
|
|
49
|
+
class: l(o.value.color),
|
|
57
50
|
icon: "ChevronDown",
|
|
58
51
|
size: "xs"
|
|
59
52
|
}, null, 8, ["class"])) : q("", !0)
|
|
@@ -61,18 +54,18 @@ const z = /* @__PURE__ */ S({
|
|
|
61
54
|
], 2)
|
|
62
55
|
]),
|
|
63
56
|
_: 1
|
|
64
|
-
}, 8, ["modelValue", "options"])) : (i(),
|
|
57
|
+
}, 8, ["modelValue", "options"])) : (i(), k("div", {
|
|
65
58
|
key: 1,
|
|
66
59
|
class: l([
|
|
67
60
|
"relative gap-1",
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
e.isSquare &&
|
|
61
|
+
t(f)(
|
|
62
|
+
t(c)({ isSquare: e.isSquare, isEditable: e.isEditable }),
|
|
63
|
+
o.value.color,
|
|
64
|
+
e.isSquare && o.value.backgroundColor
|
|
72
65
|
)
|
|
73
66
|
]),
|
|
74
67
|
type: "button"
|
|
75
|
-
}, p(
|
|
68
|
+
}, p(o.value.short), 3));
|
|
76
69
|
}
|
|
77
70
|
});
|
|
78
71
|
export {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
|
+
modelValue: boolean;
|
|
3
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
"update:modelValue": (v: boolean) => void;
|
|
5
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
6
|
+
modelValue: boolean;
|
|
7
|
+
}>>> & {
|
|
8
|
+
"onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToOption<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=SidebarToggle.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarToggle.vue"],"names":[],"mappings":";gBA+Cc,OAAO;;;;gBAAP,OAAO;;;;AAiErB,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,48 @@
|
|
|
1
|
+
import { defineComponent as s, openBlock as l, createElementBlock as n, createElementVNode as e, normalizeClass as r } from "vue";
|
|
2
|
+
const a = {
|
|
3
|
+
class: "size-3.5",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
7
|
+
}, d = /* @__PURE__ */ e("defs", null, [
|
|
8
|
+
/* @__PURE__ */ e("clipPath", { id: "mask" }, [
|
|
9
|
+
/* @__PURE__ */ e("path", {
|
|
10
|
+
"clip-rule": "evenodd",
|
|
11
|
+
d: "M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z"
|
|
12
|
+
})
|
|
13
|
+
])
|
|
14
|
+
], -1), i = { "clip-path": "url(#mask)" }, c = /* @__PURE__ */ e("path", {
|
|
15
|
+
d: "M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5",
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
"stroke-linecap": "round",
|
|
18
|
+
"stroke-linejoin": "round",
|
|
19
|
+
"stroke-width": "2"
|
|
20
|
+
}, null, -1), h = /* @__PURE__ */ s({
|
|
21
|
+
__name: "SidebarToggle",
|
|
22
|
+
props: {
|
|
23
|
+
modelValue: { type: Boolean }
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:modelValue"],
|
|
26
|
+
setup(u) {
|
|
27
|
+
return (t, o) => (l(), n("button", {
|
|
28
|
+
class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
|
|
29
|
+
type: "button",
|
|
30
|
+
onClick: o[0] || (o[0] = (p) => t.$emit("update:modelValue", !t.modelValue))
|
|
31
|
+
}, [
|
|
32
|
+
(l(), n("svg", a, [
|
|
33
|
+
d,
|
|
34
|
+
e("g", i, [
|
|
35
|
+
e("path", {
|
|
36
|
+
class: r(["transition-transform duration-300", t.modelValue ? "translate-x-0" : "-translate-x-1/2"]),
|
|
37
|
+
d: "M1 3.2h8v17.5H1z",
|
|
38
|
+
fill: "currentColor"
|
|
39
|
+
}, null, 2)
|
|
40
|
+
]),
|
|
41
|
+
c
|
|
42
|
+
]))
|
|
43
|
+
]));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
h as default
|
|
48
|
+
};
|