tmorin / ceb

<ceb/> is a library providing building blocks to develop Custom Elements (v1). Additionally, other building blocks are also provided to cover the implementation of web applications based on the Event/Message Architecture.

Home Page:https://tmorin.github.io/ceb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<ceb/> ~ custom-element-builder

Continous Integration - Build manual api

<ceb/> was initially a library dedicated for the authoring of Custom Elements (v0) then Custom Elements (v1). However, the library is now providing building blocks going beyond the topic of composable UI elements. It's about fundamental design principles, messaging, functional rendering and obviously composition of UI elements ;).

Quickly

Edit <ceb/> ~ SimpleGreeting

import {
  ElementBuilder,
  FieldBuilder,
  html,
  TemplateBuilder
} from "@tmorin/ceb-bundle-web";

// register the custom element
@(ElementBuilder.get().decorate())
export class SimpleGreeting extends HTMLElement {
  // defines a field `name`
  // which is available as an attribute or a property
  @(FieldBuilder.get().decorate())
  name: string = "World";

  // reacts on the mutations of the field `name`
  // so that new name will be rendered
  @(FieldBuilder.get().decorate())
  private onName() {
    this.render();
  }

  // defines the content of the custom element
  // each time the method is inovked, the template is rendered
  @(TemplateBuilder.get().preserveContent().decorate())
  private render() {
    return html`<h1>Hello, ${this.name}!</h1>`;
  }
}
<simple-greeting name="John Doe"/>

Packages

The library is composed of many packages.

The packages related to the definition of Custom Elements (v1):

A built-in implementation of a templating system:

A built-in implementation of the Inversion of Control principle:

A built-in implementation of the Event/Message architecture:

Bundles:

  • ceb-bundle-web : a bundle of ceb-elements-core, ceb-elements-builders, ceb-templating-builder and ceb-templating-literal

The helper packages:

License

Released under the MIT license.

About

<ceb/> is a library providing building blocks to develop Custom Elements (v1). Additionally, other building blocks are also provided to cover the implementation of web applications based on the Event/Message Architecture.

https://tmorin.github.io/ceb

License:MIT License


Languages

Language:TypeScript 98.3%Language:JavaScript 1.7%