0.0.26 • Published 3 months ago

be-clonable v0.0.26

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

be-clonable (⿻)

be-clonable is a web component decorator, that adds or hydrates a triggering button, and enables that button to clone the adorned element.

Playwright Tests NPM version

Size of package, including custom element behavior framework (be-enhanced/be-hive): How big is this package in your project?

Size of new code in this package:

Vernacular

<label be-clonable>
    <input type="checkbox" name="">
    <span>Check me out</span>
</label>

or, alternatively:

<label ⿻>
    <input type="checkbox" name="">
    <span>Check me out</span>
</label>

In fact, it is a little better from a performance point of view to manually add the button to go along with the attribute, to save the browser or server from having to render it.

<label be-clonable>
    <input type="checkbox" name="">
    <span>Check me out</span>
    <button class="be-clonable-trigger">❏</button>
</label>

The button as well as the event handler can be attached programmatically without the need for the custom attribute, which is useful during template instantiation, for example.

await customElements.whenDefined('be-enhanced');
oLabel.beEnhanced.by.beClonable;

Viewing Locally

  1. Install git.
  2. Fork/clone this repo.
  3. Install node.
  4. Open command window to folder where you cloned this repo.
  5. npm install

  6. npm run serve

  7. Open http://localhost:8000/demo/dev in a modern browser.

Importing in ES Modules:

import 'be-clonable/be-clonable.js';

Using from CDN:

<script type=module crossorigin=anonymous>
    import 'https://esm.run/be-clonable';
</script>
0.0.26

3 months ago

0.0.24

7 months ago

0.0.25

7 months ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago