fix(ts_web): resolve TypeScript nullability and event typing issues across web components

This commit is contained in:
2026-04-01 05:00:21 +00:00
parent b1c8a7446e
commit af1f660486
78 changed files with 429 additions and 399 deletions

View File

@@ -537,15 +537,15 @@ export const zIndexShowcase = () => html`
</p>
`,
menuOptions: [
{ name: 'Cancel', action: async (modal) => modal.destroy() },
{ name: 'Save', action: async (modal) => modal.destroy() }
{ 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');
const modalContent = modal!.shadowRoot!.querySelector('.modal .content');
if (modalContent) {
modalContent.addEventListener('contextmenu', async (e: MouseEvent) => {
(modalContent as HTMLElement).addEventListener('contextmenu', async (e: MouseEvent) => {
DeesContextmenu.openContextMenuWithOptions(e, [
{ name: 'Context menu in modal', iconName: 'check', action: async () => {} },
{ divider: true },
@@ -607,7 +607,7 @@ export const zIndexShowcase = () => html`
></dees-input-dropdown>
`,
menuOptions: [
{ name: 'Close', action: async (modal) => modal.destroy() }
{ name: 'Close', action: async (modal) => modal!.destroy() }
]
});
}}>Show Second Modal</dees-button>
@@ -615,7 +615,7 @@ export const zIndexShowcase = () => html`
`,
menuOptions: [
{ name: 'Close All', action: async (modal) => {
modal.destroy();
modal!.destroy();
// Also show a toast
DeesToast.createAndShow({ message: 'All modals closed!', type: 'info' });
}}
@@ -694,10 +694,10 @@ export const zIndexShowcase = () => html`
</div>
`,
menuOptions: [
{ name: 'Cancel', action: async (modal) => modal.destroy() },
{ name: 'Cancel', action: async (modal) => modal!.destroy() },
{ name: 'Save', action: async (modal) => {
DeesToast.createAndShow({ message: 'Document saved!', type: 'success' });
modal.destroy();
modal!.destroy();
}}
]
});
@@ -735,10 +735,10 @@ export const zIndexShowcase = () => html`
</dees-form>
`,
menuOptions: [
{ name: 'Cancel', action: async (modal) => modal.destroy() },
{ name: 'Cancel', action: async (modal) => modal!.destroy() },
{ name: 'Apply', action: async (modal) => {
DeesToast.createAndShow({ message: 'Tags applied!', type: 'success' });
modal.destroy();
modal!.destroy();
}}
]
});
@@ -766,7 +766,7 @@ export const zIndexShowcase = () => html`
></dees-input-dropdown>
`,
menuOptions: [
{ name: 'Exit Fullscreen', action: async (modal) => modal.destroy() }
{ name: 'Exit Fullscreen', action: async (modal) => modal!.destroy() }
]
});
}}>Open Fullscreen</dees-button>