Added docs to z-index generator.
This commit is contained in:
parent
8457fa9b3b
commit
1613dafc39
1 changed files with 11 additions and 0 deletions
|
|
@ -153,12 +153,23 @@ export const popups = ref<{
|
||||||
events: Record<string, any>;
|
events: Record<string, any>;
|
||||||
}[]>([]);
|
}[]>([]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An object containing z-index values for different priority levels.
|
||||||
|
*/
|
||||||
const zIndexes = {
|
const zIndexes = {
|
||||||
veryLow: 500000,
|
veryLow: 500000,
|
||||||
low: 1000000,
|
low: 1000000,
|
||||||
middle: 2000000,
|
middle: 2000000,
|
||||||
high: 3000000,
|
high: 3000000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Claims a z-index value for a given priority level.
|
||||||
|
* Increments the z-index value for the specified priority by 100 and returns the new value.
|
||||||
|
*
|
||||||
|
* @param {keyof typeof zIndexes} [priority='low'] - The priority level for which to claim a z-index.
|
||||||
|
* @returns {number} The new z-index value for the specified priority.
|
||||||
|
*/
|
||||||
export function claimZIndex(priority: keyof typeof zIndexes = 'low'): number {
|
export function claimZIndex(priority: keyof typeof zIndexes = 'low'): number {
|
||||||
zIndexes[priority] += 100;
|
zIndexes[priority] += 100;
|
||||||
return zIndexes[priority];
|
return zIndexes[priority];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue