Tracking de l'application VApp (IHM du jeu)

This commit is contained in:
2025-05-11 18:04:12 +02:00
commit 89e9db9b62
17763 changed files with 3718499 additions and 0 deletions

View File

@ -0,0 +1,14 @@
.v-menu > .v-overlay__content {
display: flex;
flex-direction: column;
border-radius: 4px;
}
.v-menu > .v-overlay__content > .v-card,
.v-menu > .v-overlay__content > .v-sheet,
.v-menu > .v-overlay__content > .v-list {
background: rgb(var(--v-theme-surface));
border-radius: inherit;
overflow: auto;
height: 100%;
box-shadow: 0px 5px 5px -3px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 8px 10px 1px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 3px 14px 2px var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12));
}

View File

@ -0,0 +1,163 @@
import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
// Styles
import "./VMenu.css";
// Components
import { VDialogTransition } from "../transitions/index.mjs";
import { VDefaultsProvider } from "../VDefaultsProvider/index.mjs";
import { VOverlay } from "../VOverlay/index.mjs";
import { makeVOverlayProps } from "../VOverlay/VOverlay.mjs"; // Composables
import { forwardRefs } from "../../composables/forwardRefs.mjs";
import { useProxiedModel } from "../../composables/proxiedModel.mjs";
import { useScopeId } from "../../composables/scopeId.mjs"; // Utilities
import { computed, inject, mergeProps, nextTick, provide, ref, shallowRef, watch } from 'vue';
import { VMenuSymbol } from "./shared.mjs";
import { focusableChildren, focusChild, genericComponent, getNextElement, getUid, omit, propsFactory, useRender } from "../../util/index.mjs"; // Types
export const makeVMenuProps = propsFactory({
// TODO
// disableKeys: Boolean,
id: String,
...omit(makeVOverlayProps({
closeDelay: 250,
closeOnContentClick: true,
locationStrategy: 'connected',
openDelay: 300,
scrim: false,
scrollStrategy: 'reposition',
transition: {
component: VDialogTransition
}
}), ['absolute'])
}, 'VMenu');
export const VMenu = genericComponent()({
name: 'VMenu',
props: makeVMenuProps(),
emits: {
'update:modelValue': value => true
},
setup(props, _ref) {
let {
slots
} = _ref;
const isActive = useProxiedModel(props, 'modelValue');
const {
scopeId
} = useScopeId();
const uid = getUid();
const id = computed(() => props.id || `v-menu-${uid}`);
const overlay = ref();
const parent = inject(VMenuSymbol, null);
const openChildren = shallowRef(0);
provide(VMenuSymbol, {
register() {
++openChildren.value;
},
unregister() {
--openChildren.value;
},
closeParents() {
setTimeout(() => {
if (!openChildren.value) {
isActive.value = false;
parent?.closeParents();
}
}, 40);
}
});
async function onFocusIn(e) {
const before = e.relatedTarget;
const after = e.target;
await nextTick();
if (isActive.value && before !== after && overlay.value?.contentEl &&
// We're the topmost menu
overlay.value?.globalTop &&
// It isn't the document or the menu body
![document, overlay.value.contentEl].includes(after) &&
// It isn't inside the menu body
!overlay.value.contentEl.contains(after)) {
const focusable = focusableChildren(overlay.value.contentEl);
focusable[0]?.focus();
}
}
watch(isActive, val => {
if (val) {
parent?.register();
document.addEventListener('focusin', onFocusIn, {
once: true
});
} else {
parent?.unregister();
document.removeEventListener('focusin', onFocusIn);
}
});
function onClickOutside() {
parent?.closeParents();
}
function onKeydown(e) {
if (props.disabled) return;
if (e.key === 'Tab') {
const nextElement = getNextElement(focusableChildren(overlay.value?.contentEl, false), e.shiftKey ? 'prev' : 'next', el => el.tabIndex >= 0);
if (!nextElement) {
isActive.value = false;
overlay.value?.activatorEl?.focus();
}
}
}
function onActivatorKeydown(e) {
if (props.disabled) return;
const el = overlay.value?.contentEl;
if (el && isActive.value) {
if (e.key === 'ArrowDown') {
e.preventDefault();
focusChild(el, 'next');
} else if (e.key === 'ArrowUp') {
e.preventDefault();
focusChild(el, 'prev');
}
} else if (['ArrowDown', 'ArrowUp'].includes(e.key)) {
isActive.value = true;
e.preventDefault();
setTimeout(() => setTimeout(() => onActivatorKeydown(e)));
}
}
const activatorProps = computed(() => mergeProps({
'aria-haspopup': 'menu',
'aria-expanded': String(isActive.value),
'aria-owns': id.value,
onKeydown: onActivatorKeydown
}, props.activatorProps));
useRender(() => {
const overlayProps = VOverlay.filterProps(props);
return _createVNode(VOverlay, _mergeProps({
"ref": overlay,
"id": id.value,
"class": ['v-menu', props.class],
"style": props.style
}, overlayProps, {
"modelValue": isActive.value,
"onUpdate:modelValue": $event => isActive.value = $event,
"absolute": true,
"activatorProps": activatorProps.value,
"onClick:outside": onClickOutside,
"onKeydown": onKeydown
}, 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": "VMenu"
}, {
default: () => [slots.default?.(...args)]
});
}
});
});
return forwardRefs({
id,
ΨopenChildren: openChildren
}, overlay);
}
});
//# sourceMappingURL=VMenu.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,18 @@
@use '../../styles/tools'
@use './variables' as *
.v-menu
> .v-overlay__content
display: flex
flex-direction: column
@include tools.rounded($menu-content-border-radius)
> .v-card,
> .v-sheet,
> .v-list
background: rgb(var(--v-theme-surface))
border-radius: inherit
overflow: auto
height: 100%
@include tools.elevation($menu-elevation)

View File

@ -0,0 +1,4 @@
@use '../../styles/settings';
$menu-elevation: 8 !default;
$menu-content-border-radius: settings.$border-radius-root !default;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
export { VMenu } from "./VMenu.mjs";
//# sourceMappingURL=index.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.mjs","names":["VMenu"],"sources":["../../../src/components/VMenu/index.ts"],"sourcesContent":["export { VMenu } from './VMenu'\n"],"mappings":"SAASA,KAAK"}

View File

@ -0,0 +1,4 @@
// Types
export const VMenuSymbol = Symbol.for('vuetify:v-menu');
//# sourceMappingURL=shared.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"shared.mjs","names":["VMenuSymbol","Symbol","for"],"sources":["../../../src/components/VMenu/shared.ts"],"sourcesContent":["// Types\nimport type { InjectionKey } from 'vue'\n\ninterface MenuProvide {\n register (): void\n unregister (): void\n closeParents (): void\n}\n\nexport const VMenuSymbol: InjectionKey<MenuProvide> = Symbol.for('vuetify:v-menu')\n"],"mappings":"AAAA;;AASA,OAAO,MAAMA,WAAsC,GAAGC,MAAM,CAACC,GAAG,CAAC,gBAAgB,CAAC"}