@scalar/api-client 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/Modal/ApiClientModal.vue.d.ts +1 -1
- package/dist/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/Modal/ApiClientModal.vue.js +1 -1
- package/dist/Modal/ApiClientModal.vue2.js +16 -15
- package/dist/Modal/api-client-modal.d.ts +1 -1
- package/dist/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/Modal/api-client-modal.js +43 -43
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -0
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/DataTable/DataTableInput.vue2.js +43 -36
- package/dist/components/DataTable/DataTableInputEnumSelect.vue.d.ts +22 -0
- package/dist/components/DataTable/DataTableInputEnumSelect.vue.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableInputEnumSelect.vue.js +102 -0
- package/dist/components/DataTable/DataTableInputEnumSelect.vue2.js +4 -0
- package/dist/components/SideNav/SideNavLink.vue.js +2 -2
- package/dist/constants.js +1 -1
- package/dist/store/workspace.d.ts +75 -12
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +113 -109
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +13 -11
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +10 -10
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +24 -23
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +6 -6
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4385ae2: fix: add missing dependencies
|
|
8
|
+
- 632d6f7: fix: add cookie handler and schema
|
|
9
|
+
- a5aedf5: feat: lint workspace sidenav icons
|
|
10
|
+
- a5aedf5: feat: add server icon
|
|
11
|
+
- d6a2a4d: feat: api client data table input enum select component
|
|
12
|
+
- cd5d1a4: fix: made adding of scalar classes to headless more robust
|
|
13
|
+
- Updated dependencies [d6a2a4d]
|
|
14
|
+
- Updated dependencies [04ca40b]
|
|
15
|
+
- Updated dependencies [632d6f7]
|
|
16
|
+
- Updated dependencies [a5aedf5]
|
|
17
|
+
- Updated dependencies [a5aedf5]
|
|
18
|
+
- Updated dependencies [cd5d1a4]
|
|
19
|
+
- @scalar/oas-utils@0.2.9
|
|
20
|
+
- @scalar/object-utils@1.1.3
|
|
21
|
+
- @scalar/components@0.12.8
|
|
22
|
+
|
|
3
23
|
## 2.0.5
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type useModal } from '@scalar/components';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
3
3
|
/** Controls opening and closing the modal */
|
|
4
4
|
modalState: ReturnType<typeof useModal>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../src/Modal/ApiClientModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../src/Modal/ApiClientModal.vue"],"names":[],"mappings":"AA6KA,OAAO,EAA8B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAA;;IAO5E,6CAA6C;gBACjC,UAAU,CAAC,OAAO,QAAQ,CAAC;;IADvC,6CAA6C;gBACjC,UAAU,CAAC,OAAO,QAAQ,CAAC;;AAyGzC,wBAMG;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"}
|
|
@@ -2,7 +2,7 @@ import o from "./ApiClientModal.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-16873ba4"]]);
|
|
6
6
|
export {
|
|
7
7
|
m as default
|
|
8
8
|
};
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { defineComponent as r, watch as l, onBeforeMount as s, onBeforeUnmount as c, withDirectives as m, openBlock as d, createElementBlock as i, createElementVNode as o, createVNode as p, unref as u, vShow as f } from "vue";
|
|
2
|
+
import { addScalarClassesToHeadless as v } from "@scalar/components";
|
|
3
|
+
import { RouterView as h } from "vue-router";
|
|
4
|
+
const _ = { class: "scalar" }, w = { className: "scalar-container" }, y = { className: "scalar-app scalar-client" }, C = /* @__PURE__ */ r({
|
|
4
5
|
__name: "ApiClientModal",
|
|
5
6
|
props: {
|
|
6
7
|
modalState: {}
|
|
7
8
|
},
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
10
|
-
return
|
|
11
|
-
() =>
|
|
9
|
+
setup(a) {
|
|
10
|
+
const n = a;
|
|
11
|
+
return l(
|
|
12
|
+
() => n.modalState.open,
|
|
12
13
|
(e) => {
|
|
13
14
|
e ? document.documentElement.style.overflow = "hidden" : document.documentElement.style.removeProperty("overflow");
|
|
14
15
|
}
|
|
15
|
-
), s(() => document.documentElement.style.removeProperty("overflow")), (e,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
), s(() => v()), c(() => document.documentElement.style.removeProperty("overflow")), (e, t) => m((d(), i("div", _, [
|
|
17
|
+
o("div", w, [
|
|
18
|
+
o("div", y, [
|
|
19
|
+
p(u(h), { key: "$route.fullPath" })
|
|
19
20
|
]),
|
|
20
|
-
|
|
21
|
+
o("div", {
|
|
21
22
|
class: "scalar-app-exit",
|
|
22
|
-
onClick:
|
|
23
|
+
onClick: t[0] || (t[0] = (S) => e.modalState.hide())
|
|
23
24
|
})
|
|
24
25
|
])
|
|
25
26
|
], 512)), [
|
|
26
|
-
[
|
|
27
|
+
[f, e.modalState.open]
|
|
27
28
|
]);
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
C as default
|
|
32
33
|
};
|
|
@@ -19,7 +19,7 @@ export type OpenClientPayload = {
|
|
|
19
19
|
method: RequestMethod;
|
|
20
20
|
};
|
|
21
21
|
/** Initialize Scalar API Client Modal */
|
|
22
|
-
export declare const createScalarApiClient: (el: HTMLElement | null,
|
|
22
|
+
export declare const createScalarApiClient: (el: HTMLElement | null, config: ClientConfiguration, mountOnInitialize?: boolean) => Promise<{
|
|
23
23
|
/** The vue app instance for the modal, be careful with this */
|
|
24
24
|
app: import("vue").App<Element>;
|
|
25
25
|
/** Update the API client config */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client-modal.d.ts","sourceRoot":"","sources":["../../src/Modal/api-client-modal.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAG/E,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,2BAA2B,CAAA;AAQ3E,sDAAsD;AACtD,MAAM,MAAM,mBAAmB,GAAG;IAChC,yCAAyC;IACzC,IAAI,EAAE,iBAAiB,CAAA;IACvB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,4DAA4D;IAE5D,mFAAmF;IACnF,YAAY,CAAC,EACT,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAA;CACR,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAA;AAEvE,yCAAyC;AACzC,eAAO,MAAM,qBAAqB,OAE5B,WAAW,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"api-client-modal.d.ts","sourceRoot":"","sources":["../../src/Modal/api-client-modal.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAG/E,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,2BAA2B,CAAA;AAQ3E,sDAAsD;AACtD,MAAM,MAAM,mBAAmB,GAAG;IAChC,yCAAyC;IACzC,IAAI,EAAE,iBAAiB,CAAA;IACvB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,4DAA4D;IAE5D,mFAAmF;IACnF,YAAY,CAAC,EACT,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAA;CACR,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAA;AAEvE,yCAAyC;AACzC,eAAO,MAAM,qBAAqB,OAE5B,WAAW,GAAG,IAAI,UAEd,mBAAmB;IA6DzB,+DAA+D;;IAE/D,mCAAmC;4BACX,mBAAmB;IAQ3C;;;OAGG;iCAC0B,MAAM;IAMnC;;;OAGG;uBACgB,mBAAmB;IAyEtC,uEAAuE;uBACpD,iBAAiB;IAapC,iCAAiC;qBAChB,iBAAiB;IAalC,8CAA8C;;;;;;;EAIjD,CAAA"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { clientRouter as
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
import { objectMerge as
|
|
4
|
-
import { getNestedValue as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
var h, S
|
|
9
|
-
const
|
|
1
|
+
import { clientRouter as A } from "../router.js";
|
|
2
|
+
import { useWorkspace as x } from "../store/workspace.js";
|
|
3
|
+
import { objectMerge as O } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { getNestedValue as R } from "@scalar/object-utils/nested";
|
|
5
|
+
import { createApp as j } from "vue";
|
|
6
|
+
import C from "./ApiClientModal.vue.js";
|
|
7
|
+
const L = async (b, r, k = !0) => {
|
|
8
|
+
var f, h, S;
|
|
9
|
+
const {
|
|
10
10
|
activeCollection: u,
|
|
11
|
-
collectionMutators:
|
|
12
|
-
importSpecFile:
|
|
13
|
-
importSpecFromUrl:
|
|
14
|
-
modalState:
|
|
15
|
-
requests:
|
|
16
|
-
securitySchemeMutators:
|
|
17
|
-
securitySchemes:
|
|
18
|
-
serverMutators:
|
|
11
|
+
collectionMutators: v,
|
|
12
|
+
importSpecFile: i,
|
|
13
|
+
importSpecFromUrl: n,
|
|
14
|
+
modalState: c,
|
|
15
|
+
requests: I,
|
|
16
|
+
securitySchemeMutators: U,
|
|
17
|
+
securitySchemes: M,
|
|
18
|
+
serverMutators: P,
|
|
19
19
|
workspaceMutators: p
|
|
20
|
-
} =
|
|
21
|
-
(
|
|
20
|
+
} = x();
|
|
21
|
+
(f = r.spec) != null && f.url ? n(r.spec.url, r.proxyUrl) : (h = r.spec) != null && h.content ? i((S = r.spec) == null ? void 0 : S.content) : console.error(
|
|
22
22
|
"[@scalar/api-client-modal] Could not create the API client.",
|
|
23
23
|
"Please provide an OpenAPI document: { spec: { url: '…' } }",
|
|
24
24
|
"Read more: https://github.com/scalar/scalar/tree/main/packages/api-client-modal"
|
|
25
25
|
);
|
|
26
|
-
const d = C
|
|
27
|
-
d.use(
|
|
28
|
-
const
|
|
26
|
+
const d = j(C, { modalState: c });
|
|
27
|
+
d.use(A);
|
|
28
|
+
const m = (e = b) => {
|
|
29
29
|
if (!e) {
|
|
30
30
|
console.error(
|
|
31
31
|
"[@scalar/api-client-modal] Could not create the API client.",
|
|
@@ -36,12 +36,12 @@ const N = async (k, v, I = !0) => {
|
|
|
36
36
|
}
|
|
37
37
|
d.mount(e);
|
|
38
38
|
};
|
|
39
|
-
return
|
|
39
|
+
return k && m(), p.edit("isReadOnly", !0), r.proxyUrl && p.edit("proxyUrl", r.proxyUrl), r.themeId && p.edit("themeId", r.themeId), {
|
|
40
40
|
/** The vue app instance for the modal, be careful with this */
|
|
41
41
|
app: d,
|
|
42
42
|
/** Update the API client config */
|
|
43
43
|
updateConfig(e, s = !0) {
|
|
44
|
-
s ? Object.assign(
|
|
44
|
+
s ? Object.assign(r, e) : O(r, e), e.spec && i(e.spec);
|
|
45
45
|
},
|
|
46
46
|
/**
|
|
47
47
|
* TODO this is just temporary for the modal, we'll put in a proper solution later
|
|
@@ -49,7 +49,7 @@ const N = async (k, v, I = !0) => {
|
|
|
49
49
|
*/
|
|
50
50
|
updateServerUrl: (e) => {
|
|
51
51
|
var s;
|
|
52
|
-
return
|
|
52
|
+
return P.edit(
|
|
53
53
|
((s = u.value) == null ? void 0 : s.selectedServerUid) ?? "",
|
|
54
54
|
"url",
|
|
55
55
|
e
|
|
@@ -60,34 +60,34 @@ const N = async (k, v, I = !0) => {
|
|
|
60
60
|
* maps the references useAuthenticationStore to the client auth
|
|
61
61
|
*/
|
|
62
62
|
updateAuth: (e) => {
|
|
63
|
-
var
|
|
64
|
-
if (Object.values(
|
|
65
|
-
const t = (y,
|
|
66
|
-
switch (
|
|
63
|
+
var l, a;
|
|
64
|
+
if (Object.values(M).forEach((o) => {
|
|
65
|
+
const t = (y, w = "value") => y.length && !R(o, w).length && U.edit(o.uid, w, y);
|
|
66
|
+
switch (o.type) {
|
|
67
67
|
case "apiKey":
|
|
68
68
|
t(e.apiKey.token);
|
|
69
69
|
break;
|
|
70
70
|
case "http":
|
|
71
|
-
|
|
71
|
+
o.scheme === "bearer" ? t(e.http.bearer.token) : o.scheme === "basic" && (t(e.http.basic.username), t(e.http.basic.password, "secondValue"));
|
|
72
72
|
break;
|
|
73
73
|
case "oauth2":
|
|
74
|
-
t(e.oAuth2.clientId, "clientId"),
|
|
74
|
+
t(e.oAuth2.clientId, "clientId"), o.flows.implicit ? (t(e.oAuth2.accessToken, "flows.implicit.token"), t(e.oAuth2.scopes, "flows.implicit.selectedScopes")) : o.flows.password && (t(e.oAuth2.accessToken, "flows.password.token"), t(e.oAuth2.scopes, "flows.password.selectedScopes"), t(e.oAuth2.username, "flows.password.value"), t(e.oAuth2.password, "flows.password.secondValue"));
|
|
75
75
|
break;
|
|
76
76
|
}
|
|
77
77
|
}), e.preferredSecurityScheme) {
|
|
78
|
-
const
|
|
78
|
+
const o = {
|
|
79
79
|
uid: e.preferredSecurityScheme
|
|
80
|
-
}, t = (
|
|
81
|
-
(t == null ? void 0 : t.type) === "oauth2" && (
|
|
80
|
+
}, t = (l = e.securitySchemes) == null ? void 0 : l[e.preferredSecurityScheme ?? ""];
|
|
81
|
+
(t == null ? void 0 : t.type) === "oauth2" && (o.flowKey = (a = t.flows) != null && a.implicit ? "implicit" : "password"), v.edit(
|
|
82
82
|
u.value.uid,
|
|
83
83
|
"selectedSecuritySchemes",
|
|
84
|
-
[
|
|
84
|
+
[o]
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
/** Update the spec file, this will re-parse it and clear your store */
|
|
89
89
|
updateSpec: (e) => {
|
|
90
|
-
e != null && e.url ?
|
|
90
|
+
e != null && e.url ? n(e.url, r.proxyUrl) : e != null && e.content ? i(e == null ? void 0 : e.content) : console.error(
|
|
91
91
|
"[@scalar/api-client-modal] Could not create the API client.",
|
|
92
92
|
"Please provide an OpenAPI document: { spec: { url: '…' } }",
|
|
93
93
|
"Read more: https://github.com/scalar/scalar/tree/main/packages/api-client-modal"
|
|
@@ -95,22 +95,22 @@ const N = async (k, v, I = !0) => {
|
|
|
95
95
|
},
|
|
96
96
|
/** Open the API client modal */
|
|
97
97
|
open: (e) => {
|
|
98
|
-
const s = Object.values(
|
|
99
|
-
({ path:
|
|
98
|
+
const s = Object.values(I).find(
|
|
99
|
+
({ path: l, method: a }) => e ? (
|
|
100
100
|
// The given operation
|
|
101
|
-
|
|
101
|
+
l === e.path && a === e.method
|
|
102
102
|
) : (
|
|
103
103
|
// Or the first request
|
|
104
104
|
!0
|
|
105
105
|
)
|
|
106
106
|
);
|
|
107
|
-
s &&
|
|
107
|
+
s && A.push(`/request/${s.uid}`), c.open = !0;
|
|
108
108
|
},
|
|
109
109
|
/** Mount the references to a given element */
|
|
110
|
-
mount:
|
|
111
|
-
modalState:
|
|
110
|
+
mount: m,
|
|
111
|
+
modalState: c
|
|
112
112
|
};
|
|
113
113
|
};
|
|
114
114
|
export {
|
|
115
|
-
|
|
115
|
+
L as createScalarApiClient
|
|
116
116
|
};
|
|
@@ -7,7 +7,7 @@ const M = /* @__PURE__ */ c({
|
|
|
7
7
|
setup(k) {
|
|
8
8
|
const { toggleDarkMode: t, isDark: n } = f();
|
|
9
9
|
return (g, o) => (l(), i("button", {
|
|
10
|
-
class: "w-[37px] hover:text-c-1 flex items-center justify-center rounded-lg p-
|
|
10
|
+
class: "w-[37px] hover:text-c-1 flex items-center justify-center rounded-lg p-[7px]",
|
|
11
11
|
type: "button",
|
|
12
12
|
onClick: o[0] || (o[0] = //@ts-ignore
|
|
13
13
|
(...a) => e(t) && e(t)(...a))
|
|
@@ -10,6 +10,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
10
10
|
required?: boolean;
|
|
11
11
|
modelValue: string | number;
|
|
12
12
|
readOnly?: boolean;
|
|
13
|
+
enum?: string[];
|
|
13
14
|
}>, {
|
|
14
15
|
required: boolean;
|
|
15
16
|
readOnly: boolean;
|
|
@@ -26,6 +27,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
26
27
|
required?: boolean;
|
|
27
28
|
modelValue: string | number;
|
|
28
29
|
readOnly?: boolean;
|
|
30
|
+
enum?: string[];
|
|
29
31
|
}>, {
|
|
30
32
|
required: boolean;
|
|
31
33
|
readOnly: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableInput.vue"],"names":[],"mappings":"AA8MA,iBAAS,cAAc;qBAmLM,GAAG;kBACL,GAAG;EA4B7B;AACD,QAAA,MAAM,eAAe;SAlRZ,MAAM;WACJ,MAAM;IACb,sEAAsE;qBACrD,MAAM;eACZ,OAAO;gBACN,MAAM,GAAG,MAAM;eAChB,OAAO;WACX,MAAM,EAAE;;;;;;;;;;SAPV,MAAM;WACJ,MAAM;IACb,sEAAsE;qBACrD,MAAM;eACZ,OAAO;gBACN,MAAM,GAAG,MAAM;eAChB,OAAO;WACX,MAAM,EAAE;;;;;;;;;;cADJ,OAAO;cAFP,OAAO;MAqRpB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./DataTableInput.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ a(t, [["__scopeId", "data-v-74a9b970"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as B, ref as s, computed as q, openBlock as r, createBlock as d, normalizeClass as p, withCtx as $, createElementBlock as m, renderSlot as f, createCommentVNode as c, createElementVNode as x, mergeProps as C, unref as S, createVNode as D } from "vue";
|
|
2
2
|
import I from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
|
|
3
3
|
import { ScalarIconButton as M } from "@scalar/components";
|
|
4
4
|
import O from "./DataTableCell.vue.js";
|
|
5
|
-
|
|
5
|
+
import F from "./DataTableInputEnumSelect.vue.js";
|
|
6
|
+
const N = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "text-c-2 flex min-w-[100px] items-center border-r-1/2 pl-2 pr-0"
|
|
8
|
-
},
|
|
9
|
+
}, P = ["id", "readOnly", "required", "type", "value"], z = /* @__PURE__ */ B({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "DataTableInput",
|
|
11
12
|
props: {
|
|
@@ -14,37 +15,43 @@ const F = {
|
|
|
14
15
|
containerClass: {},
|
|
15
16
|
required: { type: Boolean, default: !1 },
|
|
16
17
|
modelValue: {},
|
|
17
|
-
readOnly: { type: Boolean, default: !1 }
|
|
18
|
+
readOnly: { type: Boolean, default: !1 },
|
|
19
|
+
enum: {}
|
|
18
20
|
},
|
|
19
21
|
emits: ["update:modelValue", "inputFocus", "inputBlur", "selectVariable"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
() =>
|
|
25
|
-
),
|
|
22
|
+
setup(v, { emit: y }) {
|
|
23
|
+
const o = v, l = y, a = s(!0), i = s(""), n = s(!1), w = () => {
|
|
24
|
+
n.value || l("inputBlur");
|
|
25
|
+
}, h = q(
|
|
26
|
+
() => o.type === "password" ? a.value ? "password" : "text" : o.type ?? "text"
|
|
27
|
+
), V = (e) => {
|
|
26
28
|
const t = e.target;
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
29
|
+
i.value = t.value, l("update:modelValue", t.value);
|
|
30
|
+
}, k = (e) => {
|
|
31
|
+
l("update:modelValue", e);
|
|
32
|
+
}, b = () => {
|
|
33
|
+
n.value = !0;
|
|
32
34
|
}, g = () => {
|
|
33
|
-
|
|
35
|
+
n.value = !1;
|
|
34
36
|
};
|
|
35
|
-
return (e, t) => (
|
|
36
|
-
class:
|
|
37
|
+
return (e, t) => (r(), d(O, {
|
|
38
|
+
class: p(["relative row", e.containerClass])
|
|
37
39
|
}, {
|
|
38
40
|
default: $(() => [
|
|
39
|
-
e.$slots.default ? (
|
|
40
|
-
|
|
41
|
+
e.$slots.default ? (r(), m("div", N, [
|
|
42
|
+
f(e.$slots, "default", {}, void 0, !0)
|
|
41
43
|
])) : c("", !0),
|
|
42
|
-
|
|
43
|
-
class:
|
|
44
|
+
x("div", {
|
|
45
|
+
class: p(["group row-1", {
|
|
44
46
|
"relative required after:absolute after:centered-y after:right-0 after:pt-px after:pr-2 after:text-xxs after:font-medium after:text-c-3 after:bg-b-1 after:shadow-[-8px_0_4px_var(--scalar-background-1)] group-has-[:focus]:after:hidden": e.required
|
|
45
47
|
}])
|
|
46
48
|
}, [
|
|
47
|
-
|
|
49
|
+
o.enum && o.enum.length ? (r(), d(F, {
|
|
50
|
+
key: 0,
|
|
51
|
+
enum: o.enum,
|
|
52
|
+
modelValue: o.modelValue,
|
|
53
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => l("update:modelValue", u))
|
|
54
|
+
}, null, 8, ["enum", "modelValue"])) : (r(), m("input", C({ key: 1 }, e.$attrs, {
|
|
48
55
|
id: e.id,
|
|
49
56
|
autocomplete: "off",
|
|
50
57
|
class: "border-none focus:text-c-1 text-c-2 min-w-0 w-full px-2 py-1.5 outline-none",
|
|
@@ -52,26 +59,26 @@ const F = {
|
|
|
52
59
|
readOnly: e.readOnly,
|
|
53
60
|
required: e.required,
|
|
54
61
|
spellcheck: "false",
|
|
55
|
-
type:
|
|
62
|
+
type: h.value,
|
|
56
63
|
value: e.modelValue,
|
|
57
64
|
onBlur: w,
|
|
58
|
-
onFocus: t[
|
|
59
|
-
onInput:
|
|
60
|
-
}), null, 16,
|
|
65
|
+
onFocus: t[1] || (t[1] = (u) => l("inputFocus")),
|
|
66
|
+
onInput: V
|
|
67
|
+
}), null, 16, P))
|
|
61
68
|
], 2),
|
|
62
|
-
|
|
63
|
-
e.type === "password" ? (
|
|
69
|
+
f(e.$slots, "icon", {}, void 0, !0),
|
|
70
|
+
e.type === "password" ? (r(), d(S(M), {
|
|
64
71
|
key: 1,
|
|
65
72
|
class: "-ml-.5 mr-1 h-6 w-6 self-center p-1.5",
|
|
66
|
-
icon:
|
|
67
|
-
label:
|
|
68
|
-
onClick: t[
|
|
73
|
+
icon: a.value ? "Show" : "Hide",
|
|
74
|
+
label: a.value ? "Show Password" : "Hide Password",
|
|
75
|
+
onClick: t[2] || (t[2] = (u) => a.value = !a.value)
|
|
69
76
|
}, null, 8, ["icon", "label"])) : c("", !0),
|
|
70
77
|
D(I, {
|
|
71
|
-
query:
|
|
72
|
-
onMousedown:
|
|
78
|
+
query: i.value,
|
|
79
|
+
onMousedown: b,
|
|
73
80
|
onMouseup: g,
|
|
74
|
-
onSelect:
|
|
81
|
+
onSelect: k
|
|
75
82
|
}, null, 8, ["query"])
|
|
76
83
|
]),
|
|
77
84
|
_: 3
|
|
@@ -79,5 +86,5 @@ const F = {
|
|
|
79
86
|
}
|
|
80
87
|
});
|
|
81
88
|
export {
|
|
82
|
-
|
|
89
|
+
z as default
|
|
83
90
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
|
+
modelValue: string | number;
|
|
3
|
+
enum?: string[];
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"update:modelValue": (v: string) => void;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
7
|
+
modelValue: string | number;
|
|
8
|
+
enum?: string[];
|
|
9
|
+
}>>> & {
|
|
10
|
+
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToOption<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=DataTableInputEnumSelect.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTableInputEnumSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableInputEnumSelect.vue"],"names":[],"mappings":";gBA+Hc,MAAM,GAAG,MAAM;WACpB,MAAM,EAAE;;;;gBADH,MAAM,GAAG,MAAM;WACpB,MAAM,EAAE;;;;AA4SjB,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { defineComponent as D, computed as b, ref as d, watch as B, openBlock as o, createElementBlock as m, withDirectives as z, withKeys as N, vModelText as j, createBlock as p, unref as t, withCtx as u, Fragment as E, renderList as I, createElementVNode as i, normalizeClass as T, createVNode as s, createTextVNode as A, toDisplayString as w, createCommentVNode as K } from "vue";
|
|
2
|
+
import { ScalarDropdown as $, ScalarDropdownItem as V, ScalarIcon as v, ScalarDropdownDivider as F, ScalarButton as L } from "@scalar/components";
|
|
3
|
+
const M = { class: "w-full" }, U = { class: "flex items-center justify-center h-4 w-4" }, W = /* @__PURE__ */ i("span", null, "Add value", -1), J = /* @__PURE__ */ D({
|
|
4
|
+
__name: "DataTableInputEnumSelect",
|
|
5
|
+
props: {
|
|
6
|
+
modelValue: {},
|
|
7
|
+
enum: {}
|
|
8
|
+
},
|
|
9
|
+
emits: ["update:modelValue"],
|
|
10
|
+
setup(k, { emit: y }) {
|
|
11
|
+
const f = k, x = y, _ = b(() => f.enum ?? []), n = d(f.modelValue.toString()), r = d(!1), l = d("");
|
|
12
|
+
B(l, (a) => {
|
|
13
|
+
x("update:modelValue", a);
|
|
14
|
+
});
|
|
15
|
+
const h = (a) => {
|
|
16
|
+
n.value = a, x("update:modelValue", a), r.value = !1;
|
|
17
|
+
}, g = () => {
|
|
18
|
+
l.value.trim() && (h(l.value), l.value = "");
|
|
19
|
+
}, C = () => {
|
|
20
|
+
l.value.trim() || (n.value = "", r.value = !1);
|
|
21
|
+
}, S = (a) => n.value === a;
|
|
22
|
+
return (a, c) => (o(), m("div", M, [
|
|
23
|
+
r.value ? z((o(), m("input", {
|
|
24
|
+
key: 0,
|
|
25
|
+
"onUpdate:modelValue": c[0] || (c[0] = (e) => l.value = e),
|
|
26
|
+
class: "border-none focus:text-c-1 text-c-2 min-w-0 w-full px-2 py-1.5 outline-none",
|
|
27
|
+
placeholder: "Value",
|
|
28
|
+
type: "text",
|
|
29
|
+
onBlur: C,
|
|
30
|
+
onKeyup: N(g, ["enter"])
|
|
31
|
+
}, null, 544)), [
|
|
32
|
+
[j, l.value]
|
|
33
|
+
]) : (o(), p(t($), {
|
|
34
|
+
key: 1,
|
|
35
|
+
resize: "",
|
|
36
|
+
value: n.value
|
|
37
|
+
}, {
|
|
38
|
+
items: u(() => [
|
|
39
|
+
(o(!0), m(E, null, I(_.value, (e) => (o(), p(t(V), {
|
|
40
|
+
key: e,
|
|
41
|
+
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
|
|
42
|
+
value: e,
|
|
43
|
+
onClick: (q) => h(e)
|
|
44
|
+
}, {
|
|
45
|
+
default: u(() => [
|
|
46
|
+
i("div", {
|
|
47
|
+
class: T([
|
|
48
|
+
"flex items-center justify-center rounded-full p-[3px] group-hover/item:shadow-border",
|
|
49
|
+
S(e) ? "bg-blue text-b-1" : "text-transparent"
|
|
50
|
+
])
|
|
51
|
+
}, [
|
|
52
|
+
s(t(v), {
|
|
53
|
+
class: "size-2.5 stroke-[1.75]",
|
|
54
|
+
icon: "Checkmark"
|
|
55
|
+
})
|
|
56
|
+
], 2),
|
|
57
|
+
A(" " + w(e), 1)
|
|
58
|
+
]),
|
|
59
|
+
_: 2
|
|
60
|
+
}, 1032, ["value", "onClick"]))), 128)),
|
|
61
|
+
s(t(F)),
|
|
62
|
+
s(t(V), {
|
|
63
|
+
class: "flex items-center gap-1.5",
|
|
64
|
+
onClick: c[1] || (c[1] = (e) => r.value = !0)
|
|
65
|
+
}, {
|
|
66
|
+
default: u(() => [
|
|
67
|
+
i("div", U, [
|
|
68
|
+
s(t(v), {
|
|
69
|
+
class: "h-2.5",
|
|
70
|
+
icon: "Add"
|
|
71
|
+
})
|
|
72
|
+
]),
|
|
73
|
+
W
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
})
|
|
77
|
+
]),
|
|
78
|
+
default: u(() => [
|
|
79
|
+
s(t(L), {
|
|
80
|
+
class: "gap-1.5 font-normal h-full justify-start px-2 py-1.5",
|
|
81
|
+
fullWidth: "",
|
|
82
|
+
variant: "ghost"
|
|
83
|
+
}, {
|
|
84
|
+
default: u(() => [
|
|
85
|
+
i("span", null, w(n.value || "Select a value"), 1),
|
|
86
|
+
n.value ? K("", !0) : (o(), p(t(v), {
|
|
87
|
+
key: 0,
|
|
88
|
+
icon: "ChevronDown",
|
|
89
|
+
size: "xs"
|
|
90
|
+
}))
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
})
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
}, 8, ["value"]))
|
|
97
|
+
]));
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
export {
|
|
101
|
+
J as default
|
|
102
|
+
};
|
|
@@ -12,12 +12,12 @@ const d = { class: "sr-only" }, k = /* @__PURE__ */ t({
|
|
|
12
12
|
const o = n("router-link");
|
|
13
13
|
return r(), s(o, {
|
|
14
14
|
activeClass: "active-link",
|
|
15
|
-
class: a(["w-[37px] hover:text-c-1 flex items-center justify-center rounded-lg p-
|
|
15
|
+
class: a(["w-[37px] hover:text-c-1 flex items-center justify-center rounded-lg p-[7px]", { "bg-b-2 transition-none hover:cursor-auto text-c-1": e.active }]),
|
|
16
16
|
to: e.path
|
|
17
17
|
}, {
|
|
18
18
|
default: c(() => [
|
|
19
19
|
l(i(m), {
|
|
20
|
-
class: "stroke-[
|
|
20
|
+
class: "stroke-[1.5]",
|
|
21
21
|
icon: e.icon
|
|
22
22
|
}, null, 8, ["icon"]),
|
|
23
23
|
p("span", d, [
|
package/dist/constants.js
CHANGED
|
@@ -2,7 +2,7 @@ const e = [
|
|
|
2
2
|
{ label: "Requests", icon: "ExternalLink", path: "/request" },
|
|
3
3
|
{ label: "Cookies", icon: "Cookie", path: "/cookies" },
|
|
4
4
|
{ label: "Environment", icon: "Brackets", path: "/environment" },
|
|
5
|
-
{ label: "Servers", icon: "
|
|
5
|
+
{ label: "Servers", icon: "Server", path: "/servers" }
|
|
6
6
|
// { label: 'Git Sync', icon: 'Branch', path: '/git-sync' },
|
|
7
7
|
];
|
|
8
8
|
export {
|