Major overhaul to the theme and now functioning.
This commit is contained in:
1 parent
5823ca3c39
commit
a475dfeab6
5218 files changed
+1643729
-13229
No files matched your search
Generated
Vendored
+99
@@ -0,0 +1,99 @@
|
||||
.v-dialog {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: auto;
|
||||
}
|
||||
.v-dialog > .v-overlay__content {
|
||||
max-height: calc(100% - 48px);
|
||||
width: calc(100% - 48px);
|
||||
max-width: calc(100% - 48px);
|
||||
margin: 24px;
|
||||
}
|
||||
.v-dialog > .v-overlay__content,
|
||||
.v-dialog > .v-overlay__content > form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
}
|
||||
.v-dialog > .v-overlay__content > .v-card,
|
||||
.v-dialog > .v-overlay__content > .v-sheet,
|
||||
.v-dialog > .v-overlay__content > form > .v-card,
|
||||
.v-dialog > .v-overlay__content > form > .v-sheet {
|
||||
--v-scrollbar-offset: 0px;
|
||||
border-radius: 4px;
|
||||
overflow-y: auto;
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
.v-dialog > .v-overlay__content > .v-card,
|
||||
.v-dialog > .v-overlay__content > .v-sheet,
|
||||
.v-dialog > .v-overlay__content > form > .v-card,
|
||||
.v-dialog > .v-overlay__content > form > .v-sheet {
|
||||
box-shadow: 0px 11px 15px -7px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 24px 38px 3px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 9px 46px 8px var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12));
|
||||
}
|
||||
.v-dialog > .v-overlay__content > .v-card,
|
||||
.v-dialog > .v-overlay__content > form > .v-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.v-dialog > .v-overlay__content > .v-card > .v-card-item,
|
||||
.v-dialog > .v-overlay__content > form > .v-card > .v-card-item {
|
||||
padding: 16px 24px;
|
||||
}
|
||||
.v-dialog > .v-overlay__content > .v-card > .v-card-item + .v-card-text,
|
||||
.v-dialog > .v-overlay__content > form > .v-card > .v-card-item + .v-card-text {
|
||||
padding-top: 0;
|
||||
}
|
||||
.v-dialog > .v-overlay__content > .v-card > .v-card-text,
|
||||
.v-dialog > .v-overlay__content > form > .v-card > .v-card-text {
|
||||
font-size: inherit;
|
||||
letter-spacing: 0.03125em;
|
||||
line-height: inherit;
|
||||
padding: 16px 24px 24px;
|
||||
}
|
||||
.v-dialog > .v-overlay__content > .v-card > .v-card-actions,
|
||||
.v-dialog > .v-overlay__content > form > .v-card > .v-card-actions {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.v-dialog--fullscreen {
|
||||
--v-scrollbar-offset: 0px;
|
||||
}
|
||||
.v-dialog--fullscreen > .v-overlay__content {
|
||||
border-radius: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.v-dialog--fullscreen > .v-overlay__content > .v-card,
|
||||
.v-dialog--fullscreen > .v-overlay__content > .v-sheet,
|
||||
.v-dialog--fullscreen > .v-overlay__content > form > .v-card,
|
||||
.v-dialog--fullscreen > .v-overlay__content > form > .v-sheet {
|
||||
min-height: 100%;
|
||||
min-width: 100%;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.v-dialog--scrollable > .v-overlay__content > form,
|
||||
.v-dialog--scrollable > .v-overlay__content > form > .v-card {
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
.v-dialog--scrollable > .v-overlay__content,
|
||||
.v-dialog--scrollable > .v-overlay__content > .v-card,
|
||||
.v-dialog--scrollable > .v-overlay__content > form,
|
||||
.v-dialog--scrollable > .v-overlay__content > form > .v-card {
|
||||
display: flex;
|
||||
flex: 1 1 100%;
|
||||
flex-direction: column;
|
||||
}
|
||||
.v-dialog--scrollable > .v-overlay__content > .v-card > .v-card-text,
|
||||
.v-dialog--scrollable > .v-overlay__content > form > .v-card > .v-card-text {
|
||||
backface-visibility: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
Generated
Vendored
+3436
File diff suppressed because it is too large.
Load diff
Generated
Vendored
+111
@@ -0,0 +1,111 @@
|
||||
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
||||
// Styles
|
||||
import "./VDialog.css";
|
||||
|
||||
// Components
|
||||
import { VDialogTransition } from "../transitions/index.js";
|
||||
import { VDefaultsProvider } from "../VDefaultsProvider/index.js";
|
||||
import { VOverlay } from "../VOverlay/index.js";
|
||||
import { makeVOverlayProps } from "../VOverlay/VOverlay.js"; // Composables
|
||||
import { forwardRefs } from "../../composables/forwardRefs.js";
|
||||
import { useProxiedModel } from "../../composables/proxiedModel.js";
|
||||
import { useScopeId } from "../../composables/scopeId.js"; // Utilities
|
||||
import { mergeProps, nextTick, ref, watch } from 'vue';
|
||||
import { genericComponent, omit, propsFactory, useRender } from "../../util/index.js"; // Types
|
||||
export const makeVDialogProps = propsFactory({
|
||||
fullscreen: Boolean,
|
||||
scrollable: Boolean,
|
||||
...omit(makeVOverlayProps({
|
||||
captureFocus: true,
|
||||
origin: 'center center',
|
||||
scrollStrategy: 'block',
|
||||
transition: {
|
||||
component: VDialogTransition
|
||||
},
|
||||
zIndex: 2400,
|
||||
retainFocus: true
|
||||
}), ['disableInitialFocus'])
|
||||
}, 'VDialog');
|
||||
export const VDialog = genericComponent()({
|
||||
name: 'VDialog',
|
||||
props: makeVDialogProps(),
|
||||
emits: {
|
||||
'update:modelValue': value => true,
|
||||
afterEnter: () => true,
|
||||
afterLeave: () => true
|
||||
},
|
||||
setup(props, _ref) {
|
||||
let {
|
||||
emit,
|
||||
slots
|
||||
} = _ref;
|
||||
const isActive = useProxiedModel(props, 'modelValue');
|
||||
const {
|
||||
scopeId
|
||||
} = useScopeId();
|
||||
const overlay = ref();
|
||||
function onAfterEnter() {
|
||||
emit('afterEnter');
|
||||
if ((props.scrim || props.retainFocus) && overlay.value?.contentEl && !overlay.value.contentEl.contains(document.activeElement)) {
|
||||
overlay.value.contentEl.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
}
|
||||
}
|
||||
function onAfterLeave() {
|
||||
emit('afterLeave');
|
||||
}
|
||||
watch(isActive, async val => {
|
||||
if (!val) {
|
||||
await nextTick();
|
||||
overlay.value.activatorEl?.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
}
|
||||
});
|
||||
useRender(() => {
|
||||
const overlayProps = VOverlay.filterProps(props);
|
||||
const activatorProps = mergeProps({
|
||||
'aria-haspopup': 'dialog'
|
||||
}, props.activatorProps);
|
||||
const contentProps = mergeProps({
|
||||
tabindex: -1
|
||||
}, props.contentProps);
|
||||
return _createVNode(VOverlay, _mergeProps({
|
||||
"ref": overlay,
|
||||
"class": ['v-dialog', {
|
||||
'v-dialog--fullscreen': props.fullscreen,
|
||||
'v-dialog--scrollable': props.scrollable
|
||||
}, props.class],
|
||||
"style": props.style
|
||||
}, overlayProps, {
|
||||
"modelValue": isActive.value,
|
||||
"onUpdate:modelValue": $event => isActive.value = $event,
|
||||
"aria-modal": "true",
|
||||
"activatorProps": activatorProps,
|
||||
"contentProps": contentProps,
|
||||
"height": !props.fullscreen ? props.height : undefined,
|
||||
"width": !props.fullscreen ? props.width : undefined,
|
||||
"maxHeight": !props.fullscreen ? props.maxHeight : undefined,
|
||||
"maxWidth": !props.fullscreen ? props.maxWidth : undefined,
|
||||
"role": "dialog",
|
||||
"onAfterEnter": onAfterEnter,
|
||||
"onAfterLeave": onAfterLeave
|
||||
}, scopeId), {
|
||||
activator: slots.activator,
|
||||
default: function () {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
return _createVNode(VDefaultsProvider, {
|
||||
"root": "VDialog"
|
||||
}, {
|
||||
default: () => [slots.default?.(...args)]
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
return forwardRefs({}, overlay);
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=VDialog.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"VDialog.js","names":["VDialogTransition","VDefaultsProvider","VOverlay","makeVOverlayProps","forwardRefs","useProxiedModel","useScopeId","mergeProps","nextTick","ref","watch","genericComponent","omit","propsFactory","useRender","makeVDialogProps","fullscreen","Boolean","scrollable","captureFocus","origin","scrollStrategy","transition","component","zIndex","retainFocus","VDialog","name","props","emits","value","afterEnter","afterLeave","setup","_ref","emit","slots","isActive","scopeId","overlay","onAfterEnter","scrim","contentEl","contains","document","activeElement","focus","preventScroll","onAfterLeave","val","activatorEl","overlayProps","filterProps","activatorProps","contentProps","tabindex","_createVNode","_mergeProps","class","style","$event","height","undefined","width","maxHeight","maxWidth","activator","default","_len","arguments","length","args","Array","_key"],"sources":["../../../src/components/VDialog/VDialog.tsx"],"sourcesContent":["// Styles\nimport './VDialog.sass'\n\n// Components\nimport { VDialogTransition } from '@/components/transitions'\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\nimport { VOverlay } from '@/components/VOverlay'\nimport { makeVOverlayProps } from '@/components/VOverlay/VOverlay'\n\n// Composables\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { useScopeId } from '@/composables/scopeId'\n\n// Utilities\nimport { mergeProps, nextTick, ref, watch } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { OverlaySlots } from '@/components/VOverlay/VOverlay'\n\nexport const makeVDialogProps = propsFactory({\n fullscreen: Boolean,\n scrollable: Boolean,\n\n ...omit(makeVOverlayProps({\n captureFocus: true,\n origin: 'center center' as const,\n scrollStrategy: 'block' as const,\n transition: { component: VDialogTransition },\n zIndex: 2400,\n retainFocus: true,\n }), ['disableInitialFocus']),\n}, 'VDialog')\n\nexport const VDialog = genericComponent<OverlaySlots>()({\n name: 'VDialog',\n\n props: makeVDialogProps(),\n\n emits: {\n 'update:modelValue': (value: boolean) => true,\n afterEnter: () => true,\n afterLeave: () => true,\n },\n\n setup (props, { emit, slots }) {\n const isActive = useProxiedModel(props, 'modelValue')\n const { scopeId } = useScopeId()\n\n const overlay = ref<VOverlay>()\n\n function onAfterEnter () {\n emit('afterEnter')\n if (\n (props.scrim || props.retainFocus) &&\n overlay.value?.contentEl &&\n !overlay.value.contentEl.contains(document.activeElement)\n ) {\n overlay.value.contentEl.focus({ preventScroll: true })\n }\n }\n\n function onAfterLeave () {\n emit('afterLeave')\n }\n\n watch(isActive, async val => {\n if (!val) {\n await nextTick()\n overlay.value!.activatorEl?.focus({ preventScroll: true })\n }\n })\n\n useRender(() => {\n const overlayProps = VOverlay.filterProps(props)\n const activatorProps = mergeProps({\n 'aria-haspopup': 'dialog',\n }, props.activatorProps)\n const contentProps = mergeProps({\n tabindex: -1,\n }, props.contentProps)\n\n return (\n <VOverlay\n ref={ overlay }\n class={[\n 'v-dialog',\n {\n 'v-dialog--fullscreen': props.fullscreen,\n 'v-dialog--scrollable': props.scrollable,\n },\n props.class,\n ]}\n style={ props.style }\n { ...overlayProps }\n v-model={ isActive.value }\n aria-modal=\"true\"\n activatorProps={ activatorProps }\n contentProps={ contentProps }\n height={ !props.fullscreen ? props.height : undefined }\n width={ !props.fullscreen ? props.width : undefined }\n maxHeight={ !props.fullscreen ? props.maxHeight : undefined }\n maxWidth={ !props.fullscreen ? props.maxWidth : undefined }\n role=\"dialog\"\n onAfterEnter={ onAfterEnter }\n onAfterLeave={ onAfterLeave }\n { ...scopeId }\n >\n {{\n activator: slots.activator,\n default: (...args) => (\n <VDefaultsProvider root=\"VDialog\">\n { slots.default?.(...args) }\n </VDefaultsProvider>\n ),\n }}\n </VOverlay>\n )\n })\n\n return forwardRefs({}, overlay)\n },\n})\n\nexport type VDialog = InstanceType<typeof VDialog>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,iBAAiB;AAAA,SACjBC,iBAAiB;AAAA,SACjBC,QAAQ;AAAA,SACRC,iBAAiB,mCAE1B;AAAA,SACSC,WAAW;AAAA,SACXC,eAAe;AAAA,SACfC,UAAU,wCAEnB;AACA,SAASC,UAAU,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC7CC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,+BAExD;AAGA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAAC;EAC3CG,UAAU,EAAEC,OLine truncated
|
||||
Generated
Vendored
+90
@@ -0,0 +1,90 @@
|
||||
@use '../../styles/tools'
|
||||
@use './variables' as *
|
||||
|
||||
@include tools.layer('components')
|
||||
.v-dialog
|
||||
align-items: center
|
||||
justify-content: center
|
||||
margin: auto
|
||||
|
||||
> .v-overlay__content
|
||||
max-height: calc(100% - #{$dialog-margin * 2})
|
||||
width: calc(100% - #{$dialog-margin * 2})
|
||||
max-width: calc(100% - #{$dialog-margin * 2})
|
||||
margin: $dialog-margin
|
||||
|
||||
&,
|
||||
> form
|
||||
display: flex
|
||||
flex-direction: column
|
||||
min-height: 0
|
||||
|
||||
> .v-card,
|
||||
> .v-sheet
|
||||
--v-scrollbar-offset: 0px
|
||||
border-radius: $dialog-border-radius
|
||||
overflow-y: auto
|
||||
flex: 1 1 100%
|
||||
|
||||
@include tools.elevation($dialog-elevation)
|
||||
|
||||
> .v-card
|
||||
display: flex
|
||||
flex-direction: column
|
||||
|
||||
> .v-card-item
|
||||
padding: $dialog-card-header-padding
|
||||
|
||||
+ .v-card-text
|
||||
padding-top: $dialog-card-header-text-padding-top
|
||||
|
||||
> .v-card-text
|
||||
font-size: inherit
|
||||
letter-spacing: $dialog-card-text-letter-spacing
|
||||
line-height: inherit
|
||||
padding: $dialog-card-text-padding
|
||||
|
||||
> .v-card-actions
|
||||
justify-content: $dialog-card-actions-justify
|
||||
|
||||
.v-dialog--fullscreen
|
||||
--v-scrollbar-offset: 0px
|
||||
|
||||
> .v-overlay__content
|
||||
border-radius: 0
|
||||
margin: 0
|
||||
padding: 0
|
||||
width: 100%
|
||||
height: 100%
|
||||
max-width: 100%
|
||||
max-height: 100%
|
||||
overflow-y: auto
|
||||
top: 0
|
||||
left: 0
|
||||
|
||||
&,
|
||||
> form
|
||||
> .v-card,
|
||||
> .v-sheet
|
||||
min-height: 100%
|
||||
min-width: 100%
|
||||
border-radius: 0
|
||||
|
||||
.v-dialog--scrollable > .v-overlay__content
|
||||
> form
|
||||
&,
|
||||
> .v-card
|
||||
max-height: 100%
|
||||
max-width: 100%
|
||||
|
||||
&,
|
||||
> form
|
||||
&,
|
||||
> .v-card
|
||||
display: flex
|
||||
flex: 1 1 100%
|
||||
flex-direction: column
|
||||
|
||||
> .v-card > .v-card-text
|
||||
backface-visibility: hidden
|
||||
overflow-y: auto
|
||||
Generated
Vendored
+87
@@ -0,0 +1,87 @@
|
||||
import { createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, createVNode as _createVNode } from "vue";
|
||||
// Components
|
||||
import { VDialog } from "../VDialog.js"; // Utilities
|
||||
import { commands, render, screen, userEvent } from '@test';
|
||||
import { nextTick, ref } from 'vue';
|
||||
|
||||
// Tests
|
||||
describe('VDialog', () => {
|
||||
it('should render correctly', async () => {
|
||||
const model = ref(false);
|
||||
render(() => _createElementVNode("div", null, [_createVNode(VDialog, {
|
||||
"modelValue": model.value,
|
||||
"onUpdate:modelValue": $event => model.value = $event,
|
||||
"data-testid": "dialog"
|
||||
}, {
|
||||
default: () => [_createElementVNode("div", {
|
||||
"data-testid": "content"
|
||||
}, [_createTextVNode("Content")])]
|
||||
})]));
|
||||
expect(screen.queryByTestId('dialog')).toBeNull();
|
||||
model.value = true;
|
||||
await nextTick();
|
||||
await expect(screen.findByTestId('dialog')).resolves.toBeVisible();
|
||||
await expect.element(await screen.findByTestId('content')).toBeVisible();
|
||||
await commands.click(0, 0);
|
||||
await expect.poll(() => model.value).toBeFalsy();
|
||||
await expect.poll(() => screen.queryByTestId('dialog')).toBeNull();
|
||||
await expect.poll(() => screen.queryByTestId('content')).toBeNull();
|
||||
});
|
||||
it('should emit afterLeave', async () => {
|
||||
const model = ref(true);
|
||||
const onAfterLeave = vi.fn();
|
||||
render(() => _createElementVNode("div", null, [_createVNode(VDialog, {
|
||||
"modelValue": model.value,
|
||||
"onUpdate:modelValue": $event => model.value = $event,
|
||||
"onAfterLeave": onAfterLeave
|
||||
}, {
|
||||
default: () => [_createElementVNode("div", {
|
||||
"data-test": "content"
|
||||
}, [_createTextVNode("Content")])]
|
||||
})]));
|
||||
await commands.click(0, 0);
|
||||
await expect.poll(() => onAfterLeave).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
it('should focus on the last element when shift + tab key is pressed on the first element', async () => {
|
||||
const model = ref(true);
|
||||
render(() => _createElementVNode("div", null, [_createVNode(VDialog, {
|
||||
"modelValue": model.value,
|
||||
"onUpdate:modelValue": $event => model.value = $event,
|
||||
"persistent": true
|
||||
}, {
|
||||
default: () => [_createElementVNode("div", null, [_createElementVNode("button", {
|
||||
"data-testid": "first"
|
||||
}, [_createTextVNode("First")]), _createElementVNode("button", {
|
||||
"data-testid": "last"
|
||||
}, [_createTextVNode("Last")])])]
|
||||
})]));
|
||||
const first = screen.getByCSS('button[data-testid="first"]');
|
||||
const last = screen.getByCSS('button[data-testid="last"]');
|
||||
first.focus();
|
||||
await expect.poll(() => document.activeElement).toBe(first);
|
||||
await userEvent.tab({
|
||||
shift: true
|
||||
});
|
||||
await expect.poll(() => document.activeElement).toBe(last);
|
||||
});
|
||||
it('should focus on the first element when Tab key is pressed on the last element', async () => {
|
||||
const model = ref(true);
|
||||
render(() => _createElementVNode("div", null, [_createVNode(VDialog, {
|
||||
"modelValue": model.value,
|
||||
"onUpdate:modelValue": $event => model.value = $event
|
||||
}, {
|
||||
default: () => [_createElementVNode("div", null, [_createElementVNode("button", {
|
||||
"data-testid": "first"
|
||||
}, [_createTextVNode("First")]), _createElementVNode("button", {
|
||||
"data-testid": "last"
|
||||
}, [_createTextVNode("Last")])])]
|
||||
})]));
|
||||
const first = screen.getByCSS('button[data-testid="first"]');
|
||||
const last = screen.getByCSS('button[data-testid="last"]');
|
||||
last.focus();
|
||||
await expect.poll(() => document.activeElement).toBe(last);
|
||||
await userEvent.tab();
|
||||
await expect.poll(() => document.activeElement).toBe(first);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=VDialog.spec.browser.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"VDialog.spec.browser.js","names":["VDialog","commands","render","screen","userEvent","nextTick","ref","describe","it","model","_createElementVNode","_createVNode","value","$event","default","_createTextVNode","expect","queryByTestId","toBeNull","findByTestId","resolves","toBeVisible","element","click","poll","toBeFalsy","onAfterLeave","vi","fn","toHaveBeenCalledTimes","first","getByCSS","last","focus","document","activeElement","toBe","tab","shift"],"sources":["../../../../src/components/VDialog/__test__/VDialog.spec.browser.tsx"],"sourcesContent":["// Components\nimport { VDialog } from '../VDialog'\n\n// Utilities\nimport { commands, render, screen, userEvent } from '@test'\nimport { nextTick, ref } from 'vue'\n\n// Tests\ndescribe('VDialog', () => {\n it('should render correctly', async () => {\n const model = ref(false)\n render(() => (\n <div>\n <VDialog v-model={ model.value } data-testid=\"dialog\">\n <div data-testid=\"content\">Content</div>\n </VDialog>\n </div>\n ))\n\n expect(screen.queryByTestId('dialog')).toBeNull()\n\n model.value = true\n await nextTick()\n await expect(screen.findByTestId('dialog')).resolves.toBeVisible()\n await expect.element(await screen.findByTestId('content')).toBeVisible()\n\n await commands.click(0, 0)\n await expect.poll(() => model.value).toBeFalsy()\n await expect.poll(() => screen.queryByTestId('dialog')).toBeNull()\n await expect.poll(() => screen.queryByTestId('content')).toBeNull()\n })\n\n it('should emit afterLeave', async () => {\n const model = ref(true)\n const onAfterLeave = vi.fn()\n render(() => (\n <div>\n <VDialog v-model={ model.value } onAfterLeave={ onAfterLeave }>\n <div data-test=\"content\">Content</div>\n </VDialog>\n </div>\n ))\n\n await commands.click(0, 0)\n await expect.poll(() => onAfterLeave).toHaveBeenCalledTimes(1)\n })\n\n it('should focus on the last element when shift + tab key is pressed on the first element', async () => {\n const model = ref(true)\n render(() => (\n <div>\n <VDialog v-model={ model.value } persistent>\n <div>\n <button data-testid=\"first\">First</button>\n <button data-testid=\"last\">Last</button>\n </div>\n </VDialog>\n </div>\n ))\n const first = screen.getByCSS('button[data-testid=\"first\"]')\n const last = screen.getByCSS('button[data-testid=\"last\"]')\n\n first.focus()\n await expect.poll(() => document.activeElement).toBe(first)\n\n await userEvent.tab({ shift: true })\n await expect.poll(() => document.activeElement).toBe(last)\n })\n\n it('should focus on the first element when Tab key is pressed on the last element', async () => {\n const model = ref(true)\n render(() => (\n <div>\n <VDialog v-model={ model.value }>\n <div>\n <button data-testid=\"first\">First</button>\n <button data-testid=\"last\">Last</button>\n </div>\n </VDialog>\n </div>\n ))\n const first = screen.getByCSS('button[data-testid=\"first\"]')\n const last = screen.getByCSS('button[data-testid=\"last\"]')\n\n last.focus()\n await expect.poll(() => document.activeElement).toBe(last)\n\n await userEvent.tab()\n await expect.poll(() => document.activeElement).toBe(first)\n })\n})\n"],"mappings":";AAAA;AAAA,SACSA,OAAO,yBAEhB;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAC3D,SAASC,QAAQ,EAAEC,GAAG,QAAQ,KAAK;;AAEnC;AACAC,QAAQ,CAAC,SAAS,EAAE,MAAM;EACxBC,EAAE,CAAC,yBAAyB,EAAE,YAAY;IACxC,MAAMC,KAAK,GAAGH,GAAG,CAAC,KAAK,CAAC;IACxBJ,MAAM,CAAC,MAAAQ,mBAAA,eAAAC,YAAA,CAAAX,OAAA;MAAA,cAEgBS,KAAK,CAACG,KAAK;MAAA,uBAAAC,MAAA,IAAXJ,KAAK,CAACG,KAAK,GAAAC,MAAA;MAAA;IAAA;MAAAC,OAAA,EAAAA,CAAA,MAAAJ,mBAAA;QAAA;MAAA,IAAAK,gBAAA;IAAA,IAIjC,CAAC;IAEFC,MAAM,CAACb,MAAM,CAACc,aAAa,CAAC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;IAEjDT,KAAK,CAACG,KAAK,GAAG,IAAI;IAClB,MAAMP,QAAQ,CAAC,CAAC;IAChB,MAAMW,MAAM,CAACb,MAAM,CAACgB,YAAY,CAAC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAACC,WAAW,CAAC,CAAC;IAClE,MAAML,MAAM,CAACM,OAAO,CAAC,MAAMnB,MAAM,CAACgB,YAAY,CAAC,SAAS,CAAC,CAAC,CAACE,WAAW,CAAC,CAAC;IAExE,MAAMpB,QAAQ,CAACsB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1B,MAAMP,MAAM,CAACQ,IAAI,CAAC,MAAMf,KAAK,CAACG,KAAK,CAAC,CAACa,SAAS,CAAC,CAAC;IAChD,MAAMT,MAAM,CAACQ,IAAI,CAAC,MAAMrB,MAAM,CAACc,aAAa,CAAC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;IAClE,MAAMF,MAAM,CAACQ,IAAI,CAAC,MAAMrB,MAAM,CAACc,aAAa,CAAC,SAAS,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACrE,CAAC,CAAC;EAEFV,EAAE,CAAC,wBAAwB,EAAE,YAAY;IACvC,MAAMC,KAAK,GAAGH,GAAG,CAAC,IAAI,CAAC;IACvB,MAAMoB,YAAY,GAAGC,EAAE,CAACC,EAAE,CAAC,CAAC;IAC5B1B,MAAM,CAAC,MAAAQ,mBAAA,eAAAC,YAAA,CAAAX,OAAA;MAAA,cAEgBS,KAAK,CAACG,KAAK;MAAA,uBAAAC,MAAA,IAAXJ,KAAK,CAACG,KAAK,GAAAC,MAAA;MAAA,gBAAkBa;IAAY;MAAAZ,OAAA,EAAAA,CAAA,MAAAJ,mBAAA;QAAA;MAAA,IAAAK,gBAAA;IAAA,IAI/D,CAAC;IAEF,MAAMd,QAAQ,CAACsB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1B,MAAMP,MAAM,CAALine truncated
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
@use 'sass:map';
|
||||
@use '../../styles/settings';
|
||||
@use '../../styles/tools';
|
||||
|
||||
// Defaults
|
||||
$dialog-elevation: 24 !default;
|
||||
$dialog-border-radius: settings.$border-radius-root !default;
|
||||
$dialog-margin: 24px !default;
|
||||
|
||||
$dialog-card-actions-justify: flex-end !default;
|
||||
$dialog-card-header-padding: 16px 24px !default;
|
||||
$dialog-card-header-text-padding-top: 0 !default;
|
||||
$dialog-card-text-padding: 16px 24px 24px !default;
|
||||
$dialog-card-text-letter-spacing: tools.map-deep-get(settings.$typography, 'body-1', 'letter-spacing') !default;
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
export { VDialog } from './VDialog.js';
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export { VDialog } from "./VDialog.js";
|
||||
//# sourceMappingURL=index.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","names":["VDialog"],"sources":["../../../src/components/VDialog/index.ts"],"sourcesContent":["export { VDialog } from './VDialog'\n"],"mappings":"SAASA,OAAO","ignoreList":[]}
|
||||
Reference in new issue
Block a user