0.0.21 ā€¢ Published 2 months ago

be-clonable v0.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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:

Syntax

<label be-clonable>
    <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:3030/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.21

2 months ago

0.0.20

4 months ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

1 year ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago