How to use the @aurelia/runtime-html.HTMLDOM function in @aurelia/runtime-html

To help you get started, we’ve selected a few @aurelia/runtime-html examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aurelia / aurelia / packages / __tests__ / runtime-html / util.ts View on Github external
TextType: typeof Text,
    CommentType: typeof Comment
  ) {
    this.wnd = wnd;
    this.UIEvent = UIEventType;
    this.Event = EventType;
    this.CustomEvent = CustomEventType;
    this.Node = NodeType;
    this.Element = ElementType;
    this.HTMLElement = HTMLElementType;
    this.HTMLDivElement = HTMLDivElementType;
    this.Text = TextType;
    this.Comment = CommentType;
    this.doc = wnd.document;
    this.domParser = this.doc.createElement('div');
    this.dom = new HTMLDOM(this.wnd, this.doc, NodeType, ElementType, HTMLElementType, CustomEventType);
    this._container = null;
    this._observerLocator = null;
    this._lifecycle = null;
    this._renderer = null;
    this._projectorLocator = null;
    this._renderingEngine = null;
  }
github aurelia / aurelia / packages / testing / dist / umd / html-test-context.js View on Github external
constructor(config, wnd, Scheduler, UIEventType, EventType, CustomEventType, NodeType, ElementType, HTMLElementType, HTMLDivElementType, TextType, CommentType, DOMParserType, CSSStyleSheetType, ShadowRootType) {
            this.config = config;
            this.wnd = wnd;
            this.Scheduler = Scheduler;
            this.UIEvent = UIEventType;
            this.Event = EventType;
            this.CustomEvent = CustomEventType;
            this.Node = NodeType;
            this.Element = ElementType;
            this.HTMLElement = HTMLElementType;
            this.HTMLDivElement = HTMLDivElementType;
            this.Text = TextType;
            this.Comment = CommentType;
            this.DOMParser = DOMParserType;
            this.doc = wnd.document;
            this.dom = new runtime_html_1.HTMLDOM(this.wnd, this.doc, NodeType, ElementType, HTMLElementType, CustomEventType, CSSStyleSheetType, ShadowRootType);
            this._container = void 0;
            this._scheduler = void 0;
            this._templateCompiler = void 0;
            this._observerLocator = void 0;
            this._lifecycle = void 0;
            this._renderer = void 0;
            this._projectorLocator = void 0;
            this._domParser = void 0;
        }
        get container() {
github aurelia / aurelia / packages / testing / dist / esnext / html-test-context.js View on Github external
constructor(config, wnd, Scheduler, UIEventType, EventType, CustomEventType, NodeType, ElementType, HTMLElementType, HTMLDivElementType, TextType, CommentType, DOMParserType, CSSStyleSheetType, ShadowRootType) {
        this.config = config;
        this.wnd = wnd;
        this.Scheduler = Scheduler;
        this.UIEvent = UIEventType;
        this.Event = EventType;
        this.CustomEvent = CustomEventType;
        this.Node = NodeType;
        this.Element = ElementType;
        this.HTMLElement = HTMLElementType;
        this.HTMLDivElement = HTMLDivElementType;
        this.Text = TextType;
        this.Comment = CommentType;
        this.DOMParser = DOMParserType;
        this.doc = wnd.document;
        this.dom = new HTMLDOM(this.wnd, this.doc, NodeType, ElementType, HTMLElementType, CustomEventType, CSSStyleSheetType, ShadowRootType);
        this._container = void 0;
        this._scheduler = void 0;
        this._templateCompiler = void 0;
        this._observerLocator = void 0;
        this._lifecycle = void 0;
        this._renderer = void 0;
        this._projectorLocator = void 0;
        this._domParser = void 0;
    }
    get container() {
github aurelia / aurelia / packages / runtime-html-browser / dist / esnext / index.js View on Github external
initialize(config) {
        if (this.container.has(IDOM, false)) {
            return this.container.get(IDOM);
        }
        let dom;
        if (config !== undefined) {
            if (config.dom !== undefined) {
                dom = config.dom;
            }
            else if (config.host.ownerDocument !== null) {
                dom = new HTMLDOM(window, config.host.ownerDocument, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
            }
            else {
                dom = new HTMLDOM(window, document, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
            }
        }
        else {
            dom = new HTMLDOM(window, document, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
        }
        Registration.instance(IDOM, dom).register(this.container);
        if (DOM.scheduler === void 0) {
            this.container.register(BrowserScheduler);
        }
        else {
            Registration.instance(IScheduler, DOM.scheduler).register(this.container);
        }
        return dom;
github aurelia / aurelia / packages / runtime-html-browser / src / index.ts View on Github external
public initialize(config?: ISinglePageApp): IDOM {
    if (this.container.has(IDOM, false)) {
      return this.container.get(IDOM);
    }
    let dom: IDOM;
    if (config !== undefined) {
      if (config.dom !== undefined) {
        dom = config.dom;
      } else if (config.host.ownerDocument !== null) {
        dom = new HTMLDOM(
          window,
          config.host.ownerDocument,
          Node,
          Element,
          HTMLElement,
          CustomEvent,
          CSSStyleSheet,
          ShadowRoot
        );
      } else {
        dom = new HTMLDOM(
          window,
          document,
          Node,
          Element,
          HTMLElement,
github aurelia / aurelia / packages / runtime-html-jsdom / dist / umd / index.js View on Github external
if (this.container.has(runtime_1.IDOM, false)) {
                return this.container.get(runtime_1.IDOM);
            }
            let dom;
            if (config !== undefined) {
                if (config.dom !== undefined) {
                    dom = config.dom;
                }
                else if (config.host.ownerDocument) {
                    dom = new runtime_html_1.HTMLDOM(this.jsdom.window, config.host.ownerDocument, this.jsdom.window.Node, this.jsdom.window.Element, this.jsdom.window.HTMLElement, this.jsdom.window.CustomEvent, this.jsdom.window.CSSStyleSheet, this.jsdom.window.ShadowRoot);
                }
                else {
                    if (config.host !== undefined) {
                        this.jsdom.window.document.body.appendChild(config.host);
                    }
                    dom = new runtime_html_1.HTMLDOM(this.jsdom.window, this.jsdom.window.document, this.jsdom.window.Node, this.jsdom.window.Element, this.jsdom.window.HTMLElement, this.jsdom.window.CustomEvent, this.jsdom.window.CSSStyleSheet, this.jsdom.window.ShadowRoot);
                }
            }
            else {
                dom = new runtime_html_1.HTMLDOM(this.jsdom.window, this.jsdom.window.document, this.jsdom.window.Node, this.jsdom.window.Element, this.jsdom.window.HTMLElement, this.jsdom.window.CustomEvent, this.jsdom.window.CSSStyleSheet, this.jsdom.window.ShadowRoot);
            }
            kernel_1.Registration.instance(runtime_1.IDOM, dom).register(this.container);
            if (runtime_1.DOM.scheduler === void 0) {
                this.container.register(jsdom_scheduler_1.JSDOMScheduler);
            }
            else {
                kernel_1.Registration.instance(runtime_1.IScheduler, runtime_1.DOM.scheduler).register(this.container);
            }
            return dom;
        }
    };
github aurelia / aurelia / packages / runtime-html-browser / dist / umd / index.js View on Github external
initialize(config) {
            if (this.container.has(runtime_1.IDOM, false)) {
                return this.container.get(runtime_1.IDOM);
            }
            let dom;
            if (config !== undefined) {
                if (config.dom !== undefined) {
                    dom = config.dom;
                }
                else if (config.host.ownerDocument !== null) {
                    dom = new runtime_html_1.HTMLDOM(window, config.host.ownerDocument, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
                }
                else {
                    dom = new runtime_html_1.HTMLDOM(window, document, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
                }
            }
            else {
                dom = new runtime_html_1.HTMLDOM(window, document, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
            }
            kernel_1.Registration.instance(runtime_1.IDOM, dom).register(this.container);
            if (runtime_1.DOM.scheduler === void 0) {
                this.container.register(browser_scheduler_1.BrowserScheduler);
            }
            else {
                kernel_1.Registration.instance(runtime_1.IScheduler, runtime_1.DOM.scheduler).register(this.container);
            }
            return dom;
github aurelia / aurelia / packages / runtime-html-browser / src / index.ts View on Github external
ShadowRoot
        );
      } else {
        dom = new HTMLDOM(
          window,
          document,
          Node,
          Element,
          HTMLElement,
          CustomEvent,
          CSSStyleSheet,
          ShadowRoot
        );
      }
    } else {
      dom = new HTMLDOM(
        window,
        document,
        Node,
        Element,
        HTMLElement,
        CustomEvent,
        CSSStyleSheet,
        ShadowRoot
      );
    }
    Registration.instance(IDOM, dom).register(this.container);
    return dom;
  }
}
github aurelia / aurelia / packages / runtime-html-browser / dist / esnext / index.js View on Github external
return this.container.get(IDOM);
        }
        let dom;
        if (config !== undefined) {
            if (config.dom !== undefined) {
                dom = config.dom;
            }
            else if (config.host.ownerDocument !== null) {
                dom = new HTMLDOM(window, config.host.ownerDocument, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
            }
            else {
                dom = new HTMLDOM(window, document, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
            }
        }
        else {
            dom = new HTMLDOM(window, document, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
        }
        Registration.instance(IDOM, dom).register(this.container);
        if (DOM.scheduler === void 0) {
            this.container.register(BrowserScheduler);
        }
        else {
            Registration.instance(IScheduler, DOM.scheduler).register(this.container);
        }
        return dom;
    }
};
github aurelia / aurelia / packages / runtime-html-browser / dist / umd / index.js View on Github external
initialize(config) {
            if (this.container.has(runtime_1.IDOM, false)) {
                return this.container.get(runtime_1.IDOM);
            }
            let dom;
            if (config !== undefined) {
                if (config.dom !== undefined) {
                    dom = config.dom;
                }
                else if (config.host.ownerDocument !== null) {
                    dom = new runtime_html_1.HTMLDOM(window, config.host.ownerDocument, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
                }
                else {
                    dom = new runtime_html_1.HTMLDOM(window, document, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
                }
            }
            else {
                dom = new runtime_html_1.HTMLDOM(window, document, Node, Element, HTMLElement, CustomEvent, CSSStyleSheet, ShadowRoot);
            }
            kernel_1.Registration.instance(runtime_1.IDOM, dom).register(this.container);
            if (runtime_1.DOM.scheduler === void 0) {
                this.container.register(browser_scheduler_1.BrowserScheduler);
            }
            else {
                kernel_1.Registration.instance(runtime_1.IScheduler, runtime_1.DOM.scheduler).register(this.container);
            }
            return dom;
        }
    };