1.0.0 • Published 2 years ago

@buckneri/web-components v1.0.0

Weekly downloads
33
License
MIT
Repository
github
Last release
2 years ago

Built With Stencil NPM version

Web components using Stencil

Using these components

Script tag

  • Put a script tag similar to this <script type="module" src="https://unpkg.com/web-components/dist/mycomponent.js"></script> in the head of your html document.

Node Modules

  • Run npm install my-component --save
  • Put a script tag similar to this <script type="module" src="node_modules/web-components/dist/mycomponent.js"></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

Developing components

Stencil style guide

Recommended orginal within component.ts files

@Component() class private properties


@Element()


@State() variables - Inlined decorator


@Prop() - Inlined decorator, JSDocs required @Watch("property_name") - watch items should appear near properties watchMethodhandler


@Event({ eventName: "", composed: true, cancelable: true, bubbles: true }) event_name: EventEmitter - Inlined decorator, JSDocs required


Component lifecycle events - ordered by natural call order connectedCallback() - called on adding to DOM. if 1st, called before willLoad disconnectedCallback() - called when removed from DOM componentWillLoad() - once after DOM connection componentDidLoad() - once after render componentWillUpdate() - before render() after @Prop/@State change excl. 1st render() componentDidUpdate() - after render() excl. 1st render() componentDidUnload() - after component removed componentWillRender() - before every render() componentDidRender() - after every render()


@Listen('someEvent') onSomeEvent(ev: UIEvent)


@Method() - Public methods, JSDocs required async metho_name(): Promise


Local methods


render() function

1.0.0

2 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.10

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.2

4 years ago

0.3.0

4 years ago

0.3.1

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago