Socket
Socket
Sign inDemoInstall

lit-element

Package Overview
Dependencies
1
Maintainers
5
Versions
82
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.1.0

16

CHANGELOG.md

@@ -16,2 +16,18 @@ # Change Log

<!-- ### Fixed -->
## Unreleased
## [2.1.0] - 2019-03-21
### Changed
* `LitElement.renderRoot` is now `public readonly` instead of `protected`.
### Fixed
* Exceptions generated during update/render do not block subsequent updates ([#262](https://github.com/Polymer/lit-element/issues/262)).
* Initial update is scheduled at construction time rather than connected time ([#594](https://github.com/Polymer/lit-element/issues/594)).
* A reflecting property set immediately after a corresponding attribute
now reflects properly ([#592](https://github.com/Polymer/lit-element/issues/592)).
* Properties annotated with the `@query` and `@queryAll` decorators will now
survive property renaming optimizations when used with tsickle and Closure JS
Compiler.
## [2.0.1] - 2019-02-05

@@ -18,0 +34,0 @@ ### Fixed

2

lib/css-tag.d.ts

@@ -17,3 +17,3 @@ /**

readonly styleSheet: CSSStyleSheet | null;
toString(): String;
toString(): string;
}

@@ -20,0 +20,0 @@ /**

@@ -49,9 +49,13 @@ /**

* executes a querySelector on the element's renderRoot.
*
* @ExportDecoratedItems
*/
export declare const query: (selector: string) => (protoOrDescriptor: Object | ClassElement, name?: string | number | symbol | undefined) => any;
export declare function query(selector: string): (protoOrDescriptor: Object | ClassElement, name?: string | number | symbol | undefined) => any;
/**
* A property decorator that converts a class property into a getter
* that executes a querySelectorAll on the element's renderRoot.
*
* @ExportDecoratedItems
*/
export declare const queryAll: (selector: string) => (protoOrDescriptor: Object | ClassElement, name?: string | number | symbol | undefined) => any;
export declare function queryAll(selector: string): (protoOrDescriptor: Object | ClassElement, name?: string | number | symbol | undefined) => any;
/**

@@ -58,0 +62,0 @@ * Adds event listener options to a method used as an event listener in a

@@ -103,28 +103,29 @@ /**

* executes a querySelector on the element's renderRoot.
*
* @ExportDecoratedItems
*/
export const query = _query((target, selector) => target.querySelector(selector));
export function query(selector) {
return (protoOrDescriptor,
// tslint:disable-next-line:no-any decorator
name) => {
const descriptor = {
get() {
return this.renderRoot.querySelector(selector);
},
enumerable: true,
configurable: true,
};
return (name !== undefined) ?
legacyQuery(descriptor, protoOrDescriptor, name) :
standardQuery(descriptor, protoOrDescriptor);
};
}
/**
* A property decorator that converts a class property into a getter
* that executes a querySelectorAll on the element's renderRoot.
*/
export const queryAll = _query((target, selector) => target.querySelectorAll(selector));
const legacyQuery = (descriptor, proto, name) => {
Object.defineProperty(proto, name, descriptor);
};
const standardQuery = (descriptor, element) => ({
kind: 'method',
placement: 'prototype',
key: element.key,
descriptor,
});
/**
* Base-implementation of `@query` and `@queryAll` decorators.
*
* @param queryFn exectute a `selector` (ie, querySelector or querySelectorAll)
* against `target`.
* @suppress {visibility} The descriptor accesses an internal field on the
* element.
* @ExportDecoratedItems
*/
function _query(queryFn) {
return (selector) => (protoOrDescriptor,
export function queryAll(selector) {
return (protoOrDescriptor,
// tslint:disable-next-line:no-any decorator

@@ -134,3 +135,3 @@ name) => {

get() {
return queryFn(this.renderRoot, selector);
return this.renderRoot.querySelectorAll(selector);
},

@@ -145,2 +146,11 @@ enumerable: true,

}
const legacyQuery = (descriptor, proto, name) => {
Object.defineProperty(proto, name, descriptor);
};
const standardQuery = (descriptor, element) => ({
kind: 'method',
placement: 'prototype',
key: element.key,
descriptor,
});
const standardEventOptions = (options, element) => {

@@ -147,0 +157,0 @@ return Object.assign({}, element, { finisher(clazz) {

@@ -242,2 +242,8 @@ /**

/**
* This private version of `requestUpdate` does not access or return the
* `updateComplete` promise. This promise can be overridden and is therefore
* not free to access.
*/
private _requestUpdate;
/**
* Requests an update which is processed asynchronously. This should

@@ -264,7 +270,10 @@ * be called when an element should update based on some state not triggered

/**
* Performs an element update.
* Performs an element update. Note, if an exception is thrown during the
* update, `firstUpdated` and `updated` will not be called.
*
* You can override this method to change the timing of updates. For instance,
* to schedule updates to occur just before the next frame:
* You can override this method to change the timing of updates. If this
* method is overridden, `super.performUpdate()` must be called.
*
* For instance, to schedule updates to occur just before the next frame:
*
* ```

@@ -283,3 +292,4 @@ * protected async performUpdate(): Promise<unknown> {

* update without triggering another update. The Promise result is `false` if
* a property was set inside `updated()`. This getter can be implemented to
* a property was set inside `updated()`. If the Promise is rejected, an
* exception was thrown during the update. This getter can be implemented to
* await additional state. For example, it is sometimes useful to await a

@@ -286,0 +296,0 @@ * rendered element before fulfilling this Promise. To do this, first await

@@ -153,3 +153,2 @@ /**

get() {
// tslint:disable-next-line:no-any no symbol in index
return this[key];

@@ -162,3 +161,3 @@ },

this[key] = value;
this.requestUpdate(name, oldValue);
this._requestUpdate(name, oldValue);
},

@@ -267,2 +266,4 @@ configurable: true,

this._saveInstanceProperties();
// ensures first update will be caught by an early access of `updateComplete`
this._requestUpdate();
}

@@ -308,3 +309,3 @@ /**

this._updateState = this._updateState | STATE_HAS_CONNECTED;
// Ensure connection triggers an update. Updates cannot complete before
// Ensure first connection completes an update. Updates cannot complete before
// connection and if one is pending connection the `_hasConnectionResolver`

@@ -317,5 +318,2 @@ // will exist. If so, resolve it to complete the update, otherwise

}
else {
this.requestUpdate();
}
}

@@ -385,24 +383,20 @@ /**

/**
* Requests an update which is processed asynchronously. This should
* be called when an element should update based on some state not triggered
* by setting a property. In this case, pass no arguments. It should also be
* called when manually implementing a property setter. In this case, pass the
* property `name` and `oldValue` to ensure that any configured property
* options are honored. Returns the `updateComplete` Promise which is resolved
* when the update completes.
*
* @param name {PropertyKey} (optional) name of requesting property
* @param oldValue {any} (optional) old value of requesting property
* @returns {Promise} A Promise that is resolved when the update completes.
* This private version of `requestUpdate` does not access or return the
* `updateComplete` promise. This promise can be overridden and is therefore
* not free to access.
*/
requestUpdate(name, oldValue) {
_requestUpdate(name, oldValue) {
let shouldRequestUpdate = true;
// if we have a property key, perform property update steps.
if (name !== undefined && !this._changedProperties.has(name)) {
// If we have a property key, perform property update steps.
if (name !== undefined) {
const ctor = this.constructor;
const options = ctor._classProperties.get(name) || defaultPropertyDeclaration;
if (ctor._valueHasChanged(this[name], oldValue, options.hasChanged)) {
// track old value when changing.
this._changedProperties.set(name, oldValue);
// add to reflecting properties set
if (!this._changedProperties.has(name)) {
this._changedProperties.set(name, oldValue);
}
// Add to reflecting properties set.
// Note, it's important that every change has a chance to add the
// property to `_reflectingProperties`. This ensures setting
// attribute + property reflects correctly.
if (options.reflect === true &&

@@ -415,5 +409,5 @@ !(this._updateState & STATE_IS_REFLECTING_TO_PROPERTY)) {

}
// abort the request if the property should not be considered changed.
}
else {
// Abort the request if the property should not be considered changed.
shouldRequestUpdate = false;

@@ -425,2 +419,18 @@ }

}
}
/**
* Requests an update which is processed asynchronously. This should
* be called when an element should update based on some state not triggered
* by setting a property. In this case, pass no arguments. It should also be
* called when manually implementing a property setter. In this case, pass the
* property `name` and `oldValue` to ensure that any configured property
* options are honored. Returns the `updateComplete` Promise which is resolved
* when the update completes.
*
* @param name {PropertyKey} (optional) name of requesting property
* @param oldValue {any} (optional) old value of requesting property
* @returns {Promise} A Promise that is resolved when the update completes.
*/
requestUpdate(name, oldValue) {
this._requestUpdate(name, oldValue);
return this.updateComplete;

@@ -435,7 +445,17 @@ }

let resolve;
let reject;
const previousUpdatePromise = this._updatePromise;
this._updatePromise = new Promise((res) => resolve = res);
// Ensure any previous update has resolved before updating.
// This `await` also ensures that property changes are batched.
await previousUpdatePromise;
this._updatePromise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
try {
// Ensure any previous update has resolved before updating.
// This `await` also ensures that property changes are batched.
await previousUpdatePromise;
}
catch (e) {
// Ignore any previous errors. We only care that the previous cycle is
// done. Any error should have been handled in the previous update.
}
// Make sure the element has connected before updating.

@@ -445,10 +465,14 @@ if (!this._hasConnected) {

}
// Allow `performUpdate` to be asynchronous to enable scheduling of updates.
const result = this.performUpdate();
// Note, this is to avoid delaying an additional microtask unless we need
// to.
if (result != null &&
typeof result.then === 'function') {
await result;
try {
const result = this.performUpdate();
// If `performUpdate` returns a Promise, we await it. This is done to
// enable coordinating updates with a scheduler. Note, the result is
// checked to avoid delaying an additional microtask unless we need to.
if (result != null) {
await result;
}
}
catch (e) {
reject(e);
}
resolve(!this._hasRequestedUpdate);

@@ -466,7 +490,10 @@ }

/**
* Performs an element update.
* Performs an element update. Note, if an exception is thrown during the
* update, `firstUpdated` and `updated` will not be called.
*
* You can override this method to change the timing of updates. For instance,
* to schedule updates to occur just before the next frame:
* You can override this method to change the timing of updates. If this
* method is overridden, `super.performUpdate()` must be called.
*
* For instance, to schedule updates to occur just before the next frame:
*
* ```

@@ -484,6 +511,21 @@ * protected async performUpdate(): Promise<unknown> {

}
if (this.shouldUpdate(this._changedProperties)) {
const changedProperties = this._changedProperties;
this.update(changedProperties);
let shouldUpdate = false;
const changedProperties = this._changedProperties;
try {
shouldUpdate = this.shouldUpdate(changedProperties);
if (shouldUpdate) {
this.update(changedProperties);
}
}
catch (e) {
// Prevent `firstUpdated` and `updated` from running when there's an
// update exception.
shouldUpdate = false;
throw e;
}
finally {
// Ensure element can accept additional updates after an exception.
this._markUpdated();
}
if (shouldUpdate) {
if (!(this._updateState & STATE_HAS_UPDATED)) {

@@ -495,5 +537,2 @@ this._updateState = this._updateState | STATE_HAS_UPDATED;

}
else {
this._markUpdated();
}
}

@@ -508,3 +547,4 @@ _markUpdated() {

* update without triggering another update. The Promise result is `false` if
* a property was set inside `updated()`. This getter can be implemented to
* a property was set inside `updated()`. If the Promise is rejected, an
* exception was thrown during the update. This getter can be implemented to
* await additional state. For example, it is sometimes useful to await a

@@ -511,0 +551,0 @@ * rendered element before fulfilling this Promise. To do this, first await

@@ -18,3 +18,3 @@ /**

export * from './lib/decorators.js';
export { html, svg, TemplateResult, SVGTemplateResult } from 'lit-html/lit-html';
export { html, svg, TemplateResult, SVGTemplateResult } from 'lit-html/lit-html.js';
import { CSSResult } from './lib/css-tag.js';

@@ -59,3 +59,3 @@ export * from './lib/css-tag.js';

*/
protected renderRoot?: Element | DocumentFragment;
readonly renderRoot: Element | DocumentFragment;
/**

@@ -62,0 +62,0 @@ * Performs element initialization. By default this calls `createRenderRoot`

@@ -15,7 +15,7 @@ /**

import { TemplateResult } from 'lit-html';
import { render } from 'lit-html/lib/shady-render';
import { render } from 'lit-html/lib/shady-render.js';
import { UpdatingElement } from './lib/updating-element.js';
export * from './lib/updating-element.js';
export * from './lib/decorators.js';
export { html, svg, TemplateResult, SVGTemplateResult } from 'lit-html/lit-html';
export { html, svg, TemplateResult, SVGTemplateResult } from 'lit-html/lit-html.js';
import { supportsAdoptingStyleSheets } from './lib/css-tag.js';

@@ -95,3 +95,4 @@ export * from './lib/css-tag.js';

super.initialize();
this.renderRoot = this.createRenderRoot();
this.renderRoot =
this.createRenderRoot();
// Note, if renderRoot is not a shadowRoot, styles would/could apply to the

@@ -98,0 +99,0 @@ // element's getRootNode(). While this could be done, we're choosing not to

{
"name": "lit-element",
"version": "2.0.1",
"description": "Polymer based lit-html custom element",
"version": "2.1.0",
"description": "A simple base class for creating fast, lightweight web components",
"license": "BSD-3-Clause",

@@ -6,0 +6,0 @@ "repository": "Polymer/lit-element",

@@ -25,3 +25,3 @@ # LitElement

// This decorator defines the element.
@customElement('my-element');
@customElement('my-element')
export class MyElement extends LitElement {

@@ -28,0 +28,0 @@

@@ -47,3 +47,3 @@ /**

toString(): String {
toString(): string {
return this.cssText;

@@ -50,0 +50,0 @@ }

@@ -1,2 +0,1 @@

/**

@@ -75,5 +74,4 @@ * @license

(typeof classOrDescriptor === 'function') ?
legacyCustomElement(
tagName, classOrDescriptor as Constructor<HTMLElement>) :
standardCustomElement(tagName, classOrDescriptor as ClassDescriptor);
legacyCustomElement(tagName, classOrDescriptor) :
standardCustomElement(tagName, classOrDescriptor);

@@ -114,3 +112,3 @@ const standardProperty =

if (typeof element.initializer === 'function') {
this[element.key] = element.initializer!.call(this);
this[element.key] = element.initializer.call(this);
}

@@ -128,3 +126,3 @@ },

(proto.constructor as typeof UpdatingElement)
.createProperty(name!, options);
.createProperty(name, options);
};

@@ -150,5 +148,21 @@

* executes a querySelector on the element's renderRoot.
*
* @ExportDecoratedItems
*/
export const query = _query(
(target: NodeSelector, selector: string) => target.querySelector(selector));
export function query(selector: string) {
return (protoOrDescriptor: Object|ClassElement,
// tslint:disable-next-line:no-any decorator
name?: PropertyKey): any => {
const descriptor = {
get(this: LitElement) {
return this.renderRoot.querySelector(selector);
},
enumerable: true,
configurable: true,
};
return (name !== undefined) ?
legacyQuery(descriptor, protoOrDescriptor as Object, name) :
standardQuery(descriptor, protoOrDescriptor as ClassElement);
};
}

@@ -158,6 +172,21 @@ /**

* that executes a querySelectorAll on the element's renderRoot.
*
* @ExportDecoratedItems
*/
export const queryAll = _query(
(target: NodeSelector, selector: string) =>
target.querySelectorAll(selector));
export function queryAll(selector: string) {
return (protoOrDescriptor: Object|ClassElement,
// tslint:disable-next-line:no-any decorator
name?: PropertyKey): any => {
const descriptor = {
get(this: LitElement) {
return this.renderRoot.querySelectorAll(selector);
},
enumerable: true,
configurable: true,
};
return (name !== undefined) ?
legacyQuery(descriptor, protoOrDescriptor as Object, name) :
standardQuery(descriptor, protoOrDescriptor as ClassElement);
};
}

@@ -177,28 +206,2 @@ const legacyQuery =

/**
* Base-implementation of `@query` and `@queryAll` decorators.
*
* @param queryFn exectute a `selector` (ie, querySelector or querySelectorAll)
* against `target`.
* @suppress {visibility} The descriptor accesses an internal field on the
* element.
*/
function _query<T>(queryFn: (target: NodeSelector, selector: string) => T) {
return (selector: string) =>
(protoOrDescriptor: Object|ClassElement,
// tslint:disable-next-line:no-any decorator
name?: PropertyKey): any => {
const descriptor = {
get(this: LitElement) {
return queryFn(this.renderRoot!, selector);
},
enumerable: true,
configurable: true,
};
return (name !== undefined) ?
legacyQuery(descriptor, protoOrDescriptor as Object, name) :
standardQuery(descriptor, protoOrDescriptor as ClassElement);
};
}
const standardEventOptions =

@@ -205,0 +208,0 @@ (options: AddEventListenerOptions, element: ClassElement) => {

@@ -299,4 +299,3 @@ /**

get(): any {
// tslint:disable-next-line:no-any no symbol in index
return (this as any)[key];
return this[key];
},

@@ -308,3 +307,3 @@ set(this: UpdatingElement, value: unknown) {

(this as any)[key] = value;
this.requestUpdate(name, oldValue);
this._requestUpdate(name, oldValue);
},

@@ -447,2 +446,4 @@ configurable: true,

this._saveInstanceProperties();
// ensures first update will be caught by an early access of `updateComplete`
this._requestUpdate();
}

@@ -491,3 +492,3 @@

this._updateState = this._updateState | STATE_HAS_CONNECTED;
// Ensure connection triggers an update. Updates cannot complete before
// Ensure first connection completes an update. Updates cannot complete before
// connection and if one is pending connection the `_hasConnectionResolver`

@@ -499,4 +500,2 @@ // will exist. If so, resolve it to complete the update, otherwise

this._hasConnectedResolver = undefined;
} else {
this.requestUpdate();
}

@@ -574,18 +573,10 @@ }

/**
* Requests an update which is processed asynchronously. This should
* be called when an element should update based on some state not triggered
* by setting a property. In this case, pass no arguments. It should also be
* called when manually implementing a property setter. In this case, pass the
* property `name` and `oldValue` to ensure that any configured property
* options are honored. Returns the `updateComplete` Promise which is resolved
* when the update completes.
*
* @param name {PropertyKey} (optional) name of requesting property
* @param oldValue {any} (optional) old value of requesting property
* @returns {Promise} A Promise that is resolved when the update completes.
* This private version of `requestUpdate` does not access or return the
* `updateComplete` promise. This promise can be overridden and is therefore
* not free to access.
*/
requestUpdate(name?: PropertyKey, oldValue?: unknown) {
private _requestUpdate(name?: PropertyKey, oldValue?: unknown) {
let shouldRequestUpdate = true;
// if we have a property key, perform property update steps.
if (name !== undefined && !this._changedProperties.has(name)) {
// If we have a property key, perform property update steps.
if (name !== undefined) {
const ctor = this.constructor as typeof UpdatingElement;

@@ -596,5 +587,9 @@ const options =

this[name as keyof this], oldValue, options.hasChanged)) {
// track old value when changing.
this._changedProperties.set(name, oldValue);
// add to reflecting properties set
if (!this._changedProperties.has(name)) {
this._changedProperties.set(name, oldValue);
}
// Add to reflecting properties set.
// Note, it's important that every change has a chance to add the
// property to `_reflectingProperties`. This ensures setting
// attribute + property reflects correctly.
if (options.reflect === true &&

@@ -607,4 +602,4 @@ !(this._updateState & STATE_IS_REFLECTING_TO_PROPERTY)) {

}
// abort the request if the property should not be considered changed.
} else {
// Abort the request if the property should not be considered changed.
shouldRequestUpdate = false;

@@ -616,2 +611,19 @@ }

}
}
/**
* Requests an update which is processed asynchronously. This should
* be called when an element should update based on some state not triggered
* by setting a property. In this case, pass no arguments. It should also be
* called when manually implementing a property setter. In this case, pass the
* property `name` and `oldValue` to ensure that any configured property
* options are honored. Returns the `updateComplete` Promise which is resolved
* when the update completes.
*
* @param name {PropertyKey} (optional) name of requesting property
* @param oldValue {any} (optional) old value of requesting property
* @returns {Promise} A Promise that is resolved when the update completes.
*/
requestUpdate(name?: PropertyKey, oldValue?: unknown) {
this._requestUpdate(name, oldValue);
return this.updateComplete;

@@ -626,8 +638,17 @@ }

this._updateState = this._updateState | STATE_UPDATE_REQUESTED;
let resolve: (r: boolean) => void;
let resolve!: (r: boolean) => void;
let reject!: (e: Error) => void;
const previousUpdatePromise = this._updatePromise;
this._updatePromise = new Promise((res) => resolve = res);
// Ensure any previous update has resolved before updating.
// This `await` also ensures that property changes are batched.
await previousUpdatePromise;
this._updatePromise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
try {
// Ensure any previous update has resolved before updating.
// This `await` also ensures that property changes are batched.
await previousUpdatePromise;
} catch (e) {
// Ignore any previous errors. We only care that the previous cycle is
// done. Any error should have been handled in the previous update.
}
// Make sure the element has connected before updating.

@@ -637,11 +658,14 @@ if (!this._hasConnected) {

}
// Allow `performUpdate` to be asynchronous to enable scheduling of updates.
const result = this.performUpdate();
// Note, this is to avoid delaying an additional microtask unless we need
// to.
if (result != null &&
typeof (result as PromiseLike<unknown>).then === 'function') {
await result;
try {
const result = this.performUpdate();
// If `performUpdate` returns a Promise, we await it. This is done to
// enable coordinating updates with a scheduler. Note, the result is
// checked to avoid delaying an additional microtask unless we need to.
if (result != null) {
await result;
}
} catch (e) {
reject(e);
}
resolve!(!this._hasRequestedUpdate);
resolve(!this._hasRequestedUpdate);
}

@@ -662,7 +686,10 @@

/**
* Performs an element update.
* Performs an element update. Note, if an exception is thrown during the
* update, `firstUpdated` and `updated` will not be called.
*
* You can override this method to change the timing of updates. For instance,
* to schedule updates to occur just before the next frame:
* You can override this method to change the timing of updates. If this
* method is overridden, `super.performUpdate()` must be called.
*
* For instance, to schedule updates to occur just before the next frame:
*
* ```

@@ -680,6 +707,19 @@ * protected async performUpdate(): Promise<unknown> {

}
if (this.shouldUpdate(this._changedProperties)) {
const changedProperties = this._changedProperties;
this.update(changedProperties);
let shouldUpdate = false;
const changedProperties = this._changedProperties;
try {
shouldUpdate = this.shouldUpdate(changedProperties);
if (shouldUpdate) {
this.update(changedProperties);
}
} catch (e) {
// Prevent `firstUpdated` and `updated` from running when there's an
// update exception.
shouldUpdate = false;
throw e;
} finally {
// Ensure element can accept additional updates after an exception.
this._markUpdated();
}
if (shouldUpdate) {
if (!(this._updateState & STATE_HAS_UPDATED)) {

@@ -690,4 +730,2 @@ this._updateState = this._updateState | STATE_HAS_UPDATED;

this.updated(changedProperties);
} else {
this._markUpdated();
}

@@ -705,3 +743,4 @@ }

* update without triggering another update. The Promise result is `false` if
* a property was set inside `updated()`. This getter can be implemented to
* a property was set inside `updated()`. If the Promise is rejected, an
* exception was thrown during the update. This getter can be implemented to
* await additional state. For example, it is sometimes useful to await a

@@ -708,0 +747,0 @@ * rendered element before fulfilling this Promise. To do this, first await

@@ -15,3 +15,3 @@ /**

import {TemplateResult} from 'lit-html';
import {render} from 'lit-html/lib/shady-render';
import {render} from 'lit-html/lib/shady-render.js';

@@ -22,3 +22,3 @@ import {PropertyValues, UpdatingElement} from './lib/updating-element.js';

export * from './lib/decorators.js';
export {html, svg, TemplateResult, SVGTemplateResult} from 'lit-html/lit-html';
export {html, svg, TemplateResult, SVGTemplateResult} from 'lit-html/lit-html.js';
import {supportsAdoptingStyleSheets, CSSResult} from './lib/css-tag.js';

@@ -122,3 +122,3 @@ export * from './lib/css-tag.js';

// Array.from does not work on Set in IE
styleSet.forEach((v) => styles!.unshift(v));
styleSet.forEach((v) => styles.unshift(v));
} else if (userStyles) {

@@ -136,3 +136,3 @@ styles.push(userStyles);

*/
protected renderRoot?: Element|DocumentFragment;
readonly renderRoot!: Element|DocumentFragment;

@@ -146,3 +146,4 @@ /**

super.initialize();
this.renderRoot = this.createRenderRoot();
(this as {renderRoot: Element | DocumentFragment}).renderRoot =
this.createRenderRoot();
// Note, if renderRoot is not a shadowRoot, styles would/could apply to the

@@ -221,4 +222,4 @@ // element's getRootNode(). While this could be done, we're choosing not to

templateResult,
this.renderRoot!,
{scopeName: this.localName!, eventContext: this});
this.renderRoot,
{scopeName: this.localName, eventContext: this});
}

@@ -233,3 +234,3 @@ // When native Shadow DOM is used but adoptedStyles are not supported,

style.textContent = s.cssText;
this.renderRoot!.appendChild(style);
this.renderRoot.appendChild(style);
});

@@ -236,0 +237,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc