solely 0.5.8 → 0.7.0

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.
Files changed (160) hide show
  1. package/README.md +82 -31
  2. package/dist/compiler/ir/buildIR.cjs +1 -1
  3. package/dist/compiler/ir/buildIR.js +1 -1
  4. package/dist/compiler/parser/parser.cjs +1 -1
  5. package/dist/compiler/parser/parser.js +1 -1
  6. package/dist/components/commands/drawer/index.cjs +1 -1
  7. package/dist/components/commands/drawer/index.js +1 -1
  8. package/dist/components/commands/drawer/style.css.cjs +1 -1
  9. package/dist/components/commands/drawer/style.css.js +1 -1
  10. package/dist/components/commands/message/index.cjs +1 -1
  11. package/dist/components/commands/message/index.js +1 -1
  12. package/dist/components/commands/modal/index.cjs +1 -1
  13. package/dist/components/commands/modal/index.js +1 -1
  14. package/dist/components/commands/modal/style.css.cjs +1 -1
  15. package/dist/components/commands/modal/style.css.js +1 -1
  16. package/dist/components/commands/popconfirm/index.cjs +1 -1
  17. package/dist/components/commands/popconfirm/index.js +1 -1
  18. package/dist/components/commands/tooltip/index.cjs +1 -1
  19. package/dist/components/commands/tooltip/index.js +1 -1
  20. package/dist/components/commands/utils.cjs +1 -1
  21. package/dist/components/commands/utils.js +1 -1
  22. package/dist/components/elements/alert/index.cjs +1 -1
  23. package/dist/components/elements/alert/index.html.cjs +1 -1
  24. package/dist/components/elements/alert/index.html.js +1 -1
  25. package/dist/components/elements/alert/index.js +1 -1
  26. package/dist/components/elements/backtop/index.cjs +1 -1
  27. package/dist/components/elements/backtop/index.html.cjs +1 -1
  28. package/dist/components/elements/backtop/index.html.js +1 -1
  29. package/dist/components/elements/backtop/index.js +1 -1
  30. package/dist/components/elements/badge/index.html.cjs +1 -1
  31. package/dist/components/elements/badge/index.html.js +1 -1
  32. package/dist/components/elements/breadcrumb/index.cjs +1 -1
  33. package/dist/components/elements/breadcrumb/index.html.cjs +1 -1
  34. package/dist/components/elements/breadcrumb/index.html.js +1 -1
  35. package/dist/components/elements/breadcrumb/index.js +1 -1
  36. package/dist/components/elements/button/index.cjs +1 -1
  37. package/dist/components/elements/button/index.html.cjs +1 -1
  38. package/dist/components/elements/button/index.html.js +1 -1
  39. package/dist/components/elements/button/index.js +1 -1
  40. package/dist/components/elements/card/index.html.cjs +1 -1
  41. package/dist/components/elements/card/index.html.js +1 -1
  42. package/dist/components/elements/checkbox/index.cjs +1 -1
  43. package/dist/components/elements/checkbox/index.html.cjs +1 -1
  44. package/dist/components/elements/checkbox/index.html.js +1 -1
  45. package/dist/components/elements/checkbox/index.js +1 -1
  46. package/dist/components/elements/coordinate-input/index.html.cjs +1 -1
  47. package/dist/components/elements/coordinate-input/index.html.js +1 -1
  48. package/dist/components/elements/coordinate-input/style.css.cjs +1 -1
  49. package/dist/components/elements/coordinate-input/style.css.js +1 -1
  50. package/dist/components/elements/fab/index.cjs +1 -1
  51. package/dist/components/elements/fab/index.html.cjs +1 -1
  52. package/dist/components/elements/fab/index.html.js +1 -1
  53. package/dist/components/elements/fab/index.js +1 -1
  54. package/dist/components/elements/icon/index.cjs +1 -1
  55. package/dist/components/elements/icon/index.d.ts +8 -0
  56. package/dist/components/elements/icon/index.html.cjs +1 -1
  57. package/dist/components/elements/icon/index.html.js +1 -1
  58. package/dist/components/elements/icon/index.js +1 -1
  59. package/dist/components/elements/input/index.cjs +1 -1
  60. package/dist/components/elements/input/index.html.cjs +1 -1
  61. package/dist/components/elements/input/index.html.js +1 -1
  62. package/dist/components/elements/input/index.js +1 -1
  63. package/dist/components/elements/not-found/index.html.cjs +1 -1
  64. package/dist/components/elements/not-found/index.html.js +1 -1
  65. package/dist/components/elements/not-found/style.css.cjs +1 -1
  66. package/dist/components/elements/not-found/style.css.js +1 -1
  67. package/dist/components/elements/pagination/index.html.cjs +1 -1
  68. package/dist/components/elements/pagination/index.html.js +1 -1
  69. package/dist/components/elements/pagination/style.css.cjs +1 -1
  70. package/dist/components/elements/pagination/style.css.js +1 -1
  71. package/dist/components/elements/progress/index.html.cjs +1 -1
  72. package/dist/components/elements/progress/index.html.js +1 -1
  73. package/dist/components/elements/radio/index.cjs +1 -1
  74. package/dist/components/elements/radio/index.html.cjs +1 -1
  75. package/dist/components/elements/radio/index.html.js +1 -1
  76. package/dist/components/elements/radio/index.js +1 -1
  77. package/dist/components/elements/rate/index.cjs +1 -1
  78. package/dist/components/elements/rate/index.html.cjs +1 -1
  79. package/dist/components/elements/rate/index.html.js +1 -1
  80. package/dist/components/elements/rate/index.js +1 -1
  81. package/dist/components/elements/select/index.cjs +1 -1
  82. package/dist/components/elements/select/index.html.cjs +1 -1
  83. package/dist/components/elements/select/index.html.js +1 -1
  84. package/dist/components/elements/select/index.js +1 -1
  85. package/dist/components/elements/skeleton/index.html.cjs +1 -1
  86. package/dist/components/elements/skeleton/index.html.js +1 -1
  87. package/dist/components/elements/slider/index.cjs +1 -1
  88. package/dist/components/elements/slider/index.html.cjs +1 -1
  89. package/dist/components/elements/slider/index.html.js +1 -1
  90. package/dist/components/elements/slider/index.js +1 -1
  91. package/dist/components/elements/steps/index.cjs +1 -1
  92. package/dist/components/elements/steps/index.html.cjs +1 -1
  93. package/dist/components/elements/steps/index.html.js +1 -1
  94. package/dist/components/elements/steps/index.js +1 -1
  95. package/dist/components/elements/switch/index.cjs +1 -1
  96. package/dist/components/elements/switch/index.html.cjs +1 -1
  97. package/dist/components/elements/switch/index.html.js +1 -1
  98. package/dist/components/elements/switch/index.js +1 -1
  99. package/dist/components/elements/table/index.html.cjs +1 -1
  100. package/dist/components/elements/table/index.html.js +1 -1
  101. package/dist/components/elements/tabs/index.html.cjs +1 -1
  102. package/dist/components/elements/tabs/index.html.js +1 -1
  103. package/dist/components/elements/tag/index.html.cjs +1 -1
  104. package/dist/components/elements/tag/index.html.js +1 -1
  105. package/dist/components/elements/timeline/index.cjs +1 -1
  106. package/dist/components/elements/timeline/index.html.cjs +1 -1
  107. package/dist/components/elements/timeline/index.html.js +1 -1
  108. package/dist/components/elements/timeline/index.js +1 -1
  109. package/dist/components/elements/tooltip/index.cjs +1 -1
  110. package/dist/components/elements/tooltip/index.html.cjs +1 -1
  111. package/dist/components/elements/tooltip/index.html.js +1 -1
  112. package/dist/components/elements/tooltip/index.js +1 -1
  113. package/dist/components/elements/tree/index.cjs +1 -1
  114. package/dist/components/elements/tree/index.d.ts +5 -0
  115. package/dist/components/elements/tree/index.html.cjs +1 -1
  116. package/dist/components/elements/tree/index.html.js +1 -1
  117. package/dist/components/elements/tree/index.js +1 -1
  118. package/dist/components/elements/upload/index.cjs +1 -1
  119. package/dist/components/elements/upload/index.html.cjs +1 -1
  120. package/dist/components/elements/upload/index.html.js +1 -1
  121. package/dist/components/elements/upload/index.js +1 -1
  122. package/dist/index.cjs +1 -1
  123. package/dist/index.js +1 -1
  124. package/dist/plugins/solely-vite-plugin.cjs +1 -1
  125. package/dist/plugins/solely-vite-plugin.d.ts +10 -1
  126. package/dist/plugins/solely-vite-plugin.js +1 -1
  127. package/dist/router/core.cjs +1 -1
  128. package/dist/router/core.js +1 -1
  129. package/dist/router/router-link.cjs +1 -1
  130. package/dist/router/router-link.js +1 -1
  131. package/dist/router/router-view.cjs +1 -1
  132. package/dist/router/router-view.js +1 -1
  133. package/dist/runtime/component/base-element.cjs +1 -1
  134. package/dist/runtime/component/base-element.d.ts +8 -1
  135. package/dist/runtime/component/base-element.js +1 -1
  136. package/dist/runtime/component/decorators.cjs +1 -1
  137. package/dist/runtime/component/decorators.d.ts +7 -0
  138. package/dist/runtime/component/decorators.js +1 -1
  139. package/dist/runtime/reactivity/observe.cjs +1 -1
  140. package/dist/runtime/reactivity/observe.d.ts +1 -0
  141. package/dist/runtime/reactivity/observe.js +1 -1
  142. package/dist/runtime/renderer/html-decode.cjs +1 -1
  143. package/dist/runtime/renderer/html-decode.js +1 -1
  144. package/dist/runtime/renderer/renderIR.cjs +1 -1
  145. package/dist/runtime/renderer/renderIR.js +1 -1
  146. package/dist/shared/env.cjs +1 -1
  147. package/dist/shared/env.js +1 -1
  148. package/dist/shared/functions.d.ts +2 -2
  149. package/dist/shared/gen-function.cjs +1 -1
  150. package/dist/shared/gen-function.js +1 -1
  151. package/dist/shared/index.cjs +1 -1
  152. package/dist/shared/index.d.ts +1 -0
  153. package/dist/shared/index.js +1 -1
  154. package/dist/shared/svg-sanitize.cjs +1 -0
  155. package/dist/shared/svg-sanitize.d.ts +27 -0
  156. package/dist/shared/svg-sanitize.js +1 -0
  157. package/dist/shared/templateError.cjs +1 -1
  158. package/dist/shared/templateError.js +1 -1
  159. package/dist/types/ir.d.ts +2 -2
  160. package/package.json +19 -14
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../utils.cjs"),t=require("./style.css.cjs"),n={width:520,mask:!0,maskClosable:!1,okText:"确定",cancelText:"取消"},l=[],o=new Set,s={info:"ℹ",success:"✓",warning:"⚠",error:"✕",confirm:"?"};async function a(t){var n;if(!o.has(t)){o.add(t);try{const o=l.findIndex(e=>e.id===t);if(-1===o)return;const s=l[o],a=s.element.querySelector(".solely-modal-mask"),c=s.element.querySelector(".solely-modal");a&&a.classList.add("is-closing"),c&&c.classList.add("is-closing"),await e.addClosingAnimation(s.element,e.ANIMATION_DURATION.NORMAL),null==(n=s.cleanup)||n.call(s);const i=l.findIndex(e=>e.id===t);-1!==i&&(l[i].element.remove(),l.splice(i,1))}finally{o.delete(t)}}}async function c(){if(0===l.length)return;const e=l[l.length-1];await a(e.id)}function i(t,n,l,o=!1){const s=e.createElement("button",{className:`solely-modal__btn solely-modal__btn--${"default"===n?"default":n}`,attrs:{type:"button"}});return"string"==typeof t?s.textContent=t:t instanceof HTMLElement&&s.appendChild(o?t.cloneNode(!0):t),s.onclick=()=>e.safeAsyncCallback(l),s}function d(o){const c=e.generateId();e.injectStyle("solely-modal-styles",t.default);const d=o.type||"info",r=o.width??n.width,m=o.showCancel??"confirm"===d,p=o.maskClosable??n.maskClosable,y=e.createElement("div",{className:"solely-modal-wrap",attrs:{tabIndex:"-1",part:"wrap"}}),f=e.observeTheme(()=>y),u=[];if(!1!==o.mask){const t=e.createElement("div",{className:"solely-modal-mask"});if(p){const e=()=>{var e;a(c),null==(e=o.onCancel)||e.call(o)};t.onclick=e,u.push({element:t,type:"click",handler:e})}y.appendChild(t)}const h=e.createElement("div",{className:"solely-modal"+(o.className?` ${o.className}`:""),styles:{...o.style,width:"number"==typeof r?`${r}px`:r}}),C=e.createElement("div",{className:"solely-modal__header"}),b=e.createElement("h3",{className:"solely-modal__title"});if("string"==typeof o.title)b.textContent=o.title||"";else if(o.title instanceof HTMLElement){const e=o.cloneElement??!1;b.appendChild(e?o.title.cloneNode(!0):o.title)}if(C.appendChild(b),!1!==o.closable){const t=e.createElement("button",{className:"solely-modal__close",textContent:"×",attrs:{type:"button","aria-label":"关闭",part:"close"}}),n=()=>{var e;a(c),null==(e=o.onClose)||e.call(o)};t.onclick=n,u.push({element:t,type:"click",handler:n}),C.appendChild(t)}h.appendChild(C);const E=e.createElement("div",{className:"solely-modal__body"}),_=e.createElement("div",{className:"solely-modal__content-wrapper"});if(!1!==o.showIcon){const t=e.createElement("span",{className:`solely-modal__icon solely-modal__icon--${d}`,textContent:s[d]});_.appendChild(t)}const N=e.createElement("div",{className:"solely-modal__content"});if("string"==typeof o.content)N.textContent=o.content||"";else if(o.content instanceof HTMLElement){const e=o.cloneElement??!1;N.appendChild(e?o.content.cloneNode(!0):o.content)}_.appendChild(N),E.appendChild(_),h.appendChild(E);const w=e.createElement("div",{className:"solely-modal__footer"});if(o.buttons&&o.buttons.length>0)o.buttons.forEach(t=>{const n=i(t.text,t.type||"default",async()=>{await e.safeAsyncCallback(()=>t.onClick())},o.cloneElement);t.style&&Object.assign(n.style,t.style),w.appendChild(n)});else{if(m){const e=i(o.cancelText||n.cancelText,"default",()=>{var e;a(c),null==(e=o.onCancel)||e.call(o)},o.cloneElement);w.appendChild(e)}const t=i(o.okText||n.okText,o.okType||"primary",async()=>{const t=o.onConfirm||o.onOk;t&&!1===await e.safeAsyncCallback(()=>t())||a(c)},o.cloneElement);w.appendChild(t)}h.appendChild(w),y.appendChild(h),document.body.appendChild(y),l.push({id:c,element:y,instance:null,cleanup:()=>{u.forEach(({element:e,type:t,handler:n})=>{e.removeEventListener(t,n)}),f()}});const v={close:()=>{var e;a(c),null==(e=o.onClose)||e.call(o)},update:e=>{if(void 0!==e.title){const t=y.querySelector(".solely-modal__title");if(t)if(t.innerHTML="","string"==typeof e.title)t.textContent=e.title;else if(e.title instanceof HTMLElement){const n=e.cloneElement??!1;t.appendChild(n?e.title.cloneNode(!0):e.title)}}if(void 0!==e.content){const t=y.querySelector(".solely-modal__content");if(t)if(t.innerHTML="","string"==typeof e.content)t.textContent=e.content;else if(e.content instanceof HTMLElement){const n=e.cloneElement??!1;t.appendChild(n?e.content.cloneNode(!0):e.content)}}if(void 0!==e.width){const t=y.querySelector(".solely-modal");t&&(t.style.width="number"==typeof e.width?`${e.width}px`:e.width)}if(void 0!==e.className){const t=y.querySelector(".solely-modal");t&&(t.className=`solely-modal ${e.className}`.trim())}if(void 0!==e.style){const t=y.querySelector(".solely-modal");t&&Object.assign(t.style,e.style)}}},g=l.find(e=>e.id===c);return g&&(g.instance=v),v}const r={open:d,confirm:function(e){return d({...e,type:"confirm",showCancel:!0})},info:function(e){return d({...e,type:"info"})},success:function(e){return d({...e,type:"success"})},error:function(e){return d({...e,type:"error"})},warning:function(e){return d({...e,type:"warning"})},config:function(e){Object.assign(n,e)},destroy:async function(){for(;l.length>0;)await c()}};exports.Modal=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../utils.cjs"),t=require("./style.css.cjs"),n={width:520,mask:!0,maskClosable:!1,okText:"确定",cancelText:"取消"},l=[],o=new Set,s={info:"ℹ",success:"✓",warning:"⚠",error:"✕",confirm:"?"};async function a(t){if(!o.has(t)){o.add(t);try{const n=l.findIndex(e=>e.id===t);if(-1===n)return;const o=l[n],s=o.element.querySelector(".solely-modal-mask"),a=o.element.querySelector(".solely-modal");s&&s.classList.add("is-closing"),a&&a.classList.add("is-closing"),await e.addClosingAnimation(o.element,e.ANIMATION_DURATION.NORMAL),o.cleanup?.();const c=l.findIndex(e=>e.id===t);-1!==c&&(l[c].element.remove(),l.splice(c,1))}finally{o.delete(t)}}}async function c(){if(0===l.length)return;const e=l[l.length-1];await a(e.id)}function i(t,n,l,o=!1){const s=e.createElement("button",{className:`solely-modal__btn solely-modal__btn--${"default"===n?"default":n}`,attrs:{type:"button"}});return"string"==typeof t?s.textContent=t:t instanceof HTMLElement&&s.appendChild(o?t.cloneNode(!0):t),s.onclick=()=>e.safeAsyncCallback(l),s}function d(o){const c=e.generateId();e.injectStyle("solely-modal-styles",t.default);const d=o.type||"info",r=o.width??n.width,m=o.showCancel??"confirm"===d,p=o.maskClosable??n.maskClosable,y=e.createElement("div",{className:"solely-modal-wrap",attrs:{tabIndex:"-1",part:"wrap"}}),f=e.observeTheme(()=>y),u=[];if(!1!==o.mask){const t=e.createElement("div",{className:"solely-modal-mask"});if(p){const e=()=>{a(c),o.onCancel?.()};t.onclick=e,u.push({element:t,type:"click",handler:e})}y.appendChild(t)}const h=e.createElement("div",{className:"solely-modal"+(o.className?` ${o.className}`:""),styles:{...o.style,width:"number"==typeof r?`${r}px`:r}}),C=e.createElement("div",{className:"solely-modal__header"}),b=e.createElement("h3",{className:"solely-modal__title"});if("string"==typeof o.title)b.textContent=o.title||"";else if(o.title instanceof HTMLElement){const e=o.cloneElement??!1;b.appendChild(e?o.title.cloneNode(!0):o.title)}if(C.appendChild(b),!1!==o.closable){const t=e.createElement("button",{className:"solely-modal__close",textContent:"×",attrs:{type:"button","aria-label":"关闭",part:"close"}}),n=()=>{a(c),o.onClose?.()};t.onclick=n,u.push({element:t,type:"click",handler:n}),C.appendChild(t)}h.appendChild(C);const E=e.createElement("div",{className:"solely-modal__body"}),_=e.createElement("div",{className:"solely-modal__content-wrapper"});if(!1!==o.showIcon){const t=e.createElement("span",{className:`solely-modal__icon solely-modal__icon--${d}`,textContent:s[d]});_.appendChild(t)}const N=e.createElement("div",{className:"solely-modal__content"});if("string"==typeof o.content)N.textContent=o.content||"";else if(o.content instanceof HTMLElement){const e=o.cloneElement??!1;N.appendChild(e?o.content.cloneNode(!0):o.content)}_.appendChild(N),E.appendChild(_),h.appendChild(E);const w=e.createElement("div",{className:"solely-modal__footer"});if(o.buttons&&o.buttons.length>0)o.buttons.forEach(t=>{const n=i(t.text,t.type||"default",async()=>{await e.safeAsyncCallback(()=>t.onClick())},o.cloneElement);t.style&&Object.assign(n.style,t.style),w.appendChild(n)});else{if(m){const e=i(o.cancelText||n.cancelText,"default",()=>{a(c),o.onCancel?.()},o.cloneElement);w.appendChild(e)}const t=i(o.okText||n.okText,o.okType||"primary",async()=>{const t=o.onConfirm||o.onOk;t&&!1===await e.safeAsyncCallback(()=>t())||a(c)},o.cloneElement);w.appendChild(t)}h.appendChild(w),y.appendChild(h),document.body.appendChild(y),l.push({id:c,element:y,instance:null,cleanup:()=>{u.forEach(({element:e,type:t,handler:n})=>{e.removeEventListener(t,n)}),f()}});const g={close:()=>{a(c),o.onClose?.()},update:e=>{if(void 0!==e.title){const t=y.querySelector(".solely-modal__title");if(t)if(t.innerHTML="","string"==typeof e.title)t.textContent=e.title;else if(e.title instanceof HTMLElement){const n=e.cloneElement??!1;t.appendChild(n?e.title.cloneNode(!0):e.title)}}if(void 0!==e.content){const t=y.querySelector(".solely-modal__content");if(t)if(t.innerHTML="","string"==typeof e.content)t.textContent=e.content;else if(e.content instanceof HTMLElement){const n=e.cloneElement??!1;t.appendChild(n?e.content.cloneNode(!0):e.content)}}if(void 0!==e.width){const t=y.querySelector(".solely-modal");t&&(t.style.width="number"==typeof e.width?`${e.width}px`:e.width)}if(void 0!==e.className){const t=y.querySelector(".solely-modal");t&&(t.className=`solely-modal ${e.className}`.trim())}if(void 0!==e.style){const t=y.querySelector(".solely-modal");t&&Object.assign(t.style,e.style)}}},k=l.find(e=>e.id===c);return k&&(k.instance=g),g}const r={open:d,confirm:function(e){return d({...e,type:"confirm",showCancel:!0})},info:function(e){return d({...e,type:"info"})},success:function(e){return d({...e,type:"success"})},error:function(e){return d({...e,type:"error"})},warning:function(e){return d({...e,type:"warning"})},config:function(e){Object.assign(n,e)},destroy:async function(){for(;l.length>0;)await c()}};exports.Modal=r;
@@ -1 +1 @@
1
- import{createElement as e,observeTheme as t,safeAsyncCallback as n,injectStyle as l,addClosingAnimation as o,ANIMATION_DURATION as s,generateId as a}from"../utils.js";import c from"./style.css.js";const i={width:520,mask:!0,maskClosable:!1,okText:"确定",cancelText:"取消"},d=[],r=new Set,m={info:"ℹ",success:"✓",warning:"⚠",error:"✕",confirm:"?"};async function p(e){var t;if(!r.has(e)){r.add(e);try{const n=d.findIndex(t=>t.id===e);if(-1===n)return;const l=d[n],a=l.element.querySelector(".solely-modal-mask"),c=l.element.querySelector(".solely-modal");a&&a.classList.add("is-closing"),c&&c.classList.add("is-closing"),await o(l.element,s.NORMAL),null==(t=l.cleanup)||t.call(l);const i=d.findIndex(t=>t.id===e);-1!==i&&(d[i].element.remove(),d.splice(i,1))}finally{r.delete(e)}}}async function y(){if(0===d.length)return;const e=d[d.length-1];await p(e.id)}function f(t,l,o,s=!1){const a=e("button",{className:`solely-modal__btn solely-modal__btn--${"default"===l?"default":l}`,attrs:{type:"button"}});return"string"==typeof t?a.textContent=t:t instanceof HTMLElement&&a.appendChild(s?t.cloneNode(!0):t),a.onclick=()=>n(o),a}function u(o){const s=a();l("solely-modal-styles",c);const r=o.type||"info",y=o.width??i.width,u=o.showCancel??"confirm"===r,h=o.maskClosable??i.maskClosable,C=e("div",{className:"solely-modal-wrap",attrs:{tabIndex:"-1",part:"wrap"}}),_=t(()=>C),w=[];if(!1!==o.mask){const t=e("div",{className:"solely-modal-mask"});if(h){const e=()=>{var e;p(s),null==(e=o.onCancel)||e.call(o)};t.onclick=e,w.push({element:t,type:"click",handler:e})}C.appendChild(t)}const N=e("div",{className:"solely-modal"+(o.className?` ${o.className}`:""),styles:{...o.style,width:"number"==typeof y?`${y}px`:y}}),b=e("div",{className:"solely-modal__header"}),v=e("h3",{className:"solely-modal__title"});if("string"==typeof o.title)v.textContent=o.title||"";else if(o.title instanceof HTMLElement){const e=o.cloneElement??!1;v.appendChild(e?o.title.cloneNode(!0):o.title)}if(b.appendChild(v),!1!==o.closable){const t=e("button",{className:"solely-modal__close",textContent:"×",attrs:{type:"button","aria-label":"关闭",part:"close"}}),n=()=>{var e;p(s),null==(e=o.onClose)||e.call(o)};t.onclick=n,w.push({element:t,type:"click",handler:n}),b.appendChild(t)}N.appendChild(b);const x=e("div",{className:"solely-modal__body"}),g=e("div",{className:"solely-modal__content-wrapper"});if(!1!==o.showIcon){const t=e("span",{className:`solely-modal__icon solely-modal__icon--${r}`,textContent:m[r]});g.appendChild(t)}const k=e("div",{className:"solely-modal__content"});if("string"==typeof o.content)k.textContent=o.content||"";else if(o.content instanceof HTMLElement){const e=o.cloneElement??!1;k.appendChild(e?o.content.cloneNode(!0):o.content)}g.appendChild(k),x.appendChild(g),N.appendChild(x);const E=e("div",{className:"solely-modal__footer"});if(o.buttons&&o.buttons.length>0)o.buttons.forEach(e=>{const t=f(e.text,e.type||"default",async()=>{await n(()=>e.onClick())},o.cloneElement);e.style&&Object.assign(t.style,e.style),E.appendChild(t)});else{if(u){const e=f(o.cancelText||i.cancelText,"default",()=>{var e;p(s),null==(e=o.onCancel)||e.call(o)},o.cloneElement);E.appendChild(e)}const e=f(o.okText||i.okText,o.okType||"primary",async()=>{const e=o.onConfirm||o.onOk;e&&!1===await n(()=>e())||p(s)},o.cloneElement);E.appendChild(e)}N.appendChild(E),C.appendChild(N),document.body.appendChild(C),d.push({id:s,element:C,instance:null,cleanup:()=>{w.forEach(({element:e,type:t,handler:n})=>{e.removeEventListener(t,n)}),_()}});const T={close:()=>{var e;p(s),null==(e=o.onClose)||e.call(o)},update:e=>{if(void 0!==e.title){const t=C.querySelector(".solely-modal__title");if(t)if(t.innerHTML="","string"==typeof e.title)t.textContent=e.title;else if(e.title instanceof HTMLElement){const n=e.cloneElement??!1;t.appendChild(n?e.title.cloneNode(!0):e.title)}}if(void 0!==e.content){const t=C.querySelector(".solely-modal__content");if(t)if(t.innerHTML="","string"==typeof e.content)t.textContent=e.content;else if(e.content instanceof HTMLElement){const n=e.cloneElement??!1;t.appendChild(n?e.content.cloneNode(!0):e.content)}}if(void 0!==e.width){const t=C.querySelector(".solely-modal");t&&(t.style.width="number"==typeof e.width?`${e.width}px`:e.width)}if(void 0!==e.className){const t=C.querySelector(".solely-modal");t&&(t.className=`solely-modal ${e.className}`.trim())}if(void 0!==e.style){const t=C.querySelector(".solely-modal");t&&Object.assign(t.style,e.style)}}},L=d.find(e=>e.id===s);return L&&(L.instance=T),T}const h={open:u,confirm:function(e){return u({...e,type:"confirm",showCancel:!0})},info:function(e){return u({...e,type:"info"})},success:function(e){return u({...e,type:"success"})},error:function(e){return u({...e,type:"error"})},warning:function(e){return u({...e,type:"warning"})},config:function(e){Object.assign(i,e)},destroy:async function(){for(;d.length>0;)await y()}};export{h as Modal};
1
+ import{createElement as e,observeTheme as t,safeAsyncCallback as n,injectStyle as l,addClosingAnimation as o,ANIMATION_DURATION as s,generateId as c}from"../utils.js";import a from"./style.css.js";const i={width:520,mask:!0,maskClosable:!1,okText:"确定",cancelText:"取消"},d=[],r=new Set,m={info:"ℹ",success:"✓",warning:"⚠",error:"✕",confirm:"?"};async function p(e){if(!r.has(e)){r.add(e);try{const t=d.findIndex(t=>t.id===e);if(-1===t)return;const n=d[t],l=n.element.querySelector(".solely-modal-mask"),c=n.element.querySelector(".solely-modal");l&&l.classList.add("is-closing"),c&&c.classList.add("is-closing"),await o(n.element,s.NORMAL),n.cleanup?.();const a=d.findIndex(t=>t.id===e);-1!==a&&(d[a].element.remove(),d.splice(a,1))}finally{r.delete(e)}}}async function y(){if(0===d.length)return;const e=d[d.length-1];await p(e.id)}function f(t,l,o,s=!1){const c=e("button",{className:`solely-modal__btn solely-modal__btn--${"default"===l?"default":l}`,attrs:{type:"button"}});return"string"==typeof t?c.textContent=t:t instanceof HTMLElement&&c.appendChild(s?t.cloneNode(!0):t),c.onclick=()=>n(o),c}function u(o){const s=c();l("solely-modal-styles",a);const r=o.type||"info",y=o.width??i.width,u=o.showCancel??"confirm"===r,h=o.maskClosable??i.maskClosable,C=e("div",{className:"solely-modal-wrap",attrs:{tabIndex:"-1",part:"wrap"}}),_=t(()=>C),w=[];if(!1!==o.mask){const t=e("div",{className:"solely-modal-mask"});if(h){const e=()=>{p(s),o.onCancel?.()};t.onclick=e,w.push({element:t,type:"click",handler:e})}C.appendChild(t)}const N=e("div",{className:"solely-modal"+(o.className?` ${o.className}`:""),styles:{...o.style,width:"number"==typeof y?`${y}px`:y}}),b=e("div",{className:"solely-modal__header"}),x=e("h3",{className:"solely-modal__title"});if("string"==typeof o.title)x.textContent=o.title||"";else if(o.title instanceof HTMLElement){const e=o.cloneElement??!1;x.appendChild(e?o.title.cloneNode(!0):o.title)}if(b.appendChild(x),!1!==o.closable){const t=e("button",{className:"solely-modal__close",textContent:"×",attrs:{type:"button","aria-label":"关闭",part:"close"}}),n=()=>{p(s),o.onClose?.()};t.onclick=n,w.push({element:t,type:"click",handler:n}),b.appendChild(t)}N.appendChild(b);const g=e("div",{className:"solely-modal__body"}),k=e("div",{className:"solely-modal__content-wrapper"});if(!1!==o.showIcon){const t=e("span",{className:`solely-modal__icon solely-modal__icon--${r}`,textContent:m[r]});k.appendChild(t)}const v=e("div",{className:"solely-modal__content"});if("string"==typeof o.content)v.textContent=o.content||"";else if(o.content instanceof HTMLElement){const e=o.cloneElement??!1;v.appendChild(e?o.content.cloneNode(!0):o.content)}k.appendChild(v),g.appendChild(k),N.appendChild(g);const E=e("div",{className:"solely-modal__footer"});if(o.buttons&&o.buttons.length>0)o.buttons.forEach(e=>{const t=f(e.text,e.type||"default",async()=>{await n(()=>e.onClick())},o.cloneElement);e.style&&Object.assign(t.style,e.style),E.appendChild(t)});else{if(u){const e=f(o.cancelText||i.cancelText,"default",()=>{p(s),o.onCancel?.()},o.cloneElement);E.appendChild(e)}const e=f(o.okText||i.okText,o.okType||"primary",async()=>{const e=o.onConfirm||o.onOk;e&&!1===await n(()=>e())||p(s)},o.cloneElement);E.appendChild(e)}N.appendChild(E),C.appendChild(N),document.body.appendChild(C),d.push({id:s,element:C,instance:null,cleanup:()=>{w.forEach(({element:e,type:t,handler:n})=>{e.removeEventListener(t,n)}),_()}});const T={close:()=>{p(s),o.onClose?.()},update:e=>{if(void 0!==e.title){const t=C.querySelector(".solely-modal__title");if(t)if(t.innerHTML="","string"==typeof e.title)t.textContent=e.title;else if(e.title instanceof HTMLElement){const n=e.cloneElement??!1;t.appendChild(n?e.title.cloneNode(!0):e.title)}}if(void 0!==e.content){const t=C.querySelector(".solely-modal__content");if(t)if(t.innerHTML="","string"==typeof e.content)t.textContent=e.content;else if(e.content instanceof HTMLElement){const n=e.cloneElement??!1;t.appendChild(n?e.content.cloneNode(!0):e.content)}}if(void 0!==e.width){const t=C.querySelector(".solely-modal");t&&(t.style.width="number"==typeof e.width?`${e.width}px`:e.width)}if(void 0!==e.className){const t=C.querySelector(".solely-modal");t&&(t.className=`solely-modal ${e.className}`.trim())}if(void 0!==e.style){const t=C.querySelector(".solely-modal");t&&Object.assign(t.style,e.style)}}},L=d.find(e=>e.id===s);return L&&(L.instance=T),T}const h={open:u,confirm:function(e){return u({...e,type:"confirm",showCancel:!0})},info:function(e){return u({...e,type:"info"})},success:function(e){return u({...e,type:"success"})},error:function(e){return u({...e,type:"error"})},warning:function(e){return u({...e,type:"warning"})},config:function(e){Object.assign(i,e)},destroy:async function(){for(;d.length>0;)await y()}};export{h as Modal};
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default=".solely-modal,.solely-modal *,.solely-modal *:before,.solely-modal *:after,.solely-modal-mask,.solely-modal-wrap{box-sizing:border-box}.solely-modal-mask{position:fixed;top:0;left:0;right:0;bottom:0;background-color:var(--solely-mask-bg);z-index:1;pointer-events:auto;animation:solely-modal-mask-in var(--solely-transition-duration) var(--solely-transition-timing)}.solely-modal-mask.is-closing{animation:solely-modal-mask-out var(--solely-transition-duration) var(--solely-transition-timing) forwards}.solely-modal-wrap{position:fixed;top:0;left:0;right:0;bottom:0;z-index:var(--solely-z-index-modal);display:flex;align-items:center;justify-content:center;overflow:auto;outline:0;pointer-events:none}.solely-modal{position:relative;z-index:2;background-color:var(--solely-component-bg);border-radius:var(--solely-border-radius-md);box-shadow:var(--solely-shadow-lg);animation:solely-modal-container-in var(--solely-transition-duration) var(--solely-transition-timing);max-width:calc(100vw - var(--solely-spacing-xl));margin:var(--solely-spacing-md);pointer-events:auto}.solely-modal.is-closing{animation:solely-modal-container-out var(--solely-transition-duration) var(--solely-transition-timing) forwards}.solely-modal__header{padding:var(--solely-spacing-lg) var(--solely-spacing-xl);border-bottom:1px solid var(--solely-border-color-split);display:flex;align-items:center;justify-content:space-between}.solely-modal__title{margin:0;font-size:var(--solely-font-size-lg);font-weight:500;color:var(--solely-text-primary);line-height:var(--solely-line-height-lg)}.solely-modal__close{width:var(--solely-height-sm);height:var(--solely-height-sm);display:flex;align-items:center;justify-content:center;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration);font-size:var(--solely-font-size-lg);line-height:1;border:none;background:none;border-radius:var(--solely-border-radius-sm)}.solely-modal__close:hover{color:var(--solely-text-secondary);background-color:var(--solely-gray-3)}.solely-modal__close:active{color:var(--solely-text-primary)}.solely-modal__body{padding:var(--solely-spacing-xl);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);color:var(--solely-text-secondary)}.solely-modal__content-wrapper{display:flex;align-items:flex-start;gap:var(--solely-spacing-sm)}.solely-modal__content{width:100%}.solely-modal__footer{padding:var(--solely-spacing-md) var(--solely-spacing-lg);border-top:1px solid var(--solely-border-color-split);display:flex;justify-content:flex-end;gap:var(--solely-spacing-sm)}.solely-modal__icon{display:inline-flex;align-items:center;justify-content:center;width:var(--solely-height-sm);height:var(--solely-height-sm);border-radius:var(--solely-border-radius-circle);margin-right:var(--solely-spacing-sm);font-size:var(--solely-font-size-md)}.solely-modal__icon--info{background-color:var(--solely-info-light);color:var(--solely-info)}.solely-modal__icon--success{background-color:var(--solely-success-light);color:var(--solely-success)}.solely-modal__icon--warning{background-color:var(--solely-warning-light);color:var(--solely-warning)}.solely-modal__icon--error{background-color:var(--solely-error-light);color:var(--solely-error)}.solely-modal__icon--confirm{background-color:var(--solely-warning-light);color:var(--solely-warning)}.solely-modal__btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--solely-spacing-xs);height:var(--solely-height-md);padding:0 var(--solely-spacing-md);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);font-weight:400;line-height:var(--solely-line-height-md);white-space:nowrap;text-align:center;text-decoration:none;vertical-align:middle;background-image:none;border:1px solid transparent;border-radius:var(--solely-border-radius-md);cursor:pointer;transition:all var(--solely-transition-duration) var(--solely-transition-timing);-webkit-user-select:none;user-select:none;touch-action:manipulation;outline:none;position:relative}.solely-modal__btn:hover:not(:disabled){opacity:.9}.solely-modal__btn:active:not(:disabled){opacity:.8}.solely-modal__btn:disabled{opacity:.4;cursor:not-allowed}.solely-modal__btn--primary{color:var(--solely-white);background-color:var(--solely-primary);border-color:var(--solely-primary)}.solely-modal__btn--default{color:var(--solely-text-primary);background-color:var(--solely-component-bg);border-color:var(--solely-border-color)}.solely-modal__btn--danger{color:var(--solely-white);background-color:var(--solely-error);border-color:var(--solely-error)}@keyframes solely-modal-mask-in{0%{opacity:0}to{opacity:1}}@keyframes solely-modal-mask-out{0%{opacity:1}to{opacity:0}}@keyframes solely-modal-container-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes solely-modal-container-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}";
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default=".solely-modal,.solely-modal *,.solely-modal *:before,.solely-modal *:after,.solely-modal-mask,.solely-modal-wrap{box-sizing:border-box}.solely-modal-mask{position:fixed;inset:0;background-color:var(--solely-mask-bg);z-index:1;pointer-events:auto;animation:solely-modal-mask-in var(--solely-transition-duration) var(--solely-transition-timing)}.solely-modal-mask.is-closing{animation:solely-modal-mask-out var(--solely-transition-duration) var(--solely-transition-timing) forwards}.solely-modal-wrap{position:fixed;inset:0;z-index:var(--solely-z-index-modal);display:flex;align-items:center;justify-content:center;overflow:auto;outline:0;pointer-events:none}.solely-modal{position:relative;z-index:2;background-color:var(--solely-component-bg);border-radius:var(--solely-border-radius-md);box-shadow:var(--solely-shadow-lg);animation:solely-modal-container-in var(--solely-transition-duration) var(--solely-transition-timing);max-width:calc(100vw - var(--solely-spacing-xl));margin:var(--solely-spacing-md);pointer-events:auto}.solely-modal.is-closing{animation:solely-modal-container-out var(--solely-transition-duration) var(--solely-transition-timing) forwards}.solely-modal__header{padding:var(--solely-spacing-lg) var(--solely-spacing-xl);border-bottom:1px solid var(--solely-border-color-split);display:flex;align-items:center;justify-content:space-between}.solely-modal__title{margin:0;font-size:var(--solely-font-size-lg);font-weight:500;color:var(--solely-text-primary);line-height:var(--solely-line-height-lg)}.solely-modal__close{width:var(--solely-height-sm);height:var(--solely-height-sm);display:flex;align-items:center;justify-content:center;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration);font-size:var(--solely-font-size-lg);line-height:1;border:none;background:none;border-radius:var(--solely-border-radius-sm)}.solely-modal__close:hover{color:var(--solely-text-secondary);background-color:var(--solely-gray-3)}.solely-modal__close:active{color:var(--solely-text-primary)}.solely-modal__body{padding:var(--solely-spacing-xl);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);color:var(--solely-text-secondary)}.solely-modal__content-wrapper{display:flex;align-items:flex-start;gap:var(--solely-spacing-sm)}.solely-modal__content{width:100%}.solely-modal__footer{padding:var(--solely-spacing-md) var(--solely-spacing-lg);border-top:1px solid var(--solely-border-color-split);display:flex;justify-content:flex-end;gap:var(--solely-spacing-sm)}.solely-modal__icon{display:inline-flex;align-items:center;justify-content:center;width:var(--solely-height-sm);height:var(--solely-height-sm);border-radius:var(--solely-border-radius-circle);margin-right:var(--solely-spacing-sm);font-size:var(--solely-font-size-md)}.solely-modal__icon--info{background-color:var(--solely-info-light);color:var(--solely-info)}.solely-modal__icon--success{background-color:var(--solely-success-light);color:var(--solely-success)}.solely-modal__icon--warning{background-color:var(--solely-warning-light);color:var(--solely-warning)}.solely-modal__icon--error{background-color:var(--solely-error-light);color:var(--solely-error)}.solely-modal__icon--confirm{background-color:var(--solely-warning-light);color:var(--solely-warning)}.solely-modal__btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--solely-spacing-xs);height:var(--solely-height-md);padding:0 var(--solely-spacing-md);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);font-weight:400;line-height:var(--solely-line-height-md);white-space:nowrap;text-align:center;text-decoration:none;vertical-align:middle;background-image:none;border:1px solid transparent;border-radius:var(--solely-border-radius-md);cursor:pointer;transition:all var(--solely-transition-duration) var(--solely-transition-timing);-webkit-user-select:none;user-select:none;touch-action:manipulation;outline:none;position:relative}.solely-modal__btn:hover:not(:disabled){opacity:.9}.solely-modal__btn:active:not(:disabled){opacity:.8}.solely-modal__btn:disabled{opacity:.4;cursor:not-allowed}.solely-modal__btn--primary{color:var(--solely-white);background-color:var(--solely-primary);border-color:var(--solely-primary)}.solely-modal__btn--default{color:var(--solely-text-primary);background-color:var(--solely-component-bg);border-color:var(--solely-border-color)}.solely-modal__btn--danger{color:var(--solely-white);background-color:var(--solely-error);border-color:var(--solely-error)}@keyframes solely-modal-mask-in{0%{opacity:0}to{opacity:1}}@keyframes solely-modal-mask-out{0%{opacity:1}to{opacity:0}}@keyframes solely-modal-container-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes solely-modal-container-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}";
@@ -1 +1 @@
1
- const o=".solely-modal,.solely-modal *,.solely-modal *:before,.solely-modal *:after,.solely-modal-mask,.solely-modal-wrap{box-sizing:border-box}.solely-modal-mask{position:fixed;top:0;left:0;right:0;bottom:0;background-color:var(--solely-mask-bg);z-index:1;pointer-events:auto;animation:solely-modal-mask-in var(--solely-transition-duration) var(--solely-transition-timing)}.solely-modal-mask.is-closing{animation:solely-modal-mask-out var(--solely-transition-duration) var(--solely-transition-timing) forwards}.solely-modal-wrap{position:fixed;top:0;left:0;right:0;bottom:0;z-index:var(--solely-z-index-modal);display:flex;align-items:center;justify-content:center;overflow:auto;outline:0;pointer-events:none}.solely-modal{position:relative;z-index:2;background-color:var(--solely-component-bg);border-radius:var(--solely-border-radius-md);box-shadow:var(--solely-shadow-lg);animation:solely-modal-container-in var(--solely-transition-duration) var(--solely-transition-timing);max-width:calc(100vw - var(--solely-spacing-xl));margin:var(--solely-spacing-md);pointer-events:auto}.solely-modal.is-closing{animation:solely-modal-container-out var(--solely-transition-duration) var(--solely-transition-timing) forwards}.solely-modal__header{padding:var(--solely-spacing-lg) var(--solely-spacing-xl);border-bottom:1px solid var(--solely-border-color-split);display:flex;align-items:center;justify-content:space-between}.solely-modal__title{margin:0;font-size:var(--solely-font-size-lg);font-weight:500;color:var(--solely-text-primary);line-height:var(--solely-line-height-lg)}.solely-modal__close{width:var(--solely-height-sm);height:var(--solely-height-sm);display:flex;align-items:center;justify-content:center;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration);font-size:var(--solely-font-size-lg);line-height:1;border:none;background:none;border-radius:var(--solely-border-radius-sm)}.solely-modal__close:hover{color:var(--solely-text-secondary);background-color:var(--solely-gray-3)}.solely-modal__close:active{color:var(--solely-text-primary)}.solely-modal__body{padding:var(--solely-spacing-xl);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);color:var(--solely-text-secondary)}.solely-modal__content-wrapper{display:flex;align-items:flex-start;gap:var(--solely-spacing-sm)}.solely-modal__content{width:100%}.solely-modal__footer{padding:var(--solely-spacing-md) var(--solely-spacing-lg);border-top:1px solid var(--solely-border-color-split);display:flex;justify-content:flex-end;gap:var(--solely-spacing-sm)}.solely-modal__icon{display:inline-flex;align-items:center;justify-content:center;width:var(--solely-height-sm);height:var(--solely-height-sm);border-radius:var(--solely-border-radius-circle);margin-right:var(--solely-spacing-sm);font-size:var(--solely-font-size-md)}.solely-modal__icon--info{background-color:var(--solely-info-light);color:var(--solely-info)}.solely-modal__icon--success{background-color:var(--solely-success-light);color:var(--solely-success)}.solely-modal__icon--warning{background-color:var(--solely-warning-light);color:var(--solely-warning)}.solely-modal__icon--error{background-color:var(--solely-error-light);color:var(--solely-error)}.solely-modal__icon--confirm{background-color:var(--solely-warning-light);color:var(--solely-warning)}.solely-modal__btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--solely-spacing-xs);height:var(--solely-height-md);padding:0 var(--solely-spacing-md);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);font-weight:400;line-height:var(--solely-line-height-md);white-space:nowrap;text-align:center;text-decoration:none;vertical-align:middle;background-image:none;border:1px solid transparent;border-radius:var(--solely-border-radius-md);cursor:pointer;transition:all var(--solely-transition-duration) var(--solely-transition-timing);-webkit-user-select:none;user-select:none;touch-action:manipulation;outline:none;position:relative}.solely-modal__btn:hover:not(:disabled){opacity:.9}.solely-modal__btn:active:not(:disabled){opacity:.8}.solely-modal__btn:disabled{opacity:.4;cursor:not-allowed}.solely-modal__btn--primary{color:var(--solely-white);background-color:var(--solely-primary);border-color:var(--solely-primary)}.solely-modal__btn--default{color:var(--solely-text-primary);background-color:var(--solely-component-bg);border-color:var(--solely-border-color)}.solely-modal__btn--danger{color:var(--solely-white);background-color:var(--solely-error);border-color:var(--solely-error)}@keyframes solely-modal-mask-in{0%{opacity:0}to{opacity:1}}@keyframes solely-modal-mask-out{0%{opacity:1}to{opacity:0}}@keyframes solely-modal-container-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes solely-modal-container-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}";export{o as default};
1
+ const o=".solely-modal,.solely-modal *,.solely-modal *:before,.solely-modal *:after,.solely-modal-mask,.solely-modal-wrap{box-sizing:border-box}.solely-modal-mask{position:fixed;inset:0;background-color:var(--solely-mask-bg);z-index:1;pointer-events:auto;animation:solely-modal-mask-in var(--solely-transition-duration) var(--solely-transition-timing)}.solely-modal-mask.is-closing{animation:solely-modal-mask-out var(--solely-transition-duration) var(--solely-transition-timing) forwards}.solely-modal-wrap{position:fixed;inset:0;z-index:var(--solely-z-index-modal);display:flex;align-items:center;justify-content:center;overflow:auto;outline:0;pointer-events:none}.solely-modal{position:relative;z-index:2;background-color:var(--solely-component-bg);border-radius:var(--solely-border-radius-md);box-shadow:var(--solely-shadow-lg);animation:solely-modal-container-in var(--solely-transition-duration) var(--solely-transition-timing);max-width:calc(100vw - var(--solely-spacing-xl));margin:var(--solely-spacing-md);pointer-events:auto}.solely-modal.is-closing{animation:solely-modal-container-out var(--solely-transition-duration) var(--solely-transition-timing) forwards}.solely-modal__header{padding:var(--solely-spacing-lg) var(--solely-spacing-xl);border-bottom:1px solid var(--solely-border-color-split);display:flex;align-items:center;justify-content:space-between}.solely-modal__title{margin:0;font-size:var(--solely-font-size-lg);font-weight:500;color:var(--solely-text-primary);line-height:var(--solely-line-height-lg)}.solely-modal__close{width:var(--solely-height-sm);height:var(--solely-height-sm);display:flex;align-items:center;justify-content:center;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration);font-size:var(--solely-font-size-lg);line-height:1;border:none;background:none;border-radius:var(--solely-border-radius-sm)}.solely-modal__close:hover{color:var(--solely-text-secondary);background-color:var(--solely-gray-3)}.solely-modal__close:active{color:var(--solely-text-primary)}.solely-modal__body{padding:var(--solely-spacing-xl);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);color:var(--solely-text-secondary)}.solely-modal__content-wrapper{display:flex;align-items:flex-start;gap:var(--solely-spacing-sm)}.solely-modal__content{width:100%}.solely-modal__footer{padding:var(--solely-spacing-md) var(--solely-spacing-lg);border-top:1px solid var(--solely-border-color-split);display:flex;justify-content:flex-end;gap:var(--solely-spacing-sm)}.solely-modal__icon{display:inline-flex;align-items:center;justify-content:center;width:var(--solely-height-sm);height:var(--solely-height-sm);border-radius:var(--solely-border-radius-circle);margin-right:var(--solely-spacing-sm);font-size:var(--solely-font-size-md)}.solely-modal__icon--info{background-color:var(--solely-info-light);color:var(--solely-info)}.solely-modal__icon--success{background-color:var(--solely-success-light);color:var(--solely-success)}.solely-modal__icon--warning{background-color:var(--solely-warning-light);color:var(--solely-warning)}.solely-modal__icon--error{background-color:var(--solely-error-light);color:var(--solely-error)}.solely-modal__icon--confirm{background-color:var(--solely-warning-light);color:var(--solely-warning)}.solely-modal__btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--solely-spacing-xs);height:var(--solely-height-md);padding:0 var(--solely-spacing-md);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);font-weight:400;line-height:var(--solely-line-height-md);white-space:nowrap;text-align:center;text-decoration:none;vertical-align:middle;background-image:none;border:1px solid transparent;border-radius:var(--solely-border-radius-md);cursor:pointer;transition:all var(--solely-transition-duration) var(--solely-transition-timing);-webkit-user-select:none;user-select:none;touch-action:manipulation;outline:none;position:relative}.solely-modal__btn:hover:not(:disabled){opacity:.9}.solely-modal__btn:active:not(:disabled){opacity:.8}.solely-modal__btn:disabled{opacity:.4;cursor:not-allowed}.solely-modal__btn--primary{color:var(--solely-white);background-color:var(--solely-primary);border-color:var(--solely-primary)}.solely-modal__btn--default{color:var(--solely-text-primary);background-color:var(--solely-component-bg);border-color:var(--solely-border-color)}.solely-modal__btn--danger{color:var(--solely-white);background-color:var(--solely-error);border-color:var(--solely-error)}@keyframes solely-modal-mask-in{0%{opacity:0}to{opacity:1}}@keyframes solely-modal-mask-out{0%{opacity:1}to{opacity:0}}@keyframes solely-modal-container-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes solely-modal-container-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}";export{o as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../utils.cjs"),n=require("./style.css.cjs"),t={okText:"确定",cancelText:"取消",okType:"primary",showCancel:!0,placement:"top"};let o=null;const l=new WeakSet;function c(){o&&(o.cleanup(),o.element.remove(),o=null)}function s(){if(!o)return;const{element:n,cleanup:t}=o,l=n.querySelector(".solely-popconfirm");l&&l.classList.add("is-closing"),o=null,e.addClosingAnimation(n,e.ANIMATION_DURATION.FAST).then(()=>{t(),n.remove()})}function r(e,n,t){void 0!==n&&("string"==typeof n?e.textContent=n:n instanceof HTMLElement&&e.appendChild(t?n.cloneNode(!0):n))}function i(e){return{...e,then:n=>Promise.resolve(n(e))}}function a(l,a){if(o&&o.target===l)return c(),i({close:()=>{},destroy:()=>{}});c();const p=e.generateId();e.injectStyle("solely-popconfirm-styles",n.default);const d=a.placement??t.placement,m=a.okType??t.okType,u=a.showCancel??t.showCancel,y=a.cloneElement??!0,f=e.createElement("div",{className:"solely-popconfirm-overlay"}),v=e.observeTheme(()=>f),_=[`solely-popconfirm solely-popconfirm--${d}`,a.className].filter(Boolean).join(" "),E=e.createElement("div",{className:_,styles:a.style}),h=e.createElement("div",{className:"solely-popconfirm__content"});if(!1!==a.showIcon){const n=e.createElement("span",{className:"solely-popconfirm__icon",textContent:"⚠"});h.appendChild(n)}const C=e.createElement("div",{className:"solely-popconfirm__text"}),k=e.createElement("div",{className:"solely-popconfirm__title"});if(r(k,a.title,y),C.appendChild(k),a.description){const n=e.createElement("div",{className:"solely-popconfirm__description"});r(n,a.description,y),C.appendChild(n)}h.appendChild(C);const T=e.createElement("div",{className:"solely-popconfirm__buttons"}),b=()=>{var e;s(),null==(e=a.onCancel)||e.call(a)};if(u){const n=e.createElement("button",{className:"solely-popconfirm__btn solely-popconfirm__btn--cancel",attrs:{type:"button"}});r(n,a.cancelText??t.cancelText,y),n.onclick=b,T.appendChild(n)}const w=["solely-popconfirm__btn solely-popconfirm__btn--ok","danger"===m?"solely-popconfirm__btn--danger":""].filter(Boolean).join(" "),N=e.createElement("button",{className:w,attrs:{type:"button"}});r(N,a.okText??t.okText,y),N.onclick=()=>{var e;s(),null==(e=a.onConfirm)||e.call(a)},T.appendChild(N);const g=e.createElement("div",{className:"solely-popconfirm__arrow"});E.appendChild(g),E.appendChild(h),E.appendChild(T),f.appendChild(E),document.body.appendChild(f);const x=e.calculatePosition(l,E,d);E.style.top=`${x.top}px`,E.style.left=`${x.left}px`,void 0!==x.arrowLeft&&(g.style.left=`${x.arrowLeft}px`),void 0!==x.arrowTop&&(g.style.top=`${x.arrowTop}px`);const L=e=>{e.target===f&&b()},j=e=>{"Escape"===e.key&&(b(),document.removeEventListener("keydown",j))};f.addEventListener("click",L),document.addEventListener("keydown",j);const S=()=>{document.removeEventListener("keydown",j),f.removeEventListener("click",L),v()};return o={id:p,target:l,element:f,cleanup:S},i({close:()=>{o&&o.element===f&&(S(),s())},destroy:()=>{o&&o.element===f&&(S(),s())}})}const p={show:a,bind:function(e,n){if(l.has(e))return{close:()=>{},destroy:()=>{}};l.add(e);let t=null;const s=l=>{l.stopPropagation(),o?(c(),t=null):t=a(e,n)},r=n=>{if(!o)return;const l=n.target;o.element.contains(l)||e.contains(l)||(c(),t=null)};return e.addEventListener("click",s),document.addEventListener("mousedown",r),{close:()=>{null==t||t.close(),t=null},destroy:()=>{l.delete(e),e.removeEventListener("click",s),document.removeEventListener("mousedown",r),null==t||t.destroy(),t=null}}},config:function(e){Object.assign(t,e)},destroy:()=>{s()}};exports.Popconfirm=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../utils.cjs"),t=require("./style.css.cjs"),n={okText:"确定",cancelText:"取消",okType:"primary",showCancel:!0,placement:"top"};let o=null;const l=new WeakSet;function c(){o&&(o.cleanup(),o.element.remove(),o=null)}function s(){if(!o)return;const{element:t,cleanup:n}=o,l=t.querySelector(".solely-popconfirm");l&&l.classList.add("is-closing"),o=null,e.addClosingAnimation(t,e.ANIMATION_DURATION.FAST).then(()=>{n(),t.remove()})}function i(e,t,n){void 0!==t&&("string"==typeof t?e.textContent=t:t instanceof HTMLElement&&e.appendChild(n?t.cloneNode(!0):t))}function r(e){return{...e,then:t=>Promise.resolve(t(e))}}function a(l,a){if(o&&o.target===l)return c(),r({close:()=>{},destroy:()=>{}});c();const p=e.generateId();e.injectStyle("solely-popconfirm-styles",t.default);const d=a.placement??n.placement,m=a.okType??n.okType,y=a.showCancel??n.showCancel,u=a.cloneElement??!0,f=e.createElement("div",{className:"solely-popconfirm-overlay"}),v=e.observeTheme(()=>f),_=[`solely-popconfirm solely-popconfirm--${d}`,a.className].filter(Boolean).join(" "),E=e.createElement("div",{className:_,styles:a.style}),h=e.createElement("div",{className:"solely-popconfirm__content"});if(!1!==a.showIcon){const t=e.createElement("span",{className:"solely-popconfirm__icon",textContent:"⚠"});h.appendChild(t)}const C=e.createElement("div",{className:"solely-popconfirm__text"}),k=e.createElement("div",{className:"solely-popconfirm__title"});if(i(k,a.title,u),C.appendChild(k),a.description){const t=e.createElement("div",{className:"solely-popconfirm__description"});i(t,a.description,u),C.appendChild(t)}h.appendChild(C);const T=e.createElement("div",{className:"solely-popconfirm__buttons"}),b=()=>{s(),a.onCancel?.()};if(y){const t=e.createElement("button",{className:"solely-popconfirm__btn solely-popconfirm__btn--cancel",attrs:{type:"button"}});i(t,a.cancelText??n.cancelText,u),t.onclick=b,T.appendChild(t)}const w=["solely-popconfirm__btn solely-popconfirm__btn--ok","danger"===m?"solely-popconfirm__btn--danger":""].filter(Boolean).join(" "),N=e.createElement("button",{className:w,attrs:{type:"button"}});i(N,a.okText??n.okText,u),N.onclick=()=>{s(),a.onConfirm?.()},T.appendChild(N);const g=e.createElement("div",{className:"solely-popconfirm__arrow"});E.appendChild(g),E.appendChild(h),E.appendChild(T),f.appendChild(E),document.body.appendChild(f);const x=e.calculatePosition(l,E,d);E.style.top=`${x.top}px`,E.style.left=`${x.left}px`,void 0!==x.arrowLeft&&(g.style.left=`${x.arrowLeft}px`),void 0!==x.arrowTop&&(g.style.top=`${x.arrowTop}px`);const L=e=>{e.target===f&&b()},j=e=>{"Escape"===e.key&&(b(),document.removeEventListener("keydown",j))};f.addEventListener("click",L),document.addEventListener("keydown",j);const S=()=>{document.removeEventListener("keydown",j),f.removeEventListener("click",L),v()};return o={id:p,target:l,element:f,cleanup:S},r({close:()=>{o&&o.element===f&&(S(),s())},destroy:()=>{o&&o.element===f&&(S(),s())}})}const p={show:a,bind:function(e,t){if(l.has(e))return{close:()=>{},destroy:()=>{}};l.add(e);let n=null;const s=l=>{l.stopPropagation(),o?(c(),n=null):n=a(e,t)},i=t=>{if(!o)return;const l=t.target;o.element.contains(l)||e.contains(l)||(c(),n=null)};return e.addEventListener("click",s),document.addEventListener("mousedown",i),{close:()=>{n?.close(),n=null},destroy:()=>{l.delete(e),e.removeEventListener("click",s),document.removeEventListener("mousedown",i),n?.destroy(),n=null}}},config:function(e){Object.assign(n,e)},destroy:()=>{s()}};exports.Popconfirm=p;
@@ -1 +1 @@
1
- import{createElement as e,observeTheme as n,calculatePosition as o,injectStyle as t,addClosingAnimation as l,ANIMATION_DURATION as s,generateId as c}from"../utils.js";import i from"./style.css.js";const r={okText:"确定",cancelText:"取消",okType:"primary",showCancel:!0,placement:"top"};let p=null;const a=new WeakSet;function d(){p&&(p.cleanup(),p.element.remove(),p=null)}function m(){if(!p)return;const{element:e,cleanup:n}=p,o=e.querySelector(".solely-popconfirm");o&&o.classList.add("is-closing"),p=null,l(e,s.FAST).then(()=>{n(),e.remove()})}function y(e,n,o){void 0!==n&&("string"==typeof n?e.textContent=n:n instanceof HTMLElement&&e.appendChild(o?n.cloneNode(!0):n))}function f(e){return{...e,then:n=>Promise.resolve(n(e))}}function u(l,s){if(p&&p.target===l)return d(),f({close:()=>{},destroy:()=>{}});d();const a=c();t("solely-popconfirm-styles",i);const u=s.placement??r.placement,v=s.okType??r.okType,_=s.showCancel??r.showCancel,h=s.cloneElement??!0,C=e("div",{className:"solely-popconfirm-overlay"}),k=n(()=>C),w=[`solely-popconfirm solely-popconfirm--${u}`,s.className].filter(Boolean).join(" "),x=e("div",{className:w,styles:s.style}),b=e("div",{className:"solely-popconfirm__content"});if(!1!==s.showIcon){const n=e("span",{className:"solely-popconfirm__icon",textContent:"⚠"});b.appendChild(n)}const L=e("div",{className:"solely-popconfirm__text"}),N=e("div",{className:"solely-popconfirm__title"});if(y(N,s.title,h),L.appendChild(N),s.description){const n=e("div",{className:"solely-popconfirm__description"});y(n,s.description,h),L.appendChild(n)}b.appendChild(L);const T=e("div",{className:"solely-popconfirm__buttons"}),E=()=>{var e;m(),null==(e=s.onCancel)||e.call(s)};if(_){const n=e("button",{className:"solely-popconfirm__btn solely-popconfirm__btn--cancel",attrs:{type:"button"}});y(n,s.cancelText??r.cancelText,h),n.onclick=E,T.appendChild(n)}const g=["solely-popconfirm__btn solely-popconfirm__btn--ok","danger"===v?"solely-popconfirm__btn--danger":""].filter(Boolean).join(" "),j=e("button",{className:g,attrs:{type:"button"}});y(j,s.okText??r.okText,h),j.onclick=()=>{var e;m(),null==(e=s.onConfirm)||e.call(s)},T.appendChild(j);const $=e("div",{className:"solely-popconfirm__arrow"});x.appendChild($),x.appendChild(b),x.appendChild(T),C.appendChild(x),document.body.appendChild(C);const S=o(l,x,u);x.style.top=`${S.top}px`,x.style.left=`${S.left}px`,void 0!==S.arrowLeft&&($.style.left=`${S.arrowLeft}px`),void 0!==S.arrowTop&&($.style.top=`${S.arrowTop}px`);const B=e=>{e.target===C&&E()},P=e=>{"Escape"===e.key&&(E(),document.removeEventListener("keydown",P))};C.addEventListener("click",B),document.addEventListener("keydown",P);const q=()=>{document.removeEventListener("keydown",P),C.removeEventListener("click",B),k()};return p={id:a,target:l,element:C,cleanup:q},f({close:()=>{p&&p.element===C&&(q(),m())},destroy:()=>{p&&p.element===C&&(q(),m())}})}const v={show:u,bind:function(e,n){if(a.has(e))return{close:()=>{},destroy:()=>{}};a.add(e);let o=null;const t=t=>{t.stopPropagation(),p?(d(),o=null):o=u(e,n)},l=n=>{if(!p)return;const t=n.target;p.element.contains(t)||e.contains(t)||(d(),o=null)};return e.addEventListener("click",t),document.addEventListener("mousedown",l),{close:()=>{null==o||o.close(),o=null},destroy:()=>{a.delete(e),e.removeEventListener("click",t),document.removeEventListener("mousedown",l),null==o||o.destroy(),o=null}}},config:function(e){Object.assign(r,e)},destroy:()=>{m()}};export{v as Popconfirm};
1
+ import{createElement as e,observeTheme as o,calculatePosition as n,injectStyle as t,addClosingAnimation as l,ANIMATION_DURATION as s,generateId as c}from"../utils.js";import i from"./style.css.js";const p={okText:"确定",cancelText:"取消",okType:"primary",showCancel:!0,placement:"top"};let r=null;const a=new WeakSet;function d(){r&&(r.cleanup(),r.element.remove(),r=null)}function m(){if(!r)return;const{element:e,cleanup:o}=r,n=e.querySelector(".solely-popconfirm");n&&n.classList.add("is-closing"),r=null,l(e,s.FAST).then(()=>{o(),e.remove()})}function y(e,o,n){void 0!==o&&("string"==typeof o?e.textContent=o:o instanceof HTMLElement&&e.appendChild(n?o.cloneNode(!0):o))}function f(e){return{...e,then:o=>Promise.resolve(o(e))}}function u(l,s){if(r&&r.target===l)return d(),f({close:()=>{},destroy:()=>{}});d();const a=c();t("solely-popconfirm-styles",i);const u=s.placement??p.placement,v=s.okType??p.okType,_=s.showCancel??p.showCancel,h=s.cloneElement??!0,C=e("div",{className:"solely-popconfirm-overlay"}),k=o(()=>C),w=[`solely-popconfirm solely-popconfirm--${u}`,s.className].filter(Boolean).join(" "),x=e("div",{className:w,styles:s.style}),b=e("div",{className:"solely-popconfirm__content"});if(!1!==s.showIcon){const o=e("span",{className:"solely-popconfirm__icon",textContent:"⚠"});b.appendChild(o)}const L=e("div",{className:"solely-popconfirm__text"}),N=e("div",{className:"solely-popconfirm__title"});if(y(N,s.title,h),L.appendChild(N),s.description){const o=e("div",{className:"solely-popconfirm__description"});y(o,s.description,h),L.appendChild(o)}b.appendChild(L);const T=e("div",{className:"solely-popconfirm__buttons"}),E=()=>{m(),s.onCancel?.()};if(_){const o=e("button",{className:"solely-popconfirm__btn solely-popconfirm__btn--cancel",attrs:{type:"button"}});y(o,s.cancelText??p.cancelText,h),o.onclick=E,T.appendChild(o)}const g=["solely-popconfirm__btn solely-popconfirm__btn--ok","danger"===v?"solely-popconfirm__btn--danger":""].filter(Boolean).join(" "),j=e("button",{className:g,attrs:{type:"button"}});y(j,s.okText??p.okText,h),j.onclick=()=>{m(),s.onConfirm?.()},T.appendChild(j);const $=e("div",{className:"solely-popconfirm__arrow"});x.appendChild($),x.appendChild(b),x.appendChild(T),C.appendChild(x),document.body.appendChild(C);const S=n(l,x,u);x.style.top=`${S.top}px`,x.style.left=`${S.left}px`,void 0!==S.arrowLeft&&($.style.left=`${S.arrowLeft}px`),void 0!==S.arrowTop&&($.style.top=`${S.arrowTop}px`);const B=e=>{e.target===C&&E()},P=e=>{"Escape"===e.key&&(E(),document.removeEventListener("keydown",P))};C.addEventListener("click",B),document.addEventListener("keydown",P);const q=()=>{document.removeEventListener("keydown",P),C.removeEventListener("click",B),k()};return r={id:a,target:l,element:C,cleanup:q},f({close:()=>{r&&r.element===C&&(q(),m())},destroy:()=>{r&&r.element===C&&(q(),m())}})}const v={show:u,bind:function(e,o){if(a.has(e))return{close:()=>{},destroy:()=>{}};a.add(e);let n=null;const t=t=>{t.stopPropagation(),r?(d(),n=null):n=u(e,o)},l=o=>{if(!r)return;const t=o.target;r.element.contains(t)||e.contains(t)||(d(),n=null)};return e.addEventListener("click",t),document.addEventListener("mousedown",l),{close:()=>{n?.close(),n=null},destroy:()=>{a.delete(e),e.removeEventListener("click",t),document.removeEventListener("mousedown",l),n?.destroy(),n=null}}},config:function(e){Object.assign(p,e)},destroy:()=>{m()}};export{v as Popconfirm};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../utils.cjs"),t=require("./style.css.cjs"),o={placement:"top",trigger:"hover",duration:3e3,singleton:!0},n=[],l=new WeakSet;function r(e,t,o,n=8){const l=e.getBoundingClientRect(),r=t.offsetWidth||250,s=t.offsetHeight||100;let i,c,a=0,d=0;switch(o){case"top":a=l.top-s-n,d=l.left+(l.width-r)/2,i=r/2-4;break;case"topLeft":a=l.top-s-n,d=l.left,i=16;break;case"topRight":a=l.top-s-n,d=l.right-r,i=r-24;break;case"bottom":a=l.bottom+n,d=l.left+(l.width-r)/2,i=r/2-4;break;case"bottomLeft":a=l.bottom+n,d=l.left,i=16;break;case"bottomRight":a=l.bottom+n,d=l.right-r,i=r-24;break;case"left":a=l.top+(l.height-s)/2,d=l.left-r-n,c=s/2-4;break;case"leftTop":a=l.top,d=l.left-r-n,c=16;break;case"leftBottom":a=l.bottom-s,d=l.left-r-n,c=s-24;break;case"right":a=l.top+(l.height-s)/2,d=l.right+n,c=s/2-4;break;case"rightTop":a=l.top,d=l.right+n,c=16;break;case"rightBottom":a=l.bottom-s,d=l.right+n,c=s-24}return a=Math.max(8,Math.min(a,window.innerHeight-s-8)),d=Math.max(8,Math.min(d,window.innerWidth-r-8)),{top:a,left:d,arrowLeft:i,arrowTop:c}}let s=null,i=!1;function c(){s||(s=requestAnimationFrame(()=>{s=null,n.forEach(e=>{const t=e.element;if(!t||!e.target)return;const o=t.querySelector(".solely-tooltip__arrow"),n=r(e.target,t,e.placement);t.style.top=`${n.top}px`,t.style.left=`${n.left}px`,o&&(void 0!==n.arrowLeft&&(o.style.left=`${n.arrowLeft}px`,o.style.top=""),void 0!==n.arrowTop&&(o.style.top=`${n.arrowTop}px`,o.style.left=""))})}))}function a(){i&&(i=!1,window.removeEventListener("resize",c),s&&(cancelAnimationFrame(s),s=null))}async function d(e,t){const o=n.findIndex(t=>t.id===e);if(-1===o)return;const l=n[o];l.element.classList.add("is-closing"),l.element.remove(),l.cleanupTheme(),l.scrollParents.forEach(e=>e.removeEventListener("scroll",c)),n.splice(o,1),0===n.length&&a(),null==t||t()}function m(){if(0===n.length)return;const e=new Set;n.forEach(t=>{t.scrollParents.forEach(t=>e.add(t)),t.element.classList.add("is-closing"),t.element.remove(),t.cleanupTheme()}),e.forEach(e=>e.removeEventListener("scroll",c)),n.length=0,a()}function p(l,s){var a;const d=e.generateId();e.injectStyle("solely-tooltip-styles",t.default);const p=s.placement??o.placement,u=s.cloneElement??!0,f=n.findIndex(e=>e.target===l);if(-1!==f){const e=n[f];e.element.remove(),e.cleanupTheme(),e.scrollParents.forEach(e=>e.removeEventListener("scroll",c)),n.splice(f,1)}o.singleton&&n.length>0&&m();const h=e.createElement("div",{className:`solely-tooltip solely-tooltip--${p}${s.className?` ${s.className}`:""}`,styles:{...s.style,...s.color?{backgroundColor:s.color}:{}}}),v=e.observeTheme(()=>h),g=e.createElement("div",{className:"solely-tooltip__content"});s.content&&("string"==typeof s.content?g.textContent=s.content:s.content instanceof HTMLElement&&g.appendChild(u?s.content.cloneNode(!0):s.content)),h.appendChild(g);const b=e.createElement("div",{className:"solely-tooltip__arrow"});s.color&&(b.style.backgroundColor=s.color),h.appendChild(b),document.body.appendChild(h),requestAnimationFrame(()=>{const e=r(l,h,p);h.style.top=`${e.top}px`,h.style.left=`${e.left}px`,void 0!==e.arrowLeft&&(b.style.left=`${e.arrowLeft}px`),void 0!==e.arrowTop&&(b.style.top=`${e.arrowTop}px`)});const y=function(e){const t=[];let o=e.parentElement;for(;o&&o!==document.body;){const e=getComputedStyle(o);"auto"!==e.overflow&&"scroll"!==e.overflow&&"auto"!==e.overflowY&&"scroll"!==e.overflowY||t.push(o),o=o.parentElement}return t}(l);return y.forEach(e=>e.addEventListener("scroll",c)),i||0===n.length||(i=!0,window.addEventListener("resize",c)),n.push({id:d,element:h,target:l,placement:p,scrollParents:y,cleanupTheme:v}),null==(a=s.onVisibleChange)||a.call(s,!0),d}function u(e,t){const n=p(e,t),l=t.duration??o.duration;l>0&&setTimeout(()=>d(n),l)}const f={bind:function(e,t){if(l.has(e))return{show:()=>{},hide:()=>{},destroy:()=>{}};l.add(e);const n=t.trigger??o.trigger;let r=t.visible??t.defaultVisible??!1,s=null;const i=()=>{r||(r=!0,s=p(e,t))},c=()=>{if(!r||null===s)return;r=!1;const e=s;s=null,d(e,()=>{var e;null==(e=t.onVisibleChange)||e.call(t,!1)})},a=e=>{e.stopPropagation(),r?c():i()},m=t=>{r&&(e.contains(t.target)||c())};return"hover"===n?(e.addEventListener("mouseenter",i),e.addEventListener("mouseleave",c)):"click"===n?(e.addEventListener("click",a),document.addEventListener("click",m)):"focus"===n&&(e.addEventListener("focus",i),e.addEventListener("blur",c)),r&&(s=p(e,t)),{show:i,hide:c,destroy:()=>{c(),l.delete(e),"hover"===n?(e.removeEventListener("mouseenter",i),e.removeEventListener("mouseleave",c)):"click"===n?(e.removeEventListener("click",a),document.removeEventListener("click",m)):"focus"===n&&(e.removeEventListener("focus",i),e.removeEventListener("blur",c))}}},showOnce:u,show:u,hide:async function(e){m(),null==e||e()},destroy:m,config:function(e){Object.assign(o,e)}};exports.Tooltip=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../utils.cjs"),t=require("./style.css.cjs"),o={placement:"top",trigger:"hover",duration:3e3,singleton:!0},n=[],r=new WeakSet;function l(e,t,o,n=8){const r=e.getBoundingClientRect(),l=t.offsetWidth||250,s=t.offsetHeight||100;let i,c,a=0,d=0;switch(o){case"top":a=r.top-s-n,d=r.left+(r.width-l)/2,i=l/2-4;break;case"topLeft":a=r.top-s-n,d=r.left,i=16;break;case"topRight":a=r.top-s-n,d=r.right-l,i=l-24;break;case"bottom":a=r.bottom+n,d=r.left+(r.width-l)/2,i=l/2-4;break;case"bottomLeft":a=r.bottom+n,d=r.left,i=16;break;case"bottomRight":a=r.bottom+n,d=r.right-l,i=l-24;break;case"left":a=r.top+(r.height-s)/2,d=r.left-l-n,c=s/2-4;break;case"leftTop":a=r.top,d=r.left-l-n,c=16;break;case"leftBottom":a=r.bottom-s,d=r.left-l-n,c=s-24;break;case"right":a=r.top+(r.height-s)/2,d=r.right+n,c=s/2-4;break;case"rightTop":a=r.top,d=r.right+n,c=16;break;case"rightBottom":a=r.bottom-s,d=r.right+n,c=s-24}return a=Math.max(8,Math.min(a,window.innerHeight-s-8)),d=Math.max(8,Math.min(d,window.innerWidth-l-8)),{top:a,left:d,arrowLeft:i,arrowTop:c}}let s=null,i=!1;function c(){s||(s=requestAnimationFrame(()=>{s=null,n.forEach(e=>{const t=e.element;if(!t||!e.target)return;const o=t.querySelector(".solely-tooltip__arrow"),n=l(e.target,t,e.placement);t.style.top=`${n.top}px`,t.style.left=`${n.left}px`,o&&(void 0!==n.arrowLeft&&(o.style.left=`${n.arrowLeft}px`,o.style.top=""),void 0!==n.arrowTop&&(o.style.top=`${n.arrowTop}px`,o.style.left=""))})}))}function a(){i&&(i=!1,window.removeEventListener("resize",c),s&&(cancelAnimationFrame(s),s=null))}async function d(e,t){const o=n.findIndex(t=>t.id===e);if(-1===o)return;const r=n[o];r.element.classList.add("is-closing"),r.element.remove(),r.cleanupTheme(),r.scrollParents.forEach(e=>e.removeEventListener("scroll",c)),n.splice(o,1),0===n.length&&a(),t?.()}function m(){if(0===n.length)return;const e=new Set;n.forEach(t=>{t.scrollParents.forEach(t=>e.add(t)),t.element.classList.add("is-closing"),t.element.remove(),t.cleanupTheme()}),e.forEach(e=>e.removeEventListener("scroll",c)),n.length=0,a()}function p(r,s){const a=e.generateId();e.injectStyle("solely-tooltip-styles",t.default);const d=s.placement??o.placement,p=s.cloneElement??!0,f=n.findIndex(e=>e.target===r);if(-1!==f){const e=n[f];e.element.remove(),e.cleanupTheme(),e.scrollParents.forEach(e=>e.removeEventListener("scroll",c)),n.splice(f,1)}o.singleton&&n.length>0&&m();const u=e.createElement("div",{className:`solely-tooltip solely-tooltip--${d}${s.className?` ${s.className}`:""}`,styles:{...s.style,...s.color?{backgroundColor:s.color}:{}}}),h=e.observeTheme(()=>u),v=e.createElement("div",{className:"solely-tooltip__content"});s.content&&("string"==typeof s.content?v.textContent=s.content:s.content instanceof HTMLElement&&v.appendChild(p?s.content.cloneNode(!0):s.content)),u.appendChild(v);const g=e.createElement("div",{className:"solely-tooltip__arrow"});s.color&&(g.style.backgroundColor=s.color),u.appendChild(g),document.body.appendChild(u),requestAnimationFrame(()=>{const e=l(r,u,d);u.style.top=`${e.top}px`,u.style.left=`${e.left}px`,void 0!==e.arrowLeft&&(g.style.left=`${e.arrowLeft}px`),void 0!==e.arrowTop&&(g.style.top=`${e.arrowTop}px`)});const b=function(e){const t=[];let o=e.parentElement;for(;o&&o!==document.body;){const e=getComputedStyle(o);"auto"!==e.overflow&&"scroll"!==e.overflow&&"auto"!==e.overflowY&&"scroll"!==e.overflowY||t.push(o),o=o.parentElement}return t}(r);return b.forEach(e=>e.addEventListener("scroll",c)),i||0===n.length||(i=!0,window.addEventListener("resize",c)),n.push({id:a,element:u,target:r,placement:d,scrollParents:b,cleanupTheme:h}),s.onVisibleChange?.(!0),a}function f(e,t){const n=p(e,t),r=t.duration??o.duration;r>0&&setTimeout(()=>d(n),r)}const u={bind:function(e,t){if(r.has(e))return{show:()=>{},hide:()=>{},destroy:()=>{}};r.add(e);const n=t.trigger??o.trigger;let l=t.visible??t.defaultVisible??!1,s=null;const i=()=>{l||(l=!0,s=p(e,t))},c=()=>{if(!l||null===s)return;l=!1;const e=s;s=null,d(e,()=>{t.onVisibleChange?.(!1)})},a=e=>{e.stopPropagation(),l?c():i()},m=t=>{l&&(e.contains(t.target)||c())};return"hover"===n?(e.addEventListener("mouseenter",i),e.addEventListener("mouseleave",c)):"click"===n?(e.addEventListener("click",a),document.addEventListener("click",m)):"focus"===n&&(e.addEventListener("focus",i),e.addEventListener("blur",c)),l&&(s=p(e,t)),{show:i,hide:c,destroy:()=>{c(),r.delete(e),"hover"===n?(e.removeEventListener("mouseenter",i),e.removeEventListener("mouseleave",c)):"click"===n?(e.removeEventListener("click",a),document.removeEventListener("click",m)):"focus"===n&&(e.removeEventListener("focus",i),e.removeEventListener("blur",c))}}},showOnce:f,show:f,hide:async function(e){m(),e?.()},destroy:m,config:function(e){Object.assign(o,e)}};exports.Tooltip=u;
@@ -1 +1 @@
1
- import{generateId as e,createElement as t,observeTheme as o,injectStyle as n}from"../utils.js";import l from"./style.css.js";const r={placement:"top",trigger:"hover",duration:3e3,singleton:!0},s=[],i=new WeakSet;function c(e,t,o,n=8){const l=e.getBoundingClientRect(),r=t.offsetWidth||250,s=t.offsetHeight||100;let i,c,a=0,d=0;switch(o){case"top":a=l.top-s-n,d=l.left+(l.width-r)/2,i=r/2-4;break;case"topLeft":a=l.top-s-n,d=l.left,i=16;break;case"topRight":a=l.top-s-n,d=l.right-r,i=r-24;break;case"bottom":a=l.bottom+n,d=l.left+(l.width-r)/2,i=r/2-4;break;case"bottomLeft":a=l.bottom+n,d=l.left,i=16;break;case"bottomRight":a=l.bottom+n,d=l.right-r,i=r-24;break;case"left":a=l.top+(l.height-s)/2,d=l.left-r-n,c=s/2-4;break;case"leftTop":a=l.top,d=l.left-r-n,c=16;break;case"leftBottom":a=l.bottom-s,d=l.left-r-n,c=s-24;break;case"right":a=l.top+(l.height-s)/2,d=l.right+n,c=s/2-4;break;case"rightTop":a=l.top,d=l.right+n,c=16;break;case"rightBottom":a=l.bottom-s,d=l.right+n,c=s-24}return a=Math.max(8,Math.min(a,window.innerHeight-s-8)),d=Math.max(8,Math.min(d,window.innerWidth-r-8)),{top:a,left:d,arrowLeft:i,arrowTop:c}}let a=null,d=!1;function m(){a||(a=requestAnimationFrame(()=>{a=null,s.forEach(e=>{const t=e.element;if(!t||!e.target)return;const o=t.querySelector(".solely-tooltip__arrow"),n=c(e.target,t,e.placement);t.style.top=`${n.top}px`,t.style.left=`${n.left}px`,o&&(void 0!==n.arrowLeft&&(o.style.left=`${n.arrowLeft}px`,o.style.top=""),void 0!==n.arrowTop&&(o.style.top=`${n.arrowTop}px`,o.style.left=""))})}))}function f(){d&&(d=!1,window.removeEventListener("resize",m),a&&(cancelAnimationFrame(a),a=null))}async function p(e,t){const o=s.findIndex(t=>t.id===e);if(-1===o)return;const n=s[o];n.element.classList.add("is-closing"),n.element.remove(),n.cleanupTheme(),n.scrollParents.forEach(e=>e.removeEventListener("scroll",m)),s.splice(o,1),0===s.length&&f(),null==t||t()}function u(){if(0===s.length)return;const e=new Set;s.forEach(t=>{t.scrollParents.forEach(t=>e.add(t)),t.element.classList.add("is-closing"),t.element.remove(),t.cleanupTheme()}),e.forEach(e=>e.removeEventListener("scroll",m)),s.length=0,f()}function h(i,a){var f;const p=e();n("solely-tooltip-styles",l);const h=a.placement??r.placement,v=a.cloneElement??!0,g=s.findIndex(e=>e.target===i);if(-1!==g){const e=s[g];e.element.remove(),e.cleanupTheme(),e.scrollParents.forEach(e=>e.removeEventListener("scroll",m)),s.splice(g,1)}r.singleton&&s.length>0&&u();const w=t("div",{className:`solely-tooltip solely-tooltip--${h}${a.className?` ${a.className}`:""}`,styles:{...a.style,...a.color?{backgroundColor:a.color}:{}}}),b=o(()=>w),y=t("div",{className:"solely-tooltip__content"});a.content&&("string"==typeof a.content?y.textContent=a.content:a.content instanceof HTMLElement&&y.appendChild(v?a.content.cloneNode(!0):a.content)),w.appendChild(y);const E=t("div",{className:"solely-tooltip__arrow"});a.color&&(E.style.backgroundColor=a.color),w.appendChild(E),document.body.appendChild(w),requestAnimationFrame(()=>{const e=c(i,w,h);w.style.top=`${e.top}px`,w.style.left=`${e.left}px`,void 0!==e.arrowLeft&&(E.style.left=`${e.arrowLeft}px`),void 0!==e.arrowTop&&(E.style.top=`${e.arrowTop}px`)});const L=function(e){const t=[];let o=e.parentElement;for(;o&&o!==document.body;){const e=getComputedStyle(o);"auto"!==e.overflow&&"scroll"!==e.overflow&&"auto"!==e.overflowY&&"scroll"!==e.overflowY||t.push(o),o=o.parentElement}return t}(i);return L.forEach(e=>e.addEventListener("scroll",m)),d||0===s.length||(d=!0,window.addEventListener("resize",m)),s.push({id:p,element:w,target:i,placement:h,scrollParents:L,cleanupTheme:b}),null==(f=a.onVisibleChange)||f.call(a,!0),p}function v(e,t){const o=h(e,t),n=t.duration??r.duration;n>0&&setTimeout(()=>p(o),n)}const g={bind:function(e,t){if(i.has(e))return{show:()=>{},hide:()=>{},destroy:()=>{}};i.add(e);const o=t.trigger??r.trigger;let n=t.visible??t.defaultVisible??!1,l=null;const s=()=>{n||(n=!0,l=h(e,t))},c=()=>{if(!n||null===l)return;n=!1;const e=l;l=null,p(e,()=>{var e;null==(e=t.onVisibleChange)||e.call(t,!1)})},a=e=>{e.stopPropagation(),n?c():s()},d=t=>{n&&(e.contains(t.target)||c())};return"hover"===o?(e.addEventListener("mouseenter",s),e.addEventListener("mouseleave",c)):"click"===o?(e.addEventListener("click",a),document.addEventListener("click",d)):"focus"===o&&(e.addEventListener("focus",s),e.addEventListener("blur",c)),n&&(l=h(e,t)),{show:s,hide:c,destroy:()=>{c(),i.delete(e),"hover"===o?(e.removeEventListener("mouseenter",s),e.removeEventListener("mouseleave",c)):"click"===o?(e.removeEventListener("click",a),document.removeEventListener("click",d)):"focus"===o&&(e.removeEventListener("focus",s),e.removeEventListener("blur",c))}}},showOnce:v,show:v,hide:async function(e){u(),null==e||e()},destroy:u,config:function(e){Object.assign(r,e)}};export{g as Tooltip};
1
+ import{generateId as e,createElement as t,observeTheme as o,injectStyle as n}from"../utils.js";import r from"./style.css.js";const l={placement:"top",trigger:"hover",duration:3e3,singleton:!0},s=[],i=new WeakSet;function c(e,t,o,n=8){const r=e.getBoundingClientRect(),l=t.offsetWidth||250,s=t.offsetHeight||100;let i,c,a=0,d=0;switch(o){case"top":a=r.top-s-n,d=r.left+(r.width-l)/2,i=l/2-4;break;case"topLeft":a=r.top-s-n,d=r.left,i=16;break;case"topRight":a=r.top-s-n,d=r.right-l,i=l-24;break;case"bottom":a=r.bottom+n,d=r.left+(r.width-l)/2,i=l/2-4;break;case"bottomLeft":a=r.bottom+n,d=r.left,i=16;break;case"bottomRight":a=r.bottom+n,d=r.right-l,i=l-24;break;case"left":a=r.top+(r.height-s)/2,d=r.left-l-n,c=s/2-4;break;case"leftTop":a=r.top,d=r.left-l-n,c=16;break;case"leftBottom":a=r.bottom-s,d=r.left-l-n,c=s-24;break;case"right":a=r.top+(r.height-s)/2,d=r.right+n,c=s/2-4;break;case"rightTop":a=r.top,d=r.right+n,c=16;break;case"rightBottom":a=r.bottom-s,d=r.right+n,c=s-24}return a=Math.max(8,Math.min(a,window.innerHeight-s-8)),d=Math.max(8,Math.min(d,window.innerWidth-l-8)),{top:a,left:d,arrowLeft:i,arrowTop:c}}let a=null,d=!1;function m(){a||(a=requestAnimationFrame(()=>{a=null,s.forEach(e=>{const t=e.element;if(!t||!e.target)return;const o=t.querySelector(".solely-tooltip__arrow"),n=c(e.target,t,e.placement);t.style.top=`${n.top}px`,t.style.left=`${n.left}px`,o&&(void 0!==n.arrowLeft&&(o.style.left=`${n.arrowLeft}px`,o.style.top=""),void 0!==n.arrowTop&&(o.style.top=`${n.arrowTop}px`,o.style.left=""))})}))}function f(){d&&(d=!1,window.removeEventListener("resize",m),a&&(cancelAnimationFrame(a),a=null))}async function p(e,t){const o=s.findIndex(t=>t.id===e);if(-1===o)return;const n=s[o];n.element.classList.add("is-closing"),n.element.remove(),n.cleanupTheme(),n.scrollParents.forEach(e=>e.removeEventListener("scroll",m)),s.splice(o,1),0===s.length&&f(),t?.()}function u(){if(0===s.length)return;const e=new Set;s.forEach(t=>{t.scrollParents.forEach(t=>e.add(t)),t.element.classList.add("is-closing"),t.element.remove(),t.cleanupTheme()}),e.forEach(e=>e.removeEventListener("scroll",m)),s.length=0,f()}function h(i,a){const f=e();n("solely-tooltip-styles",r);const p=a.placement??l.placement,h=a.cloneElement??!0,v=s.findIndex(e=>e.target===i);if(-1!==v){const e=s[v];e.element.remove(),e.cleanupTheme(),e.scrollParents.forEach(e=>e.removeEventListener("scroll",m)),s.splice(v,1)}l.singleton&&s.length>0&&u();const g=t("div",{className:`solely-tooltip solely-tooltip--${p}${a.className?` ${a.className}`:""}`,styles:{...a.style,...a.color?{backgroundColor:a.color}:{}}}),w=o(()=>g),b=t("div",{className:"solely-tooltip__content"});a.content&&("string"==typeof a.content?b.textContent=a.content:a.content instanceof HTMLElement&&b.appendChild(h?a.content.cloneNode(!0):a.content)),g.appendChild(b);const y=t("div",{className:"solely-tooltip__arrow"});a.color&&(y.style.backgroundColor=a.color),g.appendChild(y),document.body.appendChild(g),requestAnimationFrame(()=>{const e=c(i,g,p);g.style.top=`${e.top}px`,g.style.left=`${e.left}px`,void 0!==e.arrowLeft&&(y.style.left=`${e.arrowLeft}px`),void 0!==e.arrowTop&&(y.style.top=`${e.arrowTop}px`)});const E=function(e){const t=[];let o=e.parentElement;for(;o&&o!==document.body;){const e=getComputedStyle(o);"auto"!==e.overflow&&"scroll"!==e.overflow&&"auto"!==e.overflowY&&"scroll"!==e.overflowY||t.push(o),o=o.parentElement}return t}(i);return E.forEach(e=>e.addEventListener("scroll",m)),d||0===s.length||(d=!0,window.addEventListener("resize",m)),s.push({id:f,element:g,target:i,placement:p,scrollParents:E,cleanupTheme:w}),a.onVisibleChange?.(!0),f}function v(e,t){const o=h(e,t),n=t.duration??l.duration;n>0&&setTimeout(()=>p(o),n)}const g={bind:function(e,t){if(i.has(e))return{show:()=>{},hide:()=>{},destroy:()=>{}};i.add(e);const o=t.trigger??l.trigger;let n=t.visible??t.defaultVisible??!1,r=null;const s=()=>{n||(n=!0,r=h(e,t))},c=()=>{if(!n||null===r)return;n=!1;const e=r;r=null,p(e,()=>{t.onVisibleChange?.(!1)})},a=e=>{e.stopPropagation(),n?c():s()},d=t=>{n&&(e.contains(t.target)||c())};return"hover"===o?(e.addEventListener("mouseenter",s),e.addEventListener("mouseleave",c)):"click"===o?(e.addEventListener("click",a),document.addEventListener("click",d)):"focus"===o&&(e.addEventListener("focus",s),e.addEventListener("blur",c)),n&&(r=h(e,t)),{show:s,hide:c,destroy:()=>{c(),i.delete(e),"hover"===o?(e.removeEventListener("mouseenter",s),e.removeEventListener("mouseleave",c)):"click"===o?(e.removeEventListener("click",a),document.removeEventListener("click",d)):"focus"===o&&(e.removeEventListener("focus",s),e.removeEventListener("blur",c))}}},showOnce:v,show:v,hide:async function(e){u(),e?.()},destroy:u,config:function(e){Object.assign(l,e)}};export{g as Tooltip};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={FAST:200,NORMAL:300,SLOW:500};let e=0,o=null;const n=new Set;exports.ANIMATION_DURATION=t,exports.Z_INDEX={TOOLTIP:1070,POPOVER:1060,MODAL:1050,TOAST:1100},exports.addClosingAnimation=function(e,o=t.NORMAL){return new Promise(t=>{e.classList.add("is-closing"),setTimeout(()=>t(),o)})},exports.calculatePosition=function(t,e,o="top",n=8){const r=t.getBoundingClientRect(),a=(null==e?void 0:e.offsetWidth)??250,s=(null==e?void 0:e.offsetHeight)??100,i=window.pageYOffset||document.documentElement.scrollTop,c=window.pageXOffset||document.documentElement.scrollLeft;let l,m,d=0,u=0;switch(o){case"top":d=r.top+i-s-n,u=r.left+c+(r.width-a)/2,l=a/2-4;break;case"topLeft":d=r.top+i-s-n,u=r.left+c,l=16;break;case"topRight":d=r.top+i-s-n,u=r.right+c-a,l=a-24;break;case"bottom":d=r.bottom+i+n,u=r.left+c+(r.width-a)/2,l=a/2-4;break;case"bottomLeft":d=r.bottom+i+n,u=r.left+c,l=16;break;case"bottomRight":d=r.bottom+i+n,u=r.right+c-a,l=a-24;break;case"left":d=r.top+i+(r.height-s)/2,u=r.left+c-a-n,m=s/2-4;break;case"leftTop":d=r.top+i,u=r.left+c-a-n,m=16;break;case"leftBottom":d=r.bottom+i-s,u=r.left+c-a-n,m=s-24;break;case"right":d=r.top+i+(r.height-s)/2,u=r.right+c+n,m=s/2-4;break;case"rightTop":d=r.top+i,u=r.right+c+n,m=16;break;case"rightBottom":d=r.bottom+i-s,u=r.right+c+n,m=s-24}const h=d,f=u;return d=Math.max(8,Math.min(d,window.innerHeight+i-s-8)),u=Math.max(8,Math.min(u,window.innerWidth+c-a-8)),void 0!==l&&u!==f&&(l+=f-u,l=Math.max(8,Math.min(l,a-8))),void 0!==m&&d!==h&&(m+=h-d,m=Math.max(8,Math.min(m,s-8))),{top:d,left:u,arrowLeft:l,arrowTop:m}},exports.createElement=function(t,e){const o=document.createElement(t);return(null==e?void 0:e.className)&&(o.className=e.className),void 0!==(null==e?void 0:e.textContent)&&(o.textContent=e.textContent),(null==e?void 0:e.styles)&&Object.assign(o.style,e.styles),(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(([t,e])=>{o.setAttribute(t,e)}),o},exports.generateId=function(){return e=(e+1)%Number.MAX_SAFE_INTEGER,e},exports.injectStyle=function(t,e){if(document.getElementById(t))return;const o=document.createElement("style");o.id=t,o.textContent=e,document.head.appendChild(o)},exports.observeTheme=function(t){const e=()=>{const e=t();if(!e)return;const o=Array.isArray(e)?e:[e],n=document.documentElement.getAttribute("data-theme");o.forEach(t=>{n?t.setAttribute("data-theme",n):t.removeAttribute("data-theme")})};return e(),n.add(e),o||(o=new MutationObserver(()=>{n.forEach(t=>t())}),o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})),()=>{n.delete(e),0===n.size&&o&&(o.disconnect(),o=null)}},exports.removeStyle=function(t){const e=document.getElementById(t);e&&e.remove()},exports.safeAsyncCallback=async function(t,e){try{return await t()}catch(o){return console.error("[Solely Commands] Async callback error:",o),void(null==e||e())}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={FAST:200,NORMAL:300,SLOW:500};let e=0,o=null;const n=new Set;exports.ANIMATION_DURATION=t,exports.Z_INDEX={TOOLTIP:1070,POPOVER:1060,MODAL:1050,TOAST:1100},exports.addClosingAnimation=function(e,o=t.NORMAL){return new Promise(t=>{e.classList.add("is-closing"),setTimeout(()=>t(),o)})},exports.calculatePosition=function(t,e,o="top",n=8){const r=t.getBoundingClientRect(),a=e?.offsetWidth??250,s=e?.offsetHeight??100,c=window.pageYOffset||document.documentElement.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft;let l,m,d=0,u=0;switch(o){case"top":d=r.top+c-s-n,u=r.left+i+(r.width-a)/2,l=a/2-4;break;case"topLeft":d=r.top+c-s-n,u=r.left+i,l=16;break;case"topRight":d=r.top+c-s-n,u=r.right+i-a,l=a-24;break;case"bottom":d=r.bottom+c+n,u=r.left+i+(r.width-a)/2,l=a/2-4;break;case"bottomLeft":d=r.bottom+c+n,u=r.left+i,l=16;break;case"bottomRight":d=r.bottom+c+n,u=r.right+i-a,l=a-24;break;case"left":d=r.top+c+(r.height-s)/2,u=r.left+i-a-n,m=s/2-4;break;case"leftTop":d=r.top+c,u=r.left+i-a-n,m=16;break;case"leftBottom":d=r.bottom+c-s,u=r.left+i-a-n,m=s-24;break;case"right":d=r.top+c+(r.height-s)/2,u=r.right+i+n,m=s/2-4;break;case"rightTop":d=r.top+c,u=r.right+i+n,m=16;break;case"rightBottom":d=r.bottom+c-s,u=r.right+i+n,m=s-24}const h=d,f=u;return d=Math.max(8,Math.min(d,window.innerHeight+c-s-8)),u=Math.max(8,Math.min(u,window.innerWidth+i-a-8)),void 0!==l&&u!==f&&(l+=f-u,l=Math.max(8,Math.min(l,a-8))),void 0!==m&&d!==h&&(m+=h-d,m=Math.max(8,Math.min(m,s-8))),{top:d,left:u,arrowLeft:l,arrowTop:m}},exports.createElement=function(t,e){const o=document.createElement(t);return e?.className&&(o.className=e.className),void 0!==e?.textContent&&(o.textContent=e.textContent),e?.styles&&Object.assign(o.style,e.styles),e?.attrs&&Object.entries(e.attrs).forEach(([t,e])=>{o.setAttribute(t,e)}),o},exports.generateId=function(){return e=(e+1)%Number.MAX_SAFE_INTEGER,e},exports.injectStyle=function(t,e){if(document.getElementById(t))return;const o=document.createElement("style");o.id=t,o.textContent=e,document.head.appendChild(o)},exports.observeTheme=function(t){const e=()=>{const e=t();if(!e)return;const o=Array.isArray(e)?e:[e],n=document.documentElement.getAttribute("data-theme");o.forEach(t=>{n?t.setAttribute("data-theme",n):t.removeAttribute("data-theme")})};return e(),n.add(e),o||(o=new MutationObserver(()=>{n.forEach(t=>t())}),o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})),()=>{n.delete(e),0===n.size&&o&&(o.disconnect(),o=null)}},exports.removeStyle=function(t){const e=document.getElementById(t);e&&e.remove()},exports.safeAsyncCallback=async function(t,e){try{return await t()}catch(o){return console.error("[Solely Commands] Async callback error:",o),void e?.()}};
@@ -1 +1 @@
1
- const t={FAST:200,NORMAL:300,SLOW:500},e={TOOLTIP:1070,POPOVER:1060,MODAL:1050,TOAST:1100};let o=0;function n(){return o=(o+1)%Number.MAX_SAFE_INTEGER,o}function r(t,e){if(document.getElementById(t))return;const o=document.createElement("style");o.id=t,o.textContent=e,document.head.appendChild(o)}function a(t){const e=document.getElementById(t);e&&e.remove()}function i(t,e){const o=document.createElement(t);return(null==e?void 0:e.className)&&(o.className=e.className),void 0!==(null==e?void 0:e.textContent)&&(o.textContent=e.textContent),(null==e?void 0:e.styles)&&Object.assign(o.style,e.styles),(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(([t,e])=>{o.setAttribute(t,e)}),o}function c(t,e,o="top",n=8){const r=t.getBoundingClientRect(),a=(null==e?void 0:e.offsetWidth)??250,i=(null==e?void 0:e.offsetHeight)??100,c=window.pageYOffset||document.documentElement.scrollTop,s=window.pageXOffset||document.documentElement.scrollLeft;let l,m,d=0,u=0;switch(o){case"top":d=r.top+c-i-n,u=r.left+s+(r.width-a)/2,l=a/2-4;break;case"topLeft":d=r.top+c-i-n,u=r.left+s,l=16;break;case"topRight":d=r.top+c-i-n,u=r.right+s-a,l=a-24;break;case"bottom":d=r.bottom+c+n,u=r.left+s+(r.width-a)/2,l=a/2-4;break;case"bottomLeft":d=r.bottom+c+n,u=r.left+s,l=16;break;case"bottomRight":d=r.bottom+c+n,u=r.right+s-a,l=a-24;break;case"left":d=r.top+c+(r.height-i)/2,u=r.left+s-a-n,m=i/2-4;break;case"leftTop":d=r.top+c,u=r.left+s-a-n,m=16;break;case"leftBottom":d=r.bottom+c-i,u=r.left+s-a-n,m=i-24;break;case"right":d=r.top+c+(r.height-i)/2,u=r.right+s+n,m=i/2-4;break;case"rightTop":d=r.top+c,u=r.right+s+n,m=16;break;case"rightBottom":d=r.bottom+c-i,u=r.right+s+n,m=i-24}const h=d,f=u;return d=Math.max(8,Math.min(d,window.innerHeight+c-i-8)),u=Math.max(8,Math.min(u,window.innerWidth+s-a-8)),void 0!==l&&u!==f&&(l+=f-u,l=Math.max(8,Math.min(l,a-8))),void 0!==m&&d!==h&&(m+=h-d,m=Math.max(8,Math.min(m,i-8))),{top:d,left:u,arrowLeft:l,arrowTop:m}}async function s(t,e){try{return await t()}catch(o){return console.error("[Solely Commands] Async callback error:",o),void(null==e||e())}}function l(e,o=t.NORMAL){return new Promise(t=>{e.classList.add("is-closing"),setTimeout(()=>t(),o)})}let m=null;const d=new Set;function u(t){const e=()=>{const e=t();if(!e)return;const o=Array.isArray(e)?e:[e],n=document.documentElement.getAttribute("data-theme");o.forEach(t=>{n?t.setAttribute("data-theme",n):t.removeAttribute("data-theme")})};return e(),d.add(e),m||(m=new MutationObserver(()=>{d.forEach(t=>t())}),m.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})),()=>{d.delete(e),0===d.size&&m&&(m.disconnect(),m=null)}}export{t as ANIMATION_DURATION,e as Z_INDEX,l as addClosingAnimation,c as calculatePosition,i as createElement,n as generateId,r as injectStyle,u as observeTheme,a as removeStyle,s as safeAsyncCallback};
1
+ const t={FAST:200,NORMAL:300,SLOW:500},e={TOOLTIP:1070,POPOVER:1060,MODAL:1050,TOAST:1100};let o=0;function n(){return o=(o+1)%Number.MAX_SAFE_INTEGER,o}function r(t,e){if(document.getElementById(t))return;const o=document.createElement("style");o.id=t,o.textContent=e,document.head.appendChild(o)}function a(t){const e=document.getElementById(t);e&&e.remove()}function c(t,e){const o=document.createElement(t);return e?.className&&(o.className=e.className),void 0!==e?.textContent&&(o.textContent=e.textContent),e?.styles&&Object.assign(o.style,e.styles),e?.attrs&&Object.entries(e.attrs).forEach(([t,e])=>{o.setAttribute(t,e)}),o}function i(t,e,o="top",n=8){const r=t.getBoundingClientRect(),a=e?.offsetWidth??250,c=e?.offsetHeight??100,i=window.pageYOffset||document.documentElement.scrollTop,s=window.pageXOffset||document.documentElement.scrollLeft;let m,l,d=0,u=0;switch(o){case"top":d=r.top+i-c-n,u=r.left+s+(r.width-a)/2,m=a/2-4;break;case"topLeft":d=r.top+i-c-n,u=r.left+s,m=16;break;case"topRight":d=r.top+i-c-n,u=r.right+s-a,m=a-24;break;case"bottom":d=r.bottom+i+n,u=r.left+s+(r.width-a)/2,m=a/2-4;break;case"bottomLeft":d=r.bottom+i+n,u=r.left+s,m=16;break;case"bottomRight":d=r.bottom+i+n,u=r.right+s-a,m=a-24;break;case"left":d=r.top+i+(r.height-c)/2,u=r.left+s-a-n,l=c/2-4;break;case"leftTop":d=r.top+i,u=r.left+s-a-n,l=16;break;case"leftBottom":d=r.bottom+i-c,u=r.left+s-a-n,l=c-24;break;case"right":d=r.top+i+(r.height-c)/2,u=r.right+s+n,l=c/2-4;break;case"rightTop":d=r.top+i,u=r.right+s+n,l=16;break;case"rightBottom":d=r.bottom+i-c,u=r.right+s+n,l=c-24}const h=d,f=u;return d=Math.max(8,Math.min(d,window.innerHeight+i-c-8)),u=Math.max(8,Math.min(u,window.innerWidth+s-a-8)),void 0!==m&&u!==f&&(m+=f-u,m=Math.max(8,Math.min(m,a-8))),void 0!==l&&d!==h&&(l+=h-d,l=Math.max(8,Math.min(l,c-8))),{top:d,left:u,arrowLeft:m,arrowTop:l}}async function s(t,e){try{return await t()}catch(o){return console.error("[Solely Commands] Async callback error:",o),void e?.()}}function m(e,o=t.NORMAL){return new Promise(t=>{e.classList.add("is-closing"),setTimeout(()=>t(),o)})}let l=null;const d=new Set;function u(t){const e=()=>{const e=t();if(!e)return;const o=Array.isArray(e)?e:[e],n=document.documentElement.getAttribute("data-theme");o.forEach(t=>{n?t.setAttribute("data-theme",n):t.removeAttribute("data-theme")})};return e(),d.add(e),l||(l=new MutationObserver(()=>{d.forEach(t=>t())}),l.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})),()=>{d.delete(e),0===d.size&&l&&(l.disconnect(),l=null)}}export{t as ANIMATION_DURATION,e as Z_INDEX,m as addClosingAnimation,i as calculatePosition,c as createElement,n as generateId,r as injectStyle,u as observeTheme,a as removeStyle,s as safeAsyncCallback};
@@ -1 +1 @@
1
- "use strict";var e=Object.defineProperty;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./style.css.cjs"),s=require("./index.html.cjs"),o=require("../../../runtime/component/base-element.cjs"),r=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyAlert=class extends o.default{constructor(){var t,s;super(...arguments),((t,s,o)=>{s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[s]=o})(this,"symbol"!=typeof(t="closeTimer")?t+"":t,s)}getAlertClasses(){return{[`alert--${this.$data.type}`]:!!this.$data.type,"is-closing":this.$data.closing,"alert--block":!!this.$data.block}}getIcon(e){const t={info:"ℹ",success:"✓",warning:"⚠",error:"✕"};return t[e]||t.info}mounted(){this.refresh()}unmounted(){this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=void 0)}handleClose(){this.$data.closing=!0,this.emit("close"),this.closeTimer=setTimeout(()=>{this.remove()},300)}setMessage(e){this.$data.message=e}setType(e){this.$data.type=e}},exports.SolelyAlert=((e,t)=>{for(var s,o=t,r=e.length-1;r>=0;r--)(s=e[r])&&(o=s(o)||o);return o})([r.CustomElement({tagName:"solely-alert",template:s.__SOLELY_IR__,styles:t.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"info"},{name:"message",type:"string",default:""},{name:"description",type:"string",default:""},{name:"closable",type:"boolean",default:!1},{name:"showIcon",type:"boolean",default:!1},{name:"block",type:"boolean",default:!1}]})],exports.SolelyAlert);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),s=require("../../../runtime/component/base-element.cjs"),o=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyAlert=class extends s.default{closeTimer;getAlertClasses(){return{[`alert--${this.$data.type}`]:!!this.$data.type,"is-closing":this.$data.closing,"alert--block":!!this.$data.block}}getIcon(e){const t={info:"ℹ",success:"✓",warning:"⚠",error:"✕"};return t[e]||t.info}mounted(){this.refresh()}unmounted(){this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=void 0)}handleClose(){this.$data.closing=!0,this.emit("close"),this.closeTimer=setTimeout(()=>{this.remove()},300)}setMessage(e){this.$data.message=e}setType(e){this.$data.type=e}},exports.SolelyAlert=((e,t)=>{for(var s,o=t,r=e.length-1;r>=0;r--)(s=e[r])&&(o=s(o)||o);return o})([o.CustomElement({tagName:"solely-alert",template:t.__SOLELY_IR__,styles:e.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"info"},{name:"message",type:"string",default:""},{name:"description",type:"string",default:""},{name:"closable",type:"boolean",default:!1},{name:"showIcon",type:"boolean",default:!1},{name:"block",type:"boolean",default:!1}]})],exports.SolelyAlert);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:s}=this;return this.getAlertClasses()},function(t){const{$data:s}=this;return s.showIcon},function(t){const{$data:s}=this;return`${this.getIcon(s.type)}`},function(t){const{$data:s}=this;return s.message},function(t){const{$data:s}=this;return`${s.message}`},function(t){const{$data:s}=this;return s.description},function(t){const{$data:s}=this;return`${s.description}`},function(t){const{$data:s}=this;return s.closable},function(t,s){const{$data:a}=this,{value:n,checked:c}=(null==t?void 0:t.target)||{};this.handleClose()}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"alert",d:0},{k:":class",f:1,d:1}],c:[{t:7,d:1,b:[{f:2,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"alert__icon",d:0}],c:[{t:0,d:0,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[{t:1,d:1,f:3}]}]}]}]},{t:0,d:0,g:"div",a:[{k:"part",v:"content",d:0},{k:"class",v:"alert__content",d:0}],c:[{t:7,d:1,b:[{f:4,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"message",d:0},{k:"class",v:"alert__message",d:0}],c:[{t:1,d:1,f:5}]}]}]},{t:7,d:1,b:[{f:6,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"description",d:0},{k:"class",v:"alert__description",d:0}],c:[{t:1,d:1,f:7}]}]}]},{t:0,d:0,s:1,g:"slot",a:[],c:[]}]},{t:7,d:1,b:[{f:8,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"close",d:0},{k:"class",v:"alert__close",d:0},{k:"@click",f:9,d:1}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"close-icon",d:0}],c:[{t:1,d:0,s:1,x:"×"}]}]}]}]}]}],s:{tf:9,cf:9,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:s}=this;return this.getAlertClasses()},function(t){const{$data:s}=this;return s.showIcon},function(t){const{$data:s}=this;return`${this.getIcon(s.type)}`},function(t){const{$data:s}=this;return s.message},function(t){const{$data:s}=this;return`${s.message}`},function(t){const{$data:s}=this;return s.description},function(t){const{$data:s}=this;return`${s.description}`},function(t){const{$data:s}=this;return s.closable},function(t,s){const{$data:a}=this,{value:c,checked:n}=t?.target||{};this.handleClose()}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"alert",d:0},{k:":class",f:1,d:1}],c:[{t:7,d:1,b:[{f:2,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"alert__icon",d:0}],c:[{t:0,d:0,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[{t:1,d:1,f:3}]}]}]}]},{t:0,d:0,g:"div",a:[{k:"part",v:"content",d:0},{k:"class",v:"alert__content",d:0}],c:[{t:7,d:1,b:[{f:4,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"message",d:0},{k:"class",v:"alert__message",d:0}],c:[{t:1,d:1,f:5}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:6,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"description",d:0},{k:"class",v:"alert__description",d:0}],c:[{t:1,d:1,f:7}]}]}]},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"slot",a:[],c:[]}]},{t:7,d:1,b:[{f:8,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"close",d:0},{k:"class",v:"alert__close",d:0},{k:"@click",f:9,d:1}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"close-icon",d:0}],c:[{t:1,d:0,s:1,x:"×"}]}]}]}]}]}],s:{tf:9,cf:9,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
@@ -1 +1 @@
1
- const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:s}=this;return this.getAlertClasses()},function(t){const{$data:s}=this;return s.showIcon},function(t){const{$data:s}=this;return`${this.getIcon(s.type)}`},function(t){const{$data:s}=this;return s.message},function(t){const{$data:s}=this;return`${s.message}`},function(t){const{$data:s}=this;return s.description},function(t){const{$data:s}=this;return`${s.description}`},function(t){const{$data:s}=this;return s.closable},function(t,s){const{$data:a}=this,{value:n,checked:c}=(null==t?void 0:t.target)||{};this.handleClose()}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"alert",d:0},{k:":class",f:1,d:1}],c:[{t:7,d:1,b:[{f:2,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"alert__icon",d:0}],c:[{t:0,d:0,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[{t:1,d:1,f:3}]}]}]}]},{t:0,d:0,g:"div",a:[{k:"part",v:"content",d:0},{k:"class",v:"alert__content",d:0}],c:[{t:7,d:1,b:[{f:4,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"message",d:0},{k:"class",v:"alert__message",d:0}],c:[{t:1,d:1,f:5}]}]}]},{t:7,d:1,b:[{f:6,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"description",d:0},{k:"class",v:"alert__description",d:0}],c:[{t:1,d:1,f:7}]}]}]},{t:0,d:0,s:1,g:"slot",a:[],c:[]}]},{t:7,d:1,b:[{f:8,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"close",d:0},{k:"class",v:"alert__close",d:0},{k:"@click",f:9,d:1}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"close-icon",d:0}],c:[{t:1,d:0,s:1,x:"×"}]}]}]}]}]}],s:{tf:9,cf:9,dn:1,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
1
+ const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:s}=this;return this.getAlertClasses()},function(t){const{$data:s}=this;return s.showIcon},function(t){const{$data:s}=this;return`${this.getIcon(s.type)}`},function(t){const{$data:s}=this;return s.message},function(t){const{$data:s}=this;return`${s.message}`},function(t){const{$data:s}=this;return s.description},function(t){const{$data:s}=this;return`${s.description}`},function(t){const{$data:s}=this;return s.closable},function(t,s){const{$data:a}=this,{value:c,checked:n}=t?.target||{};this.handleClose()}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"alert",d:0},{k:":class",f:1,d:1}],c:[{t:7,d:1,b:[{f:2,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"alert__icon",d:0}],c:[{t:0,d:0,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[{t:1,d:1,f:3}]}]}]}]},{t:0,d:0,g:"div",a:[{k:"part",v:"content",d:0},{k:"class",v:"alert__content",d:0}],c:[{t:7,d:1,b:[{f:4,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"message",d:0},{k:"class",v:"alert__message",d:0}],c:[{t:1,d:1,f:5}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:6,c:[{t:0,d:0,g:"div",a:[{k:"part",v:"description",d:0},{k:"class",v:"alert__description",d:0}],c:[{t:1,d:1,f:7}]}]}]},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"slot",a:[],c:[]}]},{t:7,d:1,b:[{f:8,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"close",d:0},{k:"class",v:"alert__close",d:0},{k:"@click",f:9,d:1}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"close-icon",d:0}],c:[{t:1,d:0,s:1,x:"×"}]}]}]}]}]}],s:{tf:9,cf:9,dn:1,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
@@ -1 +1 @@
1
- var e=Object.defineProperty;import t from"./style.css.js";import{__SOLELY_IR__ as s}from"./index.html.js";import o from"../../../runtime/component/base-element.js";import{CustomElement as r}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let a=class extends o{constructor(){var t,s;super(...arguments),((t,s,o)=>{s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[s]=o})(this,"symbol"!=typeof(t="closeTimer")?t+"":t,s)}getAlertClasses(){return{[`alert--${this.$data.type}`]:!!this.$data.type,"is-closing":this.$data.closing,"alert--block":!!this.$data.block}}getIcon(e){const t={info:"ℹ",success:"✓",warning:"⚠",error:"✕"};return t[e]||t.info}mounted(){this.refresh()}unmounted(){this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=void 0)}handleClose(){this.$data.closing=!0,this.emit("close"),this.closeTimer=setTimeout(()=>{this.remove()},300)}setMessage(e){this.$data.message=e}setType(e){this.$data.type=e}};a=((e,t)=>{for(var s,o=t,r=e.length-1;r>=0;r--)(s=e[r])&&(o=s(o)||o);return o})([r({tagName:"solely-alert",template:s,styles:t,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"info"},{name:"message",type:"string",default:""},{name:"description",type:"string",default:""},{name:"closable",type:"boolean",default:!1},{name:"showIcon",type:"boolean",default:!1},{name:"block",type:"boolean",default:!1}]})],a);export{a as SolelyAlert};
1
+ import e from"./style.css.js";import{__SOLELY_IR__ as t}from"./index.html.js";import s from"../../../runtime/component/base-element.js";import{CustomElement as o}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let a=class extends s{closeTimer;getAlertClasses(){return{[`alert--${this.$data.type}`]:!!this.$data.type,"is-closing":this.$data.closing,"alert--block":!!this.$data.block}}getIcon(e){const t={info:"ℹ",success:"✓",warning:"⚠",error:"✕"};return t[e]||t.info}mounted(){this.refresh()}unmounted(){this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=void 0)}handleClose(){this.$data.closing=!0,this.emit("close"),this.closeTimer=setTimeout(()=>{this.remove()},300)}setMessage(e){this.$data.message=e}setType(e){this.$data.type=e}};a=((e,t)=>{for(var s,o=t,a=e.length-1;a>=0;a--)(s=e[a])&&(o=s(o)||o);return o})([o({tagName:"solely-alert",template:t,styles:e,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"info"},{name:"message",type:"string",default:""},{name:"description",type:"string",default:""},{name:"closable",type:"boolean",default:!1},{name:"showIcon",type:"boolean",default:!1},{name:"block",type:"boolean",default:!1}]})],a);export{a as SolelyAlert};
@@ -1 +1 @@
1
- "use strict";var t=Object.defineProperty,e=(e,i,o)=>((e,i,o)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o)(e,"symbol"!=typeof i?i+"":i,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./style.css.cjs"),o=require("./index.html.cjs"),s=require("../utils/helpers.cjs"),n=require("../../../runtime/component/base-element.cjs"),r=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyBackTop=class extends n.default{constructor(){super(...arguments),e(this,"onScrollThrottled"),e(this,"onResizeThrottled"),e(this,"scrollAncestors",[]),e(this,"container",null),e(this,"mountTimeout"),e(this,"initialized",!1),e(this,"animating",!1),e(this,"isDocumentContainer",!1)}get visibilityHeight(){return this.$data.visibilityHeight??400}set visibilityHeight(t){this.$data.visibilityHeight=t,this.handleScroll()}get duration(){return this.$data.duration??450}set duration(t){this.$data.duration=t}updateVisibleClass(){this.$data.visible?this.classList.add("backtop--visible"):this.classList.remove("backtop--visible")}getContainer(){let t=this.parentElement;for(;t;){const e=window.getComputedStyle(t);if("auto"===e.overflowY||"scroll"===e.overflowY)return t;t=t.parentElement}return null}getScrollAncestors(t){const e=[];let i=t.parentElement;for(;i;){const t=window.getComputedStyle(i);"auto"!==t.overflowY&&"scroll"!==t.overflowY||e.push(i),i=i.parentElement}return e}mounted(){this.refresh(),this.$data.visible=!1,this.mountTimeout=setTimeout(()=>{this.initializeContainer()},100)}unmounted(){this.initialized=!1,this.animating=!1,this.mountTimeout&&(clearTimeout(this.mountTimeout),this.mountTimeout=void 0),this.cleanupEventListeners()}initializeContainer(){if(!this.initialized){if(this.initialized=!0,this.container=this.getContainer(),this.container?this.isDocumentContainer=!1:(this.container=document.documentElement,this.isDocumentContainer=!0),this.isDocumentContainer?this.scrollAncestors=[]:this.scrollAncestors=this.getScrollAncestors(this.container),this.onScrollThrottled=s.throttle(()=>{this.handleScroll(),this.isDocumentContainer||this.schedulePositionUpdate()},16),this.isDocumentContainer)window.addEventListener("scroll",this.onScrollThrottled,{passive:!0});else{this.container.addEventListener("scroll",this.onScrollThrottled),window.addEventListener("scroll",this.onScrollThrottled,{passive:!0});const t=this.onScrollThrottled;this.scrollAncestors.forEach(e=>{t&&e.addEventListener("scroll",t,{passive:!0})})}this.onResizeThrottled=s.throttle(()=>{this.isDocumentContainer||this.schedulePositionUpdate()},16),window.addEventListener("resize",this.onResizeThrottled),this.handleScroll(),this.updatePosition()}}cleanupEventListeners(){if(this.onScrollThrottled){if(this.isDocumentContainer)window.removeEventListener("scroll",this.onScrollThrottled);else{this.container&&this.container.removeEventListener("scroll",this.onScrollThrottled),window.removeEventListener("scroll",this.onScrollThrottled);const t=this.onScrollThrottled;this.scrollAncestors.forEach(e=>{t&&e.removeEventListener("scroll",t)})}this.onScrollThrottled=void 0}this.onResizeThrottled&&(window.removeEventListener("resize",this.onResizeThrottled),this.onResizeThrottled=void 0)}schedulePositionUpdate(){requestAnimationFrame(()=>this.updatePosition())}updatePosition(){if(!this.container)return;if(this.isDocumentContainer)return this.style.right="",void(this.style.bottom="");const t=this.container.getBoundingClientRect();this.style.position="fixed",this.style.right=window.innerWidth-t.right+20+"px",this.style.bottom=window.innerHeight-t.bottom+20+"px"}handleScroll(){if(!this.container)return;const t=this.getScrollTop()>=this.$data.visibilityHeight;this.$data.visible!==t&&(this.$data.visible=t,this.updateVisibleClass())}getScrollTop(){var t;return this.isDocumentContainer?window.scrollY||document.documentElement.scrollTop:(null==(t=this.container)?void 0:t.scrollTop)??0}setScrollTop(t){this.isDocumentContainer?(window.scrollTo({top:t,behavior:"instant"}),document.documentElement.scrollTop=t):this.container&&(this.container.scrollTop=t)}handleClick(){if(this.animating||!this.container)return;this.animating=!0;const t=this.$data.duration||450,e=Date.now(),i=this.getScrollTop(),o=()=>{if(!this.animating)return;const s=Date.now()-e,n=Math.min(s/t,1),r=n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,l=i*(1-r);this.setScrollTop(l),n<1?requestAnimationFrame(o):(this.animating=!1,this.dispatchEvent(new CustomEvent("backtop-finish",{bubbles:!0,composed:!0})))};requestAnimationFrame(o)}},exports.SolelyBackTop=((t,e)=>{for(var i,o=e,s=t.length-1;s>=0;s--)(i=t[s])&&(o=i(o)||o);return o})([r.CustomElement({tagName:"solely-backtop",template:o.__SOLELY_IR__,styles:i.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"visibilityHeight",type:"number",default:400},{name:"duration",type:"number",default:450}]})],exports.SolelyBackTop);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./style.css.cjs"),e=require("./index.html.cjs"),i=require("../utils/helpers.cjs"),o=require("../../../runtime/component/base-element.cjs"),s=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyBackTop=class extends o.default{onScrollThrottled;onResizeThrottled;scrollAncestors=[];container=null;mountTimeout;initialized=!1;animating=!1;isDocumentContainer=!1;get visibilityHeight(){return this.$data.visibilityHeight??400}set visibilityHeight(t){this.$data.visibilityHeight=t,this.handleScroll()}get duration(){return this.$data.duration??450}set duration(t){this.$data.duration=t}updateVisibleClass(){this.$data.visible?this.classList.add("backtop--visible"):this.classList.remove("backtop--visible")}getContainer(){let t=this.parentElement;for(;t;){const e=window.getComputedStyle(t);if("auto"===e.overflowY||"scroll"===e.overflowY)return t;t=t.parentElement}return null}getScrollAncestors(t){const e=[];let i=t.parentElement;for(;i;){const t=window.getComputedStyle(i);"auto"!==t.overflowY&&"scroll"!==t.overflowY||e.push(i),i=i.parentElement}return e}mounted(){this.refresh(),this.$data.visible=!1,this.mountTimeout=setTimeout(()=>{this.initializeContainer()},100)}unmounted(){this.initialized=!1,this.animating=!1,this.mountTimeout&&(clearTimeout(this.mountTimeout),this.mountTimeout=void 0),this.cleanupEventListeners()}initializeContainer(){if(!this.initialized){if(this.initialized=!0,this.container=this.getContainer(),this.container?this.isDocumentContainer=!1:(this.container=document.documentElement,this.isDocumentContainer=!0),this.isDocumentContainer?this.scrollAncestors=[]:this.scrollAncestors=this.getScrollAncestors(this.container),this.onScrollThrottled=i.throttle(()=>{this.handleScroll(),this.isDocumentContainer||this.schedulePositionUpdate()},16),this.isDocumentContainer)window.addEventListener("scroll",this.onScrollThrottled,{passive:!0});else{this.container.addEventListener("scroll",this.onScrollThrottled),window.addEventListener("scroll",this.onScrollThrottled,{passive:!0});const t=this.onScrollThrottled;this.scrollAncestors.forEach(e=>{t&&e.addEventListener("scroll",t,{passive:!0})})}this.onResizeThrottled=i.throttle(()=>{this.isDocumentContainer||this.schedulePositionUpdate()},16),window.addEventListener("resize",this.onResizeThrottled),this.handleScroll(),this.updatePosition()}}cleanupEventListeners(){if(this.onScrollThrottled){if(this.isDocumentContainer)window.removeEventListener("scroll",this.onScrollThrottled);else{this.container&&this.container.removeEventListener("scroll",this.onScrollThrottled),window.removeEventListener("scroll",this.onScrollThrottled);const t=this.onScrollThrottled;this.scrollAncestors.forEach(e=>{t&&e.removeEventListener("scroll",t)})}this.onScrollThrottled=void 0}this.onResizeThrottled&&(window.removeEventListener("resize",this.onResizeThrottled),this.onResizeThrottled=void 0)}schedulePositionUpdate(){requestAnimationFrame(()=>this.updatePosition())}updatePosition(){if(!this.container)return;if(this.isDocumentContainer)return this.style.right="",void(this.style.bottom="");const t=this.container.getBoundingClientRect();this.style.position="fixed",this.style.right=window.innerWidth-t.right+20+"px",this.style.bottom=window.innerHeight-t.bottom+20+"px"}handleScroll(){if(!this.container)return;const t=this.getScrollTop()>=this.$data.visibilityHeight;this.$data.visible!==t&&(this.$data.visible=t,this.updateVisibleClass())}getScrollTop(){return this.isDocumentContainer?window.scrollY||document.documentElement.scrollTop:this.container?.scrollTop??0}setScrollTop(t){this.isDocumentContainer?(window.scrollTo({top:t,behavior:"instant"}),document.documentElement.scrollTop=t):this.container&&(this.container.scrollTop=t)}handleClick(){if(this.animating||!this.container)return;this.animating=!0;const t=this.$data.duration||450,e=Date.now(),i=this.getScrollTop(),o=()=>{if(!this.animating)return;const s=Date.now()-e,n=Math.min(s/t,1),r=n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,l=i*(1-r);this.setScrollTop(l),n<1?requestAnimationFrame(o):(this.animating=!1,this.dispatchEvent(new CustomEvent("backtop-finish",{bubbles:!0,composed:!0})))};requestAnimationFrame(o)}},exports.SolelyBackTop=((t,e)=>{for(var i,o=e,s=t.length-1;s>=0;s--)(i=t[s])&&(o=i(o)||o);return o})([s.CustomElement({tagName:"solely-backtop",template:e.__SOLELY_IR__,styles:t.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"visibilityHeight",type:"number",default:400},{name:"duration",type:"number",default:450}]})],exports.SolelyBackTop);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t,s){const{$data:e}=this,{value:a,checked:c}=(null==t?void 0:t.target)||{};this.handleClick()}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"backtop",d:0},{k:"@click",f:1,d:1}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"backtop__icon",d:0}],c:[{t:1,d:0,s:1,x:"↑"}]}]}],s:{tf:1,cf:1,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t,s){const{$data:e}=this,{value:a,checked:c}=t?.target||{};this.handleClick()}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"backtop",d:0},{k:"@click",f:1,d:1}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"backtop__icon",d:0}],c:[{t:1,d:0,s:1,x:"↑"}]}]}],s:{tf:1,cf:1,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
@@ -1 +1 @@
1
- const t={t:"root",v:"1.2.0",fns:[function(t,a){const{$data:c}=this,{value:s,checked:d}=(null==t?void 0:t.target)||{};this.handleClick()}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"backtop",d:0},{k:"@click",f:1,d:1}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"backtop__icon",d:0}],c:[{t:1,d:0,s:1,x:"↑"}]}]}],s:{tf:1,cf:1,dn:1,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
1
+ const t={t:"root",v:"1.2.0",fns:[function(t,a){const{$data:c}=this,{value:s,checked:d}=t?.target||{};this.handleClick()}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"backtop",d:0},{k:"@click",f:1,d:1}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"backtop__icon",d:0}],c:[{t:1,d:0,s:1,x:"↑"}]}]}],s:{tf:1,cf:1,dn:1,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
@@ -1 +1 @@
1
- var t=Object.defineProperty,i=(i,e,o)=>((i,e,o)=>e in i?t(i,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[e]=o)(i,"symbol"!=typeof e?e+"":e,o);import e from"./style.css.js";import{__SOLELY_IR__ as o}from"./index.html.js";import{throttle as s}from"../utils/helpers.js";import n from"../../../runtime/component/base-element.js";import{CustomElement as r}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let l=class extends n{constructor(){super(...arguments),i(this,"onScrollThrottled"),i(this,"onResizeThrottled"),i(this,"scrollAncestors",[]),i(this,"container",null),i(this,"mountTimeout"),i(this,"initialized",!1),i(this,"animating",!1),i(this,"isDocumentContainer",!1)}get visibilityHeight(){return this.$data.visibilityHeight??400}set visibilityHeight(t){this.$data.visibilityHeight=t,this.handleScroll()}get duration(){return this.$data.duration??450}set duration(t){this.$data.duration=t}updateVisibleClass(){this.$data.visible?this.classList.add("backtop--visible"):this.classList.remove("backtop--visible")}getContainer(){let t=this.parentElement;for(;t;){const i=window.getComputedStyle(t);if("auto"===i.overflowY||"scroll"===i.overflowY)return t;t=t.parentElement}return null}getScrollAncestors(t){const i=[];let e=t.parentElement;for(;e;){const t=window.getComputedStyle(e);"auto"!==t.overflowY&&"scroll"!==t.overflowY||i.push(e),e=e.parentElement}return i}mounted(){this.refresh(),this.$data.visible=!1,this.mountTimeout=setTimeout(()=>{this.initializeContainer()},100)}unmounted(){this.initialized=!1,this.animating=!1,this.mountTimeout&&(clearTimeout(this.mountTimeout),this.mountTimeout=void 0),this.cleanupEventListeners()}initializeContainer(){if(!this.initialized){if(this.initialized=!0,this.container=this.getContainer(),this.container?this.isDocumentContainer=!1:(this.container=document.documentElement,this.isDocumentContainer=!0),this.isDocumentContainer?this.scrollAncestors=[]:this.scrollAncestors=this.getScrollAncestors(this.container),this.onScrollThrottled=s(()=>{this.handleScroll(),this.isDocumentContainer||this.schedulePositionUpdate()},16),this.isDocumentContainer)window.addEventListener("scroll",this.onScrollThrottled,{passive:!0});else{this.container.addEventListener("scroll",this.onScrollThrottled),window.addEventListener("scroll",this.onScrollThrottled,{passive:!0});const t=this.onScrollThrottled;this.scrollAncestors.forEach(i=>{t&&i.addEventListener("scroll",t,{passive:!0})})}this.onResizeThrottled=s(()=>{this.isDocumentContainer||this.schedulePositionUpdate()},16),window.addEventListener("resize",this.onResizeThrottled),this.handleScroll(),this.updatePosition()}}cleanupEventListeners(){if(this.onScrollThrottled){if(this.isDocumentContainer)window.removeEventListener("scroll",this.onScrollThrottled);else{this.container&&this.container.removeEventListener("scroll",this.onScrollThrottled),window.removeEventListener("scroll",this.onScrollThrottled);const t=this.onScrollThrottled;this.scrollAncestors.forEach(i=>{t&&i.removeEventListener("scroll",t)})}this.onScrollThrottled=void 0}this.onResizeThrottled&&(window.removeEventListener("resize",this.onResizeThrottled),this.onResizeThrottled=void 0)}schedulePositionUpdate(){requestAnimationFrame(()=>this.updatePosition())}updatePosition(){if(!this.container)return;if(this.isDocumentContainer)return this.style.right="",void(this.style.bottom="");const t=this.container.getBoundingClientRect();this.style.position="fixed",this.style.right=window.innerWidth-t.right+20+"px",this.style.bottom=window.innerHeight-t.bottom+20+"px"}handleScroll(){if(!this.container)return;const t=this.getScrollTop()>=this.$data.visibilityHeight;this.$data.visible!==t&&(this.$data.visible=t,this.updateVisibleClass())}getScrollTop(){var t;return this.isDocumentContainer?window.scrollY||document.documentElement.scrollTop:(null==(t=this.container)?void 0:t.scrollTop)??0}setScrollTop(t){this.isDocumentContainer?(window.scrollTo({top:t,behavior:"instant"}),document.documentElement.scrollTop=t):this.container&&(this.container.scrollTop=t)}handleClick(){if(this.animating||!this.container)return;this.animating=!0;const t=this.$data.duration||450,i=Date.now(),e=this.getScrollTop(),o=()=>{if(!this.animating)return;const s=Date.now()-i,n=Math.min(s/t,1),r=n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,l=e*(1-r);this.setScrollTop(l),n<1?requestAnimationFrame(o):(this.animating=!1,this.dispatchEvent(new CustomEvent("backtop-finish",{bubbles:!0,composed:!0})))};requestAnimationFrame(o)}};l=((t,i)=>{for(var e,o=i,s=t.length-1;s>=0;s--)(e=t[s])&&(o=e(o)||o);return o})([r({tagName:"solely-backtop",template:o,styles:e,shadowDOM:{use:!0,mode:"open"},props:[{name:"visibilityHeight",type:"number",default:400},{name:"duration",type:"number",default:450}]})],l);export{l as SolelyBackTop};
1
+ import t from"./style.css.js";import{__SOLELY_IR__ as i}from"./index.html.js";import{throttle as e}from"../utils/helpers.js";import o from"../../../runtime/component/base-element.js";import{CustomElement as n}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let s=class extends o{onScrollThrottled;onResizeThrottled;scrollAncestors=[];container=null;mountTimeout;initialized=!1;animating=!1;isDocumentContainer=!1;get visibilityHeight(){return this.$data.visibilityHeight??400}set visibilityHeight(t){this.$data.visibilityHeight=t,this.handleScroll()}get duration(){return this.$data.duration??450}set duration(t){this.$data.duration=t}updateVisibleClass(){this.$data.visible?this.classList.add("backtop--visible"):this.classList.remove("backtop--visible")}getContainer(){let t=this.parentElement;for(;t;){const i=window.getComputedStyle(t);if("auto"===i.overflowY||"scroll"===i.overflowY)return t;t=t.parentElement}return null}getScrollAncestors(t){const i=[];let e=t.parentElement;for(;e;){const t=window.getComputedStyle(e);"auto"!==t.overflowY&&"scroll"!==t.overflowY||i.push(e),e=e.parentElement}return i}mounted(){this.refresh(),this.$data.visible=!1,this.mountTimeout=setTimeout(()=>{this.initializeContainer()},100)}unmounted(){this.initialized=!1,this.animating=!1,this.mountTimeout&&(clearTimeout(this.mountTimeout),this.mountTimeout=void 0),this.cleanupEventListeners()}initializeContainer(){if(!this.initialized){if(this.initialized=!0,this.container=this.getContainer(),this.container?this.isDocumentContainer=!1:(this.container=document.documentElement,this.isDocumentContainer=!0),this.isDocumentContainer?this.scrollAncestors=[]:this.scrollAncestors=this.getScrollAncestors(this.container),this.onScrollThrottled=e(()=>{this.handleScroll(),this.isDocumentContainer||this.schedulePositionUpdate()},16),this.isDocumentContainer)window.addEventListener("scroll",this.onScrollThrottled,{passive:!0});else{this.container.addEventListener("scroll",this.onScrollThrottled),window.addEventListener("scroll",this.onScrollThrottled,{passive:!0});const t=this.onScrollThrottled;this.scrollAncestors.forEach(i=>{t&&i.addEventListener("scroll",t,{passive:!0})})}this.onResizeThrottled=e(()=>{this.isDocumentContainer||this.schedulePositionUpdate()},16),window.addEventListener("resize",this.onResizeThrottled),this.handleScroll(),this.updatePosition()}}cleanupEventListeners(){if(this.onScrollThrottled){if(this.isDocumentContainer)window.removeEventListener("scroll",this.onScrollThrottled);else{this.container&&this.container.removeEventListener("scroll",this.onScrollThrottled),window.removeEventListener("scroll",this.onScrollThrottled);const t=this.onScrollThrottled;this.scrollAncestors.forEach(i=>{t&&i.removeEventListener("scroll",t)})}this.onScrollThrottled=void 0}this.onResizeThrottled&&(window.removeEventListener("resize",this.onResizeThrottled),this.onResizeThrottled=void 0)}schedulePositionUpdate(){requestAnimationFrame(()=>this.updatePosition())}updatePosition(){if(!this.container)return;if(this.isDocumentContainer)return this.style.right="",void(this.style.bottom="");const t=this.container.getBoundingClientRect();this.style.position="fixed",this.style.right=window.innerWidth-t.right+20+"px",this.style.bottom=window.innerHeight-t.bottom+20+"px"}handleScroll(){if(!this.container)return;const t=this.getScrollTop()>=this.$data.visibilityHeight;this.$data.visible!==t&&(this.$data.visible=t,this.updateVisibleClass())}getScrollTop(){return this.isDocumentContainer?window.scrollY||document.documentElement.scrollTop:this.container?.scrollTop??0}setScrollTop(t){this.isDocumentContainer?(window.scrollTo({top:t,behavior:"instant"}),document.documentElement.scrollTop=t):this.container&&(this.container.scrollTop=t)}handleClick(){if(this.animating||!this.container)return;this.animating=!0;const t=this.$data.duration||450,i=Date.now(),e=this.getScrollTop(),o=()=>{if(!this.animating)return;const n=Date.now()-i,s=Math.min(n/t,1),r=s<.5?4*s*s*s:1-Math.pow(-2*s+2,3)/2,l=e*(1-r);this.setScrollTop(l),s<1?requestAnimationFrame(o):(this.animating=!1,this.dispatchEvent(new CustomEvent("backtop-finish",{bubbles:!0,composed:!0})))};requestAnimationFrame(o)}};s=((t,i)=>{for(var e,o=i,n=t.length-1;n>=0;n--)(e=t[n])&&(o=e(o)||o);return o})([n({tagName:"solely-backtop",template:i,styles:t,shadowDOM:{use:!0,mode:"open"},props:[{name:"visibilityHeight",type:"number",default:400},{name:"duration",type:"number",default:450}]})],s);export{s as SolelyBackTop};
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:s}=this;return this.getBadgeClasses()},function(t){const{$data:s}=this;return s.count>0&&!s.dot&&!s.status},function(t){const{$data:s}=this;return s.color?{backgroundColor:s.color}:{}},function(t){const{$data:s}=this;return`${s.count>s.overflowCount?s.overflowCount+"+":s.count}`},function(t){const{$data:s}=this;return s.dot&&!s.status},function(t){const{$data:s}=this;return s.status},function(t){const{$data:s}=this;return this.getStatusDotClasses()},function(t){const{$data:s}=this;return s.text},function(t){const{$data:s}=this;return`${s.text}`}],n:[{t:0,d:1,g:"span",a:[{k:"part",v:"base",d:0},{k:"class",v:"badge",d:0},{k:":class",f:1,d:1}],c:[{t:0,d:0,s:1,g:"slot",a:[],c:[]},{t:2,d:0,x:" 数字徽标 "},{t:7,d:1,b:[{f:2,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"count",d:0},{k:"class",v:"badge__count",d:0},{k:":style",f:3,d:1}],c:[{t:1,d:1,f:4}]}]}]},{t:2,d:0,x:" 小红点 "},{t:7,d:1,b:[{f:5,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"dot",d:0},{k:"class",v:"badge__dot",d:0},{k:":style",f:3,d:1}],c:[]}]}]},{t:2,d:0,x:" 状态点 "},{t:7,d:1,b:[{f:6,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"status",d:0},{k:"class",v:"badge__status",d:0}],c:[{t:0,d:1,g:"span",a:[{k:"part",v:"status-dot",d:0},{k:"class",v:"badge__status-dot",d:0},{k:":class",f:7,d:1}],c:[]},{t:7,d:1,b:[{f:8,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"status-text",d:0},{k:"class",v:"badge__status-text",d:0}],c:[{t:1,d:1,f:9}]}]}]}]}]}]}]}],s:{tf:9,cf:9,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:s}=this;return this.getBadgeClasses()},function(t){const{$data:s}=this;return s.count>0&&!s.dot&&!s.status},function(t){const{$data:s}=this;return s.color?{backgroundColor:s.color}:{}},function(t){const{$data:s}=this;return`${s.count>s.overflowCount?s.overflowCount+"+":s.count}`},function(t){const{$data:s}=this;return s.dot&&!s.status},function(t){const{$data:s}=this;return s.status},function(t){const{$data:s}=this;return this.getStatusDotClasses()},function(t){const{$data:s}=this;return s.text},function(t){const{$data:s}=this;return`${s.text}`}],n:[{t:0,d:1,g:"span",a:[{k:"part",v:"base",d:0},{k:"class",v:"badge",d:0},{k:":class",f:1,d:1}],c:[{t:0,d:0,s:1,g:"slot",a:[],c:[]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 数字徽标 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:2,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"count",d:0},{k:"class",v:"badge__count",d:0},{k:":style",f:3,d:1}],c:[{t:1,d:1,f:4}]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 小红点 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:5,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"dot",d:0},{k:"class",v:"badge__dot",d:0},{k:":style",f:3,d:1}],c:[]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 状态点 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:6,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"status",d:0},{k:"class",v:"badge__status",d:0}],c:[{t:0,d:1,g:"span",a:[{k:"part",v:"status-dot",d:0},{k:"class",v:"badge__status-dot",d:0},{k:":class",f:7,d:1}],c:[]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:8,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"status-text",d:0},{k:"class",v:"badge__status-text",d:0}],c:[{t:1,d:1,f:9}]}]}]}]}]}]}]}],s:{tf:9,cf:9,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
@@ -1 +1 @@
1
- const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:s}=this;return this.getBadgeClasses()},function(t){const{$data:s}=this;return s.count>0&&!s.dot&&!s.status},function(t){const{$data:s}=this;return s.color?{backgroundColor:s.color}:{}},function(t){const{$data:s}=this;return`${s.count>s.overflowCount?s.overflowCount+"+":s.count}`},function(t){const{$data:s}=this;return s.dot&&!s.status},function(t){const{$data:s}=this;return s.status},function(t){const{$data:s}=this;return this.getStatusDotClasses()},function(t){const{$data:s}=this;return s.text},function(t){const{$data:s}=this;return`${s.text}`}],n:[{t:0,d:1,g:"span",a:[{k:"part",v:"base",d:0},{k:"class",v:"badge",d:0},{k:":class",f:1,d:1}],c:[{t:0,d:0,s:1,g:"slot",a:[],c:[]},{t:2,d:0,x:" 数字徽标 "},{t:7,d:1,b:[{f:2,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"count",d:0},{k:"class",v:"badge__count",d:0},{k:":style",f:3,d:1}],c:[{t:1,d:1,f:4}]}]}]},{t:2,d:0,x:" 小红点 "},{t:7,d:1,b:[{f:5,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"dot",d:0},{k:"class",v:"badge__dot",d:0},{k:":style",f:3,d:1}],c:[]}]}]},{t:2,d:0,x:" 状态点 "},{t:7,d:1,b:[{f:6,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"status",d:0},{k:"class",v:"badge__status",d:0}],c:[{t:0,d:1,g:"span",a:[{k:"part",v:"status-dot",d:0},{k:"class",v:"badge__status-dot",d:0},{k:":class",f:7,d:1}],c:[]},{t:7,d:1,b:[{f:8,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"status-text",d:0},{k:"class",v:"badge__status-text",d:0}],c:[{t:1,d:1,f:9}]}]}]}]}]}]}]}],s:{tf:9,cf:9,dn:1,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
1
+ const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:s}=this;return this.getBadgeClasses()},function(t){const{$data:s}=this;return s.count>0&&!s.dot&&!s.status},function(t){const{$data:s}=this;return s.color?{backgroundColor:s.color}:{}},function(t){const{$data:s}=this;return`${s.count>s.overflowCount?s.overflowCount+"+":s.count}`},function(t){const{$data:s}=this;return s.dot&&!s.status},function(t){const{$data:s}=this;return s.status},function(t){const{$data:s}=this;return this.getStatusDotClasses()},function(t){const{$data:s}=this;return s.text},function(t){const{$data:s}=this;return`${s.text}`}],n:[{t:0,d:1,g:"span",a:[{k:"part",v:"base",d:0},{k:"class",v:"badge",d:0},{k:":class",f:1,d:1}],c:[{t:0,d:0,s:1,g:"slot",a:[],c:[]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 数字徽标 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:2,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"count",d:0},{k:"class",v:"badge__count",d:0},{k:":style",f:3,d:1}],c:[{t:1,d:1,f:4}]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 小红点 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:5,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"dot",d:0},{k:"class",v:"badge__dot",d:0},{k:":style",f:3,d:1}],c:[]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 状态点 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:6,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"status",d:0},{k:"class",v:"badge__status",d:0}],c:[{t:0,d:1,g:"span",a:[{k:"part",v:"status-dot",d:0},{k:"class",v:"badge__status-dot",d:0},{k:":class",f:7,d:1}],c:[]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:8,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"status-text",d:0},{k:"class",v:"badge__status-text",d:0}],c:[{t:1,d:1,f:9}]}]}]}]}]}]}]}],s:{tf:9,cf:9,dn:1,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
@@ -1 +1 @@
1
- "use strict";var e=Object.defineProperty;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./style.css.cjs"),r=require("./index.html.cjs"),s=require("../../../runtime/component/base-element.cjs"),a=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyBreadcrumb=class extends s.default{constructor(){var t;super(...arguments),((t,r,s)=>{r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s})(this,"symbol"!=typeof(t="clickedItem")?t+"":t,null)}handleClick(e,t){e.href||(t.preventDefault(),this.clickedItem=e,this.dispatchEvent(new CustomEvent("click",{bubbles:!0,composed:!0,detail:{item:e}})))}get items(){return this.$data.items}set items(e){this.$data.items=e}},exports.SolelyBreadcrumb=((e,t)=>{for(var r,s=t,a=e.length-1;a>=0;a--)(r=e[a])&&(s=r(s)||s);return s})([a.CustomElement({tagName:"solely-breadcrumb",template:r.__SOLELY_IR__,styles:t.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"items",type:"array",default:[]},{name:"separator",type:"string",default:"/"}]})],exports.SolelyBreadcrumb);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),r=require("../../../runtime/component/base-element.cjs"),s=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyBreadcrumb=class extends r.default{clickedItem=null;handleClick(e,t){e.href||(t.preventDefault(),this.clickedItem=e,this.dispatchEvent(new CustomEvent("click",{bubbles:!0,composed:!0,detail:{item:e}})))}get items(){return this.$data.items}set items(e){this.$data.items=e}},exports.SolelyBreadcrumb=((e,t)=>{for(var r,s=t,l=e.length-1;l>=0;l--)(r=e[l])&&(s=r(s)||s);return s})([s.CustomElement({tagName:"solely-breadcrumb",template:t.__SOLELY_IR__,styles:e.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"items",type:"array",default:[]},{name:"separator",type:"string",default:"/"}]})],exports.SolelyBreadcrumb);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return a.items},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return r.href&&d<a.items.length-1},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return r.href},function(t,a){const{$data:r}=this,{value:d,checked:n}=(null==t?void 0:t.target)||{};var[e]=a.map(t=>t.itmVal),[i]=a.map(t=>t.idxVal);this.handleClick(e,t)},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return`${r.title}`},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return!r.href&&d<a.items.length-1},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return d===a.items.length-1},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return d<a.items.length-1},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return`${a.separator}`}],n:[{t:0,d:0,g:"nav",a:[{k:"part",v:"base",d:0},{k:"class",v:"breadcrumb",d:0}],c:[{t:6,d:1,f:1,i:"item",n:"index",a:[],c:[{t:0,d:0,g:"span",a:[{k:"part",v:"item",d:0},{k:"class",v:"breadcrumb__item",d:0}],c:[{t:7,d:1,b:[{f:2,c:[{t:0,d:1,g:"a",a:[{k:"part",v:"link",d:0},{k:"class",v:"breadcrumb__link",d:0},{k:":href",f:3,d:1},{k:"@click",f:4,d:1}],c:[{t:1,d:1,f:5}]}]}]},{t:7,d:1,b:[{f:6,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"link",d:0},{k:"class",v:"breadcrumb__link",d:0},{k:"@click",f:4,d:1}],c:[{t:1,d:1,f:5}]}]}]},{t:7,d:1,b:[{f:7,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"current",d:0},{k:"class",v:"breadcrumb__current",d:0}],c:[{t:1,d:1,f:5}]}]}]},{t:7,d:1,b:[{f:8,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"separator",d:0},{k:"class",v:"breadcrumb__separator",d:0}],c:[{t:1,d:1,f:9}]}]}]}]}]}]}],s:{tf:9,cf:9,dn:0,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return a.items},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return r.href&&d<a.items.length-1},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return r.href},function(t,a){const{$data:r}=this,{value:d,checked:n}=t?.target||{};var[e]=a.map(t=>t.itmVal),[s]=a.map(t=>t.idxVal);this.handleClick(e,t)},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return`${r.title}`},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return!r.href&&d<a.items.length-1},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return d===a.items.length-1},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return d<a.items.length-1},function(t){const{$data:a}=this;var[r]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return`${a.separator}`}],n:[{t:0,d:0,g:"nav",a:[{k:"part",v:"base",d:0},{k:"class",v:"breadcrumb",d:0}],c:[{t:6,d:1,f:1,i:"item",n:"index",a:[],c:[{t:0,d:0,g:"span",a:[{k:"part",v:"item",d:0},{k:"class",v:"breadcrumb__item",d:0}],c:[{t:7,d:1,b:[{f:2,c:[{t:0,d:1,g:"a",a:[{k:"part",v:"link",d:0},{k:"class",v:"breadcrumb__link",d:0},{k:":href",f:3,d:1},{k:"@click",f:4,d:1}],c:[{t:1,d:1,f:5}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:6,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"link",d:0},{k:"class",v:"breadcrumb__link",d:0},{k:"@click",f:4,d:1}],c:[{t:1,d:1,f:5}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:7,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"current",d:0},{k:"class",v:"breadcrumb__current",d:0}],c:[{t:1,d:1,f:5}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:8,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"separator",d:0},{k:"class",v:"breadcrumb__separator",d:0}],c:[{t:1,d:1,f:9}]}]}]}]}]}]}],s:{tf:9,cf:9,dn:0,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
@@ -1 +1 @@
1
- const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return a.items},function(t){const{$data:a}=this;var[n]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return n.href&&d<a.items.length-1},function(t){const{$data:a}=this;var[n]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return n.href},function(t,a){const{$data:n}=this,{value:d,checked:r}=(null==t?void 0:t.target)||{};var[i]=a.map(t=>t.itmVal),[c]=a.map(t=>t.idxVal);this.handleClick(i,t)},function(t){const{$data:a}=this;var[n]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return`${n.title}`},function(t){const{$data:a}=this;var[n]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return!n.href&&d<a.items.length-1},function(t){const{$data:a}=this;var[n]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return d===a.items.length-1},function(t){const{$data:a}=this;var[n]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return d<a.items.length-1},function(t){const{$data:a}=this;var[n]=t.map(t=>t.itmVal),[d]=t.map(t=>t.idxVal);return`${a.separator}`}],n:[{t:0,d:0,g:"nav",a:[{k:"part",v:"base",d:0},{k:"class",v:"breadcrumb",d:0}],c:[{t:6,d:1,f:1,i:"item",n:"index",a:[],c:[{t:0,d:0,g:"span",a:[{k:"part",v:"item",d:0},{k:"class",v:"breadcrumb__item",d:0}],c:[{t:7,d:1,b:[{f:2,c:[{t:0,d:1,g:"a",a:[{k:"part",v:"link",d:0},{k:"class",v:"breadcrumb__link",d:0},{k:":href",f:3,d:1},{k:"@click",f:4,d:1}],c:[{t:1,d:1,f:5}]}]}]},{t:7,d:1,b:[{f:6,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"link",d:0},{k:"class",v:"breadcrumb__link",d:0},{k:"@click",f:4,d:1}],c:[{t:1,d:1,f:5}]}]}]},{t:7,d:1,b:[{f:7,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"current",d:0},{k:"class",v:"breadcrumb__current",d:0}],c:[{t:1,d:1,f:5}]}]}]},{t:7,d:1,b:[{f:8,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"separator",d:0},{k:"class",v:"breadcrumb__separator",d:0}],c:[{t:1,d:1,f:9}]}]}]}]}]}]}],s:{tf:9,cf:9,dn:0,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
1
+ const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return a.items},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return d.href&&n<a.items.length-1},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return d.href},function(t,a){const{$data:d}=this,{value:n,checked:r}=t?.target||{};var[i]=a.map(t=>t.itmVal),[c]=a.map(t=>t.idxVal);this.handleClick(i,t)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return`${d.title}`},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return!d.href&&n<a.items.length-1},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return n===a.items.length-1},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return n<a.items.length-1},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return`${a.separator}`}],n:[{t:0,d:0,g:"nav",a:[{k:"part",v:"base",d:0},{k:"class",v:"breadcrumb",d:0}],c:[{t:6,d:1,f:1,i:"item",n:"index",a:[],c:[{t:0,d:0,g:"span",a:[{k:"part",v:"item",d:0},{k:"class",v:"breadcrumb__item",d:0}],c:[{t:7,d:1,b:[{f:2,c:[{t:0,d:1,g:"a",a:[{k:"part",v:"link",d:0},{k:"class",v:"breadcrumb__link",d:0},{k:":href",f:3,d:1},{k:"@click",f:4,d:1}],c:[{t:1,d:1,f:5}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:6,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"link",d:0},{k:"class",v:"breadcrumb__link",d:0},{k:"@click",f:4,d:1}],c:[{t:1,d:1,f:5}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:7,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"current",d:0},{k:"class",v:"breadcrumb__current",d:0}],c:[{t:1,d:1,f:5}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:8,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"separator",d:0},{k:"class",v:"breadcrumb__separator",d:0}],c:[{t:1,d:1,f:9}]}]}]}]}]}]}],s:{tf:9,cf:9,dn:0,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
@@ -1 +1 @@
1
- var e=Object.defineProperty;import t from"./style.css.js";import{__SOLELY_IR__ as r}from"./index.html.js";import s from"../../../runtime/component/base-element.js";import{CustomElement as o}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let m=class extends s{constructor(){var t;super(...arguments),((t,r,s)=>{r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s})(this,"symbol"!=typeof(t="clickedItem")?t+"":t,null)}handleClick(e,t){e.href||(t.preventDefault(),this.clickedItem=e,this.dispatchEvent(new CustomEvent("click",{bubbles:!0,composed:!0,detail:{item:e}})))}get items(){return this.$data.items}set items(e){this.$data.items=e}};m=((e,t)=>{for(var r,s=t,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(s)||s);return s})([o({tagName:"solely-breadcrumb",template:r,styles:t,shadowDOM:{use:!0,mode:"open"},props:[{name:"items",type:"array",default:[]},{name:"separator",type:"string",default:"/"}]})],m);export{m as SolelyBreadcrumb};
1
+ import e from"./style.css.js";import{__SOLELY_IR__ as t}from"./index.html.js";import s from"../../../runtime/component/base-element.js";import{CustomElement as r}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let m=class extends s{clickedItem=null;handleClick(e,t){e.href||(t.preventDefault(),this.clickedItem=e,this.dispatchEvent(new CustomEvent("click",{bubbles:!0,composed:!0,detail:{item:e}})))}get items(){return this.$data.items}set items(e){this.$data.items=e}};m=((e,t)=>{for(var s,r=t,m=e.length-1;m>=0;m--)(s=e[m])&&(r=s(r)||r);return r})([r({tagName:"solely-breadcrumb",template:t,styles:e,shadowDOM:{use:!0,mode:"open"},props:[{name:"items",type:"array",default:[]},{name:"separator",type:"string",default:"/"}]})],m);export{m as SolelyBreadcrumb};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./style.css.cjs"),e=require("./index.html.cjs"),a=require("../../../runtime/component/base-element.cjs"),n=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyButton=class extends a.default{mounted(){this.refresh()}getButtonClasses(){const t={};return this.$data.type&&"default"!==this.$data.type?t[`btn--${this.$data.type}`]=!0:t["btn--default"]=!0,"small"===this.$data.size?t["btn--sm"]=!0:"large"===this.$data.size&&(t["btn--lg"]=!0),this.$data.shape&&"default"!==this.$data.shape&&(t[`btn--shape-${this.$data.shape}`]=!0),t["is-disabled"]=!!this.$data.disabled,t["is-loading"]=!!this.$data.loading,t["btn--ghost"]=!!this.$data.ghost,t["btn--danger"]=!!this.$data.danger,t["btn--icon-only"]=!!this.$data.iconOnly,t["btn--block"]=!!this.$data.block,t}getTagName(){return this.$data.href?"a":"button"}getLinkAttrs(){const t={};return this.$data.href&&(t.href=this.$data.href,this.$data.target&&(t.target=this.$data.target)),t}hasLoadingIconSlot(){return null!==this.querySelector('[slot="loading-icon"]')}getLoadingIcon(){return this.$data.loadingIcon||""}handleClick(t){if(this.$data.loading||this.$data.disabled)return t.preventDefault(),void t.stopPropagation()}setLoading(t){this.$data.loading=t}setDisabled(t){this.$data.disabled=t}focus(){var t;null==(t=this.$refs.buttonRef)||t.focus()}blur(){var t;null==(t=this.$refs.buttonRef)||t.blur()}hasDefaultSlotContent(){return Array.from(this.childNodes).filter(t=>{var e;return t.nodeType===Node.ELEMENT_NODE?!t.hasAttribute("slot"):t.nodeType===Node.TEXT_NODE&&""!==(null==(e=t.textContent)?void 0:e.trim())}).length>0}hasIconSlot(){return null!==this.querySelector('[slot="icon"]')}hasIconRightSlot(){return null!==this.querySelector('[slot="icon-right"]')}},exports.SolelyButton=((t,e)=>{for(var a,n=e,s=t.length-1;s>=0;s--)(a=t[s])&&(n=a(n)||n);return n})([n.CustomElement({tagName:"solely-button",template:e.__SOLELY_IR__,styles:t.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"default"},{name:"size",type:"string",default:"medium"},{name:"shape",type:"string",default:""},{name:"disabled",type:"boolean",default:!1},{name:"loading",type:"boolean",default:!1},{name:"ghost",type:"boolean",default:!1},{name:"danger",type:"boolean",default:!1},{name:"block",type:"boolean",default:!1},{name:"iconOnly",type:"boolean",default:!1},{name:"content",type:"string",default:""},{name:"icon",type:"string",default:""},{name:"iconRight",type:"string",default:""},{name:"loadingIcon",type:"string",default:""},{name:"href",type:"string",default:""},{name:"target",type:"string",default:""}]})],exports.SolelyButton);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./style.css.cjs"),e=require("./index.html.cjs"),a=require("../../../runtime/component/base-element.cjs"),n=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyButton=class extends a.default{mounted(){this.refresh()}getButtonClasses(){const t={};return this.$data.type&&"default"!==this.$data.type?t[`btn--${this.$data.type}`]=!0:t["btn--default"]=!0,"small"===this.$data.size?t["btn--sm"]=!0:"large"===this.$data.size&&(t["btn--lg"]=!0),this.$data.shape&&"default"!==this.$data.shape&&(t[`btn--shape-${this.$data.shape}`]=!0),t["is-disabled"]=!!this.$data.disabled,t["is-loading"]=!!this.$data.loading,t["btn--ghost"]=!!this.$data.ghost,t["btn--danger"]=!!this.$data.danger,t["btn--icon-only"]=!!this.$data.iconOnly,t["btn--block"]=!!this.$data.block,t}getTagName(){return this.$data.href?"a":"button"}getLinkAttrs(){const t={};return this.$data.href&&(t.href=this.$data.href,this.$data.target&&(t.target=this.$data.target)),t}hasLoadingIconSlot(){return null!==this.querySelector('[slot="loading-icon"]')}getLoadingIcon(){return this.$data.loadingIcon||""}handleClick(t){if(this.$data.loading||this.$data.disabled)return t.preventDefault(),void t.stopPropagation()}setLoading(t){this.$data.loading=t}setDisabled(t){this.$data.disabled=t}focus(){this.$refs.buttonRef?.focus()}blur(){this.$refs.buttonRef?.blur()}hasDefaultSlotContent(){return Array.from(this.childNodes).filter(t=>t.nodeType===Node.ELEMENT_NODE?!t.hasAttribute("slot"):t.nodeType===Node.TEXT_NODE&&""!==t.textContent?.trim()).length>0}hasIconSlot(){return null!==this.querySelector('[slot="icon"]')}hasIconRightSlot(){return null!==this.querySelector('[slot="icon-right"]')}},exports.SolelyButton=((t,e)=>{for(var a,n=e,s=t.length-1;s>=0;s--)(a=t[s])&&(n=a(n)||n);return n})([n.CustomElement({tagName:"solely-button",template:e.__SOLELY_IR__,styles:t.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"default"},{name:"size",type:"string",default:"medium"},{name:"shape",type:"string",default:""},{name:"disabled",type:"boolean",default:!1},{name:"loading",type:"boolean",default:!1},{name:"ghost",type:"boolean",default:!1},{name:"danger",type:"boolean",default:!1},{name:"block",type:"boolean",default:!1},{name:"iconOnly",type:"boolean",default:!1},{name:"content",type:"string",default:""},{name:"icon",type:"string",default:""},{name:"iconRight",type:"string",default:""},{name:"loadingIcon",type:"string",default:""},{name:"href",type:"string",default:""},{name:"target",type:"string",default:""}]})],exports.SolelyButton);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:n}=this;return"a"===this.getTagName()},function(t){const{$data:n}=this;return this.getButtonClasses()},function(t){const{$data:n}=this;return n.href},function(t){const{$data:n}=this;return n.target},function(t){const{$data:n}=this;return n.disabled||n.loading?"true":"false"},function(t,n){const{$data:a}=this,{value:c,checked:d}=(null==t?void 0:t.target)||{};this.handleClick(t)},function(t){const{$data:n}=this;return n.loading},function(t){const{$data:n}=this;return this.hasLoadingIconSlot()},function(t){const{$data:n}=this;return n.loadingIcon},function(t){const{$data:n}=this;return`${n.loadingIcon}`},function(t){const{$data:n}=this;return this.hasIconSlot()},function(t){const{$data:n}=this;return n.icon},function(t){const{$data:n}=this;return`${n.icon}`},function(t){const{$data:n}=this;return!n.iconOnly&&(n.content||this.hasDefaultSlotContent())},function(t){const{$data:n}=this;return`${n.content}`},function(t){const{$data:n}=this;return!n.loading&&!n.iconOnly&&this.hasIconRightSlot()},function(t){const{$data:n}=this;return!n.loading&&!n.iconOnly&&n.iconRight},function(t){const{$data:n}=this;return`${n.iconRight}`},function(t){const{$data:n}=this;return"button"===this.getTagName()},function(t){const{$data:n}=this;return n.disabled||n.loading}],n:[{t:7,d:1,b:[{f:1,c:[{t:0,d:1,g:"a",a:[{k:"ref",v:"buttonRef",d:0},{k:"part",v:"base",d:0},{k:"class",v:"btn",d:0},{k:":class",f:2,d:1},{k:":href",f:3,d:1},{k:":target",f:4,d:1},{k:":aria-disabled",f:5,d:1},{k:"@click",f:6,d:1}],c:[{t:7,d:1,b:[{f:7,c:[{t:2,d:0,x:" 加载状态:显示加载图标 "},{t:0,d:0,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"btn__icon loading-spinner btn__loading-icon",d:0}],c:[{t:7,d:1,b:[{f:8,c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"loading-icon",d:0}],c:[]}]},{f:9,c:[{t:1,d:1,f:10}]}]}]}]},{f:11,c:[{t:2,d:0,x:" 非加载状态,有图标插槽:显示图标插槽内容 "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[]}]}]},{f:12,c:[{t:2,d:0,x:" 非加载状态,有图标属性:显示图标 "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:1,d:1,f:13}]}]}]},{t:7,d:1,b:[{f:14,c:[{t:2,d:0,x:" 按钮内容(非 icon-only 模式显示) "},{t:0,d:0,g:"span",a:[{k:"part",v:"content",d:0},{k:"class",v:"btn__content",d:0}],c:[{t:0,d:0,g:"slot",a:[],c:[{t:1,d:1,f:15}]}]}]}]},{t:7,d:1,b:[{f:16,c:[{t:2,d:0,x:" 右侧图标插槽(非加载状态且非 icon-only 模式显示) "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon-right",d:0}],c:[]}]}]},{f:17,c:[{t:2,d:0,x:" 右侧图标属性(非加载状态且非 icon-only 模式显示) "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:1,d:1,f:18}]}]}]}]}]},{f:19,c:[{t:0,d:1,g:"button",a:[{k:"ref",v:"buttonRef",d:0},{k:"part",v:"base",d:0},{k:"type",v:"button",d:0},{k:"class",v:"btn",d:0},{k:":class",f:2,d:1},{k:":disabled",f:20,d:1},{k:":aria-disabled",f:5,d:1},{k:"@click",f:6,d:1}],c:[{t:7,d:1,b:[{f:7,c:[{t:2,d:0,x:" 加载状态:显示加载图标 "},{t:0,d:0,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"btn__icon loading-spinner btn__loading-icon",d:0}],c:[{t:7,d:1,b:[{f:8,c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"loading-icon",d:0}],c:[]}]},{f:9,c:[{t:1,d:1,f:10}]}]}]}]},{f:11,c:[{t:2,d:0,x:" 非加载状态,有图标插槽:显示图标插槽内容 "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[]}]}]},{f:12,c:[{t:2,d:0,x:" 非加载状态,有图标属性:显示图标 "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:1,d:1,f:13}]}]}]},{t:7,d:1,b:[{f:14,c:[{t:2,d:0,x:" 按钮内容(非 icon-only 模式显示) "},{t:0,d:0,g:"span",a:[{k:"part",v:"content",d:0},{k:"class",v:"btn__content",d:0}],c:[{t:0,d:0,g:"slot",a:[],c:[{t:1,d:1,f:15}]}]}]}]},{t:7,d:1,b:[{f:16,c:[{t:2,d:0,x:" 右侧图标插槽(非加载状态且非 icon-only 模式显示) "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon-right",d:0}],c:[]}]}]},{f:17,c:[{t:2,d:0,x:" 右侧图标属性(非加载状态且非 icon-only 模式显示) "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:1,d:1,f:18}]}]}]}]}]}]}],s:{tf:20,cf:20,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:n}=this;return"a"===this.getTagName()},function(t){const{$data:n}=this;return this.getButtonClasses()},function(t){const{$data:n}=this;return n.href},function(t){const{$data:n}=this;return n.target},function(t){const{$data:n}=this;return n.disabled||n.loading?"true":"false"},function(t,n){const{$data:d}=this,{value:a,checked:c}=t?.target||{};this.handleClick(t)},function(t){const{$data:n}=this;return n.loading},function(t){const{$data:n}=this;return this.hasLoadingIconSlot()},function(t){const{$data:n}=this;return n.loadingIcon},function(t){const{$data:n}=this;return`${n.loadingIcon}`},function(t){const{$data:n}=this;return this.hasIconSlot()},function(t){const{$data:n}=this;return n.icon},function(t){const{$data:n}=this;return`${n.icon}`},function(t){const{$data:n}=this;return!n.iconOnly&&(n.content||this.hasDefaultSlotContent())},function(t){const{$data:n}=this;return`${n.content}`},function(t){const{$data:n}=this;return!n.loading&&!n.iconOnly&&this.hasIconRightSlot()},function(t){const{$data:n}=this;return!n.loading&&!n.iconOnly&&n.iconRight},function(t){const{$data:n}=this;return`${n.iconRight}`},function(t){const{$data:n}=this;return"button"===this.getTagName()},function(t){const{$data:n}=this;return n.disabled||n.loading}],n:[{t:7,d:1,b:[{f:1,c:[{t:0,d:1,g:"a",a:[{k:"ref",v:"buttonRef",d:0},{k:"part",v:"base",d:0},{k:"class",v:"btn",d:0},{k:":class",f:2,d:1},{k:":href",f:3,d:1},{k:":target",f:4,d:1},{k:":aria-disabled",f:5,d:1},{k:"@click",f:6,d:1}],c:[{t:7,d:1,b:[{f:7,c:[{t:2,d:0,x:" 加载状态:显示加载图标 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"btn__icon loading-spinner btn__loading-icon",d:0}],c:[{t:7,d:1,b:[{f:8,c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"loading-icon",d:0}],c:[]}]},{f:9,c:[{t:1,d:1,f:10}]}]}]}]},{f:11,c:[{t:2,d:0,x:" 非加载状态,有图标插槽:显示图标插槽内容 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[]}]}]},{f:12,c:[{t:2,d:0,x:" 非加载状态,有图标属性:显示图标 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:1,d:1,f:13}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:14,c:[{t:2,d:0,x:" 按钮内容(非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"content",d:0},{k:"class",v:"btn__content",d:0}],c:[{t:0,d:0,g:"slot",a:[],c:[{t:1,d:1,f:15}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:16,c:[{t:2,d:0,x:" 右侧图标插槽(非加载状态且非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon-right",d:0}],c:[]}]}]},{f:17,c:[{t:2,d:0,x:" 右侧图标属性(非加载状态且非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:1,d:1,f:18}]}]}]}]}]},{f:19,c:[{t:0,d:1,g:"button",a:[{k:"ref",v:"buttonRef",d:0},{k:"part",v:"base",d:0},{k:"type",v:"button",d:0},{k:"class",v:"btn",d:0},{k:":class",f:2,d:1},{k:":disabled",f:20,d:1},{k:":aria-disabled",f:5,d:1},{k:"@click",f:6,d:1}],c:[{t:7,d:1,b:[{f:7,c:[{t:2,d:0,x:" 加载状态:显示加载图标 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"btn__icon loading-spinner btn__loading-icon",d:0}],c:[{t:7,d:1,b:[{f:8,c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"loading-icon",d:0}],c:[]}]},{f:9,c:[{t:1,d:1,f:10}]}]}]}]},{f:11,c:[{t:2,d:0,x:" 非加载状态,有图标插槽:显示图标插槽内容 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[]}]}]},{f:12,c:[{t:2,d:0,x:" 非加载状态,有图标属性:显示图标 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:1,d:1,f:13}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:14,c:[{t:2,d:0,x:" 按钮内容(非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"content",d:0},{k:"class",v:"btn__content",d:0}],c:[{t:0,d:0,g:"slot",a:[],c:[{t:1,d:1,f:15}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:16,c:[{t:2,d:0,x:" 右侧图标插槽(非加载状态且非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon-right",d:0}],c:[]}]}]},{f:17,c:[{t:2,d:0,x:" 右侧图标属性(非加载状态且非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:1,d:1,f:18}]}]}]}]}]}]}],s:{tf:20,cf:20,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
@@ -1 +1 @@
1
- const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:n}=this;return"a"===this.getTagName()},function(t){const{$data:n}=this;return this.getButtonClasses()},function(t){const{$data:n}=this;return n.href},function(t){const{$data:n}=this;return n.target},function(t){const{$data:n}=this;return n.disabled||n.loading?"true":"false"},function(t,n){const{$data:a}=this,{value:c,checked:d}=(null==t?void 0:t.target)||{};this.handleClick(t)},function(t){const{$data:n}=this;return n.loading},function(t){const{$data:n}=this;return this.hasLoadingIconSlot()},function(t){const{$data:n}=this;return n.loadingIcon},function(t){const{$data:n}=this;return`${n.loadingIcon}`},function(t){const{$data:n}=this;return this.hasIconSlot()},function(t){const{$data:n}=this;return n.icon},function(t){const{$data:n}=this;return`${n.icon}`},function(t){const{$data:n}=this;return!n.iconOnly&&(n.content||this.hasDefaultSlotContent())},function(t){const{$data:n}=this;return`${n.content}`},function(t){const{$data:n}=this;return!n.loading&&!n.iconOnly&&this.hasIconRightSlot()},function(t){const{$data:n}=this;return!n.loading&&!n.iconOnly&&n.iconRight},function(t){const{$data:n}=this;return`${n.iconRight}`},function(t){const{$data:n}=this;return"button"===this.getTagName()},function(t){const{$data:n}=this;return n.disabled||n.loading}],n:[{t:7,d:1,b:[{f:1,c:[{t:0,d:1,g:"a",a:[{k:"ref",v:"buttonRef",d:0},{k:"part",v:"base",d:0},{k:"class",v:"btn",d:0},{k:":class",f:2,d:1},{k:":href",f:3,d:1},{k:":target",f:4,d:1},{k:":aria-disabled",f:5,d:1},{k:"@click",f:6,d:1}],c:[{t:7,d:1,b:[{f:7,c:[{t:2,d:0,x:" 加载状态:显示加载图标 "},{t:0,d:0,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"btn__icon loading-spinner btn__loading-icon",d:0}],c:[{t:7,d:1,b:[{f:8,c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"loading-icon",d:0}],c:[]}]},{f:9,c:[{t:1,d:1,f:10}]}]}]}]},{f:11,c:[{t:2,d:0,x:" 非加载状态,有图标插槽:显示图标插槽内容 "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[]}]}]},{f:12,c:[{t:2,d:0,x:" 非加载状态,有图标属性:显示图标 "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:1,d:1,f:13}]}]}]},{t:7,d:1,b:[{f:14,c:[{t:2,d:0,x:" 按钮内容(非 icon-only 模式显示) "},{t:0,d:0,g:"span",a:[{k:"part",v:"content",d:0},{k:"class",v:"btn__content",d:0}],c:[{t:0,d:0,g:"slot",a:[],c:[{t:1,d:1,f:15}]}]}]}]},{t:7,d:1,b:[{f:16,c:[{t:2,d:0,x:" 右侧图标插槽(非加载状态且非 icon-only 模式显示) "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon-right",d:0}],c:[]}]}]},{f:17,c:[{t:2,d:0,x:" 右侧图标属性(非加载状态且非 icon-only 模式显示) "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:1,d:1,f:18}]}]}]}]}]},{f:19,c:[{t:0,d:1,g:"button",a:[{k:"ref",v:"buttonRef",d:0},{k:"part",v:"base",d:0},{k:"type",v:"button",d:0},{k:"class",v:"btn",d:0},{k:":class",f:2,d:1},{k:":disabled",f:20,d:1},{k:":aria-disabled",f:5,d:1},{k:"@click",f:6,d:1}],c:[{t:7,d:1,b:[{f:7,c:[{t:2,d:0,x:" 加载状态:显示加载图标 "},{t:0,d:0,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"btn__icon loading-spinner btn__loading-icon",d:0}],c:[{t:7,d:1,b:[{f:8,c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"loading-icon",d:0}],c:[]}]},{f:9,c:[{t:1,d:1,f:10}]}]}]}]},{f:11,c:[{t:2,d:0,x:" 非加载状态,有图标插槽:显示图标插槽内容 "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[]}]}]},{f:12,c:[{t:2,d:0,x:" 非加载状态,有图标属性:显示图标 "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:1,d:1,f:13}]}]}]},{t:7,d:1,b:[{f:14,c:[{t:2,d:0,x:" 按钮内容(非 icon-only 模式显示) "},{t:0,d:0,g:"span",a:[{k:"part",v:"content",d:0},{k:"class",v:"btn__content",d:0}],c:[{t:0,d:0,g:"slot",a:[],c:[{t:1,d:1,f:15}]}]}]}]},{t:7,d:1,b:[{f:16,c:[{t:2,d:0,x:" 右侧图标插槽(非加载状态且非 icon-only 模式显示) "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon-right",d:0}],c:[]}]}]},{f:17,c:[{t:2,d:0,x:" 右侧图标属性(非加载状态且非 icon-only 模式显示) "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:1,d:1,f:18}]}]}]}]}]}]}],s:{tf:20,cf:20,dn:1,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
1
+ const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:n}=this;return"a"===this.getTagName()},function(t){const{$data:n}=this;return this.getButtonClasses()},function(t){const{$data:n}=this;return n.href},function(t){const{$data:n}=this;return n.target},function(t){const{$data:n}=this;return n.disabled||n.loading?"true":"false"},function(t,n){const{$data:d}=this,{value:a,checked:c}=t?.target||{};this.handleClick(t)},function(t){const{$data:n}=this;return n.loading},function(t){const{$data:n}=this;return this.hasLoadingIconSlot()},function(t){const{$data:n}=this;return n.loadingIcon},function(t){const{$data:n}=this;return`${n.loadingIcon}`},function(t){const{$data:n}=this;return this.hasIconSlot()},function(t){const{$data:n}=this;return n.icon},function(t){const{$data:n}=this;return`${n.icon}`},function(t){const{$data:n}=this;return!n.iconOnly&&(n.content||this.hasDefaultSlotContent())},function(t){const{$data:n}=this;return`${n.content}`},function(t){const{$data:n}=this;return!n.loading&&!n.iconOnly&&this.hasIconRightSlot()},function(t){const{$data:n}=this;return!n.loading&&!n.iconOnly&&n.iconRight},function(t){const{$data:n}=this;return`${n.iconRight}`},function(t){const{$data:n}=this;return"button"===this.getTagName()},function(t){const{$data:n}=this;return n.disabled||n.loading}],n:[{t:7,d:1,b:[{f:1,c:[{t:0,d:1,g:"a",a:[{k:"ref",v:"buttonRef",d:0},{k:"part",v:"base",d:0},{k:"class",v:"btn",d:0},{k:":class",f:2,d:1},{k:":href",f:3,d:1},{k:":target",f:4,d:1},{k:":aria-disabled",f:5,d:1},{k:"@click",f:6,d:1}],c:[{t:7,d:1,b:[{f:7,c:[{t:2,d:0,x:" 加载状态:显示加载图标 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"btn__icon loading-spinner btn__loading-icon",d:0}],c:[{t:7,d:1,b:[{f:8,c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"loading-icon",d:0}],c:[]}]},{f:9,c:[{t:1,d:1,f:10}]}]}]}]},{f:11,c:[{t:2,d:0,x:" 非加载状态,有图标插槽:显示图标插槽内容 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[]}]}]},{f:12,c:[{t:2,d:0,x:" 非加载状态,有图标属性:显示图标 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:1,d:1,f:13}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:14,c:[{t:2,d:0,x:" 按钮内容(非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"content",d:0},{k:"class",v:"btn__content",d:0}],c:[{t:0,d:0,g:"slot",a:[],c:[{t:1,d:1,f:15}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:16,c:[{t:2,d:0,x:" 右侧图标插槽(非加载状态且非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon-right",d:0}],c:[]}]}]},{f:17,c:[{t:2,d:0,x:" 右侧图标属性(非加载状态且非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:1,d:1,f:18}]}]}]}]}]},{f:19,c:[{t:0,d:1,g:"button",a:[{k:"ref",v:"buttonRef",d:0},{k:"part",v:"base",d:0},{k:"type",v:"button",d:0},{k:"class",v:"btn",d:0},{k:":class",f:2,d:1},{k:":disabled",f:20,d:1},{k:":aria-disabled",f:5,d:1},{k:"@click",f:6,d:1}],c:[{t:7,d:1,b:[{f:7,c:[{t:2,d:0,x:" 加载状态:显示加载图标 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"btn__icon loading-spinner btn__loading-icon",d:0}],c:[{t:7,d:1,b:[{f:8,c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"loading-icon",d:0}],c:[]}]},{f:9,c:[{t:1,d:1,f:10}]}]}]}]},{f:11,c:[{t:2,d:0,x:" 非加载状态,有图标插槽:显示图标插槽内容 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon",d:0}],c:[]}]}]},{f:12,c:[{t:2,d:0,x:" 非加载状态,有图标属性:显示图标 "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon",d:0},{k:"class",v:"btn__icon",d:0}],c:[{t:1,d:1,f:13}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:14,c:[{t:2,d:0,x:" 按钮内容(非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"content",d:0},{k:"class",v:"btn__content",d:0}],c:[{t:0,d:0,g:"slot",a:[],c:[{t:1,d:1,f:15}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:16,c:[{t:2,d:0,x:" 右侧图标插槽(非加载状态且非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"icon-right",d:0}],c:[]}]}]},{f:17,c:[{t:2,d:0,x:" 右侧图标属性(非加载状态且非 icon-only 模式显示) "},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"icon-right",d:0},{k:"class",v:"btn__icon-right",d:0}],c:[{t:1,d:1,f:18}]}]}]}]}]}]}],s:{tf:20,cf:20,dn:1,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};