mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 11:15:36 -05:00
Format the TypeScript files (#877)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import type { Runtime } from '../runtime';
|
||||
import type {PyProxy} from "pyodide"
|
||||
import type { PyProxy } from 'pyodide';
|
||||
import { getLogger } from '../logger';
|
||||
|
||||
const logger = getLogger('py-register-widget');
|
||||
|
||||
|
||||
function createWidget(runtime: Runtime, name: string, code: string, klass: string) {
|
||||
class CustomWidget extends HTMLElement {
|
||||
shadow: ShadowRoot;
|
||||
@@ -65,14 +64,14 @@ export function make_PyWidget(runtime: Runtime) {
|
||||
this.wrapper = document.createElement('slot');
|
||||
this.shadow.appendChild(this.wrapper);
|
||||
|
||||
this.addAttributes('src','name','klass');
|
||||
this.addAttributes('src', 'name', 'klass');
|
||||
}
|
||||
|
||||
addAttributes(...attrs:string[]){
|
||||
for (const each of attrs){
|
||||
const property = each === "src" ? "source" : each;
|
||||
addAttributes(...attrs: string[]) {
|
||||
for (const each of attrs) {
|
||||
const property = each === 'src' ? 'source' : each;
|
||||
if (this.hasAttribute(each)) {
|
||||
this[property]=this.getAttribute(each);
|
||||
this[property] = this.getAttribute(each);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user