@reactive-web-components/rwc 2.53.0 → 2.53.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactive-web-components/rwc",
|
|
3
|
-
"version": "2.53.
|
|
3
|
+
"version": "2.53.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./shared/index.d.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./shared/index.d.ts",
|
|
9
|
-
"import": "./reactive-web-component.
|
|
10
|
-
"require": "./reactive-web-component.
|
|
9
|
+
"import": "./reactive-web-component.jn8CKMFG.js",
|
|
10
|
+
"require": "./reactive-web-component.B4djMSlX.umd.cjs"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"author": "tamazyanarsen",
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"ui",
|
|
35
35
|
"frontend"
|
|
36
36
|
],
|
|
37
|
-
"module": "./reactive-web-component.
|
|
38
|
-
"main": "./reactive-web-component.
|
|
37
|
+
"module": "./reactive-web-component.jn8CKMFG.js",
|
|
38
|
+
"main": "./reactive-web-component.B4djMSlX.umd.cjs"
|
|
39
39
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(o,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(o=typeof globalThis<"u"?globalThis:o||self,p(o.ReactiveComponent={}))})(this,function(o){"use strict";var Ge=Object.defineProperty;var Ne=(o,p,A)=>p in o?Ge(o,p,{enumerable:!0,configurable:!0,writable:!0,value:A}):o[p]=A;var E=(o,p,A)=>Ne(o,typeof p!="symbol"?p+"":p,A);const p=t=>t&&typeof t=="object"&&("classList"in t||"attributes"in t||"customAttributes"in t||"reactiveClassList"in t||"listeners"in t||"customListeners"in t||"children"in t||"effects"in t||"style"in t||Object.keys(t).some(e=>e.startsWith(".")||e.startsWith("@")||e.startsWith("$")))&&!("hostElement"in t),A=t=>t&&typeof t=="object"&&"hostElement"in t&&"append"in t&&"set"in t&&"addStyle"in t&&"setAttribute"in t&&"addClass"in t&&"addEffect"in t&&"addReactiveContent"in t&&"setReactiveContent"in t&&"clear"in t,F=(t,e,...n)=>{e&&e.apply(t,n)};let _=!0;const m=(...t)=>{_&&console.debug(["[rwc]",...t].join(" | "),...Array.from(t.join("").matchAll(/%c/gm)).map((e,n)=>n%2===0?"color:red":"color:inherit"))},I=t=>t.replace(/([A-Z])/gm,e=>`-${e.toLowerCase()}`),Q=t=>t.replace(/-(\w)/gm,(e,n)=>n.toUpperCase()),L=(t,...e)=>{if(!_)return;const n={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},s=t.match(/@[rgbpycow]/g)||[],i=s.map(c=>{const d=c.slice(1);return n[d]||"color: inherit"});let l=t;s.forEach(c=>{const d=new RegExp(`\\${c}([^\\s,]+)`,"g");l=l.replace(d,"%c$1")}),console.log(l,...i,...e)},pt=()=>{_=!0},Y=()=>{_=!1};Y();const K=new Map,O=new WeakMap,B=[],w=[];function R(t,e=()=>!0,n){const s=new Set;let i=e;function l(){var d;const c=B[B.length-1];if(c&&!("fake"in c&&c.fake)){const a=O.get(c),h=a==null?void 0:a.parent;if(h){const f=O.get(h);f==null||f.cleanupFns.add(()=>{s.delete(c)})}s.add(c),(d=K.get(c.effectId))==null||d.add(l)}return t}return l.effectId=(n==null?void 0:n.name)||Math.random().toString(36).substring(2,15),l.getSubscribers=()=>[...s],l.setCompareFn=function(c){return i=c,l},l.clearSubscribers=function(){s.clear()},l.peek=function(){return Object.freeze(t)},l.initValue=Object.freeze(t),l.oldValue=Object.freeze(t),l.forceSet=function(c){l.oldValue=Object.freeze(t),t=c,s.forEach(d=>Promise.resolve(d).then(a=>{const h=O.get(a);h&&h.cleanupFns.size>0&&(h.cleanupFns.forEach(f=>f()),h.cleanupFns.clear()),w.push(a),a(),w.pop()}))},l.set=function(c,d=i){t!==c&&d(t,c)&&l.forceSet(c)},l.update=function(c){l.set(c(t))},l.pipe=c=>{const d=R(null);return b(()=>{const a=l();b(()=>{const h=c(a);h instanceof Promise?h.then(f=>d.set(f)):v(h)?b(()=>d.set(h())):d.set(h)})}),d},l}function b(t,e){const n=e||Math.random().toString(36).substring(2,15);m("current effect",`%c${n}%c`);const s=t;t=()=>(m("current effect callback",`%c${n}%c`),s()),"fake"in s&&s.fake&&(t.fake=!0),K.set(n,new WeakSet),t.effectId=n;const i=w[w.length-1];O.has(t)||O.set(t,{cleanupFns:new Set});const l=O.get(t);i?l.parent=i:delete l.parent,w.push(t),B.push(t),t(),B.pop(),w.pop()}const v=t=>!!t&&["object","function"].includes(typeof t)&&"set"in t&&"oldValue"in t&&"update"in t&&"forceSet"in t;function Et(t,...e){const n=R("");return b(()=>{const s=e.map(l=>v(l)?String(l()):String(l)),i=[t[0]];s.forEach((l,c)=>{i.push(l,t[c+1])}),n.set(i.join(""))}),n}function yt(t,e){const n=R(e??null),s=i=>n.set(i);return t instanceof Promise?t.then(s):typeof t=="function"&&b(()=>{const i=t();i instanceof Promise?i.then(s):v(i)?b(()=>s(i())):s(i)}),n}function St(t,e){let n=t(),s=e();b(()=>{const i=t(),l=e();i!==l&&(i!==n?e.set(i):l!==s&&t.set(l)),n=i,s=l})}function vt(...t){let e=t.map(s=>s());const n=R(e);return t.forEach((s,i)=>{b(()=>{const l=()=>e.filter(c=>c!==void 0).length;l()===t.length&&(e=Array.from(e).fill(void 0)),e[i]=s(),l()===t.length&&n.set([...e])})}),n}class T extends HTMLElement{constructor(n=!1){super();E(this,"isSlotLazyLoading",!1);E(this,"slotTemplate");E(this,"slotContext");E(this,"rootStyle");E(this,"modelValue");E(this,"providers");E(this,"appendAllSlotContent");E(this,"allSlotContent",[]);E(this,"slotContent",{});E(this,"htmlSlotContent",{});E(this,"shadow");E(this,"injects",{});this.shadow=this.attachShadow({mode:n?"closed":"open"})}appendChild(n,s=!0){var i;if(this.isSlotLazyLoading&&s){if(n instanceof HTMLElement){const l=n.slot||"default";this.htmlSlotContent[l]||(this.htmlSlotContent[l]=[]),(i=this.htmlSlotContent[l])==null||i.push(n)}}else return super.appendChild(n)}appendSlotContent(){var n;(n=this.appendAllSlotContent)==null||n.call(this)}inject(n){return m("%cinject%c",n),this.injects[n]||(this.injects[n]=R(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{m("%cinject%c",`%c${n}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(n,{detail:{context:n,callback:i=>b(()=>{s.set(i())})},bubbles:!0,composed:!0}))})}setReactiveValue(n){this.modelValue=n}}E(T,"observedAttributes",[]),E(T,"renderTagName",""),E(T,"styles");const gt=t=>"render"in t&&"setReactiveValue"in t,At="handleSlotContext",x="onConnected",Lt=()=>()=>{},G=t=>typeof t=="string"?t:JSON.stringify(t),N=t=>{const e=document.createElement("span");return e.textContent=G(t),e},V=(t,e)=>(t.appendChild(N(e)),t),tt=(t,e)=>(t.innerHTML="",V(t,e)),J=t=>{const e=document.createElement("span");return b(()=>{const n=t();e.textContent=G(n)}),e},M=t=>({append(...e){return e.forEach(n=>{t.appendChild(n.hostElement),x in n.hostElement&&setTimeout(()=>{var s,i;(i=(s=n.hostElement).onConnected)==null||i.call(s,n,n.hostElement)})}),this},set(...e){this.clear();const n=document.createDocumentFragment();return e.forEach(s=>{n.appendChild(s.hostElement)}),t.appendChild(n),this},removeChild(...e){return e.forEach(n=>{Array.from(t.childNodes.values()).some(s=>s===n.hostElement)&&t.removeChild(n.hostElement)}),this},addHtmlContent(e){return V(t,e),this},setHtmlContent(e){return tt(t,e),this},addEventlistener(e,n,s=!1){return t.addEventListener(e,i=>n(i,this,t),s),this},setAttribute(e,n){let s;if(typeof n=="boolean"&&!(t instanceof T))if(n)s="";else{this.removeAttribute(e);const i=e.toLowerCase();return i in t&&(t[i]=null),this}else typeof n!="string"?s=JSON.stringify(n):s=n;if(t.setAttribute(I(e),s),!(t instanceof T)){const i=e.toLowerCase();i in t&&(t[i]=n)}return this},setCustomAttribute(e,n){let s;return typeof n!="string"?s=JSON.stringify(n):s=n,t.setAttribute(I(e),s),this},setReactiveAttribute(e,n){return b(()=>this.setAttribute(e,n())),this},setReactiveCustomAttribute(e,n){return b(()=>this.setCustomAttribute(e,n())),this},removeAttribute(e){return t.removeAttribute(I(e)),this},addStyle(e){return Object.entries(e).forEach(([n,s])=>{const i=n.startsWith("--");typeof s=="function"?this.addEffect(()=>{if(i){const l=String(s()||"");t.style.setProperty(n,l)}else t.style[n]=s()}):typeof s=="string"&&(i?t.style.setProperty(n,s):t.style[n]=s)}),this},onConnected(e){return Reflect.defineProperty(t,x,{get(){return e}}),this},addClass(...e){return e.forEach(n=>{typeof n=="string"?t.classList.add(...n.split(" ").flatMap(s=>s.split(`
|
|
2
|
+
`)).map(s=>s.trim()).filter(Boolean)):(()=>{let s=null;this.addEffect(()=>{const i=n();i.length>0&&(s?this.replaceClass(s,i):this.addClass(i),s=i)})})()}),this},setClass(...e){return t.classList.remove(...t.classList),t.classList.add(...e),this},addReactiveClass(e){return Object.keys(e).forEach(n=>{b(()=>{e[n]()?this.addClass(n):this.removeClass(n)})}),this},removeClass(...e){return t.classList.remove(...e),this},replaceClass(e,n){return t.classList.replace(e,n),this},addEffect(e){return b(()=>e(this,this.hostElement)),this},addReactiveContent(e){return t.appendChild(J(e)),this},setReactiveContent(e){return this.clear(),t.appendChild(J(e)),this},clear(){return t.innerHTML="",this},hostElement:t}),et=(t,...e)=>({classList:[...t.map(n=>n.trim()).filter(Boolean),...e]}),Rt=(t,...e)=>et(t,...e),D=(t,e)=>{if(!e)return t;const n=Object.keys(e||{}).filter(s=>s.startsWith(".")||s.startsWith("@")||s.startsWith("$"));return n.filter(s=>s.startsWith(".")).forEach(s=>{e!=null&&e.attributes||(e.attributes={}),e.attributes[s.slice(1)]=e[s]}),n.filter(s=>s.startsWith("@")).forEach(s=>{e!=null&&e.listeners||(e.listeners={});const i=s.slice(1);e.listeners[i]=e[s]}),n.filter(s=>s.startsWith("$")).forEach(s=>{e!=null&&e.effects||(e.effects=[]),e.effects.push(e[s])}),it(t,e.classList),ct(t,e.style),rt(t,e.attributes),lt(t,e.reactiveClassList),ot(t,e.customAttributes),st(t,e.children),nt(t,e.effects),U(t,e.listeners),U(t,e.customListeners),t},U=(t,e)=>{e&&Object.entries(e).forEach(([n,s])=>{typeof s=="function"&&t.addEventlistener(n,s)})},nt=(t,e)=>e==null?void 0:e.forEach(n=>t.addEffect(n)),st=(t,e)=>$(t,...e||[]),ot=(t,e)=>{const n=e;n&&Object.keys(n).forEach(s=>{v(n[s])?t.setReactiveCustomAttribute(s,n[s]):typeof n[s]=="function"?t.addEffect(()=>{t.setCustomAttribute(s,n[s]())}):t.setCustomAttribute(s,n[s])})},it=(t,e)=>t.addClass(...e||[]),lt=(t,e)=>t.addReactiveClass(e||{}),ct=(t,e)=>t.addStyle(e||{}),rt=(t,e)=>{const n=e,s=(i,l)=>{l&&(v(l)?t.setReactiveAttribute(i,l):typeof l=="function"?t.addEffect(()=>{t.setAttribute(i,l())}):t.setAttribute(i,l))};n&&Object.keys(n).forEach(i=>{s(i,n[i])})},$=(t,...e)=>(e.forEach(n=>{typeof n=="string"?n.trim().length>0&&t.addHtmlContent(n):v(n)?t.addReactiveContent(n):t.append(n)}),t),k=(t,e)=>{const n=document.createElement(t),s={...M(n)};return D(s,e)},P=(t,e)=>{const[n,...s]=t.split(" ").map(l=>l.trim()),i=k(n,e);return s.length>0&&i.addClass(...s),(...l)=>$(i,...l.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?g(()=>c(i)):c))},g=t=>k("div").addStyle({display:"contents"}).addEffect(e=>{const n=t(),s=[];Array.isArray(n)?s.push(...n):s.push(n),e.clear(),$(e,...s)}),Tt=t=>{const e=s=>typeof s=="string"?s.trim().length>0?M(N(s)):P("div")():v(s)?M(J(s)):s;return at(()=>{const s=t();return s instanceof Array&&Array.isArray(s)?s.map(e):e(s)})},jt=(t,e,n)=>{const s=k("div").addStyle({display:"contents"}),i=new Map,l=new Map;let c=[];const d=new Set;let a=t.peek();const h=f=>{d.delete(f),i.delete(f),l.delete(f)};return b(()=>{const f=t();c=f.map(e).map(u=>typeof u=="string"?u:u.toString());const C=Array.from(s.hostElement.children);m("containerChildren",C,c),C.forEach(u=>{const S=u.dataset.key;c.includes(S)||(m("remove element",S,u),u.remove(),h(S))}),c.forEach(u=>{var W,j;const S=f[c.indexOf(u)];i.has(u)?JSON.stringify(S)!==JSON.stringify(a[c.indexOf(u)])&&((W=s.hostElement.querySelector(`[data-key="${u}"]`))==null||W.remove(),(j=i.get(u))==null||j.set(Math.random().toString(36).substring(2,15)),l.set(u,()=>n(S,c.indexOf(u),f).setCustomAttribute("data-key",u))):(m("create new element",u,S),i.set(u,R(Math.random().toString(36).substring(2,15))),l.set(u,()=>n(S,c.indexOf(u),f).setCustomAttribute("data-key",u)))}),a=f;const y=()=>{i.forEach((u,S)=>{m("key from setTimeout foreach currItemSignalMap",S),d.has(S)||(d.add(S),b(()=>{var bt;u();const W=c.indexOf(S),j=(bt=l.get(S))==null?void 0:bt();j&&(m("call effect from setTimeout",S,j.hostElement),W<=s.hostElement.children.length-1?s.hostElement.insertBefore(j.hostElement,s.hostElement.children[W]):s.hostElement.append(j.hostElement))}))})};Promise.resolve().then(()=>y())}),s},at=t=>{let e=[k("div")],n=!1;return b(()=>{var l,c;const s=t();n=Array.isArray(s);const i=[];i.push(...[s].flat()),i.length===0&&i.push(k("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{m("newReactiveComponent.map",i.map(d=>{var a;return m("newReactiveComponent hostElement",d.hostElement),(a=d.hostElement)==null?void 0:a.id})),m("currComponent[0].hostElement?.id",(l=e[0].hostElement)==null?void 0:l.id,e),(c=e[0].hostElement)==null||c.replaceWith(...i.map(d=>d.hostElement)),e.slice(1).forEach(d=>{var a;return(a=d.hostElement)==null?void 0:a.remove()}),e=i}catch(d){console.error(d)}}),n?e:e[0]},Ot=t=>At in t,wt=t=>{const e=P("div")().addStyle({display:"contents"}),n=s=>(e.hostElement.innerHTML=s,e);return typeof t=="string"?n(t):e.addEffect(()=>{n(t())}),e},X=(t,e,n)=>t?g(e):n?g(n):P("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),dt=(t,e,n)=>g(()=>X(!!t(),e,n)),kt=(t,e,n)=>typeof t=="boolean"?X(t,e,n):dt(t,e,n),Z=(t,e)=>{const n=g(e);return typeof t=="boolean"?[n].flat().forEach(s=>s.hostElement.style.display=t?"block":"none"):b(()=>{const s=t()?"block":"none";[n].flat().forEach(i=>i.hostElement.style.display=s)}),n},It=(t,e,n)=>{const s=[Z(t,e)].flat();return n&&s.push(...[Z(()=>typeof t=="boolean"?!t:!t(),n)].flat()),g(()=>s)},ht=(t,e)=>{m("createCustomElement",t);const n=document.createElement(t),s={...M(n),setReactiveValue(i){return n instanceof T&&n.setReactiveValue(i),this},setSlotTemplate(i){const l=n.slotTemplate;return l&&Object.entries(i).forEach(([c,d])=>{l[c]=d}),this}};return D(s,e)},ft=(t,e)=>{const n=t.split(" ").slice(1).map(i=>i.trim()),s=ht(t.split(" ")[0],e);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...i)=>{L("@rcreateCustomEl content",t,i);const l=i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?g(()=>c(s)):c);return s.hostElement.allSlotContent=l,s.hostElement.slotContent=l.filter(A).reduce((c,d)=>{const a=d.hostElement.getAttribute("slot")||"default";return c[a]||(c[a]=[]),c[a].push(d),c},{}),s.hostElement.appendAllSlotContent=()=>$(s,...l),s}},ut=(t,e,n)=>ft(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,p(e)?e:e&&typeof e=="string"?n:void 0),Mt=()=>{const t=()=>{};return t.oldValue=null,t},$t=()=>({}),Pt=(t,e,n)=>{const s=e?Ct(e,n)(t):t;return(i,...l)=>{const c=[...l];return i&&!p(i)&&c.unshift(i),ut(s,p(i)?i:{})(...c)}},r={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(t=>{r[t]=(e,...n)=>{let s=[...n];return e&&!p(e)&&(s=[e].concat(s)),P(t,p(e)?e:{})(...s)}});const mt=r.div,Ht=r.span,Wt=r.section,Ft=r.input,_t=r.button,Bt=r.table,Jt=r.tr,zt=r.td,qt=r.th,Gt=r.ul,Nt=r.li,Vt=r.ol,Dt=r.form,Ut=r.label,Xt=r.select,Zt=r.option,Qt=r.textarea,Yt=r.img,Kt=r.a,xt=r.p,te=r.h1,ee=r.h2,ne=r.h3,se=r.h4,oe=r.h5,ie=r.h6,le=r.br,ce=r.hr,re=r.pre,ae=r.code,de=r.nav,he=r.header,fe=r.footer,ue=r.main,me=r.aside,Ce=r.article,be=r.figure,pe=r.figcaption,Ee=r.blockquote,ye=r.cite,Se=r.small,ve=r.strong,ge=r.em,Ae=r.b,Le=r.i,Re=r.u,Te=r.s,je=r.sub,Oe=r.sup,we=r.mark,ke=r.del,Ie=r.ins,Me=r.details,$e=r.summary,Pe=r.progress,He=r.meter,We=r.audio,Fe=r.video,_e=r.canvas,Be=r.slot,Je=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{}),z="eventProps",q="EVENT_CONFIG",H="observedAttributes",ze=()=>(t,e)=>{Reflect.get(t,H)||Reflect.defineProperty(t,H,{value:[]}),Reflect.get(t,H).push(I(e))},qe=t=>(e,n)=>{Reflect.get(e,z)||Reflect.defineProperty(e,z,{value:[]}),Reflect.get(e,q)||Reflect.defineProperty(e,q,{value:{}}),Reflect.get(e,q)[n]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,z).push(n)},Ct=(t,e=!1)=>n=>{m(t,"start register static attr",n.prototype[H]);const s=[];if(n.styles){const l=n.styles,c=[];Array.isArray(l)?c.push(...l):c.push(l),c.forEach(d=>{const a=new CSSStyleSheet;a.replaceSync(d),s.push(a);const h=new CSSStyleSheet;h.replaceSync(d.slice(d.indexOf("@property"))),document.adoptedStyleSheets.push(h)})}class i extends n{constructor(...c){m("constructor",`%c${t}%c`),super(e,...c),L("@osheet",s),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){m("rwc: render from new class");let c=mt();const d=()=>{m("wrapperEffectCallback"),c=n.prototype.render.call(this)};return d.fake=!0,b(d),c}attributeChangedCallback(c,d,a){m("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${d}, newValue: ${a}`,`%c${t}%c`);try{a=JSON.parse(a)}catch{}const h=Q(c);if(h in this&&v(this[h])){const f=this[h];a===null?(f.set(f.initValue),this.removeAttribute(c)):f.set(a)}F(this,n.prototype.attributeChangedCallback,c,d,a)}connectedCallback(){var d;m("rwc: connectedCallback"),m("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(m("WRAPPER for providers",t),Object.entries(this.providers).forEach(([a,h])=>{m("register provider",a,h()),this.addEventListener(a,f=>{var y;m("send provider",a,h());const C=f;((y=C.detail)==null?void 0:y.context)===a&&(C.stopPropagation(),C.detail.callback(h))})})),this.checkInjects(),(d=n.prototype[z])==null||d.forEach(a=>{this[a]=h=>{const f=n.prototype[q][a],{bubbles:C,composed:y}=f;v(h)?b(()=>{L("@oemit reactive value",h()),this.dispatchEvent(new CustomEvent(a,{detail:h(),bubbles:C,composed:y}))}):(L("@oemit value",h),this.dispatchEvent(new CustomEvent(a,{detail:h,bubbles:C,composed:y})))}}),m("start render",`%c${t}%c`,t);const c=()=>{m("rwc: insertRenderTemplate");const a=this.render();this.shadow.appendChild(a.hostElement),F(this,n.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!n.styles){const a=C=>C instanceof Promise||Array.isArray(C)&&C.every(y=>y instanceof Promise),h=this.rootStyle,f=C=>{const y=new CSSStyleSheet;y.replaceSync(C),this.shadow.adoptedStyleSheets.push(y);const u=new CSSStyleSheet;u.replaceSync(C.slice(C.indexOf("@property"))),document.adoptedStyleSheets.push(u)};if(a(h)){const C=[];Array.isArray(h)?C.push(...h):C.push(h),Promise.all(C).then(y=>y.forEach(u=>f(u.default))).then(()=>c())}else{const C=[];Array.isArray(h)?C.push(...h):C.push(h),C.forEach(y=>f(y)),c()}}else c();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(a=>{m(this.slotContext,this.slotContext&&this.slotContext[a.name]),L("@bslot element",a,`name:${a.name};`,a.assignedElements()),a.assignedElements().forEach(h=>{const f=this.slotContext[a.name];this.slotContext&&v(f)&&(L("@oslot element",a,`name:${a.name};`,a.assignedElements()),b(()=>{h.dispatchEvent(new CustomEvent("handleSlotContext",{detail:f()}))}))})})}disconnectedCallback(){this.shadow.replaceChildren(),this.replaceChildren(),F(this,n.prototype.disconnectedCallback)}}return E(i,"observedAttributes",n.prototype[H]??[]),E(i,"renderTagName",t),i.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(t,i),n.renderTagName=t,n};o.BaseElement=T,o.a=Kt,o.addAttributeList=rt,o.addClassList=it,o.addCustomAttributes=ot,o.addHtmlContent=V,o.addReactiveClassList=lt,o.addStyleList=ct,o.appendContentItem=$,o.article=Ce,o.aside=me,o.audio=We,o.b=Ae,o.bindReactiveSignals=St,o.blockquote=Ee,o.br=le,o.button=_t,o.camelToKebab=I,o.canvas=_e,o.checkCall=F,o.cite=ye,o.classList=et,o.cls=Rt,o.code=ae,o.colorLog=L,o.component=Ct,o.createComponent=Je,o.createCustom=ut,o.createCustomEl=ft,o.createCustomElement=ht,o.createEl=P,o.createElement=k,o.createSignal=yt,o.defineSlotTemplate=$t,o.del=ke,o.details=Me,o.disableLogs=Y,o.div=mt,o.effect=b,o.elementHelpers=M,o.em=ge,o.enableLogs=pt,o.event=qe,o.eventEmitter=Lt,o.figcaption=pe,o.figure=be,o.footer=fe,o.forkJoin=vt,o.form=Dt,o.getList=jt,o.getReactiveTemplate=Tt,o.getSignalContent=g,o.getTextContent=G,o.h1=te,o.h2=ee,o.h3=ne,o.h4=se,o.h5=oe,o.h6=ie,o.header=he,o.hr=ce,o.htmlEffectWrapper=J,o.i=Le,o.img=Yt,o.initComponent=D,o.input=Ft,o.ins=Ie,o.isBaseElement=gt,o.isComponentConfig=A,o.isComponentInitConfig=p,o.isReactiveSignal=v,o.isSlotTemplate=Ot,o.kebabToCamel=Q,o.label=Ut,o.li=Nt,o.main=ue,o.mark=we,o.meter=He,o.nav=de,o.newEventEmitter=Mt,o.ol=Vt,o.option=Zt,o.p=xt,o.pre=re,o.progress=Pe,o.projectLog=m,o.property=ze,o.renderIf=X,o.rs=Et,o.rxRenderIf=dt,o.s=Te,o.section=Wt,o.select=Xt,o.setChildren=st,o.setEffects=nt,o.setHtmlContent=tt,o.setListeners=U,o.show=It,o.showIf=Z,o.signal=R,o.signalComponent=at,o.slot=Be,o.small=Se,o.span=Ht,o.strong=ve,o.sub=je,o.summary=$e,o.sup=Oe,o.table=Bt,o.td=zt,o.textContentWrapper=N,o.textarea=Qt,o.th=qt,o.tr=Jt,o.u=Re,o.ul=Gt,o.unsafeHtml=wt,o.useCustomComponent=Pt,o.video=Fe,o.when=kt,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var C = (t, e, s) =>
|
|
4
|
-
const
|
|
1
|
+
var Q = Object.defineProperty;
|
|
2
|
+
var Y = (t, e, s) => e in t ? Q(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var C = (t, e, s) => Y(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
const w = (t) => t && typeof t == "object" && ("classList" in t || "attributes" in t || "customAttributes" in t || "reactiveClassList" in t || "listeners" in t || "customListeners" in t || "children" in t || "effects" in t || "style" in t || Object.keys(t).some(
|
|
5
5
|
(e) => e.startsWith(".") || e.startsWith("@") || e.startsWith("$")
|
|
6
|
-
)) && !("hostElement" in t),
|
|
6
|
+
)) && !("hostElement" in t), K = (t) => t && typeof t == "object" && "hostElement" in t && "append" in t && "set" in t && "addStyle" in t && "setAttribute" in t && "addClass" in t && "addEffect" in t && "addReactiveContent" in t && "setReactiveContent" in t && "clear" in t, _ = (t, e, ...s) => {
|
|
7
7
|
e && e.apply(t, s);
|
|
8
8
|
};
|
|
9
9
|
let F = !0;
|
|
10
|
-
const
|
|
10
|
+
const f = (...t) => {
|
|
11
11
|
F && console.debug(
|
|
12
12
|
["[rwc]", ...t].join(" | "),
|
|
13
13
|
...Array.from(t.join("").matchAll(/%c/gm)).map((e, s) => s % 2 === 0 ? "color:red" : "color:inherit")
|
|
14
14
|
);
|
|
15
|
-
},
|
|
15
|
+
}, k = (t) => t.replace(/([A-Z])/gm, (e) => `-${e.toLowerCase()}`), tt = (t) => t.replace(/-(\w)/gm, (e, s) => s.toUpperCase()), A = (t, ...e) => {
|
|
16
16
|
if (!F) return;
|
|
17
17
|
const s = {
|
|
18
18
|
r: "color: #ff0000",
|
|
@@ -40,68 +40,69 @@ const u = (...t) => {
|
|
|
40
40
|
const a = new RegExp(`\\${c}([^\\s,]+)`, "g");
|
|
41
41
|
r = r.replace(a, "%c$1");
|
|
42
42
|
}), console.log(r, ...o, ...e);
|
|
43
|
-
},
|
|
43
|
+
}, vt = () => {
|
|
44
44
|
F = !0;
|
|
45
|
-
},
|
|
45
|
+
}, et = () => {
|
|
46
46
|
F = !1;
|
|
47
47
|
};
|
|
48
|
-
|
|
49
|
-
const L = /* @__PURE__ */ new WeakMap(),
|
|
50
|
-
function O(t, e = () => !0) {
|
|
51
|
-
const
|
|
52
|
-
let
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
et();
|
|
49
|
+
const V = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new WeakMap(), I = [], g = [];
|
|
50
|
+
function O(t, e = () => !0, s) {
|
|
51
|
+
const n = /* @__PURE__ */ new Set();
|
|
52
|
+
let o = e;
|
|
53
|
+
function r() {
|
|
54
|
+
var a;
|
|
55
|
+
const c = I[I.length - 1];
|
|
56
|
+
if (c && !("fake" in c && c.fake)) {
|
|
57
|
+
const l = L.get(c), d = l == null ? void 0 : l.parent;
|
|
58
|
+
if (d) {
|
|
59
|
+
const h = L.get(d);
|
|
60
|
+
h == null || h.cleanupFns.add(() => {
|
|
61
|
+
n.delete(c);
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
+
n.add(c), (a = V.get(c.effectId)) == null || a.add(r);
|
|
64
65
|
}
|
|
65
66
|
return t;
|
|
66
67
|
}
|
|
67
|
-
return
|
|
68
|
-
return
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
},
|
|
68
|
+
return r.effectId = (s == null ? void 0 : s.name) || Math.random().toString(36).substring(2, 15), r.getSubscribers = () => [...n], r.setCompareFn = function(c) {
|
|
69
|
+
return o = c, r;
|
|
70
|
+
}, r.clearSubscribers = function() {
|
|
71
|
+
n.clear();
|
|
72
|
+
}, r.peek = function() {
|
|
72
73
|
return Object.freeze(t);
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
74
|
+
}, r.initValue = Object.freeze(t), r.oldValue = Object.freeze(t), r.forceSet = function(c) {
|
|
75
|
+
r.oldValue = Object.freeze(t), t = c, n.forEach((a) => Promise.resolve(a).then((l) => {
|
|
76
|
+
const d = L.get(l);
|
|
77
|
+
d && d.cleanupFns.size > 0 && (d.cleanupFns.forEach((h) => h()), d.cleanupFns.clear()), g.push(l), l(), g.pop();
|
|
77
78
|
}));
|
|
78
|
-
},
|
|
79
|
-
t !==
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
const
|
|
79
|
+
}, r.set = function(c, a = o) {
|
|
80
|
+
t !== c && a(t, c) && r.forceSet(c);
|
|
81
|
+
}, r.update = function(c) {
|
|
82
|
+
r.set(c(t));
|
|
83
|
+
}, r.pipe = (c) => {
|
|
84
|
+
const a = O(null);
|
|
84
85
|
return m(() => {
|
|
85
|
-
const
|
|
86
|
+
const l = r();
|
|
86
87
|
m(() => {
|
|
87
|
-
const
|
|
88
|
-
|
|
88
|
+
const d = c(l);
|
|
89
|
+
d instanceof Promise ? d.then((h) => a.set(h)) : y(d) ? m(() => a.set(d())) : a.set(d);
|
|
89
90
|
});
|
|
90
|
-
}),
|
|
91
|
-
},
|
|
91
|
+
}), a;
|
|
92
|
+
}, r;
|
|
92
93
|
}
|
|
93
|
-
function m(t) {
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
t = () => (
|
|
98
|
-
const
|
|
94
|
+
function m(t, e) {
|
|
95
|
+
const s = e || Math.random().toString(36).substring(2, 15);
|
|
96
|
+
f("current effect", `%c${s}%c`);
|
|
97
|
+
const n = t;
|
|
98
|
+
t = () => (f("current effect callback", `%c${s}%c`), n()), "fake" in n && n.fake && (t.fake = !0), V.set(s, /* @__PURE__ */ new WeakSet()), t.effectId = s;
|
|
99
|
+
const o = g[g.length - 1];
|
|
99
100
|
L.has(t) || L.set(t, { cleanupFns: /* @__PURE__ */ new Set() });
|
|
100
|
-
const
|
|
101
|
-
|
|
101
|
+
const r = L.get(t);
|
|
102
|
+
o ? r.parent = o : delete r.parent, g.push(t), I.push(t), t(), I.pop(), g.pop();
|
|
102
103
|
}
|
|
103
104
|
const y = (t) => !!t && ["object", "function"].includes(typeof t) && "set" in t && "oldValue" in t && "update" in t && "forceSet" in t;
|
|
104
|
-
function
|
|
105
|
+
function At(t, ...e) {
|
|
105
106
|
const s = O("");
|
|
106
107
|
return m(() => {
|
|
107
108
|
const n = e.map(
|
|
@@ -112,21 +113,21 @@ function vt(t, ...e) {
|
|
|
112
113
|
}), s.set(o.join(""));
|
|
113
114
|
}), s;
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
+
function gt(t, e) {
|
|
116
117
|
const s = O(e ?? null), n = (o) => s.set(o);
|
|
117
118
|
return t instanceof Promise ? t.then(n) : typeof t == "function" && m(() => {
|
|
118
119
|
const o = t();
|
|
119
120
|
o instanceof Promise ? o.then(n) : y(o) ? m(() => n(o())) : n(o);
|
|
120
121
|
}), s;
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
+
function Lt(t, e) {
|
|
123
124
|
let s = t(), n = e();
|
|
124
125
|
m(() => {
|
|
125
126
|
const o = t(), r = e();
|
|
126
127
|
o !== r && (o !== s ? e.set(o) : r !== n && t.set(r)), s = o, n = r;
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
+
function Rt(...t) {
|
|
130
131
|
let e = t.map((n) => n());
|
|
131
132
|
const s = O(e);
|
|
132
133
|
return t.forEach((n, o) => {
|
|
@@ -168,11 +169,11 @@ class R extends HTMLElement {
|
|
|
168
169
|
(s = this.appendAllSlotContent) == null || s.call(this);
|
|
169
170
|
}
|
|
170
171
|
inject(s) {
|
|
171
|
-
return
|
|
172
|
+
return f("%cinject%c", s), this.injects[s] || (this.injects[s] = O(null)), this.injects[s];
|
|
172
173
|
}
|
|
173
174
|
checkInjects() {
|
|
174
175
|
Object.entries(this.injects).forEach(([s, n]) => {
|
|
175
|
-
|
|
176
|
+
f(
|
|
176
177
|
"%cinject%c",
|
|
177
178
|
`%c${s}%c`,
|
|
178
179
|
"from BaseElement (dispatch event)"
|
|
@@ -195,17 +196,17 @@ class R extends HTMLElement {
|
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
198
|
C(R, "observedAttributes", []), C(R, "renderTagName", ""), C(R, "styles");
|
|
198
|
-
const
|
|
199
|
-
},
|
|
199
|
+
const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotContext", J = "onConnected", jt = () => () => {
|
|
200
|
+
}, D = (t) => typeof t == "string" ? t : JSON.stringify(t), G = (t) => {
|
|
200
201
|
const e = document.createElement("span");
|
|
201
|
-
return e.textContent =
|
|
202
|
-
},
|
|
202
|
+
return e.textContent = D(t), e;
|
|
203
|
+
}, U = (t, e) => (t.appendChild(G(e)), t), nt = (t, e) => (t.innerHTML = "", U(t, e)), z = (t) => {
|
|
203
204
|
const e = document.createElement("span");
|
|
204
205
|
return m(() => {
|
|
205
206
|
const s = t();
|
|
206
|
-
e.textContent =
|
|
207
|
+
e.textContent = D(s);
|
|
207
208
|
}), e;
|
|
208
|
-
},
|
|
209
|
+
}, P = (t) => ({
|
|
209
210
|
append(...e) {
|
|
210
211
|
return e.forEach((s) => {
|
|
211
212
|
t.appendChild(s.hostElement), J in s.hostElement && setTimeout(() => {
|
|
@@ -233,10 +234,10 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
233
234
|
}), this;
|
|
234
235
|
},
|
|
235
236
|
addHtmlContent(e) {
|
|
236
|
-
return
|
|
237
|
+
return U(t, e), this;
|
|
237
238
|
},
|
|
238
239
|
setHtmlContent(e) {
|
|
239
|
-
return
|
|
240
|
+
return nt(t, e), this;
|
|
240
241
|
},
|
|
241
242
|
addEventlistener(e, s, n = !1) {
|
|
242
243
|
return t.addEventListener(e, (o) => s(o, this, t), n), this;
|
|
@@ -252,7 +253,7 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
252
253
|
return o in t && (t[o] = null), this;
|
|
253
254
|
}
|
|
254
255
|
else typeof s != "string" ? n = JSON.stringify(s) : n = s;
|
|
255
|
-
if (t.setAttribute(
|
|
256
|
+
if (t.setAttribute(k(e), n), !(t instanceof R)) {
|
|
256
257
|
const o = e.toLowerCase();
|
|
257
258
|
o in t && (t[o] = s);
|
|
258
259
|
}
|
|
@@ -260,7 +261,7 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
260
261
|
},
|
|
261
262
|
setCustomAttribute(e, s) {
|
|
262
263
|
let n;
|
|
263
|
-
return typeof s != "string" ? n = JSON.stringify(s) : n = s, t.setAttribute(
|
|
264
|
+
return typeof s != "string" ? n = JSON.stringify(s) : n = s, t.setAttribute(k(e), n), this;
|
|
264
265
|
},
|
|
265
266
|
setReactiveAttribute(e, s) {
|
|
266
267
|
return m(() => this.setAttribute(e, s())), this;
|
|
@@ -269,7 +270,7 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
269
270
|
return m(() => this.setCustomAttribute(e, s())), this;
|
|
270
271
|
},
|
|
271
272
|
removeAttribute(e) {
|
|
272
|
-
return t.removeAttribute(
|
|
273
|
+
return t.removeAttribute(k(e)), this;
|
|
273
274
|
},
|
|
274
275
|
addStyle(e) {
|
|
275
276
|
return Object.entries(e).forEach(([s, n]) => {
|
|
@@ -333,9 +334,9 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
333
334
|
return t.innerHTML = "", this;
|
|
334
335
|
},
|
|
335
336
|
hostElement: t
|
|
336
|
-
}),
|
|
337
|
+
}), ot = (t, ...e) => ({
|
|
337
338
|
classList: [...t.map((s) => s.trim()).filter(Boolean), ...e]
|
|
338
|
-
}),
|
|
339
|
+
}), Tt = (t, ...e) => ot(t, ...e), X = (t, e) => {
|
|
339
340
|
if (!e) return t;
|
|
340
341
|
const s = Object.keys(e || {}).filter(
|
|
341
342
|
(n) => n.startsWith(".") || n.startsWith("@") || n.startsWith("$")
|
|
@@ -348,19 +349,19 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
348
349
|
e.listeners[o] = e[n];
|
|
349
350
|
}), s.filter((n) => n.startsWith("$")).forEach((n) => {
|
|
350
351
|
e != null && e.effects || (e.effects = []), e.effects.push(e[n]);
|
|
351
|
-
}),
|
|
352
|
+
}), lt(t, e.classList), dt(t, e.style), ht(t, e.attributes), at(t, e.reactiveClassList), it(t, e.customAttributes), ct(t, e.children), rt(t, e.effects), q(t, e.listeners), q(t, e.customListeners), t;
|
|
352
353
|
}, q = (t, e) => {
|
|
353
354
|
e && Object.entries(e).forEach(([s, n]) => {
|
|
354
355
|
typeof n == "function" && t.addEventlistener(s, n);
|
|
355
356
|
});
|
|
356
|
-
},
|
|
357
|
+
}, rt = (t, e) => e == null ? void 0 : e.forEach((s) => t.addEffect(s)), ct = (t, e) => W(t, ...e || []), it = (t, e) => {
|
|
357
358
|
const s = e;
|
|
358
359
|
s && Object.keys(s).forEach((n) => {
|
|
359
360
|
y(s[n]) ? t.setReactiveCustomAttribute(n, s[n]) : typeof s[n] == "function" ? t.addEffect(() => {
|
|
360
361
|
t.setCustomAttribute(n, s[n]());
|
|
361
362
|
}) : t.setCustomAttribute(n, s[n]);
|
|
362
363
|
});
|
|
363
|
-
},
|
|
364
|
+
}, lt = (t, e) => t.addClass(...e || []), at = (t, e) => t.addReactiveClass(e || {}), dt = (t, e) => t.addStyle(e || {}), ht = (t, e) => {
|
|
364
365
|
const s = e, n = (o, r) => {
|
|
365
366
|
r && (y(r) ? t.setReactiveAttribute(o, r) : typeof r == "function" ? t.addEffect(() => {
|
|
366
367
|
t.setAttribute(o, r());
|
|
@@ -371,70 +372,70 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
371
372
|
});
|
|
372
373
|
}, W = (t, ...e) => (e.forEach((s) => {
|
|
373
374
|
typeof s == "string" ? s.trim().length > 0 && t.addHtmlContent(s) : y(s) ? t.addReactiveContent(s) : t.append(s);
|
|
374
|
-
}), t),
|
|
375
|
+
}), t), x = (t, e) => {
|
|
375
376
|
const s = document.createElement(t), n = {
|
|
376
|
-
...
|
|
377
|
+
...P(s)
|
|
377
378
|
};
|
|
378
|
-
return
|
|
379
|
+
return X(n, e);
|
|
379
380
|
}, H = (t, e) => {
|
|
380
|
-
const [s, ...n] = t.split(" ").map((r) => r.trim()), o =
|
|
381
|
+
const [s, ...n] = t.split(" ").map((r) => r.trim()), o = x(s, e);
|
|
381
382
|
return n.length > 0 && o.addClass(...n), (...r) => W(
|
|
382
383
|
o,
|
|
383
384
|
...r.filter(Boolean).flat().flatMap(
|
|
384
385
|
(c) => typeof c == "function" && !y(c) ? v(() => c(o)) : c
|
|
385
386
|
)
|
|
386
387
|
);
|
|
387
|
-
}, v = (t) =>
|
|
388
|
+
}, v = (t) => x("div").addStyle({ display: "contents" }).addEffect((e) => {
|
|
388
389
|
const s = t(), n = [];
|
|
389
390
|
Array.isArray(s) ? n.push(...s) : n.push(s), e.clear(), W(e, ...n);
|
|
390
|
-
}),
|
|
391
|
-
const e = (n) => typeof n == "string" ? n.trim().length > 0 ?
|
|
392
|
-
return
|
|
391
|
+
}), wt = (t) => {
|
|
392
|
+
const e = (n) => typeof n == "string" ? n.trim().length > 0 ? P(G(n)) : H("div")() : y(n) ? P(z(n)) : n;
|
|
393
|
+
return ut(() => {
|
|
393
394
|
const n = t();
|
|
394
395
|
return n instanceof Array && Array.isArray(n) ? n.map(e) : e(n);
|
|
395
396
|
});
|
|
396
397
|
}, xt = (t, e, s) => {
|
|
397
|
-
const n =
|
|
398
|
+
const n = x("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
398
399
|
let c = [];
|
|
399
400
|
const a = /* @__PURE__ */ new Set();
|
|
400
|
-
let
|
|
401
|
-
const d = (
|
|
402
|
-
a.delete(
|
|
401
|
+
let l = t.peek();
|
|
402
|
+
const d = (h) => {
|
|
403
|
+
a.delete(h), o.delete(h), r.delete(h);
|
|
403
404
|
};
|
|
404
405
|
return m(() => {
|
|
405
|
-
const
|
|
406
|
-
c =
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
const E =
|
|
410
|
-
c.includes(E) || (
|
|
411
|
-
}), c.forEach((
|
|
406
|
+
const h = t();
|
|
407
|
+
c = h.map(e).map((u) => typeof u == "string" ? u : u.toString());
|
|
408
|
+
const p = Array.from(n.hostElement.children);
|
|
409
|
+
f("containerChildren", p, c), p.forEach((u) => {
|
|
410
|
+
const E = u.dataset.key;
|
|
411
|
+
c.includes(E) || (f("remove element", E, u), u.remove(), d(E));
|
|
412
|
+
}), c.forEach((u) => {
|
|
412
413
|
var j, S;
|
|
413
|
-
const E =
|
|
414
|
-
o.has(
|
|
415
|
-
|
|
416
|
-
() => s(E, c.indexOf(
|
|
414
|
+
const E = h[c.indexOf(u)];
|
|
415
|
+
o.has(u) ? JSON.stringify(E) !== JSON.stringify(l[c.indexOf(u)]) && ((j = n.hostElement.querySelector(`[data-key="${u}"]`)) == null || j.remove(), (S = o.get(u)) == null || S.set(Math.random().toString(36).substring(2, 15)), r.set(
|
|
416
|
+
u,
|
|
417
|
+
() => s(E, c.indexOf(u), h).setCustomAttribute(
|
|
417
418
|
"data-key",
|
|
418
|
-
|
|
419
|
+
u
|
|
419
420
|
)
|
|
420
|
-
)) : (
|
|
421
|
-
|
|
421
|
+
)) : (f("create new element", u, E), o.set(
|
|
422
|
+
u,
|
|
422
423
|
O(Math.random().toString(36).substring(2, 15))
|
|
423
424
|
), r.set(
|
|
424
|
-
|
|
425
|
-
() => s(E, c.indexOf(
|
|
425
|
+
u,
|
|
426
|
+
() => s(E, c.indexOf(u), h).setCustomAttribute(
|
|
426
427
|
"data-key",
|
|
427
|
-
|
|
428
|
+
u
|
|
428
429
|
)
|
|
429
430
|
));
|
|
430
|
-
}),
|
|
431
|
+
}), l = h;
|
|
431
432
|
const b = () => {
|
|
432
|
-
o.forEach((
|
|
433
|
-
|
|
433
|
+
o.forEach((u, E) => {
|
|
434
|
+
f("key from setTimeout foreach currItemSignalMap", E), a.has(E) || (a.add(E), m(() => {
|
|
434
435
|
var B;
|
|
435
|
-
|
|
436
|
+
u();
|
|
436
437
|
const j = c.indexOf(E), S = (B = r.get(E)) == null ? void 0 : B();
|
|
437
|
-
S && (
|
|
438
|
+
S && (f(
|
|
438
439
|
"call effect from setTimeout",
|
|
439
440
|
E,
|
|
440
441
|
S.hostElement
|
|
@@ -447,42 +448,42 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
447
448
|
};
|
|
448
449
|
Promise.resolve().then(() => b());
|
|
449
450
|
}), n;
|
|
450
|
-
},
|
|
451
|
-
let e = [
|
|
451
|
+
}, ut = (t) => {
|
|
452
|
+
let e = [x("div")], s = !1;
|
|
452
453
|
return m(() => {
|
|
453
454
|
var r, c;
|
|
454
455
|
const n = t();
|
|
455
456
|
s = Array.isArray(n);
|
|
456
457
|
const o = [];
|
|
457
458
|
o.push(...[n].flat()), o.length === 0 && o.push(
|
|
458
|
-
|
|
459
|
+
x("div").addStyle({ display: "none" }).setAttribute("id", "empty_template")
|
|
459
460
|
);
|
|
460
461
|
try {
|
|
461
|
-
|
|
462
|
-
var
|
|
463
|
-
return
|
|
464
|
-
})),
|
|
462
|
+
f("newReactiveComponent.map", o.map((a) => {
|
|
463
|
+
var l;
|
|
464
|
+
return f("newReactiveComponent hostElement", a.hostElement), (l = a.hostElement) == null ? void 0 : l.id;
|
|
465
|
+
})), f("currComponent[0].hostElement?.id", (r = e[0].hostElement) == null ? void 0 : r.id, e), (c = e[0].hostElement) == null || c.replaceWith(
|
|
465
466
|
...o.map((a) => a.hostElement)
|
|
466
467
|
), e.slice(1).forEach((a) => {
|
|
467
|
-
var
|
|
468
|
-
return (
|
|
468
|
+
var l;
|
|
469
|
+
return (l = a.hostElement) == null ? void 0 : l.remove();
|
|
469
470
|
}), e = o;
|
|
470
471
|
} catch (a) {
|
|
471
472
|
console.error(a);
|
|
472
473
|
}
|
|
473
474
|
}), s ? e : e[0];
|
|
474
|
-
},
|
|
475
|
+
}, kt = (t) => st in t, Mt = (t) => {
|
|
475
476
|
const e = H("div")().addStyle({ display: "contents" }), s = (n) => (e.hostElement.innerHTML = n, e);
|
|
476
477
|
return typeof t == "string" ? s(t) : e.addEffect(() => {
|
|
477
478
|
s(t());
|
|
478
479
|
}), e;
|
|
479
|
-
},
|
|
480
|
+
}, Z = (t, e, s) => t ? v(e) : s ? v(s) : H("div")().setAttribute("id", "empty_div_renderIf").addStyle({ display: "none" }), ft = (t, e, s) => v(() => Z(!!t(), e, s)), $t = (t, e, s) => typeof t == "boolean" ? Z(t, e, s) : ft(t, e, s), N = (t, e) => {
|
|
480
481
|
const s = v(e);
|
|
481
482
|
return typeof t == "boolean" ? [s].flat().forEach((n) => n.hostElement.style.display = t ? "block" : "none") : m(() => {
|
|
482
483
|
const n = t() ? "block" : "none";
|
|
483
484
|
[s].flat().forEach((o) => o.hostElement.style.display = n);
|
|
484
485
|
}), s;
|
|
485
|
-
},
|
|
486
|
+
}, It = (t, e, s) => {
|
|
486
487
|
const n = [N(t, e)].flat();
|
|
487
488
|
return s && n.push(
|
|
488
489
|
...[N(
|
|
@@ -490,10 +491,10 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
490
491
|
s
|
|
491
492
|
)].flat()
|
|
492
493
|
), v(() => n);
|
|
493
|
-
},
|
|
494
|
-
|
|
494
|
+
}, pt = (t, e) => {
|
|
495
|
+
f("createCustomElement", t);
|
|
495
496
|
const s = document.createElement(t), n = {
|
|
496
|
-
...
|
|
497
|
+
...P(s),
|
|
497
498
|
setReactiveValue(o) {
|
|
498
499
|
return s instanceof R && s.setReactiveValue(o), this;
|
|
499
500
|
},
|
|
@@ -504,36 +505,36 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
504
505
|
}), this;
|
|
505
506
|
}
|
|
506
507
|
};
|
|
507
|
-
return
|
|
508
|
-
},
|
|
509
|
-
const s = t.split(" ").slice(1).map((o) => o.trim()), n =
|
|
508
|
+
return X(n, e);
|
|
509
|
+
}, mt = (t, e) => {
|
|
510
|
+
const s = t.split(" ").slice(1).map((o) => o.trim()), n = pt(t.split(" ")[0], e);
|
|
510
511
|
return Array.isArray(s) && s.length > 0 && n.addClass(...s), (...o) => {
|
|
511
512
|
A("@rcreateCustomEl content", t, o);
|
|
512
513
|
const r = o.filter(Boolean).flat().flatMap(
|
|
513
514
|
(c) => typeof c == "function" && !y(c) ? v(() => c(n)) : c
|
|
514
515
|
);
|
|
515
|
-
return n.hostElement.allSlotContent = r, n.hostElement.slotContent = r.filter(
|
|
516
|
+
return n.hostElement.allSlotContent = r, n.hostElement.slotContent = r.filter(K).reduce(
|
|
516
517
|
(c, a) => {
|
|
517
|
-
const
|
|
518
|
-
return c[
|
|
518
|
+
const l = a.hostElement.getAttribute("slot") || "default";
|
|
519
|
+
return c[l] || (c[l] = []), c[l].push(a), c;
|
|
519
520
|
},
|
|
520
521
|
{}
|
|
521
522
|
), n.hostElement.appendAllSlotContent = () => W(n, ...r), n;
|
|
522
523
|
};
|
|
523
|
-
},
|
|
524
|
+
}, Ct = (t, e, s) => mt(
|
|
524
525
|
`${t.renderTagName}${e && typeof e == "string" ? " " + e : ""}`,
|
|
525
|
-
|
|
526
|
+
w(e) ? e : e && typeof e == "string" ? s : void 0
|
|
526
527
|
), Pt = () => {
|
|
527
528
|
const t = () => {
|
|
528
529
|
};
|
|
529
530
|
return t.oldValue = null, t;
|
|
530
|
-
},
|
|
531
|
-
const n = e ?
|
|
531
|
+
}, Ft = () => ({}), Wt = (t, e, s) => {
|
|
532
|
+
const n = e ? yt(e, s)(t) : t;
|
|
532
533
|
return (o, ...r) => {
|
|
533
534
|
const c = [...r];
|
|
534
|
-
return o && !
|
|
535
|
+
return o && !w(o) && c.unshift(o), Ct(n, w(o) ? o : {})(...c);
|
|
535
536
|
};
|
|
536
|
-
},
|
|
537
|
+
}, i = {}, bt = [
|
|
537
538
|
"div",
|
|
538
539
|
"span",
|
|
539
540
|
"section",
|
|
@@ -595,29 +596,29 @@ const Rt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
595
596
|
"canvas",
|
|
596
597
|
"slot"
|
|
597
598
|
];
|
|
598
|
-
|
|
599
|
-
|
|
599
|
+
bt.forEach((t) => {
|
|
600
|
+
i[t] = (e, ...s) => {
|
|
600
601
|
let n = [...s];
|
|
601
|
-
return e && !
|
|
602
|
+
return e && !w(e) && (n = [e].concat(n)), H(t, w(e) ? e : {})(...n);
|
|
602
603
|
};
|
|
603
604
|
});
|
|
604
|
-
const
|
|
605
|
+
const Et = i.div, Ht = i.span, _t = i.section, zt = i.input, Bt = i.button, Jt = i.table, qt = i.tr, Nt = i.td, Vt = i.th, Dt = i.ul, Gt = i.li, Ut = i.ol, Xt = i.form, Zt = i.label, Qt = i.select, Yt = i.option, Kt = i.textarea, te = i.img, ee = i.a, se = i.p, ne = i.h1, oe = i.h2, re = i.h3, ce = i.h4, ie = i.h5, le = i.h6, ae = i.br, de = i.hr, he = i.pre, ue = i.code, fe = i.nav, pe = i.header, me = i.footer, Ce = i.main, be = i.aside, Ee = i.article, ye = i.figure, Se = i.figcaption, ve = i.blockquote, Ae = i.cite, ge = i.small, Le = i.strong, Re = i.em, Oe = i.b, je = i.i, Te = i.u, we = i.s, xe = i.sub, ke = i.sup, Me = i.mark, $e = i.del, Ie = i.ins, Pe = i.details, Fe = i.summary, We = i.progress, He = i.meter, _e = i.audio, ze = i.video, Be = i.canvas, Je = i.slot, qe = (t) => (e) => t(e).addClass(...e.classList ?? []).addReactiveClass(e.reactiveClassList ?? {}), M = "eventProps", $ = "EVENT_CONFIG", T = "observedAttributes", Ne = () => (t, e) => {
|
|
605
606
|
Reflect.get(t, T) || Reflect.defineProperty(t, T, {
|
|
606
607
|
value: []
|
|
607
608
|
}), Reflect.get(t, T).push(
|
|
608
|
-
|
|
609
|
+
k(e)
|
|
609
610
|
);
|
|
610
|
-
},
|
|
611
|
-
Reflect.get(e,
|
|
611
|
+
}, Ve = (t) => (e, s) => {
|
|
612
|
+
Reflect.get(e, M) || Reflect.defineProperty(e, M, {
|
|
612
613
|
value: []
|
|
613
|
-
}), Reflect.get(e,
|
|
614
|
+
}), Reflect.get(e, $) || Reflect.defineProperty(e, $, {
|
|
614
615
|
value: {}
|
|
615
|
-
}), Reflect.get(e,
|
|
616
|
+
}), Reflect.get(e, $)[s] = {
|
|
616
617
|
bubbles: (t == null ? void 0 : t.bubbles) ?? !1,
|
|
617
618
|
composed: (t == null ? void 0 : t.composed) ?? !1
|
|
618
|
-
}, Reflect.get(e,
|
|
619
|
-
},
|
|
620
|
-
|
|
619
|
+
}, Reflect.get(e, M).push(s);
|
|
620
|
+
}, yt = (t, e = !1) => (s) => {
|
|
621
|
+
f(
|
|
621
622
|
t,
|
|
622
623
|
"start register static attr",
|
|
623
624
|
s.prototype[T]
|
|
@@ -626,122 +627,122 @@ const bt = l.div, Wt = l.span, Ht = l.section, _t = l.input, zt = l.button, Bt =
|
|
|
626
627
|
if (s.styles) {
|
|
627
628
|
const r = s.styles, c = [];
|
|
628
629
|
Array.isArray(r) ? c.push(...r) : c.push(r), c.forEach((a) => {
|
|
629
|
-
const
|
|
630
|
-
|
|
630
|
+
const l = new CSSStyleSheet();
|
|
631
|
+
l.replaceSync(a), n.push(l);
|
|
631
632
|
const d = new CSSStyleSheet();
|
|
632
633
|
d.replaceSync(a.slice(a.indexOf("@property"))), document.adoptedStyleSheets.push(d);
|
|
633
634
|
});
|
|
634
635
|
}
|
|
635
636
|
class o extends s {
|
|
636
637
|
constructor(...c) {
|
|
637
|
-
|
|
638
|
+
f("constructor", `%c${t}%c`), super(e, ...c), A("@osheet", n), n.length > 0 && this.shadow.adoptedStyleSheets.push(...n);
|
|
638
639
|
}
|
|
639
640
|
render() {
|
|
640
|
-
|
|
641
|
-
let c =
|
|
641
|
+
f("rwc: render from new class");
|
|
642
|
+
let c = Et();
|
|
642
643
|
const a = () => {
|
|
643
|
-
|
|
644
|
+
f("wrapperEffectCallback"), c = s.prototype.render.call(this);
|
|
644
645
|
};
|
|
645
646
|
return a.fake = !0, m(a), c;
|
|
646
647
|
}
|
|
647
|
-
attributeChangedCallback(c, a,
|
|
648
|
-
|
|
648
|
+
attributeChangedCallback(c, a, l) {
|
|
649
|
+
f(
|
|
649
650
|
"%cAttribute has changed.%c",
|
|
650
651
|
`%c${c}%c`,
|
|
651
|
-
`oldValue: ${a}, newValue: ${
|
|
652
|
+
`oldValue: ${a}, newValue: ${l}`,
|
|
652
653
|
`%c${t}%c`
|
|
653
654
|
);
|
|
654
655
|
try {
|
|
655
|
-
|
|
656
|
+
l = JSON.parse(l);
|
|
656
657
|
} catch {
|
|
657
658
|
}
|
|
658
|
-
const d =
|
|
659
|
+
const d = tt(c);
|
|
659
660
|
if (d in this && y(this[d])) {
|
|
660
|
-
const
|
|
661
|
-
|
|
661
|
+
const h = this[d];
|
|
662
|
+
l === null ? (h.set(h.initValue), this.removeAttribute(c)) : h.set(l);
|
|
662
663
|
}
|
|
663
664
|
_(
|
|
664
665
|
this,
|
|
665
666
|
s.prototype.attributeChangedCallback,
|
|
666
667
|
c,
|
|
667
668
|
a,
|
|
668
|
-
|
|
669
|
+
l
|
|
669
670
|
);
|
|
670
671
|
}
|
|
671
672
|
connectedCallback() {
|
|
672
673
|
var a;
|
|
673
|
-
|
|
674
|
-
([
|
|
675
|
-
|
|
674
|
+
f("rwc: connectedCallback"), f("connectedCallback", `%c${t}%c`, this), this.providers && Object.keys(this.providers).length > 0 && (f("WRAPPER for providers", t), Object.entries(this.providers).forEach(
|
|
675
|
+
([l, d]) => {
|
|
676
|
+
f("register provider", l, d()), this.addEventListener(l, (h) => {
|
|
676
677
|
var b;
|
|
677
|
-
|
|
678
|
-
const
|
|
679
|
-
((b =
|
|
678
|
+
f("send provider", l, d());
|
|
679
|
+
const p = h;
|
|
680
|
+
((b = p.detail) == null ? void 0 : b.context) === l && (p.stopPropagation(), p.detail.callback(d));
|
|
680
681
|
});
|
|
681
682
|
}
|
|
682
|
-
)), this.checkInjects(), (a = s.prototype[
|
|
683
|
-
(
|
|
684
|
-
this[
|
|
685
|
-
const
|
|
683
|
+
)), this.checkInjects(), (a = s.prototype[M]) == null || a.forEach(
|
|
684
|
+
(l) => {
|
|
685
|
+
this[l] = (d) => {
|
|
686
|
+
const h = s.prototype[$][l], { bubbles: p, composed: b } = h;
|
|
686
687
|
y(d) ? m(() => {
|
|
687
688
|
A("@oemit reactive value", d()), this.dispatchEvent(
|
|
688
|
-
new CustomEvent(
|
|
689
|
+
new CustomEvent(l, {
|
|
689
690
|
detail: d(),
|
|
690
|
-
bubbles:
|
|
691
|
+
bubbles: p,
|
|
691
692
|
composed: b
|
|
692
693
|
})
|
|
693
694
|
);
|
|
694
695
|
}) : (A("@oemit value", d), this.dispatchEvent(
|
|
695
|
-
new CustomEvent(
|
|
696
|
+
new CustomEvent(l, {
|
|
696
697
|
detail: d,
|
|
697
|
-
bubbles:
|
|
698
|
+
bubbles: p,
|
|
698
699
|
composed: b
|
|
699
700
|
})
|
|
700
701
|
));
|
|
701
702
|
};
|
|
702
703
|
}
|
|
703
|
-
),
|
|
704
|
+
), f("start render", `%c${t}%c`, t);
|
|
704
705
|
const c = () => {
|
|
705
|
-
|
|
706
|
-
const
|
|
707
|
-
this.shadow.appendChild(
|
|
706
|
+
f("rwc: insertRenderTemplate");
|
|
707
|
+
const l = this.render();
|
|
708
|
+
this.shadow.appendChild(l.hostElement), _(this, s.prototype.connectedCallback), this.appendSlotContent();
|
|
708
709
|
};
|
|
709
710
|
if (this.rootStyle && !s.styles) {
|
|
710
|
-
const
|
|
711
|
+
const l = (p) => p instanceof Promise || Array.isArray(p) && p.every((b) => b instanceof Promise), d = this.rootStyle, h = (p) => {
|
|
711
712
|
const b = new CSSStyleSheet();
|
|
712
|
-
b.replaceSync(
|
|
713
|
-
const
|
|
714
|
-
|
|
713
|
+
b.replaceSync(p), this.shadow.adoptedStyleSheets.push(b);
|
|
714
|
+
const u = new CSSStyleSheet();
|
|
715
|
+
u.replaceSync(p.slice(p.indexOf("@property"))), document.adoptedStyleSheets.push(u);
|
|
715
716
|
};
|
|
716
|
-
if (
|
|
717
|
-
const
|
|
718
|
-
Array.isArray(d) ?
|
|
717
|
+
if (l(d)) {
|
|
718
|
+
const p = [];
|
|
719
|
+
Array.isArray(d) ? p.push(...d) : p.push(d), Promise.all(p).then((b) => b.forEach((u) => h(u.default))).then(() => c());
|
|
719
720
|
} else {
|
|
720
|
-
const
|
|
721
|
-
Array.isArray(d) ?
|
|
721
|
+
const p = [];
|
|
722
|
+
Array.isArray(d) ? p.push(...d) : p.push(d), p.forEach((b) => h(b)), c();
|
|
722
723
|
}
|
|
723
724
|
} else
|
|
724
725
|
c();
|
|
725
|
-
this.slotContext && Object.keys(this.slotContext).length > 0 && this.shadow.querySelectorAll("slot").forEach((
|
|
726
|
-
|
|
726
|
+
this.slotContext && Object.keys(this.slotContext).length > 0 && this.shadow.querySelectorAll("slot").forEach((l) => {
|
|
727
|
+
f(
|
|
727
728
|
this.slotContext,
|
|
728
|
-
this.slotContext && this.slotContext[
|
|
729
|
+
this.slotContext && this.slotContext[l.name]
|
|
729
730
|
), A(
|
|
730
731
|
"@bslot element",
|
|
731
|
-
|
|
732
|
-
`name:${
|
|
733
|
-
|
|
734
|
-
),
|
|
735
|
-
const
|
|
736
|
-
this.slotContext && y(
|
|
732
|
+
l,
|
|
733
|
+
`name:${l.name};`,
|
|
734
|
+
l.assignedElements()
|
|
735
|
+
), l.assignedElements().forEach((d) => {
|
|
736
|
+
const h = this.slotContext[l.name];
|
|
737
|
+
this.slotContext && y(h) && (A(
|
|
737
738
|
"@oslot element",
|
|
738
|
-
|
|
739
|
-
`name:${
|
|
740
|
-
|
|
739
|
+
l,
|
|
740
|
+
`name:${l.name};`,
|
|
741
|
+
l.assignedElements()
|
|
741
742
|
), m(() => {
|
|
742
743
|
d.dispatchEvent(
|
|
743
744
|
new CustomEvent("handleSlotContext", {
|
|
744
|
-
detail:
|
|
745
|
+
detail: h()
|
|
745
746
|
})
|
|
746
747
|
);
|
|
747
748
|
}));
|
|
@@ -758,123 +759,123 @@ const bt = l.div, Wt = l.span, Ht = l.section, _t = l.input, zt = l.button, Bt =
|
|
|
758
759
|
};
|
|
759
760
|
export {
|
|
760
761
|
R as BaseElement,
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
762
|
+
ee as a,
|
|
763
|
+
ht as addAttributeList,
|
|
764
|
+
lt as addClassList,
|
|
765
|
+
it as addCustomAttributes,
|
|
766
|
+
U as addHtmlContent,
|
|
767
|
+
at as addReactiveClassList,
|
|
768
|
+
dt as addStyleList,
|
|
768
769
|
W as appendContentItem,
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
770
|
+
Ee as article,
|
|
771
|
+
be as aside,
|
|
772
|
+
_e as audio,
|
|
773
|
+
Oe as b,
|
|
774
|
+
Lt as bindReactiveSignals,
|
|
775
|
+
ve as blockquote,
|
|
776
|
+
ae as br,
|
|
777
|
+
Bt as button,
|
|
778
|
+
k as camelToKebab,
|
|
779
|
+
Be as canvas,
|
|
779
780
|
_ as checkCall,
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
781
|
+
Ae as cite,
|
|
782
|
+
ot as classList,
|
|
783
|
+
Tt as cls,
|
|
784
|
+
ue as code,
|
|
784
785
|
A as colorLog,
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
786
|
+
yt as component,
|
|
787
|
+
qe as createComponent,
|
|
788
|
+
Ct as createCustom,
|
|
789
|
+
mt as createCustomEl,
|
|
790
|
+
pt as createCustomElement,
|
|
790
791
|
H as createEl,
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
792
|
+
x as createElement,
|
|
793
|
+
gt as createSignal,
|
|
794
|
+
Ft as defineSlotTemplate,
|
|
795
|
+
$e as del,
|
|
795
796
|
Pe as details,
|
|
796
|
-
|
|
797
|
-
|
|
797
|
+
et as disableLogs,
|
|
798
|
+
Et as div,
|
|
798
799
|
m as effect,
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
800
|
+
P as elementHelpers,
|
|
801
|
+
Re as em,
|
|
802
|
+
vt as enableLogs,
|
|
803
|
+
Ve as event,
|
|
804
|
+
jt as eventEmitter,
|
|
805
|
+
Se as figcaption,
|
|
806
|
+
ye as figure,
|
|
807
|
+
me as footer,
|
|
808
|
+
Rt as forkJoin,
|
|
809
|
+
Xt as form,
|
|
809
810
|
xt as getList,
|
|
810
|
-
|
|
811
|
+
wt as getReactiveTemplate,
|
|
811
812
|
v as getSignalContent,
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
813
|
+
D as getTextContent,
|
|
814
|
+
ne as h1,
|
|
815
|
+
oe as h2,
|
|
816
|
+
re as h3,
|
|
817
|
+
ce as h4,
|
|
818
|
+
ie as h5,
|
|
819
|
+
le as h6,
|
|
820
|
+
pe as header,
|
|
821
|
+
de as hr,
|
|
821
822
|
z as htmlEffectWrapper,
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
823
|
+
je as i,
|
|
824
|
+
te as img,
|
|
825
|
+
X as initComponent,
|
|
826
|
+
zt as input,
|
|
827
|
+
Ie as ins,
|
|
828
|
+
Ot as isBaseElement,
|
|
829
|
+
K as isComponentConfig,
|
|
830
|
+
w as isComponentInitConfig,
|
|
830
831
|
y as isReactiveSignal,
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
832
|
+
kt as isSlotTemplate,
|
|
833
|
+
tt as kebabToCamel,
|
|
834
|
+
Zt as label,
|
|
835
|
+
Gt as li,
|
|
836
|
+
Ce as main,
|
|
837
|
+
Me as mark,
|
|
838
|
+
He as meter,
|
|
839
|
+
fe as nav,
|
|
839
840
|
Pt as newEventEmitter,
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
841
|
+
Ut as ol,
|
|
842
|
+
Yt as option,
|
|
843
|
+
se as p,
|
|
844
|
+
he as pre,
|
|
845
|
+
We as progress,
|
|
846
|
+
f as projectLog,
|
|
847
|
+
Ne as property,
|
|
848
|
+
Z as renderIf,
|
|
849
|
+
At as rs,
|
|
850
|
+
ft as rxRenderIf,
|
|
851
|
+
we as s,
|
|
852
|
+
_t as section,
|
|
853
|
+
Qt as select,
|
|
854
|
+
ct as setChildren,
|
|
855
|
+
rt as setEffects,
|
|
856
|
+
nt as setHtmlContent,
|
|
856
857
|
q as setListeners,
|
|
857
|
-
|
|
858
|
+
It as show,
|
|
858
859
|
N as showIf,
|
|
859
860
|
O as signal,
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
861
|
+
ut as signalComponent,
|
|
862
|
+
Je as slot,
|
|
863
|
+
ge as small,
|
|
864
|
+
Ht as span,
|
|
865
|
+
Le as strong,
|
|
865
866
|
xe as sub,
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
867
|
+
Fe as summary,
|
|
868
|
+
ke as sup,
|
|
869
|
+
Jt as table,
|
|
870
|
+
Nt as td,
|
|
871
|
+
G as textContentWrapper,
|
|
872
|
+
Kt as textarea,
|
|
873
|
+
Vt as th,
|
|
874
|
+
qt as tr,
|
|
875
|
+
Te as u,
|
|
876
|
+
Dt as ul,
|
|
877
|
+
Mt as unsafeHtml,
|
|
878
|
+
Wt as useCustomComponent,
|
|
879
|
+
ze as video,
|
|
880
|
+
$t as when
|
|
880
881
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IsPromise, IsPromiseFunction, UnwrapPromise } from './helpers.types';
|
|
2
2
|
import { CompareFn, ReactiveSignal, UnwrapSignal } from './signal.type';
|
|
3
|
-
export declare function signal<T = unknown>(initValue: T, signalCompareFn?: CompareFn<T
|
|
4
|
-
|
|
3
|
+
export declare function signal<T = unknown>(initValue: T, signalCompareFn?: CompareFn<T>, config?: {
|
|
4
|
+
name?: string;
|
|
5
|
+
}): ReactiveSignal<T>;
|
|
6
|
+
export declare function effect(cb: () => void, name?: string): void;
|
|
5
7
|
export declare const isReactiveSignal: <R extends ReactiveSignal<any>>(v: R | any) => v is R;
|
|
6
8
|
/**
|
|
7
9
|
* Reactive String (rs). Создаёт зависимый string сигнал от источника.
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(o,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(o=typeof globalThis<"u"?globalThis:o||self,p(o.ReactiveComponent={}))})(this,function(o){"use strict";var qe=Object.defineProperty;var Ge=(o,p,A)=>p in o?qe(o,p,{enumerable:!0,configurable:!0,writable:!0,value:A}):o[p]=A;var E=(o,p,A)=>Ge(o,typeof p!="symbol"?p+"":p,A);const p=t=>t&&typeof t=="object"&&("classList"in t||"attributes"in t||"customAttributes"in t||"reactiveClassList"in t||"listeners"in t||"customListeners"in t||"children"in t||"effects"in t||"style"in t||Object.keys(t).some(e=>e.startsWith(".")||e.startsWith("@")||e.startsWith("$")))&&!("hostElement"in t),A=t=>t&&typeof t=="object"&&"hostElement"in t&&"append"in t&&"set"in t&&"addStyle"in t&&"setAttribute"in t&&"addClass"in t&&"addEffect"in t&&"addReactiveContent"in t&&"setReactiveContent"in t&&"clear"in t,W=(t,e,...n)=>{e&&e.apply(t,n)};let _=!0;const f=(...t)=>{_&&console.debug(["[rwc]",...t].join(" | "),...Array.from(t.join("").matchAll(/%c/gm)).map((e,n)=>n%2===0?"color:red":"color:inherit"))},I=t=>t.replace(/([A-Z])/gm,e=>`-${e.toLowerCase()}`),Q=t=>t.replace(/-(\w)/gm,(e,n)=>n.toUpperCase()),L=(t,...e)=>{if(!_)return;const n={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},s=t.match(/@[rgbpycow]/g)||[],i=s.map(c=>{const d=c.slice(1);return n[d]||"color: inherit"});let l=t;s.forEach(c=>{const d=new RegExp(`\\${c}([^\\s,]+)`,"g");l=l.replace(d,"%c$1")}),console.log(l,...i,...e)},bt=()=>{_=!0},Y=()=>{_=!1};Y();const O=new WeakMap,B=[],w=[];function R(t,e=()=>!0){const n=new Set;let s=e;function i(){const l=B[B.length-1];if(l&&!("fake"in l&&l.fake)){const c=O.get(l),d=c==null?void 0:c.parent;if(d){const a=O.get(d);a==null||a.cleanupFns.add(()=>{n.delete(l)})}n.add(l)}return t}return i.getSubscribers=()=>[...n],i.setCompareFn=function(l){return s=l,i},i.clearSubscribers=function(){n.clear()},i.peek=function(){return Object.freeze(t)},i.initValue=Object.freeze(t),i.oldValue=Object.freeze(t),i.forceSet=function(l){i.oldValue=Object.freeze(t),t=l,n.forEach(c=>Promise.resolve(c).then(d=>{const a=O.get(d);a&&a.cleanupFns.size>0&&(a.cleanupFns.forEach(h=>h()),a.cleanupFns.clear()),w.push(d),d(),w.pop()}))},i.set=function(l,c=s){t!==l&&c(t,l)&&i.forceSet(l)},i.update=function(l){i.set(l(t))},i.pipe=l=>{const c=R(null);return b(()=>{const d=i();b(()=>{const a=l(d);a instanceof Promise?a.then(h=>c.set(h)):v(a)?b(()=>c.set(a())):c.set(a)})}),c},i}function b(t){const e=Math.random().toString(36).substring(2,15);f("current effect",`%c${e}%c`);const n=t;t=()=>(f("current effect callback",`%c${e}%c`),n());const s=w[w.length-1];O.has(t)||O.set(t,{cleanupFns:new Set});const i=O.get(t);s?i.parent=s:delete i.parent,w.push(t),B.push(t),t(),B.pop(),w.pop()}const v=t=>!!t&&["object","function"].includes(typeof t)&&"set"in t&&"oldValue"in t&&"update"in t&&"forceSet"in t;function pt(t,...e){const n=R("");return b(()=>{const s=e.map(l=>v(l)?String(l()):String(l)),i=[t[0]];s.forEach((l,c)=>{i.push(l,t[c+1])}),n.set(i.join(""))}),n}function Et(t,e){const n=R(e??null),s=i=>n.set(i);return t instanceof Promise?t.then(s):typeof t=="function"&&b(()=>{const i=t();i instanceof Promise?i.then(s):v(i)?b(()=>s(i())):s(i)}),n}function yt(t,e){let n=t(),s=e();b(()=>{const i=t(),l=e();i!==l&&(i!==n?e.set(i):l!==s&&t.set(l)),n=i,s=l})}function St(...t){let e=t.map(s=>s());const n=R(e);return t.forEach((s,i)=>{b(()=>{const l=()=>e.filter(c=>c!==void 0).length;l()===t.length&&(e=Array.from(e).fill(void 0)),e[i]=s(),l()===t.length&&n.set([...e])})}),n}class T extends HTMLElement{constructor(n=!1){super();E(this,"isSlotLazyLoading",!1);E(this,"slotTemplate");E(this,"slotContext");E(this,"rootStyle");E(this,"modelValue");E(this,"providers");E(this,"appendAllSlotContent");E(this,"allSlotContent",[]);E(this,"slotContent",{});E(this,"htmlSlotContent",{});E(this,"shadow");E(this,"injects",{});this.shadow=this.attachShadow({mode:n?"closed":"open"})}appendChild(n,s=!0){var i;if(this.isSlotLazyLoading&&s){if(n instanceof HTMLElement){const l=n.slot||"default";this.htmlSlotContent[l]||(this.htmlSlotContent[l]=[]),(i=this.htmlSlotContent[l])==null||i.push(n)}}else return super.appendChild(n)}appendSlotContent(){var n;(n=this.appendAllSlotContent)==null||n.call(this)}inject(n){return f("%cinject%c",n),this.injects[n]||(this.injects[n]=R(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{f("%cinject%c",`%c${n}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(n,{detail:{context:n,callback:i=>b(()=>{s.set(i())})},bubbles:!0,composed:!0}))})}setReactiveValue(n){this.modelValue=n}}E(T,"observedAttributes",[]),E(T,"renderTagName",""),E(T,"styles");const vt=t=>"render"in t&&"setReactiveValue"in t,gt="handleSlotContext",K="onConnected",At=()=>()=>{},G=t=>typeof t=="string"?t:JSON.stringify(t),N=t=>{const e=document.createElement("span");return e.textContent=G(t),e},V=(t,e)=>(t.appendChild(N(e)),t),x=(t,e)=>(t.innerHTML="",V(t,e)),J=t=>{const e=document.createElement("span");return b(()=>{const n=t();e.textContent=G(n)}),e},M=t=>({append(...e){return e.forEach(n=>{t.appendChild(n.hostElement),K in n.hostElement&&setTimeout(()=>{var s,i;(i=(s=n.hostElement).onConnected)==null||i.call(s,n,n.hostElement)})}),this},set(...e){this.clear();const n=document.createDocumentFragment();return e.forEach(s=>{n.appendChild(s.hostElement)}),t.appendChild(n),this},removeChild(...e){return e.forEach(n=>{Array.from(t.childNodes.values()).some(s=>s===n.hostElement)&&t.removeChild(n.hostElement)}),this},addHtmlContent(e){return V(t,e),this},setHtmlContent(e){return x(t,e),this},addEventlistener(e,n,s=!1){return t.addEventListener(e,i=>n(i,this,t),s),this},setAttribute(e,n){let s;if(typeof n=="boolean"&&!(t instanceof T))if(n)s="";else{this.removeAttribute(e);const i=e.toLowerCase();return i in t&&(t[i]=null),this}else typeof n!="string"?s=JSON.stringify(n):s=n;if(t.setAttribute(I(e),s),!(t instanceof T)){const i=e.toLowerCase();i in t&&(t[i]=n)}return this},setCustomAttribute(e,n){let s;return typeof n!="string"?s=JSON.stringify(n):s=n,t.setAttribute(I(e),s),this},setReactiveAttribute(e,n){return b(()=>this.setAttribute(e,n())),this},setReactiveCustomAttribute(e,n){return b(()=>this.setCustomAttribute(e,n())),this},removeAttribute(e){return t.removeAttribute(I(e)),this},addStyle(e){return Object.entries(e).forEach(([n,s])=>{const i=n.startsWith("--");typeof s=="function"?this.addEffect(()=>{if(i){const l=String(s()||"");t.style.setProperty(n,l)}else t.style[n]=s()}):typeof s=="string"&&(i?t.style.setProperty(n,s):t.style[n]=s)}),this},onConnected(e){return Reflect.defineProperty(t,K,{get(){return e}}),this},addClass(...e){return e.forEach(n=>{typeof n=="string"?t.classList.add(...n.split(" ").flatMap(s=>s.split(`
|
|
2
|
-
`)).map(s=>s.trim()).filter(Boolean)):(()=>{let s=null;this.addEffect(()=>{const i=n();i.length>0&&(s?this.replaceClass(s,i):this.addClass(i),s=i)})})()}),this},setClass(...e){return t.classList.remove(...t.classList),t.classList.add(...e),this},addReactiveClass(e){return Object.keys(e).forEach(n=>{b(()=>{e[n]()?this.addClass(n):this.removeClass(n)})}),this},removeClass(...e){return t.classList.remove(...e),this},replaceClass(e,n){return t.classList.replace(e,n),this},addEffect(e){return b(()=>e(this,this.hostElement)),this},addReactiveContent(e){return t.appendChild(J(e)),this},setReactiveContent(e){return this.clear(),t.appendChild(J(e)),this},clear(){return t.innerHTML="",this},hostElement:t}),tt=(t,...e)=>({classList:[...t.map(n=>n.trim()).filter(Boolean),...e]}),Lt=(t,...e)=>tt(t,...e),D=(t,e)=>{if(!e)return t;const n=Object.keys(e||{}).filter(s=>s.startsWith(".")||s.startsWith("@")||s.startsWith("$"));return n.filter(s=>s.startsWith(".")).forEach(s=>{e!=null&&e.attributes||(e.attributes={}),e.attributes[s.slice(1)]=e[s]}),n.filter(s=>s.startsWith("@")).forEach(s=>{e!=null&&e.listeners||(e.listeners={});const i=s.slice(1);e.listeners[i]=e[s]}),n.filter(s=>s.startsWith("$")).forEach(s=>{e!=null&&e.effects||(e.effects=[]),e.effects.push(e[s])}),ot(t,e.classList),lt(t,e.style),ct(t,e.attributes),it(t,e.reactiveClassList),st(t,e.customAttributes),nt(t,e.children),et(t,e.effects),U(t,e.listeners),U(t,e.customListeners),t},U=(t,e)=>{e&&Object.entries(e).forEach(([n,s])=>{typeof s=="function"&&t.addEventlistener(n,s)})},et=(t,e)=>e==null?void 0:e.forEach(n=>t.addEffect(n)),nt=(t,e)=>$(t,...e||[]),st=(t,e)=>{const n=e;n&&Object.keys(n).forEach(s=>{v(n[s])?t.setReactiveCustomAttribute(s,n[s]):typeof n[s]=="function"?t.addEffect(()=>{t.setCustomAttribute(s,n[s]())}):t.setCustomAttribute(s,n[s])})},ot=(t,e)=>t.addClass(...e||[]),it=(t,e)=>t.addReactiveClass(e||{}),lt=(t,e)=>t.addStyle(e||{}),ct=(t,e)=>{const n=e,s=(i,l)=>{l&&(v(l)?t.setReactiveAttribute(i,l):typeof l=="function"?t.addEffect(()=>{t.setAttribute(i,l())}):t.setAttribute(i,l))};n&&Object.keys(n).forEach(i=>{s(i,n[i])})},$=(t,...e)=>(e.forEach(n=>{typeof n=="string"?n.trim().length>0&&t.addHtmlContent(n):v(n)?t.addReactiveContent(n):t.append(n)}),t),k=(t,e)=>{const n=document.createElement(t),s={...M(n)};return D(s,e)},P=(t,e)=>{const[n,...s]=t.split(" ").map(l=>l.trim()),i=k(n,e);return s.length>0&&i.addClass(...s),(...l)=>$(i,...l.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?g(()=>c(i)):c))},g=t=>k("div").addStyle({display:"contents"}).addEffect(e=>{const n=t(),s=[];Array.isArray(n)?s.push(...n):s.push(n),e.clear(),$(e,...s)}),Rt=t=>{const e=s=>typeof s=="string"?s.trim().length>0?M(N(s)):P("div")():v(s)?M(J(s)):s;return rt(()=>{const s=t();return s instanceof Array&&Array.isArray(s)?s.map(e):e(s)})},Tt=(t,e,n)=>{const s=k("div").addStyle({display:"contents"}),i=new Map,l=new Map;let c=[];const d=new Set;let a=t.peek();const h=C=>{d.delete(C),i.delete(C),l.delete(C)};return b(()=>{const C=t();c=C.map(e).map(u=>typeof u=="string"?u:u.toString());const m=Array.from(s.hostElement.children);f("containerChildren",m,c),m.forEach(u=>{const S=u.dataset.key;c.includes(S)||(f("remove element",S,u),u.remove(),h(S))}),c.forEach(u=>{var F,j;const S=C[c.indexOf(u)];i.has(u)?JSON.stringify(S)!==JSON.stringify(a[c.indexOf(u)])&&((F=s.hostElement.querySelector(`[data-key="${u}"]`))==null||F.remove(),(j=i.get(u))==null||j.set(Math.random().toString(36).substring(2,15)),l.set(u,()=>n(S,c.indexOf(u),C).setCustomAttribute("data-key",u))):(f("create new element",u,S),i.set(u,R(Math.random().toString(36).substring(2,15))),l.set(u,()=>n(S,c.indexOf(u),C).setCustomAttribute("data-key",u)))}),a=C;const y=()=>{i.forEach((u,S)=>{f("key from setTimeout foreach currItemSignalMap",S),d.has(S)||(d.add(S),b(()=>{var Ct;u();const F=c.indexOf(S),j=(Ct=l.get(S))==null?void 0:Ct();j&&(f("call effect from setTimeout",S,j.hostElement),F<=s.hostElement.children.length-1?s.hostElement.insertBefore(j.hostElement,s.hostElement.children[F]):s.hostElement.append(j.hostElement))}))})};Promise.resolve().then(()=>y())}),s},rt=t=>{let e=[k("div")],n=!1;return b(()=>{var l,c;const s=t();n=Array.isArray(s);const i=[];i.push(...[s].flat()),i.length===0&&i.push(k("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{f("newReactiveComponent.map",i.map(d=>{var a;return f("newReactiveComponent hostElement",d.hostElement),(a=d.hostElement)==null?void 0:a.id})),f("currComponent[0].hostElement?.id",(l=e[0].hostElement)==null?void 0:l.id,e),(c=e[0].hostElement)==null||c.replaceWith(...i.map(d=>d.hostElement)),e.slice(1).forEach(d=>{var a;return(a=d.hostElement)==null?void 0:a.remove()}),e=i}catch(d){console.error(d)}}),n?e:e[0]},jt=t=>gt in t,Ot=t=>{const e=P("div")().addStyle({display:"contents"}),n=s=>(e.hostElement.innerHTML=s,e);return typeof t=="string"?n(t):e.addEffect(()=>{n(t())}),e},X=(t,e,n)=>t?g(e):n?g(n):P("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),at=(t,e,n)=>g(()=>X(!!t(),e,n)),wt=(t,e,n)=>typeof t=="boolean"?X(t,e,n):at(t,e,n),Z=(t,e)=>{const n=g(e);return typeof t=="boolean"?[n].flat().forEach(s=>s.hostElement.style.display=t?"block":"none"):b(()=>{const s=t()?"block":"none";[n].flat().forEach(i=>i.hostElement.style.display=s)}),n},kt=(t,e,n)=>{const s=[Z(t,e)].flat();return n&&s.push(...[Z(()=>typeof t=="boolean"?!t:!t(),n)].flat()),g(()=>s)},dt=(t,e)=>{f("createCustomElement",t);const n=document.createElement(t),s={...M(n),setReactiveValue(i){return n instanceof T&&n.setReactiveValue(i),this},setSlotTemplate(i){const l=n.slotTemplate;return l&&Object.entries(i).forEach(([c,d])=>{l[c]=d}),this}};return D(s,e)},ht=(t,e)=>{const n=t.split(" ").slice(1).map(i=>i.trim()),s=dt(t.split(" ")[0],e);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...i)=>{L("@rcreateCustomEl content",t,i);const l=i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?g(()=>c(s)):c);return s.hostElement.allSlotContent=l,s.hostElement.slotContent=l.filter(A).reduce((c,d)=>{const a=d.hostElement.getAttribute("slot")||"default";return c[a]||(c[a]=[]),c[a].push(d),c},{}),s.hostElement.appendAllSlotContent=()=>$(s,...l),s}},ut=(t,e,n)=>ht(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,p(e)?e:e&&typeof e=="string"?n:void 0),It=()=>{const t=()=>{};return t.oldValue=null,t},Mt=()=>({}),$t=(t,e,n)=>{const s=e?mt(e,n)(t):t;return(i,...l)=>{const c=[...l];return i&&!p(i)&&c.unshift(i),ut(s,p(i)?i:{})(...c)}},r={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(t=>{r[t]=(e,...n)=>{let s=[...n];return e&&!p(e)&&(s=[e].concat(s)),P(t,p(e)?e:{})(...s)}});const ft=r.div,Pt=r.span,Ht=r.section,Ft=r.input,Wt=r.button,_t=r.table,Bt=r.tr,Jt=r.td,zt=r.th,qt=r.ul,Gt=r.li,Nt=r.ol,Vt=r.form,Dt=r.label,Ut=r.select,Xt=r.option,Zt=r.textarea,Qt=r.img,Yt=r.a,Kt=r.p,xt=r.h1,te=r.h2,ee=r.h3,ne=r.h4,se=r.h5,oe=r.h6,ie=r.br,le=r.hr,ce=r.pre,re=r.code,ae=r.nav,de=r.header,he=r.footer,ue=r.main,fe=r.aside,me=r.article,Ce=r.figure,be=r.figcaption,pe=r.blockquote,Ee=r.cite,ye=r.small,Se=r.strong,ve=r.em,ge=r.b,Ae=r.i,Le=r.u,Re=r.s,Te=r.sub,je=r.sup,Oe=r.mark,we=r.del,ke=r.ins,Ie=r.details,Me=r.summary,$e=r.progress,Pe=r.meter,He=r.audio,Fe=r.video,We=r.canvas,_e=r.slot,Be=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{}),z="eventProps",q="EVENT_CONFIG",H="observedAttributes",Je=()=>(t,e)=>{Reflect.get(t,H)||Reflect.defineProperty(t,H,{value:[]}),Reflect.get(t,H).push(I(e))},ze=t=>(e,n)=>{Reflect.get(e,z)||Reflect.defineProperty(e,z,{value:[]}),Reflect.get(e,q)||Reflect.defineProperty(e,q,{value:{}}),Reflect.get(e,q)[n]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,z).push(n)},mt=(t,e=!1)=>n=>{f(t,"start register static attr",n.prototype[H]);const s=[];if(n.styles){const l=n.styles,c=[];Array.isArray(l)?c.push(...l):c.push(l),c.forEach(d=>{const a=new CSSStyleSheet;a.replaceSync(d),s.push(a);const h=new CSSStyleSheet;h.replaceSync(d.slice(d.indexOf("@property"))),document.adoptedStyleSheets.push(h)})}class i extends n{constructor(...c){f("constructor",`%c${t}%c`),super(e,...c),L("@osheet",s),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){f("rwc: render from new class");let c=ft();const d=()=>{f("wrapperEffectCallback"),c=n.prototype.render.call(this)};return d.fake=!0,b(d),c}attributeChangedCallback(c,d,a){f("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${d}, newValue: ${a}`,`%c${t}%c`);try{a=JSON.parse(a)}catch{}const h=Q(c);if(h in this&&v(this[h])){const C=this[h];a===null?(C.set(C.initValue),this.removeAttribute(c)):C.set(a)}W(this,n.prototype.attributeChangedCallback,c,d,a)}connectedCallback(){var d;f("rwc: connectedCallback"),f("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(f("WRAPPER for providers",t),Object.entries(this.providers).forEach(([a,h])=>{f("register provider",a,h()),this.addEventListener(a,C=>{var y;f("send provider",a,h());const m=C;((y=m.detail)==null?void 0:y.context)===a&&(m.stopPropagation(),m.detail.callback(h))})})),this.checkInjects(),(d=n.prototype[z])==null||d.forEach(a=>{this[a]=h=>{const C=n.prototype[q][a],{bubbles:m,composed:y}=C;v(h)?b(()=>{L("@oemit reactive value",h()),this.dispatchEvent(new CustomEvent(a,{detail:h(),bubbles:m,composed:y}))}):(L("@oemit value",h),this.dispatchEvent(new CustomEvent(a,{detail:h,bubbles:m,composed:y})))}}),f("start render",`%c${t}%c`,t);const c=()=>{f("rwc: insertRenderTemplate");const a=this.render();this.shadow.appendChild(a.hostElement),W(this,n.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!n.styles){const a=m=>m instanceof Promise||Array.isArray(m)&&m.every(y=>y instanceof Promise),h=this.rootStyle,C=m=>{const y=new CSSStyleSheet;y.replaceSync(m),this.shadow.adoptedStyleSheets.push(y);const u=new CSSStyleSheet;u.replaceSync(m.slice(m.indexOf("@property"))),document.adoptedStyleSheets.push(u)};if(a(h)){const m=[];Array.isArray(h)?m.push(...h):m.push(h),Promise.all(m).then(y=>y.forEach(u=>C(u.default))).then(()=>c())}else{const m=[];Array.isArray(h)?m.push(...h):m.push(h),m.forEach(y=>C(y)),c()}}else c();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(a=>{f(this.slotContext,this.slotContext&&this.slotContext[a.name]),L("@bslot element",a,`name:${a.name};`,a.assignedElements()),a.assignedElements().forEach(h=>{const C=this.slotContext[a.name];this.slotContext&&v(C)&&(L("@oslot element",a,`name:${a.name};`,a.assignedElements()),b(()=>{h.dispatchEvent(new CustomEvent("handleSlotContext",{detail:C()}))}))})})}disconnectedCallback(){this.shadow.replaceChildren(),this.replaceChildren(),W(this,n.prototype.disconnectedCallback)}}return E(i,"observedAttributes",n.prototype[H]??[]),E(i,"renderTagName",t),i.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(t,i),n.renderTagName=t,n};o.BaseElement=T,o.a=Yt,o.addAttributeList=ct,o.addClassList=ot,o.addCustomAttributes=st,o.addHtmlContent=V,o.addReactiveClassList=it,o.addStyleList=lt,o.appendContentItem=$,o.article=me,o.aside=fe,o.audio=He,o.b=ge,o.bindReactiveSignals=yt,o.blockquote=pe,o.br=ie,o.button=Wt,o.camelToKebab=I,o.canvas=We,o.checkCall=W,o.cite=Ee,o.classList=tt,o.cls=Lt,o.code=re,o.colorLog=L,o.component=mt,o.createComponent=Be,o.createCustom=ut,o.createCustomEl=ht,o.createCustomElement=dt,o.createEl=P,o.createElement=k,o.createSignal=Et,o.defineSlotTemplate=Mt,o.del=we,o.details=Ie,o.disableLogs=Y,o.div=ft,o.effect=b,o.elementHelpers=M,o.em=ve,o.enableLogs=bt,o.event=ze,o.eventEmitter=At,o.figcaption=be,o.figure=Ce,o.footer=he,o.forkJoin=St,o.form=Vt,o.getList=Tt,o.getReactiveTemplate=Rt,o.getSignalContent=g,o.getTextContent=G,o.h1=xt,o.h2=te,o.h3=ee,o.h4=ne,o.h5=se,o.h6=oe,o.header=de,o.hr=le,o.htmlEffectWrapper=J,o.i=Ae,o.img=Qt,o.initComponent=D,o.input=Ft,o.ins=ke,o.isBaseElement=vt,o.isComponentConfig=A,o.isComponentInitConfig=p,o.isReactiveSignal=v,o.isSlotTemplate=jt,o.kebabToCamel=Q,o.label=Dt,o.li=Gt,o.main=ue,o.mark=Oe,o.meter=Pe,o.nav=ae,o.newEventEmitter=It,o.ol=Nt,o.option=Xt,o.p=Kt,o.pre=ce,o.progress=$e,o.projectLog=f,o.property=Je,o.renderIf=X,o.rs=pt,o.rxRenderIf=at,o.s=Re,o.section=Ht,o.select=Ut,o.setChildren=nt,o.setEffects=et,o.setHtmlContent=x,o.setListeners=U,o.show=kt,o.showIf=Z,o.signal=R,o.signalComponent=rt,o.slot=_e,o.small=ye,o.span=Pt,o.strong=Se,o.sub=Te,o.summary=Me,o.sup=je,o.table=_t,o.td=Jt,o.textContentWrapper=N,o.textarea=Zt,o.th=zt,o.tr=Bt,o.u=Le,o.ul=qt,o.unsafeHtml=Ot,o.useCustomComponent=$t,o.video=Fe,o.when=wt,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|