@scalar/api-client 3.14.0 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/assets/computer.ascii.virtual.js.map +1 -1
- package/dist/components/HelpfulLink.vue.script.js +1 -1
- package/dist/components/HelpfulLink.vue.script.js.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.script.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js.map +1 -1
- package/dist/components/SectionFilter.vue.d.ts +1 -1
- package/dist/components/SectionFilter.vue.d.ts.map +1 -1
- package/dist/components/SectionFilter.vue.js +1 -1
- package/dist/components/SectionFilter.vue.script.js +2 -2
- package/dist/components/SectionFilter.vue.script.js.map +1 -1
- package/dist/components/SectionFilterButton.vue.script.js +1 -1
- package/dist/components/SectionFilterButton.vue.script.js.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.script.js +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.script.js.map +1 -1
- package/dist/components/Server/ServerVariablesSelect.vue.script.js +1 -1
- package/dist/components/Server/ServerVariablesSelect.vue.script.js.map +1 -1
- package/dist/components/Server/ServerVariablesTextbox.vue.script.js +1 -1
- package/dist/components/Server/ServerVariablesTextbox.vue.script.js.map +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.script.js +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.script.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.script.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.script.js.map +1 -1
- package/dist/hooks/use-file-dialog.js +2 -1
- package/dist/hooks/use-file-dialog.js.map +1 -1
- package/dist/plugins/posthog/index.js.map +1 -1
- package/dist/plugins/posthog/sanitize-event-payload.js +1 -1
- package/dist/plugins/posthog/sanitize-event-payload.js.map +1 -1
- package/dist/style.css +296 -273
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +4 -2
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/persist-response-cookies.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/response-cache.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +58 -29
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js +5 -3
- package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +6 -3
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +8 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +29 -16
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/files.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +10 -5
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-parameter-content.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-parameter-schema.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/group-by.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.d.ts +54 -0
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.js +56 -0
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.js.map +1 -0
- package/dist/v2/blocks/request-block/helpers/structured-body-codec.js +1 -1
- package/dist/v2/blocks/request-block/helpers/structured-body-codec.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/validate-parameter.js.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/extract-filename.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/get-content-length.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/media-types.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/prettify-jsonc-string.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/process-response-body.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js +7 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js +3 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js +3 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +5 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-callback.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-callback.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js +6 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js +5 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.script.js +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/code-variable-widget.js +1 -0
- package/dist/v2/components/code-input/code-variable-widget.js.map +1 -1
- package/dist/v2/components/code-input/helpers/build-pill-context.js.map +1 -1
- package/dist/v2/components/code-input/helpers/lookup-variable-value.js.map +1 -1
- package/dist/v2/components/code-input/helpers/pill-signature.js.map +1 -1
- package/dist/v2/components/code-input/helpers/serialize-value.js.map +1 -1
- package/dist/v2/components/context-menu/ContextMenu.vue.script.js +1 -1
- package/dist/v2/components/context-menu/ContextMenu.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTable.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTable.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableCell.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableCell.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableHeader.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableHeader.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js +3 -2
- package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableRow.vue.js +1 -1
- package/dist/v2/components/data-table/DataTableRow.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableText.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableText.vue.script.js.map +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.script.js +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.script.js.map +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.script.js +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.script.js +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.script.js.map +1 -1
- package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -1
- package/dist/v2/components/modals/DeleteModal.vue.script.js +1 -1
- package/dist/v2/components/modals/DeleteModal.vue.script.js.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.script.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
- package/dist/v2/components/resize/Resize.vue.js +1 -1
- package/dist/v2/components/resize/Resize.vue.script.js +1 -1
- package/dist/v2/components/resize/Resize.vue.script.js.map +1 -1
- package/dist/v2/components/resize/use-split-resize.js +4 -2
- package/dist/v2/components/resize/use-split-resize.js.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.script.js +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.js +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.script.js +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.script.js +3 -3
- package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.script.js +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue.script.js +1 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js +1 -1
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js +1 -1
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js.map +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.script.js +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/Environment.vue.script.js +1 -1
- package/dist/v2/features/environments/components/Environment.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js +3 -2
- package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +11 -0
- package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
- package/dist/v2/features/modal/helpers/map-hidden-clients-config.js.map +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js.map +1 -1
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js.map +1 -1
- package/dist/v2/features/modal/modal-events.js.map +1 -1
- package/dist/v2/features/operation/Operation.vue.script.js +1 -1
- package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts.map +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.js +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -1
- package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +1 -1
- package/dist/v2/features/search/components/SearchResult.vue.script.js +1 -1
- package/dist/v2/features/search/components/SearchResult.vue.script.js.map +1 -1
- package/dist/v2/features/search/helpers/create-fuse-instance.js.map +1 -1
- package/dist/v2/features/search/helpers/create-search-index.js.map +1 -1
- package/dist/v2/features/search/hooks/use-document-search.js.map +1 -1
- package/dist/v2/features/search/hooks/use-search-index.js.map +1 -1
- package/dist/v2/helpers/generate-location-id.js.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +1 -1
- package/dist/v2/helpers/handle-hotkeys.js.map +1 -1
- package/dist/v2/helpers/test-utils.js.map +1 -1
- package/dist/v2/hooks/use-global-hot-keys.js.map +1 -1
- package/dist/v2/hooks/use-scroll-lock.js.map +1 -1
- package/dist/v2/workspace-events.js.map +1 -1
- package/dist/vue-styles.css +227 -234
- package/package.json +20 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-variable-widget.js","names":[],"sources":["../../../../src/v2/components/code-input/code-variable-widget.ts"],"sourcesContent":["import { REGEX } from '@scalar/helpers/regex/regex-helpers'\nimport {\n Decoration,\n type DecorationSet,\n EditorView,\n RangeSetBuilder,\n ViewPlugin,\n type ViewUpdate,\n WidgetType,\n} from '@scalar/use-codemirror'\nimport { type ContextFunctionName, getContextFunctionComment } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { createApp } from 'vue'\n\nimport PillTooltipHost from './PillTooltipHost.vue'\nimport type { PillContext } from './pill-context'\n\n/**\n * Displays `{{name}}` as a pill: environment variables show the resolved value;\n * context functions (e.g. `{{$guid}}`) show that the value is generated at send time.\n */\nclass PillWidget extends WidgetType {\n private app: any\n private readonly pillColor: string\n private readonly variableInfo: PillContext\n\n constructor(\n private readonly variableName: string,\n environment: XScalarEnvironment | undefined,\n variant: PillContext['type'],\n ) {\n super()\n if (variant === 'contextFunction') {\n this.pillColor = 'var(--scalar-color-3)'\n this.variableInfo = {\n type: 'contextFunction',\n identifier: variableName,\n details: getContextFunctionComment(variableName as ContextFunctionName),\n }\n return\n }\n\n this.pillColor = environment?.color || 'var(--scalar-color-1)'\n\n const variable = environment?.variables?.find((v) => v.name === variableName)\n const value = variable ? (typeof variable.value === 'string' ? variable.value : variable.value?.default) : undefined\n this.variableInfo = {\n type: 'environment',\n name: variableName,\n value: value || 'No value',\n isDefined: Boolean(value),\n }\n }\n\n toDOM(): HTMLElement {\n const span = document.createElement('span')\n span.className = this.variableInfo.type === 'contextFunction' ? 'cm-pill cm-pill--context-fn' : 'cm-pill'\n span.textContent = this.variableName\n\n span.style.setProperty('--tw-bg-base', this.pillColor)\n\n if (this.variableInfo.type === 'environment') {\n span.style.opacity = this.variableInfo.isDefined ? '1' : '0.5'\n }\n\n // PillTooltipHost is renderless and attaches `useTooltip` listeners to\n // `target` directly — mount onto a throwaway container so the pill DOM\n // we just built is preserved.\n this.app = createApp(PillTooltipHost, {\n context: this.variableInfo,\n target: span,\n })\n this.app.mount(document.createElement('div'))\n\n return span\n }\n\n override destroy(): void {\n if (this.app) {\n this.app.unmount()\n this.app = null\n }\n }\n\n override eq(other: WidgetType): boolean {\n if (!(other instanceof PillWidget)) {\n return false\n }\n if (\n other.variableName !== this.variableName ||\n other.pillColor !== this.pillColor ||\n other.variableInfo.type !== this.variableInfo.type\n ) {\n return false\n }\n const a = other.variableInfo\n const b = this.variableInfo\n if (a.type !== b.type) {\n return false\n }\n if (a.type === 'environment' && b.type === 'environment') {\n return a.name === b.name && a.value === b.value && a.isDefined === b.isDefined\n }\n if (a.type === 'contextFunction' && b.type === 'contextFunction') {\n return a.identifier === b.identifier && a.details === b.details\n }\n return false\n }\n\n override ignoreEvent(): boolean {\n return false\n }\n}\n\n/**\n * Styles the active environment variable pill.\n * This plugin creates decorations for environment variables in the editor.\n */\nexport const pillPlugin = (props: {\n environment: XScalarEnvironment | undefined\n isReadOnly: boolean | undefined\n isContextFunctionName?: (name: string) => boolean\n}) =>\n ViewPlugin.fromClass(\n class {\n decorations: DecorationSet\n lastEnvironment: XScalarEnvironment | undefined\n\n constructor(view: EditorView) {\n this.lastEnvironment = props.environment\n this.decorations = this.buildDecorations(view)\n }\n\n update(update: ViewUpdate): void {\n // Rebuild decorations if environment changed\n if (props.environment !== this.lastEnvironment) {\n this.lastEnvironment = props.environment\n this.decorations = this.buildDecorations(update.view)\n return\n }\n\n // Only rebuild decorations if document or viewport changed\n if (update.docChanged || update.viewportChanged) {\n this.decorations = this.buildDecorations(update.view)\n }\n }\n\n buildDecorations(view: EditorView): DecorationSet {\n const builder = new RangeSetBuilder<Decoration>()\n const isContextFn = props.isContextFunctionName ?? (() => false)\n\n for (const { from, to } of view.visibleRanges) {\n const text = view.state.doc.sliceString(from, to)\n\n // Create a new regex instance to ensure lastIndex is reset\n const regex = new RegExp(REGEX.VARIABLES.source, REGEX.VARIABLES.flags)\n let match: RegExpExecArray | null\n\n while ((match = regex.exec(text)) !== null) {\n const start = from + match.index\n const end = start + match[0].length\n const variableName = match[1] ?? ''\n\n // Skip decorations that span line breaks as CodeMirror does not allow them\n const matchedText = view.state.doc.sliceString(start, end)\n if (matchedText.includes('\\n')) {\n continue\n }\n\n const variant: PillContext['type'] = isContextFn(variableName) ? 'contextFunction' : 'environment'\n\n builder.add(\n start,\n end,\n Decoration.widget({\n widget: new PillWidget(variableName, props.environment, variant),\n side: 1,\n }),\n )\n }\n }\n\n return builder.finish()\n }\n },\n {\n decorations: (v) => v.decorations,\n },\n )\n\n/**\n * Custom backspace handler for the editor.\n * Handles special cases like removing entire variable syntax and clearing all content.\n */\nexport const backspaceCommand = EditorView.domEventHandlers({\n keydown(event, view): boolean {\n if (event.key !== 'Backspace') {\n return false\n }\n\n const { state } = view\n const { from, to } = state.selection.main\n\n // When selecting all content and pressing backspace,\n // prevent breaking line content addition on pill removal\n if (from === 0 && to === state.doc.length) {\n view.dispatch({\n changes: { from: 0, to: state.doc.length },\n selection: { anchor: 0 },\n })\n event.preventDefault()\n return true\n }\n\n // When cursor is after a variable closing bracket (}}),\n // remove the entire closing syntax at once\n if (from === to && from >= 2) {\n const before = state.doc.sliceString(from - 2, from)\n if (before === '}}') {\n view.dispatch({\n changes: { from: from - 2, to: from },\n selection: { anchor: from - 2 },\n })\n event.preventDefault()\n return true\n }\n }\n\n return false\n },\n})\n"],"mappings":";;;;;;;;;;AA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,IAAI,WAAW,cAAc,MAAM,aAAa,QAAQ;KAChE,MAAM;KACP,CAAC,CACH;;;AAIL,SAAO,QAAQ,QAAQ;;GAG3B,EACE,cAAc,MAAM,EAAE,aACvB,CACF;;;;;AAMH,IAAa,mBAAmB,WAAW,iBAAiB,EAC1D,QAAQ,OAAO,MAAe;AAC5B,KAAI,MAAM,QAAQ,YAChB,QAAO;CAGT,MAAM,EAAE,UAAU;CAClB,MAAM,EAAE,MAAM,OAAO,MAAM,UAAU;AAIrC,KAAI,SAAS,KAAK,OAAO,MAAM,IAAI,QAAQ;AACzC,OAAK,SAAS;GACZ,SAAS;IAAE,MAAM;IAAG,IAAI,MAAM,IAAI;IAAQ;GAC1C,WAAW,EAAE,QAAQ,GAAG;GACzB,CAAC;AACF,QAAM,gBAAgB;AACtB,SAAO;;AAKT,KAAI,SAAS,MAAM,QAAQ;MACV,MAAM,IAAI,YAAY,OAAO,GAAG,KAAK,KACrC,MAAM;AACnB,QAAK,SAAS;IACZ,SAAS;KAAE,MAAM,OAAO;KAAG,IAAI;KAAM;IACrC,WAAW,EAAE,QAAQ,OAAO,GAAG;IAChC,CAAC;AACF,SAAM,gBAAgB;AACtB,UAAO;;;AAIX,QAAO;GAEV,CAAC"}
|
|
1
|
+
{"version":3,"file":"code-variable-widget.js","names":[],"sources":["../../../../src/v2/components/code-input/code-variable-widget.ts"],"sourcesContent":["import { REGEX } from '@scalar/helpers/regex/regex-helpers'\nimport {\n Decoration,\n type DecorationSet,\n EditorView,\n RangeSetBuilder,\n ViewPlugin,\n type ViewUpdate,\n WidgetType,\n} from '@scalar/use-codemirror'\nimport { type ContextFunctionName, getContextFunctionComment } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { createApp } from 'vue'\n\nimport PillTooltipHost from './PillTooltipHost.vue'\nimport type { PillContext } from './pill-context'\n\n/**\n * Displays `{{name}}` as a pill: environment variables show the resolved value;\n * context functions (e.g. `{{$guid}}`) show that the value is generated at send time.\n */\nclass PillWidget extends WidgetType {\n private app: any\n private readonly pillColor: string\n private readonly variableInfo: PillContext\n\n constructor(\n private readonly variableName: string,\n environment: XScalarEnvironment | undefined,\n variant: PillContext['type'],\n ) {\n super()\n if (variant === 'contextFunction') {\n this.pillColor = 'var(--scalar-color-3)'\n this.variableInfo = {\n type: 'contextFunction',\n identifier: variableName,\n details: getContextFunctionComment(variableName as ContextFunctionName),\n }\n return\n }\n\n this.pillColor = environment?.color || 'var(--scalar-color-1)'\n\n const variable = environment?.variables?.find((v) => v.name === variableName)\n const value = variable ? (typeof variable.value === 'string' ? variable.value : variable.value?.default) : undefined\n this.variableInfo = {\n type: 'environment',\n name: variableName,\n value: value || 'No value',\n isDefined: Boolean(value),\n }\n }\n\n toDOM(): HTMLElement {\n const span = document.createElement('span')\n span.className = this.variableInfo.type === 'contextFunction' ? 'cm-pill cm-pill--context-fn' : 'cm-pill'\n span.textContent = this.variableName\n\n span.style.setProperty('--tw-bg-base', this.pillColor)\n\n if (this.variableInfo.type === 'environment') {\n span.style.opacity = this.variableInfo.isDefined ? '1' : '0.5'\n }\n\n // PillTooltipHost is renderless and attaches `useTooltip` listeners to\n // `target` directly — mount onto a throwaway container so the pill DOM\n // we just built is preserved.\n this.app = createApp(PillTooltipHost, {\n context: this.variableInfo,\n target: span,\n })\n this.app.mount(document.createElement('div'))\n\n return span\n }\n\n override destroy(): void {\n if (this.app) {\n this.app.unmount()\n this.app = null\n }\n }\n\n override eq(other: WidgetType): boolean {\n if (!(other instanceof PillWidget)) {\n return false\n }\n if (\n other.variableName !== this.variableName ||\n other.pillColor !== this.pillColor ||\n other.variableInfo.type !== this.variableInfo.type\n ) {\n return false\n }\n const a = other.variableInfo\n const b = this.variableInfo\n if (a.type !== b.type) {\n return false\n }\n if (a.type === 'environment' && b.type === 'environment') {\n return a.name === b.name && a.value === b.value && a.isDefined === b.isDefined\n }\n if (a.type === 'contextFunction' && b.type === 'contextFunction') {\n return a.identifier === b.identifier && a.details === b.details\n }\n return false\n }\n\n override ignoreEvent(): boolean {\n return false\n }\n}\n\n/**\n * Styles the active environment variable pill.\n * This plugin creates decorations for environment variables in the editor.\n */\nexport const pillPlugin = (props: {\n environment: XScalarEnvironment | undefined\n isReadOnly: boolean | undefined\n isContextFunctionName?: (name: string) => boolean\n}) =>\n ViewPlugin.fromClass(\n class {\n decorations: DecorationSet\n lastEnvironment: XScalarEnvironment | undefined\n\n constructor(view: EditorView) {\n this.lastEnvironment = props.environment\n this.decorations = this.buildDecorations(view)\n }\n\n update(update: ViewUpdate): void {\n // Rebuild decorations if environment changed\n if (props.environment !== this.lastEnvironment) {\n this.lastEnvironment = props.environment\n this.decorations = this.buildDecorations(update.view)\n return\n }\n\n // Only rebuild decorations if document or viewport changed\n if (update.docChanged || update.viewportChanged) {\n this.decorations = this.buildDecorations(update.view)\n }\n }\n\n buildDecorations(view: EditorView): DecorationSet {\n const builder = new RangeSetBuilder<Decoration>()\n const isContextFn = props.isContextFunctionName ?? (() => false)\n\n for (const { from, to } of view.visibleRanges) {\n const text = view.state.doc.sliceString(from, to)\n\n // Create a new regex instance to ensure lastIndex is reset\n const regex = new RegExp(REGEX.VARIABLES.source, REGEX.VARIABLES.flags)\n let match: RegExpExecArray | null\n\n while ((match = regex.exec(text)) !== null) {\n const start = from + match.index\n const end = start + match[0].length\n const variableName = match[1] ?? ''\n\n // Skip decorations that span line breaks as CodeMirror does not allow them\n const matchedText = view.state.doc.sliceString(start, end)\n if (matchedText.includes('\\n')) {\n continue\n }\n\n const variant: PillContext['type'] = isContextFn(variableName) ? 'contextFunction' : 'environment'\n\n builder.add(\n start,\n end,\n Decoration.widget({\n widget: new PillWidget(variableName, props.environment, variant),\n side: 1,\n }),\n )\n }\n }\n\n return builder.finish()\n }\n },\n {\n decorations: (v) => v.decorations,\n },\n )\n\n/**\n * Custom backspace handler for the editor.\n * Handles special cases like removing entire variable syntax and clearing all content.\n */\nexport const backspaceCommand = EditorView.domEventHandlers({\n keydown(event, view): boolean {\n if (event.key !== 'Backspace') {\n return false\n }\n\n const { state } = view\n const { from, to } = state.selection.main\n\n // When selecting all content and pressing backspace,\n // prevent breaking line content addition on pill removal\n if (from === 0 && to === state.doc.length) {\n view.dispatch({\n changes: { from: 0, to: state.doc.length },\n selection: { anchor: 0 },\n })\n event.preventDefault()\n return true\n }\n\n // When cursor is after a variable closing bracket (}}),\n // remove the entire closing syntax at once\n if (from === to && from >= 2) {\n const before = state.doc.sliceString(from - 2, from)\n if (before === '}}') {\n view.dispatch({\n changes: { from: from - 2, to: from },\n selection: { anchor: from - 2 },\n })\n event.preventDefault()\n return true\n }\n }\n\n return false\n },\n})\n"],"mappings":";;;;;;;;;;AAqBA,IAAM,aAAN,MAAM,mBAAmB,WAAW;CAMf;CALnB;CACA;CACA;CAEA,YACE,cACA,aACA,SACA;EACA,MAAM;EAJW,KAAA,eAAA;EAKjB,IAAI,YAAY,mBAAmB;GACjC,KAAK,YAAY;GACjB,KAAK,eAAe;IAClB,MAAM;IACN,YAAY;IACZ,SAAS,0BAA0B,YAAmC;GACxE;GACA;EACF;EAEA,KAAK,YAAY,aAAa,SAAS;EAEvC,MAAM,WAAW,aAAa,WAAW,MAAM,MAAM,EAAE,SAAS,YAAY;EAC5E,MAAM,QAAQ,WAAY,OAAO,SAAS,UAAU,WAAW,SAAS,QAAQ,SAAS,OAAO,UAAW,KAAA;EAC3G,KAAK,eAAe;GAClB,MAAM;GACN,MAAM;GACN,OAAO,SAAS;GAChB,WAAW,QAAQ,KAAK;EAC1B;CACF;CAEA,QAAqB;EACnB,MAAM,OAAO,SAAS,cAAc,MAAM;EAC1C,KAAK,YAAY,KAAK,aAAa,SAAS,oBAAoB,gCAAgC;EAChG,KAAK,cAAc,KAAK;EAExB,KAAK,MAAM,YAAY,gBAAgB,KAAK,SAAS;EAErD,IAAI,KAAK,aAAa,SAAS,eAC7B,KAAK,MAAM,UAAU,KAAK,aAAa,YAAY,MAAM;EAM3D,KAAK,M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MAAM,eAAe;GACrB,OAAO;EACT;;CAGF,OAAO;AACT,EACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-pill-context.js","names":[],"sources":["../../../../../src/v2/components/code-input/helpers/build-pill-context.ts"],"sourcesContent":["import {\n type ContextFunctionName,\n getContextFunctionComment,\n isContextFunctionName,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\n\nimport type { PillContext } from '../pill-context'\nimport { lookupVariableValue } from './lookup-variable-value'\n\n/**\n * Build the tooltip context shown when hovering a pill.\n *\n * `{{$contextFunctions}}` describe what they generate at send time, while\n * regular environment variables show the resolved value (or a \"not defined\"\n * fallback when the environment does not declare them).\n */\nexport const buildPillContext = (variableName: string, environment: XScalarEnvironment | undefined): PillContext => {\n if (isContextFunctionName(variableName)) {\n return {\n type: 'contextFunction',\n identifier: variableName,\n details: getContextFunctionComment(variableName as ContextFunctionName),\n }\n }\n const value = lookupVariableValue(environment, variableName)\n return {\n type: 'environment',\n name: variableName,\n value: value || 'No value',\n isDefined: Boolean(value),\n }\n}\n"],"mappings":";;;;;;;;;;AAiBA,IAAa,oBAAoB,cAAsB,gBAA6D;
|
|
1
|
+
{"version":3,"file":"build-pill-context.js","names":[],"sources":["../../../../../src/v2/components/code-input/helpers/build-pill-context.ts"],"sourcesContent":["import {\n type ContextFunctionName,\n getContextFunctionComment,\n isContextFunctionName,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\n\nimport type { PillContext } from '../pill-context'\nimport { lookupVariableValue } from './lookup-variable-value'\n\n/**\n * Build the tooltip context shown when hovering a pill.\n *\n * `{{$contextFunctions}}` describe what they generate at send time, while\n * regular environment variables show the resolved value (or a \"not defined\"\n * fallback when the environment does not declare them).\n */\nexport const buildPillContext = (variableName: string, environment: XScalarEnvironment | undefined): PillContext => {\n if (isContextFunctionName(variableName)) {\n return {\n type: 'contextFunction',\n identifier: variableName,\n details: getContextFunctionComment(variableName as ContextFunctionName),\n }\n }\n const value = lookupVariableValue(environment, variableName)\n return {\n type: 'environment',\n name: variableName,\n value: value || 'No value',\n isDefined: Boolean(value),\n }\n}\n"],"mappings":";;;;;;;;;;AAiBA,IAAa,oBAAoB,cAAsB,gBAA6D;CAClH,IAAI,sBAAsB,YAAY,GACpC,OAAO;EACL,MAAM;EACN,YAAY;EACZ,SAAS,0BAA0B,YAAmC;CACxE;CAEF,MAAM,QAAQ,oBAAoB,aAAa,YAAY;CAC3D,OAAO;EACL,MAAM;EACN,MAAM;EACN,OAAO,SAAS;EAChB,WAAW,QAAQ,KAAK;CAC1B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-variable-value.js","names":[],"sources":["../../../../../src/v2/components/code-input/helpers/lookup-variable-value.ts"],"sourcesContent":["import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\n\n/**\n * Resolve a variable name to its value in the given environment, if any.\n *\n * Variable values can be a plain string or a structured object with a\n * `default` field (and optional metadata such as `description`); both shapes\n * are flattened to a single string here. Returns `undefined` when the\n * environment is missing or does not declare the variable.\n */\nexport const lookupVariableValue = (environment: XScalarEnvironment | undefined, name: string): string | undefined => {\n const variable = environment?.variables?.find((entry) => entry.name === name)\n if (!variable) {\n return undefined\n }\n return typeof variable.value === 'string' ? variable.value : variable.value?.default\n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,uBAAuB,aAA6C,SAAqC;CACpH,MAAM,WAAW,aAAa,WAAW,MAAM,UAAU,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"lookup-variable-value.js","names":[],"sources":["../../../../../src/v2/components/code-input/helpers/lookup-variable-value.ts"],"sourcesContent":["import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\n\n/**\n * Resolve a variable name to its value in the given environment, if any.\n *\n * Variable values can be a plain string or a structured object with a\n * `default` field (and optional metadata such as `description`); both shapes\n * are flattened to a single string here. Returns `undefined` when the\n * environment is missing or does not declare the variable.\n */\nexport const lookupVariableValue = (environment: XScalarEnvironment | undefined, name: string): string | undefined => {\n const variable = environment?.variables?.find((entry) => entry.name === name)\n if (!variable) {\n return undefined\n }\n return typeof variable.value === 'string' ? variable.value : variable.value?.default\n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,uBAAuB,aAA6C,SAAqC;CACpH,MAAM,WAAW,aAAa,WAAW,MAAM,UAAU,MAAM,SAAS,IAAI;CAC5E,IAAI,CAAC,UACH;CAEF,OAAO,OAAO,SAAS,UAAU,WAAW,SAAS,QAAQ,SAAS,OAAO;AAC/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pill-signature.js","names":[],"sources":["../../../../../src/v2/components/code-input/helpers/pill-signature.ts"],"sourcesContent":["import { REGEX } from '@scalar/helpers/regex/regex-helpers'\n\n/**\n * Build a structural signature for a model string.\n *\n * Two values produce the same signature iff their sequence of `{{name}}`\n * pills is identical. The editor uses this to skip a DOM rebuild for\n * plain-text edits that do not change the pill set, which preserves the\n * live caret and avoids any flicker.\n *\n * Returns an empty signature when pill rendering is disabled or the text\n * contains no pill markers — both cases share a single \"no pills\" bucket.\n */\nexport const pillSignature = (text: string, withVariables: boolean): string => {\n if (!withVariables || !text.includes('{{')) {\n return ''\n }\n const regex = new RegExp(REGEX.VARIABLES.source, REGEX.VARIABLES.flags)\n let signature = ''\n let match: RegExpExecArray | null\n while ((match = regex.exec(text)) !== null) {\n signature += `|${match[1] ?? ''}`\n }\n return signature\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,iBAAiB,MAAc,kBAAmC;
|
|
1
|
+
{"version":3,"file":"pill-signature.js","names":[],"sources":["../../../../../src/v2/components/code-input/helpers/pill-signature.ts"],"sourcesContent":["import { REGEX } from '@scalar/helpers/regex/regex-helpers'\n\n/**\n * Build a structural signature for a model string.\n *\n * Two values produce the same signature iff their sequence of `{{name}}`\n * pills is identical. The editor uses this to skip a DOM rebuild for\n * plain-text edits that do not change the pill set, which preserves the\n * live caret and avoids any flicker.\n *\n * Returns an empty signature when pill rendering is disabled or the text\n * contains no pill markers — both cases share a single \"no pills\" bucket.\n */\nexport const pillSignature = (text: string, withVariables: boolean): string => {\n if (!withVariables || !text.includes('{{')) {\n return ''\n }\n const regex = new RegExp(REGEX.VARIABLES.source, REGEX.VARIABLES.flags)\n let signature = ''\n let match: RegExpExecArray | null\n while ((match = regex.exec(text)) !== null) {\n signature += `|${match[1] ?? ''}`\n }\n return signature\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,iBAAiB,MAAc,kBAAmC;CAC7E,IAAI,CAAC,iBAAiB,CAAC,KAAK,SAAS,IAAI,GACvC,OAAO;CAET,MAAM,QAAQ,IAAI,OAAO,MAAM,UAAU,QAAQ,MAAM,UAAU,KAAK;CACtE,IAAI,YAAY;CAChB,IAAI;CACJ,QAAQ,QAAQ,MAAM,KAAK,IAAI,OAAO,MACpC,aAAa,IAAI,MAAM,MAAM;CAE/B,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize-value.js","names":[],"sources":["../../../../../src/v2/components/code-input/helpers/serialize-value.ts"],"sourcesContent":["import type { CodeInputModelValue } from '../CodeInput.vue'\n\n/**\n * Convert any model value to a string suitable for the editor's serialized form.\n *\n * Strings pass through untouched, nullish values become an empty string, and\n * everything else is JSON-stringified so booleans, numbers, arrays, and\n * objects round-trip predictably through the editor.\n */\nexport const serializeValue = (value: CodeInputModelValue): string => {\n if (typeof value === 'string') {\n return value\n }\n if (value == null) {\n return ''\n }\n return JSON.stringify(value)\n}\n"],"mappings":";;;;;;;;AASA,IAAa,kBAAkB,UAAuC;
|
|
1
|
+
{"version":3,"file":"serialize-value.js","names":[],"sources":["../../../../../src/v2/components/code-input/helpers/serialize-value.ts"],"sourcesContent":["import type { CodeInputModelValue } from '../CodeInput.vue'\n\n/**\n * Convert any model value to a string suitable for the editor's serialized form.\n *\n * Strings pass through untouched, nullish values become an empty string, and\n * everything else is JSON-stringified so booleans, numbers, arrays, and\n * objects round-trip predictably through the editor.\n */\nexport const serializeValue = (value: CodeInputModelValue): string => {\n if (typeof value === 'string') {\n return value\n }\n if (value == null) {\n return ''\n }\n return JSON.stringify(value)\n}\n"],"mappings":";;;;;;;;AASA,IAAa,kBAAkB,UAAuC;CACpE,IAAI,OAAO,UAAU,UACnB,OAAO;CAET,IAAI,SAAS,MACX,OAAO;CAET,OAAO,KAAK,UAAU,KAAK;AAC7B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createBlock, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
2
2
|
import { ContextMenuContent, ContextMenuItem, ContextMenuPortal, ContextMenuRoot, ContextMenuTrigger } from "radix-vue";
|
|
3
3
|
//#region src/v2/components/context-menu/ContextMenu.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var ContextMenu_vue_vue_type_script_setup_true_lang_default =
|
|
4
|
+
var ContextMenu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
5
|
__name: "ContextMenu",
|
|
6
6
|
props: {
|
|
7
7
|
align: { default: "center" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.vue.script.js","names":[],"sources":["../../../../src/v2/components/context-menu/ContextMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuPortal,\n ContextMenuRoot,\n ContextMenuTrigger,\n} from 'radix-vue'\n\nconst props = withDefaults(\n defineProps<{\n align?: 'start' | 'center' | 'end'\n side?: 'top' | 'right' | 'bottom' | 'left'\n sideOffset?: number\n disabled?: boolean\n triggerClass?: string\n }>(),\n {\n side: 'bottom',\n align: 'center',\n disabled: false,\n },\n)\n</script>\n\n<template>\n <ContextMenuRoot>\n <ContextMenuTrigger\n :class=\"triggerClass\"\n :disabled=\"props.disabled\">\n <slot name=\"trigger\" />\n </ContextMenuTrigger>\n <ContextMenuPortal>\n <ContextMenuContent\n :align=\"props.align\"\n class=\"scalar-api-client-context-menu\"\n :side=\"props.side\"\n :sideOffset=\"props.sideOffset\">\n <ContextMenuItem>\n <slot name=\"content\" />\n </ContextMenuItem>\n </ContextMenuContent>\n </ContextMenuPortal>\n </ContextMenuRoot>\n</template>\n\n<style>\n@reference \"@/style.css\";\n\n/**\n * The content wrapper (data-radix-popper-content-wrapper) creates\n * a new stacking context, so we need to override the z-index there.\n * We need to target our own context menu class to keep the styles from\n * leaking out and affecting other Radix UI components.\n */\n[data-radix-popper-content-wrapper]:has(.scalar-api-client-context-menu) {\n /**\n * We have to use important because Radix UI sets the z-index in a style\n * attribute on the content wrapper.\n */\n @apply z-context!;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;;uBAiBZ,YAiBkB,MAAA,
|
|
1
|
+
{"version":3,"file":"ContextMenu.vue.script.js","names":[],"sources":["../../../../src/v2/components/context-menu/ContextMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuPortal,\n ContextMenuRoot,\n ContextMenuTrigger,\n} from 'radix-vue'\n\nconst props = withDefaults(\n defineProps<{\n align?: 'start' | 'center' | 'end'\n side?: 'top' | 'right' | 'bottom' | 'left'\n sideOffset?: number\n disabled?: boolean\n triggerClass?: string\n }>(),\n {\n side: 'bottom',\n align: 'center',\n disabled: false,\n },\n)\n</script>\n\n<template>\n <ContextMenuRoot>\n <ContextMenuTrigger\n :class=\"triggerClass\"\n :disabled=\"props.disabled\">\n <slot name=\"trigger\" />\n </ContextMenuTrigger>\n <ContextMenuPortal>\n <ContextMenuContent\n :align=\"props.align\"\n class=\"scalar-api-client-context-menu\"\n :side=\"props.side\"\n :sideOffset=\"props.sideOffset\">\n <ContextMenuItem>\n <slot name=\"content\" />\n </ContextMenuItem>\n </ContextMenuContent>\n </ContextMenuPortal>\n </ContextMenuRoot>\n</template>\n\n<style>\n@reference \"@/style.css\";\n\n/**\n * The content wrapper (data-radix-popper-content-wrapper) creates\n * a new stacking context, so we need to override the z-index there.\n * We need to target our own context menu class to keep the styles from\n * leaking out and affecting other Radix UI components.\n */\n[data-radix-popper-content-wrapper]:has(.scalar-api-client-context-menu) {\n /**\n * We have to use important because Radix UI sets the z-index in a style\n * attribute on the content wrapper.\n */\n @apply z-context!;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;;uBAiBZ,YAiBkB,MAAA,eAAA,GAAA,MAAA;2BAZK,CAJrB,YAIqB,MAAA,kBAAA,GAAA;KAHlB,OAAK,eAAE,QAAA,YAAY;KACnB,UAAU,MAAM;;4BACM,CAAvB,WAAuB,KAAA,QAAA,SAAA,CAAA,CAAA;;kCAEzB,YAUoB,MAAA,iBAAA,GAAA,MAAA;4BADG,CARrB,YAQqB,MAAA,kBAAA,GAAA;MAPlB,OAAO,MAAM;MACd,OAAM;MACL,MAAM,MAAM;MACZ,YAAY,MAAM;;6BAGD,CAFlB,YAEkB,MAAA,eAAA,GAAA,MAAA;8BADO,CAAvB,WAAuB,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -6,7 +6,7 @@ var _hoisted_2 = {
|
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "sr-only"
|
|
8
8
|
};
|
|
9
|
-
var DataTable_vue_vue_type_script_setup_true_lang_default =
|
|
9
|
+
var DataTable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
10
10
|
__name: "DataTable",
|
|
11
11
|
props: {
|
|
12
12
|
columns: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.vue.script.js","names":["$slots"],"sources":["../../../../src/v2/components/data-table/DataTable.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\ndefineProps<{\n columns: (string | undefined)[]\n /** Scroll horizontally */\n scroll?: boolean\n /** Presentational table */\n presentational?: boolean\n}>()\nconst { cx } = useBindCx()\n</script>\n<template>\n <div\n v-bind=\"\n cx(\n scroll ? 'overflow-x-auto custom-scroll' : 'overflow-visible',\n 'scalar-data-table',\n )\n \">\n <table\n class=\"mb-0 grid min-h-8 auto-rows-auto\"\n :class=\"{ 'w-max min-w-full': scroll }\"\n :role=\"presentational ? 'presentation' : 'table'\"\n :style=\"{\n gridTemplateColumns: columns.map((col) => col || '1fr').join(' '),\n }\">\n <caption\n v-if=\"$slots.caption\"\n class=\"sr-only\">\n <slot name=\"caption\" />\n </caption>\n <slot />\n </table>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAUA,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"DataTable.vue.script.js","names":["$slots"],"sources":["../../../../src/v2/components/data-table/DataTable.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\ndefineProps<{\n columns: (string | undefined)[]\n /** Scroll horizontally */\n scroll?: boolean\n /** Presentational table */\n presentational?: boolean\n}>()\nconst { cx } = useBindCx()\n</script>\n<template>\n <div\n v-bind=\"\n cx(\n scroll ? 'overflow-x-auto custom-scroll' : 'overflow-visible',\n 'scalar-data-table',\n )\n \">\n <table\n class=\"mb-0 grid min-h-8 auto-rows-auto\"\n :class=\"{ 'w-max min-w-full': scroll }\"\n :role=\"presentational ? 'presentation' : 'table'\"\n :style=\"{\n gridTemplateColumns: columns.map((col) => col || '1fr').join(' '),\n }\">\n <caption\n v-if=\"$slots.caption\"\n class=\"sr-only\">\n <slot name=\"caption\" />\n </caption>\n <slot />\n </table>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAUA,MAAM,EAAE,OAAO,UAAU;;uBAGvB,mBAqBM,OAAA,eAAA,mBApBW,MAAA,EAAA,CAAE,CAAU,QAAA,SAAM,kCAAA,oBAAA,mBAAA,CAAA,CAAA,GAAA,CAMjC,mBAaQ,SAAA;IAZN,OAAK,eAAA,CAAC,oCAAkC,EAAA,oBACV,QAAA,OAAM,CAAA,CAAA;IACnC,MAAM,QAAA,iBAAc,iBAAA;IACpB,OAAK,eAAA,EAAA,qBAAiC,QAAA,QAAQ,KAAK,QAAQ,OAAG,KAAA,CAAA,CAAW,KAAI,GAAA,EAAA,CAAA;OAItEA,KAAAA,OAAO,WAAA,UAAA,GADf,mBAIU,WAJV,YAIU,CADR,WAAuB,KAAA,QAAA,SAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,GAEzB,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,IAAA,UAAA,CAAA,GAAA,EAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, unref, withCtx } from "vue";
|
|
2
2
|
import { useBindCx } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
//#region src/v2/components/data-table/DataTableCell.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var DataTableCell_vue_vue_type_script_setup_true_lang_default =
|
|
4
|
+
var DataTableCell_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
5
|
inheritAttrs: false,
|
|
6
6
|
__name: "DataTableCell",
|
|
7
7
|
props: { is: { default: "td" } },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableCell.vue.script.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nwithDefaults(\n defineProps<{\n is?: string | Component\n }>(),\n { is: 'td' },\n)\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"\n cx(\n 'box-content max-h-8 min-h-8 min-w-8 border-l-0 border-t border-b-0 border-r flex text-base/5 last:border-r-0 group-last:border-b-transparent p-0 m-0 relative',\n )\n \"\n class=\"group-[.alert]:bg-b-alert group-[.error]:bg-b-danger\">\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;EAYA,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"DataTableCell.vue.script.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nwithDefaults(\n defineProps<{\n is?: string | Component\n }>(),\n { is: 'td' },\n)\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"\n cx(\n 'box-content max-h-8 min-h-8 min-w-8 border-l-0 border-t border-b-0 border-r flex text-base/5 last:border-r-0 group-last:border-b-transparent p-0 m-0 relative',\n )\n \"\n class=\"group-[.alert]:bg-b-alert group-[.error]:bg-b-danger\">\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;EAYA,MAAM,EAAE,OAAO,UAAU;;uBAGvB,YASY,wBARL,QAAA,EAAE,GADT,WAEiB,MAAA,EAAA,CAAE,CAAA,+JAAA,GAAA,EAKjB,OAAM,uDAAsD,CAAA,GAAA;2BACpD,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -8,7 +8,7 @@ var _hoisted_1 = [
|
|
|
8
8
|
"checked",
|
|
9
9
|
"disabled"
|
|
10
10
|
];
|
|
11
|
-
var DataTableCheckbox_vue_vue_type_script_setup_true_lang_default =
|
|
11
|
+
var DataTableCheckbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
12
12
|
__name: "DataTableCheckbox",
|
|
13
13
|
props: {
|
|
14
14
|
modelValue: { type: Boolean },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableCheckbox.vue.script.js","names":["$emit"],"sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { cva } from '@scalar/use-hooks/useBindCx'\n\nimport DataTableCell from './DataTableCell.vue'\n\nwithDefaults(\n defineProps<{\n modelValue: boolean\n disabled?: boolean\n align?: 'left' | 'center'\n ariaLabel?: string\n }>(),\n {\n align: 'center',\n ariaLabel: 'Toggle',\n },\n)\n\ndefineEmits<{\n (e: 'update:modelValue', v: boolean): void\n}>()\n\nconst variants = cva({\n base: 'w-8 h-8 flex items-center justify-center text-b-2 peer-checked:text-c-1 pointer-events-none absolute',\n variants: {\n align: {\n left: 'left-0',\n center: 'centered',\n },\n },\n})\n</script>\n<template>\n <DataTableCell class=\"group/cell relative flex min-w-8\">\n <input\n :aria-label=\"ariaLabel\"\n :checked=\"modelValue\"\n class=\"peer absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-default\"\n :disabled=\"Boolean(disabled)\"\n type=\"checkbox\"\n @change=\"(e: any) => $emit('update:modelValue', e.target.checked)\" />\n <div :class=\"variants({ align })\">\n <div\n class=\"absolute m-auto size-3/4 rounded border-[1px] opacity-0\"\n :class=\"\n !disabled &&\n 'group-has-[:focus-visible]/cell:border-c-accent group-hover:opacity-100 group-has-[:focus-visible]/cell:opacity-100'\n \" />\n <ScalarIcon\n icon=\"Checkmark\"\n size=\"xs\"\n thickness=\"2.5\" />\n </div>\n </DataTableCell>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,OAAO;IACL,MAAM;IACN,QAAQ;
|
|
1
|
+
{"version":3,"file":"DataTableCheckbox.vue.script.js","names":["$emit"],"sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { cva } from '@scalar/use-hooks/useBindCx'\n\nimport DataTableCell from './DataTableCell.vue'\n\nwithDefaults(\n defineProps<{\n modelValue: boolean\n disabled?: boolean\n align?: 'left' | 'center'\n ariaLabel?: string\n }>(),\n {\n align: 'center',\n ariaLabel: 'Toggle',\n },\n)\n\ndefineEmits<{\n (e: 'update:modelValue', v: boolean): void\n}>()\n\nconst variants = cva({\n base: 'w-8 h-8 flex items-center justify-center text-b-2 peer-checked:text-c-1 pointer-events-none absolute',\n variants: {\n align: {\n left: 'left-0',\n center: 'centered',\n },\n },\n})\n</script>\n<template>\n <DataTableCell class=\"group/cell relative flex min-w-8\">\n <input\n :aria-label=\"ariaLabel\"\n :checked=\"modelValue\"\n class=\"peer absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-default\"\n :disabled=\"Boolean(disabled)\"\n type=\"checkbox\"\n @change=\"(e: any) => $emit('update:modelValue', e.target.checked)\" />\n <div :class=\"variants({ align })\">\n <div\n class=\"absolute m-auto size-3/4 rounded border-[1px] opacity-0\"\n :class=\"\n !disabled &&\n 'group-has-[:focus-visible]/cell:border-c-accent group-hover:opacity-100 group-has-[:focus-visible]/cell:opacity-100'\n \" />\n <ScalarIcon\n icon=\"Checkmark\"\n size=\"xs\"\n thickness=\"2.5\" />\n </div>\n </DataTableCell>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,OAAO;IACL,MAAM;IACN,QAAQ;GACV,EACF;EACF,CAAC;;uBAGC,YAoBgB,uBAAA,EApBD,OAAM,mCAAkC,GAAA;2BAOkB,CANvE,mBAMuE,SAAA;KALpE,cAAY,QAAA;KACZ,SAAS,QAAA;KACV,OAAM;KACL,UAAU,QAAQ,QAAA,QAAQ;KAC3B,MAAK;KACJ,UAAM,OAAA,OAAA,OAAA,MAAG,MAAWA,KAAAA,MAAK,qBAAsB,EAAE,OAAO,OAAO;8BAClE,mBAWM,OAAA,EAXA,OAAK,eAAE,MAAA,QAAA,CAAQ,CAAA,EAAA,OAAG,QAAA,MAAK,CAAA,CAAA,EAAA,GAAA,CAC3B,mBAKM,OAAA,EAJJ,OAAK,eAAA,CAAC,2DAAA,CACc,QAAA,YAAA,qHAAA,CAAA,EAAA,GAAA,MAAA,CAAA,GAItB,YAGoB,MAAA,UAAA,GAAA;KAFlB,MAAK;KACL,MAAK;KACL,WAAU"}
|
|
@@ -2,7 +2,7 @@ import DataTableCell_default from "./DataTableCell.vue.js";
|
|
|
2
2
|
import { createBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
3
3
|
import { useBindCx } from "@scalar/use-hooks/useBindCx";
|
|
4
4
|
//#region src/v2/components/data-table/DataTableHeader.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var DataTableHeader_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var DataTableHeader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
__name: "DataTableHeader",
|
|
7
7
|
setup(__props) {
|
|
8
8
|
const { cx } = useBindCx();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableHeader.vue.script.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport DataTableCell from './DataTableCell.vue'\n\nconst { cx } = useBindCx()\n</script>\n<template>\n <DataTableCell\n is=\"th\"\n v-bind=\"cx('items-center font-medium px-2 min-w-0 -outline-offset-1')\">\n <slot />\n </DataTableCell>\n</template>\n"],"mappings":";;;;;;;EAKA,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"DataTableHeader.vue.script.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport DataTableCell from './DataTableCell.vue'\n\nconst { cx } = useBindCx()\n</script>\n<template>\n <DataTableCell\n is=\"th\"\n v-bind=\"cx('items-center font-medium px-2 min-w-0 -outline-offset-1')\">\n <slot />\n </DataTableCell>\n</template>\n"],"mappings":";;;;;;;EAKA,MAAM,EAAE,OAAO,UAAU;;uBAGvB,YAIgB,uBAJhB,WAIgB,EAHd,IAAG,KAAI,GACC,MAAA,EAAA,CAAE,CAAA,yDAAA,CAAA,GAAA;2BACF,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"names":[],"mappings":"AAkLA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM/C,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,sEAAsE;IACtE,cAAc,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,0EAA0E;IAC1E,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,4FAA4F;IAC5F,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"names":[],"mappings":"AAkLA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EA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C,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 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 =
|
|
5
|
+
var DataTableInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(DataTableInput_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a6f4752a"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DataTableInput_default as default };
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ var _hoisted_4 = {
|
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "centered-y text-orange absolute right-7 text-xs"
|
|
18
18
|
};
|
|
19
|
-
var DataTableInput_vue_vue_type_script_setup_true_lang_default =
|
|
19
|
+
var DataTableInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
20
20
|
inheritAttrs: false,
|
|
21
21
|
__name: "DataTableInput",
|
|
22
22
|
props: {
|
|
@@ -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,
|
|
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,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AW,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;
|
|
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"}
|
|
@@ -9,7 +9,7 @@ var _hoisted_2 = { class: "text-c-1 whitespace-nowrap" };
|
|
|
9
9
|
var _hoisted_3 = { class: "text-c-1 overflow-hidden text-ellipsis" };
|
|
10
10
|
var _hoisted_4 = { class: "overflow-hidden text-ellipsis" };
|
|
11
11
|
var _hoisted_5 = { class: "flex h-4 w-4 items-center justify-center" };
|
|
12
|
-
var DataTableInputSelect_vue_vue_type_script_setup_true_lang_default =
|
|
12
|
+
var DataTableInputSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
13
13
|
__name: "DataTableInputSelect",
|
|
14
14
|
props: {
|
|
15
15
|
modelValue: { type: [
|
|
@@ -82,7 +82,8 @@ var DataTableInputSelect_vue_vue_type_script_setup_true_lang_default = /* @__PUR
|
|
|
82
82
|
});
|
|
83
83
|
/** Update the model value when the selected options change */
|
|
84
84
|
const updateSelectedOptions = (selectedOptions) => {
|
|
85
|
-
|
|
85
|
+
const selectedValues = selectedOptions.map((option) => option.value);
|
|
86
|
+
emit("update:modelValue", selectedValues.join(","));
|
|
86
87
|
};
|
|
87
88
|
return (_ctx, _cache) => {
|
|
88
89
|
return openBlock(), createElementBlock("div", _hoisted_1, [__props.type === "array" ? (openBlock(), createBlock(unref(ScalarComboboxMultiselect), {
|
|
@@ -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,
|
|
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/B,kBAAkB,QAAQ;EAC5B;EAEA,MAAM,uBAAuB;GAC3B,IAAI,YAAY,MAAM,KAAK,GACzB,eAAe,YAAY,KAAK;EAEpC;EAEA,MAAM,mBAAmB;GACvB,IAAI,CAAC,YAAY,MAAM,KAAK,GAC1B,KAAK,qBAAqB,EAAE;GAE9B,kBAAkB,QAAQ;EAC5B;EAEA,MAAM,cAAc,UAAkB;GACpC,OAAO,MAAM,WAAW,SAAS,MAAM;EACzC;EAEA,MAAM,oBAAoB,aAAa;GACrC,IAAI,UACF,eAAe;IACb,SAAS,OAAO,MAAM;GACxB,CAAC;EAEL,CAAC;EAED,MAAM,eAAe,eAAe;GAClC,OAAO,MAAM,eAAe,KAAA,IAAY,MAAM,aAAa,MAAM;EACnE,CAAC;;EAGD,MAAM,eAAe,eACnB,QAAQ,MAAM,KAAK,WAAW;GAC5B,MAAM,KAAK,OAAO,SAAS;GAC3B,OAAO;IAAM;IAAI,OAA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B,KAAK;MACN,OAAM;MACL,OAAO;MACP,UAAK,WAAE,eAAe,MAAM;;6BAYvB,CAXN,mBAWM,OAAA,EAVJ,OAAK,eAAA,CAAC,iEACmB,WAAW,MAAM,IAAA,yBAAA,gCAAA,CAAA,EAAA,GAAA,CAK1C,YAGkB,MAAA,UAAA,GAAA;OAFhB,OAAM;OACN,MAAK;OACL,WAAU;eAEd,mBAA+D,QAA/D,YAA+D,gBAAhB,MAAM,GAAA,CAAA,CAAA,CAAA;;;eAEvC,QAAA,qBAAA,UAAA,GAAhB,mBAYW,UAAA,EAAA,KAAA,EAAA,GAAA,CAXoB,QAAA,MAAQ,UAAA,UAAA,GAArC,YAA+C,MAAA,qBAAA,GAAA,EAAA,KAAA,EAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,GAC/C,YASqB,MAAA,kBAAA,GAAA;KARnB,OAAM;KACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,kBAAA,QAAiB;;4BAKnB,CAJN,mBAIM,OAJN,YAIM,CAHJ,YAEc,MAAA,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"}
|
|
@@ -6,7 +6,7 @@ var _hoisted_1 = { class: "group contents" };
|
|
|
6
6
|
function _sfc_render(_ctx, _cache) {
|
|
7
7
|
return openBlock(), createElementBlock("tr", _hoisted_1, [renderSlot(_ctx.$slots, "default")]);
|
|
8
8
|
}
|
|
9
|
-
var DataTableRow_default =
|
|
9
|
+
var DataTableRow_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]);
|
|
10
10
|
//#endregion
|
|
11
11
|
export { DataTableRow_default as default };
|
|
12
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableRow.vue.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableRow.vue"],"sourcesContent":["<template>\n <tr class=\"group contents\">\n <slot />\n </tr>\n</template>\n"],"mappings":";;;;mBACM,OAAM,
|
|
1
|
+
{"version":3,"file":"DataTableRow.vue.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableRow.vue"],"sourcesContent":["<template>\n <tr class=\"group contents\">\n <slot />\n </tr>\n</template>\n"],"mappings":";;;;mBACM,OAAM,iBAAgB;;qBAA1B,mBAEK,MAFL,YAEK,CADH,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -2,7 +2,7 @@ import DataTableCell_default from "./DataTableCell.vue.js";
|
|
|
2
2
|
import { createBlock, createElementVNode, createTextVNode, defineComponent, openBlock, renderSlot, toDisplayString, withCtx } from "vue";
|
|
3
3
|
//#region src/v2/components/data-table/DataTableText.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var _hoisted_1 = { class: "flex-1 px-2 py-1.5 whitespace-nowrap" };
|
|
5
|
-
var DataTableText_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var DataTableText_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
__name: "DataTableText",
|
|
7
7
|
props: { text: {} },
|
|
8
8
|
setup(__props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableText.vue.script.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableText.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport DataTableCell from './DataTableCell.vue'\n\ndefineProps<{\n text?: string | number\n}>()\n</script>\n<template>\n <DataTableCell class=\"relative flex\">\n <span class=\"flex-1 px-2 py-1.5 whitespace-nowrap\">\n <slot>{{ text }}</slot>\n </span>\n </DataTableCell>\n</template>\n"],"mappings":";;;;;;;;;uBAQE,YAIgB,uBAAA,EAJD,OAAM,
|
|
1
|
+
{"version":3,"file":"DataTableText.vue.script.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableText.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport DataTableCell from './DataTableCell.vue'\n\ndefineProps<{\n text?: string | number\n}>()\n</script>\n<template>\n <DataTableCell class=\"relative flex\">\n <span class=\"flex-1 px-2 py-1.5 whitespace-nowrap\">\n <slot>{{ text }}</slot>\n </span>\n </DataTableCell>\n</template>\n"],"mappings":";;;;;;;;;uBAQE,YAIgB,uBAAA,EAJD,OAAM,gBAAe,GAAA;2BAG3B,CAFP,mBAEO,QAFP,YAEO,CADL,WAAuB,KAAA,QAAA,WAAA,CAAA,SAAA,CAAA,gBAAA,gBAAd,QAAA,IAAI,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -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;
|
|
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"}
|
|
@@ -2,7 +2,7 @@ import { createElementBlock, createElementVNode, createTextVNode, createVNode, d
|
|
|
2
2
|
import { ScalarButton } from "@scalar/components/button";
|
|
3
3
|
//#region src/v2/components/forms/ConfirmationForm.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var _hoisted_1 = { class: "flex justify-between gap-10" };
|
|
5
|
-
var ConfirmationForm_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var ConfirmationForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
__name: "ConfirmationForm",
|
|
7
7
|
props: {
|
|
8
8
|
label: { default: "Save" },
|
|
@@ -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,
|
|
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 +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;;;;
|
|
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"}
|
|
@@ -19,7 +19,7 @@ var _hoisted_7 = {
|
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "ui-not-open:hidden flex items-center gap-2 pr-0.75"
|
|
21
21
|
};
|
|
22
|
-
var CollapsibleSection_vue_vue_type_script_setup_true_lang_default =
|
|
22
|
+
var CollapsibleSection_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
23
23
|
name: "CollapsibleSection",
|
|
24
24
|
props: {
|
|
25
25
|
defaultOpen: {
|
|
@@ -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 as boolean\"\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,
|
|
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 as boolean\"\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;kBAA6B,QAAA;;IAIrF,aAAa,QAAA;IACb,QAAQ,QAAA;;sBAIiD,EAZhD,WAAI,CAUd,YAE0D,sBAAA;KADvD,OAAO;KACP,UAAM,OAAA,OAAA,OAAA,MAAG,UAAU,KAAI,qBAAsB,KAAK;4BAErD,mBA2DU,WAAA;KA1DP,mBAAiB,MAAA,SAAA;KAClB,OAAM;QACN,mBAgDM,OAAA,EA/CJ,OAA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ode & {
|
|
25
|
-
__ctx?: Awaited<typeof __VLS_setup
|
|
25
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
26
26
|
};
|
|
27
27
|
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
28
28
|
[K in keyof T]: T[K];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValueEmitter.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/ValueEmitter.vue"],"names":[],"mappings":"AAuCA;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY,GAAK,CAAC,EACvB,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WAkCO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;eAjC5B,CAAC;;;;KAiC8D,CAAC,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC5J,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;WACH,EAAE;;YAhCJ,QAAQ,SAAS,CAAC,GAAG,IAAI;YACzB,SAAS,GAAG,IAAI;;EAkClB,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ValueEmitter.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/ValueEmitter.vue"],"names":[],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ValueEmitter_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
3
3
|
name: "ValueEmitter",
|
|
4
4
|
props: { value: {} },
|
|
5
5
|
emits: ["change", "unmount"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValueEmitter.vue.script.js","names":[],"sources":["../../../../src/v2/components/layout/ValueEmitter.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * This component takes in any value and emits it back\n *\n * This is useful when we need to catch the open state of a disclosure from its v-slot\n */\nexport default {\n name: 'ValueEmitter',\n}\n</script>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport { onBeforeUnmount, watch } from 'vue'\n\nconst { value } = defineProps<{ value: T }>()\nconst emit = defineEmits<{\n (e: 'change', value: T): void\n (e: 'unmount'): void\n}>()\n\nwatch(\n () => value,\n (newValue) => emit('change', newValue),\n { immediate: true },\n)\n\nonBeforeUnmount(() => emit('unmount'))\n</script>\n\n<!-- eslint-disable-next-line vue/valid-template-root -->\n<template>\n <!-- We use this hack to emit the slot value back to the parent -->\n</template>\n"],"mappings":";;CAOE,MAAM;;;;EAQR,MAAM,OAAO;
|
|
1
|
+
{"version":3,"file":"ValueEmitter.vue.script.js","names":[],"sources":["../../../../src/v2/components/layout/ValueEmitter.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * This component takes in any value and emits it back\n *\n * This is useful when we need to catch the open state of a disclosure from its v-slot\n */\nexport default {\n name: 'ValueEmitter',\n}\n</script>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport { onBeforeUnmount, watch } from 'vue'\n\nconst { value } = defineProps<{ value: T }>()\nconst emit = defineEmits<{\n (e: 'change', value: T): void\n (e: 'unmount'): void\n}>()\n\nwatch(\n () => value,\n (newValue) => emit('change', newValue),\n { immediate: true },\n)\n\nonBeforeUnmount(() => emit('unmount'))\n</script>\n\n<!-- eslint-disable-next-line vue/valid-template-root -->\n<template>\n <!-- We use this hack to emit the slot value back to the parent -->\n</template>\n"],"mappings":";;CAOE,MAAM;;;;EAQR,MAAM,OAAO;EAKb,YACQ,QAAA,QACL,aAAa,KAAK,UAAU,QAAQ,GACrC,EAAE,WAAW,KAAK,CACpB;EAEA,sBAAsB,KAAK,SAAS,CAAC"}
|
|
@@ -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;
|
|
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"}
|
|
@@ -6,7 +6,7 @@ var _hoisted_1 = {
|
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "text-c-2 text-sm leading-normal text-pretty"
|
|
8
8
|
};
|
|
9
|
-
var DeleteModal_vue_vue_type_script_setup_true_lang_default =
|
|
9
|
+
var DeleteModal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
10
10
|
__name: "DeleteModal",
|
|
11
11
|
props: {
|
|
12
12
|
name: {},
|
|
@@ -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,
|
|
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"}
|
|
@@ -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 =
|
|
5
|
+
var ModalClientContainer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ModalClientContainer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-77897d1c"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ModalClientContainer_default as default };
|
|
8
8
|
|