@scalar/api-client 2.17.8 → 2.18.0
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 +49 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.js +46 -51
- package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts +9 -0
- package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +7 -0
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +12 -10
- package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts +3 -0
- package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-server-url.js +12 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +87 -65
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +115 -144
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
- package/dist/v2/components/code-input/CodeInput.vue2.js +120 -107
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +3 -3
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
- package/dist/v2/components/data-table/DataTableInput.vue2.js +27 -27
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +3 -2
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js +42 -39
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -3
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +5 -3
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +25 -30
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +89 -141
- package/dist/v2/features/app/app-events.d.ts +22 -0
- package/dist/v2/features/app/app-events.d.ts.map +1 -0
- package/dist/v2/features/app/app-events.js +136 -0
- package/dist/v2/features/app/app-state.d.ts +135 -0
- package/dist/v2/features/app/app-state.d.ts.map +1 -0
- package/dist/v2/features/app/app-state.js +316 -0
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +6 -3
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
- package/dist/v2/features/app/components/AppSidebar.vue2.js +4 -4
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +4 -2
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.js +25 -22
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts +9 -5
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +62 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +14 -10
- package/dist/v2/features/app/helpers/routes.d.ts +5 -2
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +7 -7
- package/dist/v2/features/collection/components/Form.vue.d.ts +1 -1
- package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +2 -2
- package/dist/v2/features/modal/Modal.vue2.js +40 -41
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +38 -28
- package/dist/v2/features/operation/helpers/combine-params.d.ts +4 -0
- package/dist/v2/features/operation/helpers/combine-params.d.ts.map +1 -0
- package/dist/v2/features/operation/helpers/combine-params.js +13 -0
- package/dist/v2/features/operation/index.d.ts +1 -0
- package/dist/v2/features/operation/index.d.ts.map +1 -1
- package/dist/v2/features/operation/index.js +10 -8
- package/dist/v2/helpers/get-tab-details.d.ts +2 -2
- package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +16 -16
- package/dist/v2/features/app/hooks/use-app-sidebar.d.ts +0 -40
- package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-app-sidebar.js +0 -134
- package/dist/v2/features/app/hooks/use-sync-path.d.ts +0 -11
- package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-sync-path.js +0 -52
- package/dist/v2/features/app/hooks/use-tabs.d.ts +0 -31
- package/dist/v2/features/app/hooks/use-tabs.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-tabs.js +0 -44
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts +0 -18
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.js +0 -156
- package/dist/v2/features/app/hooks/use-workspace-selector.d.ts +0 -28
- package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-workspace-selector.js +0 -81
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isDefined as
|
|
3
|
-
import { useCodeMirror as
|
|
4
|
-
import { nanoid as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { pillPlugin as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as Q, useAttrs as G, ref as u, computed as d, toRef as r, watch as X, createElementBlock as i, openBlock as a, Fragment as Y, createBlock as y, createCommentVNode as f, normalizeClass as Z, createElementVNode as V, toDisplayString as _, mergeProps as ee, unref as O, withKeys as b, withModifiers as $, createTextVNode as B, renderSlot as I } from "vue";
|
|
2
|
+
import { isDefined as te } from "@scalar/helpers/array/is-defined";
|
|
3
|
+
import { useCodeMirror as ne, useDropdown as le, colorPicker as oe } from "@scalar/use-codemirror";
|
|
4
|
+
import { nanoid as ae } from "nanoid";
|
|
5
|
+
import k from "../data-table/DataTableInputSelect.vue.js";
|
|
6
|
+
import re from "../../features/environments/components/EnvironmentVariablesDropdown.vue.js";
|
|
7
|
+
import { pillPlugin as ie, backspaceCommand as se } from "./code-variable-widget.js";
|
|
8
|
+
const ue = { class: "whitespace-nowrap" }, de = ["id"], fe = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "z-context text-c-2 absolute right-1.5 bottom-1 hidden font-sans group-has-[:focus-visible]/input:block",
|
|
11
11
|
role: "alert"
|
|
12
|
-
},
|
|
12
|
+
}, ce = {
|
|
13
13
|
key: 5,
|
|
14
14
|
class: "centered-y text-orange absolute right-7 text-xs"
|
|
15
|
-
},
|
|
15
|
+
}, me = {
|
|
16
16
|
key: 6,
|
|
17
17
|
class: "centered-y absolute right-0 flex h-full items-center p-1.5 group-has-[.cm-focused]:z-1"
|
|
18
|
-
},
|
|
18
|
+
}, ye = {
|
|
19
19
|
key: 7,
|
|
20
20
|
class: "required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.alert]:shadow-none group-[.error]:bg-transparent group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0"
|
|
21
|
-
},
|
|
21
|
+
}, be = {
|
|
22
22
|
inheritAttrs: !1
|
|
23
|
-
},
|
|
24
|
-
...
|
|
23
|
+
}, xe = /* @__PURE__ */ Q({
|
|
24
|
+
...be,
|
|
25
25
|
__name: "CodeInput",
|
|
26
26
|
props: {
|
|
27
|
-
modelValue: {
|
|
27
|
+
modelValue: {},
|
|
28
28
|
environment: {},
|
|
29
29
|
type: {},
|
|
30
30
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -32,7 +32,7 @@ const ae = { class: "whitespace-nowrap" }, re = ["id"], ie = {
|
|
|
32
32
|
layout: { default: "desktop" },
|
|
33
33
|
enum: {},
|
|
34
34
|
examples: {},
|
|
35
|
-
default: {
|
|
35
|
+
default: {},
|
|
36
36
|
nullable: { type: Boolean, default: !1 },
|
|
37
37
|
placeholder: {},
|
|
38
38
|
required: { type: Boolean },
|
|
@@ -53,167 +53,180 @@ const ae = { class: "whitespace-nowrap" }, re = ["id"], ie = {
|
|
|
53
53
|
handleFieldSubmit: { type: Function }
|
|
54
54
|
},
|
|
55
55
|
emits: ["update:modelValue", "submit", "blur", "curl", "redirectToEnvironment"],
|
|
56
|
-
setup(t, { expose:
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
t.handleFieldChange ? t.handleFieldChange(e) : u("update:modelValue", e);
|
|
56
|
+
setup(t, { expose: M, emit: N }) {
|
|
57
|
+
const s = N, x = G(), R = x.id || `id-${ae()}`, h = u(!1), q = d(() => t.enum?.length ? !1 : t.type === "boolean" || Array.isArray(t.type) && t.type.includes("boolean")), C = d(() => t.nullable ? ["true", "false", "null"] : ["true", "false"]), z = d(() => Array.isArray(t.type) ? t.type.find((e) => e !== "null") ?? "string" : t.type), E = (e) => {
|
|
58
|
+
if (!t.alwaysEmitChange && e === c(t.modelValue))
|
|
59
|
+
return;
|
|
60
|
+
if (typeof e == "string" && t.importCurl && e.trim().toLowerCase().startsWith("curl")) {
|
|
61
|
+
s("curl", e), l.value && l.value.dispatch({
|
|
62
|
+
changes: {
|
|
63
|
+
from: 0,
|
|
64
|
+
to: l.value.state.doc.length,
|
|
65
|
+
insert: c(t.modelValue)
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
70
69
|
}
|
|
71
|
-
|
|
72
|
-
t.
|
|
73
|
-
}, S = (e) => {
|
|
74
|
-
y.value = !1, t.emitOnBlur && t.modelValue && h(e), u("blur", e);
|
|
70
|
+
const n = T(e);
|
|
71
|
+
t.handleFieldChange ? t.handleFieldChange(n) : s("update:modelValue", n);
|
|
75
72
|
}, g = (e) => {
|
|
76
|
-
|
|
77
|
-
},
|
|
73
|
+
t.handleFieldSubmit ? t.handleFieldSubmit(e) : s("submit", e);
|
|
74
|
+
}, S = (e) => {
|
|
75
|
+
h.value = !1, t.emitOnBlur && t.modelValue && g(e), s("blur", e);
|
|
76
|
+
}, p = (e) => {
|
|
77
|
+
s("update:modelValue", e);
|
|
78
|
+
}, W = () => {
|
|
78
79
|
const e = [...t.extensions];
|
|
79
|
-
return t.colorPicker && e.push(
|
|
80
|
-
},
|
|
81
|
-
() =>
|
|
80
|
+
return t.colorPicker && e.push(oe), e;
|
|
81
|
+
}, K = d(
|
|
82
|
+
() => ie({
|
|
82
83
|
environment: t.environment,
|
|
83
84
|
isReadOnly: t.layout === "modal"
|
|
84
85
|
})
|
|
85
|
-
),
|
|
86
|
-
...
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
]),
|
|
90
|
-
|
|
86
|
+
), L = d(() => [
|
|
87
|
+
...W(),
|
|
88
|
+
K.value,
|
|
89
|
+
se
|
|
90
|
+
]), P = u(null), c = (e) => typeof e == "object" ? JSON.stringify(e) : String(e ?? ""), T = (e) => {
|
|
91
|
+
const n = e.trim(), o = n.startsWith("[") || n.startsWith("{"), F = typeof t.modelValue;
|
|
92
|
+
if (Array.isArray(t.modelValue) && !o && n.includes(","))
|
|
93
|
+
return n.split(",").map((H) => H.trim());
|
|
94
|
+
if (o || F === "number" || F === "boolean")
|
|
95
|
+
try {
|
|
96
|
+
return JSON.parse(e);
|
|
97
|
+
} catch {
|
|
98
|
+
}
|
|
99
|
+
return e;
|
|
100
|
+
}, { codeMirror: l } = ne({
|
|
101
|
+
content: r(() => c(t.modelValue)),
|
|
91
102
|
onChange: (e) => {
|
|
92
|
-
|
|
103
|
+
E(e), J();
|
|
93
104
|
},
|
|
94
105
|
onFocus: () => {
|
|
95
|
-
|
|
106
|
+
h.value = !0;
|
|
96
107
|
},
|
|
97
108
|
onBlur: S,
|
|
98
|
-
codeMirrorRef:
|
|
109
|
+
codeMirrorRef: P,
|
|
99
110
|
disableTabIndent: r(() => t.disableTabIndent),
|
|
100
111
|
disableEnter: r(() => t.disableEnter),
|
|
101
112
|
disableCloseBrackets: r(() => t.disableCloseBrackets),
|
|
102
113
|
lineNumbers: r(() => t.lineNumbers),
|
|
103
114
|
language: r(() => t.language),
|
|
104
115
|
lint: r(() => t.lint),
|
|
105
|
-
extensions:
|
|
116
|
+
extensions: L,
|
|
106
117
|
placeholder: r(() => t.placeholder)
|
|
107
118
|
});
|
|
108
|
-
|
|
109
|
-
|
|
119
|
+
X(l, () => {
|
|
120
|
+
l.value && Object.hasOwn(x, "autofocus") && l.value.focus();
|
|
110
121
|
});
|
|
111
|
-
const
|
|
112
|
-
codeMirror:
|
|
113
|
-
query:
|
|
114
|
-
showDropdown:
|
|
122
|
+
const v = u(!1), A = u(""), D = u({ left: 0, top: 0 }), w = u(null), { handleDropdownSelect: j, updateDropdownVisibility: J } = le({
|
|
123
|
+
codeMirror: l,
|
|
124
|
+
query: A,
|
|
125
|
+
showDropdown: v,
|
|
115
126
|
dropdownPosition: D
|
|
116
|
-
}), U =
|
|
117
|
-
if (
|
|
118
|
-
e === "down" || e === "up" ? (
|
|
127
|
+
}), U = d(() => v.value && t.withVariables && t.layout !== "modal" && !!t.environment), m = (e, n) => {
|
|
128
|
+
if (v.value) {
|
|
129
|
+
e === "down" || e === "up" ? (n.preventDefault(), w.value?.handleArrowKey(e)) : e === "enter" && (n.preventDefault(), w.value?.handleSelect());
|
|
119
130
|
return;
|
|
120
131
|
}
|
|
121
|
-
e === "escape" && !t.disableTabIndent &&
|
|
132
|
+
e === "escape" && !t.disableTabIndent && n.stopPropagation(), e === "enter" && n.target instanceof HTMLDivElement && g(n.target.textContent ?? "");
|
|
122
133
|
};
|
|
123
|
-
return
|
|
134
|
+
return M({
|
|
124
135
|
/**
|
|
125
136
|
* Focus the codemirror element
|
|
126
137
|
*
|
|
127
138
|
* @param cursorAtEnd boolean place the cursor at the end of the input
|
|
128
139
|
*/
|
|
129
140
|
focus: (e) => {
|
|
130
|
-
if (!
|
|
141
|
+
if (!l.value || (l.value.focus(), !te(e)))
|
|
131
142
|
return;
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
selection: { anchor:
|
|
143
|
+
const n = e === "start" ? 0 : e === "end" ? l.value.state.doc.length : e;
|
|
144
|
+
l.value.dispatch({
|
|
145
|
+
selection: { anchor: n },
|
|
135
146
|
scrollIntoView: !0
|
|
136
147
|
});
|
|
137
148
|
},
|
|
138
|
-
isFocused:
|
|
139
|
-
handleChange:
|
|
140
|
-
handleSubmit:
|
|
149
|
+
isFocused: h,
|
|
150
|
+
handleChange: E,
|
|
151
|
+
handleSubmit: g,
|
|
141
152
|
handleBlur: S,
|
|
142
|
-
booleanOptions:
|
|
143
|
-
codeMirror:
|
|
153
|
+
booleanOptions: C,
|
|
154
|
+
codeMirror: l,
|
|
144
155
|
modelValue: t.modelValue,
|
|
145
|
-
cursorPosition: () =>
|
|
146
|
-
|
|
147
|
-
|
|
156
|
+
cursorPosition: () => l.value?.state.selection.main.head,
|
|
157
|
+
serializeValue: c,
|
|
158
|
+
deserializeValue: T
|
|
159
|
+
}), (e, n) => (a(), i(Y, null, [
|
|
160
|
+
e.disabled ? (a(), i("div", {
|
|
148
161
|
key: 0,
|
|
149
|
-
class:
|
|
162
|
+
class: Z(["text-c-2 flex cursor-default items-center justify-center", e.layout === "modal" ? "font-code pr-2 pl-1 text-base" : "px-2"]),
|
|
150
163
|
"data-testid": "code-input-disabled"
|
|
151
164
|
}, [
|
|
152
|
-
|
|
153
|
-
], 2)) : t.enum?.length ? (
|
|
165
|
+
V("span", ue, _(e.modelValue), 1)
|
|
166
|
+
], 2)) : t.enum?.length ? (a(), y(k, {
|
|
154
167
|
key: 1,
|
|
155
168
|
default: t.default,
|
|
156
169
|
modelValue: e.modelValue,
|
|
157
|
-
type:
|
|
170
|
+
type: z.value,
|
|
158
171
|
value: t.enum,
|
|
159
|
-
"onUpdate:modelValue":
|
|
160
|
-
}, null, 8, ["default", "modelValue", "type", "value"])) :
|
|
172
|
+
"onUpdate:modelValue": p
|
|
173
|
+
}, null, 8, ["default", "modelValue", "type", "value"])) : q.value ? (a(), y(k, {
|
|
161
174
|
key: 2,
|
|
162
175
|
default: t.default,
|
|
163
176
|
modelValue: e.modelValue,
|
|
164
|
-
value:
|
|
165
|
-
"onUpdate:modelValue":
|
|
166
|
-
}, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (
|
|
177
|
+
value: C.value,
|
|
178
|
+
"onUpdate:modelValue": p
|
|
179
|
+
}, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (a(), y(k, {
|
|
167
180
|
key: 3,
|
|
168
181
|
default: t.default,
|
|
169
182
|
modelValue: e.modelValue,
|
|
170
183
|
value: e.examples,
|
|
171
|
-
"onUpdate:modelValue":
|
|
172
|
-
}, null, 8, ["default", "modelValue", "value"])) : (
|
|
184
|
+
"onUpdate:modelValue": p
|
|
185
|
+
}, null, 8, ["default", "modelValue", "value"])) : (a(), i("div", ee({
|
|
173
186
|
key: 4,
|
|
174
|
-
id:
|
|
187
|
+
id: O(R)
|
|
175
188
|
}, e.$attrs, {
|
|
176
189
|
ref_key: "codeMirrorRef",
|
|
177
|
-
ref:
|
|
190
|
+
ref: P,
|
|
178
191
|
class: ["group/input group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden text-xs leading-[1.44] whitespace-nowrap -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline", {
|
|
179
192
|
"line-wrapping has-[:focus-visible]:bg-b-1 has-[:focus-visible]:absolute has-[:focus-visible]:z-1": e.lineWrapping,
|
|
180
193
|
"flow-code-input--error": e.error
|
|
181
194
|
}],
|
|
182
195
|
onKeydown: [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
196
|
+
n[0] || (n[0] = b($((o) => m("down", o), ["stop"]), ["down"])),
|
|
197
|
+
n[1] || (n[1] = b((o) => m("enter", o), ["enter"])),
|
|
198
|
+
n[2] || (n[2] = b((o) => m("escape", o), ["escape"])),
|
|
199
|
+
n[3] || (n[3] = b($((o) => m("up", o), ["stop"]), ["up"]))
|
|
187
200
|
]
|
|
188
201
|
}), [
|
|
189
|
-
e.disableTabIndent ? f("", !0) : (
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
202
|
+
e.disableTabIndent ? f("", !0) : (a(), i("div", fe, [...n[5] || (n[5] = [
|
|
203
|
+
B(" Press ", -1),
|
|
204
|
+
V("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
|
|
205
|
+
B(" then ", -1),
|
|
206
|
+
V("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Tab", -1),
|
|
207
|
+
B(" to exit ", -1)
|
|
195
208
|
])]))
|
|
196
|
-
], 16,
|
|
197
|
-
e.$slots.warning ? (
|
|
198
|
-
|
|
209
|
+
], 16, de)),
|
|
210
|
+
e.$slots.warning ? (a(), i("div", ce, [
|
|
211
|
+
I(e.$slots, "warning", {}, void 0, !0)
|
|
199
212
|
])) : f("", !0),
|
|
200
|
-
e.$slots.icon ? (
|
|
201
|
-
|
|
213
|
+
e.$slots.icon ? (a(), i("div", me, [
|
|
214
|
+
I(e.$slots, "icon", {}, void 0, !0)
|
|
202
215
|
])) : f("", !0),
|
|
203
|
-
e.required ? (
|
|
204
|
-
U.value && e.environment ? (
|
|
216
|
+
e.required ? (a(), i("div", ye, " Required ")) : f("", !0),
|
|
217
|
+
U.value && e.environment ? (a(), y(re, {
|
|
205
218
|
key: 8,
|
|
206
219
|
ref_key: "dropdownRef",
|
|
207
|
-
ref:
|
|
220
|
+
ref: w,
|
|
208
221
|
dropdownPosition: D.value,
|
|
209
222
|
environment: e.environment,
|
|
210
|
-
query:
|
|
211
|
-
onRedirect:
|
|
212
|
-
onSelect:
|
|
223
|
+
query: A.value,
|
|
224
|
+
onRedirect: n[4] || (n[4] = (o) => s("redirectToEnvironment")),
|
|
225
|
+
onSelect: O(j)
|
|
213
226
|
}, null, 8, ["dropdownPosition", "environment", "query", "onSelect"])) : f("", !0)
|
|
214
227
|
], 64));
|
|
215
228
|
}
|
|
216
229
|
});
|
|
217
230
|
export {
|
|
218
|
-
|
|
231
|
+
xe as default
|
|
219
232
|
};
|
|
@@ -6,7 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
/** Class for the wrapping cell because attrs is bound to the input */
|
|
7
7
|
containerClass?: VueClassProp | undefined;
|
|
8
8
|
required?: boolean;
|
|
9
|
-
modelValue: string
|
|
9
|
+
modelValue: string;
|
|
10
10
|
/** Allows adding a custom value to the enum dropdown, defaults to true */
|
|
11
11
|
canAddCustomEnumValue?: boolean;
|
|
12
12
|
readOnly?: boolean;
|
|
@@ -27,12 +27,12 @@ type __VLS_Slots = {} & {
|
|
|
27
27
|
};
|
|
28
28
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
29
29
|
selectVariable: (value: string) => any;
|
|
30
|
-
"update:modelValue": (v: string) => any;
|
|
30
|
+
"update:modelValue": (v: string | number) => any;
|
|
31
31
|
inputFocus: () => any;
|
|
32
32
|
inputBlur: () => any;
|
|
33
33
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
34
34
|
onSelectVariable?: ((value: string) => any) | undefined;
|
|
35
|
-
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
35
|
+
"onUpdate:modelValue"?: ((v: string | number) => any) | undefined;
|
|
36
36
|
onInputFocus?: (() => any) | undefined;
|
|
37
37
|
onInputBlur?: (() => any) | undefined;
|
|
38
38
|
}>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"names":[],"mappings":"AAuMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM/C,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,sEAAsE;IACtE,cAAc,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"names":[],"mappings":"AAuMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM/C,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,sEAAsE;IACtE,cAAc,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,0EAA0E;IAC1E,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,kBAAkB,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;AAgUJ,QAAA,IAAI,OAAO,IAAU,EAAuB,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACvF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAmC7C,QAAA,MAAM,eAAe;;;;;;;;;;;cAlXN,OAAO;cAIP,OAAO;kBAMH,OAAO;2BAPE,OAAO;6EAuXjC,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./DataTableInput.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-3157c3c7"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as b, ref as
|
|
1
|
+
import { defineComponent as b, ref as y, useTemplateRef as B, computed as $, createBlock as d, openBlock as n, normalizeClass as I, withCtx as O, createElementBlock as u, createCommentVNode as i, createElementVNode as S, renderSlot as p, createTextVNode as E, Fragment as h, mergeProps as c, unref as s } from "vue";
|
|
2
2
|
import { ScalarIconButton as v } from "@scalar/components";
|
|
3
|
-
import { ScalarIconX as
|
|
3
|
+
import { ScalarIconX as A, ScalarIconEye as T, ScalarIconEyeSlash as W } from "@scalar/icons";
|
|
4
4
|
import q from "./DataTableCell.vue.js";
|
|
5
5
|
import F from "./DataTableInputSelect.vue.js";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import N from "../code-input/CodeInput.vue.js";
|
|
7
|
+
const P = ["for"], D = { class: "relative flex min-w-0 flex-1" }, U = ["readOnly", "type", "value"], z = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "centered-y text-orange absolute right-7 text-xs"
|
|
10
10
|
}, J = /* @__PURE__ */ b({
|
|
@@ -27,48 +27,48 @@ const N = ["for"], P = { class: "relative flex min-w-0 flex-1" }, D = ["readOnly
|
|
|
27
27
|
},
|
|
28
28
|
emits: ["update:modelValue", "inputFocus", "inputBlur", "selectVariable"],
|
|
29
29
|
setup(V, { emit: w }) {
|
|
30
|
-
const a = V, t = w,
|
|
30
|
+
const a = V, t = w, r = y(!0), k = y(!1), m = B("codeInput"), g = () => !k.value && t("inputBlur"), f = $(
|
|
31
31
|
() => a.type === "password" ? "text" : a.type ?? "text"
|
|
32
32
|
), C = () => {
|
|
33
|
-
!a.enum?.length && !a.readOnly &&
|
|
33
|
+
!a.enum?.length && !a.readOnly && m.value?.focus();
|
|
34
34
|
};
|
|
35
35
|
return (e, l) => (n(), d(q, {
|
|
36
|
-
class:
|
|
36
|
+
class: I(["relative flex", e.containerClass])
|
|
37
37
|
}, {
|
|
38
|
-
default:
|
|
38
|
+
default: O(() => [
|
|
39
39
|
e.$slots.default ? (n(), u("div", {
|
|
40
40
|
key: 0,
|
|
41
41
|
class: "text-c-1 flex items-center pr-0 pl-3",
|
|
42
42
|
for: e.id ?? "",
|
|
43
43
|
onClick: C
|
|
44
44
|
}, [
|
|
45
|
-
|
|
46
|
-
l[6] || (l[6] =
|
|
47
|
-
], 8,
|
|
48
|
-
|
|
45
|
+
p(e.$slots, "default", {}, void 0, !0),
|
|
46
|
+
l[6] || (l[6] = E(": ", -1))
|
|
47
|
+
], 8, P)) : i("", !0),
|
|
48
|
+
S("div", D, [
|
|
49
49
|
a.enum && a.enum.length ? (n(), d(F, {
|
|
50
50
|
key: 0,
|
|
51
51
|
canAddCustomValue: a.canAddCustomEnumValue,
|
|
52
52
|
modelValue: a.modelValue,
|
|
53
53
|
value: a.enum,
|
|
54
54
|
"onUpdate:modelValue": l[0] || (l[0] = (o) => t("update:modelValue", o))
|
|
55
|
-
}, null, 8, ["canAddCustomValue", "modelValue", "value"])) : (n(), u(
|
|
56
|
-
|
|
55
|
+
}, null, 8, ["canAddCustomValue", "modelValue", "value"])) : (n(), u(h, { key: 1 }, [
|
|
56
|
+
r.value && e.type === "password" ? (n(), u("input", c({ key: 0 }, e.id ? { ...e.$attrs, id: e.id } : e.$attrs, {
|
|
57
57
|
autocomplete: "off",
|
|
58
58
|
class: ["text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1", { "scalar-password-input": e.type === "password" }],
|
|
59
59
|
"data-1p-ignore": "",
|
|
60
60
|
readOnly: e.readOnly,
|
|
61
61
|
spellcheck: "false",
|
|
62
|
-
type:
|
|
62
|
+
type: f.value,
|
|
63
63
|
value: e.modelValue,
|
|
64
64
|
onInput: l[1] || (l[1] = (o) => t(
|
|
65
65
|
"update:modelValue",
|
|
66
66
|
o.target.value ?? ""
|
|
67
67
|
))
|
|
68
|
-
}), null, 16,
|
|
68
|
+
}), null, 16, U)) : (n(), d(s(N), c({ key: 1 }, e.$attrs, {
|
|
69
69
|
id: e.id,
|
|
70
70
|
ref_key: "codeInput",
|
|
71
|
-
ref:
|
|
71
|
+
ref: m,
|
|
72
72
|
class: ["text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1", [
|
|
73
73
|
e.type === "password" && e.description && "pr-12",
|
|
74
74
|
e.description && "pr-8",
|
|
@@ -85,31 +85,31 @@ const N = ["for"], P = { class: "relative flex min-w-0 flex-1" }, D = ["readOnly
|
|
|
85
85
|
readOnly: e.readOnly,
|
|
86
86
|
required: !!e.required,
|
|
87
87
|
spellcheck: "false",
|
|
88
|
-
type:
|
|
88
|
+
type: f.value,
|
|
89
89
|
onBlur: g,
|
|
90
90
|
onFocus: l[2] || (l[2] = (o) => t("inputFocus")),
|
|
91
91
|
"onUpdate:modelValue": l[3] || (l[3] = (o) => t("update:modelValue", o))
|
|
92
92
|
}), null, 16, ["id", "class", "description", "environment", "lineWrapping", "max", "min", "modelValue", "readOnly", "required", "type"]))
|
|
93
93
|
], 64))
|
|
94
94
|
]),
|
|
95
|
-
e.$slots.warning ? (n(), u("div",
|
|
96
|
-
|
|
95
|
+
e.$slots.warning ? (n(), u("div", z, [
|
|
96
|
+
p(e.$slots, "warning", {}, void 0, !0)
|
|
97
97
|
])) : i("", !0),
|
|
98
|
-
|
|
99
|
-
e.modelValue ? (n(), d(
|
|
98
|
+
p(e.$slots, "icon", {}, void 0, !0),
|
|
99
|
+
e.modelValue ? (n(), d(s(v), {
|
|
100
100
|
key: 2,
|
|
101
101
|
class: "-ml-.25 h-6 w-6 self-center p-1.25",
|
|
102
|
-
icon:
|
|
102
|
+
icon: s(A),
|
|
103
103
|
label: "Clear Value",
|
|
104
104
|
onClick: l[4] || (l[4] = (o) => t("update:modelValue", ""))
|
|
105
105
|
}, null, 8, ["icon"])) : i("", !0),
|
|
106
|
-
e.type === "password" ? (n(), d(
|
|
106
|
+
e.type === "password" ? (n(), d(s(v), {
|
|
107
107
|
key: 3,
|
|
108
108
|
class: "-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25",
|
|
109
109
|
"data-testid": "data-table-password-toggle",
|
|
110
|
-
icon:
|
|
111
|
-
label:
|
|
112
|
-
onClick: l[5] || (l[5] = (o) =>
|
|
110
|
+
icon: r.value ? s(T) : s(W),
|
|
111
|
+
label: r.value ? "Show Password" : "Hide Password",
|
|
112
|
+
onClick: l[5] || (l[5] = (o) => r.value = !r.value)
|
|
113
113
|
}, null, 8, ["icon", "label"])) : i("", !0)
|
|
114
114
|
]),
|
|
115
115
|
_: 3
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { CodeInputModelValue } from '../../../v2/components/code-input/CodeInput.vue.js';
|
|
1
2
|
type __VLS_Props = {
|
|
2
|
-
modelValue:
|
|
3
|
+
modelValue: CodeInputModelValue;
|
|
3
4
|
value?: string[];
|
|
4
|
-
default?:
|
|
5
|
+
default?: CodeInputModelValue | undefined;
|
|
5
6
|
canAddCustomValue?: boolean;
|
|
6
7
|
type?: string | undefined;
|
|
7
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableInputSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInputSelect.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataTableInputSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInputSelect.vue"],"names":[],"mappings":"AA+LA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAA;AAEnF,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,mBAAmB,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAA;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAC;;;;;;uBAFoB,OAAO;;AA4Z/B,wBAQG"}
|