Mercurial > code > home > repos > light9
changeset 2294:4031e511bca9
resource-display uri can no longer be a string
author | drewp@bigasterisk.com |
---|---|
date | Tue, 30 May 2023 01:00:32 -0700 |
parents | c070f46c0761 |
children | d18586476827 |
files | light9/web/EditChoice.ts light9/web/ResourceDisplay.ts |
diffstat | 2 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/web/EditChoice.ts Tue May 30 00:59:20 2023 -0700 +++ b/light9/web/EditChoice.ts Tue May 30 01:00:32 2023 -0700 @@ -61,7 +61,7 @@ // an <resource-display> or <a href> tag) @customElement("edit-choice") export class EditChoice extends LitElement { - @property() uri: NamedNode | null = null; + @property() uri?: NamedNode static styles = [ css` :host { @@ -102,12 +102,12 @@ // } // } - _setUri(u: any) { + _setUri(u?: NamedNode) { this.uri = u; this.dispatchEvent(new CustomEvent("edited", {detail: {newValue: u}})); } unlink() { - return this._setUri(null); + return this._setUri(undefined); } }
--- a/light9/web/ResourceDisplay.ts Tue May 30 00:59:20 2023 -0700 +++ b/light9/web/ResourceDisplay.ts Tue May 30 01:00:32 2023 -0700 @@ -72,8 +72,7 @@ // </template> // `; } - // callers might set this as string or pass a NamedNode. - @property() uri?: NamedNode | string; + @property() uri?: NamedNode; @state() label: string = "";