@scalar/api-client 3.19.2 → 3.20.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 (409) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  3. package/dist/components/SectionFilter.vue.d.ts +2 -0
  4. package/dist/components/SectionFilter.vue.d.ts.map +1 -1
  5. package/dist/components/SectionFilter.vue.js +1 -1
  6. package/dist/components/SectionFilter.vue.js.map +1 -1
  7. package/dist/components/SectionFilter.vue.script.js +11 -8
  8. package/dist/components/SectionFilter.vue.script.js.map +1 -1
  9. package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -1
  10. package/dist/components/Server/ServerVariablesSelect.vue.js.map +1 -1
  11. package/dist/components/Server/ServerVariablesSelect.vue.script.js +5 -3
  12. package/dist/components/Server/ServerVariablesSelect.vue.script.js.map +1 -1
  13. package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -1
  14. package/dist/components/Server/ServerVariablesTextbox.vue.js.map +1 -1
  15. package/dist/components/Server/ServerVariablesTextbox.vue.script.js +6 -3
  16. package/dist/components/Server/ServerVariablesTextbox.vue.script.js.map +1 -1
  17. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
  18. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js.map +1 -1
  19. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js +4 -2
  20. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js.map +1 -1
  21. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  22. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js.map +1 -1
  23. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js +3 -1
  24. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js.map +1 -1
  25. package/dist/style.css +159 -135
  26. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +10 -1
  27. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  28. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  29. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +46 -5
  30. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  31. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -0
  32. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  33. package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
  34. package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
  35. package/dist/v2/blocks/operation-block/components/Header.vue.script.js +15 -8
  36. package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
  37. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +1 -1
  39. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js.map +1 -1
  40. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js +4 -2
  41. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js.map +1 -1
  42. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  43. package/dist/v2/blocks/operation-block/helpers/send-request.js +4 -3
  44. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  45. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +2 -0
  46. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  47. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  48. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  49. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +51 -26
  50. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  51. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  52. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  53. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  54. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +28 -8
  55. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  56. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -1
  57. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js.map +1 -1
  58. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +9 -3
  59. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -1
  60. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.d.ts.map +1 -1
  61. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.js.map +1 -1
  62. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js +6 -4
  63. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js.map +1 -1
  64. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  65. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  66. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +3 -1
  67. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  68. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  69. package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
  70. package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js +7 -5
  71. package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js.map +1 -1
  72. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -2
  73. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  74. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  75. package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
  76. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +40 -7
  77. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
  78. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +12 -12
  79. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  80. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  81. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +24 -20
  82. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  83. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  84. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
  85. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js +6 -4
  86. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
  87. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts.map +1 -1
  88. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +1 -1
  89. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
  90. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
  91. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +5 -4
  92. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
  93. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +2 -0
  94. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  95. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  96. package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
  97. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +37 -13
  98. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
  99. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts +3 -3
  100. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
  101. package/dist/v2/blocks/response-block/components/Headers.vue.js.map +1 -1
  102. package/dist/v2/blocks/response-block/components/Headers.vue.script.js +5 -3
  103. package/dist/v2/blocks/response-block/components/Headers.vue.script.js.map +1 -1
  104. package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts.map +1 -1
  105. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
  106. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
  107. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +3 -1
  108. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
  109. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js.map +1 -1
  111. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js +11 -3
  112. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js.map +1 -1
  113. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts.map +1 -1
  114. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +1 -1
  115. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js.map +1 -1
  116. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js +8 -6
  117. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js.map +1 -1
  118. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts +1 -0
  119. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  120. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js.map +1 -1
  121. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js +109 -56
  122. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js.map +1 -1
  123. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.d.ts.map +1 -1
  124. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js.map +1 -1
  125. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js +5 -3
  126. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js.map +1 -1
  127. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.d.ts.map +1 -1
  128. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.js.map +1 -1
  129. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js +6 -3
  130. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js.map +1 -1
  131. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.d.ts.map +1 -1
  132. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js.map +1 -1
  133. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js +7 -5
  134. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js.map +1 -1
  135. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +4 -2
  136. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  137. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  138. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js.map +1 -1
  139. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js +22 -14
  140. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js.map +1 -1
  141. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  142. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +1 -1
  143. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js.map +1 -1
  144. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js +4 -2
  145. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js.map +1 -1
  146. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts.map +1 -1
  147. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js.map +1 -1
  148. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js +11 -6
  149. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js.map +1 -1
  150. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.d.ts +4 -0
  151. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.d.ts.map +1 -0
  152. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.js +100 -0
  153. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.js.map +1 -0
  154. package/dist/v2/blocks/response-block/helpers/response-stream.d.ts +13 -0
  155. package/dist/v2/blocks/response-block/helpers/response-stream.d.ts.map +1 -0
  156. package/dist/v2/blocks/response-block/helpers/response-stream.js +97 -0
  157. package/dist/v2/blocks/response-block/helpers/response-stream.js.map +1 -0
  158. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +3 -1
  159. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  160. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  161. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  162. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +42 -29
  163. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  164. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +6 -6
  165. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  166. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
  167. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
  168. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +7 -4
  169. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
  170. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  171. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js.map +1 -1
  172. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +21 -16
  173. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
  174. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  175. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  176. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +7 -5
  177. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  178. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +1 -1
  179. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js.map +1 -1
  180. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js +7 -5
  181. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js.map +1 -1
  182. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  183. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  184. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +105 -40
  185. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  186. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
  187. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js.map +1 -1
  188. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js +10 -8
  189. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js.map +1 -1
  190. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  191. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js.map +1 -1
  192. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js +14 -9
  193. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
  194. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
  195. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
  196. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js +6 -4
  197. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
  198. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  199. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  200. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js +3 -1
  201. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  202. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  203. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  204. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +40 -40
  205. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  206. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts +108 -7
  207. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts.map +1 -1
  208. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +12 -0
  209. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js.map +1 -1
  210. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  211. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.d.ts.map +1 -1
  212. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +8 -5
  213. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -1
  214. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +2 -0
  215. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -1
  216. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +2 -0
  217. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
  218. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts +3 -0
  219. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts.map +1 -0
  220. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js +8 -0
  221. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js.map +1 -0
  222. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.d.ts +3 -0
  223. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.d.ts.map +1 -0
  224. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.js +11 -0
  225. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.js.map +1 -0
  226. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts +19 -0
  227. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts.map +1 -0
  228. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +117 -0
  229. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js.map +1 -0
  230. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -1
  231. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  232. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +15 -11
  233. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  234. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.d.ts +1 -1
  235. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.d.ts.map +1 -1
  236. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js +8 -1
  237. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js.map +1 -1
  238. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -1
  239. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +6 -0
  240. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
  241. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -1
  242. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  243. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +8 -6
  244. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
  245. package/dist/v2/components/code-input/CodeInput.vue.d.ts +4 -4
  246. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  247. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  248. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  249. package/dist/v2/components/code-input/CodeInput.vue.script.js +10 -10
  250. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  251. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts +4 -4
  252. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
  253. package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
  254. package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
  255. package/dist/v2/components/code-input/CodeInputLite.vue.script.js +8 -5
  256. package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
  257. package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts +4 -0
  258. package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts.map +1 -1
  259. package/dist/v2/components/code-input/PillTooltipHost.vue.js.map +1 -1
  260. package/dist/v2/components/code-input/PillTooltipHost.vue.script.js +7 -3
  261. package/dist/v2/components/code-input/PillTooltipHost.vue.script.js.map +1 -1
  262. package/dist/v2/components/code-input/code-variable-widget.d.ts +3 -0
  263. package/dist/v2/components/code-input/code-variable-widget.d.ts.map +1 -1
  264. package/dist/v2/components/code-input/code-variable-widget.js +6 -3
  265. package/dist/v2/components/code-input/code-variable-widget.js.map +1 -1
  266. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +0 -1
  267. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  268. package/dist/v2/components/data-table/DataTableCheckbox.vue.js.map +1 -1
  269. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js +4 -2
  270. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js.map +1 -1
  271. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  272. package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
  273. package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
  274. package/dist/v2/components/data-table/DataTableInput.vue.script.js +5 -3
  275. package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
  276. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  277. package/dist/v2/components/data-table/DataTableInputSelect.vue.js.map +1 -1
  278. package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js +12 -9
  279. package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js.map +1 -1
  280. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
  281. package/dist/v2/components/forms/ConfirmationForm.vue.js.map +1 -1
  282. package/dist/v2/components/forms/ConfirmationForm.vue.script.js +5 -3
  283. package/dist/v2/components/forms/ConfirmationForm.vue.script.js.map +1 -1
  284. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -1
  285. package/dist/v2/components/layout/CollapsibleSection.vue.js.map +1 -1
  286. package/dist/v2/components/layout/CollapsibleSection.vue.script.js +3 -1
  287. package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
  288. package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -1
  289. package/dist/v2/components/modals/DeleteModal.vue.js.map +1 -1
  290. package/dist/v2/components/modals/DeleteModal.vue.script.js +3 -1
  291. package/dist/v2/components/modals/DeleteModal.vue.script.js.map +1 -1
  292. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
  293. package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
  294. package/dist/v2/components/modals/ModalClientContainer.vue.js.map +1 -1
  295. package/dist/v2/components/modals/ModalClientContainer.vue.script.js +5 -2
  296. package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
  297. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  298. package/dist/v2/components/server/ServerDropdown.vue.js.map +1 -1
  299. package/dist/v2/components/server/ServerDropdown.vue.script.js +9 -5
  300. package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
  301. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  302. package/dist/v2/components/sidebar/Sidebar.vue.js.map +1 -1
  303. package/dist/v2/components/sidebar/Sidebar.vue.script.js +4 -2
  304. package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
  305. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  306. package/dist/v2/components/sidebar/SidebarMenu.vue.js.map +1 -1
  307. package/dist/v2/components/sidebar/SidebarMenu.vue.script.js +4 -2
  308. package/dist/v2/components/sidebar/SidebarMenu.vue.script.js.map +1 -1
  309. package/dist/v2/components/sidebar/SidebarToggle.vue.d.ts.map +1 -1
  310. package/dist/v2/components/sidebar/SidebarToggle.vue.js.map +1 -1
  311. package/dist/v2/components/sidebar/SidebarToggle.vue.script.js +4 -2
  312. package/dist/v2/components/sidebar/SidebarToggle.vue.script.js.map +1 -1
  313. package/dist/v2/constants.js +1 -1
  314. package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts.map +1 -1
  315. package/dist/v2/features/command-palette/components/CommandActionForm.vue.js.map +1 -1
  316. package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js +4 -2
  317. package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js.map +1 -1
  318. package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts +2 -2
  319. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  320. package/dist/v2/features/environments/EnvironmentsList.vue.js.map +1 -1
  321. package/dist/v2/features/environments/EnvironmentsList.vue.script.js +4 -2
  322. package/dist/v2/features/environments/EnvironmentsList.vue.script.js.map +1 -1
  323. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  324. package/dist/v2/features/environments/components/Environment.vue.js.map +1 -1
  325. package/dist/v2/features/environments/components/Environment.vue.script.js +12 -10
  326. package/dist/v2/features/environments/components/Environment.vue.script.js.map +1 -1
  327. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
  328. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js.map +1 -1
  329. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js +5 -3
  330. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js.map +1 -1
  331. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
  332. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js.map +1 -1
  333. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js +9 -6
  334. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js.map +1 -1
  335. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  336. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  337. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +6 -4
  338. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  339. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
  340. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +1 -1
  341. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js.map +1 -1
  342. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js +22 -10
  343. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js.map +1 -1
  344. package/dist/v2/features/localization/index.d.ts +18 -0
  345. package/dist/v2/features/localization/index.d.ts.map +1 -0
  346. package/dist/v2/features/localization/index.js +35 -0
  347. package/dist/v2/features/localization/index.js.map +1 -0
  348. package/dist/v2/features/localization/locales/ar.d.ts +385 -0
  349. package/dist/v2/features/localization/locales/ar.d.ts.map +1 -0
  350. package/dist/v2/features/localization/locales/ar.js +345 -0
  351. package/dist/v2/features/localization/locales/ar.js.map +1 -0
  352. package/dist/v2/features/localization/locales/de.d.ts +385 -0
  353. package/dist/v2/features/localization/locales/de.d.ts.map +1 -0
  354. package/dist/v2/features/localization/locales/de.js +345 -0
  355. package/dist/v2/features/localization/locales/de.js.map +1 -0
  356. package/dist/v2/features/localization/locales/es.d.ts +385 -0
  357. package/dist/v2/features/localization/locales/es.d.ts.map +1 -0
  358. package/dist/v2/features/localization/locales/es.js +345 -0
  359. package/dist/v2/features/localization/locales/es.js.map +1 -0
  360. package/dist/v2/features/localization/locales/fr.d.ts +385 -0
  361. package/dist/v2/features/localization/locales/fr.d.ts.map +1 -0
  362. package/dist/v2/features/localization/locales/fr.js +345 -0
  363. package/dist/v2/features/localization/locales/fr.js.map +1 -0
  364. package/dist/v2/features/localization/locales/pt.d.ts +385 -0
  365. package/dist/v2/features/localization/locales/pt.d.ts.map +1 -0
  366. package/dist/v2/features/localization/locales/pt.js +345 -0
  367. package/dist/v2/features/localization/locales/pt.js.map +1 -0
  368. package/dist/v2/features/localization/locales/ru.d.ts +385 -0
  369. package/dist/v2/features/localization/locales/ru.d.ts.map +1 -0
  370. package/dist/v2/features/localization/locales/ru.js +345 -0
  371. package/dist/v2/features/localization/locales/ru.js.map +1 -0
  372. package/dist/v2/features/localization/locales/zh-cn.d.ts +385 -0
  373. package/dist/v2/features/localization/locales/zh-cn.d.ts.map +1 -0
  374. package/dist/v2/features/localization/locales/zh-cn.js +345 -0
  375. package/dist/v2/features/localization/locales/zh-cn.js.map +1 -0
  376. package/dist/v2/features/localization/translations.d.ts +385 -0
  377. package/dist/v2/features/localization/translations.d.ts.map +1 -0
  378. package/dist/v2/features/localization/translations.js +345 -0
  379. package/dist/v2/features/localization/translations.js.map +1 -0
  380. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  381. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  382. package/dist/v2/features/modal/Modal.vue.script.js +17 -4
  383. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  384. package/dist/v2/features/modal/use-lazy-api-client.d.ts +11 -0
  385. package/dist/v2/features/modal/use-lazy-api-client.d.ts.map +1 -0
  386. package/dist/v2/features/modal/use-lazy-api-client.js +48 -0
  387. package/dist/v2/features/modal/use-lazy-api-client.js.map +1 -0
  388. package/dist/v2/features/operation/Operation.vue.d.ts +2 -0
  389. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  390. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  391. package/dist/v2/features/operation/Operation.vue.script.js +50 -12
  392. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  393. package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts.map +1 -1
  394. package/dist/v2/features/search/components/DocumentSearchModal.vue.js +1 -1
  395. package/dist/v2/features/search/components/DocumentSearchModal.vue.js.map +1 -1
  396. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js +12 -8
  397. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -1
  398. package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +1 -1
  399. package/dist/v2/features/search/components/SearchResult.vue.js.map +1 -1
  400. package/dist/v2/features/search/components/SearchResult.vue.script.js +14 -10
  401. package/dist/v2/features/search/components/SearchResult.vue.script.js.map +1 -1
  402. package/dist/v2/types/options.d.ts +1 -1
  403. package/dist/v2/types/options.d.ts.map +1 -1
  404. package/dist/v2/workspace-events.d.ts +2 -2
  405. package/dist/v2/workspace-events.d.ts.map +1 -1
  406. package/dist/v2/workspace-events.js +8 -1
  407. package/dist/v2/workspace-events.js.map +1 -1
  408. package/dist/vue-styles.css +124 -125
  409. package/package.json +22 -11
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import DataTableInput_vue_vue_type_script_setup_true_lang_default from "./DataTableInput.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/v2/components/data-table/DataTableInput.vue
5
- var DataTableInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(DataTableInput_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a6f4752a"]]);
5
+ var DataTableInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(DataTableInput_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-135d11b9"]]);
6
6
  //#endregion
7
7
  export { DataTableInput_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableInput.vue.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconEye, ScalarIconEyeSlash, ScalarIconX } from '@scalar/icons'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, ref, useTemplateRef } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { CodeInputLite } from '@/v2/components/code-input'\n\nimport DataTableCell from './DataTableCell.vue'\nimport DataTableInputSelect from './DataTableInputSelect.vue'\n\nconst props = withDefaults(\n defineProps<{\n id?: string\n type?: string | undefined\n /** Class for the wrapping cell because attrs is bound to the input */\n containerClass?: VueClassProp | undefined\n required?: boolean\n modelValue: string\n /** Allows adding a custom value to the enum dropdown, defaults to true */\n canAddCustomEnumValue?: boolean\n readOnly?: boolean\n enum?: string[]\n environment: XScalarEnvironment\n description?: string | undefined\n /** Whether to show context function suggestions like $guid, $timestamp. Defaults to true */\n withFakeData?: boolean\n }>(),\n {\n canAddCustomEnumValue: true,\n required: false,\n readOnly: false,\n withFakeData: true,\n },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string | number): void\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\nconst mask = ref(true)\nconst interactingWithDropdown = ref(false)\nconst codeInput = useTemplateRef('codeInput')\n\nconst handleBlur = () => !interactingWithDropdown.value && emit('inputBlur')\n\nconst inputType = computed(() =>\n props.type === 'password' ? 'text' : (props.type ?? 'text'),\n)\n\n// If not an enum nor read only, focus the code input\nconst handleLabelClick = () => {\n if (!props.enum?.length && !props.readOnly) {\n codeInput.value?.focus()\n }\n}\n</script>\n<template>\n <DataTableCell\n class=\"relative flex\"\n :class=\"containerClass\">\n <div\n v-if=\"$slots.default\"\n class=\"text-c-1 flex items-center pr-0 pl-3\"\n :for=\"id ?? ''\"\n @click=\"handleLabelClick\">\n <slot />:\n </div>\n <div class=\"relative flex min-w-0 flex-1\">\n <template v-if=\"props.enum && props.enum.length\">\n <DataTableInputSelect\n :canAddCustomValue=\"props.canAddCustomEnumValue\"\n :modelValue=\"props.modelValue\"\n :value=\"props.enum\"\n @update:modelValue=\"emit('update:modelValue', $event)\" />\n </template>\n <template v-else>\n <input\n v-if=\"mask && type === 'password'\"\n v-bind=\"id ? { ...$attrs, id: id } : $attrs\"\n autocomplete=\"off\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1\"\n :class=\"{ 'scalar-password-input': type === 'password' }\"\n data-1p-ignore\n :readOnly=\"readOnly\"\n spellcheck=\"false\"\n :type=\"inputType\"\n :value=\"modelValue\"\n @input=\"\n emit(\n 'update:modelValue',\n ($event.target as HTMLInputElement).value ?? '',\n )\n \" />\n <CodeInputLite\n v-else\n v-bind=\"$attrs\"\n :id=\"id\"\n ref=\"codeInput\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1\"\n :class=\"[\n type === 'password' && description && 'pr-12',\n description && 'pr-8',\n type === 'password' && 'scalar-password-input',\n ]\"\n :environment=\"environment\"\n :modelValue=\"modelValue ?? ''\"\n :readOnly=\"readOnly\"\n :required=\"Boolean(required)\"\n :type=\"inputType\"\n :withFakeData=\"withFakeData\"\n @blur=\"handleBlur\"\n @focus=\"emit('inputFocus')\"\n @update:modelValue=\"(value) => emit('update:modelValue', value)\" />\n </template>\n </div>\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n <slot name=\"icon\" />\n <!-- Clear -->\n <ScalarIconButton\n v-if=\"modelValue\"\n class=\"-ml-.25 h-6 w-6 self-center p-1.25\"\n :icon=\"ScalarIconX\"\n label=\"Clear Value\"\n @click=\"emit('update:modelValue', '')\" />\n <!-- Toggle Visibility -->\n <ScalarIconButton\n v-if=\"type === 'password'\"\n class=\"-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25\"\n data-testid=\"data-table-password-toggle\"\n :icon=\"mask ? ScalarIconEye : ScalarIconEyeSlash\"\n :label=\"mask ? 'Show Password' : 'Hide Password'\"\n @click=\"mask = !mask\" />\n </DataTableCell>\n</template>\n\n<style scoped>\n:deep(.code-input-lite__editor) {\n background-color: transparent;\n font-family: var(--scalar-font);\n font-size: var(--scalar-small);\n padding: 5px 8px;\n}\n:deep(.scalar-pill:not(:last-of-type)) {\n margin-right: 0.15em;\n}\n:deep(.scalar-pill:not(:first-of-type)) {\n margin-left: 0.5px;\n}\n.required::after {\n content: 'Required';\n}\n/* Tailwind placeholder is busted */\ninput::placeholder {\n color: var(--scalar-color-3);\n}\n/* we want our inputs to look like a password input but not be one */\n.scalar-password-input {\n text-security: disc;\n -webkit-text-security: disc;\n -moz-text-security: disc;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"DataTableInput.vue.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconEye, ScalarIconEyeSlash, ScalarIconX } from '@scalar/icons'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, ref, useTemplateRef } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport DataTableCell from './DataTableCell.vue'\nimport DataTableInputSelect from './DataTableInputSelect.vue'\n\nconst props = withDefaults(\n defineProps<{\n id?: string\n type?: string | undefined\n /** Class for the wrapping cell because attrs is bound to the input */\n containerClass?: VueClassProp | undefined\n required?: boolean\n modelValue: string\n /** Allows adding a custom value to the enum dropdown, defaults to true */\n canAddCustomEnumValue?: boolean\n readOnly?: boolean\n enum?: string[]\n environment: XScalarEnvironment\n description?: string | undefined\n /** Whether to show context function suggestions like $guid, $timestamp. Defaults to true */\n withFakeData?: boolean\n }>(),\n {\n canAddCustomEnumValue: true,\n required: false,\n readOnly: false,\n withFakeData: true,\n },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string | number): void\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\ndefineOptions({ inheritAttrs: false })\n\nconst mask = ref(true)\nconst interactingWithDropdown = ref(false)\nconst codeInput = useTemplateRef('codeInput')\n\nconst handleBlur = () => !interactingWithDropdown.value && emit('inputBlur')\n\nconst inputType = computed(() =>\n props.type === 'password' ? 'text' : (props.type ?? 'text'),\n)\n\n// If not an enum nor read only, focus the code input\nconst handleLabelClick = () => {\n if (!props.enum?.length && !props.readOnly) {\n codeInput.value?.focus()\n }\n}\n</script>\n<template>\n <DataTableCell\n class=\"relative flex\"\n :class=\"containerClass\">\n <div\n v-if=\"$slots.default\"\n class=\"text-c-1 flex items-center pr-0 pl-3\"\n :for=\"id ?? ''\"\n @click=\"handleLabelClick\">\n <slot />:\n </div>\n <div class=\"relative flex min-w-0 flex-1\">\n <template v-if=\"props.enum && props.enum.length\">\n <DataTableInputSelect\n :canAddCustomValue=\"props.canAddCustomEnumValue\"\n :modelValue=\"props.modelValue\"\n :value=\"props.enum\"\n @update:modelValue=\"emit('update:modelValue', $event)\" />\n </template>\n <template v-else>\n <input\n v-if=\"mask && type === 'password'\"\n v-bind=\"id ? { ...$attrs, id: id } : $attrs\"\n autocomplete=\"off\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1\"\n :class=\"{ 'scalar-password-input': type === 'password' }\"\n data-1p-ignore\n :readOnly=\"readOnly\"\n spellcheck=\"false\"\n :type=\"inputType\"\n :value=\"modelValue\"\n @input=\"\n emit(\n 'update:modelValue',\n ($event.target as HTMLInputElement).value ?? '',\n )\n \" />\n <CodeInputLite\n v-else\n v-bind=\"$attrs\"\n :id=\"id\"\n ref=\"codeInput\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1\"\n :class=\"[\n type === 'password' && description && 'pr-12',\n description && 'pr-8',\n type === 'password' && 'scalar-password-input',\n ]\"\n :environment=\"environment\"\n :modelValue=\"modelValue ?? ''\"\n :readOnly=\"readOnly\"\n :required=\"Boolean(required)\"\n :type=\"inputType\"\n :withFakeData=\"withFakeData\"\n @blur=\"handleBlur\"\n @focus=\"emit('inputFocus')\"\n @update:modelValue=\"(value) => emit('update:modelValue', value)\" />\n </template>\n </div>\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n <slot name=\"icon\" />\n <!-- Clear -->\n <ScalarIconButton\n v-if=\"modelValue\"\n class=\"-ml-.25 h-6 w-6 self-center p-1.25\"\n :icon=\"ScalarIconX\"\n :label=\"translate('apiClient.dataTableInput.clearValue')\"\n @click=\"emit('update:modelValue', '')\" />\n <!-- Toggle Visibility -->\n <ScalarIconButton\n v-if=\"type === 'password'\"\n class=\"-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25\"\n data-testid=\"data-table-password-toggle\"\n :icon=\"mask ? ScalarIconEye : ScalarIconEyeSlash\"\n :label=\"\n mask\n ? translate('apiClient.dataTableInput.showPassword')\n : translate('apiClient.dataTableInput.hidePassword')\n \"\n @click=\"mask = !mask\" />\n </DataTableCell>\n</template>\n\n<style scoped>\n:deep(.code-input-lite__editor) {\n background-color: transparent;\n font-family: var(--scalar-font);\n font-size: var(--scalar-small);\n padding: 5px 8px;\n}\n:deep(.scalar-pill:not(:last-of-type)) {\n margin-right: 0.15em;\n}\n:deep(.scalar-pill:not(:first-of-type)) {\n margin-left: 0.5px;\n}\n/* Tailwind placeholder is busted */\ninput::placeholder {\n color: var(--scalar-color-3);\n}\n/* we want our inputs to look like a password input but not be one */\n.scalar-password-input {\n text-security: disc;\n -webkit-text-security: disc;\n -moz-text-security: disc;\n}\n</style>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../features/localization/index.js";
1
2
  import DataTableInputSelect_default from "./DataTableInputSelect.vue.js";
2
3
  import CodeInputLite_default from "../code-input/CodeInputLite.vue.js";
3
4
  import DataTableCell_default from "./DataTableCell.vue.js";
@@ -53,6 +54,7 @@ var DataTableInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
53
54
  setup(__props, { emit: __emit }) {
54
55
  const props = __props;
55
56
  const emit = __emit;
57
+ const { translate } = useLocalization();
56
58
  const mask = ref(true);
57
59
  const interactingWithDropdown = ref(false);
58
60
  const codeInput = useTemplateRef("codeInput");
@@ -126,15 +128,15 @@ var DataTableInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
126
128
  key: 2,
127
129
  class: "-ml-.25 h-6 w-6 self-center p-1.25",
128
130
  icon: unref(ScalarIconX),
129
- label: "Clear Value",
131
+ label: unref(translate)("apiClient.dataTableInput.clearValue"),
130
132
  onClick: _cache[4] || (_cache[4] = ($event) => emit("update:modelValue", ""))
131
- }, null, 8, ["icon"])) : createCommentVNode("", true),
133
+ }, null, 8, ["icon", "label"])) : createCommentVNode("", true),
132
134
  __props.type === "password" ? (openBlock(), createBlock(unref(ScalarIconButton), {
133
135
  key: 3,
134
136
  class: "-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25",
135
137
  "data-testid": "data-table-password-toggle",
136
138
  icon: mask.value ? unref(ScalarIconEye) : unref(ScalarIconEyeSlash),
137
- label: mask.value ? "Show Password" : "Hide Password",
139
+ label: mask.value ? unref(translate)("apiClient.dataTableInput.showPassword") : unref(translate)("apiClient.dataTableInput.hidePassword"),
138
140
  onClick: _cache[5] || (_cache[5] = ($event) => mask.value = !mask.value)
139
141
  }, null, 8, ["icon", "label"])) : createCommentVNode("", true)
140
142
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableInput.vue.script.js","names":["$slots","$attrs"],"sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconEye, ScalarIconEyeSlash, ScalarIconX } from '@scalar/icons'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, ref, useTemplateRef } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { CodeInputLite } from '@/v2/components/code-input'\n\nimport DataTableCell from './DataTableCell.vue'\nimport DataTableInputSelect from './DataTableInputSelect.vue'\n\nconst props = withDefaults(\n defineProps<{\n id?: string\n type?: string | undefined\n /** Class for the wrapping cell because attrs is bound to the input */\n containerClass?: VueClassProp | undefined\n required?: boolean\n modelValue: string\n /** Allows adding a custom value to the enum dropdown, defaults to true */\n canAddCustomEnumValue?: boolean\n readOnly?: boolean\n enum?: string[]\n environment: XScalarEnvironment\n description?: string | undefined\n /** Whether to show context function suggestions like $guid, $timestamp. Defaults to true */\n withFakeData?: boolean\n }>(),\n {\n canAddCustomEnumValue: true,\n required: false,\n readOnly: false,\n withFakeData: true,\n },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string | number): void\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\nconst mask = ref(true)\nconst interactingWithDropdown = ref(false)\nconst codeInput = useTemplateRef('codeInput')\n\nconst handleBlur = () => !interactingWithDropdown.value && emit('inputBlur')\n\nconst inputType = computed(() =>\n props.type === 'password' ? 'text' : (props.type ?? 'text'),\n)\n\n// If not an enum nor read only, focus the code input\nconst handleLabelClick = () => {\n if (!props.enum?.length && !props.readOnly) {\n codeInput.value?.focus()\n }\n}\n</script>\n<template>\n <DataTableCell\n class=\"relative flex\"\n :class=\"containerClass\">\n <div\n v-if=\"$slots.default\"\n class=\"text-c-1 flex items-center pr-0 pl-3\"\n :for=\"id ?? ''\"\n @click=\"handleLabelClick\">\n <slot />:\n </div>\n <div class=\"relative flex min-w-0 flex-1\">\n <template v-if=\"props.enum && props.enum.length\">\n <DataTableInputSelect\n :canAddCustomValue=\"props.canAddCustomEnumValue\"\n :modelValue=\"props.modelValue\"\n :value=\"props.enum\"\n @update:modelValue=\"emit('update:modelValue', $event)\" />\n </template>\n <template v-else>\n <input\n v-if=\"mask && type === 'password'\"\n v-bind=\"id ? { ...$attrs, id: id } : $attrs\"\n autocomplete=\"off\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1\"\n :class=\"{ 'scalar-password-input': type === 'password' }\"\n data-1p-ignore\n :readOnly=\"readOnly\"\n spellcheck=\"false\"\n :type=\"inputType\"\n :value=\"modelValue\"\n @input=\"\n emit(\n 'update:modelValue',\n ($event.target as HTMLInputElement).value ?? '',\n )\n \" />\n <CodeInputLite\n v-else\n v-bind=\"$attrs\"\n :id=\"id\"\n ref=\"codeInput\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1\"\n :class=\"[\n type === 'password' && description && 'pr-12',\n description && 'pr-8',\n type === 'password' && 'scalar-password-input',\n ]\"\n :environment=\"environment\"\n :modelValue=\"modelValue ?? ''\"\n :readOnly=\"readOnly\"\n :required=\"Boolean(required)\"\n :type=\"inputType\"\n :withFakeData=\"withFakeData\"\n @blur=\"handleBlur\"\n @focus=\"emit('inputFocus')\"\n @update:modelValue=\"(value) => emit('update:modelValue', value)\" />\n </template>\n </div>\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n <slot name=\"icon\" />\n <!-- Clear -->\n <ScalarIconButton\n v-if=\"modelValue\"\n class=\"-ml-.25 h-6 w-6 self-center p-1.25\"\n :icon=\"ScalarIconX\"\n label=\"Clear Value\"\n @click=\"emit('update:modelValue', '')\" />\n <!-- Toggle Visibility -->\n <ScalarIconButton\n v-if=\"type === 'password'\"\n class=\"-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25\"\n data-testid=\"data-table-password-toggle\"\n :icon=\"mask ? ScalarIconEye : ScalarIconEyeSlash\"\n :label=\"mask ? 'Show Password' : 'Hide Password'\"\n @click=\"mask = !mask\" />\n </DataTableCell>\n</template>\n\n<style scoped>\n:deep(.code-input-lite__editor) {\n background-color: transparent;\n font-family: var(--scalar-font);\n font-size: var(--scalar-small);\n padding: 5px 8px;\n}\n:deep(.scalar-pill:not(:last-of-type)) {\n margin-right: 0.15em;\n}\n:deep(.scalar-pill:not(:first-of-type)) {\n margin-left: 0.5px;\n}\n.required::after {\n content: 'Required';\n}\n/* Tailwind placeholder is busted */\ninput::placeholder {\n color: var(--scalar-color-3);\n}\n/* we want our inputs to look like a password input but not be one */\n.scalar-password-input {\n text-security: disc;\n -webkit-text-security: disc;\n -moz-text-security: disc;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYA,MAAM,QAAQ;EAyBd,MAAM,OAAO;EASb,MAAM,OAAO,IAAI,IAAI;EACrB,MAAM,0BAA0B,IAAI,KAAK;EACzC,MAAM,YAAY,eAAe,WAAW;EAE5C,MAAM,mBAAmB,CAAC,wBAAwB,SAAS,KAAK,WAAW;EAE3E,MAAM,YAAY,eAChB,MAAM,SAAS,aAAa,SAAU,MAAM,QAAQ,MACtD;EAGA,MAAM,yBAAyB;GAC7B,IAAI,CAAC,MAAM,MAAM,UAAU,CAAC,MAAM,UAChC,UAAU,OAAO,MAAM;EAE3B;;uBAGE,YA+EgB,uBAAA,EA9Ed,OAAK,eAAA,CAAC,iBACE,QAAA,cAAc,CAAA,EAAA,GAAA;2BAOhB;KALEA,KAAAA,OAAO,WAAA,UAAA,GADf,mBAMM,OAAA;;MAJJ,OAAM;MACL,KAAK,QAAA,MAAE;MACP,SAAO;SACR,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,IAAA,GAAA,OAAA,OAAA,OAAA,KAAA,gBAAA,MACV,EAAA,EAAA,GAAA,GAAA,UAAA,KAAA,mBAAA,IAAA,IAAA;KACA,mBA+CM,OA/CN,YA+CM,CA9C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A,GAAA,KAAA,GAAA,IAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;KAEzB,WAAoB,KAAA,QAAA,QAAA,CAAA,GAAA,KAAA,GAAA,IAAA;KAGZ,QAAA,cAAA,UAAA,GADR,YAK2C,MAAA,gBAAA,GAAA;;MAHzC,OAAM;MACL,MAAM,MAAA,WAAA;MACP,OAAM;MACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,qBAAA,EAAA;;KAGN,QAAA,SAAI,cAAA,UAAA,GADZ,YAM0B,MAAA,gBAAA,GAAA;;MAJxB,OAAM;MACN,eAAY;MACX,MAAM,KAAA,QAAO,MAAA,aAAA,IAAgB,MAAA,kBAAA;MAC7B,OAAO,KAAA,QAAI,kBAAA;MACX,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAA,QAAI,CAAI,KAAA"}
1
+ {"version":3,"file":"DataTableInput.vue.script.js","names":["$slots","$attrs"],"sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconEye, ScalarIconEyeSlash, ScalarIconX } from '@scalar/icons'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, ref, useTemplateRef } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport DataTableCell from './DataTableCell.vue'\nimport DataTableInputSelect from './DataTableInputSelect.vue'\n\nconst props = withDefaults(\n defineProps<{\n id?: string\n type?: string | undefined\n /** Class for the wrapping cell because attrs is bound to the input */\n containerClass?: VueClassProp | undefined\n required?: boolean\n modelValue: string\n /** Allows adding a custom value to the enum dropdown, defaults to true */\n canAddCustomEnumValue?: boolean\n readOnly?: boolean\n enum?: string[]\n environment: XScalarEnvironment\n description?: string | undefined\n /** Whether to show context function suggestions like $guid, $timestamp. Defaults to true */\n withFakeData?: boolean\n }>(),\n {\n canAddCustomEnumValue: true,\n required: false,\n readOnly: false,\n withFakeData: true,\n },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string | number): void\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\ndefineOptions({ inheritAttrs: false })\n\nconst mask = ref(true)\nconst interactingWithDropdown = ref(false)\nconst codeInput = useTemplateRef('codeInput')\n\nconst handleBlur = () => !interactingWithDropdown.value && emit('inputBlur')\n\nconst inputType = computed(() =>\n props.type === 'password' ? 'text' : (props.type ?? 'text'),\n)\n\n// If not an enum nor read only, focus the code input\nconst handleLabelClick = () => {\n if (!props.enum?.length && !props.readOnly) {\n codeInput.value?.focus()\n }\n}\n</script>\n<template>\n <DataTableCell\n class=\"relative flex\"\n :class=\"containerClass\">\n <div\n v-if=\"$slots.default\"\n class=\"text-c-1 flex items-center pr-0 pl-3\"\n :for=\"id ?? ''\"\n @click=\"handleLabelClick\">\n <slot />:\n </div>\n <div class=\"relative flex min-w-0 flex-1\">\n <template v-if=\"props.enum && props.enum.length\">\n <DataTableInputSelect\n :canAddCustomValue=\"props.canAddCustomEnumValue\"\n :modelValue=\"props.modelValue\"\n :value=\"props.enum\"\n @update:modelValue=\"emit('update:modelValue', $event)\" />\n </template>\n <template v-else>\n <input\n v-if=\"mask && type === 'password'\"\n v-bind=\"id ? { ...$attrs, id: id } : $attrs\"\n autocomplete=\"off\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1\"\n :class=\"{ 'scalar-password-input': type === 'password' }\"\n data-1p-ignore\n :readOnly=\"readOnly\"\n spellcheck=\"false\"\n :type=\"inputType\"\n :value=\"modelValue\"\n @input=\"\n emit(\n 'update:modelValue',\n ($event.target as HTMLInputElement).value ?? '',\n )\n \" />\n <CodeInputLite\n v-else\n v-bind=\"$attrs\"\n :id=\"id\"\n ref=\"codeInput\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1\"\n :class=\"[\n type === 'password' && description && 'pr-12',\n description && 'pr-8',\n type === 'password' && 'scalar-password-input',\n ]\"\n :environment=\"environment\"\n :modelValue=\"modelValue ?? ''\"\n :readOnly=\"readOnly\"\n :required=\"Boolean(required)\"\n :type=\"inputType\"\n :withFakeData=\"withFakeData\"\n @blur=\"handleBlur\"\n @focus=\"emit('inputFocus')\"\n @update:modelValue=\"(value) => emit('update:modelValue', value)\" />\n </template>\n </div>\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n <slot name=\"icon\" />\n <!-- Clear -->\n <ScalarIconButton\n v-if=\"modelValue\"\n class=\"-ml-.25 h-6 w-6 self-center p-1.25\"\n :icon=\"ScalarIconX\"\n :label=\"translate('apiClient.dataTableInput.clearValue')\"\n @click=\"emit('update:modelValue', '')\" />\n <!-- Toggle Visibility -->\n <ScalarIconButton\n v-if=\"type === 'password'\"\n class=\"-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25\"\n data-testid=\"data-table-password-toggle\"\n :icon=\"mask ? ScalarIconEye : ScalarIconEyeSlash\"\n :label=\"\n mask\n ? translate('apiClient.dataTableInput.showPassword')\n : translate('apiClient.dataTableInput.hidePassword')\n \"\n @click=\"mask = !mask\" />\n </DataTableCell>\n</template>\n\n<style scoped>\n:deep(.code-input-lite__editor) {\n background-color: transparent;\n font-family: var(--scalar-font);\n font-size: var(--scalar-small);\n padding: 5px 8px;\n}\n:deep(.scalar-pill:not(:last-of-type)) {\n margin-right: 0.15em;\n}\n:deep(.scalar-pill:not(:first-of-type)) {\n margin-left: 0.5px;\n}\n/* Tailwind placeholder is busted */\ninput::placeholder {\n color: var(--scalar-color-3);\n}\n/* we want our inputs to look like a password input but not be one */\n.scalar-password-input {\n text-security: disc;\n -webkit-text-security: disc;\n -moz-text-security: disc;\n}\n</style>\n"],"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,OAAM;MACN,eAAY;MACX,MAAM,KAAA,QAAO,MAAA,aAAA,IAAgB,MAAA,kBAAA;MAC7B,OAAgB,KAAA,QAAiB,MAAA,SAAA,CAAS,CAAA,uCAAA,IAAsD,MAAA,SAAA,CAAS,CAAA,uCAAA;MAKzG,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAA,QAAI,CAAI,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableInputSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInputSelect.vue"],"names":[],"mappings":"AAgMA,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;AAobJ,QAAA,MAAM,YAAY;;;;;uBAtbM,OAAO;6EA0b7B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"DataTableInputSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInputSelect.vue"],"names":[],"mappings":"AAqMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAA;AAGnF,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;AA0bJ,QAAA,MAAM,YAAY;;;;;uBA5bM,OAAO;6EAgc7B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableInputSelect.vue.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableInputSelect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarComboboxMultiselect } from '@scalar/components/combobox'\nimport {\n ScalarDropdown,\n ScalarDropdownDivider,\n ScalarDropdownItem,\n} from '@scalar/components/dropdown'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport type { CodeInputModelValue } from '@/v2/components/code-input/CodeInput.vue'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: CodeInputModelValue\n value?: string[]\n default?: CodeInputModelValue | undefined\n canAddCustomValue?: boolean\n type?: string | undefined\n }>(),\n { canAddCustomValue: true },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string): void\n}>()\n\nconst options = computed(() => props.value ?? [])\nconst addingCustomValue = ref(false)\nconst customValue = ref('')\nconst inputRef = ref<HTMLInputElement | null>(null)\n\nwatch(customValue, (newValue) => {\n emit('update:modelValue', newValue)\n})\n\nconst updateSelected = (value: string) => {\n emit('update:modelValue', value)\n addingCustomValue.value = false\n}\n\nconst addCustomValue = () => {\n if (customValue.value.trim()) {\n updateSelected(customValue.value)\n }\n}\n\nconst handleBlur = () => {\n if (!customValue.value.trim()) {\n emit('update:modelValue', '')\n }\n addingCustomValue.value = false\n}\n\nconst isSelected = (value: string) => {\n return props.modelValue.toString() === value\n}\n\nwatch(addingCustomValue, (newValue) => {\n if (newValue) {\n nextTick(() => {\n inputRef.value?.focus()\n })\n }\n})\n\nconst initialValue = computed(() => {\n return props.modelValue !== undefined ? props.modelValue : props.default\n})\n\n/** Options for the array type */\nconst arrayOptions = computed(() =>\n options.value.map((option) => {\n const id = option.toString()\n return { id: id, label: id, value: id }\n }),\n)\n\n/** Filter the options by what is selected */\nconst selectedArrayOptions = computed(() => {\n const selectedValues = new Set(props.modelValue.toString().split(','))\n return arrayOptions.value.filter((option) => selectedValues.has(option.id))\n})\n\n/** Update the model value when the selected options change */\nconst updateSelectedOptions = (selectedOptions: any) => {\n const selectedValues = selectedOptions.map((option: any) => option.value)\n emit('update:modelValue', selectedValues.join(','))\n}\n</script>\n\n<template>\n <div\n class=\"group-[.alert]:outline-orange group-[.error]:outline-red w-full pr-10 -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline\">\n <template v-if=\"type === 'array'\">\n <ScalarComboboxMultiselect\n :modelValue=\"selectedArrayOptions\"\n :options=\"arrayOptions\"\n @update:modelValue=\"updateSelectedOptions\">\n <ScalarButton\n class=\"custom-scroll h-full justify-start gap-1.5 px-2 py-1.5 pr-6 font-normal outline-none\"\n fullWidth\n variant=\"ghost\">\n <span class=\"text-c-1 whitespace-nowrap\">{{\n selectedArrayOptions.length > 0\n ? selectedArrayOptions.map((option) => option.label).join(', ')\n : 'Select a value'\n }}</span>\n <ScalarIcon\n class=\"min-w-4\"\n icon=\"ChevronDown\"\n size=\"md\" />\n </ScalarButton>\n </ScalarComboboxMultiselect>\n </template>\n <template v-else-if=\"addingCustomValue\">\n <input\n ref=\"inputRef\"\n v-model=\"customValue\"\n class=\"text-c-1 w-full min-w-0 border-none px-2 py-1.5 outline-none\"\n placeholder=\"Value\"\n type=\"text\"\n @blur=\"handleBlur\"\n @keyup.enter=\"addCustomValue\" />\n </template>\n <template v-else>\n <ScalarDropdown\n resize\n :value=\"initialValue\">\n <ScalarButton\n class=\"size-full justify-start gap-1.5 overflow-auto px-2 py-1.5 font-normal whitespace-nowrap outline-none\"\n variant=\"ghost\">\n <span class=\"text-c-1 overflow-hidden text-ellipsis\">{{\n initialValue ?? 'Select a value'\n }}</span>\n <ScalarIcon\n icon=\"ChevronDown\"\n size=\"md\" />\n </ScalarButton>\n <template #items>\n <ScalarDropdownItem\n v-for=\"option in options\"\n :key=\"option\"\n class=\"group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap\"\n :value=\"option\"\n @click=\"updateSelected(option)\">\n <div\n class=\"flex h-4 w-4 items-center justify-center rounded-full p-[3px]\"\n :class=\"\n isSelected(option)\n ? 'bg-c-accent text-b-1'\n : 'shadow-border text-transparent'\n \">\n <ScalarIcon\n class=\"size-2.5\"\n icon=\"Checkmark\"\n thickness=\"3\" />\n </div>\n <span class=\"overflow-hidden text-ellipsis\">{{ option }}</span>\n </ScalarDropdownItem>\n <template v-if=\"canAddCustomValue\">\n <ScalarDropdownDivider v-if=\"options.length\" />\n <ScalarDropdownItem\n class=\"flex items-center gap-1.5\"\n @click=\"addingCustomValue = true\">\n <div class=\"flex h-4 w-4 items-center justify-center\">\n <ScalarIcon\n icon=\"Add\"\n size=\"sm\" />\n </div>\n <span>Add value</span>\n </ScalarDropdownItem>\n </template>\n </template>\n </ScalarDropdown>\n </template>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"DataTableInputSelect.vue.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableInputSelect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarComboboxMultiselect } from '@scalar/components/combobox'\nimport {\n ScalarDropdown,\n ScalarDropdownDivider,\n ScalarDropdownItem,\n} from '@scalar/components/dropdown'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport type { CodeInputModelValue } from '@/v2/components/code-input/CodeInput.vue'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: CodeInputModelValue\n value?: string[]\n default?: CodeInputModelValue | undefined\n canAddCustomValue?: boolean\n type?: string | undefined\n }>(),\n { canAddCustomValue: true },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst options = computed(() => props.value ?? [])\nconst addingCustomValue = ref(false)\nconst customValue = ref('')\nconst inputRef = ref<HTMLInputElement | null>(null)\n\nwatch(customValue, (newValue) => {\n emit('update:modelValue', newValue)\n})\n\nconst updateSelected = (value: string) => {\n emit('update:modelValue', value)\n addingCustomValue.value = false\n}\n\nconst addCustomValue = () => {\n if (customValue.value.trim()) {\n updateSelected(customValue.value)\n }\n}\n\nconst handleBlur = () => {\n if (!customValue.value.trim()) {\n emit('update:modelValue', '')\n }\n addingCustomValue.value = false\n}\n\nconst isSelected = (value: string) => {\n return props.modelValue.toString() === value\n}\n\nwatch(addingCustomValue, (newValue) => {\n if (newValue) {\n nextTick(() => {\n inputRef.value?.focus()\n })\n }\n})\n\nconst initialValue = computed(() => {\n return props.modelValue !== undefined ? props.modelValue : props.default\n})\n\n/** Options for the array type */\nconst arrayOptions = computed(() =>\n options.value.map((option) => {\n const id = option.toString()\n return { id: id, label: id, value: id }\n }),\n)\n\n/** Filter the options by what is selected */\nconst selectedArrayOptions = computed(() => {\n const selectedValues = new Set(props.modelValue.toString().split(','))\n return arrayOptions.value.filter((option) => selectedValues.has(option.id))\n})\n\n/** Update the model value when the selected options change */\nconst updateSelectedOptions = (selectedOptions: any) => {\n const selectedValues = selectedOptions.map((option: any) => option.value)\n emit('update:modelValue', selectedValues.join(','))\n}\n</script>\n\n<template>\n <div\n class=\"group-[.alert]:outline-orange group-[.error]:outline-red w-full pr-10 -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline\">\n <template v-if=\"type === 'array'\">\n <ScalarComboboxMultiselect\n :modelValue=\"selectedArrayOptions\"\n :options=\"arrayOptions\"\n @update:modelValue=\"updateSelectedOptions\">\n <ScalarButton\n class=\"custom-scroll h-full justify-start gap-1.5 px-2 py-1.5 pr-6 font-normal outline-none\"\n fullWidth\n variant=\"ghost\">\n <span class=\"text-c-1 whitespace-nowrap\">{{\n selectedArrayOptions.length > 0\n ? selectedArrayOptions.map((option) => option.label).join(', ')\n : 'Select a value'\n }}</span>\n <ScalarIcon\n class=\"min-w-4\"\n icon=\"ChevronDown\"\n size=\"md\" />\n </ScalarButton>\n </ScalarComboboxMultiselect>\n </template>\n <template v-else-if=\"addingCustomValue\">\n <input\n ref=\"inputRef\"\n v-model=\"customValue\"\n class=\"text-c-1 w-full min-w-0 border-none px-2 py-1.5 outline-none\"\n :placeholder=\"translate('apiClient.dataTableInputSelect.value')\"\n type=\"text\"\n @blur=\"handleBlur\"\n @keyup.enter=\"addCustomValue\" />\n </template>\n <template v-else>\n <ScalarDropdown\n resize\n :value=\"initialValue\">\n <ScalarButton\n class=\"size-full justify-start gap-1.5 overflow-auto px-2 py-1.5 font-normal whitespace-nowrap outline-none\"\n variant=\"ghost\">\n <span class=\"text-c-1 overflow-hidden text-ellipsis\">{{\n initialValue ?? 'Select a value'\n }}</span>\n <ScalarIcon\n icon=\"ChevronDown\"\n size=\"md\" />\n </ScalarButton>\n <template #items>\n <ScalarDropdownItem\n v-for=\"option in options\"\n :key=\"option\"\n class=\"group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap\"\n :value=\"option\"\n @click=\"updateSelected(option)\">\n <div\n class=\"flex h-4 w-4 items-center justify-center rounded-full p-[3px]\"\n :class=\"\n isSelected(option)\n ? 'bg-c-accent text-b-1'\n : 'shadow-border text-transparent'\n \">\n <ScalarIcon\n class=\"size-2.5\"\n icon=\"Checkmark\"\n thickness=\"3\" />\n </div>\n <span class=\"overflow-hidden text-ellipsis\">{{ option }}</span>\n </ScalarDropdownItem>\n <template v-if=\"canAddCustomValue\">\n <ScalarDropdownDivider v-if=\"options.length\" />\n <ScalarDropdownItem\n class=\"flex items-center gap-1.5\"\n @click=\"addingCustomValue = true\">\n <div class=\"flex h-4 w-4 items-center justify-center\">\n <ScalarIcon\n icon=\"Add\"\n size=\"sm\" />\n </div>\n <span>{{\n translate('apiClient.dataTableInputSelect.addValue')\n }}</span>\n </ScalarDropdownItem>\n </template>\n </template>\n </ScalarDropdown>\n </template>\n </div>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../features/localization/index.js";
1
2
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, vModelText, watch, withCtx, withDirectives, withKeys } from "vue";
2
3
  import { ScalarButton } from "@scalar/components/button";
3
4
  import { ScalarIcon } from "@scalar/components/icon";
@@ -6,9 +7,10 @@ import { ScalarDropdown, ScalarDropdownDivider, ScalarDropdownItem } from "@scal
6
7
  //#region src/v2/components/data-table/DataTableInputSelect.vue?vue&type=script&setup=true&lang.ts
7
8
  var _hoisted_1 = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-full pr-10 -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline" };
8
9
  var _hoisted_2 = { class: "text-c-1 whitespace-nowrap" };
9
- var _hoisted_3 = { class: "text-c-1 overflow-hidden text-ellipsis" };
10
- var _hoisted_4 = { class: "overflow-hidden text-ellipsis" };
11
- var _hoisted_5 = { class: "flex h-4 w-4 items-center justify-center" };
10
+ var _hoisted_3 = ["placeholder"];
11
+ var _hoisted_4 = { class: "text-c-1 overflow-hidden text-ellipsis" };
12
+ var _hoisted_5 = { class: "overflow-hidden text-ellipsis" };
13
+ var _hoisted_6 = { class: "flex h-4 w-4 items-center justify-center" };
12
14
  var DataTableInputSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
13
15
  __name: "DataTableInputSelect",
14
16
  props: {
@@ -37,6 +39,7 @@ var DataTableInputSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE
37
39
  setup(__props, { emit: __emit }) {
38
40
  const props = __props;
39
41
  const emit = __emit;
42
+ const { translate } = useLocalization();
40
43
  const options = computed(() => props.value ?? []);
41
44
  const addingCustomValue = ref(false);
42
45
  const customValue = ref("");
@@ -111,11 +114,11 @@ var DataTableInputSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE
111
114
  ref: inputRef,
112
115
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customValue.value = $event),
113
116
  class: "text-c-1 w-full min-w-0 border-none px-2 py-1.5 outline-none",
114
- placeholder: "Value",
117
+ placeholder: unref(translate)("apiClient.dataTableInputSelect.value"),
115
118
  type: "text",
116
119
  onBlur: handleBlur,
117
120
  onKeyup: withKeys(addCustomValue, ["enter"])
118
- }, null, 544)), [[vModelText, customValue.value]]) : (openBlock(), createBlock(unref(ScalarDropdown), {
121
+ }, null, 40, _hoisted_3)), [[vModelText, customValue.value]]) : (openBlock(), createBlock(unref(ScalarDropdown), {
119
122
  key: 2,
120
123
  resize: "",
121
124
  value: initialValue.value
@@ -131,24 +134,24 @@ var DataTableInputSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE
131
134
  class: "size-2.5",
132
135
  icon: "Checkmark",
133
136
  thickness: "3"
134
- })], 2), createElementVNode("span", _hoisted_4, toDisplayString(option), 1)]),
137
+ })], 2), createElementVNode("span", _hoisted_5, toDisplayString(option), 1)]),
135
138
  _: 2
136
139
  }, 1032, ["value", "onClick"]);
137
140
  }), 128)), __props.canAddCustomValue ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [options.value.length ? (openBlock(), createBlock(unref(ScalarDropdownDivider), { key: 0 })) : createCommentVNode("", true), createVNode(unref(ScalarDropdownItem), {
138
141
  class: "flex items-center gap-1.5",
139
142
  onClick: _cache[1] || (_cache[1] = ($event) => addingCustomValue.value = true)
140
143
  }, {
141
- default: withCtx(() => [createElementVNode("div", _hoisted_5, [createVNode(unref(ScalarIcon), {
144
+ default: withCtx(() => [createElementVNode("div", _hoisted_6, [createVNode(unref(ScalarIcon), {
142
145
  icon: "Add",
143
146
  size: "sm"
144
- })]), _cache[2] || (_cache[2] = createElementVNode("span", null, "Add value", -1))]),
147
+ })]), createElementVNode("span", null, toDisplayString(unref(translate)("apiClient.dataTableInputSelect.addValue")), 1)]),
145
148
  _: 1
146
149
  })], 64)) : createCommentVNode("", true)]),
147
150
  default: withCtx(() => [createVNode(unref(ScalarButton), {
148
151
  class: "size-full justify-start gap-1.5 overflow-auto px-2 py-1.5 font-normal whitespace-nowrap outline-none",
149
152
  variant: "ghost"
150
153
  }, {
151
- default: withCtx(() => [createElementVNode("span", _hoisted_3, toDisplayString(initialValue.value ?? "Select a value"), 1), createVNode(unref(ScalarIcon), {
154
+ default: withCtx(() => [createElementVNode("span", _hoisted_4, toDisplayString(initialValue.value ?? "Select a value"), 1), createVNode(unref(ScalarIcon), {
152
155
  icon: "ChevronDown",
153
156
  size: "md"
154
157
  })]),
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableInputSelect.vue.script.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableInputSelect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarComboboxMultiselect } from '@scalar/components/combobox'\nimport {\n ScalarDropdown,\n ScalarDropdownDivider,\n ScalarDropdownItem,\n} from '@scalar/components/dropdown'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport type { CodeInputModelValue } from '@/v2/components/code-input/CodeInput.vue'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: CodeInputModelValue\n value?: string[]\n default?: CodeInputModelValue | undefined\n canAddCustomValue?: boolean\n type?: string | undefined\n }>(),\n { canAddCustomValue: true },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string): void\n}>()\n\nconst options = computed(() => props.value ?? [])\nconst addingCustomValue = ref(false)\nconst customValue = ref('')\nconst inputRef = ref<HTMLInputElement | null>(null)\n\nwatch(customValue, (newValue) => {\n emit('update:modelValue', newValue)\n})\n\nconst updateSelected = (value: string) => {\n emit('update:modelValue', value)\n addingCustomValue.value = false\n}\n\nconst addCustomValue = () => {\n if (customValue.value.trim()) {\n updateSelected(customValue.value)\n }\n}\n\nconst handleBlur = () => {\n if (!customValue.value.trim()) {\n emit('update:modelValue', '')\n }\n addingCustomValue.value = false\n}\n\nconst isSelected = (value: string) => {\n return props.modelValue.toString() === value\n}\n\nwatch(addingCustomValue, (newValue) => {\n if (newValue) {\n nextTick(() => {\n inputRef.value?.focus()\n })\n }\n})\n\nconst initialValue = computed(() => {\n return props.modelValue !== undefined ? props.modelValue : props.default\n})\n\n/** Options for the array type */\nconst arrayOptions = computed(() =>\n options.value.map((option) => {\n const id = option.toString()\n return { id: id, label: id, value: id }\n }),\n)\n\n/** Filter the options by what is selected */\nconst selectedArrayOptions = computed(() => {\n const selectedValues = new Set(props.modelValue.toString().split(','))\n return arrayOptions.value.filter((option) => selectedValues.has(option.id))\n})\n\n/** Update the model value when the selected options change */\nconst updateSelectedOptions = (selectedOptions: any) => {\n const selectedValues = selectedOptions.map((option: any) => option.value)\n emit('update:modelValue', selectedValues.join(','))\n}\n</script>\n\n<template>\n <div\n class=\"group-[.alert]:outline-orange group-[.error]:outline-red w-full pr-10 -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline\">\n <template v-if=\"type === 'array'\">\n <ScalarComboboxMultiselect\n :modelValue=\"selectedArrayOptions\"\n :options=\"arrayOptions\"\n @update:modelValue=\"updateSelectedOptions\">\n <ScalarButton\n class=\"custom-scroll h-full justify-start gap-1.5 px-2 py-1.5 pr-6 font-normal outline-none\"\n fullWidth\n variant=\"ghost\">\n <span class=\"text-c-1 whitespace-nowrap\">{{\n selectedArrayOptions.length > 0\n ? selectedArrayOptions.map((option) => option.label).join(', ')\n : 'Select a value'\n }}</span>\n <ScalarIcon\n class=\"min-w-4\"\n icon=\"ChevronDown\"\n size=\"md\" />\n </ScalarButton>\n </ScalarComboboxMultiselect>\n </template>\n <template v-else-if=\"addingCustomValue\">\n <input\n ref=\"inputRef\"\n v-model=\"customValue\"\n class=\"text-c-1 w-full min-w-0 border-none px-2 py-1.5 outline-none\"\n placeholder=\"Value\"\n type=\"text\"\n @blur=\"handleBlur\"\n @keyup.enter=\"addCustomValue\" />\n </template>\n <template v-else>\n <ScalarDropdown\n resize\n :value=\"initialValue\">\n <ScalarButton\n class=\"size-full justify-start gap-1.5 overflow-auto px-2 py-1.5 font-normal whitespace-nowrap outline-none\"\n variant=\"ghost\">\n <span class=\"text-c-1 overflow-hidden text-ellipsis\">{{\n initialValue ?? 'Select a value'\n }}</span>\n <ScalarIcon\n icon=\"ChevronDown\"\n size=\"md\" />\n </ScalarButton>\n <template #items>\n <ScalarDropdownItem\n v-for=\"option in options\"\n :key=\"option\"\n class=\"group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap\"\n :value=\"option\"\n @click=\"updateSelected(option)\">\n <div\n class=\"flex h-4 w-4 items-center justify-center rounded-full p-[3px]\"\n :class=\"\n isSelected(option)\n ? 'bg-c-accent text-b-1'\n : 'shadow-border text-transparent'\n \">\n <ScalarIcon\n class=\"size-2.5\"\n icon=\"Checkmark\"\n thickness=\"3\" />\n </div>\n <span class=\"overflow-hidden text-ellipsis\">{{ option }}</span>\n </ScalarDropdownItem>\n <template v-if=\"canAddCustomValue\">\n <ScalarDropdownDivider v-if=\"options.length\" />\n <ScalarDropdownItem\n class=\"flex items-center gap-1.5\"\n @click=\"addingCustomValue = true\">\n <div class=\"flex h-4 w-4 items-center justify-center\">\n <ScalarIcon\n icon=\"Add\"\n size=\"sm\" />\n </div>\n <span>Add value</span>\n </ScalarDropdownItem>\n </template>\n </template>\n </ScalarDropdown>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA,MAAM,QAAQ;EAWd,MAAM,OAAO;EAIb,MAAM,UAAU,eAAe,MAAM,SAAS,CAAC,CAAC;EAChD,MAAM,oBAAoB,IAAI,KAAK;EACnC,MAAM,cAAc,IAAI,EAAE;EAC1B,MAAM,WAAW,IAA6B,IAAI;EAElD,MAAM,cAAc,aAAa;GAC/B,KAAK,qBAAqB,QAAQ;EACpC,CAAC;EAED,MAAM,kBAAkB,UAAkB;GACxC,KAAK,qBAAqB,KAAK;GAC/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,UAAA,GAAA;MADZ,MAAK;MACL,MAAK;qCAET,mBAAsB,QAAA,MAAhB,aAAS,EAAA,EAAA,CAAA;;;2BAhCN,CATf,YASe,MAAA,YAAA,GAAA;KARb,OAAM;KACN,SAAQ;;4BAGC,CAFT,mBAES,QAFT,YAES,gBADP,aAAA,SAAY,gBAAA,GAAA,CAAA,GAEd,YAEc,MAAA,UAAA,GAAA;MADZ,MAAK;MACL,MAAK"}
1
+ {"version":3,"file":"DataTableInputSelect.vue.script.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableInputSelect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarComboboxMultiselect } from '@scalar/components/combobox'\nimport {\n ScalarDropdown,\n ScalarDropdownDivider,\n ScalarDropdownItem,\n} from '@scalar/components/dropdown'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport type { CodeInputModelValue } from '@/v2/components/code-input/CodeInput.vue'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: CodeInputModelValue\n value?: string[]\n default?: CodeInputModelValue | undefined\n canAddCustomValue?: boolean\n type?: string | undefined\n }>(),\n { canAddCustomValue: true },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst options = computed(() => props.value ?? [])\nconst addingCustomValue = ref(false)\nconst customValue = ref('')\nconst inputRef = ref<HTMLInputElement | null>(null)\n\nwatch(customValue, (newValue) => {\n emit('update:modelValue', newValue)\n})\n\nconst updateSelected = (value: string) => {\n emit('update:modelValue', value)\n addingCustomValue.value = false\n}\n\nconst addCustomValue = () => {\n if (customValue.value.trim()) {\n updateSelected(customValue.value)\n }\n}\n\nconst handleBlur = () => {\n if (!customValue.value.trim()) {\n emit('update:modelValue', '')\n }\n addingCustomValue.value = false\n}\n\nconst isSelected = (value: string) => {\n return props.modelValue.toString() === value\n}\n\nwatch(addingCustomValue, (newValue) => {\n if (newValue) {\n nextTick(() => {\n inputRef.value?.focus()\n })\n }\n})\n\nconst initialValue = computed(() => {\n return props.modelValue !== undefined ? props.modelValue : props.default\n})\n\n/** Options for the array type */\nconst arrayOptions = computed(() =>\n options.value.map((option) => {\n const id = option.toString()\n return { id: id, label: id, value: id }\n }),\n)\n\n/** Filter the options by what is selected */\nconst selectedArrayOptions = computed(() => {\n const selectedValues = new Set(props.modelValue.toString().split(','))\n return arrayOptions.value.filter((option) => selectedValues.has(option.id))\n})\n\n/** Update the model value when the selected options change */\nconst updateSelectedOptions = (selectedOptions: any) => {\n const selectedValues = selectedOptions.map((option: any) => option.value)\n emit('update:modelValue', selectedValues.join(','))\n}\n</script>\n\n<template>\n <div\n class=\"group-[.alert]:outline-orange group-[.error]:outline-red w-full pr-10 -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline\">\n <template v-if=\"type === 'array'\">\n <ScalarComboboxMultiselect\n :modelValue=\"selectedArrayOptions\"\n :options=\"arrayOptions\"\n @update:modelValue=\"updateSelectedOptions\">\n <ScalarButton\n class=\"custom-scroll h-full justify-start gap-1.5 px-2 py-1.5 pr-6 font-normal outline-none\"\n fullWidth\n variant=\"ghost\">\n <span class=\"text-c-1 whitespace-nowrap\">{{\n selectedArrayOptions.length > 0\n ? selectedArrayOptions.map((option) => option.label).join(', ')\n : 'Select a value'\n }}</span>\n <ScalarIcon\n class=\"min-w-4\"\n icon=\"ChevronDown\"\n size=\"md\" />\n </ScalarButton>\n </ScalarComboboxMultiselect>\n </template>\n <template v-else-if=\"addingCustomValue\">\n <input\n ref=\"inputRef\"\n v-model=\"customValue\"\n class=\"text-c-1 w-full min-w-0 border-none px-2 py-1.5 outline-none\"\n :placeholder=\"translate('apiClient.dataTableInputSelect.value')\"\n type=\"text\"\n @blur=\"handleBlur\"\n @keyup.enter=\"addCustomValue\" />\n </template>\n <template v-else>\n <ScalarDropdown\n resize\n :value=\"initialValue\">\n <ScalarButton\n class=\"size-full justify-start gap-1.5 overflow-auto px-2 py-1.5 font-normal whitespace-nowrap outline-none\"\n variant=\"ghost\">\n <span class=\"text-c-1 overflow-hidden text-ellipsis\">{{\n initialValue ?? 'Select a value'\n }}</span>\n <ScalarIcon\n icon=\"ChevronDown\"\n size=\"md\" />\n </ScalarButton>\n <template #items>\n <ScalarDropdownItem\n v-for=\"option in options\"\n :key=\"option\"\n class=\"group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap\"\n :value=\"option\"\n @click=\"updateSelected(option)\">\n <div\n class=\"flex h-4 w-4 items-center justify-center rounded-full p-[3px]\"\n :class=\"\n isSelected(option)\n ? 'bg-c-accent text-b-1'\n : 'shadow-border text-transparent'\n \">\n <ScalarIcon\n class=\"size-2.5\"\n icon=\"Checkmark\"\n thickness=\"3\" />\n </div>\n <span class=\"overflow-hidden text-ellipsis\">{{ option }}</span>\n </ScalarDropdownItem>\n <template v-if=\"canAddCustomValue\">\n <ScalarDropdownDivider v-if=\"options.length\" />\n <ScalarDropdownItem\n class=\"flex items-center gap-1.5\"\n @click=\"addingCustomValue = true\">\n <div class=\"flex h-4 w-4 items-center justify-center\">\n <ScalarIcon\n icon=\"Add\"\n size=\"sm\" />\n </div>\n <span>{{\n translate('apiClient.dataTableInputSelect.addValue')\n }}</span>\n </ScalarDropdownItem>\n </template>\n </template>\n </ScalarDropdown>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,MAAM,QAAQ;EAWd,MAAM,OAAO;EAIb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,UAAU,eAAe,MAAM,SAAS,CAAC,CAAC;EAChD,MAAM,oBAAoB,IAAI,KAAK;EACnC,MAAM,cAAc,IAAI,EAAE;EAC1B,MAAM,WAAW,IAA6B,IAAI;EAElD,MAAM,cAAc,aAAa;GAC/B,KAAK,qBAAqB,QAAQ;EACpC,CAAC;EA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,OAAA,MAAA,WAAE,kBAAA,QAAiB;;4BAKnB,CAJN,mBAIM,OAJN,YAIM,CAHJ,YAEc,MAAA,UAAA,GAAA;MADZ,MAAK;MACL,MAAK;WAET,mBAES,QAAA,MAAA,gBADP,MAAA,SAAA,CAAS,CAAA,yCAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;;2BAjCF,CATf,YASe,MAAA,YAAA,GAAA;KARb,OAAM;KACN,SAAQ;;4BAGC,CAFT,mBAES,QAFT,YAES,gBADP,aAAA,SAAY,gBAAA,GAAA,CAAA,GAEd,YAEc,MAAA,UAAA,GAAA;MADZ,MAAK;MACL,MAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/forms/ConfirmationForm.vue"],"names":[],"mappings":"AA8CA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0CAA0C;IAC1C,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAC7B,CAAC;AAoGF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ConfirmationForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/forms/ConfirmationForm.vue"],"names":[],"mappings":"AAoDA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0CAA0C;IAC1C,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAC7B,CAAC;AAwGF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationForm.vue.js","names":[],"sources":["../../../../src/v2/components/forms/ConfirmationForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\n\nconst { label = 'Save', variant = 'solid' } = defineProps<{\n /** The label of the submit button */\n label?: string\n /** Sets the style of the submit button */\n variant?: 'danger' | 'solid'\n}>()\n\nconst emit = defineEmits<{\n (e: 'cancel'): void\n (e: 'submit'): void\n}>()\n</script>\n<template>\n <form\n class=\"flex flex-col gap-4 text-base\"\n @submit.prevent=\"emit('submit')\">\n <slot />\n\n <div class=\"flex justify-between gap-10\">\n <!-- Cancel -->\n <ScalarButton\n size=\"sm\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"emit('cancel')\">\n Cancel\n </ScalarButton>\n\n <!-- Submit -->\n <ScalarButton\n size=\"sm\"\n type=\"submit\"\n :variant=\"variant\">\n {{ label }}\n </ScalarButton>\n </div>\n </form>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"ConfirmationForm.vue.js","names":[],"sources":["../../../../src/v2/components/forms/ConfirmationForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { label, variant = 'solid' } = defineProps<{\n /** The label of the submit button */\n label?: string\n /** Sets the style of the submit button */\n variant?: 'danger' | 'solid'\n}>()\n\nconst emit = defineEmits<{\n (e: 'cancel'): void\n (e: 'submit'): void\n}>()\n\nconst { translate } = useLocalization()\n</script>\n<template>\n <form\n class=\"flex flex-col gap-4 text-base\"\n @submit.prevent=\"emit('submit')\">\n <slot />\n\n <div class=\"flex justify-between gap-10\">\n <!-- Cancel -->\n <ScalarButton\n size=\"sm\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"emit('cancel')\">\n {{ translate('apiClient.confirmationForm.cancel') }}\n </ScalarButton>\n\n <!-- Submit -->\n <ScalarButton\n size=\"sm\"\n type=\"submit\"\n :variant=\"variant\">\n {{ label ?? translate('apiClient.confirmationForm.save') }}\n </ScalarButton>\n </div>\n </form>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../features/localization/index.js";
1
2
  import { createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, withCtx, withModifiers } from "vue";
2
3
  import { ScalarButton } from "@scalar/components/button";
3
4
  //#region src/v2/components/forms/ConfirmationForm.vue?vue&type=script&setup=true&lang.ts
@@ -5,12 +6,13 @@ var _hoisted_1 = { class: "flex justify-between gap-10" };
5
6
  var ConfirmationForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
6
7
  __name: "ConfirmationForm",
7
8
  props: {
8
- label: { default: "Save" },
9
+ label: {},
9
10
  variant: { default: "solid" }
10
11
  },
11
12
  emits: ["cancel", "submit"],
12
13
  setup(__props, { emit: __emit }) {
13
14
  const emit = __emit;
15
+ const { translate } = useLocalization();
14
16
  return (_ctx, _cache) => {
15
17
  return openBlock(), createElementBlock("form", {
16
18
  class: "flex flex-col gap-4 text-base",
@@ -21,14 +23,14 @@ var ConfirmationForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
21
23
  variant: "outlined",
22
24
  onClick: _cache[0] || (_cache[0] = ($event) => emit("cancel"))
23
25
  }, {
24
- default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Cancel ", -1)])]),
26
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.confirmationForm.cancel")), 1)]),
25
27
  _: 1
26
28
  }), createVNode(unref(ScalarButton), {
27
29
  size: "sm",
28
30
  type: "submit",
29
31
  variant: __props.variant
30
32
  }, {
31
- default: withCtx(() => [createTextVNode(toDisplayString(__props.label), 1)]),
33
+ default: withCtx(() => [createTextVNode(toDisplayString(__props.label ?? unref(translate)("apiClient.confirmationForm.save")), 1)]),
32
34
  _: 1
33
35
  }, 8, ["variant"])])], 32);
34
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationForm.vue.script.js","names":[],"sources":["../../../../src/v2/components/forms/ConfirmationForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\n\nconst { label = 'Save', variant = 'solid' } = defineProps<{\n /** The label of the submit button */\n label?: string\n /** Sets the style of the submit button */\n variant?: 'danger' | 'solid'\n}>()\n\nconst emit = defineEmits<{\n (e: 'cancel'): void\n (e: 'submit'): void\n}>()\n</script>\n<template>\n <form\n class=\"flex flex-col gap-4 text-base\"\n @submit.prevent=\"emit('submit')\">\n <slot />\n\n <div class=\"flex justify-between gap-10\">\n <!-- Cancel -->\n <ScalarButton\n size=\"sm\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"emit('cancel')\">\n Cancel\n </ScalarButton>\n\n <!-- Submit -->\n <ScalarButton\n size=\"sm\"\n type=\"submit\"\n :variant=\"variant\">\n {{ label }}\n </ScalarButton>\n </div>\n </form>\n</template>\n"],"mappings":";;;;;;;;;;;;EAUA,MAAM,OAAO;;uBAMX,mBAuBO,QAAA;IAtBL,OAAM;IACL,UAAM,OAAA,OAAA,OAAA,KAAA,eAAA,WAAU,KAAI,QAAA,GAAA,CAAA,SAAA,CAAA;OACrB,WAAQ,KAAA,QAAA,SAAA,GAER,mBAiBM,OAjBN,YAiBM,CAfJ,YAMe,MAAA,YAAA,GAAA;IALb,MAAK;IACL,MAAK;IACL,SAAQ;IACP,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,QAAA;;2BAEd,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAF0B,YAE1B,EAAA,CAAA,EAAA,CAAA;;OAGA,YAKe,MAAA,YAAA,GAAA;IAJb,MAAK;IACL,MAAK;IACJ,SAAS,QAAA;;2BACC,CAAA,gBAAA,gBAAR,QAAA,KAAK,GAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"ConfirmationForm.vue.script.js","names":[],"sources":["../../../../src/v2/components/forms/ConfirmationForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { label, variant = 'solid' } = defineProps<{\n /** The label of the submit button */\n label?: string\n /** Sets the style of the submit button */\n variant?: 'danger' | 'solid'\n}>()\n\nconst emit = defineEmits<{\n (e: 'cancel'): void\n (e: 'submit'): void\n}>()\n\nconst { translate } = useLocalization()\n</script>\n<template>\n <form\n class=\"flex flex-col gap-4 text-base\"\n @submit.prevent=\"emit('submit')\">\n <slot />\n\n <div class=\"flex justify-between gap-10\">\n <!-- Cancel -->\n <ScalarButton\n size=\"sm\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"emit('cancel')\">\n {{ translate('apiClient.confirmationForm.cancel') }}\n </ScalarButton>\n\n <!-- Submit -->\n <ScalarButton\n size=\"sm\"\n type=\"submit\"\n :variant=\"variant\">\n {{ label ?? translate('apiClient.confirmationForm.save') }}\n </ScalarButton>\n </div>\n </form>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAYA,MAAM,OAAO;EAKb,MAAM,EAAE,cAAc,gBAAgB;;uBAGpC,mBAuBO,QAAA;IAtBL,OAAM;IACL,UAAM,OAAA,OAAA,OAAA,KAAA,eAAA,WAAU,KAAI,QAAA,GAAA,CAAA,SAAA,CAAA;OACrB,WAAQ,KAAA,QAAA,SAAA,GAER,mBAiBM,OAjBN,YAiBM,CAfJ,YAMe,MAAA,YAAA,GAAA;IALb,MAAK;IACL,MAAK;IACL,SAAQ;IACP,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,QAAA;;2BACwC,CAAA,gBAAA,gBAAjD,MAAA,SAAA,CAAS,CAAA,mCAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;OAId,YAKe,MAAA,YAAA,GAAA;IAJb,MAAK;IACL,MAAK;IACJ,SAAS,QAAA;;2BACiD,CAAA,gBAAA,gBAAxD,QAAA,SAAS,MAAA,SAAA,CAAS,CAAA,iCAAA,CAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/CollapsibleSection.vue"],"names":[],"mappings":"AA8HA;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEhB,iDAAiD;kBACnC,OAAO;IACrB,uDAAuD;gBAC3C,MAAM;IAClB,8DAA8D;eACnD,OAAO;;;;IALlB,iDAAiD;kBACnC,OAAO;IACrB,uDAAuD;gBAC3C,MAAM;IAClB,8DAA8D;eACnD,OAAO;;;;YA0PR,CAAC,KAAK;;KAAiB,KAAK,GAAG;;cAC7B,CAAC,KAAK;;KAAiB,KAAK,GAAG;;cAC/B,CAAC,KAAK;;KAAiB,KAAK,GAAG;EAUzC,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CollapsibleSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/CollapsibleSection.vue"],"names":[],"mappings":"AAwIA;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEhB,iDAAiD;kBACnC,OAAO;IACrB,uDAAuD;gBAC3C,MAAM;IAClB,8DAA8D;eACnD,OAAO;;;;IALlB,iDAAiD;kBACnC,OAAO;IACrB,uDAAuD;gBAC3C,MAAM;IAClB,8DAA8D;eACnD,OAAO;;;;YAkQR,CAAC,KAAK;;KAAiB,KAAK,GAAG;;cAC7B,CAAC,KAAK;;KAAiB,KAAK,GAAG;;cAC/B,CAAC,KAAK;;KAAiB,KAAK,GAAG;EAUzC,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleSection.vue.js","names":[],"sources":["../../../../src/v2/components/layout/CollapsibleSection.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Simple collapsible section component that can be used to wrap content that should be collapsed and expanded\n *\n * Would like to replace with details/summary elements, but they are not supported in all browsers yet?\n */\nexport default {\n name: 'CollapsibleSection',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { useId } from 'vue'\n\nimport ValueEmitter from './ValueEmitter.vue'\n\nconst {\n defaultOpen = true,\n itemCount = 0,\n isStatic,\n} = defineProps<{\n /** Whether the disclosure is open by default. */\n defaultOpen?: boolean\n /** Number of items to show in badge when collapsed. */\n itemCount?: number\n /** Whether the disclosure is static and cannot be toggled. */\n isStatic?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n}>()\n\nconst headingId = useId()\n</script>\n\n<template>\n <Disclosure\n v-slot=\"{ open }\"\n as=\"div\"\n class=\"group/collapse text-c-2 focus-within:text-c-1 last:ui-open:border-b-0\"\n :class=\"{\n 'last-of-type:first-of-type:border-b-0': isStatic,\n 'border-b': !isStatic,\n }\"\n :defaultOpen=\"defaultOpen\"\n :static=\"isStatic\">\n <!-- We use this hack to emit the slot value back to the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emit('update:modelValue', value)\" />\n\n <section\n :aria-labelledby=\"headingId\"\n class=\"contents\">\n <div\n class=\"bg-b-2 flex items-center\"\n :class=\"isStatic && 'rounded-t-xl border-x border-t'\">\n <!-- Main disclosure button that toggles the panel -->\n <DisclosureButton\n class=\"hover:text-c-1 group box-content flex max-h-8 flex-1 items-center gap-2.5 overflow-hidden px-1 py-1.5 text-base font-medium outline-none md:px-1.5 xl:pr-0.5 xl:pl-2\"\n :class=\"isStatic && '!pl-3'\"\n :disabled=\"isStatic\">\n <ScalarIcon\n v-if=\"!isStatic\"\n class=\"text-c-3 group-hover:text-c-1 rounded-px ui-open:rotate-90 ui-not-open:rotate-0 outline-offset-2 group-focus-visible:outline\"\n icon=\"ChevronRight\"\n size=\"md\" />\n\n <!-- Heading with title -->\n <h2\n class=\"text-c-1 m-0 flex flex-1 items-center gap-1.5 leading-[20px]\">\n <span\n :id=\"headingId\"\n class=\"contents\">\n <slot\n name=\"title\"\n :open=\"open\" />\n <span\n v-if=\"!open\"\n class=\"sr-only\">\n (Collapsed)\n </span>\n </span>\n\n <!-- Badge showing item count when collapsed. -->\n <span\n v-if=\"!open && itemCount\"\n class=\"bg-b-2 text-c-2 inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs font-semibold\">\n {{ itemCount }}\n <span class=\"sr-only\">Item{{ itemCount === 1 ? '' : 's' }}</span>\n </span>\n </h2>\n </DisclosureButton>\n\n <!-- Optional actions slot that hides when the panel is closed. -->\n <div\n v-if=\"$slots.actions\"\n class=\"ui-not-open:hidden flex items-center gap-2 pr-0.75\">\n <slot\n name=\"actions\"\n :open=\"open\" />\n </div>\n </div>\n\n <!-- The collapsible content panel. -->\n <DisclosurePanel\n v-bind=\"$attrs\"\n class=\"diclosure-panel h-full max-h-fit rounded-b\">\n <slot :open=\"open\" />\n </DisclosurePanel>\n </section>\n </Disclosure>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"CollapsibleSection.vue.js","names":[],"sources":["../../../../src/v2/components/layout/CollapsibleSection.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Simple collapsible section component that can be used to wrap content that should be collapsed and expanded\n *\n * Would like to replace with details/summary elements, but they are not supported in all browsers yet?\n */\nexport default {\n name: 'CollapsibleSection',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { useId } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nimport ValueEmitter from './ValueEmitter.vue'\n\nconst {\n defaultOpen = true,\n itemCount = 0,\n isStatic,\n} = defineProps<{\n /** Whether the disclosure is open by default. */\n defaultOpen?: boolean\n /** Number of items to show in badge when collapsed. */\n itemCount?: number\n /** Whether the disclosure is static and cannot be toggled. */\n isStatic?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst headingId = useId()\n</script>\n\n<template>\n <Disclosure\n v-slot=\"{ open }\"\n as=\"div\"\n class=\"group/collapse text-c-2 focus-within:text-c-1 last:ui-open:border-b-0\"\n :class=\"{\n 'last-of-type:first-of-type:border-b-0': isStatic,\n 'border-b': !isStatic,\n }\"\n :defaultOpen=\"defaultOpen\"\n :static=\"isStatic\">\n <!-- We use this hack to emit the slot value back to the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emit('update:modelValue', value)\" />\n\n <section\n :aria-labelledby=\"headingId\"\n class=\"contents\">\n <div\n class=\"bg-b-2 flex items-center\"\n :class=\"isStatic && 'rounded-t-xl border-x border-t'\">\n <!-- Main disclosure button that toggles the panel -->\n <DisclosureButton\n class=\"hover:text-c-1 group box-content flex max-h-8 flex-1 items-center gap-2.5 overflow-hidden px-1 py-1.5 text-base font-medium outline-none md:px-1.5 xl:pr-0.5 xl:pl-2\"\n :class=\"isStatic && '!pl-3'\"\n :disabled=\"isStatic\">\n <ScalarIcon\n v-if=\"!isStatic\"\n class=\"text-c-3 group-hover:text-c-1 rounded-px ui-open:rotate-90 ui-not-open:rotate-0 outline-offset-2 group-focus-visible:outline\"\n icon=\"ChevronRight\"\n size=\"md\" />\n\n <!-- Heading with title -->\n <h2\n class=\"text-c-1 m-0 flex flex-1 items-center gap-1.5 leading-[20px]\">\n <span\n :id=\"headingId\"\n class=\"contents\">\n <slot\n name=\"title\"\n :open=\"open\" />\n <span\n v-if=\"!open\"\n class=\"sr-only\"\n >{{ translate('apiClient.collapsibleSection.collapsed') }}</span\n >\n </span>\n\n <!-- Badge showing item count when collapsed. -->\n <span\n v-if=\"!open && itemCount\"\n class=\"bg-b-2 text-c-2 inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs font-semibold\">\n {{ itemCount }}\n <span class=\"sr-only\">{{\n itemCount === 1\n ? translate('apiClient.collapsibleSection.item')\n : translate('apiClient.collapsibleSection.items')\n }}</span>\n </span>\n </h2>\n </DisclosureButton>\n\n <!-- Optional actions slot that hides when the panel is closed. -->\n <div\n v-if=\"$slots.actions\"\n class=\"ui-not-open:hidden flex items-center gap-2 pr-0.75\">\n <slot\n name=\"actions\"\n :open=\"open\" />\n </div>\n </div>\n\n <!-- The collapsible content panel. -->\n <DisclosurePanel\n v-bind=\"$attrs\"\n class=\"diclosure-panel h-full max-h-fit rounded-b\">\n <slot :open=\"open\" />\n </DisclosurePanel>\n </section>\n </Disclosure>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../features/localization/index.js";
1
2
  import ValueEmitter_default from "./ValueEmitter.vue.js";
2
3
  import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderSlot, toDisplayString, unref, useId, withCtx } from "vue";
3
4
  import { ScalarIcon } from "@scalar/components/icon";
@@ -32,6 +33,7 @@ var CollapsibleSection_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
32
33
  emits: ["update:modelValue"],
33
34
  setup(__props, { emit: __emit }) {
34
35
  const emit = __emit;
36
+ const { translate } = useLocalization();
35
37
  const headingId = useId();
36
38
  return (_ctx, _cache) => {
37
39
  return openBlock(), createBlock(unref(Disclosure), {
@@ -61,7 +63,7 @@ var CollapsibleSection_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
61
63
  })) : createCommentVNode("", true), createElementVNode("h2", _hoisted_2, [createElementVNode("span", {
62
64
  id: unref(headingId),
63
65
  class: "contents"
64
- }, [renderSlot(_ctx.$slots, "title", { open }), !open ? (openBlock(), createElementBlock("span", _hoisted_4, " (Collapsed) ")) : createCommentVNode("", true)], 8, _hoisted_3), !open && __props.itemCount ? (openBlock(), createElementBlock("span", _hoisted_5, [createTextVNode(toDisplayString(__props.itemCount) + " ", 1), createElementVNode("span", _hoisted_6, "Item" + toDisplayString(__props.itemCount === 1 ? "" : "s"), 1)])) : createCommentVNode("", true)])]),
66
+ }, [renderSlot(_ctx.$slots, "title", { open }), !open ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(unref(translate)("apiClient.collapsibleSection.collapsed")), 1)) : createCommentVNode("", true)], 8, _hoisted_3), !open && __props.itemCount ? (openBlock(), createElementBlock("span", _hoisted_5, [createTextVNode(toDisplayString(__props.itemCount) + " ", 1), createElementVNode("span", _hoisted_6, toDisplayString(__props.itemCount === 1 ? unref(translate)("apiClient.collapsibleSection.item") : unref(translate)("apiClient.collapsibleSection.items")), 1)])) : createCommentVNode("", true)])]),
65
67
  _: 2
66
68
  }, 1032, ["class", "disabled"]), _ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_7, [renderSlot(_ctx.$slots, "actions", { open })])) : createCommentVNode("", true)], 2), createVNode(unref(DisclosurePanel), mergeProps(_ctx.$attrs, { class: "diclosure-panel h-full max-h-fit rounded-b" }), {
67
69
  default: withCtx(() => [renderSlot(_ctx.$slots, "default", { open })]),
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleSection.vue.script.js","names":["$slots","$attrs"],"sources":["../../../../src/v2/components/layout/CollapsibleSection.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Simple collapsible section component that can be used to wrap content that should be collapsed and expanded\n *\n * Would like to replace with details/summary elements, but they are not supported in all browsers yet?\n */\nexport default {\n name: 'CollapsibleSection',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { useId } from 'vue'\n\nimport ValueEmitter from './ValueEmitter.vue'\n\nconst {\n defaultOpen = true,\n itemCount = 0,\n isStatic,\n} = defineProps<{\n /** Whether the disclosure is open by default. */\n defaultOpen?: boolean\n /** Number of items to show in badge when collapsed. */\n itemCount?: number\n /** Whether the disclosure is static and cannot be toggled. */\n isStatic?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n}>()\n\nconst headingId = useId()\n</script>\n\n<template>\n <Disclosure\n v-slot=\"{ open }\"\n as=\"div\"\n class=\"group/collapse text-c-2 focus-within:text-c-1 last:ui-open:border-b-0\"\n :class=\"{\n 'last-of-type:first-of-type:border-b-0': isStatic,\n 'border-b': !isStatic,\n }\"\n :defaultOpen=\"defaultOpen\"\n :static=\"isStatic\">\n <!-- We use this hack to emit the slot value back to the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emit('update:modelValue', value)\" />\n\n <section\n :aria-labelledby=\"headingId\"\n class=\"contents\">\n <div\n class=\"bg-b-2 flex items-center\"\n :class=\"isStatic && 'rounded-t-xl border-x border-t'\">\n <!-- Main disclosure button that toggles the panel -->\n <DisclosureButton\n class=\"hover:text-c-1 group box-content flex max-h-8 flex-1 items-center gap-2.5 overflow-hidden px-1 py-1.5 text-base font-medium outline-none md:px-1.5 xl:pr-0.5 xl:pl-2\"\n :class=\"isStatic && '!pl-3'\"\n :disabled=\"isStatic\">\n <ScalarIcon\n v-if=\"!isStatic\"\n class=\"text-c-3 group-hover:text-c-1 rounded-px ui-open:rotate-90 ui-not-open:rotate-0 outline-offset-2 group-focus-visible:outline\"\n icon=\"ChevronRight\"\n size=\"md\" />\n\n <!-- Heading with title -->\n <h2\n class=\"text-c-1 m-0 flex flex-1 items-center gap-1.5 leading-[20px]\">\n <span\n :id=\"headingId\"\n class=\"contents\">\n <slot\n name=\"title\"\n :open=\"open\" />\n <span\n v-if=\"!open\"\n class=\"sr-only\">\n (Collapsed)\n </span>\n </span>\n\n <!-- Badge showing item count when collapsed. -->\n <span\n v-if=\"!open && itemCount\"\n class=\"bg-b-2 text-c-2 inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs font-semibold\">\n {{ itemCount }}\n <span class=\"sr-only\">Item{{ itemCount === 1 ? '' : 's' }}</span>\n </span>\n </h2>\n </DisclosureButton>\n\n <!-- Optional actions slot that hides when the panel is closed. -->\n <div\n v-if=\"$slots.actions\"\n class=\"ui-not-open:hidden flex items-center gap-2 pr-0.75\">\n <slot\n name=\"actions\"\n :open=\"open\" />\n </div>\n </div>\n\n <!-- The collapsible content panel. -->\n <DisclosurePanel\n v-bind=\"$attrs\"\n class=\"diclosure-panel h-full max-h-fit rounded-b\">\n <slot :open=\"open\" />\n </DisclosurePanel>\n </section>\n </Disclosure>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;CAOE,MAAM;;;;;;;;;;;EAwBR,MAAM,OAAO;EAIb,MAAM,YAAY,MAAM;;uBAItB,YA2Ea,MAAA,UAAA,GAAA;IAzEX,IAAG;IACH,OAAK,eAAA,CAAC,yEAAuE;8CACpB,QAAA;k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,KAGQ,QAHF,EACd,OAAM,6CAA4C,CAAA,GAAA;4BAC7B,CAArB,WAAqB,KAAA,QAAA,WAAA,EAAR,KAAI,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"CollapsibleSection.vue.script.js","names":["$slots","$attrs"],"sources":["../../../../src/v2/components/layout/CollapsibleSection.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Simple collapsible section component that can be used to wrap content that should be collapsed and expanded\n *\n * Would like to replace with details/summary elements, but they are not supported in all browsers yet?\n */\nexport default {\n name: 'CollapsibleSection',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { useId } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nimport ValueEmitter from './ValueEmitter.vue'\n\nconst {\n defaultOpen = true,\n itemCount = 0,\n isStatic,\n} = defineProps<{\n /** Whether the disclosure is open by default. */\n defaultOpen?: boolean\n /** Number of items to show in badge when collapsed. */\n itemCount?: number\n /** Whether the disclosure is static and cannot be toggled. */\n isStatic?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst headingId = useId()\n</script>\n\n<template>\n <Disclosure\n v-slot=\"{ open }\"\n as=\"div\"\n class=\"group/collapse text-c-2 focus-within:text-c-1 last:ui-open:border-b-0\"\n :class=\"{\n 'last-of-type:first-of-type:border-b-0': isStatic,\n 'border-b': !isStatic,\n }\"\n :defaultOpen=\"defaultOpen\"\n :static=\"isStatic\">\n <!-- We use this hack to emit the slot value back to the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emit('update:modelValue', value)\" />\n\n <section\n :aria-labelledby=\"headingId\"\n class=\"contents\">\n <div\n class=\"bg-b-2 flex items-center\"\n :class=\"isStatic && 'rounded-t-xl border-x border-t'\">\n <!-- Main disclosure button that toggles the panel -->\n <DisclosureButton\n class=\"hover:text-c-1 group box-content flex max-h-8 flex-1 items-center gap-2.5 overflow-hidden px-1 py-1.5 text-base font-medium outline-none md:px-1.5 xl:pr-0.5 xl:pl-2\"\n :class=\"isStatic && '!pl-3'\"\n :disabled=\"isStatic\">\n <ScalarIcon\n v-if=\"!isStatic\"\n class=\"text-c-3 group-hover:text-c-1 rounded-px ui-open:rotate-90 ui-not-open:rotate-0 outline-offset-2 group-focus-visible:outline\"\n icon=\"ChevronRight\"\n size=\"md\" />\n\n <!-- Heading with title -->\n <h2\n class=\"text-c-1 m-0 flex flex-1 items-center gap-1.5 leading-[20px]\">\n <span\n :id=\"headingId\"\n class=\"contents\">\n <slot\n name=\"title\"\n :open=\"open\" />\n <span\n v-if=\"!open\"\n class=\"sr-only\"\n >{{ translate('apiClient.collapsibleSection.collapsed') }}</span\n >\n </span>\n\n <!-- Badge showing item count when collapsed. -->\n <span\n v-if=\"!open && itemCount\"\n class=\"bg-b-2 text-c-2 inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs font-semibold\">\n {{ itemCount }}\n <span class=\"sr-only\">{{\n itemCount === 1\n ? translate('apiClient.collapsibleSection.item')\n : translate('apiClient.collapsibleSection.items')\n }}</span>\n </span>\n </h2>\n </DisclosureButton>\n\n <!-- Optional actions slot that hides when the panel is closed. -->\n <div\n v-if=\"$slots.actions\"\n class=\"ui-not-open:hidden flex items-center gap-2 pr-0.75\">\n <slot\n name=\"actions\"\n :open=\"open\" />\n </div>\n </div>\n\n <!-- The collapsible content panel. -->\n <DisclosurePanel\n v-bind=\"$attrs\"\n class=\"diclosure-panel h-full max-h-fit rounded-b\">\n <slot :open=\"open\" />\n </DisclosurePanel>\n </section>\n </Disclosure>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;CAOE,MAAM;;;;;;;;;;;EA0BR,MAAM,OAAO;EAIb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,YAAY,MAAM;;uBAItB,YA+Ea,MAAA,UAAA,GAAA;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MM,OANN,YAMM,CAHJ,WAEiB,KAAA,QAAA,WAAA,EAAR,KAAI,CAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,CAAA,GAKjB,YAIkB,MAAA,eAAA,GAJlB,WACUC,KAGQ,QAHF,EACd,OAAM,6CAA4C,CAAA,GAAA;4BAC7B,CAArB,WAAqB,KAAA,QAAA,WAAA,EAAR,KAAI,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteModal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/modals/DeleteModal.vue"],"names":[],"mappings":"AA0CA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,qCAAqC;IACrC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC,CAAC;AAuFF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"DeleteModal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/modals/DeleteModal.vue"],"names":[],"mappings":"AA8CA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,qCAAqC;IACrC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC,CAAC;AA0FF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteModal.vue.js","names":[],"sources":["../../../../src/v2/components/modals/DeleteModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { truncate } from '@scalar/helpers/string/truncate'\nimport { computed } from 'vue'\n\nimport { ConfirmationForm } from '@/v2/components/forms'\n\nconst { name, warningMessage } = defineProps<{\n /** The name of the item to delete */\n name: string\n /** The warning message to display */\n warningMessage?: string | undefined\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n (e: 'delete'): void\n}>()\n\n/** Condenses the name to 18 characters and adds an ellipsis if it's longer */\nconst truncatedName = computed(() => truncate(name))\n</script>\n<template>\n <ConfirmationForm\n :label=\"`Delete ${truncatedName}`\"\n variant=\"danger\"\n @cancel=\"emit('close')\"\n @submit=\"emit('delete')\">\n <p\n v-if=\"warningMessage\"\n class=\"text-c-2 text-sm leading-normal text-pretty\">\n {{ warningMessage }}\n </p>\n </ConfirmationForm>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"DeleteModal.vue.js","names":[],"sources":["../../../../src/v2/components/modals/DeleteModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { truncate } from '@scalar/helpers/string/truncate'\nimport { computed } from 'vue'\n\nimport { ConfirmationForm } from '@/v2/components/forms'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { name, warningMessage } = defineProps<{\n /** The name of the item to delete */\n name: string\n /** The warning message to display */\n warningMessage?: string | undefined\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n (e: 'delete'): void\n}>()\n\nconst { translate } = useLocalization()\n\n/** Condenses the name to 18 characters and adds an ellipsis if it's longer */\nconst truncatedName = computed(() => truncate(name))\n</script>\n<template>\n <ConfirmationForm\n :label=\"translate('apiClient.deleteModal.delete', { name: truncatedName })\"\n variant=\"danger\"\n @cancel=\"emit('close')\"\n @submit=\"emit('delete')\">\n <p\n v-if=\"warningMessage\"\n class=\"text-c-2 text-sm leading-normal text-pretty\">\n {{ warningMessage }}\n </p>\n </ConfirmationForm>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../features/localization/index.js";
1
2
  import ConfirmationForm_default from "../forms/ConfirmationForm.vue.js";
2
3
  import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
3
4
  import { truncate } from "@scalar/helpers/string/truncate";
@@ -15,11 +16,12 @@ var DeleteModal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
15
16
  emits: ["close", "delete"],
16
17
  setup(__props, { emit: __emit }) {
17
18
  const emit = __emit;
19
+ const { translate } = useLocalization();
18
20
  /** Condenses the name to 18 characters and adds an ellipsis if it's longer */
19
21
  const truncatedName = computed(() => truncate(__props.name));
20
22
  return (_ctx, _cache) => {
21
23
  return openBlock(), createBlock(unref(ConfirmationForm_default), {
22
- label: `Delete ${truncatedName.value}`,
24
+ label: unref(translate)("apiClient.deleteModal.delete", { name: truncatedName.value }),
23
25
  variant: "danger",
24
26
  onCancel: _cache[0] || (_cache[0] = ($event) => emit("close")),
25
27
  onSubmit: _cache[1] || (_cache[1] = ($event) => emit("delete"))
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteModal.vue.script.js","names":[],"sources":["../../../../src/v2/components/modals/DeleteModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { truncate } from '@scalar/helpers/string/truncate'\nimport { computed } from 'vue'\n\nimport { ConfirmationForm } from '@/v2/components/forms'\n\nconst { name, warningMessage } = defineProps<{\n /** The name of the item to delete */\n name: string\n /** The warning message to display */\n warningMessage?: string | undefined\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n (e: 'delete'): void\n}>()\n\n/** Condenses the name to 18 characters and adds an ellipsis if it's longer */\nconst truncatedName = computed(() => truncate(name))\n</script>\n<template>\n <ConfirmationForm\n :label=\"`Delete ${truncatedName}`\"\n variant=\"danger\"\n @cancel=\"emit('close')\"\n @submit=\"emit('delete')\">\n <p\n v-if=\"warningMessage\"\n class=\"text-c-2 text-sm leading-normal text-pretty\">\n {{ warningMessage }}\n </p>\n </ConfirmationForm>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAaA,MAAM,OAAO;;EAMb,MAAM,gBAAgB,eAAe,SAAS,QAAA,IAAI,CAAC;;uBAGjD,YAUmB,MAAA,wBAAA,GAAA;IAThB,OAAK,UAAY,cAAA;IAClB,SAAQ;IACP,UAAM,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,OAAA;IACZ,UAAM,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,QAAA;;2BAKT,CAHI,QAAA,kBAAA,UAAA,GADR,mBAII,KAJJ,YAII,gBADC,QAAA,cAAc,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"DeleteModal.vue.script.js","names":[],"sources":["../../../../src/v2/components/modals/DeleteModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { truncate } from '@scalar/helpers/string/truncate'\nimport { computed } from 'vue'\n\nimport { ConfirmationForm } from '@/v2/components/forms'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { name, warningMessage } = defineProps<{\n /** The name of the item to delete */\n name: string\n /** The warning message to display */\n warningMessage?: string | undefined\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n (e: 'delete'): void\n}>()\n\nconst { translate } = useLocalization()\n\n/** Condenses the name to 18 characters and adds an ellipsis if it's longer */\nconst truncatedName = computed(() => truncate(name))\n</script>\n<template>\n <ConfirmationForm\n :label=\"translate('apiClient.deleteModal.delete', { name: truncatedName })\"\n variant=\"danger\"\n @cancel=\"emit('close')\"\n @submit=\"emit('delete')\">\n <p\n v-if=\"warningMessage\"\n class=\"text-c-2 text-sm leading-normal text-pretty\">\n {{ warningMessage }}\n </p>\n </ConfirmationForm>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAcA,MAAM,OAAO;EAKb,MAAM,EAAE,cAAc,gBAAgB;;EAGtC,MAAM,gBAAgB,eAAe,SAAS,QAAA,IAAI,CAAC;;uBAGjD,YAUmB,MAAA,wBAAA,GAAA;IAThB,OAAO,MAAA,SAAA,CAAS,CAAA,gCAAA,EAAA,MAAyC,cAAA,MAAa,CAAA;IACvE,SAAQ;IACP,UAAM,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,OAAA;IACZ,UAAM,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,QAAA;;2BAKT,CAHI,QAAA,kBAAA,UAAA,GADR,mBAII,KAJJ,YAII,gBADC,QAAA,cAAc,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ModalClientContainer.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"names":[],"mappings":"AAyKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAK1D,KAAK,WAAW,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AAgI9C,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAO/C,QAAA,MAAM,UAAU;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ModalClientContainer.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"names":[],"mappings":"AA8KA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAO1D,KAAK,WAAW,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AAoI9C,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAO/C,QAAA,MAAM,UAAU;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import ModalClientContainer_vue_vue_type_script_setup_true_lang_default from "./ModalClientContainer.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/v2/components/modals/ModalClientContainer.vue
5
- var ModalClientContainer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ModalClientContainer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-77897d1c"]]);
5
+ var ModalClientContainer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ModalClientContainer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-0eebddf5"]]);
6
6
  //#endregion
7
7
  export { ModalClientContainer_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"ModalClientContainer.vue.js","names":[],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { addScalarClassesToHeadless } from '@scalar/components/helpers'\nimport type { ModalState } from '@scalar/components/modal'\nimport { ScalarTeleportRoot } from '@scalar/components/teleport'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport { nextTick, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'\n\nconst props = defineProps<{ modalState: ModalState }>()\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst client = ref<HTMLElement | null>(null)\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: () => client.value as HTMLElement,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <div class=\"scalar scalar-app z-overlay relative\">\n <div\n class=\"scalar-container\"\n :class=\"{ 'scalar-client--open': modalState.open }\">\n <div\n ref=\"client\"\n aria-label=\"API Client\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: hidden;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n will-change: opacity;\n transition:\n opacity 0.35s ease,\n visibility 0s linear 0.35s;\n}\n\n.scalar-container.scalar-client--open {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transition: opacity 0.35s ease;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ModalClientContainer.vue.js","names":[],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { addScalarClassesToHeadless } from '@scalar/components/helpers'\nimport type { ModalState } from '@scalar/components/modal'\nimport { ScalarTeleportRoot } from '@scalar/components/teleport'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport { nextTick, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst props = defineProps<{ modalState: ModalState }>()\n\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst client = ref<HTMLElement | null>(null)\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: () => client.value as HTMLElement,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <div class=\"scalar scalar-app z-overlay relative\">\n <div\n class=\"scalar-container\"\n :class=\"{ 'scalar-client--open': modalState.open }\">\n <div\n ref=\"client\"\n :aria-label=\"translate('apiClient.modalClientContainer.label')\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: hidden;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n will-change: opacity;\n transition:\n opacity 0.35s ease,\n visibility 0s linear 0.35s;\n}\n\n.scalar-container.scalar-client--open {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transition: opacity 0.35s ease;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n</style>\n"],"mappings":""}
@@ -1,9 +1,11 @@
1
+ import { useLocalization } from "../../features/localization/index.js";
1
2
  import { createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, onBeforeMount, onBeforeUnmount, openBlock, ref, renderSlot, unref, watch, withCtx } from "vue";
2
3
  import { ScalarTeleportRoot } from "@scalar/components/teleport";
3
4
  import { addScalarClassesToHeadless } from "@scalar/components/helpers";
4
5
  import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
5
6
  //#region src/v2/components/modals/ModalClientContainer.vue?vue&type=script&setup=true&lang.ts
6
7
  var _hoisted_1 = { class: "scalar scalar-app z-overlay relative" };
8
+ var _hoisted_2 = ["aria-label"];
7
9
  var ModalClientContainer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
8
10
  __name: "ModalClientContainer",
9
11
  props: { modalState: {} },
@@ -11,6 +13,7 @@ var ModalClientContainer_vue_vue_type_script_setup_true_lang_default = /*@__PURE
11
13
  setup(__props, { emit: __emit }) {
12
14
  const props = __props;
13
15
  const emit = __emit;
16
+ const { translate } = useLocalization();
14
17
  const client = ref(null);
15
18
  const { activate: activateFocusTrap, deactivate: deactivateFocusTrap } = useFocusTrap(client, {
16
19
  allowOutsideClick: true,
@@ -34,7 +37,7 @@ var ModalClientContainer_vue_vue_type_script_setup_true_lang_default = /*@__PURE
34
37
  return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", { class: normalizeClass(["scalar-container", { "scalar-client--open": __props.modalState.open }]) }, [createElementVNode("div", mergeProps({
35
38
  ref_key: "client",
36
39
  ref: client,
37
- "aria-label": "API Client",
40
+ "aria-label": unref(translate)("apiClient.modalClientContainer.label"),
38
41
  "aria-modal": "true"
39
42
  }, _ctx.$attrs, {
40
43
  class: "scalar-app-layout scalar-client",
@@ -43,7 +46,7 @@ var ModalClientContainer_vue_vue_type_script_setup_true_lang_default = /*@__PURE
43
46
  }), [createVNode(unref(ScalarTeleportRoot), null, {
44
47
  default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
45
48
  _: 3
46
- })], 16), createElementVNode("div", {
49
+ })], 16, _hoisted_2), createElementVNode("div", {
47
50
  class: "scalar-app-exit",
48
51
  onClick: _cache[0] || (_cache[0] = ($event) => __props.modalState.hide())
49
52
  })], 2)]);