diff --git a/packages/open-scd/src/addons/Settings.ts b/packages/open-scd/src/addons/Settings.ts index 53e6dfdac..461b46b36 100644 --- a/packages/open-scd/src/addons/Settings.ts +++ b/packages/open-scd/src/addons/Settings.ts @@ -89,6 +89,11 @@ export function newLoadNsdocEvent( @customElement('oscd-settings') export class OscdSettings extends LitElement { + @property({ + type: Object, + }) + nsdoc!: Nsdoc; + /** Current [[`Settings`]] in `localStorage`, default to [[`defaults`]]. */ @property() get settings(): Settings { @@ -103,9 +108,6 @@ export class OscdSettings extends LitElement { 'IEC 61850-8-1': this.getSetting('IEC 61850-8-1'), }; } - /** Object containing all *.nsdoc files and a function extracting element's label form them*/ - @property({ attribute: false }) - nsdoc: Nsdoc = initializeNsdoc(); @property({ type: Object, diff --git a/packages/open-scd/src/open-scd.ts b/packages/open-scd/src/open-scd.ts index 0899c4290..a59005168 100644 --- a/packages/open-scd/src/open-scd.ts +++ b/packages/open-scd/src/open-scd.ts @@ -19,6 +19,7 @@ import { Wizarding } from './Wizarding.js'; import './addons/Settings.js'; import './addons/Waiter.js'; +import { initializeNsdoc, Nsdoc } from './foundation/nsdoc.js'; /** The `` custom element is the main entry point of the * Open Substation Configuration Designer. */ @@ -26,12 +27,17 @@ import './addons/Waiter.js'; export class OpenSCD extends Hosting( Wizarding(Plugging(Editing(Historing(LitElement)))) ) { + /** Object containing all *.nsdoc files and a function extracting element's label form them*/ + @property({ attribute: false }) + nsdoc: Nsdoc = initializeNsdoc(); + private currentSrc = ''; /** The current file's URL. `blob:` URLs are *revoked after parsing*! */ @property({ type: String }) get src(): string { return this.currentSrc; } + set src(value: string) { this.currentSrc = value; this.dispatchEvent(newPendingStateEvent(this.loadDoc(value))); @@ -89,7 +95,9 @@ export class OpenSCD extends Hosting( render(): TemplateResult { return html` - ${super.render()} + + ${super.render()} + `; }