fix(ts_web): resolve TypeScript nullability and event typing issues across web components
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { html, css, cssManager } from '@design.estate/dees-element';
|
||||
import type { DeesDashboardgrid } from './dees-dashboardgrid.js';
|
||||
import type { LayoutDirection } from './types.js';
|
||||
import '@design.estate/dees-wcctools/demotools';
|
||||
|
||||
export const demoFunc = () => {
|
||||
@@ -160,7 +161,7 @@ export const demoFunc = () => {
|
||||
});
|
||||
|
||||
// Enhanced logging for reflow events
|
||||
let lastPlaceholderPosition = null;
|
||||
let lastPlaceholderPosition: Record<string, string> | null = null;
|
||||
let moveEventCounter = 0;
|
||||
|
||||
// Helper function to log grid state
|
||||
@@ -231,25 +232,28 @@ export const demoFunc = () => {
|
||||
// Log initial state
|
||||
logGridState('Initial Grid State');
|
||||
|
||||
grid.addEventListener('widget-move', (e: CustomEvent) => {
|
||||
grid.addEventListener('widget-move', (e: Event) => {
|
||||
const detail = (e as CustomEvent).detail;
|
||||
logGridState('Widget Move', {
|
||||
widget: e.detail.widget,
|
||||
displaced: e.detail.displaced,
|
||||
swappedWith: e.detail.swappedWith
|
||||
widget: detail.widget,
|
||||
displaced: detail.displaced,
|
||||
swappedWith: detail.swappedWith
|
||||
});
|
||||
});
|
||||
|
||||
grid.addEventListener('widget-resize', (e: CustomEvent) => {
|
||||
grid.addEventListener('widget-resize', (e: Event) => {
|
||||
const detail = (e as CustomEvent).detail;
|
||||
logGridState('Widget Resize', {
|
||||
widget: e.detail.widget,
|
||||
displaced: e.detail.displaced,
|
||||
swappedWith: e.detail.swappedWith
|
||||
widget: detail.widget,
|
||||
displaced: detail.displaced,
|
||||
swappedWith: detail.swappedWith
|
||||
});
|
||||
});
|
||||
|
||||
grid.addEventListener('widget-remove', (e: CustomEvent) => {
|
||||
grid.addEventListener('widget-remove', (e: Event) => {
|
||||
const detail = (e as CustomEvent).detail;
|
||||
logGridState('Widget Remove', {
|
||||
removedWidget: e.detail.widget
|
||||
removedWidget: detail.widget
|
||||
});
|
||||
updateStatus();
|
||||
});
|
||||
@@ -312,7 +316,7 @@ export const demoFunc = () => {
|
||||
|
||||
// Log compact operations
|
||||
const originalCompact = grid.compact.bind(grid);
|
||||
grid.compact = (direction?: string) => {
|
||||
grid.compact = (direction?: LayoutDirection) => {
|
||||
console.group('🗜️ Compacting Grid');
|
||||
console.log('Direction:', direction || 'vertical');
|
||||
logGridState('Before Compact');
|
||||
|
||||
Reference in New Issue
Block a user