@scalar/api-client 2.0.57 → 2.0.58

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +61 -58
  5. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +31 -25
  7. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  8. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +51 -45
  9. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +47 -41
  11. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -40
  13. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  14. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +67 -61
  15. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  16. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +30 -30
  17. package/dist/components/TopNav/TopNav.vue.d.ts +20 -1
  18. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  19. package/dist/components/TopNav/TopNav.vue.js +2 -2
  20. package/dist/components/TopNav/TopNav.vue2.js +64 -49
  21. package/dist/layouts/App/ApiClientApp.vue.d.ts +11 -1
  22. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  23. package/dist/layouts/App/ApiClientApp.vue.js +53 -49
  24. package/dist/libs/event-busses/cancel-request-bus.d.ts +2 -0
  25. package/dist/libs/event-busses/cancel-request-bus.d.ts.map +1 -0
  26. package/dist/libs/event-busses/cancel-request-bus.js +5 -0
  27. package/dist/libs/event-busses/hot-keys-bus.d.ts +3 -1
  28. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
  29. package/dist/libs/event-busses/hot-keys-bus.js +1 -0
  30. package/dist/libs/event-busses/index.d.ts +2 -1
  31. package/dist/libs/event-busses/index.d.ts.map +1 -1
  32. package/dist/libs/event-busses/index.js +11 -8
  33. package/dist/libs/index.js +21 -18
  34. package/dist/libs/local-storage.js +1 -1
  35. package/dist/libs/sendRequest.d.ts +2 -2
  36. package/dist/libs/sendRequest.d.ts.map +1 -1
  37. package/dist/libs/sendRequest.js +22 -21
  38. package/dist/store/workspace.d.ts.map +1 -1
  39. package/dist/store/workspace.js +100 -103
  40. package/dist/style.css +1 -1
  41. package/dist/views/Request/Request.vue.d.ts +11 -1
  42. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  43. package/dist/views/Request/Request.vue.js +3 -3
  44. package/dist/views/Request/Request.vue2.js +184 -174
  45. package/dist/views/Request/RequestSidebarItem.vue.d.ts +2 -0
  46. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  47. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  48. package/dist/views/Request/RequestSidebarItem.vue2.js +139 -130
  49. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts +3 -0
  50. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -0
  51. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +7 -0
  52. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +39 -0
  53. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  54. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +37 -30
  55. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  56. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +23 -21
  57. package/package.json +7 -7
@@ -1,75 +1,80 @@
1
- import { defineComponent as g, ref as r, computed as v, onMounted as y, openBlock as V, createElementBlock as k, createElementVNode as a, withDirectives as N, withKeys as S, withModifiers as F, vModelText as I, createVNode as n, unref as i, withCtx as c, normalizeClass as M, toDisplayString as B, createTextVNode as D } from "vue";
2
- import { useWorkspace as K } from "../../store/workspace.js";
1
+ import { defineComponent as y, ref as d, computed as v, onMounted as V, openBlock as k, createElementBlock as N, createElementVNode as s, withDirectives as S, withKeys as F, withModifiers as I, vModelText as M, createVNode as n, unref as i, withCtx as u, normalizeClass as B, toDisplayString as D, createTextVNode as K } from "vue";
2
+ import { useWorkspace as T } from "../../store/workspace.js";
3
3
  import { ScalarListbox as z, ScalarButton as x, ScalarIcon as E } from "@scalar/components";
4
- const T = { class: "flex w-full flex-col gap-3" }, U = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, W = /* @__PURE__ */ a("label", {
4
+ import { useToasts as P } from "@scalar/use-toasts";
5
+ const U = { class: "flex w-full flex-col gap-3" }, W = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, j = /* @__PURE__ */ s("label", {
5
6
  class: "absolute w-full h-full opacity-0 cursor-text",
6
7
  for: "foldername"
7
- }, null, -1), j = ["onKeydown"], L = { class: "flex" }, P = { class: "flex flex-1 gap-2 max-h-8" }, J = /* @__PURE__ */ g({
8
+ }, null, -1), L = ["onKeydown"], q = { class: "flex" }, A = { class: "flex flex-1 gap-2 max-h-8" }, R = /* @__PURE__ */ y({
8
9
  __name: "CommandPaletteFolder",
9
10
  emits: ["close"],
10
- setup(q, { emit: h }) {
11
+ setup(G, { emit: h }) {
11
12
  var p;
12
- const _ = h, { activeWorkspaceCollections: b, folderMutators: w, activeCollection: C } = K(), s = r(""), d = r(((p = C.value) == null ? void 0 : p.uid) ?? ""), u = v(
13
- () => b.value.map((e) => {
14
- var l, o;
13
+ const b = h, { activeWorkspaceCollections: _, folderMutators: w, activeCollection: C } = T(), t = d(""), r = d(((p = C.value) == null ? void 0 : p.uid) ?? ""), { toast: g } = P(), c = v(
14
+ () => _.value.map((e) => {
15
+ var l, a;
15
16
  return {
16
17
  id: e.uid,
17
- label: ((o = (l = e.spec) == null ? void 0 : l.info) == null ? void 0 : o.title) ?? ""
18
+ label: ((a = (l = e.spec) == null ? void 0 : l.info) == null ? void 0 : a.title) ?? ""
18
19
  };
19
20
  })
20
- ), t = v({
21
- get: () => u.value.find(
22
- ({ id: e }) => e === d.value
21
+ ), o = v({
22
+ get: () => c.value.find(
23
+ ({ id: e }) => e === r.value
23
24
  ),
24
25
  set: (e) => {
25
- e != null && e.id && (d.value = e.id);
26
+ e != null && e.id && (r.value = e.id);
26
27
  }
27
28
  }), f = () => {
28
- s.value && t.value && (w.add(
29
+ if (!t.value) {
30
+ g("Please enter a name before creating a folder.", "error");
31
+ return;
32
+ }
33
+ t.value && o.value && (w.add(
29
34
  {
30
- name: s.value
35
+ name: t.value
31
36
  },
32
- d.value
33
- ), _("close"));
34
- }, m = r(null);
35
- return y(() => {
37
+ r.value
38
+ ), b("close"));
39
+ }, m = d(null);
40
+ return V(() => {
36
41
  var e;
37
42
  (e = m.value) == null || e.focus();
38
- }), (e, l) => (V(), k("div", T, [
39
- a("div", U, [
40
- W,
41
- N(a("input", {
43
+ }), (e, l) => (k(), N("div", U, [
44
+ s("div", W, [
45
+ j,
46
+ S(s("input", {
42
47
  id: "foldername",
43
48
  ref_key: "folderInput",
44
49
  ref: m,
45
- "onUpdate:modelValue": l[0] || (l[0] = (o) => s.value = o),
50
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => t.value = a),
46
51
  autocomplete: "off",
47
52
  class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
48
53
  "data-form-type": "other",
49
54
  "data-lpignore": "true",
50
55
  label: "Folder Name",
51
56
  placeholder: "Folder Name",
52
- onKeydown: S(F(f, ["prevent"]), ["enter"])
53
- }, null, 40, j), [
54
- [I, s.value]
57
+ onKeydown: F(I(f, ["prevent"]), ["enter"])
58
+ }, null, 40, L), [
59
+ [M, t.value]
55
60
  ])
56
61
  ]),
57
- a("div", L, [
58
- a("div", P, [
62
+ s("div", q, [
63
+ s("div", A, [
59
64
  n(i(z), {
60
- modelValue: t.value,
61
- "onUpdate:modelValue": l[1] || (l[1] = (o) => t.value = o),
62
- options: u.value
65
+ modelValue: o.value,
66
+ "onUpdate:modelValue": l[1] || (l[1] = (a) => o.value = a),
67
+ options: c.value
63
68
  }, {
64
- default: c(() => [
69
+ default: u(() => [
65
70
  n(i(x), {
66
71
  class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
67
72
  variant: "outlined"
68
73
  }, {
69
- default: c(() => [
70
- a("span", {
71
- class: M(t.value ? "text-c-1" : "text-c-3")
72
- }, B(t.value ? t.value.label : "Select Collection"), 3),
74
+ default: u(() => [
75
+ s("span", {
76
+ class: B(o.value ? "text-c-1" : "text-c-3")
77
+ }, D(o.value ? o.value.label : "Select Collection"), 3),
73
78
  n(i(E), {
74
79
  class: "text-c-3",
75
80
  icon: "ChevronDown",
@@ -84,17 +89,18 @@ const T = { class: "flex w-full flex-col gap-3" }, U = { class: "gap-3 rounded b
84
89
  ]),
85
90
  n(i(x), {
86
91
  class: "max-h-8 text-xs p-0 px-3",
92
+ disabled: !t.value.trim(),
87
93
  onClick: f
88
94
  }, {
89
- default: c(() => [
90
- D(" Create Folder ")
95
+ default: u(() => [
96
+ K(" Create Folder ")
91
97
  ]),
92
98
  _: 1
93
- })
99
+ }, 8, ["disabled"])
94
100
  ])
95
101
  ]));
96
102
  }
97
103
  });
98
104
  export {
99
- J as default
105
+ R as default
100
106
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;AA+RA,wBAMG"}
1
+ {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;AA8TA,wBAMG"}
@@ -1,57 +1,73 @@
1
- import { defineComponent as y, ref as u, onMounted as S, openBlock as k, createElementBlock as C, createElementVNode as t, withKeys as F, withModifiers as I, createVNode as a, unref as o, withCtx as m, createTextVNode as d } from "vue";
2
- import { useWorkspace as N } from "../../store/workspace.js";
3
- import { ScalarButton as f, ScalarIcon as R } from "@scalar/components";
4
- import { useFileDialog as U } from "../../hooks/useFileDialog.js";
5
- const A = { class: "flex w-full flex-col gap-3" }, B = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, K = /* @__PURE__ */ t("label", {
1
+ import { defineComponent as S, ref as d, onMounted as C, openBlock as F, createElementBlock as U, createElementVNode as o, withDirectives as M, withKeys as N, withModifiers as R, vModelText as T, createVNode as c, unref as l, withCtx as f, createTextVNode as h } from "vue";
2
+ import { useWorkspace as V } from "../../store/workspace.js";
3
+ import { ScalarButton as x, ScalarIcon as A } from "@scalar/components";
4
+ import { useToasts as B } from "@scalar/use-toasts";
5
+ import { useFileDialog as D } from "../../hooks/useFileDialog.js";
6
+ const K = { class: "flex w-full flex-col gap-3" }, L = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, P = /* @__PURE__ */ o("label", {
6
7
  class: "absolute w-full h-full opacity-0 cursor-text",
7
8
  for: "requestimport"
8
- }, null, -1), L = ["onKeydown"], M = { class: "flex gap-2" }, P = { class: "flex flex-1 gap-2 max-h-8" }, W = /* @__PURE__ */ y({
9
+ }, null, -1), q = ["onKeydown"], E = { class: "flex gap-2" }, W = { class: "flex flex-1 gap-2 max-h-8" }, G = /* @__PURE__ */ S({
9
10
  __name: "CommandPaletteImport",
10
11
  emits: ["close"],
11
- setup(V, { emit: h }) {
12
- const n = h, { activeWorkspace: _, importSpecFile: x, importSpecFromUrl: g } = N(), r = u(""), { open: w } = U({
12
+ setup($, { emit: g }) {
13
+ const i = g, { activeWorkspace: _, importSpecFile: w, importSpecFromUrl: v } = V(), s = d(""), { toast: r } = B(), { open: y } = D({
13
14
  onChange: async (e) => {
14
- const s = e == null ? void 0 : e[0];
15
- if (s) {
16
- const i = new FileReader();
17
- i.onload = async (v) => {
18
- var p;
19
- const b = (p = v.target) == null ? void 0 : p.result;
20
- x(b, _.value.uid), l(), n("close");
21
- }, i.readAsText(s);
15
+ const t = e == null ? void 0 : e[0];
16
+ if (t) {
17
+ const a = new FileReader();
18
+ a.onload = async (b) => {
19
+ var u;
20
+ const k = (u = b.target) == null ? void 0 : u.result;
21
+ try {
22
+ await w(k, _.value.uid), r("Import successful", "info"), i("close");
23
+ } catch (n) {
24
+ const I = (n == null ? void 0 : n.message) || "Unknown error";
25
+ r(`Import failed: ${I}`, "error");
26
+ }
27
+ }, a.readAsText(t);
22
28
  }
23
29
  },
24
30
  multiple: !1,
25
31
  accept: ".json,.yaml,.yml"
26
- }), l = async () => {
27
- r.value && (await g(r.value), n("close"));
28
- }, c = u(null);
29
- return S(() => {
32
+ }), p = async () => {
33
+ if (s.value)
34
+ try {
35
+ await v(s.value), r("Import successful", "info"), i("close");
36
+ } catch (e) {
37
+ console.error("the error ", e);
38
+ const t = (e == null ? void 0 : e.message) || "Unknown error";
39
+ r(`Import failed: ${t}`, "error");
40
+ }
41
+ }, m = d(null);
42
+ return C(() => {
30
43
  var e;
31
- (e = c.value) == null || e.focus();
32
- }), (e, s) => (k(), C("div", A, [
33
- t("div", B, [
34
- K,
35
- t("input", {
44
+ (e = m.value) == null || e.focus();
45
+ }), (e, t) => (F(), U("div", K, [
46
+ o("div", L, [
47
+ P,
48
+ M(o("input", {
36
49
  id: "requestimport",
37
50
  ref_key: "importInput",
38
- ref: c,
51
+ ref: m,
52
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => s.value = a),
39
53
  class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
40
54
  label: "Paste Swagger File URL",
41
55
  placeholder: "Paste Swagger File URL",
42
- onKeydown: F(I(l, ["prevent"]), ["enter"])
43
- }, null, 40, L)
56
+ onKeydown: N(R(p, ["prevent"]), ["enter"])
57
+ }, null, 40, q), [
58
+ [T, s.value]
59
+ ])
44
60
  ]),
45
- t("div", M, [
46
- t("div", P, [
47
- a(o(f), {
61
+ o("div", E, [
62
+ o("div", W, [
63
+ c(l(x), {
48
64
  class: "p-2 max-h-8 gap-1 text-xs hover:bg-b-2 relative",
49
65
  variant: "outlined",
50
- onClick: o(w)
66
+ onClick: l(y)
51
67
  }, {
52
- default: m(() => [
53
- d(" JSON, or YAML Files "),
54
- a(o(R), {
68
+ default: f(() => [
69
+ h(" JSON, or YAML Files "),
70
+ c(l(A), {
55
71
  class: "text-c-3 -rotate-90",
56
72
  icon: "ArrowRight",
57
73
  size: "sm"
@@ -60,12 +76,12 @@ const A = { class: "flex w-full flex-col gap-3" }, B = { class: "gap-3 rounded b
60
76
  _: 1
61
77
  }, 8, ["onClick"])
62
78
  ]),
63
- a(o(f), {
79
+ c(l(x), {
64
80
  class: "max-h-8 text-xs p-0 px-3",
65
- onClick: l
81
+ onClick: p
66
82
  }, {
67
- default: m(() => [
68
- d(" Import Collection ")
83
+ default: f(() => [
84
+ h(" Import Collection ")
69
85
  ]),
70
86
  _: 1
71
87
  })
@@ -74,5 +90,5 @@ const A = { class: "flex w-full flex-col gap-3" }, B = { class: "gap-3 rounded b
74
90
  }
75
91
  });
76
92
  export {
77
- W as default
93
+ G as default
78
94
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteRequest.vue"],"names":[],"mappings":";;;;;AAshBA,wBAMG"}
1
+ {"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteRequest.vue"],"names":[],"mappings":";;;;;AAmiBA,wBAMG"}
@@ -1,24 +1,25 @@
1
- import { defineComponent as K, ref as d, computed as v, onMounted as T, openBlock as k, createElementBlock as W, createElementVNode as u, withDirectives as $, withKeys as G, withModifiers as H, vModelText as L, createVNode as o, unref as s, withCtx as r, normalizeClass as M, toDisplayString as S, createBlock as O, createCommentVNode as P, createTextVNode as A } from "vue";
2
- import J from "../HttpMethod/HttpMethod.vue.js";
3
- import { useWorkspace as Q } from "../../store/workspace.js";
1
+ import { defineComponent as K, ref as d, computed as v, onMounted as W, openBlock as k, createElementBlock as P, createElementVNode as n, withDirectives as $, withKeys as G, withModifiers as H, vModelText as L, createVNode as s, unref as u, withCtx as r, normalizeClass as M, toDisplayString as S, createBlock as O, createCommentVNode as A, createTextVNode as J } from "vue";
2
+ import Q from "../HttpMethod/HttpMethod.vue.js";
3
+ import { useWorkspace as X } from "../../store/workspace.js";
4
4
  import { ScalarListbox as U, ScalarButton as p, ScalarIcon as N } from "@scalar/components";
5
- import { useRouter as X } from "vue-router";
6
- const Y = { class: "flex w-full flex-col gap-3" }, Z = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, ee = /* @__PURE__ */ u("label", {
5
+ import { useToasts as Y } from "@scalar/use-toasts";
6
+ import { useRouter as Z } from "vue-router";
7
+ const ee = { class: "flex w-full flex-col gap-3" }, te = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, le = /* @__PURE__ */ n("label", {
7
8
  class: "absolute w-full h-full opacity-0 cursor-text",
8
9
  for: "requestname"
9
- }, null, -1), te = ["onKeydown"], le = { class: "flex" }, ae = { class: "flex flex-1 gap-2 max-h-8" }, re = /* @__PURE__ */ K({
10
+ }, null, -1), ae = ["onKeydown"], oe = { class: "flex" }, se = { class: "flex flex-1 gap-2 max-h-8" }, me = /* @__PURE__ */ K({
10
11
  __name: "CommandPaletteRequest",
11
12
  emits: ["close"],
12
- setup(oe, { emit: R }) {
13
- var g, q;
14
- const I = R, { push: B } = X(), {
15
- activeCollection: D,
16
- activeWorkspace: E,
13
+ setup(ue, { emit: R }) {
14
+ var C, q;
15
+ const I = R, { push: B } = Z(), { toast: D } = Y(), {
16
+ activeCollection: E,
17
+ activeWorkspace: T,
17
18
  activeWorkspaceCollections: h,
18
19
  requestMutators: j,
19
20
  activeRequest: z,
20
21
  folders: x
21
- } = Q(), i = d(""), f = d("GET"), c = d(((g = D.value) == null ? void 0 : g.uid) ?? ""), b = v(
22
+ } = X(), a = d(""), m = d("GET"), c = d(((C = E.value) == null ? void 0 : C.uid) ?? ""), b = v(
22
23
  () => h.value.map((e) => {
23
24
  var t;
24
25
  return {
@@ -26,12 +27,12 @@ const Y = { class: "flex w-full flex-col gap-3" }, Z = { class: "gap-3 rounded b
26
27
  label: ((t = e.spec.info) == null ? void 0 : t.title) ?? "Unititled Collection"
27
28
  };
28
29
  })
29
- ), n = v({
30
+ ), i = v({
30
31
  get: () => b.value.find(({ id: e }) => e === c.value),
31
32
  set: (e) => {
32
33
  e != null && e.id && (c.value = e.id);
33
34
  }
34
- }), m = v(
35
+ }), f = v(
35
36
  () => h.value.flatMap(
36
37
  (e) => e.uid === c.value ? e.childUids.flatMap((t) => {
37
38
  const l = x[t];
@@ -50,42 +51,46 @@ const Y = { class: "flex w-full flex-col gap-3" }, Z = { class: "gap-3 rounded b
50
51
  return e.childUids.includes((t = z.value) == null ? void 0 : t.uid);
51
52
  }
52
53
  )) == null ? void 0 : q.uid) ?? ""
53
- ), a = v({
54
- get: () => m.value.find(({ id: e }) => e === _.value),
54
+ ), o = v({
55
+ get: () => f.value.find(({ id: e }) => e === _.value),
55
56
  set: (e) => {
56
57
  e != null && e.id && (_.value = e.id);
57
58
  }
58
59
  });
59
60
  function F(e) {
60
- f.value = e;
61
+ m.value = e;
61
62
  }
62
63
  const w = () => {
63
64
  var l, y, V;
64
- if (!c.value && !((l = a.value) != null && l.id)) return;
65
- const e = ((y = a.value) == null ? void 0 : y.id) ?? ((V = n.value) == null ? void 0 : V.id), t = j.add(
65
+ if (!a.value.trim()) {
66
+ D("Please enter a name before creating a request.", "error");
67
+ return;
68
+ }
69
+ if (!c.value && !((l = o.value) != null && l.id)) return;
70
+ const e = ((y = o.value) == null ? void 0 : y.id) ?? ((V = i.value) == null ? void 0 : V.id), t = j.add(
66
71
  {
67
72
  path: "",
68
- method: f.value.toUpperCase(),
69
- description: i.value,
70
- operationId: i.value,
71
- summary: i.value,
73
+ method: m.value.toUpperCase(),
74
+ description: a.value,
75
+ operationId: a.value,
76
+ summary: a.value,
72
77
  tags: ["default"]
73
78
  },
74
79
  e
75
80
  );
76
- B(`/workspace/${E.value.uid}/request/${t.uid}`), I("close");
77
- }, C = d(null);
78
- return T(() => {
81
+ B(`/workspace/${T.value.uid}/request/${t.uid}`), I("close");
82
+ }, g = d(null);
83
+ return W(() => {
79
84
  var e;
80
- (e = C.value) == null || e.focus();
81
- }), (e, t) => (k(), W("div", Y, [
82
- u("div", Z, [
83
- ee,
84
- $(u("input", {
85
+ (e = g.value) == null || e.focus();
86
+ }), (e, t) => (k(), P("div", ee, [
87
+ n("div", te, [
88
+ le,
89
+ $(n("input", {
85
90
  id: "requestname",
86
91
  ref_key: "requestInput",
87
- ref: C,
88
- "onUpdate:modelValue": t[0] || (t[0] = (l) => i.value = l),
92
+ ref: g,
93
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => a.value = l),
89
94
  autocomplete: "off",
90
95
  class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
91
96
  "data-form-type": "other",
@@ -93,33 +98,33 @@ const Y = { class: "flex w-full flex-col gap-3" }, Z = { class: "gap-3 rounded b
93
98
  label: "Request Name",
94
99
  placeholder: "Request Name",
95
100
  onKeydown: G(H(w, ["prevent"]), ["enter"])
96
- }, null, 40, te), [
97
- [L, i.value]
101
+ }, null, 40, ae), [
102
+ [L, a.value]
98
103
  ])
99
104
  ]),
100
- u("div", le, [
101
- u("div", ae, [
102
- o(J, {
105
+ n("div", oe, [
106
+ n("div", se, [
107
+ s(Q, {
103
108
  isEditable: !0,
104
109
  isSquare: "",
105
- method: f.value,
110
+ method: m.value,
106
111
  onChange: F
107
112
  }, null, 8, ["method"]),
108
- o(s(U), {
109
- modelValue: n.value,
110
- "onUpdate:modelValue": t[1] || (t[1] = (l) => n.value = l),
113
+ s(u(U), {
114
+ modelValue: i.value,
115
+ "onUpdate:modelValue": t[1] || (t[1] = (l) => i.value = l),
111
116
  options: b.value
112
117
  }, {
113
118
  default: r(() => [
114
- o(s(p), {
119
+ s(u(p), {
115
120
  class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
116
121
  variant: "outlined"
117
122
  }, {
118
123
  default: r(() => [
119
- u("span", {
120
- class: M(n.value ? "text-c-1" : "text-c-3")
121
- }, S(n.value ? n.value.label : "Select Collection"), 3),
122
- o(s(N), {
124
+ n("span", {
125
+ class: M(i.value ? "text-c-1" : "text-c-3")
126
+ }, S(i.value ? i.value.label : "Select Collection"), 3),
127
+ s(u(N), {
123
128
  class: "text-c-3",
124
129
  icon: "ChevronDown",
125
130
  size: "xs"
@@ -130,22 +135,22 @@ const Y = { class: "flex w-full flex-col gap-3" }, Z = { class: "gap-3 rounded b
130
135
  ]),
131
136
  _: 1
132
137
  }, 8, ["modelValue", "options"]),
133
- m.value.length ? (k(), O(s(U), {
138
+ f.value.length ? (k(), O(u(U), {
134
139
  key: 0,
135
- modelValue: a.value,
136
- "onUpdate:modelValue": t[2] || (t[2] = (l) => a.value = l),
137
- options: m.value
140
+ modelValue: o.value,
141
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => o.value = l),
142
+ options: f.value
138
143
  }, {
139
144
  default: r(() => [
140
- o(s(p), {
145
+ s(u(p), {
141
146
  class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
142
147
  variant: "outlined"
143
148
  }, {
144
149
  default: r(() => [
145
- u("span", {
146
- class: M(a.value ? "text-c-1" : "text-c-3")
147
- }, S(a.value ? a.value.label : "Select Folder"), 3),
148
- o(s(N), {
150
+ n("span", {
151
+ class: M(o.value ? "text-c-1" : "text-c-3")
152
+ }, S(o.value ? o.value.label : "Select Folder"), 3),
153
+ s(u(N), {
149
154
  class: "text-c-3",
150
155
  icon: "ChevronDown",
151
156
  size: "xs"
@@ -155,21 +160,22 @@ const Y = { class: "flex w-full flex-col gap-3" }, Z = { class: "gap-3 rounded b
155
160
  })
156
161
  ]),
157
162
  _: 1
158
- }, 8, ["modelValue", "options"])) : P("", !0)
163
+ }, 8, ["modelValue", "options"])) : A("", !0)
159
164
  ]),
160
- o(s(p), {
165
+ s(u(p), {
161
166
  class: "max-h-8 text-xs p-0 px-3",
167
+ disabled: !a.value.trim(),
162
168
  onClick: w
163
169
  }, {
164
170
  default: r(() => [
165
- A(" Create Request ")
171
+ J(" Create Request ")
166
172
  ]),
167
173
  _: 1
168
- })
174
+ }, 8, ["disabled"])
169
175
  ])
170
176
  ]));
171
177
  }
172
178
  });
173
179
  export {
174
- re as default
180
+ me as default
175
181
  };
@@ -1,9 +1,9 @@
1
1
  import o from "./TheCommandPalette.vue2.js";
2
- import { PaletteComponents as f } from "./TheCommandPalette.vue2.js";
2
+ import { PaletteComponents as s } from "./TheCommandPalette.vue2.js";
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-010c52cb"]]);
5
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-27c7a3a7"]]);
6
6
  export {
7
- f as PaletteComponents,
8
- a as default
7
+ s as PaletteComponents,
8
+ r as default
9
9
  };