Home Reference Source Repository

src/app/component-registry/trash-component.js

import { TrashDrawer } from "../components/trash-component/drawers/trash-drawer";
import { Component } from "../core/models/components/component";
import { ComponentOptions } from "../core/models/components/component-options";
class TrashComponent extends Component {
  constructor() {
    const options = new ComponentOptions(
      "2e0a8b90-2ef0-4c71-893f-cf2b55303589",
      "trash",
      "trash"
    );
    super(new TrashDrawer(), options);
    document.addEventListener('keyup', (event) => {
      if (event.key === "Delete")
        this.draw(event);
    });
  }
}

export const trashComponent = new TrashComponent();