diff --git a/ts_web/elements/dees-toast.ts b/ts_web/elements/dees-toast.ts index 66f2cb2..a48fc19 100644 --- a/ts_web/elements/dees-toast.ts +++ b/ts_web/elements/dees-toast.ts @@ -106,6 +106,11 @@ export class DeesToast extends DeesElement { return toast; } + // Alias for consistency with DeesModal + public static async createAndShow(options: IToastOptions | string) { + return this.show(options); + } + // Convenience methods public static info(message: string, duration?: number) { return this.show({ message, type: 'info', duration }); diff --git a/ts_web/pages/index.ts b/ts_web/pages/index.ts index 081febb..8d023bd 100644 --- a/ts_web/pages/index.ts +++ b/ts_web/pages/index.ts @@ -1,2 +1,3 @@ export * from './mainpage.js'; -export * from './input-showcase.js'; \ No newline at end of file +export * from './input-showcase.js'; +export * from './zindex-showcase.js'; \ No newline at end of file diff --git a/ts_web/pages/zindex-showcase.ts b/ts_web/pages/zindex-showcase.ts new file mode 100644 index 0000000..78718dc --- /dev/null +++ b/ts_web/pages/zindex-showcase.ts @@ -0,0 +1,464 @@ +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-appui-profiledropdown.js'; + +export const showcasePage = () => html` + + +
+ This page demonstrates the z-index management system that ensures proper stacking order for all overlay components. + Test the different scenarios to see how overlays interact with each other. +
+ +00zindex.ts
.
+ Never use arbitrary z-index values in components - always import and use the predefined layers.
+ 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.
+Even in fullscreen, overlays should work properly:
+00zindex.ts
z-index: 9999
+import { zIndexLayers } from './00zindex.js';
+
+// In your component styles:
+z-index: \${zIndexLayers.overlay.modal};
+