Skip to content

Commit c7e6c7c

Browse files
committed
rename ElementComponent to BaseComponent
1 parent 84606ff commit c7e6c7c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/BaseComponent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type WritableKeys<T> = Extract<
3939
* An {@link !Element} component
4040
* @typeParam T Component element type
4141
*/
42-
export abstract class ElementComponent<T extends Element> {
42+
export abstract class BaseComponent<T extends Element> {
4343
public readonly element: T;
4444

4545
protected constructor(element: T) {
@@ -49,15 +49,15 @@ export abstract class ElementComponent<T extends Element> {
4949
/**
5050
* Insert component after the last child
5151
*/
52-
public append(component: ElementComponent<any>) {
52+
public append(component: BaseComponent<any>) {
5353
this.element.appendChild(component.element);
5454
return this;
5555
}
5656

5757
/**
5858
* Insert component before the first child
5959
*/
60-
public prepend(component: ElementComponent<any>) {
60+
public prepend(component: BaseComponent<any>) {
6161
this.element.prepend(component.element);
6262
return this;
6363
}

src/Component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License along with @cldn/components.
1515
* If not, see <https://www.gnu.org/licenses/>.
1616
*/
17-
import {ElementComponent} from "./index.js";
17+
import {BaseComponent} from "./index.js";
1818

1919
type ElementToTagName<T extends HTMLElement> = {
2020
[K in keyof HTMLElementTagNameMap]: HTMLElementTagNameMap[K] extends T ? K : never
@@ -26,7 +26,7 @@ type ElementToTagName<T extends HTMLElement> = {
2626
* To create your own component, it's recommended to extend this class.
2727
* @typeParam T Component element type
2828
*/
29-
export class Component<T extends HTMLElement = HTMLElement> extends ElementComponent<T> {
29+
export class Component<T extends HTMLElement = HTMLElement> extends BaseComponent<T> {
3030
/**
3131
* Create Component instance
3232
* @param element Instance or tag name

src/SvgComponent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
* You should have received a copy of the GNU Lesser General Public License along with @cldn/components.
1515
* If not, see <https://www.gnu.org/licenses/>.
1616
*/
17-
import {ElementComponent} from "./index.js";
17+
import {BaseComponent} from "./index.js";
1818

1919
/**
2020
* An SVG component (`<svg>`)
2121
*/
22-
export class SvgComponent extends ElementComponent<SVGSVGElement> {
22+
export class SvgComponent extends BaseComponent<SVGSVGElement> {
2323
public constructor(element?: SVGSVGElement) {
2424
super(element ?? document.createElementNS("http://www.w3.org/2000/svg", "svg"));
2525
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
* You should have received a copy of the GNU Lesser General Public License along with @cldn/components.
1515
* If not, see <https://www.gnu.org/licenses/>.
1616
*/
17-
export {ElementComponent} from "./ElementComponent.js";
17+
export {BaseComponent} from "./BaseComponent.js";
1818
export {Component} from "./Component.js";
1919
export {SvgComponent} from "./SvgComponent.js";

0 commit comments

Comments
 (0)