import { html, css, cssManager } from '@design.estate/dees-element'; import { DeesModal } from '../elements/dees-modal.js'; import { DeesToast } from '../elements/dees-toast.js'; import { DeesContextmenu } from '../elements/dees-contextmenu.js'; import '../elements/dees-button.js'; import '../elements/dees-input-dropdown.js'; import '../elements/dees-form.js'; import '../elements/dees-panel.js'; import '../elements/dees-input-text.js'; import '../elements/dees-input-radiogroup.js'; import '../elements/dees-input-tags.js'; import '../elements/dees-input-wysiwyg.js'; import '../elements/dees-appui-profiledropdown.js'; export const showcasePage = () => html`
A comprehensive system for managing overlay stacking order across all components. Test different scenarios to see how the dynamic z-index registry ensures proper layering.
00zindex.ts
.
Never use arbitrary z-index values in components - always import and use the z-index registry.
The traditional z-index layers are still defined for reference, but the new registry system dynamically assigns z-indexes based on creation order.
Test the z-index registry in action with these interactive examples. Each element gets the next available z-index when created, ensuring proper stacking order.
This tests the most common z-index conflict scenario.
The dropdown below should appear above this modal:
You can also right-click anywhere in this modal to test context menus.
`, menuOptions: [ { name: 'Cancel', action: async (modal) => modal.destroy() }, { name: 'Save', action: async (modal) => modal.destroy() } ] }); // Add context menu to modal content const modalContent = modal.shadowRoot.querySelector('.modal .content'); if (modalContent) { modalContent.addEventListener('contextmenu', async (e: MouseEvent) => { DeesContextmenu.openContextMenuWithOptions(e, [ { name: 'Context menu in modal', iconName: 'check', action: async () => {} }, { divider: true }, { name: 'Show Toast', iconName: 'bell', action: async () => { DeesToast.createAndShow({ message: 'Toast from modal context menu!', type: 'warning' }); }} ]); }); } }}>Open Modal with DropdownThis creates a complex scenario with multiple overlays to test the complete hierarchy.
This is the base modal. Try the following:
This modal appears on top of the first one.
The dropdown here should still work:
Profile dropdowns and similar UI elements use the dropdown z-index layer.
Test the WYSIWYG editor slash commands and formatting menus in a modal:
Tips:
• Type "/" to open the slash command menu
• Select text to see the formatting toolbar
• Both menus should appear above this modal
Test the tags input component in a modal:
Even in fullscreen, overlays should work properly:
00zindex.ts
z-index: 9999
zIndexRegistry.getNextZIndex()
zIndexRegistry.register(element, zIndex)
zIndexRegistry.unregister(element)
import { zIndexRegistry } from './00zindex.js';
// In your component:
const myZIndex = zIndexRegistry.getNextZIndex();
element.style.zIndex = myZIndex.toString();
zIndexRegistry.register(element, myZIndex);
// On cleanup:
zIndexRegistry.unregister(element);