lyco 1.3.6 → 1.3.8
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/dist/basic.cjs.js +1 -1
- package/dist/basic.cjs.js.map +1 -1
- package/dist/basic.es.js +1 -1
- package/dist/basic.es.js.map +1 -1
- package/dist/{core-DkUSnSgK.js → core-BoB7sDMv.js} +2 -2
- package/dist/core-BoB7sDMv.js.map +1 -0
- package/dist/{core-B-U2ZJO6.mjs → core-bQvrG1od.mjs} +2 -2
- package/dist/core-bQvrG1od.mjs.map +1 -0
- package/dist/index.cjs.js +32 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +342 -330
- package/dist/index.es.js.map +1 -1
- package/dist/types/components/Basic/utils.d.ts +7 -0
- package/dist/types/components/Flex.d.ts +2 -3
- package/dist/types/components/FooterLayout.d.ts +2 -3
- package/dist/types/components/GridCol.d.ts +2 -3
- package/dist/types/components/GridRow.d.ts +2 -3
- package/dist/types/components/LazyForEach.d.ts +8 -0
- package/dist/types/components/mod.d.ts +2 -1
- package/dist/types/core/index.d.ts +19 -9
- package/package.json +1 -1
- package/dist/core-B-U2ZJO6.mjs.map +0 -1
- package/dist/core-DkUSnSgK.js.map +0 -1
package/dist/basic.cjs.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
const e=require(`./core-
|
1
|
+
const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(require(`lit/directives/style-map.js`));function r(e){return{let(t){return t(e),e}}}const i=r;function a(e){return typeof e==`string`?e:(0,n.styleMap)(e).toString()}function o(n,r){return(o,s)=>{let c=o??{},l=e.createEventBinder(c?.on??{}),u=o?.injectFields??(e=>{}),d=r??new Set,f=i(document.createElement(n)).let(e=>{c.className&&(e.className=c.className),c.id&&(e.id=c.id),c.style&&(e.style.cssText=a(c.style)),c.title&&(e.title=c.title),c.lang&&(e.lang=c.lang),c.dir&&(e.dir=c.dir),c.role&&(e.role=c.role),c.ariaLabel&&(e.ariaLabel=c.ariaLabel),c.ariaHidden&&(e.ariaHidden=c.ariaHidden),c.key&&e.setAttribute(`data-key`,c.key.toString())});d.forEach(e=>{c[e]&&(f[e]=c[e])}),c.hidden!==void 0&&(f.hidden=c.hidden),c.draggable!==void 0&&(f.draggable=c.draggable),c.contentEditable!==void 0&&(f.contentEditable=c.contentEditable.toString()),c.spellcheck!==void 0&&(f.spellcheck=c.spellcheck),c.tabIndex!==void 0&&(f.tabIndex=c.tabIndex),c.dataset&&Object.entries(c.dataset).forEach(([e,t])=>{f.dataset[e]=t}),l.bind(f),u(f),(0,t.render)(s,f);let p=document.createElement(`div`);return p.remove=()=>{p.remove(),l.unbindAll()},p.appendChild(f),t.html`${p.firstElementChild}`}}function s(n,r){return(o,s)=>{let c=o??{},l=e.createEventBinder(c.on??{}),u=c?.injectFields??(e=>{}),d=r??new Set,f=i(document.createElementNS(`http://www.w3.org/1998/Math/MathML`,n)).let(e=>{c.className&&(e.className=c.className),c.id&&(e.id=c.id),c.style&&(e.style.cssText=a(c.style)),c.display&&e.setAttribute(`display`,c.display),c.key&&e.setAttribute(`data-key`,c.key.toString()),c.mathbackground&&e.setAttribute(`mathbackground`,c.mathbackground),c.mathcolor&&e.setAttribute(`mathcolor`,c.mathcolor)});d.forEach(e=>{c[e]&&(f[e]=c[e])}),l.bind(f),u(f),typeof s==`object`&&s&&`_$litType$`in s?(0,t.render)(s,f):f.textContent=`${s??``}`;let p=document.createElement(`div`);return p.remove=()=>{p.remove(),l.unbindAll()},p.appendChild(f),t.html`${p.firstElementChild}`}}function c(n,r){return(o,s)=>{let c=o??{},l=e.createEventBinder(c.on??{}),u=c?.injectFields??(e=>{}),d=r??new Set,f=i(document.createElementNS(`http://www.w3.org/2000/svg`,n)).let(e=>{c.className&&e.setAttribute(`class`,c.className),c.id&&(e.id=c.id),c.style&&(e.style.cssText=a(c.style)),c.fill&&e.setAttribute(`fill`,c.fill),c.stroke&&e.setAttribute(`stroke`,c.stroke),c.key&&e.setAttribute(`data-key`,c.key.toString()),c.strokeWidth&&e.setAttribute(`stroke-width`,c.strokeWidth.toString()),c.viewBox&&e.setAttribute(`viewBox`,c.viewBox),c.transform&&e.setAttribute(`transform`,c.transform),c.opacity!==void 0&&e.setAttribute(`opacity`,c.opacity.toString())});d.forEach(e=>{if(c[e]){let t=c[e];if(typeof t==`function`)f[e]=t;else{let n=e.toString().replace(/([A-Z])/g,`-$1`).toLowerCase();f.setAttribute(n,t.toString())}}}),l.bind(f),u(f),typeof s==`object`&&s&&`_$litType$`in s||Array.isArray(s)&&s.length>0&&typeof s[0]==`object`&&`_$litType$`in s[0]?(0,t.render)(s,f):(console.log(`content`,s),f.textContent=`${s??``}`);let p=document.createElement(`div`);return p.remove=()=>{p.remove(),l.unbindAll()},p.appendChild(f),t.html`${p.firstElementChild}`}}function l(t,n){let r=o(t,n);return(t,n)=>{let i=n=>r(t,e.renderFnOrArray(n));return e.renderFnOrArrayOrCurry(n,i)}}function u(t,n){let r=s(t,n);return(t,n)=>{let i=n=>r(t,e.renderFnOrArray(n));return e.renderFnOrArrayOrCurry(n,i)}}function d(t,n){let r=c(t,n);return(t,n)=>{let i=n=>r(t,e.renderFnOrArray(n));return e.renderFnOrArrayOrCurry(n,i)}}const f={div:l(`div`),p:l(`p`),span:l(`span`),h1:l(`h1`),h2:l(`h2`),h3:l(`h3`),h4:l(`h4`),h5:l(`h5`),h6:l(`h6`),article:l(`article`),section:l(`section`),nav:l(`nav`),aside:l(`aside`),header:l(`header`),footer:l(`footer`),main:l(`main`),ul:l(`ul`),ol:l(`ol`),li:l(`li`),dl:l(`dl`),dt:l(`dt`),dd:l(`dd`),form:l(`form`,new Set([`method`,`action`,`enctype`,`target`,`novalidate`])),label:l(`label`),input:l(`input`),textarea:l(`textarea`,new Set([`cols`,`rows`,`wrap`,`maxLength`,`minLength`,`required`,`disabled`,`readonly`,`name`])),button:l(`button`),select:l(`select`,new Set([`multiple`,`required`,`disabled`,`name`,`size`])),option:l(`option`),table:l(`table`),thead:l(`thead`),tbody:l(`tbody`),tfoot:l(`tfoot`),tr:l(`tr`),th:l(`th`),td:l(`td`),a:l(`a`,new Set([`href`,`target`,`rel`,`download`,`type`])),img:l(`img`,new Set([`src`,`alt`,`width`,`height`,`loading`,`decoding`])),iframe:l(`iframe`),embed:l(`embed`),object:l(`object`),video:l(`video`),audio:l(`audio`),source:l(`source`),track:l(`track`),canvas:l(`canvas`),map:l(`map`),area:l(`area`),summary:l(`summary`),details:l(`details`),slot:l(`slot`),template:l(`template`),style:l(`style`),script:l(`script`),link:l(`link`),meta:l(`meta`),title:l(`title`),base:l(`base`),head:l(`head`),body:l(`body`),html:l(`html`),abbr:l(`abbr`),b:l(`b`),bdi:l(`bdi`),bdo:l(`bdo`),blockquote:l(`blockquote`),br:l(`br`),caption:l(`caption`),cite:l(`cite`),code:l(`code`),col:l(`col`),colgroup:l(`colgroup`),data:l(`data`),del:l(`del`),dfn:l(`dfn`),em:l(`em`),i:l(`i`),kbd:l(`kbd`),mark:l(`mark`),q:l(`q`),rp:l(`rp`),rt:l(`rt`),ruby:l(`ruby`),s:l(`s`),samp:l(`samp`),small:l(`small`),strong:l(`strong`),sub:l(`sub`),sup:l(`sup`),time:l(`time`),u:l(`u`),var:l(`var`),address:l(`address`),progress:l(`progress`),meter:l(`meter`),output:l(`output`),datalist:l(`datalist`),dialog:l(`dialog`),menu:l(`menu`),fieldset:l(`fieldset`),legend:l(`legend`),figcaption:l(`figcaption`),figure:l(`figure`),hgroup:l(`hgroup`),hr:l(`hr`),ins:l(`ins`),noscript:l(`noscript`),optgroup:l(`optgroup`),picture:l(`picture`),pre:l(`pre`),search:l(`search`),wbr:l(`wbr`)},p={math:u(`math`),mstyle:u(`mstyle`),merror:u(`merror`),mtext:u(`mtext`),mspace:u(`mspace`),msqrt:u(`msqrt`),mroot:u(`mroot`),mrow:u(`mrow`),mfrac:u(`mfrac`),msup:u(`msup`),msub:u(`msub`),msubsup:u(`msubsup`),munder:u(`munder`),mover:u(`mover`),munderover:u(`munderover`),mmultiscripts:u(`mmultiscripts`),mtable:u(`mtable`),mtr:u(`mtr`),mtd:u(`mtd`),ms:u(`ms`),mphantom:u(`mphantom`),annotation:u(`annotation`),"annotation-xml":u(`annotation-xml`),mprescripts:u(`mprescripts`),maction:u(`maction`),mi:u(`mi`),mn:u(`mn`),mo:u(`mo`),mpadded:u(`mpadded`),semantics:u(`semantics`)},m={svg:d(`svg`,new Set([`width`,`height`,`xmlns`,`version`])),defs:d(`defs`),desc:d(`desc`),title:d(`title`),metadata:d(`metadata`),g:d(`g`),a:d(`a`),circle:d(`circle`,new Set([`cx`,`cy`,`r`])),ellipse:d(`ellipse`),line:d(`line`),path:d(`path`,new Set([`d`,`pathLength`])),polygon:d(`polygon`),polyline:d(`polyline`),rect:d(`rect`,new Set([`x`,`y`,`width`,`height`,`rx`,`ry`])),use:d(`use`),stop:d(`stop`),tspan:d(`tspan`),text:d(`text`,new Set([`x`,`y`,`fontSize`,`textAnchor`,`fontWeight`])),image:d(`image`),clipPath:d(`clipPath`),linearGradient:d(`linearGradient`),radialGradient:d(`radialGradient`),mask:d(`mask`),pattern:d(`pattern`),marker:d(`marker`),symbol:d(`symbol`),view:d(`view`),animateMotion:d(`animateMotion`),animateTransform:d(`animateTransform`),filter:d(`filter`),style:d(`style`),script:d(`script`),animate:d(`animate`),set:d(`set`),mpath:d(`mpath`),foreignObject:d(`foreignObject`),textPath:d(`textPath`),feBlend:d(`feBlend`),feColorMatrix:d(`feColorMatrix`),feComponentTransfer:d(`feComponentTransfer`),feComposite:d(`feComposite`),feConvolveMatrix:d(`feConvolveMatrix`),feDiffuseLighting:d(`feDiffuseLighting`),feDisplacementMap:d(`feDisplacementMap`),feFlood:d(`feFlood`),feGaussianBlur:d(`feGaussianBlur`),feImage:d(`feImage`),feMerge:d(`feMerge`),feMorphology:d(`feMorphology`),feOffset:d(`feOffset`),feSpecularLighting:d(`feSpecularLighting`),feTile:d(`feTile`),feTurbulence:d(`feTurbulence`),feDistantLight:d(`feDistantLight`),fePointLight:d(`fePointLight`),feSpotLight:d(`feSpotLight`),feFuncR:d(`feFuncR`),feFuncG:d(`feFuncG`),feFuncB:d(`feFuncB`),feFuncA:d(`feFuncA`),feDropShadow:d(`feDropShadow`),feMergeNode:d(`feMergeNode`),switch:d(`switch`)},h=f,g=p,_=m,v={...f,...p,...m};exports.$AllEl=v,exports.$El=h,exports.$MathEl=g,exports.$SvgEl=_,exports.htmlElements=f,exports.mathmlElements=p,exports.svgElements=m;
|
2
2
|
//# sourceMappingURL=basic.cjs.js.map
|
package/dist/basic.cjs.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"basic.cjs.js","names":["style: Style","content: unknown","tag: K","addPropsType?: Set<keyof Add>","props?: BasicHtmlProps<K, Add>","content?: unknown","_props?: BasicMathMLProps<K, Add>","_props?: BasicSVGProps<K, Add>","children?: renderFnOrArrayType","c?: renderFnOrArrayType","props?: BasicMathMLProps<K, Add>","props?: BasicSVGProps<K, Add>"],"sources":["../src/components/Basic/mod.ts"],"sourcesContent":["import { html, render, type TemplateResult } from \"lit\";\nimport { StyleInfo, styleMap } from \"lit/directives/style-map.js\";\nimport {\n\tcreateEventBinder,\n\tOnEvent,\n\trenderFnOrArray,\n\trenderFnOrArrayOrCurry,\n\trenderFnOrArrayType,\n} from \"../../core\";\n\ntype HTMLEl =\n\t| HTMLElementTagNameMap\n\t| HTMLElementDeprecatedTagNameMap\n\t| SVGElementTagNameMap\n\t| MathMLElementTagNameMap;\n\ntype Style = string | Readonly<StyleInfo>;\n\nfunction createStyle(style: Style) {\n\tif (typeof style === \"string\") {\n\t\treturn style;\n\t} else {\n\t\treturn styleMap(style).toString();\n\t}\n}\n\nstyleMap;\nexport type BasicHtmlProps<_T extends keyof HTMLElementTagNameMap, AddPorps> = {\n\tclassName?: string;\n\tid?: string;\n\tkey?: string | number;\n\tstyle?: Style;\n\ton?: OnEvent;\n\ttitle?: string;\n\thidden?: boolean;\n\tdraggable?: boolean;\n\tlang?: string;\n\tdir?: string;\n\taccessKey?: string;\n\ttabIndex?: number;\n\tcontentEditable?: boolean;\n\tspellcheck?: boolean;\n\tdataset?: DOMStringMap;\n\trole?: string;\n\tariaLabel?: string;\n\tariaDescribedBy?: string;\n\tariaHidden?: string;\n\tinjectFields?: (ref: HTMLElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type BasicSVGProps<_T extends keyof SVGElementTagNameMap, AddPorps> = {\n\tclassName?: string;\n\tkey?: string | number;\n\tid?: string;\n\tstyle?: Style;\n\ton?: OnEvent;\n\t// SVG 特有属性\n\tfill?: string;\n\tstroke?: string;\n\tstrokeWidth?: number;\n\tviewBox?: string;\n\t// 通用SVG属性\n\ttransform?: string;\n\topacity?: number;\n\n\t// 插入字段\n\tinjectFields?: (ref: SVGElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type BasicMathMLProps<\n\t_T extends keyof MathMLElementTagNameMap,\n\tAddPorps\n> = {\n\tclassName?: string;\n\tkey?: string | number;\n\tid?: string;\n\tstyle?: Style;\n\ton?: OnEvent;\n\t// MathML 特有属性\n\tdisplay?: \"block\" | \"inline\";\n\tmathbackground?: string;\n\tmathcolor?: string;\n\t// 插入字段\n\tinjectFields?: (ref: MathMLElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type Props<_T extends keyof HTMLEl, AddPorps> =\n\t| BasicHtmlProps<_T, AddPorps>\n\t| BasicSVGProps<_T, AddPorps>\n\t| BasicMathMLProps<_T, AddPorps>;\n\ntype ElementFunction<\n\t_T extends keyof _F,\n\t_F extends HTMLEl,\n\t_P extends Props<_T extends keyof HTMLEl ? _T : never, AddPorps>,\n\tAddPorps\n> = {\n\t(props?: _P): (\n\t\tchildren?: renderFnOrArrayType | string | number\n\t) => TemplateResult<1>;\n\t(\n\t\tprops?: _P,\n\t\tchildren?: renderFnOrArrayType | string | number\n\t): TemplateResult<1>;\n};\n\nconst isLitTemplate = (content: unknown) => {\n\treturn (\n\t\tcontent !== null && typeof content === \"object\" && \"_$litType$\" in content\n\t);\n};\n\n// 创建一个HTML元素渲染函数工厂\nfunction createElementRenderer<K extends keyof HTMLElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n) {\n\treturn (props?: BasicHtmlProps<K, Add>, content?: unknown) => {\n\t\tconst _props = (props ?? {}) as BasicHtmlProps<K, Add>;\n\t\tconst element = document.createElement(tag);\n\t\tconst binder = createEventBinder(_props?.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\t\t// 应用所有属性\n\t\t_props.className && (element.className = _props.className);\n\t\t_props.id && (element.id = _props.id);\n\t\t_props.style && (element.style.cssText = createStyle(_props.style));\n\t\t_props.title && (element.title = _props.title);\n\t\t_props.lang && (element.lang = _props.lang);\n\t\t_props.dir && (element.dir = _props.dir);\n\t\t_props.role && (element.role = _props.role);\n\t\t_props.ariaLabel && (element.ariaLabel = _props.ariaLabel);\n\t\t_props.ariaHidden && (element.ariaHidden = _props.ariaHidden);\n\t\t_props.key && element.setAttribute(\"data-key\", _props.key.toString());\n\t\tadd.forEach((key) => {\n\t\t\tif (_props[key]) {\n\t\t\t\t(element as any)[key] = _props[key];\n\t\t\t}\n\t\t});\n\n\t\t// 设置布尔属性\n\t\tif (_props.hidden !== undefined) element.hidden = _props.hidden;\n\t\tif (_props.draggable !== undefined) element.draggable = _props.draggable;\n\t\tif (_props.contentEditable !== undefined)\n\t\t\telement.contentEditable = _props.contentEditable.toString();\n\t\tif (_props.spellcheck !== undefined) element.spellcheck = _props.spellcheck;\n\t\tif (_props.tabIndex !== undefined) element.tabIndex = _props.tabIndex;\n\n\t\t// 设置dataset\n\t\t_props.dataset &&\n\t\t\tObject.entries(_props.dataset).forEach(([key, value]) => {\n\t\t\t\telement.dataset[key] = value;\n\t\t\t});\n\n\t\t// 绑定事件\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\trender(content, element);\n\n\t\t// 创建一个包装节点,用于管理生命周期\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as HTMLElement}`;\n\t};\n}\n\nfunction createMathMLElementRenderer<\n\tK extends keyof MathMLElementTagNameMap,\n\tAdd\n>(tag: K, addPropsType?: Set<keyof Add>) {\n\treturn (_props?: BasicMathMLProps<K, Add>, content?: unknown) => {\n\t\tconst props = _props ?? ({} as BasicMathMLProps<K, Add>);\n\t\tconst element = document.createElementNS(\n\t\t\t\"http://www.w3.org/1998/Math/MathML\",\n\t\t\ttag\n\t\t);\n\t\tconst binder = createEventBinder(props.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\t\t// 应用属性\n\t\tprops.className && (element.className = props.className);\n\t\tprops.id && (element.id = props.id);\n\t\tprops.style && (element.style.cssText = createStyle(props.style));\n\t\tprops.display && element.setAttribute(\"display\", props.display);\n\t\tprops.key && element.setAttribute(\"data-key\", props.key.toString());\n\t\tprops.mathbackground &&\n\t\t\telement.setAttribute(\"mathbackground\", props.mathbackground);\n\t\tprops.mathcolor && element.setAttribute(\"mathcolor\", props.mathcolor);\n\t\tadd.forEach((key) => {\n\t\t\tif (props[key]) {\n\t\t\t\t(element as any)[key] = props[key];\n\t\t\t}\n\t\t});\n\n\t\t// 绑定事件和注入字段\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\tif (\n\t\t\tcontent !== null &&\n\t\t\ttypeof content === \"object\" &&\n\t\t\t\"_$litType$\" in content\n\t\t) {\n\t\t\trender(content as TemplateResult<1>, element as HTMLElement);\n\t\t} else {\n\t\t\telement.textContent = `${content ?? \"\"}`;\n\t\t}\n\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as MathMLElement}`;\n\t};\n}\n\nfunction createSVGElementRenderer<K extends keyof SVGElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n) {\n\treturn (_props?: BasicSVGProps<K, Add>, content?: unknown) => {\n\t\tconst props = _props ?? ({} as BasicSVGProps<K, Add>);\n\t\tconst element = document.createElementNS(\"http://www.w3.org/2000/svg\", tag);\n\t\tconst binder = createEventBinder(props.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\n\t\t// 应用SVG属性\n\t\tprops.className && element.setAttribute(\"class\", props.className);\n\t\tprops.id && (element.id = props.id);\n\t\tprops.style && (element.style.cssText = createStyle(props.style));\n\t\tprops.fill && element.setAttribute(\"fill\", props.fill);\n\t\tprops.stroke && element.setAttribute(\"stroke\", props.stroke);\n\t\tprops.key && element.setAttribute(\"data-key\", props.key.toString());\n\t\tprops.strokeWidth &&\n\t\t\telement.setAttribute(\"stroke-width\", props.strokeWidth.toString());\n\t\tprops.viewBox && element.setAttribute(\"viewBox\", props.viewBox);\n\t\tprops.transform && element.setAttribute(\"transform\", props.transform);\n\t\tprops.opacity !== undefined &&\n\t\t\telement.setAttribute(\"opacity\", props.opacity.toString());\n\t\tadd.forEach((key) => {\n\t\t\tif (props[key]) {\n\t\t\t\tconst value = props[key];\n\t\t\t\tif (typeof value === \"function\") {\n\t\t\t\t\t(element as any)[key] = value;\n\t\t\t\t} else {\n\t\t\t\t\t// 将驼峰式属性名转换为短横线式\n\t\t\t\t\tconst attributeName = key\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.replace(/([A-Z])/g, \"-$1\")\n\t\t\t\t\t\t.toLowerCase();\n\t\t\t\t\telement.setAttribute(attributeName, value.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// 绑定事件\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\tif (\n\t\t\t(content !== null &&\n\t\t\t\ttypeof content === \"object\" &&\n\t\t\t\t\"_$litType$\" in content) ||\n\t\t\t(Array.isArray(content) &&\n\t\t\t\tcontent.length > 0 &&\n\t\t\t\ttypeof content[0] === \"object\" &&\n\t\t\t\t\"_$litType$\" in content[0])\n\t\t) {\n\t\t\trender(content as TemplateResult<1>, element as unknown as HTMLElement);\n\t\t} else {\n\t\t\tconsole.log(\"content\", content);\n\t\t\telement.textContent = `${content ?? \"\"}`;\n\t\t}\n\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as SVGElement}`;\n\t};\n}\n\n// 元素注册函数\nfunction registerHtmlElement<K extends keyof HTMLElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, HTMLElementTagNameMap, BasicHtmlProps<K, Add>, Add> {\n\tconst renderer = createElementRenderer(tag, addPropsType);\n\treturn ((props?: BasicHtmlProps<K, Add>, children?: renderFnOrArrayType) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<K, HTMLElementTagNameMap, BasicHtmlProps<K, Add>, Add>;\n}\n\nfunction registerMathMLElement<\n\tK extends keyof MathMLElementTagNameMap,\n\tAdd = {}\n>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, MathMLElementTagNameMap, BasicMathMLProps<K, Add>, Add> {\n\tconst renderer = createMathMLElementRenderer(tag, addPropsType);\n\treturn ((\n\t\tprops?: BasicMathMLProps<K, Add>,\n\t\tchildren?: renderFnOrArrayType\n\t) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<\n\t\tK,\n\t\tMathMLElementTagNameMap,\n\t\tBasicMathMLProps<K, Add>,\n\t\tAdd\n\t>;\n}\n\nfunction registerSVGElement<K extends keyof SVGElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, SVGElementTagNameMap, BasicSVGProps<K, Add>, Add> {\n\tconst renderer = createSVGElementRenderer(tag, addPropsType);\n\treturn ((props?: BasicSVGProps<K, Add>, children?: renderFnOrArrayType) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<K, SVGElementTagNameMap, BasicSVGProps<K, Add>, Add>;\n}\n\n// 定义所有HTML元素映射\n\ntype FromAddProps = {\n\tmethod?: string;\n\taction?: string;\n\tenctype?: string;\n\ttarget?: string;\n\tnovalidate?: boolean;\n};\ntype InputAddProps = {\n\ttype?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\tmaxLength?: number;\n\tminLength?: number;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\treadonly?: boolean;\n\tchecked?: boolean;\n\tname?: string;\n};\n\ntype TextareaAddProps = {\n\trows?: number;\n\tcols?: number;\n\twrap?: string;\n\tmaxLength?: number;\n\tminLength?: number;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\treadonly?: boolean;\n\tname?: string;\n};\n\ntype SelectAddProps = {\n\tmultiple?: boolean;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\tname?: string;\n\tsize?: number;\n};\n\ntype AAddProps = {\n\thref?: string;\n\ttarget?: string;\n\trel?: string;\n\tdownload?: string;\n\ttype?: string;\n};\n\ntype ImgAddProps = {\n\tsrc?: string;\n\talt?: string;\n\twidth?: number | string;\n\theight?: number | string;\n\tloading?: \"lazy\" | \"eager\";\n\tdecoding?: \"sync\" | \"async\" | \"auto\";\n};\n\nexport const htmlElements = {\n\tdiv: registerHtmlElement(\"div\"),\n\tp: registerHtmlElement(\"p\"),\n\tspan: registerHtmlElement(\"span\"),\n\th1: registerHtmlElement(\"h1\"),\n\th2: registerHtmlElement(\"h2\"),\n\th3: registerHtmlElement(\"h3\"),\n\th4: registerHtmlElement(\"h4\"),\n\th5: registerHtmlElement(\"h5\"),\n\th6: registerHtmlElement(\"h6\"),\n\tarticle: registerHtmlElement(\"article\"),\n\tsection: registerHtmlElement(\"section\"),\n\tnav: registerHtmlElement(\"nav\"),\n\taside: registerHtmlElement(\"aside\"),\n\theader: registerHtmlElement(\"header\"),\n\tfooter: registerHtmlElement(\"footer\"),\n\tmain: registerHtmlElement(\"main\"),\n\tul: registerHtmlElement(\"ul\"),\n\tol: registerHtmlElement(\"ol\"),\n\tli: registerHtmlElement(\"li\"),\n\tdl: registerHtmlElement(\"dl\"),\n\tdt: registerHtmlElement(\"dt\"),\n\tdd: registerHtmlElement(\"dd\"),\n\tform: registerHtmlElement<\"form\", FromAddProps>(\n\t\t\"form\",\n\t\tnew Set([\"method\", \"action\", \"enctype\", \"target\", \"novalidate\"])\n\t),\n\tlabel: registerHtmlElement(\"label\"),\n\tinput: registerHtmlElement<\"input\", InputAddProps>(\"input\"),\n\ttextarea: registerHtmlElement<\"textarea\", TextareaAddProps>(\n\t\t\"textarea\",\n\t\tnew Set([\n\t\t\t\"cols\",\n\t\t\t\"rows\",\n\t\t\t\"wrap\",\n\t\t\t\"maxLength\",\n\t\t\t\"minLength\",\n\t\t\t\"required\",\n\t\t\t\"disabled\",\n\t\t\t\"readonly\",\n\t\t\t\"name\",\n\t\t])\n\t),\n\tbutton: registerHtmlElement(\"button\"),\n\tselect: registerHtmlElement<\"select\", SelectAddProps>(\n\t\t\"select\",\n\t\tnew Set([\"multiple\", \"required\", \"disabled\", \"name\", \"size\"])\n\t),\n\toption: registerHtmlElement(\"option\"),\n\ttable: registerHtmlElement(\"table\"),\n\tthead: registerHtmlElement(\"thead\"),\n\ttbody: registerHtmlElement(\"tbody\"),\n\ttfoot: registerHtmlElement(\"tfoot\"),\n\ttr: registerHtmlElement(\"tr\"),\n\tth: registerHtmlElement(\"th\"),\n\ttd: registerHtmlElement(\"td\"),\n\ta: registerHtmlElement<\"a\", AAddProps>(\n\t\t\"a\",\n\t\tnew Set([\"href\", \"target\", \"rel\", \"download\", \"type\"])\n\t),\n\timg: registerHtmlElement<\"img\", ImgAddProps>(\n\t\t\"img\",\n\t\tnew Set([\"src\", \"alt\", \"width\", \"height\", \"loading\", \"decoding\"])\n\t),\n\tiframe: registerHtmlElement(\"iframe\"),\n\tembed: registerHtmlElement(\"embed\"),\n\tobject: registerHtmlElement(\"object\"),\n\tvideo: registerHtmlElement(\"video\"),\n\taudio: registerHtmlElement(\"audio\"),\n\tsource: registerHtmlElement(\"source\"),\n\ttrack: registerHtmlElement(\"track\"),\n\tcanvas: registerHtmlElement(\"canvas\"),\n\tmap: registerHtmlElement(\"map\"),\n\tarea: registerHtmlElement(\"area\"),\n\tsummary: registerHtmlElement(\"summary\"),\n\tdetails: registerHtmlElement(\"details\"),\n\tslot: registerHtmlElement(\"slot\"),\n\ttemplate: registerHtmlElement(\"template\"),\n\tstyle: registerHtmlElement(\"style\"),\n\tscript: registerHtmlElement(\"script\"),\n\tlink: registerHtmlElement(\"link\"),\n\tmeta: registerHtmlElement(\"meta\"),\n\ttitle: registerHtmlElement(\"title\"),\n\tbase: registerHtmlElement(\"base\"),\n\thead: registerHtmlElement(\"head\"),\n\tbody: registerHtmlElement(\"body\"),\n\thtml: registerHtmlElement(\"html\"),\n\tabbr: registerHtmlElement(\"abbr\"),\n\tb: registerHtmlElement(\"b\"),\n\tbdi: registerHtmlElement(\"bdi\"),\n\tbdo: registerHtmlElement(\"bdo\"),\n\tblockquote: registerHtmlElement(\"blockquote\"),\n\tbr: registerHtmlElement(\"br\"),\n\tcaption: registerHtmlElement(\"caption\"),\n\tcite: registerHtmlElement(\"cite\"),\n\tcode: registerHtmlElement(\"code\"),\n\tcol: registerHtmlElement(\"col\"),\n\tcolgroup: registerHtmlElement(\"colgroup\"),\n\tdata: registerHtmlElement(\"data\"),\n\tdel: registerHtmlElement(\"del\"),\n\tdfn: registerHtmlElement(\"dfn\"),\n\tem: registerHtmlElement(\"em\"),\n\ti: registerHtmlElement(\"i\"),\n\tkbd: registerHtmlElement(\"kbd\"),\n\tmark: registerHtmlElement(\"mark\"),\n\tq: registerHtmlElement(\"q\"),\n\trp: registerHtmlElement(\"rp\"),\n\trt: registerHtmlElement(\"rt\"),\n\truby: registerHtmlElement(\"ruby\"),\n\ts: registerHtmlElement(\"s\"),\n\tsamp: registerHtmlElement(\"samp\"),\n\tsmall: registerHtmlElement(\"small\"),\n\tstrong: registerHtmlElement(\"strong\"),\n\tsub: registerHtmlElement(\"sub\"),\n\tsup: registerHtmlElement(\"sup\"),\n\ttime: registerHtmlElement(\"time\"),\n\tu: registerHtmlElement(\"u\"),\n\tvar: registerHtmlElement(\"var\"),\n\taddress: registerHtmlElement(\"address\"),\n\tprogress: registerHtmlElement(\"progress\"),\n\tmeter: registerHtmlElement(\"meter\"),\n\toutput: registerHtmlElement(\"output\"),\n\tdatalist: registerHtmlElement(\"datalist\"),\n\tdialog: registerHtmlElement(\"dialog\"),\n\tmenu: registerHtmlElement(\"menu\"),\n\tfieldset: registerHtmlElement(\"fieldset\"),\n\tlegend: registerHtmlElement(\"legend\"),\n\tfigcaption: registerHtmlElement(\"figcaption\"),\n\tfigure: registerHtmlElement(\"figure\"),\n\thgroup: registerHtmlElement(\"hgroup\"),\n\thr: registerHtmlElement(\"hr\"),\n\tins: registerHtmlElement(\"ins\"),\n\tnoscript: registerHtmlElement(\"noscript\"),\n\toptgroup: registerHtmlElement(\"optgroup\"),\n\tpicture: registerHtmlElement(\"picture\"),\n\tpre: registerHtmlElement(\"pre\"),\n\tsearch: registerHtmlElement(\"search\"),\n\twbr: registerHtmlElement(\"wbr\"),\n} as const;\n\nexport const mathmlElements = {\n\tmath: registerMathMLElement(\"math\"),\n\tmstyle: registerMathMLElement(\"mstyle\"),\n\tmerror: registerMathMLElement(\"merror\"),\n\tmtext: registerMathMLElement(\"mtext\"),\n\tmspace: registerMathMLElement(\"mspace\"),\n\tmsqrt: registerMathMLElement(\"msqrt\"),\n\tmroot: registerMathMLElement(\"mroot\"),\n\tmrow: registerMathMLElement(\"mrow\"),\n\tmfrac: registerMathMLElement(\"mfrac\"),\n\tmsup: registerMathMLElement(\"msup\"),\n\tmsub: registerMathMLElement(\"msub\"),\n\tmsubsup: registerMathMLElement(\"msubsup\"),\n\tmunder: registerMathMLElement(\"munder\"),\n\tmover: registerMathMLElement(\"mover\"),\n\tmunderover: registerMathMLElement(\"munderover\"),\n\tmmultiscripts: registerMathMLElement(\"mmultiscripts\"),\n\tmtable: registerMathMLElement(\"mtable\"),\n\tmtr: registerMathMLElement(\"mtr\"),\n\tmtd: registerMathMLElement(\"mtd\"),\n\tms: registerMathMLElement(\"ms\"),\n\tmphantom: registerMathMLElement(\"mphantom\"),\n\tannotation: registerMathMLElement(\"annotation\"),\n\t\"annotation-xml\": registerMathMLElement(\"annotation-xml\"),\n\tmprescripts: registerMathMLElement(\"mprescripts\"),\n\tmaction: registerMathMLElement(\"maction\"),\n\tmi: registerMathMLElement(\"mi\"),\n\tmn: registerMathMLElement(\"mn\"),\n\tmo: registerMathMLElement(\"mo\"),\n\tmpadded: registerMathMLElement(\"mpadded\"),\n\tsemantics: registerMathMLElement(\"semantics\"),\n};\n\ntype SvgAddProps = {\n\twidth?: number | string;\n\theight?: number | string;\n\txmlns?: string;\n\tversion?: string;\n};\n\ntype CircleAddProps = {\n\tcx?: number | string;\n\tcy?: number | string;\n\tr?: number | string;\n};\n\ntype PathAddProps = {\n\td?: string;\n\tpathLength?: number;\n};\n\ntype RectAddProps = {\n\tx?: number | string;\n\ty?: number | string;\n\twidth?: number | string;\n\theight?: number | string;\n\trx?: number | string;\n\try?: number | string;\n};\n\ntype TextAddProps = {\n\tx?: number | string;\n\ty?: number | string;\n\tfontSize?: number | string;\n\ttextAnchor?: \"start\" | \"middle\" | \"end\" | \"inherit\";\n\tfontWeight?: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | \"inherit\";\n};\n\nexport const svgElements = {\n\tsvg: registerSVGElement<\"svg\", SvgAddProps>(\n\t\t\"svg\",\n\t\tnew Set([\"width\", \"height\", \"xmlns\", \"version\"])\n\t),\n\tdefs: registerSVGElement(\"defs\"),\n\tdesc: registerSVGElement(\"desc\"),\n\ttitle: registerSVGElement(\"title\"),\n\tmetadata: registerSVGElement(\"metadata\"),\n\tg: registerSVGElement(\"g\"),\n\ta: registerSVGElement(\"a\"),\n\tcircle: registerSVGElement<\"circle\", CircleAddProps>(\n\t\t\"circle\",\n\t\tnew Set([\"cx\", \"cy\", \"r\"])\n\t),\n\tellipse: registerSVGElement(\"ellipse\"),\n\tline: registerSVGElement(\"line\"),\n\tpath: registerSVGElement<\"path\", PathAddProps>(\n\t\t\"path\",\n\t\tnew Set([\"d\", \"pathLength\"])\n\t),\n\tpolygon: registerSVGElement(\"polygon\"),\n\tpolyline: registerSVGElement(\"polyline\"),\n\trect: registerSVGElement<\"rect\", RectAddProps>(\n\t\t\"rect\",\n\t\tnew Set([\"x\", \"y\", \"width\", \"height\", \"rx\", \"ry\"])\n\t),\n\tuse: registerSVGElement(\"use\"),\n\tstop: registerSVGElement(\"stop\"),\n\ttspan: registerSVGElement(\"tspan\"),\n\ttext: registerSVGElement<\"text\", TextAddProps>(\n\t\t\"text\",\n\t\tnew Set([\"x\", \"y\", \"fontSize\", \"textAnchor\", \"fontWeight\"])\n\t),\n\timage: registerSVGElement(\"image\"),\n\tclipPath: registerSVGElement(\"clipPath\"),\n\tlinearGradient: registerSVGElement(\"linearGradient\"),\n\tradialGradient: registerSVGElement(\"radialGradient\"),\n\tmask: registerSVGElement(\"mask\"),\n\tpattern: registerSVGElement(\"pattern\"),\n\tmarker: registerSVGElement(\"marker\"),\n\tsymbol: registerSVGElement(\"symbol\"),\n\tview: registerSVGElement(\"view\"),\n\tanimateMotion: registerSVGElement(\"animateMotion\"),\n\tanimateTransform: registerSVGElement(\"animateTransform\"),\n\tfilter: registerSVGElement(\"filter\"),\n\tstyle: registerSVGElement(\"style\"),\n\tscript: registerSVGElement(\"script\"),\n\tanimate: registerSVGElement(\"animate\"),\n\tset: registerSVGElement(\"set\"),\n\tmpath: registerSVGElement(\"mpath\"),\n\tforeignObject: registerSVGElement(\"foreignObject\"),\n\ttextPath: registerSVGElement(\"textPath\"),\n\tfeBlend: registerSVGElement(\"feBlend\"),\n\tfeColorMatrix: registerSVGElement(\"feColorMatrix\"),\n\tfeComponentTransfer: registerSVGElement(\"feComponentTransfer\"),\n\tfeComposite: registerSVGElement(\"feComposite\"),\n\tfeConvolveMatrix: registerSVGElement(\"feConvolveMatrix\"),\n\tfeDiffuseLighting: registerSVGElement(\"feDiffuseLighting\"),\n\tfeDisplacementMap: registerSVGElement(\"feDisplacementMap\"),\n\tfeFlood: registerSVGElement(\"feFlood\"),\n\tfeGaussianBlur: registerSVGElement(\"feGaussianBlur\"),\n\tfeImage: registerSVGElement(\"feImage\"),\n\tfeMerge: registerSVGElement(\"feMerge\"),\n\tfeMorphology: registerSVGElement(\"feMorphology\"),\n\tfeOffset: registerSVGElement(\"feOffset\"),\n\tfeSpecularLighting: registerSVGElement(\"feSpecularLighting\"),\n\tfeTile: registerSVGElement(\"feTile\"),\n\tfeTurbulence: registerSVGElement(\"feTurbulence\"),\n\tfeDistantLight: registerSVGElement(\"feDistantLight\"),\n\tfePointLight: registerSVGElement(\"fePointLight\"),\n\tfeSpotLight: registerSVGElement(\"feSpotLight\"),\n\tfeFuncR: registerSVGElement(\"feFuncR\"),\n\tfeFuncG: registerSVGElement(\"feFuncG\"),\n\tfeFuncB: registerSVGElement(\"feFuncB\"),\n\tfeFuncA: registerSVGElement(\"feFuncA\"),\n\tfeDropShadow: registerSVGElement(\"feDropShadow\"),\n\tfeMergeNode: registerSVGElement(\"feMergeNode\"),\n\tswitch: registerSVGElement(\"switch\"),\n};\n\n/**\n * @alias elements\n */\nexport const $El = htmlElements;\n\n/**\n * @alias mathmlElements\n */\nexport const $MathEl = mathmlElements;\n\n/**\n * @alias svgElements\n */\nexport const $SvgEl = svgElements;\n\nexport const $AllEl = {\n\t...htmlElements,\n\t...mathmlElements,\n\t...svgElements,\n};\n"],"mappings":"sHAkBA,SAAS,EAAYA,EAAc,CAIjC,cAHU,GAAU,SACb,EAEA,CAAA,EAAA,EAAA,UAAS,EAAM,CAAC,UAAU,AAElC,CAyFD,SAAS,EACRE,EACAC,EACC,CACD,MAAO,CAACC,EAAgCC,IAAsB,CAK7D,IAJM,EAAU,GAAS,CAAE,EACrB,EAAU,SAAS,cAAc,EAAI,CACrC,EAAS,EAAA,kBAAA,GAA0B,IAAM,CAAE,EAAC,CAC5C,EAAA,GAAsB,eAAiB,AAAC,GAAQ,CAAE,GAClD,EAAM,GAAgB,IAAI,IAqChC,AAnCA,EAAO,YAAc,EAAQ,UAAY,EAAO,WAChD,EAAO,KAAO,EAAQ,GAAK,EAAO,IAClC,EAAO,QAAU,EAAQ,MAAM,QAAU,EAAY,EAAO,MAAM,EAClE,EAAO,QAAU,EAAQ,MAAQ,EAAO,OACxC,EAAO,OAAS,EAAQ,KAAO,EAAO,MACtC,EAAO,MAAQ,EAAQ,IAAM,EAAO,KACpC,EAAO,OAAS,EAAQ,KAAO,EAAO,MACtC,EAAO,YAAc,EAAQ,UAAY,EAAO,WAChD,EAAO,aAAe,EAAQ,WAAa,EAAO,YAClD,EAAO,KAAO,EAAQ,aAAa,WAAY,EAAO,IAAI,UAAU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C,aAAc,EAAmB,eAAe,CAChD,YAAa,EAAmB,cAAc,CAC9C,OAAQ,EAAmB,SAAS,AACpC,EAKY,EAAM,EAKN,EAAU,EAKV,EAAS,EAET,EAAS,CACrB,GAAG,EACH,GAAG,EACH,GAAG,CACH"}
|
1
|
+
{"version":3,"file":"basic.cjs.js","names":["obj: T","fn: (it: T) => void","style: Style","content: unknown","tag: K","addPropsType?: Set<keyof Add>","props?: BasicHtmlProps<K, Add>","content?: unknown","_props?: BasicMathMLProps<K, Add>","_props?: BasicSVGProps<K, Add>","children?: renderFnOrArrayType","c?: renderFnOrArrayType","props?: BasicMathMLProps<K, Add>","props?: BasicSVGProps<K, Add>"],"sources":["../src/components/Basic/utils.ts","../src/components/Basic/mod.ts"],"sourcesContent":["export function initWith<T>(obj: T) {\n\treturn {\n\t\tlet(fn: (it: T) => void): T {\n\t\t\tfn(obj);\n\t\t\treturn obj;\n\t\t},\n\t};\n}\n\n/**\n * @alias initWith\n */\nexport const iw = initWith;\n","import { html, render, type TemplateResult } from \"lit\";\nimport { StyleInfo, styleMap } from \"lit/directives/style-map.js\";\nimport {\n\tcreateEventBinder,\n\tOnEvent,\n\trenderFnOrArray,\n\trenderFnOrArrayOrCurry,\n\trenderFnOrArrayType,\n} from \"../../core\";\nimport { iw } from \"./utils\";\n\ntype HTMLEl =\n\t| HTMLElementTagNameMap\n\t| HTMLElementDeprecatedTagNameMap\n\t| SVGElementTagNameMap\n\t| MathMLElementTagNameMap;\n\ntype Style = string | Readonly<StyleInfo>;\n\nfunction createStyle(style: Style) {\n\tif (typeof style === \"string\") {\n\t\treturn style;\n\t} else {\n\t\treturn styleMap(style).toString();\n\t}\n}\n\nstyleMap;\nexport type BasicHtmlProps<_T extends keyof HTMLElementTagNameMap, AddPorps> = {\n\tclassName?: string;\n\tid?: string;\n\tkey?: string | number;\n\tstyle?: Style;\n\ton?: OnEvent;\n\ttitle?: string;\n\thidden?: boolean;\n\tdraggable?: boolean;\n\tlang?: string;\n\tdir?: string;\n\taccessKey?: string;\n\ttabIndex?: number;\n\tcontentEditable?: boolean;\n\tspellcheck?: boolean;\n\tdataset?: DOMStringMap;\n\trole?: string;\n\tariaLabel?: string;\n\tariaDescribedBy?: string;\n\tariaHidden?: string;\n\tinjectFields?: (ref: HTMLElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type BasicSVGProps<_T extends keyof SVGElementTagNameMap, AddPorps> = {\n\tclassName?: string;\n\tkey?: string | number;\n\tid?: string;\n\tstyle?: Style;\n\ton?: OnEvent;\n\t// SVG 特有属性\n\tfill?: string;\n\tstroke?: string;\n\tstrokeWidth?: number;\n\tviewBox?: string;\n\t// 通用SVG属性\n\ttransform?: string;\n\topacity?: number;\n\n\t// 插入字段\n\tinjectFields?: (ref: SVGElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type BasicMathMLProps<\n\t_T extends keyof MathMLElementTagNameMap,\n\tAddPorps\n> = {\n\tclassName?: string;\n\tkey?: string | number;\n\tid?: string;\n\tstyle?: Style;\n\ton?: OnEvent;\n\t// MathML 特有属性\n\tdisplay?: \"block\" | \"inline\";\n\tmathbackground?: string;\n\tmathcolor?: string;\n\t// 插入字段\n\tinjectFields?: (ref: MathMLElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type Props<_T extends keyof HTMLEl, AddPorps> =\n\t| BasicHtmlProps<_T, AddPorps>\n\t| BasicSVGProps<_T, AddPorps>\n\t| BasicMathMLProps<_T, AddPorps>;\n\ntype ElementFunction<\n\t_T extends keyof _F,\n\t_F extends HTMLEl,\n\t_P extends Props<_T extends keyof HTMLEl ? _T : never, AddPorps>,\n\tAddPorps\n> = {\n\t(props?: _P): (\n\t\tchildren?: renderFnOrArrayType | string | number\n\t) => TemplateResult<1>;\n\t(\n\t\tprops?: _P,\n\t\tchildren?: renderFnOrArrayType | string | number\n\t): TemplateResult<1>;\n};\n\nconst isLitTemplate = (content: unknown) => {\n\treturn (\n\t\tcontent !== null && typeof content === \"object\" && \"_$litType$\" in content\n\t);\n};\n\n// 创建一个HTML元素渲染函数工厂\nfunction createElementRenderer<K extends keyof HTMLElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n) {\n\treturn (props?: BasicHtmlProps<K, Add>, content?: unknown) => {\n\t\tconst _props = (props ?? {}) as BasicHtmlProps<K, Add>;\n\t\tconst binder = createEventBinder(_props?.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\t\tconst element = iw(document.createElement(tag)).let((it) => {\n\t\t\t_props.className && (it.className = _props.className);\n\t\t\t_props.id && (it.id = _props.id);\n\t\t\t_props.style && (it.style.cssText = createStyle(_props.style));\n\t\t\t_props.title && (it.title = _props.title);\n\t\t\t_props.lang && (it.lang = _props.lang);\n\t\t\t_props.dir && (it.dir = _props.dir);\n\t\t\t_props.role && (it.role = _props.role);\n\t\t\t_props.ariaLabel && (it.ariaLabel = _props.ariaLabel);\n\t\t\t_props.ariaHidden && (it.ariaHidden = _props.ariaHidden);\n\t\t\t_props.key && it.setAttribute(\"data-key\", _props.key.toString());\n\t\t});\n\t\tadd.forEach((key) => {\n\t\t\tif (_props[key]) {\n\t\t\t\t(element as any)[key] = _props[key];\n\t\t\t}\n\t\t});\n\n\t\t// 设置布尔属性\n\t\tif (_props.hidden !== undefined) element.hidden = _props.hidden;\n\t\tif (_props.draggable !== undefined) element.draggable = _props.draggable;\n\t\tif (_props.contentEditable !== undefined)\n\t\t\telement.contentEditable = _props.contentEditable.toString();\n\t\tif (_props.spellcheck !== undefined) element.spellcheck = _props.spellcheck;\n\t\tif (_props.tabIndex !== undefined) element.tabIndex = _props.tabIndex;\n\n\t\t// 设置dataset\n\t\t_props.dataset &&\n\t\t\tObject.entries(_props.dataset).forEach(([key, value]) => {\n\t\t\t\telement.dataset[key] = value;\n\t\t\t});\n\n\t\t// 绑定事件\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\trender(content, element);\n\n\t\t// 创建一个包装节点,用于管理生命周期\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as HTMLElement}`;\n\t};\n}\n\nfunction createMathMLElementRenderer<\n\tK extends keyof MathMLElementTagNameMap,\n\tAdd\n>(tag: K, addPropsType?: Set<keyof Add>) {\n\treturn (_props?: BasicMathMLProps<K, Add>, content?: unknown) => {\n\t\tconst props = _props ?? ({} as BasicMathMLProps<K, Add>);\n\n\t\tconst binder = createEventBinder(props.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\t\t// 应用属性\n\t\tconst element = iw(\n\t\t\tdocument.createElementNS(\"http://www.w3.org/1998/Math/MathML\", tag)\n\t\t).let((it) => {\n\t\t\tprops.className && (it.className = props.className);\n\t\t\tprops.id && (it.id = props.id);\n\t\t\tprops.style && (it.style.cssText = createStyle(props.style));\n\t\t\tprops.display && it.setAttribute(\"display\", props.display);\n\t\t\tprops.key && it.setAttribute(\"data-key\", props.key.toString());\n\t\t\tprops.mathbackground &&\n\t\t\t\tit.setAttribute(\"mathbackground\", props.mathbackground);\n\t\t\tprops.mathcolor && it.setAttribute(\"mathcolor\", props.mathcolor);\n\t\t});\n\n\t\tadd.forEach((key) => {\n\t\t\tif (props[key]) {\n\t\t\t\t(element as any)[key] = props[key];\n\t\t\t}\n\t\t});\n\n\t\t// 绑定事件和注入字段\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\tif (\n\t\t\tcontent !== null &&\n\t\t\ttypeof content === \"object\" &&\n\t\t\t\"_$litType$\" in content\n\t\t) {\n\t\t\trender(content as TemplateResult<1>, element as HTMLElement);\n\t\t} else {\n\t\t\telement.textContent = `${content ?? \"\"}`;\n\t\t}\n\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as MathMLElement}`;\n\t};\n}\n\nfunction createSVGElementRenderer<K extends keyof SVGElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n) {\n\treturn (_props?: BasicSVGProps<K, Add>, content?: unknown) => {\n\t\tconst props = _props ?? ({} as BasicSVGProps<K, Add>);\n\t\tconst binder = createEventBinder(props.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\n\t\tconst element = iw(\n\t\t\tdocument.createElementNS(\"http://www.w3.org/2000/svg\", tag)\n\t\t).let((it) => {\n\t\t\t// 应用SVG属性\n\t\t\tprops.className && it.setAttribute(\"class\", props.className);\n\t\t\tprops.id && (it.id = props.id);\n\t\t\tprops.style && (it.style.cssText = createStyle(props.style));\n\t\t\tprops.fill && it.setAttribute(\"fill\", props.fill);\n\t\t\tprops.stroke && it.setAttribute(\"stroke\", props.stroke);\n\t\t\tprops.key && it.setAttribute(\"data-key\", props.key.toString());\n\t\t\tprops.strokeWidth &&\n\t\t\t\tit.setAttribute(\"stroke-width\", props.strokeWidth.toString());\n\t\t\tprops.viewBox && it.setAttribute(\"viewBox\", props.viewBox);\n\t\t\tprops.transform && it.setAttribute(\"transform\", props.transform);\n\t\t\tprops.opacity !== undefined &&\n\t\t\t\tit.setAttribute(\"opacity\", props.opacity.toString());\n\t\t});\n\n\t\tadd.forEach((key) => {\n\t\t\tif (props[key]) {\n\t\t\t\tconst value = props[key];\n\t\t\t\tif (typeof value === \"function\") {\n\t\t\t\t\t(element as any)[key] = value;\n\t\t\t\t} else {\n\t\t\t\t\t// 将驼峰式属性名转换为短横线式\n\t\t\t\t\tconst attributeName = key\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.replace(/([A-Z])/g, \"-$1\")\n\t\t\t\t\t\t.toLowerCase();\n\t\t\t\t\telement.setAttribute(attributeName, value.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// 绑定事件\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\tif (\n\t\t\t(content !== null &&\n\t\t\t\ttypeof content === \"object\" &&\n\t\t\t\t\"_$litType$\" in content) ||\n\t\t\t(Array.isArray(content) &&\n\t\t\t\tcontent.length > 0 &&\n\t\t\t\ttypeof content[0] === \"object\" &&\n\t\t\t\t\"_$litType$\" in content[0])\n\t\t) {\n\t\t\trender(content as TemplateResult<1>, element as unknown as HTMLElement);\n\t\t} else {\n\t\t\tconsole.log(\"content\", content);\n\t\t\telement.textContent = `${content ?? \"\"}`;\n\t\t}\n\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as SVGElement}`;\n\t};\n}\n\n// 元素注册函数\nfunction registerHtmlElement<K extends keyof HTMLElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, HTMLElementTagNameMap, BasicHtmlProps<K, Add>, Add> {\n\tconst renderer = createElementRenderer(tag, addPropsType);\n\treturn ((props?: BasicHtmlProps<K, Add>, children?: renderFnOrArrayType) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<K, HTMLElementTagNameMap, BasicHtmlProps<K, Add>, Add>;\n}\n\nfunction registerMathMLElement<\n\tK extends keyof MathMLElementTagNameMap,\n\tAdd = {}\n>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, MathMLElementTagNameMap, BasicMathMLProps<K, Add>, Add> {\n\tconst renderer = createMathMLElementRenderer(tag, addPropsType);\n\treturn ((\n\t\tprops?: BasicMathMLProps<K, Add>,\n\t\tchildren?: renderFnOrArrayType\n\t) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<\n\t\tK,\n\t\tMathMLElementTagNameMap,\n\t\tBasicMathMLProps<K, Add>,\n\t\tAdd\n\t>;\n}\n\nfunction registerSVGElement<K extends keyof SVGElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, SVGElementTagNameMap, BasicSVGProps<K, Add>, Add> {\n\tconst renderer = createSVGElementRenderer(tag, addPropsType);\n\treturn ((props?: BasicSVGProps<K, Add>, children?: renderFnOrArrayType) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<K, SVGElementTagNameMap, BasicSVGProps<K, Add>, Add>;\n}\n\n// 定义所有HTML元素映射\n\ntype FromAddProps = {\n\tmethod?: string;\n\taction?: string;\n\tenctype?: string;\n\ttarget?: string;\n\tnovalidate?: boolean;\n};\ntype InputAddProps = {\n\ttype?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\tmaxLength?: number;\n\tminLength?: number;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\treadonly?: boolean;\n\tchecked?: boolean;\n\tname?: string;\n};\n\ntype TextareaAddProps = {\n\trows?: number;\n\tcols?: number;\n\twrap?: string;\n\tmaxLength?: number;\n\tminLength?: number;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\treadonly?: boolean;\n\tname?: string;\n};\n\ntype SelectAddProps = {\n\tmultiple?: boolean;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\tname?: string;\n\tsize?: number;\n};\n\ntype AAddProps = {\n\thref?: string;\n\ttarget?: string;\n\trel?: string;\n\tdownload?: string;\n\ttype?: string;\n};\n\ntype ImgAddProps = {\n\tsrc?: string;\n\talt?: string;\n\twidth?: number | string;\n\theight?: number | string;\n\tloading?: \"lazy\" | \"eager\";\n\tdecoding?: \"sync\" | \"async\" | \"auto\";\n};\n\nexport const htmlElements = {\n\tdiv: registerHtmlElement(\"div\"),\n\tp: registerHtmlElement(\"p\"),\n\tspan: registerHtmlElement(\"span\"),\n\th1: registerHtmlElement(\"h1\"),\n\th2: registerHtmlElement(\"h2\"),\n\th3: registerHtmlElement(\"h3\"),\n\th4: registerHtmlElement(\"h4\"),\n\th5: registerHtmlElement(\"h5\"),\n\th6: registerHtmlElement(\"h6\"),\n\tarticle: registerHtmlElement(\"article\"),\n\tsection: registerHtmlElement(\"section\"),\n\tnav: registerHtmlElement(\"nav\"),\n\taside: registerHtmlElement(\"aside\"),\n\theader: registerHtmlElement(\"header\"),\n\tfooter: registerHtmlElement(\"footer\"),\n\tmain: registerHtmlElement(\"main\"),\n\tul: registerHtmlElement(\"ul\"),\n\tol: registerHtmlElement(\"ol\"),\n\tli: registerHtmlElement(\"li\"),\n\tdl: registerHtmlElement(\"dl\"),\n\tdt: registerHtmlElement(\"dt\"),\n\tdd: registerHtmlElement(\"dd\"),\n\tform: registerHtmlElement<\"form\", FromAddProps>(\n\t\t\"form\",\n\t\tnew Set([\"method\", \"action\", \"enctype\", \"target\", \"novalidate\"])\n\t),\n\tlabel: registerHtmlElement(\"label\"),\n\tinput: registerHtmlElement<\"input\", InputAddProps>(\"input\"),\n\ttextarea: registerHtmlElement<\"textarea\", TextareaAddProps>(\n\t\t\"textarea\",\n\t\tnew Set([\n\t\t\t\"cols\",\n\t\t\t\"rows\",\n\t\t\t\"wrap\",\n\t\t\t\"maxLength\",\n\t\t\t\"minLength\",\n\t\t\t\"required\",\n\t\t\t\"disabled\",\n\t\t\t\"readonly\",\n\t\t\t\"name\",\n\t\t])\n\t),\n\tbutton: registerHtmlElement(\"button\"),\n\tselect: registerHtmlElement<\"select\", SelectAddProps>(\n\t\t\"select\",\n\t\tnew Set([\"multiple\", \"required\", \"disabled\", \"name\", \"size\"])\n\t),\n\toption: registerHtmlElement(\"option\"),\n\ttable: registerHtmlElement(\"table\"),\n\tthead: registerHtmlElement(\"thead\"),\n\ttbody: registerHtmlElement(\"tbody\"),\n\ttfoot: registerHtmlElement(\"tfoot\"),\n\ttr: registerHtmlElement(\"tr\"),\n\tth: registerHtmlElement(\"th\"),\n\ttd: registerHtmlElement(\"td\"),\n\ta: registerHtmlElement<\"a\", AAddProps>(\n\t\t\"a\",\n\t\tnew Set([\"href\", \"target\", \"rel\", \"download\", \"type\"])\n\t),\n\timg: registerHtmlElement<\"img\", ImgAddProps>(\n\t\t\"img\",\n\t\tnew Set([\"src\", \"alt\", \"width\", \"height\", \"loading\", \"decoding\"])\n\t),\n\tiframe: registerHtmlElement(\"iframe\"),\n\tembed: registerHtmlElement(\"embed\"),\n\tobject: registerHtmlElement(\"object\"),\n\tvideo: registerHtmlElement(\"video\"),\n\taudio: registerHtmlElement(\"audio\"),\n\tsource: registerHtmlElement(\"source\"),\n\ttrack: registerHtmlElement(\"track\"),\n\tcanvas: registerHtmlElement(\"canvas\"),\n\tmap: registerHtmlElement(\"map\"),\n\tarea: registerHtmlElement(\"area\"),\n\tsummary: registerHtmlElement(\"summary\"),\n\tdetails: registerHtmlElement(\"details\"),\n\tslot: registerHtmlElement(\"slot\"),\n\ttemplate: registerHtmlElement(\"template\"),\n\tstyle: registerHtmlElement(\"style\"),\n\tscript: registerHtmlElement(\"script\"),\n\tlink: registerHtmlElement(\"link\"),\n\tmeta: registerHtmlElement(\"meta\"),\n\ttitle: registerHtmlElement(\"title\"),\n\tbase: registerHtmlElement(\"base\"),\n\thead: registerHtmlElement(\"head\"),\n\tbody: registerHtmlElement(\"body\"),\n\thtml: registerHtmlElement(\"html\"),\n\tabbr: registerHtmlElement(\"abbr\"),\n\tb: registerHtmlElement(\"b\"),\n\tbdi: registerHtmlElement(\"bdi\"),\n\tbdo: registerHtmlElement(\"bdo\"),\n\tblockquote: registerHtmlElement(\"blockquote\"),\n\tbr: registerHtmlElement(\"br\"),\n\tcaption: registerHtmlElement(\"caption\"),\n\tcite: registerHtmlElement(\"cite\"),\n\tcode: registerHtmlElement(\"code\"),\n\tcol: registerHtmlElement(\"col\"),\n\tcolgroup: registerHtmlElement(\"colgroup\"),\n\tdata: registerHtmlElement(\"data\"),\n\tdel: registerHtmlElement(\"del\"),\n\tdfn: registerHtmlElement(\"dfn\"),\n\tem: registerHtmlElement(\"em\"),\n\ti: registerHtmlElement(\"i\"),\n\tkbd: registerHtmlElement(\"kbd\"),\n\tmark: registerHtmlElement(\"mark\"),\n\tq: registerHtmlElement(\"q\"),\n\trp: registerHtmlElement(\"rp\"),\n\trt: registerHtmlElement(\"rt\"),\n\truby: registerHtmlElement(\"ruby\"),\n\ts: registerHtmlElement(\"s\"),\n\tsamp: registerHtmlElement(\"samp\"),\n\tsmall: registerHtmlElement(\"small\"),\n\tstrong: registerHtmlElement(\"strong\"),\n\tsub: registerHtmlElement(\"sub\"),\n\tsup: registerHtmlElement(\"sup\"),\n\ttime: registerHtmlElement(\"time\"),\n\tu: registerHtmlElement(\"u\"),\n\tvar: registerHtmlElement(\"var\"),\n\taddress: registerHtmlElement(\"address\"),\n\tprogress: registerHtmlElement(\"progress\"),\n\tmeter: registerHtmlElement(\"meter\"),\n\toutput: registerHtmlElement(\"output\"),\n\tdatalist: registerHtmlElement(\"datalist\"),\n\tdialog: registerHtmlElement(\"dialog\"),\n\tmenu: registerHtmlElement(\"menu\"),\n\tfieldset: registerHtmlElement(\"fieldset\"),\n\tlegend: registerHtmlElement(\"legend\"),\n\tfigcaption: registerHtmlElement(\"figcaption\"),\n\tfigure: registerHtmlElement(\"figure\"),\n\thgroup: registerHtmlElement(\"hgroup\"),\n\thr: registerHtmlElement(\"hr\"),\n\tins: registerHtmlElement(\"ins\"),\n\tnoscript: registerHtmlElement(\"noscript\"),\n\toptgroup: registerHtmlElement(\"optgroup\"),\n\tpicture: registerHtmlElement(\"picture\"),\n\tpre: registerHtmlElement(\"pre\"),\n\tsearch: registerHtmlElement(\"search\"),\n\twbr: registerHtmlElement(\"wbr\"),\n} as const;\n\nexport const mathmlElements = {\n\tmath: registerMathMLElement(\"math\"),\n\tmstyle: registerMathMLElement(\"mstyle\"),\n\tmerror: registerMathMLElement(\"merror\"),\n\tmtext: registerMathMLElement(\"mtext\"),\n\tmspace: registerMathMLElement(\"mspace\"),\n\tmsqrt: registerMathMLElement(\"msqrt\"),\n\tmroot: registerMathMLElement(\"mroot\"),\n\tmrow: registerMathMLElement(\"mrow\"),\n\tmfrac: registerMathMLElement(\"mfrac\"),\n\tmsup: registerMathMLElement(\"msup\"),\n\tmsub: registerMathMLElement(\"msub\"),\n\tmsubsup: registerMathMLElement(\"msubsup\"),\n\tmunder: registerMathMLElement(\"munder\"),\n\tmover: registerMathMLElement(\"mover\"),\n\tmunderover: registerMathMLElement(\"munderover\"),\n\tmmultiscripts: registerMathMLElement(\"mmultiscripts\"),\n\tmtable: registerMathMLElement(\"mtable\"),\n\tmtr: registerMathMLElement(\"mtr\"),\n\tmtd: registerMathMLElement(\"mtd\"),\n\tms: registerMathMLElement(\"ms\"),\n\tmphantom: registerMathMLElement(\"mphantom\"),\n\tannotation: registerMathMLElement(\"annotation\"),\n\t\"annotation-xml\": registerMathMLElement(\"annotation-xml\"),\n\tmprescripts: registerMathMLElement(\"mprescripts\"),\n\tmaction: registerMathMLElement(\"maction\"),\n\tmi: registerMathMLElement(\"mi\"),\n\tmn: registerMathMLElement(\"mn\"),\n\tmo: registerMathMLElement(\"mo\"),\n\tmpadded: registerMathMLElement(\"mpadded\"),\n\tsemantics: registerMathMLElement(\"semantics\"),\n};\n\ntype SvgAddProps = {\n\twidth?: number | string;\n\theight?: number | string;\n\txmlns?: string;\n\tversion?: string;\n};\n\ntype CircleAddProps = {\n\tcx?: number | string;\n\tcy?: number | string;\n\tr?: number | string;\n};\n\ntype PathAddProps = {\n\td?: string;\n\tpathLength?: number;\n};\n\ntype RectAddProps = {\n\tx?: number | string;\n\ty?: number | string;\n\twidth?: number | string;\n\theight?: number | string;\n\trx?: number | string;\n\try?: number | string;\n};\n\ntype TextAddProps = {\n\tx?: number | string;\n\ty?: number | string;\n\tfontSize?: number | string;\n\ttextAnchor?: \"start\" | \"middle\" | \"end\" | \"inherit\";\n\tfontWeight?: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | \"inherit\";\n};\n\nexport const svgElements = {\n\tsvg: registerSVGElement<\"svg\", SvgAddProps>(\n\t\t\"svg\",\n\t\tnew Set([\"width\", \"height\", \"xmlns\", \"version\"])\n\t),\n\tdefs: registerSVGElement(\"defs\"),\n\tdesc: registerSVGElement(\"desc\"),\n\ttitle: registerSVGElement(\"title\"),\n\tmetadata: registerSVGElement(\"metadata\"),\n\tg: registerSVGElement(\"g\"),\n\ta: registerSVGElement(\"a\"),\n\tcircle: registerSVGElement<\"circle\", CircleAddProps>(\n\t\t\"circle\",\n\t\tnew Set([\"cx\", \"cy\", \"r\"])\n\t),\n\tellipse: registerSVGElement(\"ellipse\"),\n\tline: registerSVGElement(\"line\"),\n\tpath: registerSVGElement<\"path\", PathAddProps>(\n\t\t\"path\",\n\t\tnew Set([\"d\", \"pathLength\"])\n\t),\n\tpolygon: registerSVGElement(\"polygon\"),\n\tpolyline: registerSVGElement(\"polyline\"),\n\trect: registerSVGElement<\"rect\", RectAddProps>(\n\t\t\"rect\",\n\t\tnew Set([\"x\", \"y\", \"width\", \"height\", \"rx\", \"ry\"])\n\t),\n\tuse: registerSVGElement(\"use\"),\n\tstop: registerSVGElement(\"stop\"),\n\ttspan: registerSVGElement(\"tspan\"),\n\ttext: registerSVGElement<\"text\", TextAddProps>(\n\t\t\"text\",\n\t\tnew Set([\"x\", \"y\", \"fontSize\", \"textAnchor\", \"fontWeight\"])\n\t),\n\timage: registerSVGElement(\"image\"),\n\tclipPath: registerSVGElement(\"clipPath\"),\n\tlinearGradient: registerSVGElement(\"linearGradient\"),\n\tradialGradient: registerSVGElement(\"radialGradient\"),\n\tmask: registerSVGElement(\"mask\"),\n\tpattern: registerSVGElement(\"pattern\"),\n\tmarker: registerSVGElement(\"marker\"),\n\tsymbol: registerSVGElement(\"symbol\"),\n\tview: registerSVGElement(\"view\"),\n\tanimateMotion: registerSVGElement(\"animateMotion\"),\n\tanimateTransform: registerSVGElement(\"animateTransform\"),\n\tfilter: registerSVGElement(\"filter\"),\n\tstyle: registerSVGElement(\"style\"),\n\tscript: registerSVGElement(\"script\"),\n\tanimate: registerSVGElement(\"animate\"),\n\tset: registerSVGElement(\"set\"),\n\tmpath: registerSVGElement(\"mpath\"),\n\tforeignObject: registerSVGElement(\"foreignObject\"),\n\ttextPath: registerSVGElement(\"textPath\"),\n\tfeBlend: registerSVGElement(\"feBlend\"),\n\tfeColorMatrix: registerSVGElement(\"feColorMatrix\"),\n\tfeComponentTransfer: registerSVGElement(\"feComponentTransfer\"),\n\tfeComposite: registerSVGElement(\"feComposite\"),\n\tfeConvolveMatrix: registerSVGElement(\"feConvolveMatrix\"),\n\tfeDiffuseLighting: registerSVGElement(\"feDiffuseLighting\"),\n\tfeDisplacementMap: registerSVGElement(\"feDisplacementMap\"),\n\tfeFlood: registerSVGElement(\"feFlood\"),\n\tfeGaussianBlur: registerSVGElement(\"feGaussianBlur\"),\n\tfeImage: registerSVGElement(\"feImage\"),\n\tfeMerge: registerSVGElement(\"feMerge\"),\n\tfeMorphology: registerSVGElement(\"feMorphology\"),\n\tfeOffset: registerSVGElement(\"feOffset\"),\n\tfeSpecularLighting: registerSVGElement(\"feSpecularLighting\"),\n\tfeTile: registerSVGElement(\"feTile\"),\n\tfeTurbulence: registerSVGElement(\"feTurbulence\"),\n\tfeDistantLight: registerSVGElement(\"feDistantLight\"),\n\tfePointLight: registerSVGElement(\"fePointLight\"),\n\tfeSpotLight: registerSVGElement(\"feSpotLight\"),\n\tfeFuncR: registerSVGElement(\"feFuncR\"),\n\tfeFuncG: registerSVGElement(\"feFuncG\"),\n\tfeFuncB: registerSVGElement(\"feFuncB\"),\n\tfeFuncA: registerSVGElement(\"feFuncA\"),\n\tfeDropShadow: registerSVGElement(\"feDropShadow\"),\n\tfeMergeNode: registerSVGElement(\"feMergeNode\"),\n\tswitch: registerSVGElement(\"switch\"),\n};\n\n/**\n * @alias elements\n */\nexport const $El = htmlElements;\n\n/**\n * @alias mathmlElements\n */\nexport const $MathEl = mathmlElements;\n\n/**\n * @alias svgElements\n */\nexport const $SvgEl = svgElements;\n\nexport const $AllEl = {\n\t...htmlElements,\n\t...mathmlElements,\n\t...svgElements,\n};\n"],"mappings":"sHAAA,SAAgB,EAAYA,EAAQ,CACnC,MAAO,CACN,IAAIC,EAAwB,CAE3B,MADA,GAAG,EAAI,CACA,CACP,CACD,CACD,CAKD,MAAa,EAAK,ECOlB,SAAS,EAAYC,EAAc,CAIjC,cAHU,GAAU,SACb,EAEA,CAAA,EAAA,EAAA,UAAS,EAAM,CAAC,UAAU,AAElC,CAyFD,SAAS,EACRE,EACAC,EACC,CACD,MAAO,CAACC,EAAgCC,IAAsB,CAK7D,IAJM,EAAU,GAAS,CAAE,EACrB,EAAS,EAAA,kBAAA,GAA0B,IAAM,CAAE,EAAC,CAC5C,EAAA,GAAsB,eAAiB,AAAC,GAAQ,CAAE,GAClD,EAAM,GAAgB,IAAI,IAC1B,EAAU,EAAG,SAAS,cAAc,EAAI,CAAC,CAAC,IAAI,AAAC,GAAO,CAU3D,AATA,EAAO,YAAc,EAAG,UAAY,EAAO,WAC3C,EAAO,KAAO,EAAG,GAAK,EAAO,IAC7B,EAAO,QAAU,EAAG,MAAM,QAAU,EAAY,EAAO,MAAM,EAC7D,EAAO,QAAU,EAAG,MAAQ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S,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,aAAc,EAAmB,eAAe,CAChD,SAAU,EAAmB,WAAW,CACxC,mBAAoB,EAAmB,qBAAqB,CAC5D,OAAQ,EAAmB,SAAS,CACpC,aAAc,EAAmB,eAAe,CAChD,eAAgB,EAAmB,iBAAiB,CACpD,aAAc,EAAmB,eAAe,CAChD,YAAa,EAAmB,cAAc,CAC9C,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,aAAc,EAAmB,eAAe,CAChD,YAAa,EAAmB,cAAc,CAC9C,OAAQ,EAAmB,SAAS,AACpC,EAKY,EAAM,EAKN,EAAU,EAKV,EAAS,EAET,EAAS,CACrB,GAAG,EACH,GAAG,EACH,GAAG,CACH"}
|
package/dist/basic.es.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{createEventBinder as e,renderFnOrArray as t,renderFnOrArrayOrCurry as n}from"./core-
|
1
|
+
import{createEventBinder as e,renderFnOrArray as t,renderFnOrArrayOrCurry as n}from"./core-bQvrG1od.mjs";import{html as r,render as i}from"lit";import{styleMap as a}from"lit/directives/style-map.js";function o(e){return{let(t){return t(e),e}}}const s=o;function c(e){return typeof e==`string`?e:a(e).toString()}function l(t,n){return(a,o)=>{let l=a??{},u=e(l?.on??{}),d=a?.injectFields??(e=>{}),f=n??new Set,p=s(document.createElement(t)).let(e=>{l.className&&(e.className=l.className),l.id&&(e.id=l.id),l.style&&(e.style.cssText=c(l.style)),l.title&&(e.title=l.title),l.lang&&(e.lang=l.lang),l.dir&&(e.dir=l.dir),l.role&&(e.role=l.role),l.ariaLabel&&(e.ariaLabel=l.ariaLabel),l.ariaHidden&&(e.ariaHidden=l.ariaHidden),l.key&&e.setAttribute(`data-key`,l.key.toString())});f.forEach(e=>{l[e]&&(p[e]=l[e])}),l.hidden!==void 0&&(p.hidden=l.hidden),l.draggable!==void 0&&(p.draggable=l.draggable),l.contentEditable!==void 0&&(p.contentEditable=l.contentEditable.toString()),l.spellcheck!==void 0&&(p.spellcheck=l.spellcheck),l.tabIndex!==void 0&&(p.tabIndex=l.tabIndex),l.dataset&&Object.entries(l.dataset).forEach(([e,t])=>{p.dataset[e]=t}),u.bind(p),d(p),i(o,p);let m=document.createElement(`div`);return m.remove=()=>{m.remove(),u.unbindAll()},m.appendChild(p),r`${m.firstElementChild}`}}function u(t,n){return(a,o)=>{let l=a??{},u=e(l.on??{}),d=l?.injectFields??(e=>{}),f=n??new Set,p=s(document.createElementNS(`http://www.w3.org/1998/Math/MathML`,t)).let(e=>{l.className&&(e.className=l.className),l.id&&(e.id=l.id),l.style&&(e.style.cssText=c(l.style)),l.display&&e.setAttribute(`display`,l.display),l.key&&e.setAttribute(`data-key`,l.key.toString()),l.mathbackground&&e.setAttribute(`mathbackground`,l.mathbackground),l.mathcolor&&e.setAttribute(`mathcolor`,l.mathcolor)});f.forEach(e=>{l[e]&&(p[e]=l[e])}),u.bind(p),d(p),typeof o==`object`&&o&&`_$litType$`in o?i(o,p):p.textContent=`${o??``}`;let m=document.createElement(`div`);return m.remove=()=>{m.remove(),u.unbindAll()},m.appendChild(p),r`${m.firstElementChild}`}}function d(t,n){return(a,o)=>{let l=a??{},u=e(l.on??{}),d=l?.injectFields??(e=>{}),f=n??new Set,p=s(document.createElementNS(`http://www.w3.org/2000/svg`,t)).let(e=>{l.className&&e.setAttribute(`class`,l.className),l.id&&(e.id=l.id),l.style&&(e.style.cssText=c(l.style)),l.fill&&e.setAttribute(`fill`,l.fill),l.stroke&&e.setAttribute(`stroke`,l.stroke),l.key&&e.setAttribute(`data-key`,l.key.toString()),l.strokeWidth&&e.setAttribute(`stroke-width`,l.strokeWidth.toString()),l.viewBox&&e.setAttribute(`viewBox`,l.viewBox),l.transform&&e.setAttribute(`transform`,l.transform),l.opacity!==void 0&&e.setAttribute(`opacity`,l.opacity.toString())});f.forEach(e=>{if(l[e]){let t=l[e];if(typeof t==`function`)p[e]=t;else{let n=e.toString().replace(/([A-Z])/g,`-$1`).toLowerCase();p.setAttribute(n,t.toString())}}}),u.bind(p),d(p),typeof o==`object`&&o&&`_$litType$`in o||Array.isArray(o)&&o.length>0&&typeof o[0]==`object`&&`_$litType$`in o[0]?i(o,p):(console.log(`content`,o),p.textContent=`${o??``}`);let m=document.createElement(`div`);return m.remove=()=>{m.remove(),u.unbindAll()},m.appendChild(p),r`${m.firstElementChild}`}}function f(e,r){let i=l(e,r);return(e,r)=>{let a=n=>i(e,t(n));return n(r,a)}}function p(e,r){let i=u(e,r);return(e,r)=>{let a=n=>i(e,t(n));return n(r,a)}}function m(e,r){let i=d(e,r);return(e,r)=>{let a=n=>i(e,t(n));return n(r,a)}}const h={div:f(`div`),p:f(`p`),span:f(`span`),h1:f(`h1`),h2:f(`h2`),h3:f(`h3`),h4:f(`h4`),h5:f(`h5`),h6:f(`h6`),article:f(`article`),section:f(`section`),nav:f(`nav`),aside:f(`aside`),header:f(`header`),footer:f(`footer`),main:f(`main`),ul:f(`ul`),ol:f(`ol`),li:f(`li`),dl:f(`dl`),dt:f(`dt`),dd:f(`dd`),form:f(`form`,new Set([`method`,`action`,`enctype`,`target`,`novalidate`])),label:f(`label`),input:f(`input`),textarea:f(`textarea`,new Set([`cols`,`rows`,`wrap`,`maxLength`,`minLength`,`required`,`disabled`,`readonly`,`name`])),button:f(`button`),select:f(`select`,new Set([`multiple`,`required`,`disabled`,`name`,`size`])),option:f(`option`),table:f(`table`),thead:f(`thead`),tbody:f(`tbody`),tfoot:f(`tfoot`),tr:f(`tr`),th:f(`th`),td:f(`td`),a:f(`a`,new Set([`href`,`target`,`rel`,`download`,`type`])),img:f(`img`,new Set([`src`,`alt`,`width`,`height`,`loading`,`decoding`])),iframe:f(`iframe`),embed:f(`embed`),object:f(`object`),video:f(`video`),audio:f(`audio`),source:f(`source`),track:f(`track`),canvas:f(`canvas`),map:f(`map`),area:f(`area`),summary:f(`summary`),details:f(`details`),slot:f(`slot`),template:f(`template`),style:f(`style`),script:f(`script`),link:f(`link`),meta:f(`meta`),title:f(`title`),base:f(`base`),head:f(`head`),body:f(`body`),html:f(`html`),abbr:f(`abbr`),b:f(`b`),bdi:f(`bdi`),bdo:f(`bdo`),blockquote:f(`blockquote`),br:f(`br`),caption:f(`caption`),cite:f(`cite`),code:f(`code`),col:f(`col`),colgroup:f(`colgroup`),data:f(`data`),del:f(`del`),dfn:f(`dfn`),em:f(`em`),i:f(`i`),kbd:f(`kbd`),mark:f(`mark`),q:f(`q`),rp:f(`rp`),rt:f(`rt`),ruby:f(`ruby`),s:f(`s`),samp:f(`samp`),small:f(`small`),strong:f(`strong`),sub:f(`sub`),sup:f(`sup`),time:f(`time`),u:f(`u`),var:f(`var`),address:f(`address`),progress:f(`progress`),meter:f(`meter`),output:f(`output`),datalist:f(`datalist`),dialog:f(`dialog`),menu:f(`menu`),fieldset:f(`fieldset`),legend:f(`legend`),figcaption:f(`figcaption`),figure:f(`figure`),hgroup:f(`hgroup`),hr:f(`hr`),ins:f(`ins`),noscript:f(`noscript`),optgroup:f(`optgroup`),picture:f(`picture`),pre:f(`pre`),search:f(`search`),wbr:f(`wbr`)},g={math:p(`math`),mstyle:p(`mstyle`),merror:p(`merror`),mtext:p(`mtext`),mspace:p(`mspace`),msqrt:p(`msqrt`),mroot:p(`mroot`),mrow:p(`mrow`),mfrac:p(`mfrac`),msup:p(`msup`),msub:p(`msub`),msubsup:p(`msubsup`),munder:p(`munder`),mover:p(`mover`),munderover:p(`munderover`),mmultiscripts:p(`mmultiscripts`),mtable:p(`mtable`),mtr:p(`mtr`),mtd:p(`mtd`),ms:p(`ms`),mphantom:p(`mphantom`),annotation:p(`annotation`),"annotation-xml":p(`annotation-xml`),mprescripts:p(`mprescripts`),maction:p(`maction`),mi:p(`mi`),mn:p(`mn`),mo:p(`mo`),mpadded:p(`mpadded`),semantics:p(`semantics`)},_={svg:m(`svg`,new Set([`width`,`height`,`xmlns`,`version`])),defs:m(`defs`),desc:m(`desc`),title:m(`title`),metadata:m(`metadata`),g:m(`g`),a:m(`a`),circle:m(`circle`,new Set([`cx`,`cy`,`r`])),ellipse:m(`ellipse`),line:m(`line`),path:m(`path`,new Set([`d`,`pathLength`])),polygon:m(`polygon`),polyline:m(`polyline`),rect:m(`rect`,new Set([`x`,`y`,`width`,`height`,`rx`,`ry`])),use:m(`use`),stop:m(`stop`),tspan:m(`tspan`),text:m(`text`,new Set([`x`,`y`,`fontSize`,`textAnchor`,`fontWeight`])),image:m(`image`),clipPath:m(`clipPath`),linearGradient:m(`linearGradient`),radialGradient:m(`radialGradient`),mask:m(`mask`),pattern:m(`pattern`),marker:m(`marker`),symbol:m(`symbol`),view:m(`view`),animateMotion:m(`animateMotion`),animateTransform:m(`animateTransform`),filter:m(`filter`),style:m(`style`),script:m(`script`),animate:m(`animate`),set:m(`set`),mpath:m(`mpath`),foreignObject:m(`foreignObject`),textPath:m(`textPath`),feBlend:m(`feBlend`),feColorMatrix:m(`feColorMatrix`),feComponentTransfer:m(`feComponentTransfer`),feComposite:m(`feComposite`),feConvolveMatrix:m(`feConvolveMatrix`),feDiffuseLighting:m(`feDiffuseLighting`),feDisplacementMap:m(`feDisplacementMap`),feFlood:m(`feFlood`),feGaussianBlur:m(`feGaussianBlur`),feImage:m(`feImage`),feMerge:m(`feMerge`),feMorphology:m(`feMorphology`),feOffset:m(`feOffset`),feSpecularLighting:m(`feSpecularLighting`),feTile:m(`feTile`),feTurbulence:m(`feTurbulence`),feDistantLight:m(`feDistantLight`),fePointLight:m(`fePointLight`),feSpotLight:m(`feSpotLight`),feFuncR:m(`feFuncR`),feFuncG:m(`feFuncG`),feFuncB:m(`feFuncB`),feFuncA:m(`feFuncA`),feDropShadow:m(`feDropShadow`),feMergeNode:m(`feMergeNode`),switch:m(`switch`)},v=h,y=g,b=_,x={...h,...g,..._};export{x as $AllEl,v as $El,y as $MathEl,b as $SvgEl,h as htmlElements,g as mathmlElements,_ as svgElements};
|
2
2
|
//# sourceMappingURL=basic.es.js.map
|
package/dist/basic.es.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"basic.es.js","names":["style: Style","content: unknown","tag: K","addPropsType?: Set<keyof Add>","props?: BasicHtmlProps<K, Add>","content?: unknown","_props?: BasicMathMLProps<K, Add>","_props?: BasicSVGProps<K, Add>","children?: renderFnOrArrayType","c?: renderFnOrArrayType","props?: BasicMathMLProps<K, Add>","props?: BasicSVGProps<K, Add>"],"sources":["../src/components/Basic/mod.ts"],"sourcesContent":["import { html, render, type TemplateResult } from \"lit\";\nimport { StyleInfo, styleMap } from \"lit/directives/style-map.js\";\nimport {\n\tcreateEventBinder,\n\tOnEvent,\n\trenderFnOrArray,\n\trenderFnOrArrayOrCurry,\n\trenderFnOrArrayType,\n} from \"../../core\";\n\ntype HTMLEl =\n\t| HTMLElementTagNameMap\n\t| HTMLElementDeprecatedTagNameMap\n\t| SVGElementTagNameMap\n\t| MathMLElementTagNameMap;\n\ntype Style = string | Readonly<StyleInfo>;\n\nfunction createStyle(style: Style) {\n\tif (typeof style === \"string\") {\n\t\treturn style;\n\t} else {\n\t\treturn styleMap(style).toString();\n\t}\n}\n\nstyleMap;\nexport type BasicHtmlProps<_T extends keyof HTMLElementTagNameMap, AddPorps> = {\n\tclassName?: string;\n\tid?: string;\n\tkey?: string | number;\n\tstyle?: Style;\n\ton?: OnEvent;\n\ttitle?: string;\n\thidden?: boolean;\n\tdraggable?: boolean;\n\tlang?: string;\n\tdir?: string;\n\taccessKey?: string;\n\ttabIndex?: number;\n\tcontentEditable?: boolean;\n\tspellcheck?: boolean;\n\tdataset?: DOMStringMap;\n\trole?: string;\n\tariaLabel?: string;\n\tariaDescribedBy?: string;\n\tariaHidden?: string;\n\tinjectFields?: (ref: HTMLElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type BasicSVGProps<_T extends keyof SVGElementTagNameMap, AddPorps> = {\n\tclassName?: string;\n\tkey?: string | number;\n\tid?: string;\n\tstyle?: Style;\n\ton?: OnEvent;\n\t// SVG 特有属性\n\tfill?: string;\n\tstroke?: string;\n\tstrokeWidth?: number;\n\tviewBox?: string;\n\t// 通用SVG属性\n\ttransform?: string;\n\topacity?: number;\n\n\t// 插入字段\n\tinjectFields?: (ref: SVGElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type BasicMathMLProps<\n\t_T extends keyof MathMLElementTagNameMap,\n\tAddPorps\n> = {\n\tclassName?: string;\n\tkey?: string | number;\n\tid?: string;\n\tstyle?: Style;\n\ton?: OnEvent;\n\t// MathML 特有属性\n\tdisplay?: \"block\" | \"inline\";\n\tmathbackground?: string;\n\tmathcolor?: string;\n\t// 插入字段\n\tinjectFields?: (ref: MathMLElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type Props<_T extends keyof HTMLEl, AddPorps> =\n\t| BasicHtmlProps<_T, AddPorps>\n\t| BasicSVGProps<_T, AddPorps>\n\t| BasicMathMLProps<_T, AddPorps>;\n\ntype ElementFunction<\n\t_T extends keyof _F,\n\t_F extends HTMLEl,\n\t_P extends Props<_T extends keyof HTMLEl ? _T : never, AddPorps>,\n\tAddPorps\n> = {\n\t(props?: _P): (\n\t\tchildren?: renderFnOrArrayType | string | number\n\t) => TemplateResult<1>;\n\t(\n\t\tprops?: _P,\n\t\tchildren?: renderFnOrArrayType | string | number\n\t): TemplateResult<1>;\n};\n\nconst isLitTemplate = (content: unknown) => {\n\treturn (\n\t\tcontent !== null && typeof content === \"object\" && \"_$litType$\" in content\n\t);\n};\n\n// 创建一个HTML元素渲染函数工厂\nfunction createElementRenderer<K extends keyof HTMLElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n) {\n\treturn (props?: BasicHtmlProps<K, Add>, content?: unknown) => {\n\t\tconst _props = (props ?? {}) as BasicHtmlProps<K, Add>;\n\t\tconst element = document.createElement(tag);\n\t\tconst binder = createEventBinder(_props?.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\t\t// 应用所有属性\n\t\t_props.className && (element.className = _props.className);\n\t\t_props.id && (element.id = _props.id);\n\t\t_props.style && (element.style.cssText = createStyle(_props.style));\n\t\t_props.title && (element.title = _props.title);\n\t\t_props.lang && (element.lang = _props.lang);\n\t\t_props.dir && (element.dir = _props.dir);\n\t\t_props.role && (element.role = _props.role);\n\t\t_props.ariaLabel && (element.ariaLabel = _props.ariaLabel);\n\t\t_props.ariaHidden && (element.ariaHidden = _props.ariaHidden);\n\t\t_props.key && element.setAttribute(\"data-key\", _props.key.toString());\n\t\tadd.forEach((key) => {\n\t\t\tif (_props[key]) {\n\t\t\t\t(element as any)[key] = _props[key];\n\t\t\t}\n\t\t});\n\n\t\t// 设置布尔属性\n\t\tif (_props.hidden !== undefined) element.hidden = _props.hidden;\n\t\tif (_props.draggable !== undefined) element.draggable = _props.draggable;\n\t\tif (_props.contentEditable !== undefined)\n\t\t\telement.contentEditable = _props.contentEditable.toString();\n\t\tif (_props.spellcheck !== undefined) element.spellcheck = _props.spellcheck;\n\t\tif (_props.tabIndex !== undefined) element.tabIndex = _props.tabIndex;\n\n\t\t// 设置dataset\n\t\t_props.dataset &&\n\t\t\tObject.entries(_props.dataset).forEach(([key, value]) => {\n\t\t\t\telement.dataset[key] = value;\n\t\t\t});\n\n\t\t// 绑定事件\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\trender(content, element);\n\n\t\t// 创建一个包装节点,用于管理生命周期\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as HTMLElement}`;\n\t};\n}\n\nfunction createMathMLElementRenderer<\n\tK extends keyof MathMLElementTagNameMap,\n\tAdd\n>(tag: K, addPropsType?: Set<keyof Add>) {\n\treturn (_props?: BasicMathMLProps<K, Add>, content?: unknown) => {\n\t\tconst props = _props ?? ({} as BasicMathMLProps<K, Add>);\n\t\tconst element = document.createElementNS(\n\t\t\t\"http://www.w3.org/1998/Math/MathML\",\n\t\t\ttag\n\t\t);\n\t\tconst binder = createEventBinder(props.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\t\t// 应用属性\n\t\tprops.className && (element.className = props.className);\n\t\tprops.id && (element.id = props.id);\n\t\tprops.style && (element.style.cssText = createStyle(props.style));\n\t\tprops.display && element.setAttribute(\"display\", props.display);\n\t\tprops.key && element.setAttribute(\"data-key\", props.key.toString());\n\t\tprops.mathbackground &&\n\t\t\telement.setAttribute(\"mathbackground\", props.mathbackground);\n\t\tprops.mathcolor && element.setAttribute(\"mathcolor\", props.mathcolor);\n\t\tadd.forEach((key) => {\n\t\t\tif (props[key]) {\n\t\t\t\t(element as any)[key] = props[key];\n\t\t\t}\n\t\t});\n\n\t\t// 绑定事件和注入字段\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\tif (\n\t\t\tcontent !== null &&\n\t\t\ttypeof content === \"object\" &&\n\t\t\t\"_$litType$\" in content\n\t\t) {\n\t\t\trender(content as TemplateResult<1>, element as HTMLElement);\n\t\t} else {\n\t\t\telement.textContent = `${content ?? \"\"}`;\n\t\t}\n\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as MathMLElement}`;\n\t};\n}\n\nfunction createSVGElementRenderer<K extends keyof SVGElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n) {\n\treturn (_props?: BasicSVGProps<K, Add>, content?: unknown) => {\n\t\tconst props = _props ?? ({} as BasicSVGProps<K, Add>);\n\t\tconst element = document.createElementNS(\"http://www.w3.org/2000/svg\", tag);\n\t\tconst binder = createEventBinder(props.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\n\t\t// 应用SVG属性\n\t\tprops.className && element.setAttribute(\"class\", props.className);\n\t\tprops.id && (element.id = props.id);\n\t\tprops.style && (element.style.cssText = createStyle(props.style));\n\t\tprops.fill && element.setAttribute(\"fill\", props.fill);\n\t\tprops.stroke && element.setAttribute(\"stroke\", props.stroke);\n\t\tprops.key && element.setAttribute(\"data-key\", props.key.toString());\n\t\tprops.strokeWidth &&\n\t\t\telement.setAttribute(\"stroke-width\", props.strokeWidth.toString());\n\t\tprops.viewBox && element.setAttribute(\"viewBox\", props.viewBox);\n\t\tprops.transform && element.setAttribute(\"transform\", props.transform);\n\t\tprops.opacity !== undefined &&\n\t\t\telement.setAttribute(\"opacity\", props.opacity.toString());\n\t\tadd.forEach((key) => {\n\t\t\tif (props[key]) {\n\t\t\t\tconst value = props[key];\n\t\t\t\tif (typeof value === \"function\") {\n\t\t\t\t\t(element as any)[key] = value;\n\t\t\t\t} else {\n\t\t\t\t\t// 将驼峰式属性名转换为短横线式\n\t\t\t\t\tconst attributeName = key\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.replace(/([A-Z])/g, \"-$1\")\n\t\t\t\t\t\t.toLowerCase();\n\t\t\t\t\telement.setAttribute(attributeName, value.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// 绑定事件\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\tif (\n\t\t\t(content !== null &&\n\t\t\t\ttypeof content === \"object\" &&\n\t\t\t\t\"_$litType$\" in content) ||\n\t\t\t(Array.isArray(content) &&\n\t\t\t\tcontent.length > 0 &&\n\t\t\t\ttypeof content[0] === \"object\" &&\n\t\t\t\t\"_$litType$\" in content[0])\n\t\t) {\n\t\t\trender(content as TemplateResult<1>, element as unknown as HTMLElement);\n\t\t} else {\n\t\t\tconsole.log(\"content\", content);\n\t\t\telement.textContent = `${content ?? \"\"}`;\n\t\t}\n\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as SVGElement}`;\n\t};\n}\n\n// 元素注册函数\nfunction registerHtmlElement<K extends keyof HTMLElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, HTMLElementTagNameMap, BasicHtmlProps<K, Add>, Add> {\n\tconst renderer = createElementRenderer(tag, addPropsType);\n\treturn ((props?: BasicHtmlProps<K, Add>, children?: renderFnOrArrayType) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<K, HTMLElementTagNameMap, BasicHtmlProps<K, Add>, Add>;\n}\n\nfunction registerMathMLElement<\n\tK extends keyof MathMLElementTagNameMap,\n\tAdd = {}\n>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, MathMLElementTagNameMap, BasicMathMLProps<K, Add>, Add> {\n\tconst renderer = createMathMLElementRenderer(tag, addPropsType);\n\treturn ((\n\t\tprops?: BasicMathMLProps<K, Add>,\n\t\tchildren?: renderFnOrArrayType\n\t) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<\n\t\tK,\n\t\tMathMLElementTagNameMap,\n\t\tBasicMathMLProps<K, Add>,\n\t\tAdd\n\t>;\n}\n\nfunction registerSVGElement<K extends keyof SVGElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, SVGElementTagNameMap, BasicSVGProps<K, Add>, Add> {\n\tconst renderer = createSVGElementRenderer(tag, addPropsType);\n\treturn ((props?: BasicSVGProps<K, Add>, children?: renderFnOrArrayType) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<K, SVGElementTagNameMap, BasicSVGProps<K, Add>, Add>;\n}\n\n// 定义所有HTML元素映射\n\ntype FromAddProps = {\n\tmethod?: string;\n\taction?: string;\n\tenctype?: string;\n\ttarget?: string;\n\tnovalidate?: boolean;\n};\ntype InputAddProps = {\n\ttype?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\tmaxLength?: number;\n\tminLength?: number;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\treadonly?: boolean;\n\tchecked?: boolean;\n\tname?: string;\n};\n\ntype TextareaAddProps = {\n\trows?: number;\n\tcols?: number;\n\twrap?: string;\n\tmaxLength?: number;\n\tminLength?: number;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\treadonly?: boolean;\n\tname?: string;\n};\n\ntype SelectAddProps = {\n\tmultiple?: boolean;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\tname?: string;\n\tsize?: number;\n};\n\ntype AAddProps = {\n\thref?: string;\n\ttarget?: string;\n\trel?: string;\n\tdownload?: string;\n\ttype?: string;\n};\n\ntype ImgAddProps = {\n\tsrc?: string;\n\talt?: string;\n\twidth?: number | string;\n\theight?: number | string;\n\tloading?: \"lazy\" | \"eager\";\n\tdecoding?: \"sync\" | \"async\" | \"auto\";\n};\n\nexport const htmlElements = {\n\tdiv: registerHtmlElement(\"div\"),\n\tp: registerHtmlElement(\"p\"),\n\tspan: registerHtmlElement(\"span\"),\n\th1: registerHtmlElement(\"h1\"),\n\th2: registerHtmlElement(\"h2\"),\n\th3: registerHtmlElement(\"h3\"),\n\th4: registerHtmlElement(\"h4\"),\n\th5: registerHtmlElement(\"h5\"),\n\th6: registerHtmlElement(\"h6\"),\n\tarticle: registerHtmlElement(\"article\"),\n\tsection: registerHtmlElement(\"section\"),\n\tnav: registerHtmlElement(\"nav\"),\n\taside: registerHtmlElement(\"aside\"),\n\theader: registerHtmlElement(\"header\"),\n\tfooter: registerHtmlElement(\"footer\"),\n\tmain: registerHtmlElement(\"main\"),\n\tul: registerHtmlElement(\"ul\"),\n\tol: registerHtmlElement(\"ol\"),\n\tli: registerHtmlElement(\"li\"),\n\tdl: registerHtmlElement(\"dl\"),\n\tdt: registerHtmlElement(\"dt\"),\n\tdd: registerHtmlElement(\"dd\"),\n\tform: registerHtmlElement<\"form\", FromAddProps>(\n\t\t\"form\",\n\t\tnew Set([\"method\", \"action\", \"enctype\", \"target\", \"novalidate\"])\n\t),\n\tlabel: registerHtmlElement(\"label\"),\n\tinput: registerHtmlElement<\"input\", InputAddProps>(\"input\"),\n\ttextarea: registerHtmlElement<\"textarea\", TextareaAddProps>(\n\t\t\"textarea\",\n\t\tnew Set([\n\t\t\t\"cols\",\n\t\t\t\"rows\",\n\t\t\t\"wrap\",\n\t\t\t\"maxLength\",\n\t\t\t\"minLength\",\n\t\t\t\"required\",\n\t\t\t\"disabled\",\n\t\t\t\"readonly\",\n\t\t\t\"name\",\n\t\t])\n\t),\n\tbutton: registerHtmlElement(\"button\"),\n\tselect: registerHtmlElement<\"select\", SelectAddProps>(\n\t\t\"select\",\n\t\tnew Set([\"multiple\", \"required\", \"disabled\", \"name\", \"size\"])\n\t),\n\toption: registerHtmlElement(\"option\"),\n\ttable: registerHtmlElement(\"table\"),\n\tthead: registerHtmlElement(\"thead\"),\n\ttbody: registerHtmlElement(\"tbody\"),\n\ttfoot: registerHtmlElement(\"tfoot\"),\n\ttr: registerHtmlElement(\"tr\"),\n\tth: registerHtmlElement(\"th\"),\n\ttd: registerHtmlElement(\"td\"),\n\ta: registerHtmlElement<\"a\", AAddProps>(\n\t\t\"a\",\n\t\tnew Set([\"href\", \"target\", \"rel\", \"download\", \"type\"])\n\t),\n\timg: registerHtmlElement<\"img\", ImgAddProps>(\n\t\t\"img\",\n\t\tnew Set([\"src\", \"alt\", \"width\", \"height\", \"loading\", \"decoding\"])\n\t),\n\tiframe: registerHtmlElement(\"iframe\"),\n\tembed: registerHtmlElement(\"embed\"),\n\tobject: registerHtmlElement(\"object\"),\n\tvideo: registerHtmlElement(\"video\"),\n\taudio: registerHtmlElement(\"audio\"),\n\tsource: registerHtmlElement(\"source\"),\n\ttrack: registerHtmlElement(\"track\"),\n\tcanvas: registerHtmlElement(\"canvas\"),\n\tmap: registerHtmlElement(\"map\"),\n\tarea: registerHtmlElement(\"area\"),\n\tsummary: registerHtmlElement(\"summary\"),\n\tdetails: registerHtmlElement(\"details\"),\n\tslot: registerHtmlElement(\"slot\"),\n\ttemplate: registerHtmlElement(\"template\"),\n\tstyle: registerHtmlElement(\"style\"),\n\tscript: registerHtmlElement(\"script\"),\n\tlink: registerHtmlElement(\"link\"),\n\tmeta: registerHtmlElement(\"meta\"),\n\ttitle: registerHtmlElement(\"title\"),\n\tbase: registerHtmlElement(\"base\"),\n\thead: registerHtmlElement(\"head\"),\n\tbody: registerHtmlElement(\"body\"),\n\thtml: registerHtmlElement(\"html\"),\n\tabbr: registerHtmlElement(\"abbr\"),\n\tb: registerHtmlElement(\"b\"),\n\tbdi: registerHtmlElement(\"bdi\"),\n\tbdo: registerHtmlElement(\"bdo\"),\n\tblockquote: registerHtmlElement(\"blockquote\"),\n\tbr: registerHtmlElement(\"br\"),\n\tcaption: registerHtmlElement(\"caption\"),\n\tcite: registerHtmlElement(\"cite\"),\n\tcode: registerHtmlElement(\"code\"),\n\tcol: registerHtmlElement(\"col\"),\n\tcolgroup: registerHtmlElement(\"colgroup\"),\n\tdata: registerHtmlElement(\"data\"),\n\tdel: registerHtmlElement(\"del\"),\n\tdfn: registerHtmlElement(\"dfn\"),\n\tem: registerHtmlElement(\"em\"),\n\ti: registerHtmlElement(\"i\"),\n\tkbd: registerHtmlElement(\"kbd\"),\n\tmark: registerHtmlElement(\"mark\"),\n\tq: registerHtmlElement(\"q\"),\n\trp: registerHtmlElement(\"rp\"),\n\trt: registerHtmlElement(\"rt\"),\n\truby: registerHtmlElement(\"ruby\"),\n\ts: registerHtmlElement(\"s\"),\n\tsamp: registerHtmlElement(\"samp\"),\n\tsmall: registerHtmlElement(\"small\"),\n\tstrong: registerHtmlElement(\"strong\"),\n\tsub: registerHtmlElement(\"sub\"),\n\tsup: registerHtmlElement(\"sup\"),\n\ttime: registerHtmlElement(\"time\"),\n\tu: registerHtmlElement(\"u\"),\n\tvar: registerHtmlElement(\"var\"),\n\taddress: registerHtmlElement(\"address\"),\n\tprogress: registerHtmlElement(\"progress\"),\n\tmeter: registerHtmlElement(\"meter\"),\n\toutput: registerHtmlElement(\"output\"),\n\tdatalist: registerHtmlElement(\"datalist\"),\n\tdialog: registerHtmlElement(\"dialog\"),\n\tmenu: registerHtmlElement(\"menu\"),\n\tfieldset: registerHtmlElement(\"fieldset\"),\n\tlegend: registerHtmlElement(\"legend\"),\n\tfigcaption: registerHtmlElement(\"figcaption\"),\n\tfigure: registerHtmlElement(\"figure\"),\n\thgroup: registerHtmlElement(\"hgroup\"),\n\thr: registerHtmlElement(\"hr\"),\n\tins: registerHtmlElement(\"ins\"),\n\tnoscript: registerHtmlElement(\"noscript\"),\n\toptgroup: registerHtmlElement(\"optgroup\"),\n\tpicture: registerHtmlElement(\"picture\"),\n\tpre: registerHtmlElement(\"pre\"),\n\tsearch: registerHtmlElement(\"search\"),\n\twbr: registerHtmlElement(\"wbr\"),\n} as const;\n\nexport const mathmlElements = {\n\tmath: registerMathMLElement(\"math\"),\n\tmstyle: registerMathMLElement(\"mstyle\"),\n\tmerror: registerMathMLElement(\"merror\"),\n\tmtext: registerMathMLElement(\"mtext\"),\n\tmspace: registerMathMLElement(\"mspace\"),\n\tmsqrt: registerMathMLElement(\"msqrt\"),\n\tmroot: registerMathMLElement(\"mroot\"),\n\tmrow: registerMathMLElement(\"mrow\"),\n\tmfrac: registerMathMLElement(\"mfrac\"),\n\tmsup: registerMathMLElement(\"msup\"),\n\tmsub: registerMathMLElement(\"msub\"),\n\tmsubsup: registerMathMLElement(\"msubsup\"),\n\tmunder: registerMathMLElement(\"munder\"),\n\tmover: registerMathMLElement(\"mover\"),\n\tmunderover: registerMathMLElement(\"munderover\"),\n\tmmultiscripts: registerMathMLElement(\"mmultiscripts\"),\n\tmtable: registerMathMLElement(\"mtable\"),\n\tmtr: registerMathMLElement(\"mtr\"),\n\tmtd: registerMathMLElement(\"mtd\"),\n\tms: registerMathMLElement(\"ms\"),\n\tmphantom: registerMathMLElement(\"mphantom\"),\n\tannotation: registerMathMLElement(\"annotation\"),\n\t\"annotation-xml\": registerMathMLElement(\"annotation-xml\"),\n\tmprescripts: registerMathMLElement(\"mprescripts\"),\n\tmaction: registerMathMLElement(\"maction\"),\n\tmi: registerMathMLElement(\"mi\"),\n\tmn: registerMathMLElement(\"mn\"),\n\tmo: registerMathMLElement(\"mo\"),\n\tmpadded: registerMathMLElement(\"mpadded\"),\n\tsemantics: registerMathMLElement(\"semantics\"),\n};\n\ntype SvgAddProps = {\n\twidth?: number | string;\n\theight?: number | string;\n\txmlns?: string;\n\tversion?: string;\n};\n\ntype CircleAddProps = {\n\tcx?: number | string;\n\tcy?: number | string;\n\tr?: number | string;\n};\n\ntype PathAddProps = {\n\td?: string;\n\tpathLength?: number;\n};\n\ntype RectAddProps = {\n\tx?: number | string;\n\ty?: number | string;\n\twidth?: number | string;\n\theight?: number | string;\n\trx?: number | string;\n\try?: number | string;\n};\n\ntype TextAddProps = {\n\tx?: number | string;\n\ty?: number | string;\n\tfontSize?: number | string;\n\ttextAnchor?: \"start\" | \"middle\" | \"end\" | \"inherit\";\n\tfontWeight?: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | \"inherit\";\n};\n\nexport const svgElements = {\n\tsvg: registerSVGElement<\"svg\", SvgAddProps>(\n\t\t\"svg\",\n\t\tnew Set([\"width\", \"height\", \"xmlns\", \"version\"])\n\t),\n\tdefs: registerSVGElement(\"defs\"),\n\tdesc: registerSVGElement(\"desc\"),\n\ttitle: registerSVGElement(\"title\"),\n\tmetadata: registerSVGElement(\"metadata\"),\n\tg: registerSVGElement(\"g\"),\n\ta: registerSVGElement(\"a\"),\n\tcircle: registerSVGElement<\"circle\", CircleAddProps>(\n\t\t\"circle\",\n\t\tnew Set([\"cx\", \"cy\", \"r\"])\n\t),\n\tellipse: registerSVGElement(\"ellipse\"),\n\tline: registerSVGElement(\"line\"),\n\tpath: registerSVGElement<\"path\", PathAddProps>(\n\t\t\"path\",\n\t\tnew Set([\"d\", \"pathLength\"])\n\t),\n\tpolygon: registerSVGElement(\"polygon\"),\n\tpolyline: registerSVGElement(\"polyline\"),\n\trect: registerSVGElement<\"rect\", RectAddProps>(\n\t\t\"rect\",\n\t\tnew Set([\"x\", \"y\", \"width\", \"height\", \"rx\", \"ry\"])\n\t),\n\tuse: registerSVGElement(\"use\"),\n\tstop: registerSVGElement(\"stop\"),\n\ttspan: registerSVGElement(\"tspan\"),\n\ttext: registerSVGElement<\"text\", TextAddProps>(\n\t\t\"text\",\n\t\tnew Set([\"x\", \"y\", \"fontSize\", \"textAnchor\", \"fontWeight\"])\n\t),\n\timage: registerSVGElement(\"image\"),\n\tclipPath: registerSVGElement(\"clipPath\"),\n\tlinearGradient: registerSVGElement(\"linearGradient\"),\n\tradialGradient: registerSVGElement(\"radialGradient\"),\n\tmask: registerSVGElement(\"mask\"),\n\tpattern: registerSVGElement(\"pattern\"),\n\tmarker: registerSVGElement(\"marker\"),\n\tsymbol: registerSVGElement(\"symbol\"),\n\tview: registerSVGElement(\"view\"),\n\tanimateMotion: registerSVGElement(\"animateMotion\"),\n\tanimateTransform: registerSVGElement(\"animateTransform\"),\n\tfilter: registerSVGElement(\"filter\"),\n\tstyle: registerSVGElement(\"style\"),\n\tscript: registerSVGElement(\"script\"),\n\tanimate: registerSVGElement(\"animate\"),\n\tset: registerSVGElement(\"set\"),\n\tmpath: registerSVGElement(\"mpath\"),\n\tforeignObject: registerSVGElement(\"foreignObject\"),\n\ttextPath: registerSVGElement(\"textPath\"),\n\tfeBlend: registerSVGElement(\"feBlend\"),\n\tfeColorMatrix: registerSVGElement(\"feColorMatrix\"),\n\tfeComponentTransfer: registerSVGElement(\"feComponentTransfer\"),\n\tfeComposite: registerSVGElement(\"feComposite\"),\n\tfeConvolveMatrix: registerSVGElement(\"feConvolveMatrix\"),\n\tfeDiffuseLighting: registerSVGElement(\"feDiffuseLighting\"),\n\tfeDisplacementMap: registerSVGElement(\"feDisplacementMap\"),\n\tfeFlood: registerSVGElement(\"feFlood\"),\n\tfeGaussianBlur: registerSVGElement(\"feGaussianBlur\"),\n\tfeImage: registerSVGElement(\"feImage\"),\n\tfeMerge: registerSVGElement(\"feMerge\"),\n\tfeMorphology: registerSVGElement(\"feMorphology\"),\n\tfeOffset: registerSVGElement(\"feOffset\"),\n\tfeSpecularLighting: registerSVGElement(\"feSpecularLighting\"),\n\tfeTile: registerSVGElement(\"feTile\"),\n\tfeTurbulence: registerSVGElement(\"feTurbulence\"),\n\tfeDistantLight: registerSVGElement(\"feDistantLight\"),\n\tfePointLight: registerSVGElement(\"fePointLight\"),\n\tfeSpotLight: registerSVGElement(\"feSpotLight\"),\n\tfeFuncR: registerSVGElement(\"feFuncR\"),\n\tfeFuncG: registerSVGElement(\"feFuncG\"),\n\tfeFuncB: registerSVGElement(\"feFuncB\"),\n\tfeFuncA: registerSVGElement(\"feFuncA\"),\n\tfeDropShadow: registerSVGElement(\"feDropShadow\"),\n\tfeMergeNode: registerSVGElement(\"feMergeNode\"),\n\tswitch: registerSVGElement(\"switch\"),\n};\n\n/**\n * @alias elements\n */\nexport const $El = htmlElements;\n\n/**\n * @alias mathmlElements\n */\nexport const $MathEl = mathmlElements;\n\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,IAAK,EAAmB,MAAM,CAC9B,MAAO,EAAmB,QAAQ,CAClC,cAAe,EAAmB,gBAAgB,CAClD,SAAU,EAAmB,WAAW,CACxC,QAAS,EAAmB,UAAU,CACtC,cAAe,EAAmB,gBAAgB,CAClD,oBAAqB,EAAmB,sBAAsB,CAC9D,YAAa,EAAmB,cAAc,CAC9C,iBAAkB,EAAmB,mBAAmB,CACxD,kBAAmB,EAAmB,oBAAoB,CAC1D,kBAAmB,EAAmB,oBAAoB,CAC1D,QAAS,EAAmB,UAAU,CACtC,eAAgB,EAAmB,iBAAiB,CACpD,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,aAAc,EAAmB,eAAe,CAChD,SAAU,EAAmB,WAAW,CACxC,mBAAoB,EAAmB,qBAAqB,CAC5D,OAAQ,EAAmB,SAAS,CACpC,aAAc,EAAmB,eAAe,CAChD,eAAgB,EAAmB,iBAAiB,CACpD,aAAc,EAAmB,eAAe,CAChD,YAAa,EAAmB,cAAc,CAC9C,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,aAAc,EAAmB,eAAe,CAChD,YAAa,EAAmB,cAAc,CAC9C,OAAQ,EAAmB,SAAS,AACpC,EAKY,EAAM,EAKN,EAAU,EAKV,EAAS,EAET,EAAS,CACrB,GAAG,EACH,GAAG,EACH,GAAG,CACH"}
|
1
|
+
{"version":3,"file":"basic.es.js","names":["obj: T","fn: (it: T) => void","style: Style","content: unknown","tag: K","addPropsType?: Set<keyof Add>","props?: BasicHtmlProps<K, Add>","content?: unknown","_props?: BasicMathMLProps<K, Add>","_props?: BasicSVGProps<K, Add>","children?: renderFnOrArrayType","c?: renderFnOrArrayType","props?: BasicMathMLProps<K, Add>","props?: BasicSVGProps<K, Add>"],"sources":["../src/components/Basic/utils.ts","../src/components/Basic/mod.ts"],"sourcesContent":["export function initWith<T>(obj: T) {\n\treturn {\n\t\tlet(fn: (it: T) => void): T {\n\t\t\tfn(obj);\n\t\t\treturn obj;\n\t\t},\n\t};\n}\n\n/**\n * @alias initWith\n */\nexport const iw = initWith;\n","import { html, render, type TemplateResult } from \"lit\";\nimport { StyleInfo, styleMap } from \"lit/directives/style-map.js\";\nimport {\n\tcreateEventBinder,\n\tOnEvent,\n\trenderFnOrArray,\n\trenderFnOrArrayOrCurry,\n\trenderFnOrArrayType,\n} from \"../../core\";\nimport { iw } from \"./utils\";\n\ntype HTMLEl =\n\t| HTMLElementTagNameMap\n\t| HTMLElementDeprecatedTagNameMap\n\t| SVGElementTagNameMap\n\t| MathMLElementTagNameMap;\n\ntype Style = string | Readonly<StyleInfo>;\n\nfunction createStyle(style: Style) {\n\tif (typeof style === \"string\") {\n\t\treturn style;\n\t} else {\n\t\treturn styleMap(style).toString();\n\t}\n}\n\nstyleMap;\nexport type BasicHtmlProps<_T extends keyof HTMLElementTagNameMap, AddPorps> = {\n\tclassName?: string;\n\tid?: string;\n\tkey?: string | number;\n\tstyle?: Style;\n\ton?: OnEvent;\n\ttitle?: string;\n\thidden?: boolean;\n\tdraggable?: boolean;\n\tlang?: string;\n\tdir?: string;\n\taccessKey?: string;\n\ttabIndex?: number;\n\tcontentEditable?: boolean;\n\tspellcheck?: boolean;\n\tdataset?: DOMStringMap;\n\trole?: string;\n\tariaLabel?: string;\n\tariaDescribedBy?: string;\n\tariaHidden?: string;\n\tinjectFields?: (ref: HTMLElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type BasicSVGProps<_T extends keyof SVGElementTagNameMap, AddPorps> = {\n\tclassName?: string;\n\tkey?: string | number;\n\tid?: string;\n\tstyle?: Style;\n\ton?: OnEvent;\n\t// SVG 特有属性\n\tfill?: string;\n\tstroke?: string;\n\tstrokeWidth?: number;\n\tviewBox?: string;\n\t// 通用SVG属性\n\ttransform?: string;\n\topacity?: number;\n\n\t// 插入字段\n\tinjectFields?: (ref: SVGElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type BasicMathMLProps<\n\t_T extends keyof MathMLElementTagNameMap,\n\tAddPorps\n> = {\n\tclassName?: string;\n\tkey?: string | number;\n\tid?: string;\n\tstyle?: Style;\n\ton?: OnEvent;\n\t// MathML 特有属性\n\tdisplay?: \"block\" | \"inline\";\n\tmathbackground?: string;\n\tmathcolor?: string;\n\t// 插入字段\n\tinjectFields?: (ref: MathMLElementTagNameMap[_T]) => void;\n} & AddPorps;\n\nexport type Props<_T extends keyof HTMLEl, AddPorps> =\n\t| BasicHtmlProps<_T, AddPorps>\n\t| BasicSVGProps<_T, AddPorps>\n\t| BasicMathMLProps<_T, AddPorps>;\n\ntype ElementFunction<\n\t_T extends keyof _F,\n\t_F extends HTMLEl,\n\t_P extends Props<_T extends keyof HTMLEl ? _T : never, AddPorps>,\n\tAddPorps\n> = {\n\t(props?: _P): (\n\t\tchildren?: renderFnOrArrayType | string | number\n\t) => TemplateResult<1>;\n\t(\n\t\tprops?: _P,\n\t\tchildren?: renderFnOrArrayType | string | number\n\t): TemplateResult<1>;\n};\n\nconst isLitTemplate = (content: unknown) => {\n\treturn (\n\t\tcontent !== null && typeof content === \"object\" && \"_$litType$\" in content\n\t);\n};\n\n// 创建一个HTML元素渲染函数工厂\nfunction createElementRenderer<K extends keyof HTMLElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n) {\n\treturn (props?: BasicHtmlProps<K, Add>, content?: unknown) => {\n\t\tconst _props = (props ?? {}) as BasicHtmlProps<K, Add>;\n\t\tconst binder = createEventBinder(_props?.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\t\tconst element = iw(document.createElement(tag)).let((it) => {\n\t\t\t_props.className && (it.className = _props.className);\n\t\t\t_props.id && (it.id = _props.id);\n\t\t\t_props.style && (it.style.cssText = createStyle(_props.style));\n\t\t\t_props.title && (it.title = _props.title);\n\t\t\t_props.lang && (it.lang = _props.lang);\n\t\t\t_props.dir && (it.dir = _props.dir);\n\t\t\t_props.role && (it.role = _props.role);\n\t\t\t_props.ariaLabel && (it.ariaLabel = _props.ariaLabel);\n\t\t\t_props.ariaHidden && (it.ariaHidden = _props.ariaHidden);\n\t\t\t_props.key && it.setAttribute(\"data-key\", _props.key.toString());\n\t\t});\n\t\tadd.forEach((key) => {\n\t\t\tif (_props[key]) {\n\t\t\t\t(element as any)[key] = _props[key];\n\t\t\t}\n\t\t});\n\n\t\t// 设置布尔属性\n\t\tif (_props.hidden !== undefined) element.hidden = _props.hidden;\n\t\tif (_props.draggable !== undefined) element.draggable = _props.draggable;\n\t\tif (_props.contentEditable !== undefined)\n\t\t\telement.contentEditable = _props.contentEditable.toString();\n\t\tif (_props.spellcheck !== undefined) element.spellcheck = _props.spellcheck;\n\t\tif (_props.tabIndex !== undefined) element.tabIndex = _props.tabIndex;\n\n\t\t// 设置dataset\n\t\t_props.dataset &&\n\t\t\tObject.entries(_props.dataset).forEach(([key, value]) => {\n\t\t\t\telement.dataset[key] = value;\n\t\t\t});\n\n\t\t// 绑定事件\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\trender(content, element);\n\n\t\t// 创建一个包装节点,用于管理生命周期\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as HTMLElement}`;\n\t};\n}\n\nfunction createMathMLElementRenderer<\n\tK extends keyof MathMLElementTagNameMap,\n\tAdd\n>(tag: K, addPropsType?: Set<keyof Add>) {\n\treturn (_props?: BasicMathMLProps<K, Add>, content?: unknown) => {\n\t\tconst props = _props ?? ({} as BasicMathMLProps<K, Add>);\n\n\t\tconst binder = createEventBinder(props.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\t\t// 应用属性\n\t\tconst element = iw(\n\t\t\tdocument.createElementNS(\"http://www.w3.org/1998/Math/MathML\", tag)\n\t\t).let((it) => {\n\t\t\tprops.className && (it.className = props.className);\n\t\t\tprops.id && (it.id = props.id);\n\t\t\tprops.style && (it.style.cssText = createStyle(props.style));\n\t\t\tprops.display && it.setAttribute(\"display\", props.display);\n\t\t\tprops.key && it.setAttribute(\"data-key\", props.key.toString());\n\t\t\tprops.mathbackground &&\n\t\t\t\tit.setAttribute(\"mathbackground\", props.mathbackground);\n\t\t\tprops.mathcolor && it.setAttribute(\"mathcolor\", props.mathcolor);\n\t\t});\n\n\t\tadd.forEach((key) => {\n\t\t\tif (props[key]) {\n\t\t\t\t(element as any)[key] = props[key];\n\t\t\t}\n\t\t});\n\n\t\t// 绑定事件和注入字段\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\tif (\n\t\t\tcontent !== null &&\n\t\t\ttypeof content === \"object\" &&\n\t\t\t\"_$litType$\" in content\n\t\t) {\n\t\t\trender(content as TemplateResult<1>, element as HTMLElement);\n\t\t} else {\n\t\t\telement.textContent = `${content ?? \"\"}`;\n\t\t}\n\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as MathMLElement}`;\n\t};\n}\n\nfunction createSVGElementRenderer<K extends keyof SVGElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n) {\n\treturn (_props?: BasicSVGProps<K, Add>, content?: unknown) => {\n\t\tconst props = _props ?? ({} as BasicSVGProps<K, Add>);\n\t\tconst binder = createEventBinder(props.on ?? {});\n\t\tconst injectFields = props?.injectFields ?? ((ref) => {});\n\t\tconst add = addPropsType ?? new Set();\n\n\t\tconst element = iw(\n\t\t\tdocument.createElementNS(\"http://www.w3.org/2000/svg\", tag)\n\t\t).let((it) => {\n\t\t\t// 应用SVG属性\n\t\t\tprops.className && it.setAttribute(\"class\", props.className);\n\t\t\tprops.id && (it.id = props.id);\n\t\t\tprops.style && (it.style.cssText = createStyle(props.style));\n\t\t\tprops.fill && it.setAttribute(\"fill\", props.fill);\n\t\t\tprops.stroke && it.setAttribute(\"stroke\", props.stroke);\n\t\t\tprops.key && it.setAttribute(\"data-key\", props.key.toString());\n\t\t\tprops.strokeWidth &&\n\t\t\t\tit.setAttribute(\"stroke-width\", props.strokeWidth.toString());\n\t\t\tprops.viewBox && it.setAttribute(\"viewBox\", props.viewBox);\n\t\t\tprops.transform && it.setAttribute(\"transform\", props.transform);\n\t\t\tprops.opacity !== undefined &&\n\t\t\t\tit.setAttribute(\"opacity\", props.opacity.toString());\n\t\t});\n\n\t\tadd.forEach((key) => {\n\t\t\tif (props[key]) {\n\t\t\t\tconst value = props[key];\n\t\t\t\tif (typeof value === \"function\") {\n\t\t\t\t\t(element as any)[key] = value;\n\t\t\t\t} else {\n\t\t\t\t\t// 将驼峰式属性名转换为短横线式\n\t\t\t\t\tconst attributeName = key\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.replace(/([A-Z])/g, \"-$1\")\n\t\t\t\t\t\t.toLowerCase();\n\t\t\t\t\telement.setAttribute(attributeName, value.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// 绑定事件\n\t\tbinder.bind(element);\n\t\tinjectFields(element);\n\n\t\t// 处理内容\n\t\tif (\n\t\t\t(content !== null &&\n\t\t\t\ttypeof content === \"object\" &&\n\t\t\t\t\"_$litType$\" in content) ||\n\t\t\t(Array.isArray(content) &&\n\t\t\t\tcontent.length > 0 &&\n\t\t\t\ttypeof content[0] === \"object\" &&\n\t\t\t\t\"_$litType$\" in content[0])\n\t\t) {\n\t\t\trender(content as TemplateResult<1>, element as unknown as HTMLElement);\n\t\t} else {\n\t\t\tconsole.log(\"content\", content);\n\t\t\telement.textContent = `${content ?? \"\"}`;\n\t\t}\n\n\t\tconst wrapper = document.createElement(\"div\");\n\t\twrapper.remove = () => {\n\t\t\twrapper.remove();\n\t\t\tbinder.unbindAll();\n\t\t};\n\t\twrapper.appendChild(element);\n\n\t\treturn html`${wrapper.firstElementChild as SVGElement}`;\n\t};\n}\n\n// 元素注册函数\nfunction registerHtmlElement<K extends keyof HTMLElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, HTMLElementTagNameMap, BasicHtmlProps<K, Add>, Add> {\n\tconst renderer = createElementRenderer(tag, addPropsType);\n\treturn ((props?: BasicHtmlProps<K, Add>, children?: renderFnOrArrayType) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<K, HTMLElementTagNameMap, BasicHtmlProps<K, Add>, Add>;\n}\n\nfunction registerMathMLElement<\n\tK extends keyof MathMLElementTagNameMap,\n\tAdd = {}\n>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, MathMLElementTagNameMap, BasicMathMLProps<K, Add>, Add> {\n\tconst renderer = createMathMLElementRenderer(tag, addPropsType);\n\treturn ((\n\t\tprops?: BasicMathMLProps<K, Add>,\n\t\tchildren?: renderFnOrArrayType\n\t) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<\n\t\tK,\n\t\tMathMLElementTagNameMap,\n\t\tBasicMathMLProps<K, Add>,\n\t\tAdd\n\t>;\n}\n\nfunction registerSVGElement<K extends keyof SVGElementTagNameMap, Add>(\n\ttag: K,\n\taddPropsType?: Set<keyof Add>\n): ElementFunction<K, SVGElementTagNameMap, BasicSVGProps<K, Add>, Add> {\n\tconst renderer = createSVGElementRenderer(tag, addPropsType);\n\treturn ((props?: BasicSVGProps<K, Add>, children?: renderFnOrArrayType) => {\n\t\tconst render = (c?: renderFnOrArrayType) =>\n\t\t\trenderer(props, renderFnOrArray(c));\n\t\treturn renderFnOrArrayOrCurry(children, render) as\n\t\t\t| TemplateResult<1>\n\t\t\t| ((children?: renderFnOrArrayType) => TemplateResult<1>);\n\t}) as ElementFunction<K, SVGElementTagNameMap, BasicSVGProps<K, Add>, Add>;\n}\n\n// 定义所有HTML元素映射\n\ntype FromAddProps = {\n\tmethod?: string;\n\taction?: string;\n\tenctype?: string;\n\ttarget?: string;\n\tnovalidate?: boolean;\n};\ntype InputAddProps = {\n\ttype?: string;\n\tvalue?: string;\n\tplaceholder?: string;\n\tmaxLength?: number;\n\tminLength?: number;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\treadonly?: boolean;\n\tchecked?: boolean;\n\tname?: string;\n};\n\ntype TextareaAddProps = {\n\trows?: number;\n\tcols?: number;\n\twrap?: string;\n\tmaxLength?: number;\n\tminLength?: number;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\treadonly?: boolean;\n\tname?: string;\n};\n\ntype SelectAddProps = {\n\tmultiple?: boolean;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\tname?: string;\n\tsize?: number;\n};\n\ntype AAddProps = {\n\thref?: string;\n\ttarget?: string;\n\trel?: string;\n\tdownload?: string;\n\ttype?: string;\n};\n\ntype ImgAddProps = {\n\tsrc?: string;\n\talt?: string;\n\twidth?: number | string;\n\theight?: number | string;\n\tloading?: \"lazy\" | \"eager\";\n\tdecoding?: \"sync\" | \"async\" | \"auto\";\n};\n\nexport const htmlElements = {\n\tdiv: registerHtmlElement(\"div\"),\n\tp: registerHtmlElement(\"p\"),\n\tspan: registerHtmlElement(\"span\"),\n\th1: registerHtmlElement(\"h1\"),\n\th2: registerHtmlElement(\"h2\"),\n\th3: registerHtmlElement(\"h3\"),\n\th4: registerHtmlElement(\"h4\"),\n\th5: registerHtmlElement(\"h5\"),\n\th6: registerHtmlElement(\"h6\"),\n\tarticle: registerHtmlElement(\"article\"),\n\tsection: registerHtmlElement(\"section\"),\n\tnav: registerHtmlElement(\"nav\"),\n\taside: registerHtmlElement(\"aside\"),\n\theader: registerHtmlElement(\"header\"),\n\tfooter: registerHtmlElement(\"footer\"),\n\tmain: registerHtmlElement(\"main\"),\n\tul: registerHtmlElement(\"ul\"),\n\tol: registerHtmlElement(\"ol\"),\n\tli: registerHtmlElement(\"li\"),\n\tdl: registerHtmlElement(\"dl\"),\n\tdt: registerHtmlElement(\"dt\"),\n\tdd: registerHtmlElement(\"dd\"),\n\tform: registerHtmlElement<\"form\", FromAddProps>(\n\t\t\"form\",\n\t\tnew Set([\"method\", \"action\", \"enctype\", \"target\", \"novalidate\"])\n\t),\n\tlabel: registerHtmlElement(\"label\"),\n\tinput: registerHtmlElement<\"input\", InputAddProps>(\"input\"),\n\ttextarea: registerHtmlElement<\"textarea\", TextareaAddProps>(\n\t\t\"textarea\",\n\t\tnew Set([\n\t\t\t\"cols\",\n\t\t\t\"rows\",\n\t\t\t\"wrap\",\n\t\t\t\"maxLength\",\n\t\t\t\"minLength\",\n\t\t\t\"required\",\n\t\t\t\"disabled\",\n\t\t\t\"readonly\",\n\t\t\t\"name\",\n\t\t])\n\t),\n\tbutton: registerHtmlElement(\"button\"),\n\tselect: registerHtmlElement<\"select\", SelectAddProps>(\n\t\t\"select\",\n\t\tnew Set([\"multiple\", \"required\", \"disabled\", \"name\", \"size\"])\n\t),\n\toption: registerHtmlElement(\"option\"),\n\ttable: registerHtmlElement(\"table\"),\n\tthead: registerHtmlElement(\"thead\"),\n\ttbody: registerHtmlElement(\"tbody\"),\n\ttfoot: registerHtmlElement(\"tfoot\"),\n\ttr: registerHtmlElement(\"tr\"),\n\tth: registerHtmlElement(\"th\"),\n\ttd: registerHtmlElement(\"td\"),\n\ta: registerHtmlElement<\"a\", AAddProps>(\n\t\t\"a\",\n\t\tnew Set([\"href\", \"target\", \"rel\", \"download\", \"type\"])\n\t),\n\timg: registerHtmlElement<\"img\", ImgAddProps>(\n\t\t\"img\",\n\t\tnew Set([\"src\", \"alt\", \"width\", \"height\", \"loading\", \"decoding\"])\n\t),\n\tiframe: registerHtmlElement(\"iframe\"),\n\tembed: registerHtmlElement(\"embed\"),\n\tobject: registerHtmlElement(\"object\"),\n\tvideo: registerHtmlElement(\"video\"),\n\taudio: registerHtmlElement(\"audio\"),\n\tsource: registerHtmlElement(\"source\"),\n\ttrack: registerHtmlElement(\"track\"),\n\tcanvas: registerHtmlElement(\"canvas\"),\n\tmap: registerHtmlElement(\"map\"),\n\tarea: registerHtmlElement(\"area\"),\n\tsummary: registerHtmlElement(\"summary\"),\n\tdetails: registerHtmlElement(\"details\"),\n\tslot: registerHtmlElement(\"slot\"),\n\ttemplate: registerHtmlElement(\"template\"),\n\tstyle: registerHtmlElement(\"style\"),\n\tscript: registerHtmlElement(\"script\"),\n\tlink: registerHtmlElement(\"link\"),\n\tmeta: registerHtmlElement(\"meta\"),\n\ttitle: registerHtmlElement(\"title\"),\n\tbase: registerHtmlElement(\"base\"),\n\thead: registerHtmlElement(\"head\"),\n\tbody: registerHtmlElement(\"body\"),\n\thtml: registerHtmlElement(\"html\"),\n\tabbr: registerHtmlElement(\"abbr\"),\n\tb: registerHtmlElement(\"b\"),\n\tbdi: registerHtmlElement(\"bdi\"),\n\tbdo: registerHtmlElement(\"bdo\"),\n\tblockquote: registerHtmlElement(\"blockquote\"),\n\tbr: registerHtmlElement(\"br\"),\n\tcaption: registerHtmlElement(\"caption\"),\n\tcite: registerHtmlElement(\"cite\"),\n\tcode: registerHtmlElement(\"code\"),\n\tcol: registerHtmlElement(\"col\"),\n\tcolgroup: registerHtmlElement(\"colgroup\"),\n\tdata: registerHtmlElement(\"data\"),\n\tdel: registerHtmlElement(\"del\"),\n\tdfn: registerHtmlElement(\"dfn\"),\n\tem: registerHtmlElement(\"em\"),\n\ti: registerHtmlElement(\"i\"),\n\tkbd: registerHtmlElement(\"kbd\"),\n\tmark: registerHtmlElement(\"mark\"),\n\tq: registerHtmlElement(\"q\"),\n\trp: registerHtmlElement(\"rp\"),\n\trt: registerHtmlElement(\"rt\"),\n\truby: registerHtmlElement(\"ruby\"),\n\ts: registerHtmlElement(\"s\"),\n\tsamp: registerHtmlElement(\"samp\"),\n\tsmall: registerHtmlElement(\"small\"),\n\tstrong: registerHtmlElement(\"strong\"),\n\tsub: registerHtmlElement(\"sub\"),\n\tsup: registerHtmlElement(\"sup\"),\n\ttime: registerHtmlElement(\"time\"),\n\tu: registerHtmlElement(\"u\"),\n\tvar: registerHtmlElement(\"var\"),\n\taddress: registerHtmlElement(\"address\"),\n\tprogress: registerHtmlElement(\"progress\"),\n\tmeter: registerHtmlElement(\"meter\"),\n\toutput: registerHtmlElement(\"output\"),\n\tdatalist: registerHtmlElement(\"datalist\"),\n\tdialog: registerHtmlElement(\"dialog\"),\n\tmenu: registerHtmlElement(\"menu\"),\n\tfieldset: registerHtmlElement(\"fieldset\"),\n\tlegend: registerHtmlElement(\"legend\"),\n\tfigcaption: registerHtmlElement(\"figcaption\"),\n\tfigure: registerHtmlElement(\"figure\"),\n\thgroup: registerHtmlElement(\"hgroup\"),\n\thr: registerHtmlElement(\"hr\"),\n\tins: registerHtmlElement(\"ins\"),\n\tnoscript: registerHtmlElement(\"noscript\"),\n\toptgroup: registerHtmlElement(\"optgroup\"),\n\tpicture: registerHtmlElement(\"picture\"),\n\tpre: registerHtmlElement(\"pre\"),\n\tsearch: registerHtmlElement(\"search\"),\n\twbr: registerHtmlElement(\"wbr\"),\n} as const;\n\nexport const mathmlElements = {\n\tmath: registerMathMLElement(\"math\"),\n\tmstyle: registerMathMLElement(\"mstyle\"),\n\tmerror: registerMathMLElement(\"merror\"),\n\tmtext: registerMathMLElement(\"mtext\"),\n\tmspace: registerMathMLElement(\"mspace\"),\n\tmsqrt: registerMathMLElement(\"msqrt\"),\n\tmroot: registerMathMLElement(\"mroot\"),\n\tmrow: registerMathMLElement(\"mrow\"),\n\tmfrac: registerMathMLElement(\"mfrac\"),\n\tmsup: registerMathMLElement(\"msup\"),\n\tmsub: registerMathMLElement(\"msub\"),\n\tmsubsup: registerMathMLElement(\"msubsup\"),\n\tmunder: registerMathMLElement(\"munder\"),\n\tmover: registerMathMLElement(\"mover\"),\n\tmunderover: registerMathMLElement(\"munderover\"),\n\tmmultiscripts: registerMathMLElement(\"mmultiscripts\"),\n\tmtable: registerMathMLElement(\"mtable\"),\n\tmtr: registerMathMLElement(\"mtr\"),\n\tmtd: registerMathMLElement(\"mtd\"),\n\tms: registerMathMLElement(\"ms\"),\n\tmphantom: registerMathMLElement(\"mphantom\"),\n\tannotation: registerMathMLElement(\"annotation\"),\n\t\"annotation-xml\": registerMathMLElement(\"annotation-xml\"),\n\tmprescripts: registerMathMLElement(\"mprescripts\"),\n\tmaction: registerMathMLElement(\"maction\"),\n\tmi: registerMathMLElement(\"mi\"),\n\tmn: registerMathMLElement(\"mn\"),\n\tmo: registerMathMLElement(\"mo\"),\n\tmpadded: registerMathMLElement(\"mpadded\"),\n\tsemantics: registerMathMLElement(\"semantics\"),\n};\n\ntype SvgAddProps = {\n\twidth?: number | string;\n\theight?: number | string;\n\txmlns?: string;\n\tversion?: string;\n};\n\ntype CircleAddProps = {\n\tcx?: number | string;\n\tcy?: number | string;\n\tr?: number | string;\n};\n\ntype PathAddProps = {\n\td?: string;\n\tpathLength?: number;\n};\n\ntype RectAddProps = {\n\tx?: number | string;\n\ty?: number | string;\n\twidth?: number | string;\n\theight?: number | string;\n\trx?: number | string;\n\try?: number | string;\n};\n\ntype TextAddProps = {\n\tx?: number | string;\n\ty?: number | string;\n\tfontSize?: number | string;\n\ttextAnchor?: \"start\" | \"middle\" | \"end\" | \"inherit\";\n\tfontWeight?: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | \"inherit\";\n};\n\nexport const svgElements = {\n\tsvg: registerSVGElement<\"svg\", SvgAddProps>(\n\t\t\"svg\",\n\t\tnew Set([\"width\", \"height\", \"xmlns\", \"version\"])\n\t),\n\tdefs: registerSVGElement(\"defs\"),\n\tdesc: registerSVGElement(\"desc\"),\n\ttitle: registerSVGElement(\"title\"),\n\tmetadata: registerSVGElement(\"metadata\"),\n\tg: registerSVGElement(\"g\"),\n\ta: registerSVGElement(\"a\"),\n\tcircle: registerSVGElement<\"circle\", CircleAddProps>(\n\t\t\"circle\",\n\t\tnew Set([\"cx\", \"cy\", \"r\"])\n\t),\n\tellipse: registerSVGElement(\"ellipse\"),\n\tline: registerSVGElement(\"line\"),\n\tpath: registerSVGElement<\"path\", PathAddProps>(\n\t\t\"path\",\n\t\tnew Set([\"d\", \"pathLength\"])\n\t),\n\tpolygon: registerSVGElement(\"polygon\"),\n\tpolyline: registerSVGElement(\"polyline\"),\n\trect: registerSVGElement<\"rect\", RectAddProps>(\n\t\t\"rect\",\n\t\tnew Set([\"x\", \"y\", \"width\", \"height\", \"rx\", \"ry\"])\n\t),\n\tuse: registerSVGElement(\"use\"),\n\tstop: registerSVGElement(\"stop\"),\n\ttspan: registerSVGElement(\"tspan\"),\n\ttext: registerSVGElement<\"text\", TextAddProps>(\n\t\t\"text\",\n\t\tnew Set([\"x\", \"y\", \"fontSize\", \"textAnchor\", \"fontWeight\"])\n\t),\n\timage: registerSVGElement(\"image\"),\n\tclipPath: registerSVGElement(\"clipPath\"),\n\tlinearGradient: registerSVGElement(\"linearGradient\"),\n\tradialGradient: registerSVGElement(\"radialGradient\"),\n\tmask: registerSVGElement(\"mask\"),\n\tpattern: registerSVGElement(\"pattern\"),\n\tmarker: registerSVGElement(\"marker\"),\n\tsymbol: registerSVGElement(\"symbol\"),\n\tview: registerSVGElement(\"view\"),\n\tanimateMotion: registerSVGElement(\"animateMotion\"),\n\tanimateTransform: registerSVGElement(\"animateTransform\"),\n\tfilter: registerSVGElement(\"filter\"),\n\tstyle: registerSVGElement(\"style\"),\n\tscript: registerSVGElement(\"script\"),\n\tanimate: registerSVGElement(\"animate\"),\n\tset: registerSVGElement(\"set\"),\n\tmpath: registerSVGElement(\"mpath\"),\n\tforeignObject: registerSVGElement(\"foreignObject\"),\n\ttextPath: registerSVGElement(\"textPath\"),\n\tfeBlend: registerSVGElement(\"feBlend\"),\n\tfeColorMatrix: registerSVGElement(\"feColorMatrix\"),\n\tfeComponentTransfer: registerSVGElement(\"feComponentTransfer\"),\n\tfeComposite: registerSVGElement(\"feComposite\"),\n\tfeConvolveMatrix: registerSVGElement(\"feConvolveMatrix\"),\n\tfeDiffuseLighting: registerSVGElement(\"feDiffuseLighting\"),\n\tfeDisplacementMap: registerSVGElement(\"feDisplacementMap\"),\n\tfeFlood: registerSVGElement(\"feFlood\"),\n\tfeGaussianBlur: registerSVGElement(\"feGaussianBlur\"),\n\tfeImage: registerSVGElement(\"feImage\"),\n\tfeMerge: registerSVGElement(\"feMerge\"),\n\tfeMorphology: registerSVGElement(\"feMorphology\"),\n\tfeOffset: registerSVGElement(\"feOffset\"),\n\tfeSpecularLighting: registerSVGElement(\"feSpecularLighting\"),\n\tfeTile: registerSVGElement(\"feTile\"),\n\tfeTurbulence: registerSVGElement(\"feTurbulence\"),\n\tfeDistantLight: registerSVGElement(\"feDistantLight\"),\n\tfePointLight: registerSVGElement(\"fePointLight\"),\n\tfeSpotLight: registerSVGElement(\"feSpotLight\"),\n\tfeFuncR: registerSVGElement(\"feFuncR\"),\n\tfeFuncG: registerSVGElement(\"feFuncG\"),\n\tfeFuncB: registerSVGElement(\"feFuncB\"),\n\tfeFuncA: registerSVGElement(\"feFuncA\"),\n\tfeDropShadow: registerSVGElement(\"feDropShadow\"),\n\tfeMergeNode: registerSVGElement(\"feMergeNode\"),\n\tswitch: registerSVGElement(\"switch\"),\n};\n\n/**\n * @alias elements\n */\nexport const $El = htmlElements;\n\n/**\n * @alias mathmlElements\n */\nexport const $MathEl = mathmlElements;\n\n/**\n * @alias svgElements\n */\nexport const $SvgEl = svgElements;\n\nexport const $AllEl = {\n\t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mB,SAAS,CACpC,KAAM,EAAmB,OAAO,CAChC,cAAe,EAAmB,gBAAgB,CAClD,iBAAkB,EAAmB,mBAAmB,CACxD,OAAQ,EAAmB,SAAS,CACpC,MAAO,EAAmB,QAAQ,CAClC,OAAQ,EAAmB,SAAS,CACpC,QAAS,EAAmB,UAAU,CACtC,IAAK,EAAmB,MAAM,CAC9B,MAAO,EAAmB,QAAQ,CAClC,cAAe,EAAmB,gBAAgB,CAClD,SAAU,EAAmB,WAAW,CACxC,QAAS,EAAmB,UAAU,CACtC,cAAe,EAAmB,gBAAgB,CAClD,oBAAqB,EAAmB,sBAAsB,CAC9D,YAAa,EAAmB,cAAc,CAC9C,iBAAkB,EAAmB,mBAAmB,CACxD,kBAAmB,EAAmB,oBAAoB,CAC1D,kBAAmB,EAAmB,oBAAoB,CAC1D,QAAS,EAAmB,UAAU,CACtC,eAAgB,EAAmB,iBAAiB,CACpD,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,aAAc,EAAmB,eAAe,CAChD,SAAU,EAAmB,WAAW,CACxC,mBAAoB,EAAmB,qBAAqB,CAC5D,OAAQ,EAAmB,SAAS,CACpC,aAAc,EAAmB,eAAe,CAChD,eAAgB,EAAmB,iBAAiB,CACpD,aAAc,EAAmB,eAAe,CAChD,YAAa,EAAmB,cAAc,CAC9C,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,QAAS,EAAmB,UAAU,CACtC,aAAc,EAAmB,eAAe,CAChD,YAAa,EAAmB,cAAc,CAC9C,OAAQ,EAAmB,SAAS,AACpC,EAKY,EAAM,EAKN,EAAU,EAKV,EAAS,EAET,EAAS,CACrB,GAAG,EACH,GAAG,EACH,GAAG,CACH"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=s(require(`lit`)),l=Symbol(`___LYCO_NULL___`);function u(e){return e?typeof e==`function`?e():e:c.html``}function d(e,t){let n=t??(e=>e);if(e===void 0)return c.html``;if(Array.isArray(e))return e.map((e,t)=>n(u(e),t,!0,!1));if(typeof e!=`function`)return n(u(e),void 0,!1,!1);let r=e();return Array.isArray(r)?r.map((e,t)=>n(u(e),t,!0,!1)):n(u(r),void 0,!1,!0)}function f(e){let t=Math.random().toString(36).substring(2,15);return e?`lyco-${e}-${t}`:`lyco-${t}`}function p(e,t){let n=t??(e=>e),r=e=>n(u(e));return e?r(e):r}function m(e,t,n){let r={string:e=>c.html` ${e} `,number:e=>c.html` ${e} `},i=typeof e in r?r[typeof e]:e,a=t??(e=>e),o=e=>a(d(e,n));return i?o(i):o}const h=e=>({init:!1,prefix:e,className:l}),g={"GridBreakpoint::grid-breakpoint":h(`grid-breakpoint`),"Hidden::hidden-container":h(`hidden-container`),"ListGroup::list-group":h(`list-group`),"ScrollBar::scrollbar-container":h(`scrollbar-container`),"SkeletonLoader::skeleton":h(`skeleton`),"Swiper::swiper":h(`swiper`),"Table::table":h(`table`),"WaterFlow::waterflow":h(`waterflow`),"AutoFitGrid::auto-fit-grid":h(`auto-fit-grid`),"GridCol::grid-col":h(`grid-col`),"GridRow::grid-row":h(`grid-row`),"List::list":h(`list`),"Dialog::dialog":h(`dialog`),"SwitchInput::switch":h(`switch`),"Combobox::combobox":h(`combobox`)};function _(e){let t=g[e];return t.init||(g[e].init=!0,g[e].className=f(t.prefix)),g[e].className===l?f(t.prefix):g[e].className}const v={all:{value:0}};function y(e){var t;return(t=v[e])?.value||(v[e]={value:0}),v[e].value}function b(e,t){return v.all={value:v.all.value+1},v[e]===void 0?v[e]={value:0}:v[e].value=v[e].value+1,c.html`
|
2
2
|
<!-- ${e} - ${v[e].value} -->
|
3
3
|
${t}
|
4
|
-
`}
|
5
|
-
//# sourceMappingURL=core-
|
4
|
+
`}var x=class{static applyAnimation(e,t){t.animationClass&&(e.classList.add(t.animationClass),t.duration&&(e.style.animationDuration=`${t.duration}s`),t.delay&&(e.style.animationDelay=`${t.delay}s`)),t.animation&&t.animation(e),t.cssProperties&&Object.keys(t.cssProperties).length>0&&(Object.keys(t.cssProperties).forEach(n=>{e.style[n]=t.cssProperties[n]}),t.duration&&(e.style.transitionDuration=`${t.duration}s`))}};function S(e,t,n){t.forEach(([t,r])=>{if(!r)return;n.has(t)&&e.removeEventListener(t,n.get(t));let i,a;if(typeof r==`function`?(i=r,a=void 0):(i=r.handler,a=r.options),!i)return;let o=e=>i(e);e.addEventListener(t,o,a),n.set(t,o)})}function C(e){let t=new Map,n=Object.entries(e),r={value:null},i={bind(e){S(e,n,t),r.value=e},unbindAll(){t.forEach((e,t)=>{var n;(n=r.value)?.removeEventListener(t,e)}),t.clear(),r.value=null},auto:e=>{e?i.bind(e):i.unbindAll()}};return i}Object.defineProperty(exports,`AnimationAPI`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`LycoComponent`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`__toESM`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`createEventBinder`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`getComponentCount`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`getRandomClassName`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`renderFn`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`renderFnOrArray`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`renderFnOrArrayOrCurry`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`renderFnOrCurry`,{enumerable:!0,get:function(){return p}});
|
5
|
+
//# sourceMappingURL=core-BoB7sDMv.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core-BoB7sDMv.js","names":["fn?: renderFnType","fnOrArray?: renderFnOrArrayType","injectBox?: (\n\t\tbox: Temp,\n\t\tidx?: number,\n\t\tisArray?: boolean,\n\t\tisFunc?: boolean\n\t) => Temp","prefix?: string","injectBox?: (box: Temp) => Temp","f?: renderFnType","fnOrArray?: renderFnOrArrayType | string | number","injectBox?: (box: Temp | Temp[]) => Temp | Temp[]","injectBox2?: (\n\t\tbox: Temp,\n\t\tidx?: number,\n\t\tisArray?: boolean,\n\t\tisFunc?: boolean\n\t) => Temp","f?: any","f?: renderFnOrArrayType | string | number","prefix: string","key: keyof typeof allRandomClassName","componentCount: ComponentCount","name: string","slot: Temp","element: HTMLElement","options: {\n\t\t\tanimationClass?: string;\n\t\t\tanimation?: (element: HTMLElement) => void;\n\t\t\tcssProperties?: Record<string, string>;\n\t\t\tduration?: number;\n\t\t\tdelay?: number;\n\t\t}","on: OnEvent","el: EventTarget","on: Array<[string, EventHandler<any>]>","eventListeners: Map<string, EventListener>","handler: (event: Event) => void","options: boolean | AddEventListenerOptions | undefined","event: Event","e?: Element"],"sources":["../src/core/index.ts"],"sourcesContent":["import { html, TemplateResult } from \"lit\";\n\nconst ___LYCO_NULL___ = Symbol(\"___LYCO_NULL___\");\nexport type Temp = TemplateResult<1> | TemplateResult;\nexport type renderFnType = Temp | (() => Temp);\nexport type renderFnOrArrayType = renderFnType | Array<Temp> | (() => Temp[]);\n\nexport function renderFn(fn?: renderFnType): Temp {\n\treturn fn ? (typeof fn === \"function\" ? fn() : fn) : html``;\n}\n\nexport type WithHtml<K> = ((children?: K) => Temp) & {\n\thtml: (strings: TemplateStringsArray, ...values: unknown[]) => Temp;\n};\n\nexport function renderFnOrArray(\n\tfnOrArray?: renderFnOrArrayType,\n\tinjectBox?: (\n\t\tbox: Temp,\n\t\tidx?: number,\n\t\tisArray?: boolean,\n\t\tisFunc?: boolean\n\t) => Temp\n): Temp | Temp[] {\n\tlet _injectBox = injectBox ?? ((box) => box);\n\tif (fnOrArray === undefined) {\n\t\treturn html``;\n\t}\n\tif (Array.isArray(fnOrArray)) {\n\t\treturn fnOrArray.map((htmlTemp, idx) =>\n\t\t\t_injectBox(renderFn(htmlTemp), idx, true, false)\n\t\t);\n\t} else if (typeof fnOrArray !== \"function\") {\n\t\treturn _injectBox(renderFn(fnOrArray), undefined, false, false);\n\t}\n\n\tconst result = fnOrArray();\n\tif (Array.isArray(result)) {\n\t\treturn result.map((htmlTemp, idx) =>\n\t\t\t_injectBox(renderFn(htmlTemp), idx, true, false)\n\t\t);\n\t} else {\n\t\treturn _injectBox(renderFn(result), undefined, false, true);\n\t}\n}\n\nexport function randomClassName(prefix?: string): string {\n\tconst random = Math.random().toString(36).substring(2, 15);\n\treturn prefix ? `lyco-${prefix}-${random}` : `lyco-${random}`;\n}\n\nexport function renderFnOrCurry(\n\tfn?: renderFnType,\n\tinjectBox?: (box: Temp) => Temp\n): Temp | ((fn?: renderFnType) => Temp) {\n\tconst _injectBox = injectBox ?? ((box) => box);\n\tconst curriedFn = (f?: renderFnType) => _injectBox(renderFn(f!));\n\n\treturn fn ? curriedFn(fn) : curriedFn;\n}\n\nexport function renderFnOrArrayOrCurry(\n\tfnOrArray?: renderFnOrArrayType | string | number,\n\tinjectBox?: (box: Temp | Temp[]) => Temp | Temp[],\n\tinjectBox2?: (\n\t\tbox: Temp,\n\t\tidx?: number,\n\t\tisArray?: boolean,\n\t\tisFunc?: boolean\n\t) => Temp\n): Temp | Temp[] | ((fnOrArray?: renderFnOrArrayType) => Temp | Temp[]) {\n\tconst typeMap = {\n\t\tstring: (f?: any) => html` ${f} `,\n\t\tnumber: (f?: any) => html` ${f} `,\n\t};\n\tconst _fnOrArray =\n\t\ttypeof fnOrArray in typeMap\n\t\t\t? typeMap[typeof fnOrArray as \"string\" | \"number\"]\n\t\t\t: fnOrArray;\n\tconst _injectBox = injectBox ?? ((box) => box);\n\tconst curriedFn = (f?: renderFnOrArrayType | string | number) =>\n\t\t_injectBox(renderFnOrArray(f as any, injectBox2)!);\n\n\treturn _fnOrArray ? curriedFn(_fnOrArray) : curriedFn;\n}\n\nconst withInit = (\n\tprefix: string\n): {\n\tinit: boolean;\n\tprefix: string;\n\tclassName: string | typeof ___LYCO_NULL___;\n} => ({\n\tinit: false,\n\tprefix,\n\tclassName: ___LYCO_NULL___,\n});\n\nconst allRandomClassName = {\n\t\"GridBreakpoint::grid-breakpoint\": withInit(\"grid-breakpoint\"),\n\t\"Hidden::hidden-container\": withInit(\"hidden-container\"),\n\t\"ListGroup::list-group\": withInit(\"list-group\"),\n\t\"ScrollBar::scrollbar-container\": withInit(\"scrollbar-container\"),\n\t\"SkeletonLoader::skeleton\": withInit(\"skeleton\"),\n\t\"Swiper::swiper\": withInit(\"swiper\"),\n\t\"Table::table\": withInit(\"table\"),\n\t\"WaterFlow::waterflow\": withInit(\"waterflow\"),\n\t\"AutoFitGrid::auto-fit-grid\": withInit(\"auto-fit-grid\"),\n\t\"GridCol::grid-col\": withInit(\"grid-col\"),\n\t\"GridRow::grid-row\": withInit(\"grid-row\"),\n\t\"List::list\": withInit(\"list\"),\n\t\"Dialog::dialog\": withInit(\"dialog\"),\n\t\"SwitchInput::switch\": withInit(\"switch\"),\n\t\"Combobox::combobox\": withInit(\"combobox\"),\n};\n\nexport function getRandomClassName(key: keyof typeof allRandomClassName) {\n\tconst r = allRandomClassName[key];\n\tif (!r.init) {\n\t\tallRandomClassName[key].init = true;\n\t\tallRandomClassName[key].className = randomClassName(r.prefix);\n\t}\n\treturn allRandomClassName[key].className === ___LYCO_NULL___\n\t\t? randomClassName(r.prefix)\n\t\t: allRandomClassName[key].className;\n}\ntype ComponentCountItem = {\n\tvalue: number;\n};\n\ntype ComponentCount = {\n\t[key: string]: ComponentCountItem;\n} & {\n\tall: ComponentCountItem; // 修改为 ComponentCountItem 类型\n};\nexport const componentCount: ComponentCount = {\n\tall: { value: 0 },\n};\n\nexport function getComponentCount(name: string) {\n\tif (!componentCount[name]?.value) {\n\t\tcomponentCount[name] = { value: 0 };\n\t}\n\treturn componentCount[name].value;\n}\n\nexport function LycoComponent(name: string, slot: Temp) {\n\tcomponentCount.all = {\n\t\tvalue: componentCount.all.value + 1,\n\t};\n\tcomponentCount[name] === undefined\n\t\t? (componentCount[name] = { value: 0 })\n\t\t: (componentCount[name].value = componentCount[name].value + 1);\n\t// console.debug(\n\t// \t`LycoComponent: ${name} - ${componentCount[name].value} - ${componentCount.all.value}`\n\t// );\n\treturn html`\n\t\t<!-- ${name} - ${componentCount[name].value} -->\n\t\t${slot}\n\t`;\n}\n\n// 动画API:支持CSS动画类、任意动画库、CSS属性\nexport class AnimationAPI {\n\tstatic applyAnimation(\n\t\telement: HTMLElement,\n\t\toptions: {\n\t\t\tanimationClass?: string;\n\t\t\tanimation?: (element: HTMLElement) => void;\n\t\t\tcssProperties?: Record<string, string>;\n\t\t\tduration?: number;\n\t\t\tdelay?: number;\n\t\t}\n\t) {\n\t\t// Apply CSS animation class\n\t\tif (options.animationClass) {\n\t\t\telement.classList.add(options.animationClass);\n\t\t\tif (options.duration) {\n\t\t\t\telement.style.animationDuration = `${options.duration}s`;\n\t\t\t}\n\t\t\tif (options.delay) {\n\t\t\t\telement.style.animationDelay = `${options.delay}s`;\n\t\t\t}\n\t\t}\n\n\t\t// Use custom animation function (supports any animation library)\n\t\tif (options.animation) {\n\t\t\toptions.animation(element);\n\t\t}\n\n\t\t// Apply direct CSS styles for animation\n\t\tif (\n\t\t\toptions.cssProperties &&\n\t\t\tObject.keys(options.cssProperties).length > 0\n\t\t) {\n\t\t\tObject.keys(options.cssProperties).forEach((key) => {\n\t\t\t\telement.style[key as any] = options.cssProperties![key];\n\t\t\t});\n\t\t\tif (options.duration) {\n\t\t\t\telement.style.transitionDuration = `${options.duration}s`;\n\t\t\t}\n\t\t}\n\t}\n}\n\ntype EventHandler<K extends keyof GlobalEventHandlersEventMap> =\n\t| ((event: GlobalEventHandlersEventMap[K]) => void)\n\t| {\n\t\t\thandler: (event: GlobalEventHandlersEventMap[K]) => void;\n\t\t\toptions?: boolean | AddEventListenerOptions;\n\t };\n\nexport type OnEvent = {\n\t[K in keyof GlobalEventHandlersEventMap]?: EventHandler<K>;\n};\n\nexport function withEvents(on: OnEvent) {\n\treturn on;\n}\n\nexport function bindEvents(\n\tel: EventTarget,\n\ton: Array<[string, EventHandler<any>]>,\n\teventListeners: Map<string, EventListener>\n): void {\n\ton.forEach(([name, entry]) => {\n\t\tif (!entry) return; // 添加空值检查\n\n\t\tif (eventListeners.has(name)) {\n\t\t\tel.removeEventListener(name, eventListeners.get(name)!);\n\t\t}\n\n\t\tlet handler: (event: Event) => void;\n\t\tlet options: boolean | AddEventListenerOptions | undefined;\n\n\t\tif (typeof entry === \"function\") {\n\t\t\thandler = entry;\n\t\t\toptions = undefined;\n\t\t} else {\n\t\t\thandler = entry.handler;\n\t\t\toptions = entry.options;\n\t\t}\n\n\t\tif (!handler) return; // 确保 handler 存在\n\n\t\tconst listener = (event: Event) => handler(event);\n\t\tel.addEventListener(name, listener, options);\n\t\teventListeners.set(name, listener);\n\t});\n}\n\nexport function createEventBinder(on: OnEvent) {\n\tconst eventListeners = new Map<string, EventListener>();\n\tconst _on = Object.entries(on);\n\tconst _el = {\n\t\tvalue: null as EventTarget | null,\n\t};\n\tconst self = {\n\t\tbind(el: EventTarget) {\n\t\t\tbindEvents(el, _on, eventListeners);\n\t\t\t_el.value = el;\n\t\t},\n\t\tunbindAll() {\n\t\t\teventListeners.forEach((k, v) => {\n\t\t\t\t_el.value?.removeEventListener(v, k);\n\t\t\t});\n\t\t\teventListeners.clear();\n\t\t\t_el.value = null;\n\t\t},\n\t\tauto: (e?: Element) => {\n\t\t\tif (e) {\n\t\t\t\tself.bind(e);\n\t\t\t} else {\n\t\t\t\tself.unbindAll();\n\t\t\t}\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,EAAA,EAAI,QAAO,oBAAoB,EAAG,EAAE,AACpC,EAAC,CACF,EAAe,OAAO,CACtB,EAAI,MAAQ,IACZ,EACD,KAAM,AAACM,GAAgB,CACtB,AAAI,EACH,EAAK,KAAK,EAAE,CAEZ,EAAK,WAAW,AAEjB,CACD,EACD,OAAO,CACP"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import{html as e}from"lit";const t=Symbol(`___LYCO_NULL___`);function n(t){return t?typeof t==`function`?t():t:e``}function r(t,r){let i=r??(e=>e);if(t===void 0)return e``;if(Array.isArray(t))return t.map((e,t)=>i(n(e),t,!0,!1));if(typeof t!=`function`)return i(n(t),void 0,!1,!1);let a=t();return Array.isArray(a)?a.map((e,t)=>i(n(e),t,!0,!1)):i(n(a),void 0,!1,!0)}function i(e){let t=Math.random().toString(36).substring(2,15);return e?`lyco-${e}-${t}`:`lyco-${t}`}function a(e,t){let r=t??(e=>e),i=e=>r(n(e));return e?i(e):i}function o(t,n,i){let a={string:t=>e` ${t} `,number:t=>e` ${t} `},o=typeof t in a?a[typeof t]:t,s=n??(e=>e),c=e=>s(r(e,i));return o?c(o):c}const s=e=>({init:!1,prefix:e,className:t}),c={"GridBreakpoint::grid-breakpoint":s(`grid-breakpoint`),"Hidden::hidden-container":s(`hidden-container`),"ListGroup::list-group":s(`list-group`),"ScrollBar::scrollbar-container":s(`scrollbar-container`),"SkeletonLoader::skeleton":s(`skeleton`),"Swiper::swiper":s(`swiper`),"Table::table":s(`table`),"WaterFlow::waterflow":s(`waterflow`),"AutoFitGrid::auto-fit-grid":s(`auto-fit-grid`),"GridCol::grid-col":s(`grid-col`),"GridRow::grid-row":s(`grid-row`),"List::list":s(`list`),"Dialog::dialog":s(`dialog`),"SwitchInput::switch":s(`switch`),"Combobox::combobox":s(`combobox`)};function l(e){let n=c[e];return n.init||(c[e].init=!0,c[e].className=i(n.prefix)),c[e].className===t?i(n.prefix):c[e].className}const u={all:{value:0}};function d(e){var t;return(t=u[e])?.value||(u[e]={value:0}),u[e].value}function f(t,n){return u.all={value:u.all.value+1},u[t]===void 0?u[t]={value:0}:u[t].value=u[t].value+1,e`
|
2
2
|
<!-- ${t} - ${u[t].value} -->
|
3
3
|
${n}
|
4
|
-
`}
|
5
|
-
//# sourceMappingURL=core-
|
4
|
+
`}var p=class{static applyAnimation(e,t){t.animationClass&&(e.classList.add(t.animationClass),t.duration&&(e.style.animationDuration=`${t.duration}s`),t.delay&&(e.style.animationDelay=`${t.delay}s`)),t.animation&&t.animation(e),t.cssProperties&&Object.keys(t.cssProperties).length>0&&(Object.keys(t.cssProperties).forEach(n=>{e.style[n]=t.cssProperties[n]}),t.duration&&(e.style.transitionDuration=`${t.duration}s`))}};function m(e,t,n){t.forEach(([t,r])=>{if(!r)return;n.has(t)&&e.removeEventListener(t,n.get(t));let i,a;if(typeof r==`function`?(i=r,a=void 0):(i=r.handler,a=r.options),!i)return;let o=e=>i(e);e.addEventListener(t,o,a),n.set(t,o)})}function h(e){let t=new Map,n=Object.entries(e),r={value:null},i={bind(e){m(e,n,t),r.value=e},unbindAll(){t.forEach((e,t)=>{var n;(n=r.value)?.removeEventListener(t,e)}),t.clear(),r.value=null},auto:e=>{e?i.bind(e):i.unbindAll()}};return i}export{p as AnimationAPI,f as LycoComponent,h as createEventBinder,d as getComponentCount,l as getRandomClassName,n as renderFn,r as renderFnOrArray,o as renderFnOrArrayOrCurry,a as renderFnOrCurry};
|
5
|
+
//# sourceMappingURL=core-bQvrG1od.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core-bQvrG1od.mjs","names":["fn?: renderFnType","fnOrArray?: renderFnOrArrayType","injectBox?: (\n\t\tbox: Temp,\n\t\tidx?: number,\n\t\tisArray?: boolean,\n\t\tisFunc?: boolean\n\t) => Temp","prefix?: string","injectBox?: (box: Temp) => Temp","f?: renderFnType","fnOrArray?: renderFnOrArrayType | string | number","injectBox?: (box: Temp | Temp[]) => Temp | Temp[]","injectBox2?: (\n\t\tbox: Temp,\n\t\tidx?: number,\n\t\tisArray?: boolean,\n\t\tisFunc?: boolean\n\t) => Temp","f?: any","f?: renderFnOrArrayType | string | number","prefix: string","key: keyof typeof allRandomClassName","componentCount: ComponentCount","name: string","slot: Temp","element: HTMLElement","options: {\n\t\t\tanimationClass?: string;\n\t\t\tanimation?: (element: HTMLElement) => void;\n\t\t\tcssProperties?: Record<string, string>;\n\t\t\tduration?: number;\n\t\t\tdelay?: number;\n\t\t}","on: OnEvent","el: EventTarget","on: Array<[string, EventHandler<any>]>","eventListeners: Map<string, EventListener>","handler: (event: Event) => void","options: boolean | AddEventListenerOptions | undefined","event: Event","e?: Element"],"sources":["../src/core/index.ts"],"sourcesContent":["import { html, TemplateResult } from \"lit\";\n\nconst ___LYCO_NULL___ = Symbol(\"___LYCO_NULL___\");\nexport type Temp = TemplateResult<1> | TemplateResult;\nexport type renderFnType = Temp | (() => Temp);\nexport type renderFnOrArrayType = renderFnType | Array<Temp> | (() => Temp[]);\n\nexport function renderFn(fn?: renderFnType): Temp {\n\treturn fn ? (typeof fn === \"function\" ? fn() : fn) : html``;\n}\n\nexport type WithHtml<K> = ((children?: K) => Temp) & {\n\thtml: (strings: TemplateStringsArray, ...values: unknown[]) => Temp;\n};\n\nexport function renderFnOrArray(\n\tfnOrArray?: renderFnOrArrayType,\n\tinjectBox?: (\n\t\tbox: Temp,\n\t\tidx?: number,\n\t\tisArray?: boolean,\n\t\tisFunc?: boolean\n\t) => Temp\n): Temp | Temp[] {\n\tlet _injectBox = injectBox ?? ((box) => box);\n\tif (fnOrArray === undefined) {\n\t\treturn html``;\n\t}\n\tif (Array.isArray(fnOrArray)) {\n\t\treturn fnOrArray.map((htmlTemp, idx) =>\n\t\t\t_injectBox(renderFn(htmlTemp), idx, true, false)\n\t\t);\n\t} else if (typeof fnOrArray !== \"function\") {\n\t\treturn _injectBox(renderFn(fnOrArray), undefined, false, false);\n\t}\n\n\tconst result = fnOrArray();\n\tif (Array.isArray(result)) {\n\t\treturn result.map((htmlTemp, idx) =>\n\t\t\t_injectBox(renderFn(htmlTemp), idx, true, false)\n\t\t);\n\t} else {\n\t\treturn _injectBox(renderFn(result), undefined, false, true);\n\t}\n}\n\nexport function randomClassName(prefix?: string): string {\n\tconst random = Math.random().toString(36).substring(2, 15);\n\treturn prefix ? `lyco-${prefix}-${random}` : `lyco-${random}`;\n}\n\nexport function renderFnOrCurry(\n\tfn?: renderFnType,\n\tinjectBox?: (box: Temp) => Temp\n): Temp | ((fn?: renderFnType) => Temp) {\n\tconst _injectBox = injectBox ?? ((box) => box);\n\tconst curriedFn = (f?: renderFnType) => _injectBox(renderFn(f!));\n\n\treturn fn ? curriedFn(fn) : curriedFn;\n}\n\nexport function renderFnOrArrayOrCurry(\n\tfnOrArray?: renderFnOrArrayType | string | number,\n\tinjectBox?: (box: Temp | Temp[]) => Temp | Temp[],\n\tinjectBox2?: (\n\t\tbox: Temp,\n\t\tidx?: number,\n\t\tisArray?: boolean,\n\t\tisFunc?: boolean\n\t) => Temp\n): Temp | Temp[] | ((fnOrArray?: renderFnOrArrayType) => Temp | Temp[]) {\n\tconst typeMap = {\n\t\tstring: (f?: any) => html` ${f} `,\n\t\tnumber: (f?: any) => html` ${f} `,\n\t};\n\tconst _fnOrArray =\n\t\ttypeof fnOrArray in typeMap\n\t\t\t? typeMap[typeof fnOrArray as \"string\" | \"number\"]\n\t\t\t: fnOrArray;\n\tconst _injectBox = injectBox ?? ((box) => box);\n\tconst curriedFn = (f?: renderFnOrArrayType | string | number) =>\n\t\t_injectBox(renderFnOrArray(f as any, injectBox2)!);\n\n\treturn _fnOrArray ? curriedFn(_fnOrArray) : curriedFn;\n}\n\nconst withInit = (\n\tprefix: string\n): {\n\tinit: boolean;\n\tprefix: string;\n\tclassName: string | typeof ___LYCO_NULL___;\n} => ({\n\tinit: false,\n\tprefix,\n\tclassName: ___LYCO_NULL___,\n});\n\nconst allRandomClassName = {\n\t\"GridBreakpoint::grid-breakpoint\": withInit(\"grid-breakpoint\"),\n\t\"Hidden::hidden-container\": withInit(\"hidden-container\"),\n\t\"ListGroup::list-group\": withInit(\"list-group\"),\n\t\"ScrollBar::scrollbar-container\": withInit(\"scrollbar-container\"),\n\t\"SkeletonLoader::skeleton\": withInit(\"skeleton\"),\n\t\"Swiper::swiper\": withInit(\"swiper\"),\n\t\"Table::table\": withInit(\"table\"),\n\t\"WaterFlow::waterflow\": withInit(\"waterflow\"),\n\t\"AutoFitGrid::auto-fit-grid\": withInit(\"auto-fit-grid\"),\n\t\"GridCol::grid-col\": withInit(\"grid-col\"),\n\t\"GridRow::grid-row\": withInit(\"grid-row\"),\n\t\"List::list\": withInit(\"list\"),\n\t\"Dialog::dialog\": withInit(\"dialog\"),\n\t\"SwitchInput::switch\": withInit(\"switch\"),\n\t\"Combobox::combobox\": withInit(\"combobox\"),\n};\n\nexport function getRandomClassName(key: keyof typeof allRandomClassName) {\n\tconst r = allRandomClassName[key];\n\tif (!r.init) {\n\t\tallRandomClassName[key].init = true;\n\t\tallRandomClassName[key].className = randomClassName(r.prefix);\n\t}\n\treturn allRandomClassName[key].className === ___LYCO_NULL___\n\t\t? randomClassName(r.prefix)\n\t\t: allRandomClassName[key].className;\n}\ntype ComponentCountItem = {\n\tvalue: number;\n};\n\ntype ComponentCount = {\n\t[key: string]: ComponentCountItem;\n} & {\n\tall: ComponentCountItem; // 修改为 ComponentCountItem 类型\n};\nexport const componentCount: ComponentCount = {\n\tall: { value: 0 },\n};\n\nexport function getComponentCount(name: string) {\n\tif (!componentCount[name]?.value) {\n\t\tcomponentCount[name] = { value: 0 };\n\t}\n\treturn componentCount[name].value;\n}\n\nexport function LycoComponent(name: string, slot: Temp) {\n\tcomponentCount.all = {\n\t\tvalue: componentCount.all.value + 1,\n\t};\n\tcomponentCount[name] === undefined\n\t\t? (componentCount[name] = { value: 0 })\n\t\t: (componentCount[name].value = componentCount[name].value + 1);\n\t// console.debug(\n\t// \t`LycoComponent: ${name} - ${componentCount[name].value} - ${componentCount.all.value}`\n\t// );\n\treturn html`\n\t\t<!-- ${name} - ${componentCount[name].value} -->\n\t\t${slot}\n\t`;\n}\n\n// 动画API:支持CSS动画类、任意动画库、CSS属性\nexport class AnimationAPI {\n\tstatic applyAnimation(\n\t\telement: HTMLElement,\n\t\toptions: {\n\t\t\tanimationClass?: string;\n\t\t\tanimation?: (element: HTMLElement) => void;\n\t\t\tcssProperties?: Record<string, string>;\n\t\t\tduration?: number;\n\t\t\tdelay?: number;\n\t\t}\n\t) {\n\t\t// Apply CSS animation class\n\t\tif (options.animationClass) {\n\t\t\telement.classList.add(options.animationClass);\n\t\t\tif (options.duration) {\n\t\t\t\telement.style.animationDuration = `${options.duration}s`;\n\t\t\t}\n\t\t\tif (options.delay) {\n\t\t\t\telement.style.animationDelay = `${options.delay}s`;\n\t\t\t}\n\t\t}\n\n\t\t// Use custom animation function (supports any animation library)\n\t\tif (options.animation) {\n\t\t\toptions.animation(element);\n\t\t}\n\n\t\t// Apply direct CSS styles for animation\n\t\tif (\n\t\t\toptions.cssProperties &&\n\t\t\tObject.keys(options.cssProperties).length > 0\n\t\t) {\n\t\t\tObject.keys(options.cssProperties).forEach((key) => {\n\t\t\t\telement.style[key as any] = options.cssProperties![key];\n\t\t\t});\n\t\t\tif (options.duration) {\n\t\t\t\telement.style.transitionDuration = `${options.duration}s`;\n\t\t\t}\n\t\t}\n\t}\n}\n\ntype EventHandler<K extends keyof GlobalEventHandlersEventMap> =\n\t| ((event: GlobalEventHandlersEventMap[K]) => void)\n\t| {\n\t\t\thandler: (event: GlobalEventHandlersEventMap[K]) => void;\n\t\t\toptions?: boolean | AddEventListenerOptions;\n\t };\n\nexport type OnEvent = {\n\t[K in keyof GlobalEventHandlersEventMap]?: EventHandler<K>;\n};\n\nexport function withEvents(on: OnEvent) {\n\treturn on;\n}\n\nexport function bindEvents(\n\tel: EventTarget,\n\ton: Array<[string, EventHandler<any>]>,\n\teventListeners: Map<string, EventListener>\n): void {\n\ton.forEach(([name, entry]) => {\n\t\tif (!entry) return; // 添加空值检查\n\n\t\tif (eventListeners.has(name)) {\n\t\t\tel.removeEventListener(name, eventListeners.get(name)!);\n\t\t}\n\n\t\tlet handler: (event: Event) => void;\n\t\tlet options: boolean | AddEventListenerOptions | undefined;\n\n\t\tif (typeof entry === \"function\") {\n\t\t\thandler = entry;\n\t\t\toptions = undefined;\n\t\t} else {\n\t\t\thandler = entry.handler;\n\t\t\toptions = entry.options;\n\t\t}\n\n\t\tif (!handler) return; // 确保 handler 存在\n\n\t\tconst listener = (event: Event) => handler(event);\n\t\tel.addEventListener(name, listener, options);\n\t\teventListeners.set(name, listener);\n\t});\n}\n\nexport function createEventBinder(on: OnEvent) {\n\tconst eventListeners = new Map<string, EventListener>();\n\tconst _on = Object.entries(on);\n\tconst _el = {\n\t\tvalue: null as EventTarget | null,\n\t};\n\tconst self = {\n\t\tbind(el: EventTarget) {\n\t\t\tbindEvents(el, _on, eventListeners);\n\t\t\t_el.value = el;\n\t\t},\n\t\tunbindAll() {\n\t\t\teventListeners.forEach((k, v) => {\n\t\t\t\t_el.value?.removeEventListener(v, k);\n\t\t\t});\n\t\t\teventListeners.clear();\n\t\t\t_el.value = null;\n\t\t},\n\t\tauto: (e?: Element) => {\n\t\t\tif (e) {\n\t\t\t\tself.bind(e);\n\t\t\t} else {\n\t\t\t\tself.unbindAll();\n\t\t\t}\n\t\t},\n\t};\n\treturn self;\n}\n"],"mappings":"2BAEA,MAAM,EAAkB,OAAO,kBAAkB,CAKjD,SAAgB,EAASA,EAAyB,CACjD,OAAO,SAAa,GAAO,WAAa,GAAI,CAAG,EAAM,EAAK,CAC1D,CAMD,SAAgB,EACfC,EACAC,EAMgB,CAChB,IAAI,EAAa,IAAc,AAAC,GAAQ,GACxC,GAAI,QAAA,GACH,MAAO,GAAK,EAEb,GAAI,MAAM,QAAQ,EAAU,CAC3B,MAAO,GAAU,IAAI,CAAC,EAAU,IAC/B,EAAW,EAAS,EAAS,CAAE,GAAK,GAAM,EAAM,CAChD,WACgB,GAAc,WAC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