Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsalem401 committed Dec 26, 2024
1 parent 726acef commit 765b5ba
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/core/src/dom_components/model/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ import {
import { ComponentDynamicValueListener } from './ComponentDynamicValueListener';
import { DynamicValueWatcher } from './DynamicValueWatcher';

export interface IComponent extends ExtractMethods<Component> { }
export interface IComponent extends ExtractMethods<Component> {}
export interface DynamicWatchersOptions {
skipWatcherUpdates?: boolean;
}
export interface SetAttrOptions extends SetOptions, UpdateStyleOptions, DynamicWatchersOptions { }
export interface ComponentSetOptions extends SetOptions, DynamicWatchersOptions { }
export interface SetAttrOptions extends SetOptions, UpdateStyleOptions, DynamicWatchersOptions {}
export interface ComponentSetOptions extends SetOptions, DynamicWatchersOptions {}

const escapeRegExp = (str: string) => {
return str.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
Expand Down Expand Up @@ -226,25 +226,25 @@ export default class Component extends StyleableModel<ComponentProperties> {
return this.frame?.getPage();
}

preInit() { }
preInit() {}

/**
* Hook method, called once the model is created
*/
init() { }
init() {}

/**
* Hook method, called when the model has been updated (eg. updated some model's property)
* @param {String} property Property name, if triggered after some property update
* @param {*} value Property value, if triggered after some property update
* @param {*} previous Property previous value, if triggered after some property update
*/
updated(property: string, value: any, previous: any) { }
updated(property: string, value: any, previous: any) {}

/**
* Hook method, called once the model has been removed
*/
removed() { }
removed() {}

em!: EditorModel;
opt!: ComponentOptions;
Expand Down Expand Up @@ -340,13 +340,13 @@ export default class Component extends StyleableModel<ComponentProperties> {
set<A extends string>(
keyOrAttributes: A | Partial<ComponentProperties>,
valueOrOptions?: ComponentProperties[A] | ComponentSetOptions,
optionsOrUndefined?: ComponentSetOptions
optionsOrUndefined?: ComponentSetOptions,
): this {
let attributes: Partial<ComponentProperties>;
let options: ComponentSetOptions = { skipWatcherUpdates: false };
if (typeof keyOrAttributes === 'object') {
attributes = keyOrAttributes;
options = valueOrOptions || options as ComponentSetOptions;
options = valueOrOptions || (options as ComponentSetOptions);
} else if (typeof keyOrAttributes === 'string') {
attributes = { [keyOrAttributes as string]: valueOrOptions };
options = optionsOrUndefined || options;
Expand Down

0 comments on commit 765b5ba

Please sign in to comment.