@scalar/api-client 2.2.20 → 2.2.22

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 (44) 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 +1 -1
  4. package/dist/components/AddressBar/AddressBar.vue2.js +1 -1
  5. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts +3 -0
  6. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +1 -1
  7. package/dist/components/ImportCurl/ImportCurlModal.vue.js +2 -2
  8. package/dist/components/ImportCurl/ImportCurlModal.vue2.js +85 -49
  9. package/dist/components/Sidebar/Sidebar.vue.d.ts +2 -2
  10. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  11. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  12. package/dist/components/Sidebar/Sidebar.vue2.js +16 -16
  13. package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
  14. package/dist/components/Sidebar/SidebarToggle.vue.js +3 -3
  15. package/dist/layouts/App/create-api-client-app.d.ts +8 -7
  16. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  17. package/dist/layouts/Modal/create-api-client-modal.d.ts +16 -14
  18. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  19. package/dist/layouts/Web/create-api-client-web.d.ts +8 -7
  20. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  21. package/dist/libs/create-client.d.ts +8 -7
  22. package/dist/libs/create-client.d.ts.map +1 -1
  23. package/dist/libs/create-client.js +19 -18
  24. package/dist/store/environment.d.ts +4 -4
  25. package/dist/store/requests.d.ts +2 -2
  26. package/dist/store/store.d.ts +11 -11
  27. package/dist/store/store.d.ts.map +1 -1
  28. package/dist/store/store.js +53 -48
  29. package/dist/style.css +1 -1
  30. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  31. package/dist/views/Request/Request.vue.js +2 -2
  32. package/dist/views/Request/Request.vue2.js +159 -149
  33. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  34. package/dist/views/Request/RequestSection/RequestParams.vue.js +74 -61
  35. package/dist/views/Request/RequestSidebar.vue.d.ts +3 -4
  36. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  37. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  38. package/dist/views/Request/RequestSidebar.vue2.js +160 -163
  39. package/dist/views/Request/RequestSubpageHeader.vue.d.ts +0 -1
  40. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  41. package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
  42. package/dist/views/Request/RequestSubpageHeader.vue2.js +44 -49
  43. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  44. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cAkR8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA4YjD,wBAMG"}
1
+ {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cAqS8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAmajD,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Request.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fa0c6bf7"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8b8ff238"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };
@@ -1,177 +1,187 @@
1
- import { defineComponent as X, ref as S, computed as O, watch as Y, onMounted as Z, onBeforeUnmount as ee, openBlock as x, createElementBlock as te, Fragment as oe, createElementVNode as b, normalizeClass as g, unref as s, createVNode as d, withCtx as I, createBlock as T, createCommentVNode as M } from "vue";
2
- import re from "../../components/ImportCurl/ImportCurlModal.vue.js";
3
- import se from "../../components/ViewLayout/ViewLayout.vue.js";
4
- import le from "../../components/ViewLayout/ViewLayoutContent.vue.js";
5
- import { importCurlCommand as ae } from "../../libs/importers/curl.js";
6
- import { useActiveEntities as ue } from "../../store/active-entities.js";
7
- import ne from "./RequestSection/RequestSection.vue.js";
8
- import ie from "./RequestSubpageHeader.vue.js";
9
- import ce from "./ResponseSection/ResponseSection.vue.js";
10
- import { useOpenApiWatcher as me } from "./hooks/useOpenApiWatcher.js";
11
- import { safeJSON as de } from "@scalar/object-utils/parse";
12
- import { useBreakpoints as ve } from "@scalar/use-hooks/useBreakpoints";
13
- import { useToasts as fe } from "@scalar/use-toasts";
14
- import { useRouter as pe } from "vue-router";
15
- import ye from "./RequestSidebar.vue.js";
16
- import { createRequestOperation as Se } from "../../libs/send-request/send-request.js";
17
- import { ERRORS as Re } from "../../libs/errors.js";
18
- import { useWorkspace as he } from "../../store/store.js";
19
- import { useLayout as qe } from "../../hooks/useLayout.js";
20
- const xe = { class: "flex h-full" }, be = { class: "flex flex-1 flex-col h-full" }, ze = /* @__PURE__ */ X({
1
+ import { defineComponent as re, ref as S, computed as L, watch as se, onMounted as ue, onBeforeUnmount as ae, openBlock as y, createElementBlock as le, Fragment as ie, createElementVNode as k, normalizeClass as D, unref as u, createBlock as w, createCommentVNode as E, createVNode as q, withCtx as H } from "vue";
2
+ import ne from "../../components/ImportCurl/ImportCurlModal.vue.js";
3
+ import ce from "../../components/ViewLayout/ViewLayout.vue.js";
4
+ import me from "../../components/ViewLayout/ViewLayoutContent.vue.js";
5
+ import { importCurlCommand as de } from "../../libs/importers/curl.js";
6
+ import { useActiveEntities as ve } from "../../store/active-entities.js";
7
+ import fe from "./RequestSection/RequestSection.vue.js";
8
+ import pe from "./RequestSubpageHeader.vue.js";
9
+ import Se from "./ResponseSection/ResponseSection.vue.js";
10
+ import { useOpenApiWatcher as ye } from "./hooks/useOpenApiWatcher.js";
11
+ import { safeJSON as qe } from "@scalar/object-utils/parse";
12
+ import { useBreakpoints as Re } from "@scalar/use-hooks/useBreakpoints";
13
+ import { useToasts as be } from "@scalar/use-toasts";
14
+ import { useRouter as he } from "vue-router";
15
+ import xe from "./RequestSidebar.vue.js";
16
+ import { createRequestOperation as Ue } from "../../libs/send-request/send-request.js";
17
+ import { ERRORS as ke } from "../../libs/errors.js";
18
+ import { useWorkspace as we } from "../../store/store.js";
19
+ import { useLayout as Ee } from "../../hooks/useLayout.js";
20
+ const Oe = { class: "flex h-full" }, Ve = { class: "flex flex-1 flex-col h-full" }, Ke = /* @__PURE__ */ re({
21
21
  __name: "Request",
22
22
  emits: ["newTab"],
23
- setup(we) {
24
- const _ = he(), { toast: w } = fe(), { layout: A } = qe(), {
25
- activeCollection: U,
26
- activeExample: v,
27
- activeEnvironment: k,
28
- activeRequest: R,
29
- activeWorkspace: a,
30
- activeServer: L
31
- } = ue(), {
32
- cookies: H,
33
- isReadOnly: u,
34
- modalState: n,
35
- requestHistory: E,
36
- securitySchemes: $,
37
- requestMutators: j,
38
- serverMutators: W,
39
- servers: z,
40
- events: f
41
- } = _, l = S(!u), V = S(), t = S(), h = S(""), D = pe(), F = O(
42
- () => E.findLast((o) => {
43
- var e;
44
- return o.request.uid === ((e = v.value) == null ? void 0 : e.uid);
23
+ setup(Ce) {
24
+ const W = we(), { toast: O } = be(), { layout: _ } = Ee(), {
25
+ activeCollection: R,
26
+ activeExample: m,
27
+ activeEnvironment: V,
28
+ activeRequest: b,
29
+ activeWorkspace: h,
30
+ activeServer: $,
31
+ activeWorkspaceCollections: j
32
+ } = ve(), {
33
+ cookies: z,
34
+ isReadOnly: x,
35
+ modalState: l,
36
+ requestHistory: C,
37
+ showSidebar: F,
38
+ securitySchemes: Q,
39
+ requestMutators: J,
40
+ serverMutators: G,
41
+ servers: K,
42
+ events: d
43
+ } = W, a = S(!x), N = S(), e = S(), U = S(""), P = he(), X = L(
44
+ () => C.findLast((o) => {
45
+ var t;
46
+ return o.request.uid === ((t = m.value) == null ? void 0 : t.uid);
45
47
  })
46
- ), { mediaQueries: Q } = ve();
47
- Y(Q.xl, (o) => l.value = o, {
48
- immediate: A !== "modal"
48
+ ), { mediaQueries: Y } = Re();
49
+ se(Y.xl, (o) => a.value = o, {
50
+ immediate: _ !== "modal"
49
51
  });
50
- const C = O(
52
+ const B = L(
51
53
  () => {
52
- var o, e;
53
- return (u ? (o = U.value) == null ? void 0 : o.selectedSecuritySchemeUids : (e = R.value) == null ? void 0 : e.selectedSecuritySchemeUids) ?? [];
54
+ var o, t;
55
+ return (x ? (o = R.value) == null ? void 0 : o.selectedSecuritySchemeUids : (t = b.value) == null ? void 0 : t.selectedSecuritySchemeUids) ?? [];
54
56
  }
55
- ), B = async () => {
56
- if (!R.value || !v.value || !U.value)
57
+ ), g = async () => {
58
+ if (!b.value || !m.value || !R.value)
57
59
  return;
58
- const o = typeof k.value == "object" ? k.value.value : "{}", e = de.parse(o);
59
- e.error && console.error("INVALID ENVIRONMENT!");
60
- const r = e.error || typeof e.data != "object" ? {} : e.data ?? {}, p = a.value.cookies.map((y) => H[y]), [i, c] = Se({
61
- request: R.value,
62
- example: v.value,
63
- selectedSecuritySchemeUids: C.value,
64
- proxyUrl: a.value.proxyUrl ?? "",
65
- environment: r,
66
- globalCookies: p,
67
- status: f.requestStatus,
68
- securitySchemes: $,
69
- server: L.value
60
+ const o = typeof V.value == "object" ? V.value.value : "{}", t = qe.parse(o);
61
+ t.error && console.error("INVALID ENVIRONMENT!");
62
+ const s = t.error || typeof t.data != "object" ? {} : t.data ?? {}, r = h.value.cookies.map((f) => z[f]), [i, n] = Ue({
63
+ request: b.value,
64
+ example: m.value,
65
+ selectedSecuritySchemeUids: B.value,
66
+ proxyUrl: h.value.proxyUrl ?? "",
67
+ environment: s,
68
+ globalCookies: r,
69
+ status: d.requestStatus,
70
+ securitySchemes: Q,
71
+ server: $.value
70
72
  });
71
73
  if (i) {
72
- w(i.message, "error");
74
+ O(i.message, "error");
73
75
  return;
74
76
  }
75
- V.value = c.controller;
76
- const [m, q] = await c.sendRequest();
77
- m ? w(m.message, "error") : E.push(q);
78
- }, J = async () => {
77
+ N.value = n.controller;
78
+ const [c, v] = await n.sendRequest();
79
+ c ? O(c.message, "error") : C.push(v);
80
+ }, Z = async () => {
79
81
  var o;
80
- return (o = V.value) == null ? void 0 : o.abort(Re.REQUEST_ABORTED);
82
+ return (o = N.value) == null ? void 0 : o.abort(ke.REQUEST_ABORTED);
81
83
  };
82
- Z(() => {
83
- f.executeRequest.on(B), f.cancelRequest.on(J);
84
- }), me(), ee(() => f.executeRequest.off(B));
85
- function G({ requestName: o }) {
86
- var r, p, i, c;
87
- if (!t.value) return;
88
- if (t.value.servers) {
89
- const m = Object.values(z).find(
90
- (q) => {
91
- var y, N;
92
- return q.url === ((N = (y = t == null ? void 0 : t.value) == null ? void 0 : y.servers) == null ? void 0 : N[0]);
84
+ ue(() => {
85
+ d.executeRequest.on(g), d.cancelRequest.on(Z);
86
+ }), ye(), ae(() => d.executeRequest.off(g));
87
+ function ee({
88
+ requestName: o,
89
+ collectionUid: t
90
+ }) {
91
+ var n, c, v, f, I, T;
92
+ if (!e.value) return;
93
+ const s = j.value.find(
94
+ (p) => p.uid === t
95
+ );
96
+ if (!s) return;
97
+ const r = ((n = s == null ? void 0 : s.info) == null ? void 0 : n.title) === "Drafts";
98
+ if (!r && e.value.servers) {
99
+ const p = Object.values(K).find(
100
+ (oe) => {
101
+ var M, A;
102
+ return oe.url === ((A = (M = e == null ? void 0 : e.value) == null ? void 0 : M.servers) == null ? void 0 : A[0]);
93
103
  }
94
104
  );
95
- m ? h.value = m.uid : h.value = W.add(
96
- { url: t.value.servers[0] },
97
- a.value.collections[0]
105
+ p ? U.value = p.uid : U.value = G.add(
106
+ { url: e.value.servers[0] },
107
+ s.uid
98
108
  ).uid;
99
109
  }
100
- const e = j.add(
110
+ const i = J.add(
101
111
  {
102
112
  summary: o,
103
- path: (r = t == null ? void 0 : t.value) == null ? void 0 : r.path,
104
- method: (p = t == null ? void 0 : t.value) == null ? void 0 : p.method,
105
- parameters: (i = t == null ? void 0 : t.value) == null ? void 0 : i.parameters,
106
- selectedServerUid: h.value,
107
- requestBody: (c = t == null ? void 0 : t.value) == null ? void 0 : c.requestBody
113
+ path: r ? (c = e == null ? void 0 : e.value) == null ? void 0 : c.url : (v = e == null ? void 0 : e.value) == null ? void 0 : v.path,
114
+ method: (f = e == null ? void 0 : e.value) == null ? void 0 : f.method,
115
+ parameters: (I = e == null ? void 0 : e.value) == null ? void 0 : I.parameters,
116
+ selectedServerUid: r ? void 0 : U.value,
117
+ requestBody: (T = e == null ? void 0 : e.value) == null ? void 0 : T.requestBody
108
118
  },
109
- a.value.collections[0]
119
+ s.uid
110
120
  );
111
- e && D.push(
112
- `/workspace/${a.value.uid}/request/${e.uid}`
113
- ), n.hide();
114
- }
115
- function K(o) {
116
- t.value = ae(o), n.show();
121
+ i && P.push(
122
+ `/workspace/${h.value.uid}/request/${i.uid}`
123
+ ), l.hide();
117
124
  }
118
- function P(o) {
119
- console.log("hello", o), l.value = o;
125
+ function te(o) {
126
+ e.value = de(o), l.show();
120
127
  }
121
- return (o, e) => (x(), te(oe, null, [
122
- b("div", {
123
- class: g(["flex flex-1 flex-col pt-0 h-full bg-b-1 relative z-0 overflow-hidden", {
124
- "!mr-0 !mb-0 !border-0": s(u)
125
- }])
126
- }, [
127
- b("div", xe, [
128
- d(ye, {
129
- isReadonly: s(u),
130
- showSidebar: l.value,
131
- onNewTab: e[0] || (e[0] = (r) => o.$emit("newTab", r)),
132
- "onUpdate:showSidebar": P
133
- }, null, 8, ["isReadonly", "showSidebar"]),
134
- b("div", be, [
135
- d(ie, {
136
- modelValue: l.value,
137
- "onUpdate:modelValue": e[1] || (e[1] = (r) => l.value = r),
138
- isReadonly: s(u),
139
- onHideModal: e[2] || (e[2] = () => s(n).hide()),
140
- onImportCurl: K
141
- }, null, 8, ["modelValue", "isReadonly"]),
142
- d(se, null, {
143
- default: I(() => [
144
- s(v) ? (x(), T(le, {
145
- key: 0,
146
- class: g(["flex-1", [l.value ? "sidebar-active-hide-layout" : ""]])
147
- }, {
148
- default: I(() => {
149
- var r;
150
- return [
151
- d(ne, { selectedSecuritySchemeUids: C.value }, null, 8, ["selectedSecuritySchemeUids"]),
152
- d(ce, {
153
- response: (r = F.value) == null ? void 0 : r.response
154
- }, null, 8, ["response"])
155
- ];
156
- }),
157
- _: 1
158
- }, 8, ["class"])) : M("", !0)
159
- ]),
160
- _: 1
161
- })
128
+ return (o, t) => {
129
+ var s;
130
+ return y(), le(ie, null, [
131
+ k("div", {
132
+ class: D(["flex flex-1 flex-col pt-0 h-full bg-b-1 relative z-0 overflow-hidden", {
133
+ "!mr-0 !mb-0 !border-0": u(x)
134
+ }])
135
+ }, [
136
+ k("div", Oe, [
137
+ u(F) ? (y(), w(xe, {
138
+ key: 0,
139
+ isSidebarOpen: a.value,
140
+ onNewTab: t[0] || (t[0] = (r) => o.$emit("newTab", r)),
141
+ "onUpdate:isSidebarOpen": t[1] || (t[1] = (r) => a.value = r)
142
+ }, null, 8, ["isSidebarOpen"])) : E("", !0),
143
+ k("div", Ve, [
144
+ q(pe, {
145
+ modelValue: a.value,
146
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => a.value = r),
147
+ onHideModal: t[3] || (t[3] = () => u(l).hide()),
148
+ onImportCurl: te
149
+ }, null, 8, ["modelValue"]),
150
+ q(ce, null, {
151
+ default: H(() => [
152
+ u(m) ? (y(), w(me, {
153
+ key: 0,
154
+ class: D(["flex-1", [a.value ? "sidebar-active-hide-layout" : ""]])
155
+ }, {
156
+ default: H(() => {
157
+ var r;
158
+ return [
159
+ q(fe, { selectedSecuritySchemeUids: B.value }, null, 8, ["selectedSecuritySchemeUids"]),
160
+ q(Se, {
161
+ response: (r = X.value) == null ? void 0 : r.response
162
+ }, null, 8, ["response"])
163
+ ];
164
+ }),
165
+ _: 1
166
+ }, 8, ["class"])) : E("", !0)
167
+ ]),
168
+ _: 1
169
+ })
170
+ ])
162
171
  ])
163
- ])
164
- ], 2),
165
- t.value ? (x(), T(re, {
166
- key: 0,
167
- parsedCurl: t.value,
168
- state: s(n),
169
- onClose: e[3] || (e[3] = (r) => s(n).hide()),
170
- onImportCurl: G
171
- }, null, 8, ["parsedCurl", "state"])) : M("", !0)
172
- ], 64));
172
+ ], 2),
173
+ e.value ? (y(), w(ne, {
174
+ key: 0,
175
+ collectionUid: ((s = u(R)) == null ? void 0 : s.uid) ?? "",
176
+ parsedCurl: e.value,
177
+ state: u(l),
178
+ onClose: t[4] || (t[4] = (r) => u(l).hide()),
179
+ onImportCurl: ee
180
+ }, null, 8, ["collectionUid", "parsedCurl", "state"])) : E("", !0)
181
+ ], 64);
182
+ };
173
183
  }
174
184
  });
175
185
  export {
176
- ze as default
186
+ Ke as default
177
187
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AA+LA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAKxC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AAmSF,wBAOG"}
1
+ {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AA4MA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAKxC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AAqUF,wBAOG"}
@@ -1,124 +1,137 @@
1
- import { defineComponent as $, computed as y, onMounted as w, ref as x, watch as E, openBlock as A, createBlock as S, withCtx as i, createTextVNode as h, toDisplayString as g, createElementVNode as c, createVNode as R, unref as T, withModifiers as B, nextTick as k } from "vue";
2
- import M from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
- import { useActiveEntities as N } from "../../../store/active-entities.js";
4
- import V from "./RequestTable.vue.js";
5
- import { ScalarButton as W } from "@scalar/components";
6
- import { requestExampleParametersSchema as _ } from "@scalar/oas-utils/entities/spec";
7
- import { useWorkspace as z } from "../../../store/store.js";
8
- const D = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, U = { class: "sr-only" }, Y = /* @__PURE__ */ $({
1
+ import { defineComponent as K, computed as y, onMounted as $, ref as E, watch as S, openBlock as T, createBlock as A, withCtx as n, createTextVNode as h, toDisplayString as x, createElementVNode as o, createVNode as f, unref as R, withModifiers as z, nextTick as k } from "vue";
2
+ import B from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
+ import { useActiveEntities as M } from "../../../store/active-entities.js";
4
+ import N from "./RequestTable.vue.js";
5
+ import { ScalarTooltip as V, ScalarButton as W } from "@scalar/components";
6
+ import { requestExampleParametersSchema as b } from "@scalar/oas-utils/entities/spec";
7
+ import { useWorkspace as D } from "../../../store/store.js";
8
+ const O = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, U = { class: "sr-only" }, Z = /* @__PURE__ */ K({
9
9
  __name: "RequestParams",
10
10
  props: {
11
11
  title: {},
12
12
  paramKey: {}
13
13
  },
14
- setup(b) {
15
- const r = b, { activeRequest: o, activeExample: a } = N(), { requestExampleMutators: n } = z(), l = y(
14
+ setup(_) {
15
+ const r = _, { activeRequest: u, activeExample: a } = M(), { requestExampleMutators: i } = D(), l = y(
16
16
  () => {
17
17
  var e;
18
18
  return ((e = a.value) == null ? void 0 : e.parameters[r.paramKey]) ?? [];
19
19
  }
20
20
  );
21
- w(() => {
22
- f();
21
+ $(() => {
22
+ v();
23
23
  });
24
- const u = () => {
25
- if (!o.value || !a.value) return;
26
- const e = _.parse({ enabled: !1 }), t = [...l.value, e];
27
- n.edit(
24
+ const p = () => {
25
+ if (!u.value || !a.value) return;
26
+ const e = b.parse({ enabled: !1 }), t = [...l.value, e];
27
+ i.edit(
28
28
  a.value.uid,
29
29
  `parameters.${r.paramKey}`,
30
30
  t
31
31
  );
32
- }, p = x(null), q = (e, t, v) => {
33
- if (!o.value || !a.value) return;
34
- const m = l.value;
35
- if (m.length > e) {
36
- const s = [...m];
37
- s[e] = { ...s[e], [t]: v }, (s[e].key !== "" || s[e].value !== "") && (s[e].enabled = !0), s[e].key === "" && s[e].value === "" && s.splice(e, 1), n.edit(
32
+ }, m = E(null), q = (e, t, d) => {
33
+ if (!u.value || !a.value) return;
34
+ const c = l.value;
35
+ if (c.length > e) {
36
+ const s = [...c];
37
+ s[e] = { ...s[e], [t]: d }, (s[e].key !== "" || s[e].value !== "") && (s[e].enabled = !0), s[e].key === "" && s[e].value === "" && s.splice(e, 1), i.edit(
38
38
  a.value.uid,
39
39
  `parameters.${r.paramKey}`,
40
40
  s
41
41
  );
42
42
  } else {
43
- const s = [_.parse({ [t]: v })];
44
- n.edit(
43
+ const s = [b.parse({ [t]: d })];
44
+ i.edit(
45
45
  a.value.uid,
46
46
  `parameters.${r.paramKey}`,
47
47
  s
48
48
  ), k(() => {
49
- var d;
50
- if (!p.value) return;
51
- (d = p.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || d.focus();
49
+ var g;
50
+ if (!m.value) return;
51
+ (g = m.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || g.focus();
52
52
  });
53
53
  }
54
- e === m.length - 1 && u();
55
- }, P = (e, t) => o.value && a.value && n.edit(
54
+ e === c.length - 1 && p();
55
+ }, w = (e, t) => u.value && a.value && i.edit(
56
56
  a.value.uid,
57
57
  `parameters.${r.paramKey}.${e}.enabled`,
58
58
  t
59
59
  ), C = () => {
60
- if (!o.value || !a.value) return;
61
- const e = l.value.filter(
62
- (t) => t.enabled || t.required
63
- );
64
- n.edit(
60
+ if (!u.value || !a.value) return;
61
+ const e = l.value.filter((t) => t.required);
62
+ i.edit(
65
63
  a.value.uid,
66
64
  `parameters.${r.paramKey}`,
67
65
  e
68
66
  ), k(() => {
69
- u();
67
+ p();
70
68
  });
71
69
  };
72
- function f() {
70
+ function v() {
73
71
  if (l.value.length === 0)
74
- u();
72
+ p();
75
73
  else if (l.value.length >= 1) {
76
74
  const e = l.value[l.value.length - 1];
77
- e.key !== "" && e.value !== "" && u();
75
+ e.key !== "" && e.value !== "" && p();
78
76
  }
79
77
  }
80
- const K = y(
78
+ const P = y(
81
79
  () => l.value.filter((e) => e.key || e.value).length
82
80
  );
83
- return E(
81
+ return S(
84
82
  () => a.value,
85
83
  (e, t) => {
86
- e !== t && f();
84
+ e !== t && v();
87
85
  },
88
86
  { immediate: !0 }
89
- ), (e, t) => (A(), S(M, {
87
+ ), (e, t) => (T(), A(B, {
90
88
  class: "group/params",
91
- itemCount: K.value
89
+ itemCount: P.value
92
90
  }, {
93
- title: i(() => [
94
- h(g(e.title), 1)
91
+ title: n(() => [
92
+ h(x(e.title), 1)
95
93
  ]),
96
- actions: i(() => [
97
- c("div", D, [
98
- R(T(W), {
99
- class: "px-1 transition-none",
100
- size: "sm",
101
- variant: "ghost",
102
- onClick: B(C, ["stop"])
94
+ actions: n(() => [
95
+ o("div", O, [
96
+ f(R(V), {
97
+ side: "right",
98
+ sideOffset: 12
103
99
  }, {
104
- default: i(() => [
105
- t[0] || (t[0] = h(" Clear")),
106
- c("span", U, "All " + g(e.title), 1)
100
+ trigger: n(() => [
101
+ f(R(W), {
102
+ class: "px-1 transition-none",
103
+ size: "sm",
104
+ variant: "ghost",
105
+ onClick: z(C, ["stop"])
106
+ }, {
107
+ default: n(() => [
108
+ t[0] || (t[0] = h(" Clear ")),
109
+ o("span", U, "All " + x(e.title), 1)
110
+ ]),
111
+ _: 1
112
+ })
107
113
  ]),
114
+ content: n(() => t[1] || (t[1] = [
115
+ o("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-context p-2 text-xxs leading-5 z-10 text-c-1" }, [
116
+ o("div", { class: "flex items-center text-c-2" }, [
117
+ o("span", null, "Clear optional parameters")
118
+ ])
119
+ ], -1)
120
+ ])),
108
121
  _: 1
109
122
  })
110
123
  ])
111
124
  ]),
112
- default: i(() => [
113
- c("div", {
125
+ default: n(() => [
126
+ o("div", {
114
127
  ref_key: "tableWrapperRef",
115
- ref: p
128
+ ref: m
116
129
  }, [
117
- R(V, {
130
+ f(N, {
118
131
  class: "flex-1",
119
132
  columns: ["32px", "", ""],
120
133
  items: l.value,
121
- onToggleRow: P,
134
+ onToggleRow: w,
122
135
  onUpdateRow: q
123
136
  }, null, 8, ["items"])
124
137
  ], 512)
@@ -128,5 +141,5 @@ const D = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
128
141
  }
129
142
  });
130
143
  export {
131
- Y as default
144
+ Z as default
132
145
  };
@@ -1,6 +1,5 @@
1
1
  type __VLS_Props = {
2
- showSidebar: boolean;
3
- isReadonly: boolean;
2
+ isSidebarOpen: boolean;
4
3
  };
5
4
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
5
  "update:modelValue": (v: boolean) => any;
@@ -9,7 +8,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
9
8
  name: string;
10
9
  uid: string;
11
10
  }) => any;
12
- "update:showSidebar": (v: boolean) => any;
11
+ "update:isSidebarOpen": (v: boolean) => any;
13
12
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
13
  "onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
15
14
  onClearDrafts?: (() => any) | undefined;
@@ -17,7 +16,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
17
16
  name: string;
18
17
  uid: string;
19
18
  }) => any) | undefined;
20
- "onUpdate:showSidebar"?: ((v: boolean) => any) | undefined;
19
+ "onUpdate:isSidebarOpen"?: ((v: boolean) => any) | undefined;
21
20
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
21
  export default _default;
23
22
  //# sourceMappingURL=RequestSidebar.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AA+eA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;;;;;cAMqC,MAAM;aAAO,MAAM;;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AAqwB1D,wBAOG"}
1
+ {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AA0eA,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAA;CACvB,CAAC;;;;;cAMqC,MAAM;aAAO,MAAM;;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AAgwB1D,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestSidebar.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-17d11c53"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-189ce360"]]);
5
5
  export {
6
6
  m as default
7
7
  };