Tracking de l'application VApp (IHM du jeu)
This commit is contained in:
54
VApp/node_modules/vuetify/lib/util/anchor.mjs
generated
vendored
Normal file
54
VApp/node_modules/vuetify/lib/util/anchor.mjs
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
// Utilities
|
||||
import { includes } from "./helpers.mjs";
|
||||
const block = ['top', 'bottom'];
|
||||
const inline = ['start', 'end', 'left', 'right'];
|
||||
/** Parse a raw anchor string into an object */
|
||||
export function parseAnchor(anchor, isRtl) {
|
||||
let [side, align] = anchor.split(' ');
|
||||
if (!align) {
|
||||
align = includes(block, side) ? 'start' : includes(inline, side) ? 'top' : 'center';
|
||||
}
|
||||
return {
|
||||
side: toPhysical(side, isRtl),
|
||||
align: toPhysical(align, isRtl)
|
||||
};
|
||||
}
|
||||
export function toPhysical(str, isRtl) {
|
||||
if (str === 'start') return isRtl ? 'right' : 'left';
|
||||
if (str === 'end') return isRtl ? 'left' : 'right';
|
||||
return str;
|
||||
}
|
||||
export function flipSide(anchor) {
|
||||
return {
|
||||
side: {
|
||||
center: 'center',
|
||||
top: 'bottom',
|
||||
bottom: 'top',
|
||||
left: 'right',
|
||||
right: 'left'
|
||||
}[anchor.side],
|
||||
align: anchor.align
|
||||
};
|
||||
}
|
||||
export function flipAlign(anchor) {
|
||||
return {
|
||||
side: anchor.side,
|
||||
align: {
|
||||
center: 'center',
|
||||
top: 'bottom',
|
||||
bottom: 'top',
|
||||
left: 'right',
|
||||
right: 'left'
|
||||
}[anchor.align]
|
||||
};
|
||||
}
|
||||
export function flipCorner(anchor) {
|
||||
return {
|
||||
side: anchor.align,
|
||||
align: anchor.side
|
||||
};
|
||||
}
|
||||
export function getAxis(anchor) {
|
||||
return includes(block, anchor.side) ? 'y' : 'x';
|
||||
}
|
||||
//# sourceMappingURL=anchor.mjs.map
|
Reference in New Issue
Block a user