UNPKG

element-f

Version:

Define your custom elements with elegance

1 lines 1.3 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ElementF=t():e.ElementF=t()}(self,(function(){return(()=>{"use strict";var e={628:(e,t,n)=>{function o(e,t=[]){const n=Symbol("bus"),o=class extends HTMLElement{constructor(){super();const t=function(){const e=new Map,t=new WeakMap;return this[n]=function({type:t,...n}){[...(e.get(t)||new Set).values()].forEach((e=>e(n)))},{on(t,n){e.set(t,(e.get(t)||new Set).add(n))},off(n,o){(e.get(n)||new Set).delete(t.get(o)??o)},once(e,n){let o=(...t)=>{n(...t),this.off(e,o)};t.set(n,o),this.on(e,o)}}}.call(this);e.call(this,t)}attributeChangedCallback(e,t,o){this[n]({type:["attribute",e].join(":"),newValue:o,previousValue:t})}connectedCallback(){this[n]({type:"connect"})}disconnectedCallback(){this[n]({type:"disconnect"})}};return Object.defineProperty(o,"observedAttributes",{configurable:!1,enumerable:!1,get:()=>t}),o}n.d(t,{default:()=>o})}},t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}return n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n(628)})().default}));