@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.
Files changed (87) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
  4. package/dist/v2/blocks/operation-block/helpers/build-request.js +46 -51
  5. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts +9 -0
  6. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts.map +1 -0
  7. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +7 -0
  8. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  9. package/dist/v2/blocks/operation-block/helpers/get-example.js +12 -10
  10. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts +3 -0
  11. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts.map +1 -0
  12. package/dist/v2/blocks/operation-block/helpers/get-server-url.js +12 -0
  13. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  15. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +87 -65
  16. package/dist/v2/components/code-input/CodeInput.vue.d.ts +115 -144
  17. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  18. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  19. package/dist/v2/components/code-input/CodeInput.vue2.js +120 -107
  20. package/dist/v2/components/data-table/DataTableInput.vue.d.ts +3 -3
  21. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  22. package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
  23. package/dist/v2/components/data-table/DataTableInput.vue2.js +27 -27
  24. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +3 -2
  25. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  26. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +42 -39
  27. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -3
  28. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  29. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +5 -3
  30. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  31. package/dist/v2/components/sidebar/SidebarMenu.vue.js +25 -30
  32. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  33. package/dist/v2/features/app/App.vue.js +89 -141
  34. package/dist/v2/features/app/app-events.d.ts +22 -0
  35. package/dist/v2/features/app/app-events.d.ts.map +1 -0
  36. package/dist/v2/features/app/app-events.js +136 -0
  37. package/dist/v2/features/app/app-state.d.ts +135 -0
  38. package/dist/v2/features/app/app-state.d.ts.map +1 -0
  39. package/dist/v2/features/app/app-state.js +316 -0
  40. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +6 -3
  41. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  42. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  43. package/dist/v2/features/app/components/AppSidebar.vue2.js +4 -4
  44. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +4 -2
  45. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  46. package/dist/v2/features/app/components/DesktopTabs.vue.js +25 -22
  47. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +9 -5
  48. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  49. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +62 -1
  50. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  51. package/dist/v2/features/app/helpers/create-api-client-app.js +14 -10
  52. package/dist/v2/features/app/helpers/routes.d.ts +5 -2
  53. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  54. package/dist/v2/features/collection/WorkspaceCollection.vue.js +7 -7
  55. package/dist/v2/features/collection/components/Form.vue.d.ts +1 -1
  56. package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
  57. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  58. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  59. package/dist/v2/features/modal/Modal.vue.js +2 -2
  60. package/dist/v2/features/modal/Modal.vue2.js +40 -41
  61. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  62. package/dist/v2/features/operation/Operation.vue.js +38 -28
  63. package/dist/v2/features/operation/helpers/combine-params.d.ts +4 -0
  64. package/dist/v2/features/operation/helpers/combine-params.d.ts.map +1 -0
  65. package/dist/v2/features/operation/helpers/combine-params.js +13 -0
  66. package/dist/v2/features/operation/index.d.ts +1 -0
  67. package/dist/v2/features/operation/index.d.ts.map +1 -1
  68. package/dist/v2/features/operation/index.js +10 -8
  69. package/dist/v2/helpers/get-tab-details.d.ts +2 -2
  70. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
  71. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  72. package/package.json +16 -16
  73. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts +0 -40
  74. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +0 -1
  75. package/dist/v2/features/app/hooks/use-app-sidebar.js +0 -134
  76. package/dist/v2/features/app/hooks/use-sync-path.d.ts +0 -11
  77. package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +0 -1
  78. package/dist/v2/features/app/hooks/use-sync-path.js +0 -52
  79. package/dist/v2/features/app/hooks/use-tabs.d.ts +0 -31
  80. package/dist/v2/features/app/hooks/use-tabs.d.ts.map +0 -1
  81. package/dist/v2/features/app/hooks/use-tabs.js +0 -44
  82. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts +0 -18
  83. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +0 -1
  84. package/dist/v2/features/app/hooks/use-workspace-client-app-events.js +0 -156
  85. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts +0 -28
  86. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +0 -1
  87. package/dist/v2/features/app/hooks/use-workspace-selector.js +0 -81
@@ -1,30 +1,30 @@
1
- import { defineComponent as W, useAttrs as j, ref as d, computed as s, toRef as r, watch as H, createElementBlock as i, openBlock as o, Fragment as Q, createBlock as c, createCommentVNode as f, normalizeClass as G, createElementVNode as w, toDisplayString as J, mergeProps as X, unref as F, withKeys as b, withModifiers as T, createTextVNode as V, renderSlot as $ } from "vue";
2
- import { isDefined as Y } from "@scalar/helpers/array/is-defined";
3
- import { useCodeMirror as Z, useDropdown as _, colorPicker as ee } from "@scalar/use-codemirror";
4
- import { nanoid as te } from "nanoid";
5
- import B from "../data-table/DataTableInputSelect.vue.js";
6
- import le from "../../features/environments/components/EnvironmentVariablesDropdown.vue.js";
7
- import { pillPlugin as ne, backspaceCommand as oe } from "./code-variable-widget.js";
8
- const ae = { class: "whitespace-nowrap" }, re = ["id"], ie = {
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
- }, ue = {
12
+ }, ce = {
13
13
  key: 5,
14
14
  class: "centered-y text-orange absolute right-7 text-xs"
15
- }, de = {
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
- }, se = {
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
- }, fe = {
21
+ }, be = {
22
22
  inheritAttrs: !1
23
- }, ve = /* @__PURE__ */ W({
24
- ...fe,
23
+ }, xe = /* @__PURE__ */ Q({
24
+ ...be,
25
25
  __name: "CodeInput",
26
26
  props: {
27
- modelValue: { type: [String, Number, Boolean] },
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: { type: [String, Number, Boolean] },
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: I, emit: M }) {
57
- const u = M, k = j(), N = k.id || `id-${te()}`, y = d(!1), R = s(() => t.enum?.length ? !1 : t.type === "boolean" || Array.isArray(t.type) && t.type.includes("boolean")), x = s(() => t.nullable ? ["true", "false", "null"] : ["true", "false"]), q = s(() => Array.isArray(t.type) ? t.type.find((e) => e !== "null") ?? "string" : t.type), C = (e) => {
58
- if (!(!t.alwaysEmitChange && e === t.modelValue)) {
59
- if (t.importCurl && e.trim().toLowerCase().startsWith("curl")) {
60
- u("curl", e), n.value && n.value.dispatch({
61
- changes: {
62
- from: 0,
63
- to: n.value.state.doc.length,
64
- insert: String(t.modelValue)
65
- }
66
- });
67
- return;
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
- }, h = (e) => {
72
- t.handleFieldSubmit ? t.handleFieldSubmit(e) : u("submit", e);
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
- u("update:modelValue", e);
77
- }, A = () => {
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(ee), e;
80
- }, O = s(
81
- () => ne({
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
- ), z = s(() => [
86
- ...A(),
87
- O.value,
88
- oe
89
- ]), E = d(null), { codeMirror: n } = Z({
90
- content: r(() => String(t.modelValue ?? "")),
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
- C(e), L();
103
+ E(e), J();
93
104
  },
94
105
  onFocus: () => {
95
- y.value = !0;
106
+ h.value = !0;
96
107
  },
97
108
  onBlur: S,
98
- codeMirrorRef: E,
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: z,
116
+ extensions: L,
106
117
  placeholder: r(() => t.placeholder)
107
118
  });
108
- H(n, () => {
109
- n.value && Object.hasOwn(k, "autofocus") && n.value.focus();
119
+ X(l, () => {
120
+ l.value && Object.hasOwn(x, "autofocus") && l.value.focus();
110
121
  });
111
- const p = d(!1), P = d(""), D = d({ left: 0, top: 0 }), v = d(null), { handleDropdownSelect: K, updateDropdownVisibility: L } = _({
112
- codeMirror: n,
113
- query: P,
114
- showDropdown: p,
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 = s(() => p.value && t.withVariables && t.layout !== "modal" && !!t.environment), m = (e, l) => {
117
- if (p.value) {
118
- e === "down" || e === "up" ? (l.preventDefault(), v.value?.handleArrowKey(e)) : e === "enter" && (l.preventDefault(), v.value?.handleSelect());
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 && l.stopPropagation(), e === "enter" && l.target instanceof HTMLDivElement && h(l.target.textContent ?? "");
132
+ e === "escape" && !t.disableTabIndent && n.stopPropagation(), e === "enter" && n.target instanceof HTMLDivElement && g(n.target.textContent ?? "");
122
133
  };
123
- return I({
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 (!n.value || (n.value.focus(), !Y(e)))
141
+ if (!l.value || (l.value.focus(), !te(e)))
131
142
  return;
132
- const l = e === "start" ? 0 : e === "end" ? n.value.state.doc.length : e;
133
- n.value.dispatch({
134
- selection: { anchor: l },
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: y,
139
- handleChange: C,
140
- handleSubmit: h,
149
+ isFocused: h,
150
+ handleChange: E,
151
+ handleSubmit: g,
141
152
  handleBlur: S,
142
- booleanOptions: x,
143
- codeMirror: n,
153
+ booleanOptions: C,
154
+ codeMirror: l,
144
155
  modelValue: t.modelValue,
145
- cursorPosition: () => n.value?.state.selection.main.head
146
- }), (e, l) => (o(), i(Q, null, [
147
- e.disabled ? (o(), i("div", {
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: G(["text-c-2 flex cursor-default items-center justify-center", e.layout === "modal" ? "font-code pr-2 pl-1 text-base" : "px-2"]),
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
- w("span", ae, J(e.modelValue), 1)
153
- ], 2)) : t.enum?.length ? (o(), c(B, {
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: q.value,
170
+ type: z.value,
158
171
  value: t.enum,
159
- "onUpdate:modelValue": g
160
- }, null, 8, ["default", "modelValue", "type", "value"])) : R.value ? (o(), c(B, {
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: x.value,
165
- "onUpdate:modelValue": g
166
- }, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (o(), c(B, {
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": g
172
- }, null, 8, ["default", "modelValue", "value"])) : (o(), i("div", X({
184
+ "onUpdate:modelValue": p
185
+ }, null, 8, ["default", "modelValue", "value"])) : (a(), i("div", ee({
173
186
  key: 4,
174
- id: F(N)
187
+ id: O(R)
175
188
  }, e.$attrs, {
176
189
  ref_key: "codeMirrorRef",
177
- ref: E,
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
- l[0] || (l[0] = b(T((a) => m("down", a), ["stop"]), ["down"])),
184
- l[1] || (l[1] = b((a) => m("enter", a), ["enter"])),
185
- l[2] || (l[2] = b((a) => m("escape", a), ["escape"])),
186
- l[3] || (l[3] = b(T((a) => m("up", a), ["stop"]), ["up"]))
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) : (o(), i("div", ie, [...l[5] || (l[5] = [
190
- V(" Press ", -1),
191
- w("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
192
- V(" then ", -1),
193
- w("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Tab", -1),
194
- V(" to exit ", -1)
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, re)),
197
- e.$slots.warning ? (o(), i("div", ue, [
198
- $(e.$slots, "warning", {}, void 0, !0)
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 ? (o(), i("div", de, [
201
- $(e.$slots, "icon", {}, void 0, !0)
213
+ e.$slots.icon ? (a(), i("div", me, [
214
+ I(e.$slots, "icon", {}, void 0, !0)
202
215
  ])) : f("", !0),
203
- e.required ? (o(), i("div", se, " Required ")) : f("", !0),
204
- U.value && e.environment ? (o(), c(le, {
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: v,
220
+ ref: w,
208
221
  dropdownPosition: D.value,
209
222
  environment: e.environment,
210
- query: P.value,
211
- onRedirect: l[4] || (l[4] = (a) => u("redirectToEnvironment")),
212
- onSelect: F(K)
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
- ve as default
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 | number;
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,GAAG,MAAM,CAAA;IAC3B,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;AAoUJ,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;AAoC7C,QAAA,MAAM,eAAe;;;;;;;;;;;cAvXN,OAAO;cAIP,OAAO;kBAMH,OAAO;2BAPE,OAAO;6EA4XjC,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
+ {"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 e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-d6948ce7"]]);
4
+ const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-3157c3c7"]]);
5
5
  export {
6
- e as default
6
+ c as default
7
7
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as b, ref as p, computed as B, createBlock as d, openBlock as n, normalizeClass as $, withCtx as I, createElementBlock as u, createCommentVNode as i, createElementVNode as O, renderSlot as m, createTextVNode as S, Fragment as E, mergeProps as c, unref as r } from "vue";
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 h, ScalarIconEye as A, ScalarIconEyeSlash as W } from "@scalar/icons";
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 T from "../code-input/CodeInput.vue.js";
7
- const N = ["for"], P = { class: "relative flex min-w-0 flex-1" }, D = ["readOnly", "type", "value"], U = {
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, s = p(!0), k = p(!1), f = p(null), g = () => !k.value && t("inputBlur"), y = B(
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 && f.value?.focus();
33
+ !a.enum?.length && !a.readOnly && m.value?.focus();
34
34
  };
35
35
  return (e, l) => (n(), d(q, {
36
- class: $(["relative flex", e.containerClass])
36
+ class: I(["relative flex", e.containerClass])
37
37
  }, {
38
- default: I(() => [
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
- m(e.$slots, "default", {}, void 0, !0),
46
- l[6] || (l[6] = S(": ", -1))
47
- ], 8, N)) : i("", !0),
48
- O("div", P, [
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(E, { key: 1 }, [
56
- s.value && e.type === "password" ? (n(), u("input", c({ key: 0 }, e.id ? { ...e.$attrs, id: e.id } : e.$attrs, {
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: y.value,
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, D)) : (n(), d(r(T), c({ key: 1 }, e.$attrs, {
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: f,
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: y.value,
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", U, [
96
- m(e.$slots, "warning", {}, void 0, !0)
95
+ e.$slots.warning ? (n(), u("div", z, [
96
+ p(e.$slots, "warning", {}, void 0, !0)
97
97
  ])) : i("", !0),
98
- m(e.$slots, "icon", {}, void 0, !0),
99
- e.modelValue ? (n(), d(r(v), {
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: r(h),
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(r(v), {
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: s.value ? r(A) : r(W),
111
- label: s.value ? "Show Password" : "Hide Password",
112
- onClick: l[5] || (l[5] = (o) => s.value = !s.value)
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: string | number | boolean;
3
+ modelValue: CodeInputModelValue;
3
4
  value?: string[];
4
- default?: string | number | boolean | undefined;
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":"AA4LA,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;IACrC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IAC/C,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAC;;;;;;uBAFoB,OAAO;;AA2Z/B,wBAQG"}
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"}