Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
valueFn: () => 'autocomplete-' + core.getUid(),
},
let Ctor = tagOrCtor;
if (isString(Ctor)) {
Ctor = ComponentRegistry.getConstructor(tagOrCtor);
}
const ref = getRef_(owner, config);
let comp;
if (isDef(ref)) {
comp = match_(owner.components[ref], Ctor, config, owner);
owner.components[ref] = comp;
owner.refs[ref] = comp;
} else {
const data = getCurrentData();
let key = config.key;
if (!isDef(key)) {
const type = getUid(Ctor, true);
data.currCount = data.currCount || {};
data.currCount[type] = data.currCount[type] || 0;
key = `__METAL_IC__${type}_${data.currCount[type]++}`;
}
comp = match_(
data.prevComps ? data.prevComps[key] : null,
Ctor,
config,
owner
);
data.currComps = data.currComps || {};
data.currComps[key] = comp;
}
return comp;
}
assertSameBodyIdInVirtualDocument() {
var bodySurface = this.virtualDocument.querySelector('body');
if (!globals.document.body.id) {
globals.document.body.id = 'senna_surface_' + getUid();
}
if (bodySurface) {
bodySurface.id = globals.document.body.id;
}
}
updateElementIdIfSpecialSurface_(element) {
if (!element.id && element === globals.document.body) {
element.id = 'senna_surface_' + getUid();
}
}
constructor() {
super();
/**
* Holds the screen id.
* @type {string}
* @protected
*/
this.id = this.makeId_(getUid());
/**
* Holds the screen meta tags. Relevant when the meta tags
* should be updated when screen is rendered.
*/
this.metas = null;
/**
* Holds the screen title. Relevant when the page title should be
* upadated when screen is rendered.
* @type {?string=}
* @default null
* @protected
*/
this.title = null;
}