@scalar/api-client 3.21.0 → 3.21.2
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 +59 -0
- package/dist/components/SectionFilter.vue.d.ts +0 -2
- package/dist/components/SectionFilter.vue.d.ts.map +1 -1
- package/dist/components/SectionFilter.vue.js +1 -1
- package/dist/components/SectionFilter.vue.js.map +1 -1
- package/dist/components/SectionFilter.vue.script.js +2 -8
- package/dist/components/SectionFilter.vue.script.js.map +1 -1
- package/dist/components/SectionFilterButton.vue.d.ts +0 -1
- package/dist/components/SectionFilterButton.vue.d.ts.map +1 -1
- package/dist/components/SectionFilterButton.vue.js.map +1 -1
- package/dist/components/SectionFilterButton.vue.script.js +2 -10
- package/dist/components/SectionFilterButton.vue.script.js.map +1 -1
- package/dist/style.css +156 -85
- 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 -0
- 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.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js +2 -0
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +2 -0
- 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 +24 -6
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +4 -0
- 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.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +8 -5
- 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 +2 -0
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js +12 -4
- package/dist/v2/blocks/request-block/components/RequestBodyForm.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.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +5 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
- 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 +1 -0
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.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 +2 -2
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +5 -3
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.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.js.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +4 -3
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.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.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +23 -43
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +7 -0
- 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.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +6 -0
- 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/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +5 -5
- 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/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js +11 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.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.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js +13 -1
- package/dist/v2/components/code-input/CodeInputLite.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.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js +7 -2
- package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.d.ts +20 -0
- package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.js.map +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.script.js +36 -16
- package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
- package/dist/v2/components/layout/collapsible-section-heading-level.d.ts +13 -0
- package/dist/v2/components/layout/collapsible-section-heading-level.d.ts.map +1 -0
- package/dist/v2/components/layout/collapsible-section-heading-level.js +14 -0
- package/dist/v2/components/layout/collapsible-section-heading-level.js.map +1 -0
- package/dist/v2/components/layout/index.d.ts +1 -0
- package/dist/v2/components/layout/index.d.ts.map +1 -1
- package/dist/v2/components/layout/index.js +2 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.js.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.script.js +10 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue.d.ts +15 -2
- package/dist/v2/components/sidebar/SidebarToggle.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue.js +3 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue.script.js +5 -5
- package/dist/v2/components/sidebar/SidebarToggle.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js +2 -1
- package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
- package/dist/vue-styles.css +118 -77
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"names":[],"mappings":"AAuLA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO/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;AA2VJ,QAAA,IAAI,OAAO,IAAU,EAAuB,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACvF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAO7C,QAAA,MAAM,UAAU;;;;;;;;;;;cAhXD,OAAO;kBASH,OAAO;cALX,OAAO;2BADM,OAAO;6EAiXjC,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
|
|
|
2
2
|
import DataTableInput_vue_vue_type_script_setup_true_lang_default from "./DataTableInput.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/v2/components/data-table/DataTableInput.vue
|
|
5
|
-
var DataTableInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(DataTableInput_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var DataTableInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(DataTableInput_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-8e7de9be"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DataTableInput_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableInput.vue.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconEye, ScalarIconEyeSlash, ScalarIconX } from '@scalar/icons'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, ref, useTemplateRef } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport DataTableCell from './DataTableCell.vue'\nimport DataTableInputSelect from './DataTableInputSelect.vue'\n\nconst props = withDefaults(\n defineProps<{\n id?: string\n type?: string | undefined\n /** Class for the wrapping cell because attrs is bound to the input */\n containerClass?: VueClassProp | undefined\n required?: boolean\n modelValue: string\n /** Allows adding a custom value to the enum dropdown, defaults to true */\n canAddCustomEnumValue?: boolean\n readOnly?: boolean\n enum?: string[]\n environment: XScalarEnvironment\n description?: string | undefined\n /** Whether to show context function suggestions like $guid, $timestamp. Defaults to true */\n withFakeData?: boolean\n }>(),\n {\n canAddCustomEnumValue: true,\n required: false,\n readOnly: false,\n withFakeData: true,\n },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string | number): void\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\ndefineOptions({ inheritAttrs: false })\n\nconst mask = ref(true)\nconst interactingWithDropdown = ref(false)\nconst codeInput = useTemplateRef('codeInput')\n\nconst handleBlur = () => !interactingWithDropdown.value && emit('inputBlur')\n\nconst inputType = computed(() =>\n props.type === 'password' ? 'text' : (props.type ?? 'text'),\n)\n\n// If not an enum nor read only, focus the code input\nconst handleLabelClick = () => {\n if (!props.enum?.length && !props.readOnly) {\n codeInput.value?.focus()\n }\n}\n</script>\n<template>\n <DataTableCell\n class=\"relative flex\"\n :class=\"containerClass\">\n <div\n v-if=\"$slots.default\"\n class=\"text-c-1 flex items-center pr-0 pl-3\"\n :for=\"id ?? ''\"\n @click=\"handleLabelClick\">\n <slot />:\n </div>\n <div class=\"relative flex min-w-0 flex-1\">\n <template v-if=\"props.enum && props.enum.length\">\n <DataTableInputSelect\n :canAddCustomValue=\"props.canAddCustomEnumValue\"\n :modelValue=\"props.modelValue\"\n :value=\"props.enum\"\n @update:modelValue=\"emit('update:modelValue', $event)\" />\n </template>\n <template v-else>\n <input\n v-if=\"mask && type === 'password'\"\n v-bind=\"id ? { ...$attrs, id: id } : $attrs\"\n autocomplete=\"off\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1\"\n :class=\"{ 'scalar-password-input': type === 'password' }\"\n data-1p-ignore\n :readOnly=\"readOnly\"\n spellcheck=\"false\"\n :type=\"inputType\"\n :value=\"modelValue\"\n @input=\"\n emit(\n 'update:modelValue',\n ($event.target as HTMLInputElement).value ?? '',\n )\n \" />\n <CodeInputLite\n v-else\n v-bind=\"$attrs\"\n :id=\"id\"\n ref=\"codeInput\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1\"\n :class=\"[\n type === 'password' && description && 'pr-12',\n description && 'pr-8',\n type === 'password' && 'scalar-password-input',\n ]\"\n :environment=\"environment\"\n :modelValue=\"modelValue ?? ''\"\n :readOnly=\"readOnly\"\n :required=\"Boolean(required)\"\n :type=\"inputType\"\n :withFakeData=\"withFakeData\"\n @blur=\"handleBlur\"\n @focus=\"emit('inputFocus')\"\n @update:modelValue=\"(value) => emit('update:modelValue', value)\" />\n </template>\n </div>\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n <slot name=\"icon\" />\n <!-- Clear -->\n <ScalarIconButton\n v-if=\"modelValue\"\n class=\"-ml-.25 h-6 w-6 self-center p-1.25\"\n :icon=\"ScalarIconX\"\n :label=\"translate('apiClient.dataTableInput.clearValue')\"\n @click=\"emit('update:modelValue', '')\" />\n <!-- Toggle Visibility -->\n <ScalarIconButton\n v-if=\"type === 'password'\"\n class=\"-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25\"\n data-testid=\"data-table-password-toggle\"\n :icon=\"mask ? ScalarIconEye : ScalarIconEyeSlash\"\n :label=\"
|
|
1
|
+
{"version":3,"file":"DataTableInput.vue.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconEye, ScalarIconEyeSlash, ScalarIconX } from '@scalar/icons'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, ref, useTemplateRef } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport DataTableCell from './DataTableCell.vue'\nimport DataTableInputSelect from './DataTableInputSelect.vue'\n\nconst props = withDefaults(\n defineProps<{\n id?: string\n type?: string | undefined\n /** Class for the wrapping cell because attrs is bound to the input */\n containerClass?: VueClassProp | undefined\n required?: boolean\n modelValue: string\n /** Allows adding a custom value to the enum dropdown, defaults to true */\n canAddCustomEnumValue?: boolean\n readOnly?: boolean\n enum?: string[]\n environment: XScalarEnvironment\n description?: string | undefined\n /** Whether to show context function suggestions like $guid, $timestamp. Defaults to true */\n withFakeData?: boolean\n }>(),\n {\n canAddCustomEnumValue: true,\n required: false,\n readOnly: false,\n withFakeData: true,\n },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string | number): void\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\ndefineOptions({ inheritAttrs: false })\n\nconst mask = ref(true)\nconst interactingWithDropdown = ref(false)\nconst codeInput = useTemplateRef('codeInput')\n\nconst handleBlur = () => !interactingWithDropdown.value && emit('inputBlur')\n\nconst inputType = computed(() =>\n props.type === 'password' ? 'text' : (props.type ?? 'text'),\n)\n\n// If not an enum nor read only, focus the code input\nconst handleLabelClick = () => {\n if (!props.enum?.length && !props.readOnly) {\n codeInput.value?.focus()\n }\n}\n</script>\n<template>\n <DataTableCell\n class=\"relative flex\"\n :class=\"containerClass\">\n <div\n v-if=\"$slots.default\"\n class=\"text-c-1 flex items-center pr-0 pl-3\"\n :for=\"id ?? ''\"\n @click=\"handleLabelClick\">\n <slot />:\n </div>\n <div class=\"relative flex min-w-0 flex-1\">\n <template v-if=\"props.enum && props.enum.length\">\n <DataTableInputSelect\n :canAddCustomValue=\"props.canAddCustomEnumValue\"\n :modelValue=\"props.modelValue\"\n :value=\"props.enum\"\n @update:modelValue=\"emit('update:modelValue', $event)\" />\n </template>\n <template v-else>\n <input\n v-if=\"mask && type === 'password'\"\n v-bind=\"id ? { ...$attrs, id: id } : $attrs\"\n autocomplete=\"off\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1\"\n :class=\"{ 'scalar-password-input': type === 'password' }\"\n data-1p-ignore\n :readOnly=\"readOnly\"\n spellcheck=\"false\"\n :type=\"inputType\"\n :value=\"modelValue\"\n @input=\"\n emit(\n 'update:modelValue',\n ($event.target as HTMLInputElement).value ?? '',\n )\n \" />\n <CodeInputLite\n v-else\n v-bind=\"$attrs\"\n :id=\"id\"\n ref=\"codeInput\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1\"\n :class=\"[\n type === 'password' && description && 'pr-12',\n description && 'pr-8',\n type === 'password' && 'scalar-password-input',\n ]\"\n :environment=\"environment\"\n :modelValue=\"modelValue ?? ''\"\n :readOnly=\"readOnly\"\n :required=\"Boolean(required)\"\n :type=\"inputType\"\n :withFakeData=\"withFakeData\"\n @blur=\"handleBlur\"\n @focus=\"emit('inputFocus')\"\n @update:modelValue=\"(value) => emit('update:modelValue', value)\" />\n </template>\n </div>\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n <slot name=\"icon\" />\n <!-- Clear -->\n <ScalarIconButton\n v-if=\"modelValue\"\n class=\"-ml-.25 h-6 w-6 self-center p-1.25\"\n :icon=\"ScalarIconX\"\n :label=\"translate('apiClient.dataTableInput.clearValue')\"\n @click=\"emit('update:modelValue', '')\" />\n <!-- Toggle Visibility -->\n <!-- A toggle button keeps one name and reports its state, so the label\n stays \"Show Password\" while `aria-pressed` says whether the value is\n revealed. Flipping the name instead leaves screen readers silent,\n because activating a button does not re-announce its name. -->\n <ScalarIconButton\n v-if=\"type === 'password'\"\n :aria-pressed=\"!mask\"\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=\"translate('apiClient.dataTableInput.showPassword')\"\n @click=\"mask = !mask\" />\n </DataTableCell>\n</template>\n\n<style scoped>\n:deep(.code-input-lite__editor) {\n background-color: transparent;\n font-family: var(--scalar-font);\n font-size: var(--scalar-small);\n padding: 5px 8px;\n}\n:deep(.scalar-pill:not(:last-of-type)) {\n margin-right: 0.15em;\n}\n:deep(.scalar-pill:not(:first-of-type)) {\n margin-left: 0.5px;\n}\n/* Tailwind placeholder is busted */\ninput::placeholder {\n color: var(--scalar-color-3);\n}\n/* we want our inputs to look like a password input but not be one */\n.scalar-password-input {\n text-security: disc;\n -webkit-text-security: disc;\n -moz-text-security: disc;\n}\n</style>\n"],"mappings":""}
|
|
@@ -133,12 +133,17 @@ var DataTableInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
133
133
|
}, null, 8, ["icon", "label"])) : createCommentVNode("", true),
|
|
134
134
|
__props.type === "password" ? (openBlock(), createBlock(unref(ScalarIconButton), {
|
|
135
135
|
key: 3,
|
|
136
|
+
"aria-pressed": !mask.value,
|
|
136
137
|
class: "-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25",
|
|
137
138
|
"data-testid": "data-table-password-toggle",
|
|
138
139
|
icon: mask.value ? unref(ScalarIconEye) : unref(ScalarIconEyeSlash),
|
|
139
|
-
label:
|
|
140
|
+
label: unref(translate)("apiClient.dataTableInput.showPassword"),
|
|
140
141
|
onClick: _cache[5] || (_cache[5] = ($event) => mask.value = !mask.value)
|
|
141
|
-
}, null, 8, [
|
|
142
|
+
}, null, 8, [
|
|
143
|
+
"aria-pressed",
|
|
144
|
+
"icon",
|
|
145
|
+
"label"
|
|
146
|
+
])) : createCommentVNode("", true)
|
|
142
147
|
]),
|
|
143
148
|
_: 3
|
|
144
149
|
}, 8, ["class"]);
|
|
@@ -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'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport DataTableCell from './DataTableCell.vue'\nimport DataTableInputSelect from './DataTableInputSelect.vue'\n\nconst props = withDefaults(\n defineProps<{\n id?: string\n type?: string | undefined\n /** Class for the wrapping cell because attrs is bound to the input */\n containerClass?: VueClassProp | undefined\n required?: boolean\n modelValue: string\n /** Allows adding a custom value to the enum dropdown, defaults to true */\n canAddCustomEnumValue?: boolean\n readOnly?: boolean\n enum?: string[]\n environment: XScalarEnvironment\n description?: string | undefined\n /** Whether to show context function suggestions like $guid, $timestamp. Defaults to true */\n withFakeData?: boolean\n }>(),\n {\n canAddCustomEnumValue: true,\n required: false,\n readOnly: false,\n withFakeData: true,\n },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string | number): void\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\ndefineOptions({ inheritAttrs: false })\n\nconst mask = ref(true)\nconst interactingWithDropdown = ref(false)\nconst codeInput = useTemplateRef('codeInput')\n\nconst handleBlur = () => !interactingWithDropdown.value && emit('inputBlur')\n\nconst inputType = computed(() =>\n props.type === 'password' ? 'text' : (props.type ?? 'text'),\n)\n\n// If not an enum nor read only, focus the code input\nconst handleLabelClick = () => {\n if (!props.enum?.length && !props.readOnly) {\n codeInput.value?.focus()\n }\n}\n</script>\n<template>\n <DataTableCell\n class=\"relative flex\"\n :class=\"containerClass\">\n <div\n v-if=\"$slots.default\"\n class=\"text-c-1 flex items-center pr-0 pl-3\"\n :for=\"id ?? ''\"\n @click=\"handleLabelClick\">\n <slot />:\n </div>\n <div class=\"relative flex min-w-0 flex-1\">\n <template v-if=\"props.enum && props.enum.length\">\n <DataTableInputSelect\n :canAddCustomValue=\"props.canAddCustomEnumValue\"\n :modelValue=\"props.modelValue\"\n :value=\"props.enum\"\n @update:modelValue=\"emit('update:modelValue', $event)\" />\n </template>\n <template v-else>\n <input\n v-if=\"mask && type === 'password'\"\n v-bind=\"id ? { ...$attrs, id: id } : $attrs\"\n autocomplete=\"off\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1\"\n :class=\"{ 'scalar-password-input': type === 'password' }\"\n data-1p-ignore\n :readOnly=\"readOnly\"\n spellcheck=\"false\"\n :type=\"inputType\"\n :value=\"modelValue\"\n @input=\"\n emit(\n 'update:modelValue',\n ($event.target as HTMLInputElement).value ?? '',\n )\n \" />\n <CodeInputLite\n v-else\n v-bind=\"$attrs\"\n :id=\"id\"\n ref=\"codeInput\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1\"\n :class=\"[\n type === 'password' && description && 'pr-12',\n description && 'pr-8',\n type === 'password' && 'scalar-password-input',\n ]\"\n :environment=\"environment\"\n :modelValue=\"modelValue ?? ''\"\n :readOnly=\"readOnly\"\n :required=\"Boolean(required)\"\n :type=\"inputType\"\n :withFakeData=\"withFakeData\"\n @blur=\"handleBlur\"\n @focus=\"emit('inputFocus')\"\n @update:modelValue=\"(value) => emit('update:modelValue', value)\" />\n </template>\n </div>\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n <slot name=\"icon\" />\n <!-- Clear -->\n <ScalarIconButton\n v-if=\"modelValue\"\n class=\"-ml-.25 h-6 w-6 self-center p-1.25\"\n :icon=\"ScalarIconX\"\n :label=\"translate('apiClient.dataTableInput.clearValue')\"\n @click=\"emit('update:modelValue', '')\" />\n <!-- Toggle Visibility -->\n <ScalarIconButton\n v-if=\"type === 'password'\"\n class=\"-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25\"\n data-testid=\"data-table-password-toggle\"\n :icon=\"mask ? ScalarIconEye : ScalarIconEyeSlash\"\n :label=\"
|
|
1
|
+
{"version":3,"file":"DataTableInput.vue.script.js","names":["$slots","$attrs"],"sources":["../../../../src/v2/components/data-table/DataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconEye, ScalarIconEyeSlash, ScalarIconX } from '@scalar/icons'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, ref, useTemplateRef } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport DataTableCell from './DataTableCell.vue'\nimport DataTableInputSelect from './DataTableInputSelect.vue'\n\nconst props = withDefaults(\n defineProps<{\n id?: string\n type?: string | undefined\n /** Class for the wrapping cell because attrs is bound to the input */\n containerClass?: VueClassProp | undefined\n required?: boolean\n modelValue: string\n /** Allows adding a custom value to the enum dropdown, defaults to true */\n canAddCustomEnumValue?: boolean\n readOnly?: boolean\n enum?: string[]\n environment: XScalarEnvironment\n description?: string | undefined\n /** Whether to show context function suggestions like $guid, $timestamp. Defaults to true */\n withFakeData?: boolean\n }>(),\n {\n canAddCustomEnumValue: true,\n required: false,\n readOnly: false,\n withFakeData: true,\n },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: string | number): void\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\ndefineOptions({ inheritAttrs: false })\n\nconst mask = ref(true)\nconst interactingWithDropdown = ref(false)\nconst codeInput = useTemplateRef('codeInput')\n\nconst handleBlur = () => !interactingWithDropdown.value && emit('inputBlur')\n\nconst inputType = computed(() =>\n props.type === 'password' ? 'text' : (props.type ?? 'text'),\n)\n\n// If not an enum nor read only, focus the code input\nconst handleLabelClick = () => {\n if (!props.enum?.length && !props.readOnly) {\n codeInput.value?.focus()\n }\n}\n</script>\n<template>\n <DataTableCell\n class=\"relative flex\"\n :class=\"containerClass\">\n <div\n v-if=\"$slots.default\"\n class=\"text-c-1 flex items-center pr-0 pl-3\"\n :for=\"id ?? ''\"\n @click=\"handleLabelClick\">\n <slot />:\n </div>\n <div class=\"relative flex min-w-0 flex-1\">\n <template v-if=\"props.enum && props.enum.length\">\n <DataTableInputSelect\n :canAddCustomValue=\"props.canAddCustomEnumValue\"\n :modelValue=\"props.modelValue\"\n :value=\"props.enum\"\n @update:modelValue=\"emit('update:modelValue', $event)\" />\n </template>\n <template v-else>\n <input\n v-if=\"mask && type === 'password'\"\n v-bind=\"id ? { ...$attrs, id: id } : $attrs\"\n autocomplete=\"off\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1\"\n :class=\"{ 'scalar-password-input': type === 'password' }\"\n data-1p-ignore\n :readOnly=\"readOnly\"\n spellcheck=\"false\"\n :type=\"inputType\"\n :value=\"modelValue\"\n @input=\"\n emit(\n 'update:modelValue',\n ($event.target as HTMLInputElement).value ?? '',\n )\n \" />\n <CodeInputLite\n v-else\n v-bind=\"$attrs\"\n :id=\"id\"\n ref=\"codeInput\"\n class=\"text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1\"\n :class=\"[\n type === 'password' && description && 'pr-12',\n description && 'pr-8',\n type === 'password' && 'scalar-password-input',\n ]\"\n :environment=\"environment\"\n :modelValue=\"modelValue ?? ''\"\n :readOnly=\"readOnly\"\n :required=\"Boolean(required)\"\n :type=\"inputType\"\n :withFakeData=\"withFakeData\"\n @blur=\"handleBlur\"\n @focus=\"emit('inputFocus')\"\n @update:modelValue=\"(value) => emit('update:modelValue', value)\" />\n </template>\n </div>\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n <slot name=\"icon\" />\n <!-- Clear -->\n <ScalarIconButton\n v-if=\"modelValue\"\n class=\"-ml-.25 h-6 w-6 self-center p-1.25\"\n :icon=\"ScalarIconX\"\n :label=\"translate('apiClient.dataTableInput.clearValue')\"\n @click=\"emit('update:modelValue', '')\" />\n <!-- Toggle Visibility -->\n <!-- A toggle button keeps one name and reports its state, so the label\n stays \"Show Password\" while `aria-pressed` says whether the value is\n revealed. Flipping the name instead leaves screen readers silent,\n because activating a button does not re-announce its name. -->\n <ScalarIconButton\n v-if=\"type === 'password'\"\n :aria-pressed=\"!mask\"\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=\"translate('apiClient.dataTableInput.showPassword')\"\n @click=\"mask = !mask\" />\n </DataTableCell>\n</template>\n\n<style scoped>\n:deep(.code-input-lite__editor) {\n background-color: transparent;\n font-family: var(--scalar-font);\n font-size: var(--scalar-small);\n padding: 5px 8px;\n}\n:deep(.scalar-pill:not(:last-of-type)) {\n margin-right: 0.15em;\n}\n:deep(.scalar-pill:not(:first-of-type)) {\n margin-left: 0.5px;\n}\n/* Tailwind placeholder is busted */\ninput::placeholder {\n color: var(--scalar-color-3);\n}\n/* we want our inputs to look like a password input but not be one */\n.scalar-password-input {\n text-security: disc;\n -webkit-text-security: disc;\n -moz-text-security: disc;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA,MAAM,QAAQ;EAyBd,MAAM,OAAO;EAOb,MAAM,EAAE,cAAc,gBAAgB;EAItC,MAAM,OAAO,IAAI,IAAI;EACrB,MAAM,0BAA0B,IAAI,KAAK;EACzC,MAAM,YAAY,eAAe,WAAW;EAE5C,MAAM,mBAAmB,CAAC,wBAAwB,SAAS,KAAK,WAAW;EAE3E,MAAM,YAAY,eAChB,MAAM,SAAS,aAAa,SAAU,MAAM,QAAQ,MACtD;EAGA,MAAM,yBAAyB;GAC7B,IAAI,CAAC,MAAM,MAAM,UAAU,CAAC,MAAM,UAChC,UAAU,OAAO,MAAM;EAE3B;;uBAGE,YAoFgB,uBAAA,EAnFd,OAAK,eAAA,CAAC,iBACE,QAAA,cAAc,CAAA,EAAA,GAAA;2BAOhB;KALEA,KAAAA,OAAO,WAAA,UAAA,GADf,mBAMM,OAAA;;MAJJ,OAAM;MACL,KAAK,QAAA,MAAE;MACP,SAAO;SACR,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,IAAA,GAAA,OAAA,OAAA,OAAA,KAAA,gBAAA,MACV,EAAA,EAAA,GAAA,GAAA,UAAA,KAAA,mBAAA,IAAA,IAAA;KACA,mBA+CM,OA/CN,YA+CM,CA9CY,MAAM,QAAQ,MAAM,KAAK,UAAA,UAAA,GACvC,YAI2D,8BAAA;;MAHxD,mBAAmB,MAAM;MACzB,YAAY,MAAM;MAClB,OAAO,MAAM;MACb,uBAAiB,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,qBAAsB,MAAM;;;;;yBAExD,mBAsCW,UAAA,EAAA,KAAA,EAAA,GAAA,CApCD,KAAA,SAAQ,QAAA,SAAI,cAAA,UAAA,GADpB,mBAgBM,SAhBN,WAgBM,EAAA,KAAA,EAAA,GAdI,QAAA,KAAE;MAAA,GAAQC,KAAAA;MAAM,IAAM,QAAA;KAAE,IAAKA,KAAAA,QAAM;MAC3C,cAAa;MACb,OAAK,CAAC,6FAA2F,EAAA,yBAC9D,QAAA,SAAI,WAAA,CAAA;MACvC,kBAAA;MACC,UAAU,QAAA;MACX,YAAW;MACV,MAAM,UAAA;MACN,OAAO,QAAA;MACP,SAAK,OAAA,OAAA,OAAA,MAAA,WAAe,KAAA,qBAAwD,OAAO,OAA4B,SAAK,EAAA;gDAMvH,YAmBqE,MAAA,qBAAA,GAnBrE,WAmBqE,EAAA,KAAA,EAAA,GAjB3DA,KAAAA,QAAM;MACb,IAAI,QAAA;eACD;MAAJ,KAAI;MACJ,OAAK,CAAC,gFAA8E;OAC9D,QAAA,SAAI,cAAmB,QAAA,eAAW;OAAyB,QAAA,eAAW;OAAwB,QAAA,SAAI,cAAA;;MAKvH,aAAa,QAAA;MACb,YAAY,QAAA,cAAU;MACtB,UAAU,QAAA;MACV,UAAU,QAAQ,QAAA,QAAQ;MAC1B,MAAM,UAAA;MACN,cAAc,QAAA;MACd,QAAM;MACN,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,YAAA;MACX,uBAAiB,OAAA,OAAA,OAAA,MAAG,UAAU,KAAI,qBAAsB,KAAK;;;;;;;;;;;KAI5DD,KAAAA,OAAO,WAAA,UAAA,GADf,mBAIM,OAJN,YAIM,CADJ,WAAuB,KAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,IAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;KAEzB,WAAoB,KAAA,QAAA,QAAA,CAAA,GAAA,KAAA,GAAA,IAAA;KAGZ,QAAA,cAAA,UAAA,GADR,YAK2C,MAAA,gBAAA,GAAA;;MAHzC,OAAM;MACL,MAAM,MAAA,WAAA;MACN,OAAO,MAAA,SAAA,CAAS,CAAA,qCAAA;MAChB,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,qBAAA,EAAA;;KAON,QAAA,SAAI,cAAA,UAAA,GADZ,YAO0B,MAAA,gBAAA,GAAA;;MALvB,gBAAY,CAAG,KAAA;MAChB,OAAM;MACN,eAAY;MACX,MAAM,KAAA,QAAO,MAAA,aAAA,IAAgB,MAAA,kBAAA;MAC7B,OAAO,MAAA,SAAA,CAAS,CAAA,uCAAA;MAChB,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAA,QAAI,CAAI,KAAA"}
|
|
@@ -8,6 +8,16 @@ export default _default;
|
|
|
8
8
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
9
9
|
/** Whether the disclosure is open by default. */
|
|
10
10
|
defaultOpen?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the title belongs in the document outline.
|
|
13
|
+
*
|
|
14
|
+
* A section of a request or response is a passage of the page, so its title
|
|
15
|
+
* is a heading by default. A caller whose title only names a cluster of
|
|
16
|
+
* controls opts out: the title renders as plain text and the section becomes
|
|
17
|
+
* a `group` named by it, which keeps the card findable without adding an
|
|
18
|
+
* entry to the heading outline that has no passage behind it.
|
|
19
|
+
*/
|
|
20
|
+
heading?: boolean;
|
|
11
21
|
/** Number of items to show in badge when collapsed. */
|
|
12
22
|
itemCount?: number;
|
|
13
23
|
/** Whether the disclosure is static and cannot be toggled. */
|
|
@@ -17,6 +27,16 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
17
27
|
}, string, import("vue").PublicProps, Readonly<{
|
|
18
28
|
/** Whether the disclosure is open by default. */
|
|
19
29
|
defaultOpen?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the title belongs in the document outline.
|
|
32
|
+
*
|
|
33
|
+
* A section of a request or response is a passage of the page, so its title
|
|
34
|
+
* is a heading by default. A caller whose title only names a cluster of
|
|
35
|
+
* controls opts out: the title renders as plain text and the section becomes
|
|
36
|
+
* a `group` named by it, which keeps the card findable without adding an
|
|
37
|
+
* entry to the heading outline that has no passage behind it.
|
|
38
|
+
*/
|
|
39
|
+
heading?: boolean;
|
|
20
40
|
/** Number of items to show in badge when collapsed. */
|
|
21
41
|
itemCount?: number;
|
|
22
42
|
/** Whether the disclosure is static and cannot be toggled. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/CollapsibleSection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CollapsibleSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/CollapsibleSection.vue"],"names":[],"mappings":"AA4KA;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEhB,iDAAiD;kBACnC,OAAO;IACrB;;;;;;;;OAQG;cACO,OAAO;IACjB,uDAAuD;gBAC3C,MAAM;IAClB,8DAA8D;eACnD,OAAO;;;;IAflB,iDAAiD;kBACnC,OAAO;IACrB;;;;;;;;OAQG;cACO,OAAO;IACjB,uDAAuD;gBAC3C,MAAM;IAClB,8DAA8D;eACnD,OAAO;;;;YA+RR,CAAC,KAAK;;KAAiB,KAAK,GAAG;;cAC7B,CAAC,KAAK;;KAAiB,KAAK,GAAG;;cAC/B,CAAC,KAAK;;KAAiB,KAAK,GAAG;EAUzC,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleSection.vue.js","names":[],"sources":["../../../../src/v2/components/layout/CollapsibleSection.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Simple collapsible section component that can be used to wrap content that should be collapsed and expanded\n *\n * Would like to replace with details/summary elements, but they are not supported in all browsers yet?\n */\nexport default {\n name: 'CollapsibleSection',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { useId } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nimport ValueEmitter from './ValueEmitter.vue'\n\nconst {\n defaultOpen = true,\n itemCount = 0,\n isStatic,\n} = defineProps<{\n /** Whether the disclosure is open by default. */\n defaultOpen?: boolean\n /** Number of items to show in badge when collapsed. */\n itemCount?: number\n /** Whether the disclosure is static and cannot be toggled. */\n isStatic?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst
|
|
1
|
+
{"version":3,"file":"CollapsibleSection.vue.js","names":[],"sources":["../../../../src/v2/components/layout/CollapsibleSection.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Simple collapsible section component that can be used to wrap content that should be collapsed and expanded\n *\n * Would like to replace with details/summary elements, but they are not supported in all browsers yet?\n */\nexport default {\n name: 'CollapsibleSection',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { computed, inject, toValue, useId } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nimport { COLLAPSIBLE_SECTION_HEADING_LEVEL } from './collapsible-section-heading-level'\nimport ValueEmitter from './ValueEmitter.vue'\n\nconst {\n defaultOpen = true,\n heading = true,\n itemCount = 0,\n isStatic,\n} = defineProps<{\n /** Whether the disclosure is open by default. */\n defaultOpen?: boolean\n /**\n * Whether the title belongs in the document outline.\n *\n * A section of a request or response is a passage of the page, so its title\n * is a heading by default. A caller whose title only names a cluster of\n * controls opts out: the title renders as plain text and the section becomes\n * a `group` named by it, which keeps the card findable without adding an\n * entry to the heading outline that has no passage behind it.\n */\n heading?: boolean\n /** Number of items to show in badge when collapsed. */\n itemCount?: number\n /** Whether the disclosure is static and cannot be toggled. */\n isStatic?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n}>()\n\nconst { translate } = useLocalization()\n\n/**\n * Defaults to `h2`, for a section that sits directly below the page title. A\n * parent that renders a title above its sections provides a deeper level.\n */\nconst headingLevel = inject(COLLAPSIBLE_SECTION_HEADING_LEVEL, 2)\n\n/**\n * The element that holds the title. A caller that opted out of the heading gets\n * a `span`, which reads as plain text and is also the only valid choice inside\n * the disclosure button, since a heading is not phrasing content.\n */\nconst titleTag = computed((): string =>\n heading ? `h${toValue(headingLevel)}` : 'span',\n)\n\n/** Names the `group` a section without a heading becomes. */\nconst titleId = useId()\n</script>\n\n<template>\n <Disclosure\n v-slot=\"{ open }\"\n as=\"div\"\n class=\"group/collapse text-c-2 focus-within:text-c-1 last:ui-open:border-b-0\"\n :class=\"{\n 'last-of-type:first-of-type:border-b-0': isStatic,\n 'border-b': !isStatic,\n }\"\n :defaultOpen=\"defaultOpen\"\n :static=\"isStatic\">\n <!-- We use this hack to emit the slot value back to the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emit('update:modelValue', value)\" />\n\n <!-- A section that carries a heading stays deliberately unnamed: naming it\n would turn it into a region landmark wrapping its own heading, so\n screen readers announce the title twice before reading the contents.\n Without a heading there is nothing to duplicate, and `group` is not a\n landmark, so the name bounds the card without joining the landmark\n list. -->\n <section\n :aria-labelledby=\"heading ? undefined : titleId\"\n class=\"contents\"\n :role=\"heading ? undefined : 'group'\">\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 <component\n :is=\"titleTag\"\n :id=\"heading ? undefined : titleId\"\n class=\"text-c-1 m-0 flex flex-1 items-center gap-1.5 leading-[20px]\">\n <span class=\"contents\">\n <slot\n name=\"title\"\n :open=\"open\" />\n <span\n v-if=\"!open\"\n class=\"sr-only\"\n >{{ translate('apiClient.collapsibleSection.collapsed') }}</span\n >\n </span>\n\n <!-- Badge showing item count when collapsed. -->\n <span\n v-if=\"!open && itemCount\"\n class=\"bg-b-2 text-c-2 inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs font-semibold\">\n {{ itemCount }}\n <span class=\"sr-only\">{{\n itemCount === 1\n ? translate('apiClient.collapsibleSection.item')\n : translate('apiClient.collapsibleSection.items')\n }}</span>\n </span>\n </component>\n </DisclosureButton>\n\n <!-- Optional actions slot that hides when the panel is closed. -->\n <div\n v-if=\"$slots.actions\"\n class=\"ui-not-open:hidden flex items-center gap-2 pr-0.75\">\n <slot\n name=\"actions\"\n :open=\"open\" />\n </div>\n </div>\n\n <!-- The collapsible content panel. -->\n <DisclosurePanel\n v-bind=\"$attrs\"\n class=\"diclosure-panel h-full max-h-fit rounded-b\">\n <slot :open=\"open\" />\n </DisclosurePanel>\n </section>\n </Disclosure>\n</template>\n"],"mappings":""}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { useLocalization } from "../../features/localization/index.js";
|
|
2
|
+
import { COLLAPSIBLE_SECTION_HEADING_LEVEL } from "./collapsible-section-heading-level.js";
|
|
2
3
|
import ValueEmitter_default from "./ValueEmitter.vue.js";
|
|
3
|
-
import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderSlot, toDisplayString, unref, useId, withCtx } from "vue";
|
|
4
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, mergeProps, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, toValue, unref, useId, withCtx } from "vue";
|
|
4
5
|
import { ScalarIcon } from "@scalar/components/icon";
|
|
5
6
|
import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/vue";
|
|
6
7
|
//#region src/v2/components/layout/CollapsibleSection.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var _hoisted_1 = ["aria-labelledby"];
|
|
8
|
-
var _hoisted_2 = { class: "
|
|
9
|
-
var _hoisted_3 =
|
|
10
|
-
var _hoisted_4 = {
|
|
8
|
+
var _hoisted_1 = ["aria-labelledby", "role"];
|
|
9
|
+
var _hoisted_2 = { class: "contents" };
|
|
10
|
+
var _hoisted_3 = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "sr-only"
|
|
13
13
|
};
|
|
14
|
-
var
|
|
14
|
+
var _hoisted_4 = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "bg-b-2 text-c-2 inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs font-semibold"
|
|
17
17
|
};
|
|
18
|
-
var
|
|
19
|
-
var
|
|
18
|
+
var _hoisted_5 = { class: "sr-only" };
|
|
19
|
+
var _hoisted_6 = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "ui-not-open:hidden flex items-center gap-2 pr-0.75"
|
|
22
22
|
};
|
|
@@ -27,6 +27,10 @@ var CollapsibleSection_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
27
27
|
type: Boolean,
|
|
28
28
|
default: true
|
|
29
29
|
},
|
|
30
|
+
heading: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
30
34
|
itemCount: { default: 0 },
|
|
31
35
|
isStatic: { type: Boolean }
|
|
32
36
|
},
|
|
@@ -34,7 +38,19 @@ var CollapsibleSection_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
34
38
|
setup(__props, { emit: __emit }) {
|
|
35
39
|
const emit = __emit;
|
|
36
40
|
const { translate } = useLocalization();
|
|
37
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Defaults to `h2`, for a section that sits directly below the page title. A
|
|
43
|
+
* parent that renders a title above its sections provides a deeper level.
|
|
44
|
+
*/
|
|
45
|
+
const headingLevel = inject(COLLAPSIBLE_SECTION_HEADING_LEVEL, 2);
|
|
46
|
+
/**
|
|
47
|
+
* The element that holds the title. A caller that opted out of the heading gets
|
|
48
|
+
* a `span`, which reads as plain text and is also the only valid choice inside
|
|
49
|
+
* the disclosure button, since a heading is not phrasing content.
|
|
50
|
+
*/
|
|
51
|
+
const titleTag = computed(() => __props.heading ? `h${toValue(headingLevel)}` : "span");
|
|
52
|
+
/** Names the `group` a section without a heading becomes. */
|
|
53
|
+
const titleId = useId();
|
|
38
54
|
return (_ctx, _cache) => {
|
|
39
55
|
return openBlock(), createBlock(unref(Disclosure), {
|
|
40
56
|
as: "div",
|
|
@@ -49,8 +65,9 @@ var CollapsibleSection_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
49
65
|
value: open,
|
|
50
66
|
onChange: _cache[0] || (_cache[0] = (value) => emit("update:modelValue", value))
|
|
51
67
|
}, null, 8, ["value"]), createElementVNode("section", {
|
|
52
|
-
"aria-labelledby": unref(
|
|
53
|
-
class: "contents"
|
|
68
|
+
"aria-labelledby": __props.heading ? void 0 : unref(titleId),
|
|
69
|
+
class: "contents",
|
|
70
|
+
role: __props.heading ? void 0 : "group"
|
|
54
71
|
}, [createElementVNode("div", { class: normalizeClass(["bg-b-2 flex items-center", __props.isStatic && "rounded-t-xl border-x border-t"]) }, [createVNode(unref(DisclosureButton), {
|
|
55
72
|
class: normalizeClass(["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", __props.isStatic && "!pl-3"]),
|
|
56
73
|
disabled: __props.isStatic
|
|
@@ -60,12 +77,15 @@ var CollapsibleSection_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
60
77
|
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",
|
|
61
78
|
icon: "ChevronRight",
|
|
62
79
|
size: "md"
|
|
63
|
-
})) : createCommentVNode("", true),
|
|
64
|
-
id: unref(
|
|
65
|
-
class: "
|
|
66
|
-
},
|
|
80
|
+
})) : createCommentVNode("", true), (openBlock(), createBlock(resolveDynamicComponent(titleTag.value), {
|
|
81
|
+
id: __props.heading ? void 0 : unref(titleId),
|
|
82
|
+
class: "text-c-1 m-0 flex flex-1 items-center gap-1.5 leading-[20px]"
|
|
83
|
+
}, {
|
|
84
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_2, [renderSlot(_ctx.$slots, "title", { open }), !open ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(unref(translate)("apiClient.collapsibleSection.collapsed")), 1)) : createCommentVNode("", true)]), !open && __props.itemCount ? (openBlock(), createElementBlock("span", _hoisted_4, [createTextVNode(toDisplayString(__props.itemCount) + " ", 1), createElementVNode("span", _hoisted_5, toDisplayString(__props.itemCount === 1 ? unref(translate)("apiClient.collapsibleSection.item") : unref(translate)("apiClient.collapsibleSection.items")), 1)])) : createCommentVNode("", true)]),
|
|
85
|
+
_: 2
|
|
86
|
+
}, 1032, ["id"]))]),
|
|
67
87
|
_: 2
|
|
68
|
-
}, 1032, ["class", "disabled"]), _ctx.$slots.actions ? (openBlock(), createElementBlock("div",
|
|
88
|
+
}, 1032, ["class", "disabled"]), _ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "actions", { open })])) : createCommentVNode("", true)], 2), createVNode(unref(DisclosurePanel), mergeProps(_ctx.$attrs, { class: "diclosure-panel h-full max-h-fit rounded-b" }), {
|
|
69
89
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", { open })]),
|
|
70
90
|
_: 2
|
|
71
91
|
}, 1040)], 8, _hoisted_1)]),
|
|
@@ -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 { useLocalization } from '@/v2/features/localization'\n\nimport ValueEmitter from './ValueEmitter.vue'\n\nconst {\n defaultOpen = true,\n itemCount = 0,\n isStatic,\n} = defineProps<{\n /** Whether the disclosure is open by default. */\n defaultOpen?: boolean\n /** Number of items to show in badge when collapsed. */\n itemCount?: number\n /** Whether the disclosure is static and cannot be toggled. */\n isStatic?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst
|
|
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 { computed, inject, toValue, useId } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nimport { COLLAPSIBLE_SECTION_HEADING_LEVEL } from './collapsible-section-heading-level'\nimport ValueEmitter from './ValueEmitter.vue'\n\nconst {\n defaultOpen = true,\n heading = true,\n itemCount = 0,\n isStatic,\n} = defineProps<{\n /** Whether the disclosure is open by default. */\n defaultOpen?: boolean\n /**\n * Whether the title belongs in the document outline.\n *\n * A section of a request or response is a passage of the page, so its title\n * is a heading by default. A caller whose title only names a cluster of\n * controls opts out: the title renders as plain text and the section becomes\n * a `group` named by it, which keeps the card findable without adding an\n * entry to the heading outline that has no passage behind it.\n */\n heading?: boolean\n /** Number of items to show in badge when collapsed. */\n itemCount?: number\n /** Whether the disclosure is static and cannot be toggled. */\n isStatic?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n}>()\n\nconst { translate } = useLocalization()\n\n/**\n * Defaults to `h2`, for a section that sits directly below the page title. A\n * parent that renders a title above its sections provides a deeper level.\n */\nconst headingLevel = inject(COLLAPSIBLE_SECTION_HEADING_LEVEL, 2)\n\n/**\n * The element that holds the title. A caller that opted out of the heading gets\n * a `span`, which reads as plain text and is also the only valid choice inside\n * the disclosure button, since a heading is not phrasing content.\n */\nconst titleTag = computed((): string =>\n heading ? `h${toValue(headingLevel)}` : 'span',\n)\n\n/** Names the `group` a section without a heading becomes. */\nconst titleId = useId()\n</script>\n\n<template>\n <Disclosure\n v-slot=\"{ open }\"\n as=\"div\"\n class=\"group/collapse text-c-2 focus-within:text-c-1 last:ui-open:border-b-0\"\n :class=\"{\n 'last-of-type:first-of-type:border-b-0': isStatic,\n 'border-b': !isStatic,\n }\"\n :defaultOpen=\"defaultOpen\"\n :static=\"isStatic\">\n <!-- We use this hack to emit the slot value back to the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emit('update:modelValue', value)\" />\n\n <!-- A section that carries a heading stays deliberately unnamed: naming it\n would turn it into a region landmark wrapping its own heading, so\n screen readers announce the title twice before reading the contents.\n Without a heading there is nothing to duplicate, and `group` is not a\n landmark, so the name bounds the card without joining the landmark\n list. -->\n <section\n :aria-labelledby=\"heading ? undefined : titleId\"\n class=\"contents\"\n :role=\"heading ? undefined : 'group'\">\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 <component\n :is=\"titleTag\"\n :id=\"heading ? undefined : titleId\"\n class=\"text-c-1 m-0 flex flex-1 items-center gap-1.5 leading-[20px]\">\n <span class=\"contents\">\n <slot\n name=\"title\"\n :open=\"open\" />\n <span\n v-if=\"!open\"\n class=\"sr-only\"\n >{{ translate('apiClient.collapsibleSection.collapsed') }}</span\n >\n </span>\n\n <!-- Badge showing item count when collapsed. -->\n <span\n v-if=\"!open && itemCount\"\n class=\"bg-b-2 text-c-2 inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs font-semibold\">\n {{ itemCount }}\n <span class=\"sr-only\">{{\n itemCount === 1\n ? translate('apiClient.collapsibleSection.item')\n : translate('apiClient.collapsibleSection.items')\n }}</span>\n </span>\n </component>\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;;;;;;;;;;;;;;;EAsCR,MAAM,OAAO;EAIb,MAAM,EAAE,cAAc,gBAAgB;;;;;EAMtC,MAAM,eAAe,OAAO,mCAAmC,CAAC;;;;;;EAOhE,MAAM,WAAW,eACf,QAAA,UAAU,IAAI,QAAQ,YAAY,MAAM,MAC1C;;EAGA,MAAM,UAAU,MAAM;;uBAIpB,YAsFa,MAAA,UAAA,GAAA;IApFX,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;4BAQrD,mBAgEU,WAAA;KA/DP,mBAAiB,QAAA,UAAU,KAAA,IAAY,MAAA,OAAA;KACxC,OAAM;KACL,MAAM,QAAA,UAAU,KAAA,IAAS;QAC1B,mBAoDM,OAAA,EAnDJ,OAAK,eAAA,CAAC,4BACE,QAAA,YAAQ,gCAAA,CAAA,EAAA,GAAA,CAEhB,YAsCmB,MAAA,gBAAA,GAAA;KArCjB,OAAK,eAAA,CAAC,wKACE,QAAA,YAAQ,OAAA,CAAA;KACf,UAAU,QAAA;;4BAKG,CAAA,CAHL,QAAA,YAAA,UAAA,GADT,YAIc,MAAA,UAAA,GAAA;;MAFZ,OAAM;MACN,MAAK;MACL,MAAK;uDAGP,YA0BY,wBAzBL,SAAA,KAAQ,GAAA;MACZ,IAAI,QAAA,UAAU,KAAA,IAAY,MAAA,OAAA;MAC3B,OAAM;;6BAUC,CATP,mBASO,QATP,YASO,CARL,WAEiB,KAAA,QAAA,SAAA,EAAR,KAAI,CAAA,GAAA,CAEJ,QAAA,UAAA,GADT,mBAIC,QAJD,YAIC,gBADK,MAAA,SAAA,CAAS,CAAA,wCAAA,CAAA,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA,GAAA,CAMR,QAAQ,QAAA,aAAA,UAAA,GADjB,mBASO,QATP,YASO,CAAA,gBAAA,gBANF,QAAA,SAAS,IAAG,KACf,CAAA,GAAA,mBAIS,QAJT,YAIS,gBAHP,QAAA,cAAS,IAA2B,MAAA,SAAA,CAAS,CAAA,mCAAA,IAA0D,MAAA,SAAA,CAAS,CAAA,oCAAA,CAAA,GAAA,CAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA;;;;qCAUhHA,KAAAA,OAAO,WAAA,UAAA,GADf,mBAMM,OANN,YAMM,CAHJ,WAEiB,KAAA,QAAA,WAAA,EAAR,KAAI,CAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,CAAA,GAKjB,YAIkB,MAAA,eAAA,GAJlB,WACUC,KAGQ,QAHF,EACd,OAAM,6CAA4C,CAAA,GAAA;4BAC7B,CAArB,WAAqB,KAAA,QAAA,WAAA,EAAR,KAAI,CAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InjectionKey, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/** Heading levels a collapsible section title may use. */
|
|
3
|
+
export type CollapsibleSectionHeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
/**
|
|
5
|
+
* Heading level for the title of a CollapsibleSection.
|
|
6
|
+
*
|
|
7
|
+
* A section assumes it sits directly below the page title and renders an `h2`.
|
|
8
|
+
* A parent that renders a title of its own above its sections provides a
|
|
9
|
+
* deeper level, so screen reader users hear the sections as subsections of
|
|
10
|
+
* that title rather than as its siblings.
|
|
11
|
+
*/
|
|
12
|
+
export declare const COLLAPSIBLE_SECTION_HEADING_LEVEL: InjectionKey<MaybeRefOrGetter<CollapsibleSectionHeadingLevel>>;
|
|
13
|
+
//# sourceMappingURL=collapsible-section-heading-level.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible-section-heading-level.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/collapsible-section-heading-level.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAEzD,0DAA0D;AAC1D,MAAM,MAAM,8BAA8B,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,EAAE,YAAY,CAAC,gBAAgB,CAAC,8BAA8B,CAAC,CAE5G,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/v2/components/layout/collapsible-section-heading-level.ts
|
|
2
|
+
/**
|
|
3
|
+
* Heading level for the title of a CollapsibleSection.
|
|
4
|
+
*
|
|
5
|
+
* A section assumes it sits directly below the page title and renders an `h2`.
|
|
6
|
+
* A parent that renders a title of its own above its sections provides a
|
|
7
|
+
* deeper level, so screen reader users hear the sections as subsections of
|
|
8
|
+
* that title rather than as its siblings.
|
|
9
|
+
*/
|
|
10
|
+
var COLLAPSIBLE_SECTION_HEADING_LEVEL = Symbol("collapsible-section-heading-level");
|
|
11
|
+
//#endregion
|
|
12
|
+
export { COLLAPSIBLE_SECTION_HEADING_LEVEL };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=collapsible-section-heading-level.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible-section-heading-level.js","names":[],"sources":["../../../../src/v2/components/layout/collapsible-section-heading-level.ts"],"sourcesContent":["import type { InjectionKey, MaybeRefOrGetter } from 'vue'\n\n/** Heading levels a collapsible section title may use. */\nexport type CollapsibleSectionHeadingLevel = 2 | 3 | 4 | 5 | 6\n\n/**\n * Heading level for the title of a CollapsibleSection.\n *\n * A section assumes it sits directly below the page title and renders an `h2`.\n * A parent that renders a title of its own above its sections provides a\n * deeper level, so screen reader users hear the sections as subsections of\n * that title rather than as its siblings.\n */\nexport const COLLAPSIBLE_SECTION_HEADING_LEVEL: InjectionKey<MaybeRefOrGetter<CollapsibleSectionHeadingLevel>> = Symbol(\n 'collapsible-section-heading-level',\n)\n"],"mappings":";;;;;;;;;AAaA,IAAa,oCAAoG,OAC/G,mCACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EACL,iCAAiC,EACjC,KAAK,8BAA8B,GACpC,MAAM,qCAAqC,CAAA"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { COLLAPSIBLE_SECTION_HEADING_LEVEL } from "./collapsible-section-heading-level.js";
|
|
1
2
|
import CollapsibleSection_default from "./CollapsibleSection.vue.js";
|
|
2
|
-
export { CollapsibleSection_default as CollapsibleSection };
|
|
3
|
+
export { COLLAPSIBLE_SECTION_HEADING_LEVEL, CollapsibleSection_default as CollapsibleSection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalClientContainer.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModalClientContainer.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"names":[],"mappings":"AAyLA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAO1D,KAAK,WAAW,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AA+I9C,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAO/C,QAAA,MAAM,UAAU;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
|
|
|
2
2
|
import ModalClientContainer_vue_vue_type_script_setup_true_lang_default from "./ModalClientContainer.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/v2/components/modals/ModalClientContainer.vue
|
|
5
|
-
var ModalClientContainer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ModalClientContainer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var ModalClientContainer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ModalClientContainer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-44c68ca5"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ModalClientContainer_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalClientContainer.vue.js","names":[],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { addScalarClassesToHeadless } from '@scalar/components/helpers'\nimport type { ModalState } from '@scalar/components/modal'\nimport { ScalarTeleportRoot } from '@scalar/components/teleport'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport { nextTick, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst props = defineProps<{ modalState: ModalState }>()\n\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst client = ref<HTMLElement | null>(null)\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: () => client.value as HTMLElement,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <div class=\"scalar scalar-app z-overlay relative\">\n <div\n class=\"scalar-container\"\n :class=\"{ 'scalar-client--open': modalState.open }\">\n <div\n ref=\"client\"\n :aria-label=\"translate('apiClient.modalClientContainer.label')\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: hidden;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n will-change: opacity;\n transition:\n opacity 0.35s ease,\n visibility 0s linear 0.35s;\n}\n\n.scalar-container.scalar-client--open {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transition: opacity 0.35s ease;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ModalClientContainer.vue.js","names":[],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { addScalarClassesToHeadless } from '@scalar/components/helpers'\nimport type { ModalState } from '@scalar/components/modal'\nimport { ScalarTeleportRoot } from '@scalar/components/teleport'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport { nextTick, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst props = defineProps<{ modalState: ModalState }>()\n\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst client = ref<HTMLElement | null>(null)\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: () => client.value as HTMLElement,\n /**\n * Put initial focus on the close button so assistive technology users hear\n * the way out of the dialog before anything else. Returning `undefined`\n * (no marked element, e.g. a layout without a close button) keeps\n * focus-trap's default of the first tabbable element. Never return `null`\n * here: focus-trap throws on a non-node return value. The lookup is scoped\n * to the dialog so a host page element can never be picked up.\n */\n initialFocus: () =>\n client.value?.querySelector<HTMLElement>('[data-modal-initial-focus]') ??\n undefined,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <div class=\"scalar scalar-app z-overlay relative\">\n <div\n class=\"scalar-container\"\n :class=\"{ 'scalar-client--open': modalState.open }\">\n <div\n ref=\"client\"\n :aria-label=\"translate('apiClient.modalClientContainer.label')\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: hidden;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n will-change: opacity;\n transition:\n opacity 0.35s ease,\n visibility 0s linear 0.35s;\n}\n\n.scalar-container.scalar-client--open {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transition: opacity 0.35s ease;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n</style>\n"],"mappings":""}
|
|
@@ -17,7 +17,16 @@ var ModalClientContainer_vue_vue_type_script_setup_true_lang_default = /*@__PURE
|
|
|
17
17
|
const client = ref(null);
|
|
18
18
|
const { activate: activateFocusTrap, deactivate: deactivateFocusTrap } = useFocusTrap(client, {
|
|
19
19
|
allowOutsideClick: true,
|
|
20
|
-
fallbackFocus: () => client.value
|
|
20
|
+
fallbackFocus: () => client.value,
|
|
21
|
+
/**
|
|
22
|
+
* Put initial focus on the close button so assistive technology users hear
|
|
23
|
+
* the way out of the dialog before anything else. Returning `undefined`
|
|
24
|
+
* (no marked element, e.g. a layout without a close button) keeps
|
|
25
|
+
* focus-trap's default of the first tabbable element. Never return `null`
|
|
26
|
+
* here: focus-trap throws on a non-node return value. The lookup is scoped
|
|
27
|
+
* to the dialog so a host page element can never be picked up.
|
|
28
|
+
*/
|
|
29
|
+
initialFocus: () => client.value?.querySelector("[data-modal-initial-focus]") ?? void 0
|
|
21
30
|
});
|
|
22
31
|
onBeforeMount(() => addScalarClassesToHeadless());
|
|
23
32
|
watch(() => props.modalState.open, async (open) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalClientContainer.vue.script.js","names":["$attrs"],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { addScalarClassesToHeadless } from '@scalar/components/helpers'\nimport type { ModalState } from '@scalar/components/modal'\nimport { ScalarTeleportRoot } from '@scalar/components/teleport'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport { nextTick, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst props = defineProps<{ modalState: ModalState }>()\n\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst client = ref<HTMLElement | null>(null)\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: () => client.value as HTMLElement,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <div class=\"scalar scalar-app z-overlay relative\">\n <div\n class=\"scalar-container\"\n :class=\"{ 'scalar-client--open': modalState.open }\">\n <div\n ref=\"client\"\n :aria-label=\"translate('apiClient.modalClientContainer.label')\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: hidden;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n will-change: opacity;\n transition:\n opacity 0.35s ease,\n visibility 0s linear 0.35s;\n}\n\n.scalar-container.scalar-client--open {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transition: opacity 0.35s ease;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;EASA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAKb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,SAAS,IAAwB,IAAI;EAE3C,MAAM,EAAE,UAAU,mBAAmB,YAAY,wBAC/C,aAAa,QAAQ;GACnB,mBAAmB;GACnB,qBAAqB,OAAO;
|
|
1
|
+
{"version":3,"file":"ModalClientContainer.vue.script.js","names":["$attrs"],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { addScalarClassesToHeadless } from '@scalar/components/helpers'\nimport type { ModalState } from '@scalar/components/modal'\nimport { ScalarTeleportRoot } from '@scalar/components/teleport'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport { nextTick, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst props = defineProps<{ modalState: ModalState }>()\n\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst client = ref<HTMLElement | null>(null)\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: () => client.value as HTMLElement,\n /**\n * Put initial focus on the close button so assistive technology users hear\n * the way out of the dialog before anything else. Returning `undefined`\n * (no marked element, e.g. a layout without a close button) keeps\n * focus-trap's default of the first tabbable element. Never return `null`\n * here: focus-trap throws on a non-node return value. The lookup is scoped\n * to the dialog so a host page element can never be picked up.\n */\n initialFocus: () =>\n client.value?.querySelector<HTMLElement>('[data-modal-initial-focus]') ??\n undefined,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <div class=\"scalar scalar-app z-overlay relative\">\n <div\n class=\"scalar-container\"\n :class=\"{ 'scalar-client--open': modalState.open }\">\n <div\n ref=\"client\"\n :aria-label=\"translate('apiClient.modalClientContainer.label')\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: hidden;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n will-change: opacity;\n transition:\n opacity 0.35s ease,\n visibility 0s linear 0.35s;\n}\n\n.scalar-container.scalar-client--open {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transition: opacity 0.35s ease;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;EASA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAKb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,SAAS,IAAwB,IAAI;EAE3C,MAAM,EAAE,UAAU,mBAAmB,YAAY,wBAC/C,aAAa,QAAQ;GACnB,mBAAmB;GACnB,qBAAqB,OAAO;;;;;;;;;GAS5B,oBACE,OAAO,OAAO,cAA2B,4BAA4B,KACrE,KAAA;EACJ,CAAC;EAGH,oBAAoB,2BAA2B,CAAC;EAGhD,YACQ,MAAM,WAAW,MACvB,OAAO,SAAS;GACd,IAAI,MAAM;IACR,MAAM,SAAS;IACf,kBAAkB;IAClB,KAAK,MAAM;GACb,OAAO;IACL,oBAAoB;IACpB,KAAK,OAAO;GACd;EACF,GACA,EAAE,WAAW,MAAM,CACrB;EAGA,sBAAsB;GACpB,oBAAoB;EACtB,CAAC;;uBAIC,mBAsBM,OAtBN,YAsBM,CArBJ,mBAoBM,OAAA,EAnBJ,OAAK,eAAA,CAAC,oBAAkB,EAAA,uBACS,QAAA,WAAW,KAAI,CAAA,CAAA,EAAA,GAAA,CAChD,mBAWM,OAXN,WAWM;aAVA;IAAJ,KAAI;IACH,cAAY,MAAA,SAAA,CAAS,CAAA,sCAAA;IACtB,cAAW;MACHA,KAAAA,QAAM;IACd,OAAM;IACN,MAAK;IACL,UAAS;QACT,YAEqB,MAAA,kBAAA,GAAA,MAAA;2BADX,CAAR,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,IAAA,CAAA,CAAA;;yBAKZ,mBAE+B,OAAA;IAD7B,OAAM;IACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,WAAW,KAAI"}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/**
|
|
3
|
+
* How the toggle is drawn.
|
|
4
|
+
*
|
|
5
|
+
* `default` is a flat button that sits inside a panel. `overlay` is the
|
|
6
|
+
* modal's treatment: the same flat button while the panel header has room
|
|
7
|
+
* for it, and a circular control on the dimmed backdrop once the viewport is
|
|
8
|
+
* narrow enough that the sidebar covers the panel, where it mirrors the
|
|
9
|
+
* close button in the opposite corner.
|
|
10
|
+
*/
|
|
11
|
+
variant?: 'default' | 'overlay';
|
|
12
|
+
};
|
|
1
13
|
type __VLS_ModelProps = {
|
|
2
14
|
modelValue: boolean;
|
|
3
15
|
};
|
|
4
|
-
|
|
16
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
18
|
"update:modelValue": (value: boolean) => any;
|
|
6
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
7
20
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
8
21
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
22
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarToggle.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarToggle.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"names":[],"mappings":"AAkHA,KAAK,WAAW,GAAG;IACjB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CAChC,CAAC;AAWF,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,OAAO,CAAC;CACnB,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAwFxD,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
1
2
|
import SidebarToggle_vue_vue_type_script_setup_true_lang_default from "./SidebarToggle.vue.script.js";
|
|
3
|
+
/* empty css */
|
|
2
4
|
//#region src/v2/components/sidebar/SidebarToggle.vue
|
|
3
|
-
var SidebarToggle_default = SidebarToggle_vue_vue_type_script_setup_true_lang_default;
|
|
5
|
+
var SidebarToggle_default = /*#__PURE__*/ _plugin_vue_export_helper_default(SidebarToggle_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-4a35414a"]]);
|
|
4
6
|
//#endregion
|
|
5
7
|
export { SidebarToggle_default as default };
|
|
6
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarToggle.vue.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { translate } = useLocalization()\n\nconst isSidebarOpen = defineModel<boolean>({\n required: true,\n})\n</script>\n<template>\n <button\n :aria-pressed=\"isSidebarOpen\"\n class=\"scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2\"\n type=\"button\"\n @click=\"isSidebarOpen = !isSidebarOpen\">\n <span class=\"sr-only\">{{\n isSidebarOpen\n ? translate('apiClient.sidebarToggle.hide')\n : translate('apiClient.sidebarToggle.show')\n }}</span>\n <svg\n class=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"mask\">\n <path\n clip-rule=\"evenodd\"\n d=\"M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z\" />\n </clipPath>\n </defs>\n <g clip-path=\"url(#mask)\">\n <path\n class=\"transition-transform duration-300\"\n :class=\"isSidebarOpen ? 'translate-x-0' : '-translate-x-1/2'\"\n d=\"M1 3.2h8v17.5H1z\"\n fill=\"currentColor\" />\n </g>\n <path\n d=\"M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n </svg>\n </button>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SidebarToggle.vue.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { variant = 'default' } = defineProps<{\n /**\n * How the toggle is drawn.\n *\n * `default` is a flat button that sits inside a panel. `overlay` is the\n * modal's treatment: the same flat button while the panel header has room\n * for it, and a circular control on the dimmed backdrop once the viewport is\n * narrow enough that the sidebar covers the panel, where it mirrors the\n * close button in the opposite corner.\n */\n variant?: 'default' | 'overlay'\n}>()\n\nconst { translate } = useLocalization()\n\nconst isSidebarOpen = defineModel<boolean>({\n required: true,\n})\n</script>\n<template>\n <button\n :aria-pressed=\"isSidebarOpen\"\n class=\"scalar-sidebar-toggle\"\n :class=\"\n variant === 'overlay'\n ? 'scalar-sidebar-toggle--overlay'\n : 'text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2'\n \"\n type=\"button\"\n @click=\"isSidebarOpen = !isSidebarOpen\">\n <span class=\"sr-only\">{{\n isSidebarOpen\n ? translate('apiClient.sidebarToggle.hide')\n : translate('apiClient.sidebarToggle.show')\n }}</span>\n <svg\n class=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"mask\">\n <path\n clip-rule=\"evenodd\"\n d=\"M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z\" />\n </clipPath>\n </defs>\n <g clip-path=\"url(#mask)\">\n <path\n class=\"transition-transform duration-300\"\n :class=\"isSidebarOpen ? 'translate-x-0' : '-translate-x-1/2'\"\n d=\"M1 3.2h8v17.5H1z\"\n fill=\"currentColor\" />\n </g>\n <path\n d=\"M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n </svg>\n </button>\n</template>\n\n<style scoped>\n/**\n * The wide state is the default variant written out in plain CSS. Spelling it\n * out here rather than reusing the utility classes keeps the narrow state below\n * from having to outrank a utility of the same specificity.\n */\n.scalar-sidebar-toggle--overlay {\n color: var(--scalar-color-3);\n border-radius: var(--scalar-radius-md);\n padding: 8px;\n}\n.scalar-sidebar-toggle--overlay:hover {\n background: var(--scalar-background-2);\n}\n.scalar-sidebar-toggle--overlay:active {\n color: var(--scalar-color-1);\n}\n\n/**\n * Below the `lg` breakpoint (1000px) the toggle moves onto the dimmed backdrop\n * and matches the close button in the opposite corner: white on a translucent\n * fill, in a 36px circle. The padding is literal rather than a utility class so\n * that circle matches that button even when this component is consumed from a\n * build that generates its own utilities.\n *\n * The breakpoint is where the address bar stops being able to centre itself.\n * The bar caps at 768px, so once the panel is narrower than roughly 870px the\n * bar's left edge slides under a toggle sitting inside the panel and clips the\n * method chip. `lg` clears that crossover with room to spare.\n */\n@media (width < 1000px) {\n .scalar-sidebar-toggle--overlay {\n color: white;\n background: rgba(0, 0, 0, 0.1);\n border-radius: var(--scalar-radius-full);\n padding: 10px;\n }\n .scalar-sidebar-toggle--overlay:hover {\n background: rgba(255, 255, 255, 0.1);\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useLocalization } from "../../features/localization/index.js";
|
|
2
|
-
import { createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, useModel } from "vue";
|
|
2
|
+
import { createElementBlock, createElementVNode, defineComponent, mergeModels, normalizeClass, openBlock, toDisplayString, unref, useModel } from "vue";
|
|
3
3
|
//#region src/v2/components/sidebar/SidebarToggle.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var _hoisted_1 = ["aria-pressed"];
|
|
5
5
|
var _hoisted_2 = { class: "sr-only" };
|
|
@@ -12,13 +12,13 @@ var _hoisted_3 = {
|
|
|
12
12
|
var _hoisted_4 = { "clip-path": "url(#mask)" };
|
|
13
13
|
var SidebarToggle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
14
14
|
__name: "SidebarToggle",
|
|
15
|
-
props: {
|
|
15
|
+
props: /*@__PURE__*/ mergeModels({ variant: { default: "default" } }, {
|
|
16
16
|
"modelValue": {
|
|
17
17
|
type: Boolean,
|
|
18
18
|
required: true
|
|
19
19
|
},
|
|
20
20
|
"modelModifiers": {}
|
|
21
|
-
},
|
|
21
|
+
}),
|
|
22
22
|
emits: ["update:modelValue"],
|
|
23
23
|
setup(__props) {
|
|
24
24
|
const { translate } = useLocalization();
|
|
@@ -26,7 +26,7 @@ var SidebarToggle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
26
26
|
return (_ctx, _cache) => {
|
|
27
27
|
return openBlock(), createElementBlock("button", {
|
|
28
28
|
"aria-pressed": isSidebarOpen.value,
|
|
29
|
-
class: "scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2",
|
|
29
|
+
class: normalizeClass(["scalar-sidebar-toggle", __props.variant === "overlay" ? "scalar-sidebar-toggle--overlay" : "text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2"]),
|
|
30
30
|
type: "button",
|
|
31
31
|
onClick: _cache[0] || (_cache[0] = ($event) => isSidebarOpen.value = !isSidebarOpen.value)
|
|
32
32
|
}, [createElementVNode("span", _hoisted_2, toDisplayString(isSidebarOpen.value ? unref(translate)("apiClient.sidebarToggle.hide") : unref(translate)("apiClient.sidebarToggle.show")), 1), (openBlock(), createElementBlock("svg", _hoisted_3, [
|
|
@@ -46,7 +46,7 @@ var SidebarToggle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
46
46
|
"stroke-linejoin": "round",
|
|
47
47
|
"stroke-width": "2"
|
|
48
48
|
}, null, -1))
|
|
49
|
-
]))],
|
|
49
|
+
]))], 10, _hoisted_1);
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
});
|