@ -35,18 +35,22 @@ if (typeof HTMLElement === 'function') {
$$l _u = new Map ( ) ;
/** @type {any} The managed render effect for reflecting attributes */
$$me ;
/** @type {ShadowRoot | null} The ShadowRoot of the custom element */
$$shadowRoot = null ;
/ * *
* @ param { * } $$componentCtor
* @ param { * } $$slots
* @ param { * } use _shadow _dom
* @ param { ShadowRootInit | undefined } shadow _root _init
* /
constructor ( $$componentCtor , $$slots , use_shadow _dom ) {
constructor ( $$componentCtor , $$slots , shadow_root _init ) {
super ( ) ;
this . $$ctor = $$componentCtor ;
this . $$s = $$slots ;
if ( use _shadow _dom ) {
this . attachShadow ( { mode : 'open' } ) ;
if ( shadow _root _init ) {
// We need to store the reference to shadow root, because `closed` shadow root cannot be
// accessed with `this.shadowRoot`.
this . $$shadowRoot = this . attachShadow ( shadow _root _init ) ;
}
}
@ -136,7 +140,7 @@ if (typeof HTMLElement === 'function') {
}
this . $$c = createClassComponent ( {
component : this . $$ctor ,
target : this . shadowRoot || this ,
target : this . $$ shadowRoot || this ,
props : {
... this . $$d ,
$$slots ,
@ -277,7 +281,7 @@ function get_custom_elements_slots(element) {
* @ param { Record < string , CustomElementPropDefinition > } props _definition The props to observe
* @ param { string [ ] } slots The slots to create
* @ param { string [ ] } exports Explicitly exported values , other than props
* @ param { boolean } use _shadow _dom Whether to use shadow DOM
* @ param { ShadowRootInit | undefined } shadow _root _init Options passed to shadow DOM constructor
* @ param { ( ce : new ( ) => HTMLElement ) => new ( ) => HTMLElement } [ extend ]
* /
export function create _custom _element (
@ -285,12 +289,12 @@ export function create_custom_element(
props _definition ,
slots ,
exports ,
use_shadow _dom ,
shadow_root _init ,
extend
) {
let Class = class extends SvelteElement {
constructor ( ) {
super ( Component , slots , use_shadow _dom ) ;
super ( Component , slots , shadow_root _init ) ;
this . $$p _d = props _definition ;
}
static get observedAttributes ( ) {