0.5.1 • Published 4 years ago

@dv4all/wcp-utils v0.5.1

Weekly downloads
16
License
MIT
Repository
github
Last release
4 years ago

@dv4all/wcp-utils

THIS LIBRARY IS USED BY OTHER @dv4all WEB COMPONENT MODULES.

This is web component utility module. It is used by other modules to create new customElements.

Usage

import { newCustomElement } from "@dv4all/wcp-utils";
//html template

const html = `
  <style>
    :host{
      display:block;
    }
  </style>
  <h1>Test custom component</h1>
`;

//props
const props = {
  observedAttr: ["role"],
  shadowMode: "open",
  renderHtml: htmlButton
};

//create new custom element
const NewCustomElement = newCustomElement(props);

//register custom element
customElements.define("dv4-new-custom-element", NewCustomElement);

//export for custom element defining
//Note! element will always be defined but you can create
//additional definition. This is not advised but it possible.
export default NewCustomElement;

This module is part of monorepo dv4all-wcp.

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago