@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.
- package/CHANGELOG.md +18 -0
- 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 +1 -1
- package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts +3 -0
- package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCurl/ImportCurlModal.vue.js +2 -2
- package/dist/components/ImportCurl/ImportCurlModal.vue2.js +85 -49
- package/dist/components/Sidebar/Sidebar.vue.d.ts +2 -2
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +16 -16
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarToggle.vue.js +3 -3
- package/dist/layouts/App/create-api-client-app.d.ts +8 -7
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +16 -14
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +8 -7
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +8 -7
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +19 -18
- package/dist/store/environment.d.ts +4 -4
- package/dist/store/requests.d.ts +2 -2
- package/dist/store/store.d.ts +11 -11
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +53 -48
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +159 -149
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +74 -61
- package/dist/views/Request/RequestSidebar.vue.d.ts +3 -4
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +160 -163
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts +0 -1
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
- package/dist/views/Request/RequestSubpageHeader.vue2.js +44 -49
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;
|
|
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
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8b8ff238"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,177 +1,187 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { importCurlCommand as
|
|
6
|
-
import { useActiveEntities as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useOpenApiWatcher as
|
|
11
|
-
import { safeJSON as
|
|
12
|
-
import { useBreakpoints as
|
|
13
|
-
import { useToasts as
|
|
14
|
-
import { useRouter as
|
|
15
|
-
import
|
|
16
|
-
import { createRequestOperation as
|
|
17
|
-
import { ERRORS as
|
|
18
|
-
import { useWorkspace as
|
|
19
|
-
import { useLayout as
|
|
20
|
-
const
|
|
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(
|
|
24
|
-
const
|
|
25
|
-
activeCollection:
|
|
26
|
-
activeExample:
|
|
27
|
-
activeEnvironment:
|
|
28
|
-
activeRequest:
|
|
29
|
-
activeWorkspace:
|
|
30
|
-
activeServer:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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:
|
|
47
|
-
Y
|
|
48
|
-
immediate:
|
|
48
|
+
), { mediaQueries: Y } = Re();
|
|
49
|
+
se(Y.xl, (o) => a.value = o, {
|
|
50
|
+
immediate: _ !== "modal"
|
|
49
51
|
});
|
|
50
|
-
const
|
|
52
|
+
const B = L(
|
|
51
53
|
() => {
|
|
52
|
-
var o,
|
|
53
|
-
return (
|
|
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
|
-
),
|
|
56
|
-
if (!
|
|
57
|
+
), g = async () => {
|
|
58
|
+
if (!b.value || !m.value || !R.value)
|
|
57
59
|
return;
|
|
58
|
-
const o = typeof
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
request:
|
|
62
|
-
example:
|
|
63
|
-
selectedSecuritySchemeUids:
|
|
64
|
-
proxyUrl:
|
|
65
|
-
environment:
|
|
66
|
-
globalCookies:
|
|
67
|
-
status:
|
|
68
|
-
securitySchemes:
|
|
69
|
-
server:
|
|
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
|
-
|
|
74
|
+
O(i.message, "error");
|
|
73
75
|
return;
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
const [
|
|
77
|
-
|
|
78
|
-
},
|
|
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 =
|
|
82
|
+
return (o = N.value) == null ? void 0 : o.abort(ke.REQUEST_ABORTED);
|
|
81
83
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}),
|
|
85
|
-
function
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
96
|
-
{ url:
|
|
97
|
-
|
|
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
|
|
110
|
+
const i = J.add(
|
|
101
111
|
{
|
|
102
112
|
summary: o,
|
|
103
|
-
path:
|
|
104
|
-
method: (
|
|
105
|
-
parameters: (
|
|
106
|
-
selectedServerUid:
|
|
107
|
-
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
|
-
|
|
119
|
+
s.uid
|
|
110
120
|
);
|
|
111
|
-
|
|
112
|
-
`/workspace/${
|
|
113
|
-
),
|
|
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
|
|
119
|
-
|
|
125
|
+
function te(o) {
|
|
126
|
+
e.value = de(o), l.show();
|
|
120
127
|
}
|
|
121
|
-
return (o,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
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":"
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import
|
|
5
|
-
import { ScalarButton as W } from "@scalar/components";
|
|
6
|
-
import { requestExampleParametersSchema as
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
const
|
|
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(
|
|
15
|
-
const r =
|
|
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
|
-
|
|
22
|
-
|
|
21
|
+
$(() => {
|
|
22
|
+
v();
|
|
23
23
|
});
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
const e =
|
|
27
|
-
|
|
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
|
-
},
|
|
33
|
-
if (!
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const s = [...
|
|
37
|
-
s[e] = { ...s[e], [t]:
|
|
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 = [
|
|
44
|
-
|
|
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
|
|
50
|
-
if (!
|
|
51
|
-
(
|
|
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 ===
|
|
55
|
-
},
|
|
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 (!
|
|
61
|
-
const e = l.value.filter(
|
|
62
|
-
|
|
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
|
-
|
|
67
|
+
p();
|
|
70
68
|
});
|
|
71
69
|
};
|
|
72
|
-
function
|
|
70
|
+
function v() {
|
|
73
71
|
if (l.value.length === 0)
|
|
74
|
-
|
|
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 !== "" &&
|
|
75
|
+
e.key !== "" && e.value !== "" && p();
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
|
-
const
|
|
78
|
+
const P = y(
|
|
81
79
|
() => l.value.filter((e) => e.key || e.value).length
|
|
82
80
|
);
|
|
83
|
-
return
|
|
81
|
+
return S(
|
|
84
82
|
() => a.value,
|
|
85
83
|
(e, t) => {
|
|
86
|
-
e !== t &&
|
|
84
|
+
e !== t && v();
|
|
87
85
|
},
|
|
88
86
|
{ immediate: !0 }
|
|
89
|
-
), (e, t) => (
|
|
87
|
+
), (e, t) => (T(), A(B, {
|
|
90
88
|
class: "group/params",
|
|
91
|
-
itemCount:
|
|
89
|
+
itemCount: P.value
|
|
92
90
|
}, {
|
|
93
|
-
title:
|
|
94
|
-
h(
|
|
91
|
+
title: n(() => [
|
|
92
|
+
h(x(e.title), 1)
|
|
95
93
|
]),
|
|
96
|
-
actions:
|
|
97
|
-
|
|
98
|
-
R(
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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:
|
|
113
|
-
|
|
125
|
+
default: n(() => [
|
|
126
|
+
o("div", {
|
|
114
127
|
ref_key: "tableWrapperRef",
|
|
115
|
-
ref:
|
|
128
|
+
ref: m
|
|
116
129
|
}, [
|
|
117
|
-
|
|
130
|
+
f(N, {
|
|
118
131
|
class: "flex-1",
|
|
119
132
|
columns: ["32px", "", ""],
|
|
120
133
|
items: l.value,
|
|
121
|
-
onToggleRow:
|
|
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
|
-
|
|
144
|
+
Z as default
|
|
132
145
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
|
|
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:
|
|
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:
|
|
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":"
|
|
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-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-189ce360"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|