forked from MapComplete/MapComplete
Adding a community index view with Svelte (WIP)
This commit is contained in:
parent
ad13444883
commit
d30ed22673
10 changed files with 487 additions and 101 deletions
|
@ -1,13 +1,26 @@
|
|||
import BaseUIElement from "../BaseUIElement"
|
||||
|
||||
import { SvelteComponentTyped } from "svelte"
|
||||
|
||||
/**
|
||||
* The SvelteUIComponent serves as a translating class which which wraps a SvelteElement into the BaseUIElement framework.
|
||||
*/
|
||||
export default class SvelteUIElement extends BaseUIElement {
|
||||
private readonly _svelteComponent
|
||||
private readonly _props: Record<string, any>
|
||||
export default class SvelteUIElement<
|
||||
Props extends Record<string, any> = any,
|
||||
Events extends Record<string, any> = any,
|
||||
Slots extends Record<string, any> = any
|
||||
> extends BaseUIElement {
|
||||
private readonly _svelteComponent: {
|
||||
new (args: {
|
||||
target: HTMLElement
|
||||
props: Props
|
||||
events?: Events
|
||||
slots?: Slots
|
||||
}): SvelteComponentTyped<Props, Events, Slots>
|
||||
}
|
||||
private readonly _props: Props
|
||||
|
||||
constructor(svelteElement, props: Record<string, any>) {
|
||||
constructor(svelteElement, props: Props) {
|
||||
super()
|
||||
this._svelteComponent = svelteElement
|
||||
this._props = props
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue