solely 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/components/commands/message/index.cjs +1 -1
- package/dist/components/commands/message/index.js +1 -1
- package/dist/components/elements/checkbox/index.cjs +1 -1
- package/dist/components/elements/checkbox/index.js +1 -1
- package/dist/components/elements/icon/index.cjs +1 -0
- package/dist/components/elements/icon/index.d.ts +107 -0
- package/dist/components/elements/icon/index.html.cjs +1 -0
- package/dist/components/elements/icon/index.html.js +1 -0
- package/dist/components/elements/icon/index.js +1 -0
- package/dist/components/elements/icon/style.css.cjs +1 -0
- package/dist/components/elements/icon/style.css.js +1 -0
- package/dist/components/elements/icon/types.d.ts +24 -0
- package/dist/components/elements/index.cjs +1 -1
- package/dist/components/elements/index.d.ts +4 -0
- package/dist/components/elements/index.js +1 -1
- package/dist/components/elements/not-found/index.cjs +1 -0
- package/dist/components/elements/not-found/index.d.ts +10 -0
- package/dist/components/elements/not-found/index.html.cjs +1 -0
- package/dist/components/elements/not-found/index.html.js +1 -0
- package/dist/components/elements/not-found/index.js +1 -0
- package/dist/components/elements/not-found/style.css.cjs +1 -0
- package/dist/components/elements/not-found/style.css.js +1 -0
- package/dist/components/elements/not-found/types.d.ts +20 -0
- package/dist/components/elements/pagination/index.cjs +1 -1
- package/dist/components/elements/pagination/index.d.ts +1 -2
- package/dist/components/elements/pagination/index.html.cjs +1 -1
- package/dist/components/elements/pagination/index.html.js +1 -1
- package/dist/components/elements/pagination/index.js +1 -1
- package/dist/components/elements/select/option.d.ts +18 -0
- package/dist/components/elements/tree/index.cjs +1 -1
- package/dist/components/elements/tree/index.d.ts +10 -0
- package/dist/components/elements/tree/index.js +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/icons/LICENSE.txt +14 -0
- package/dist/icons/bootstrap-icons.svg +1 -0
- package/dist/router/router-view.cjs +1 -1
- package/dist/router/router-view.d.ts +3 -1
- package/dist/router/router-view.js +1 -1
- package/dist/router/types.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../utils.cjs"),t=require("./style.css.cjs"),n={duration:3e3,maxCount:5,gap:8,top:24,bottom:24,left:24,right:24,placement:"top"};let o,i=null;const s=new Set,a=[],r={info:"ℹ",success:"✓",warning:"⚠",error:"✕",loading:e.createElement("span",{className:"message__loading-spinner"})},c=new Map;function l(t,n){const o=e.createElement("span",{className:`message__icon message__icon--${n}`});return"string"==typeof t?o.textContent=t:o.appendChild(t.cloneNode(!0)),o}async function p(t){var n;if(!s.has(t)){s.add(t);try{const s=a.findIndex(e=>e.id===t);if(-1===s)return;const l=a[s];l.timer&&(clearTimeout(l.timer),l.timer=void 0),await e.addClosingAnimation(l.element,e.ANIMATION_DURATION.NORMAL),l.element.remove();const p=a.findIndex(e=>e.id===t);-1!==p&&a.splice(p,1);try{null==(n=l.onClose)||n.call(l)}catch(r){console.error("[Solely Message] onClose callback error:",r)}o&&clearTimeout(o),o=window.setTimeout(()=>{0===a.length&&(c.forEach((e,t)=>{0===e.childElementCount&&(e.remove(),c.delete(t))}),0===c.size&&i&&(i.disconnect(),i=null)),o=void 0},300)}finally{s.delete(t)}}}function d(o){const s=e.generateId(),d=o.placement||n.placement,m=function(o=n.placement){const s=o;if(c.has(s))return c.get(s);const a=e.createElement("div",{className:"message-container"}),r={position:"fixed",display:"flex",flexDirection:"column",gap:`${n.gap}px`,pointerEvents:"none",zIndex:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../utils.cjs"),t=require("./style.css.cjs"),n={duration:3e3,maxCount:5,gap:8,top:24,bottom:24,left:24,right:24,placement:"top"};let o,i=null;const s=new Set,a=[],r={info:"ℹ",success:"✓",warning:"⚠",error:"✕",loading:e.createElement("span",{className:"message__loading-spinner"})},c=new Map;function l(t,n){const o=e.createElement("span",{className:`message__icon message__icon--${n}`});return"string"==typeof t?o.textContent=t:o.appendChild(t.cloneNode(!0)),o}async function p(t){var n;if(!s.has(t)){s.add(t);try{const s=a.findIndex(e=>e.id===t);if(-1===s)return;const l=a[s];l.timer&&(clearTimeout(l.timer),l.timer=void 0),await e.addClosingAnimation(l.element,e.ANIMATION_DURATION.NORMAL),l.element.remove();const p=a.findIndex(e=>e.id===t);-1!==p&&a.splice(p,1);try{null==(n=l.onClose)||n.call(l)}catch(r){console.error("[Solely Message] onClose callback error:",r)}o&&clearTimeout(o),o=window.setTimeout(()=>{0===a.length&&(c.forEach((e,t)=>{0===e.childElementCount&&(e.remove(),c.delete(t))}),0===c.size&&i&&(i.disconnect(),i=null)),o=void 0},300)}finally{s.delete(t)}}}function d(o){const s=e.generateId(),d=o.placement||n.placement,m=function(o=n.placement){const s=o;if(c.has(s))return c.get(s);const a=e.createElement("div",{className:"message-container"}),r={position:"fixed",display:"flex",flexDirection:"column",gap:`${n.gap}px`,pointerEvents:"none",zIndex:String(e.Z_INDEX.TOAST)};switch(o){case"top":r.top=`${n.top}px`,r.left="50%",r.transform="translateX(-50%)";break;case"topLeft":r.top=`${n.top}px`,r.left=`${n.left}px`,r.alignItems="flex-start";break;case"topRight":r.top=`${n.top}px`,r.right=`${n.right}px`,r.alignItems="flex-end";break;case"bottom":r.bottom=`${n.bottom}px`,r.left="50%",r.transform="translateX(-50%)";break;case"bottomLeft":r.bottom=`${n.bottom}px`,r.left=`${n.left}px`,r.alignItems="flex-start";break;case"bottomRight":r.bottom=`${n.bottom}px`,r.right=`${n.right}px`,r.alignItems="flex-end";break;case"left":r.top="50%",r.left=`${n.left}px`,r.transform="translateY(-50%)",r.alignItems="flex-start";break;case"right":r.top="50%",r.right=`${n.right}px`,r.transform="translateY(-50%)",r.alignItems="flex-end"}Object.assign(a.style,r);const l=document.documentElement.getAttribute("data-theme");return l&&a.setAttribute("data-theme",l),document.body.appendChild(a),e.injectStyle("solely-message-styles",t.default),function(e){i&&i.disconnect(),i=new MutationObserver(()=>{const t=document.documentElement.getAttribute("data-theme");t?e.setAttribute("data-theme",t):e.removeAttribute("data-theme")}),i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}(a),c.set(s,a),a}(d),u=a.filter(e=>e.placement===d);if(u.length>=n.maxCount){const e=u[0];e&&p(e.id)}const f=function(t,n){const o=t.type||"info",i=!1!==t.showIcon,s=e.createElement("div",{className:`message message--${o}${t.className?` ${t.className}`:""}`,styles:t.style});if(s.setAttribute("role","error"===o||"warning"===o?"alert":"status"),s.setAttribute("aria-live","error"===o||"warning"===o?"assertive":"polite"),i){const e=t.icon?l(t.icon,o):l(r[o],o);s.appendChild(e)}const a=e.createElement("span",{className:"message__content"}),c=e.createElement("span",{className:"message__text"});if("string"==typeof t.content?c.textContent=t.content:t.content instanceof HTMLElement&&c.appendChild(t.content.cloneNode(!0)),a.appendChild(c),t.description){const n=e.createElement("span",{className:"message__description"});"string"==typeof t.description?n.textContent=t.description:t.description instanceof HTMLElement&&n.appendChild(t.description.cloneNode(!0)),a.appendChild(n)}if(s.appendChild(a),t.closable){const t=e.createElement("button",{className:"message__close",textContent:"×",attrs:{type:"button","aria-label":"关闭"}});t.onclick=()=>p(n),s.appendChild(t)}return s}(o,s);m.appendChild(f);const g={id:s,element:f,onClose:o.onClose,placement:d},b=o.duration??n.duration;return b>0&&(g.timer=window.setTimeout(()=>{p(s)},b)),a.push(g),{close:()=>p(s),update:t=>{if("string"==typeof t||t instanceof HTMLElement){const e=f.querySelector(".message__text");return void(e&&(e.innerHTML="","string"==typeof t?e.textContent=t:t instanceof HTMLElement&&e.appendChild(t.cloneNode(!0))))}if(void 0!==t.content){const e=f.querySelector(".message__text");e&&(e.innerHTML="","string"==typeof t.content?e.textContent=t.content:t.content instanceof HTMLElement&&e.appendChild(t.content.cloneNode(!0)))}if(void 0!==t.description){let n=f.querySelector(".message__description");if(!n&&t.description){n=e.createElement("span",{className:"message__description"}),"string"==typeof t.description?n.textContent=t.description:t.description instanceof HTMLElement&&n.appendChild(t.description.cloneNode(!0));const o=f.querySelector(".message__content");null==o||o.appendChild(n)}else n&&(t.description?(n.innerHTML="","string"==typeof t.description?n.textContent=t.description:t.description instanceof HTMLElement&&n.appendChild(t.description.cloneNode(!0))):n.remove())}}}}const m={open:d,info:function(e,t){return d({content:e,type:"info",..."number"==typeof t?{duration:t}:t})},success:function(e,t){return d({content:e,type:"success",..."number"==typeof t?{duration:t}:t})},warning:function(e,t){return d({content:e,type:"warning",..."number"==typeof t?{duration:t}:t})},error:function(e,t){return d({content:e,type:"error",..."number"==typeof t?{duration:t}:t})},loading:function(e,t){return d(void 0===t?{content:e,type:"loading",duration:0,closable:!0}:"number"==typeof t?{content:e,type:"loading",duration:t,closable:!0}:{content:e,type:"loading",duration:0,closable:!0,...t})},config:function(e){Object.assign(n,e),c.forEach((t,n)=>{void 0!==e.top&&["top","topLeft","topRight"].includes(n)&&(t.style.top=`${e.top}px`),void 0!==e.bottom&&["bottom","bottomLeft","bottomRight"].includes(n)&&(t.style.bottom=`${e.bottom}px`),void 0!==e.left&&["topLeft","bottomLeft","left"].includes(n)&&(t.style.left=`${e.left}px`),void 0!==e.right&&["topRight","bottomRight","right"].includes(n)&&(t.style.right=`${e.right}px`),void 0!==e.gap&&(t.style.gap=`${e.gap}px`)})},destroy:async function(){o&&(clearTimeout(o),o=void 0);const e=[...a];await Promise.all(e.map(e=>p(e.id)))}};exports.Message=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement as t,addClosingAnimation as e,ANIMATION_DURATION as n,
|
|
1
|
+
import{createElement as t,addClosingAnimation as e,ANIMATION_DURATION as n,Z_INDEX as o,generateId as i,injectStyle as s}from"../utils.js";import a from"./style.css.js";const r={duration:3e3,maxCount:5,gap:8,top:24,bottom:24,left:24,right:24,placement:"top"};let c,l=null;const p=new Set,d=[],m={info:"ℹ",success:"✓",warning:"⚠",error:"✕",loading:t("span",{className:"message__loading-spinner"})},f=new Map;function u(e,n){const o=t("span",{className:`message__icon message__icon--${n}`});return"string"==typeof e?o.textContent=e:o.appendChild(e.cloneNode(!0)),o}async function g(t){var o;if(!p.has(t)){p.add(t);try{const s=d.findIndex(e=>e.id===t);if(-1===s)return;const a=d[s];a.timer&&(clearTimeout(a.timer),a.timer=void 0),await e(a.element,n.NORMAL),a.element.remove();const r=d.findIndex(e=>e.id===t);-1!==r&&d.splice(r,1);try{null==(o=a.onClose)||o.call(a)}catch(i){console.error("[Solely Message] onClose callback error:",i)}c&&clearTimeout(c),c=window.setTimeout(()=>{0===d.length&&(f.forEach((t,e)=>{0===t.childElementCount&&(t.remove(),f.delete(e))}),0===f.size&&l&&(l.disconnect(),l=null)),c=void 0},300)}finally{p.delete(t)}}}function b(e){const n=i(),c=e.placement||r.placement,p=function(e=r.placement){const n=e;if(f.has(n))return f.get(n);const i=t("div",{className:"message-container"}),c={position:"fixed",display:"flex",flexDirection:"column",gap:`${r.gap}px`,pointerEvents:"none",zIndex:String(o.TOAST)};switch(e){case"top":c.top=`${r.top}px`,c.left="50%",c.transform="translateX(-50%)";break;case"topLeft":c.top=`${r.top}px`,c.left=`${r.left}px`,c.alignItems="flex-start";break;case"topRight":c.top=`${r.top}px`,c.right=`${r.right}px`,c.alignItems="flex-end";break;case"bottom":c.bottom=`${r.bottom}px`,c.left="50%",c.transform="translateX(-50%)";break;case"bottomLeft":c.bottom=`${r.bottom}px`,c.left=`${r.left}px`,c.alignItems="flex-start";break;case"bottomRight":c.bottom=`${r.bottom}px`,c.right=`${r.right}px`,c.alignItems="flex-end";break;case"left":c.top="50%",c.left=`${r.left}px`,c.transform="translateY(-50%)",c.alignItems="flex-start";break;case"right":c.top="50%",c.right=`${r.right}px`,c.transform="translateY(-50%)",c.alignItems="flex-end"}Object.assign(i.style,c);const p=document.documentElement.getAttribute("data-theme");return p&&i.setAttribute("data-theme",p),document.body.appendChild(i),s("solely-message-styles",a),function(t){l&&l.disconnect(),l=new MutationObserver(()=>{const e=document.documentElement.getAttribute("data-theme");e?t.setAttribute("data-theme",e):t.removeAttribute("data-theme")}),l.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}(i),f.set(n,i),i}(c),b=d.filter(t=>t.placement===c);if(b.length>=r.maxCount){const t=b[0];t&&g(t.id)}const h=function(e,n){const o=e.type||"info",i=!1!==e.showIcon,s=t("div",{className:`message message--${o}${e.className?` ${e.className}`:""}`,styles:e.style});if(s.setAttribute("role","error"===o||"warning"===o?"alert":"status"),s.setAttribute("aria-live","error"===o||"warning"===o?"assertive":"polite"),i){const t=e.icon?u(e.icon,o):u(m[o],o);s.appendChild(t)}const a=t("span",{className:"message__content"}),r=t("span",{className:"message__text"});if("string"==typeof e.content?r.textContent=e.content:e.content instanceof HTMLElement&&r.appendChild(e.content.cloneNode(!0)),a.appendChild(r),e.description){const n=t("span",{className:"message__description"});"string"==typeof e.description?n.textContent=e.description:e.description instanceof HTMLElement&&n.appendChild(e.description.cloneNode(!0)),a.appendChild(n)}if(s.appendChild(a),e.closable){const e=t("button",{className:"message__close",textContent:"×",attrs:{type:"button","aria-label":"关闭"}});e.onclick=()=>g(n),s.appendChild(e)}return s}(e,n);p.appendChild(h);const y={id:n,element:h,onClose:e.onClose,placement:c},x=e.duration??r.duration;return x>0&&(y.timer=window.setTimeout(()=>{g(n)},x)),d.push(y),{close:()=>g(n),update:e=>{if("string"==typeof e||e instanceof HTMLElement){const t=h.querySelector(".message__text");return void(t&&(t.innerHTML="","string"==typeof e?t.textContent=e:e instanceof HTMLElement&&t.appendChild(e.cloneNode(!0))))}if(void 0!==e.content){const t=h.querySelector(".message__text");t&&(t.innerHTML="","string"==typeof e.content?t.textContent=e.content:e.content instanceof HTMLElement&&t.appendChild(e.content.cloneNode(!0)))}if(void 0!==e.description){let n=h.querySelector(".message__description");if(!n&&e.description){n=t("span",{className:"message__description"}),"string"==typeof e.description?n.textContent=e.description:e.description instanceof HTMLElement&&n.appendChild(e.description.cloneNode(!0));const o=h.querySelector(".message__content");null==o||o.appendChild(n)}else n&&(e.description?(n.innerHTML="","string"==typeof e.description?n.textContent=e.description:e.description instanceof HTMLElement&&n.appendChild(e.description.cloneNode(!0))):n.remove())}}}}const h={open:b,info:function(t,e){return b({content:t,type:"info",..."number"==typeof e?{duration:e}:e})},success:function(t,e){return b({content:t,type:"success",..."number"==typeof e?{duration:e}:e})},warning:function(t,e){return b({content:t,type:"warning",..."number"==typeof e?{duration:e}:e})},error:function(t,e){return b({content:t,type:"error",..."number"==typeof e?{duration:e}:e})},loading:function(t,e){return b(void 0===e?{content:t,type:"loading",duration:0,closable:!0}:"number"==typeof e?{content:t,type:"loading",duration:e,closable:!0}:{content:t,type:"loading",duration:0,closable:!0,...e})},config:function(t){Object.assign(r,t),f.forEach((e,n)=>{void 0!==t.top&&["top","topLeft","topRight"].includes(n)&&(e.style.top=`${t.top}px`),void 0!==t.bottom&&["bottom","bottomLeft","bottomRight"].includes(n)&&(e.style.bottom=`${t.bottom}px`),void 0!==t.left&&["topLeft","bottomLeft","left"].includes(n)&&(e.style.left=`${t.left}px`),void 0!==t.right&&["topRight","bottomRight","right"].includes(n)&&(e.style.right=`${t.right}px`),void 0!==t.gap&&(e.style.gap=`${t.gap}px`)})},destroy:async function(){c&&(clearTimeout(c),c=void 0);const t=[...d];await Promise.all(t.map(t=>g(t.id)))}};export{h as Message};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),a=require("../../../runtime/component/base-element.cjs"),s=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyCheckbox=class extends a.default{getCheckboxClasses(){const e={},t=this.$data.size||"medium",a=this.$data.type||"primary";return"small"===t?e["checkbox--sm"]=!0:"large"===t?e["checkbox--lg"]=!0:e["checkbox--md"]=!0,e[`checkbox--${a}`]=!0,e["is-checked"]=!!this.$data.checked,e["is-indeterminate"]=!!this.$data.indeterminate,e["is-disabled"]=!!this.$data.disabled,e["checkbox--block"]=!!this.$data.block,e}handleClick(e){this.$data.disabled||
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),a=require("../../../runtime/component/base-element.cjs"),s=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyCheckbox=class extends a.default{getCheckboxClasses(){const e={},t=this.$data.size||"medium",a=this.$data.type||"primary";return"small"===t?e["checkbox--sm"]=!0:"large"===t?e["checkbox--lg"]=!0:e["checkbox--md"]=!0,e[`checkbox--${a}`]=!0,e["is-checked"]=!!this.$data.checked,e["is-indeterminate"]=!!this.$data.indeterminate,e["is-disabled"]=!!this.$data.disabled,e["checkbox--block"]=!!this.$data.block,e}handleClick(e){this.$data.disabled||this.toggle()}handleKeyDown(e){this.$data.disabled||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick(e))}toggle(){if(this.$data.disabled)return;const e=!this.$data.checked;this.$data.checked=e,this.$data.indeterminate&&(this.$data.indeterminate=!1),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}setChecked(e){this.$data.checked=e,this.$data.indeterminate=!1}getChecked(){return this.$data.checked}get checked(){return this.$data.checked}set checked(e){this.setChecked(e)}setIndeterminate(e){this.$data.indeterminate=e}focus(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".checkbox");t&&t.focus()}blur(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".checkbox");t&&t.blur()}mounted(){this.updateAriaAttributes()}updated(){this.updateAriaAttributes()}updateAriaAttributes(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".checkbox");t&&(t.setAttribute("aria-checked",this.$data.checked?"true":"false"),t.setAttribute("aria-disabled",this.$data.disabled?"true":"false"))}},exports.SolelyCheckbox=((e,t)=>{for(var a,s=t,d=e.length-1;d>=0;d--)(a=e[d])&&(s=a(s)||s);return s})([s.CustomElement({tagName:"solely-checkbox",template:t.default,styles:e.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"checked",type:"boolean",default:!1},{name:"indeterminate",type:"boolean",default:!1},{name:"disabled",type:"boolean",default:!1},{name:"content",type:"string",default:""},{name:"type",type:"string",default:"primary"},{name:"size",type:"string",default:"medium"},{name:"block",type:"boolean",default:!1},{name:"name",type:"string",default:""}],model:{prop:"checked",event:"change"}})],exports.SolelyCheckbox);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./style.css.js";import t from"./index.html.js";import a from"../../../runtime/component/base-element.js";import{CustomElement as
|
|
1
|
+
import e from"./style.css.js";import t from"./index.html.js";import a from"../../../runtime/component/base-element.js";import{CustomElement as d}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let s=class extends a{getCheckboxClasses(){const e={},t=this.$data.size||"medium",a=this.$data.type||"primary";return"small"===t?e["checkbox--sm"]=!0:"large"===t?e["checkbox--lg"]=!0:e["checkbox--md"]=!0,e[`checkbox--${a}`]=!0,e["is-checked"]=!!this.$data.checked,e["is-indeterminate"]=!!this.$data.indeterminate,e["is-disabled"]=!!this.$data.disabled,e["checkbox--block"]=!!this.$data.block,e}handleClick(e){this.$data.disabled||this.toggle()}handleKeyDown(e){this.$data.disabled||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick(e))}toggle(){if(this.$data.disabled)return;const e=!this.$data.checked;this.$data.checked=e,this.$data.indeterminate&&(this.$data.indeterminate=!1),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}setChecked(e){this.$data.checked=e,this.$data.indeterminate=!1}getChecked(){return this.$data.checked}get checked(){return this.$data.checked}set checked(e){this.setChecked(e)}setIndeterminate(e){this.$data.indeterminate=e}focus(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".checkbox");t&&t.focus()}blur(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".checkbox");t&&t.blur()}mounted(){this.updateAriaAttributes()}updated(){this.updateAriaAttributes()}updateAriaAttributes(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector(".checkbox");t&&(t.setAttribute("aria-checked",this.$data.checked?"true":"false"),t.setAttribute("aria-disabled",this.$data.disabled?"true":"false"))}};s=((e,t)=>{for(var a,d=t,s=e.length-1;s>=0;s--)(a=e[s])&&(d=a(d)||d);return d})([d({tagName:"solely-checkbox",template:t,styles:e,shadowDOM:{use:!0,mode:"open"},props:[{name:"checked",type:"boolean",default:!1},{name:"indeterminate",type:"boolean",default:!1},{name:"disabled",type:"boolean",default:!1},{name:"content",type:"string",default:""},{name:"type",type:"string",default:"primary"},{name:"size",type:"string",default:"medium"},{name:"block",type:"boolean",default:!1},{name:"name",type:"string",default:""}],model:{prop:"checked",event:"change"}})],s);export{s as SolelyCheckbox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./style.css.cjs"),e=require("./index.html.cjs"),s=require("../../../runtime/component/base-element.cjs"),n=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;const o=new Map,r=new Map;let i=null;async function a(t){return i||(r.size>0?Promise.resolve():(i=(async()=>{try{const e=await fetch(t),s=await e.text();(new DOMParser).parseFromString(s,"image/svg+xml").querySelectorAll("symbol").forEach(t=>{const e=t.id,s=t.getAttribute("viewBox")||"0 0 16 16",n=t.innerHTML;e&&n&&r.set(e,{viewBox:s,content:n})}),console.info(`[Solely Icon] Loaded ${r.size} icons from sprite`)}catch(e){console.warn("[Solely Icon] Failed to load icon sprite:",e)}})(),i))}function c(t){const e=o.get(t);if(e)return e;const s=r.get(t);return s?s.content:""}function l(t){const e=r.get(t);return e?e.viewBox:"0 0 16 16"}function u(t){return o.has(t)||r.has(t)}exports.SolelyIcon=class extends s.default{getIconContent(){return this.$data.name?c(this.$data.name)||this.getDefaultIcon():""}getViewBox(){return this.$data.name?l(this.$data.name):"0 0 16 16"}getDefaultIcon(){return'<rect x="2" y="2" width="12" height="12" rx="2" fill="none" stroke="currentColor" stroke-width="1.5"/><line x1="6" y1="8" x2="10" y2="8" stroke="currentColor" stroke-width="1.5"/><circle cx="8" cy="11.5" r="0.75" fill="currentColor"/>'}getIconSize(){const t=this.$data.size||"medium",e={small:"12px",medium:"16px",large:"24px"}[t];if(e)return e;const s=Number(t);return!isNaN(s)&&s>0?`${s}px`:String(t)}getSizeStyle(){return`--icon-size: ${this.getIconSize()};`}getSpinStyle(){const t=this.$data.spin;return t?`--spin-direction: ${"counterclockwise"===t?"reverse":"normal"}; --spin-duration: ${this.$data.spinDuration||1}s;`:""}getColorStyle(){const t=this.$data.color;return t?`--icon-color: ${t};`:""}getIconClasses(){const t={icon:!0,"is-spinning":!!this.$data.spin},e=this.$data.size;return"small"!==e&&"medium"!==e&&"large"!==e||(t[`icon--${e}`]=!0),t}hasIcon(){return!(!this.$data.name||!u(this.$data.name)&&!i&&!this.$data.sprite)}updateHostStyles(){this.style.setProperty("--icon-size",this.getIconSize());const t=this.$data.color;t?this.style.setProperty("--icon-color",t):this.style.removeProperty("--icon-color");const e=this.$data.spin;if(e){const t=this.$data.spinDuration||1,s="counterclockwise"===e?"reverse":"normal";this.style.setProperty("--spin-duration",`${t}s`),this.style.setProperty("--spin-direction",s)}else this.style.removeProperty("--spin-duration"),this.style.removeProperty("--spin-direction");this.classList.remove("icon--small","icon--medium","icon--large");const s=this.$data.size;"small"!==s&&"medium"!==s&&"large"!==s||this.classList.add(`icon--${s}`)}async mounted(){this.updateHostStyles();const t=this.$data.sprite;t?(await a(t),this.updateSvgContent()):i?(await i,this.updateSvgContent()):this.updateSvgContent()}updated(){this.updateHostStyles(),this.updateSvgContent()}updateSvgContent(){const t=this.$refs.svgRef;t&&this.hasIcon()&&(t.innerHTML=this.getIconContent())}handleClick(t){if(this.$data.disabled)return t.preventDefault(),void t.stopPropagation()}focus(){var t;null==(t=this.$refs.svgRef)||t.focus()}blur(){var t;null==(t=this.$refs.svgRef)||t.blur()}},exports.SolelyIcon=((t,e)=>{for(var s,n=e,o=t.length-1;o>=0;o--)(s=t[o])&&(n=s(n)||n);return n})([n.CustomElement({tagName:"solely-icon",template:e.default,styles:t.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"name",type:"string",default:""},{name:"size",type:"string",default:"medium"},{name:"color",type:"string",default:""},{name:"spin",type:"string",default:""},{name:"spinDuration",type:"number",default:1},{name:"disabled",type:"boolean",default:!1},{name:"sprite",type:"string",default:""}]})],exports.SolelyIcon),exports.getIcon=c,exports.getIconViewBox=l,exports.getRegisteredIcons=function(){return Array.from(new Set([...o.keys(),...r.keys()]))},exports.hasIcon=u,exports.loadIconSprite=a,exports.registerIcon=function(t,e){o.set(t,e)},exports.registerIcons=function(t){Object.entries(t).forEach(([t,e])=>{o.set(t,e)})};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { BaseElement } from '../../../runtime/component';
|
|
2
|
+
import { IconProps, IconRefs } from './types';
|
|
3
|
+
export declare function loadIconSprite(path: string): Promise<void>;
|
|
4
|
+
/**
|
|
5
|
+
* 设置图标 Sprite 文件路径(自动加载)
|
|
6
|
+
* @param path 相对于 public 目录的路径
|
|
7
|
+
*/
|
|
8
|
+
export declare function setIconSpritePath(path: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* 获取 sprite 加载状态
|
|
11
|
+
* @returns 是否正在加载
|
|
12
|
+
*/
|
|
13
|
+
export declare function isSpriteLoading(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 等待 sprite 加载完成
|
|
16
|
+
* @returns Promise
|
|
17
|
+
*/
|
|
18
|
+
export declare function waitForSpriteLoad(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* 注册图标到全局注册表
|
|
21
|
+
* @param name 图标名称
|
|
22
|
+
* @param svgContent SVG 内容(仅 path 部分或完整 SVG)
|
|
23
|
+
*/
|
|
24
|
+
export declare function registerIcon(name: string, svgContent: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* 批量注册图标
|
|
27
|
+
* @param icons 图标对象 { name: svgContent }
|
|
28
|
+
*/
|
|
29
|
+
export declare function registerIcons(icons: Record<string, string>): void;
|
|
30
|
+
export declare function getIcon(name: string): string;
|
|
31
|
+
export declare function getIconViewBox(name: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* 检查图标是否已注册
|
|
34
|
+
* @param name 图标名称
|
|
35
|
+
* @returns 是否已注册
|
|
36
|
+
*/
|
|
37
|
+
export declare function hasIcon(name: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 获取所有已注册的图标名称
|
|
40
|
+
* @returns 图标名称数组
|
|
41
|
+
*/
|
|
42
|
+
export declare function getRegisteredIcons(): string[];
|
|
43
|
+
declare class SolelyIcon extends BaseElement<IconProps, IconRefs> {
|
|
44
|
+
/**
|
|
45
|
+
* 获取图标 SVG 内容
|
|
46
|
+
*/
|
|
47
|
+
getIconContent(): string;
|
|
48
|
+
/**
|
|
49
|
+
* 获取图标的 viewBox
|
|
50
|
+
*/
|
|
51
|
+
getViewBox(): string;
|
|
52
|
+
private getDefaultIcon;
|
|
53
|
+
/**
|
|
54
|
+
* 获取图标尺寸
|
|
55
|
+
*/
|
|
56
|
+
getIconSize(): string;
|
|
57
|
+
/**
|
|
58
|
+
* 获取 CSS 尺寸变量
|
|
59
|
+
*/
|
|
60
|
+
getSizeStyle(): string;
|
|
61
|
+
/**
|
|
62
|
+
* 获取旋转样式
|
|
63
|
+
*/
|
|
64
|
+
getSpinStyle(): string;
|
|
65
|
+
/**
|
|
66
|
+
* 获取颜色样式
|
|
67
|
+
*/
|
|
68
|
+
getColorStyle(): string;
|
|
69
|
+
/**
|
|
70
|
+
* 获取图标类名
|
|
71
|
+
*/
|
|
72
|
+
getIconClasses(): Record<string, boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* 是否有有效图标(或正在加载中)
|
|
75
|
+
* 用于模板条件渲染,加载中时返回 true 以创建 SVG 元素
|
|
76
|
+
*/
|
|
77
|
+
hasIcon(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* 更新宿主元素的 CSS 变量(尺寸、颜色、旋转)
|
|
80
|
+
*/
|
|
81
|
+
private updateHostStyles;
|
|
82
|
+
/**
|
|
83
|
+
* 组件挂载后更新 SVG 内容
|
|
84
|
+
*/
|
|
85
|
+
mounted(): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* 数据变化时更新 SVG 内容
|
|
88
|
+
*/
|
|
89
|
+
updated(): void;
|
|
90
|
+
/**
|
|
91
|
+
* 更新 SVG 元素的内容
|
|
92
|
+
*/
|
|
93
|
+
private updateSvgContent;
|
|
94
|
+
/**
|
|
95
|
+
* 处理点击事件
|
|
96
|
+
*/
|
|
97
|
+
handleClick(event: MouseEvent): void;
|
|
98
|
+
/**
|
|
99
|
+
* 聚焦图标(如果可交互)
|
|
100
|
+
*/
|
|
101
|
+
focus(): void;
|
|
102
|
+
/**
|
|
103
|
+
* 失焦图标
|
|
104
|
+
*/
|
|
105
|
+
blur(): void;
|
|
106
|
+
}
|
|
107
|
+
export { SolelyIcon };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<If test="this.hasIcon()">\n <svg\n ref="svgRef"\n class="icon-svg"\n :class="this.getIconClasses()"\n :viewBox="this.getViewBox()"\n fill="currentColor"\n @click="this.handleClick(event)"\n role="img"\n :aria-label="$data.name"\n ></svg>\n</If>\n<Else>\n <span class="icon-placeholder"></span>\n</Else>\n';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n='<If test="this.hasIcon()">\n <svg\n ref="svgRef"\n class="icon-svg"\n :class="this.getIconClasses()"\n :viewBox="this.getViewBox()"\n fill="currentColor"\n @click="this.handleClick(event)"\n role="img"\n :aria-label="$data.name"\n ></svg>\n</If>\n<Else>\n <span class="icon-placeholder"></span>\n</Else>\n';export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./style.css.js";import e from"./index.html.js";import n from"../../../runtime/component/base-element.js";import{CustomElement as s}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;const i=new Map,o=new Map;let r=null;async function a(t){return r||(o.size>0?Promise.resolve():(r=(async()=>{try{const e=await fetch(t),n=await e.text();(new DOMParser).parseFromString(n,"image/svg+xml").querySelectorAll("symbol").forEach(t=>{const e=t.id,n=t.getAttribute("viewBox")||"0 0 16 16",s=t.innerHTML;e&&s&&o.set(e,{viewBox:n,content:s})}),console.info(`[Solely Icon] Loaded ${o.size} icons from sprite`)}catch(e){console.warn("[Solely Icon] Failed to load icon sprite:",e)}})(),r))}function c(t,e){i.set(t,e)}function l(t){Object.entries(t).forEach(([t,e])=>{i.set(t,e)})}function u(t){const e=i.get(t);if(e)return e;const n=o.get(t);return n?n.content:""}function d(t){const e=o.get(t);return e?e.viewBox:"0 0 16 16"}function p(t){return i.has(t)||o.has(t)}function m(){return Array.from(new Set([...i.keys(),...o.keys()]))}let h=class extends n{getIconContent(){return this.$data.name?u(this.$data.name)||this.getDefaultIcon():""}getViewBox(){return this.$data.name?d(this.$data.name):"0 0 16 16"}getDefaultIcon(){return'<rect x="2" y="2" width="12" height="12" rx="2" fill="none" stroke="currentColor" stroke-width="1.5"/><line x1="6" y1="8" x2="10" y2="8" stroke="currentColor" stroke-width="1.5"/><circle cx="8" cy="11.5" r="0.75" fill="currentColor"/>'}getIconSize(){const t=this.$data.size||"medium",e={small:"12px",medium:"16px",large:"24px"}[t];if(e)return e;const n=Number(t);return!isNaN(n)&&n>0?`${n}px`:String(t)}getSizeStyle(){return`--icon-size: ${this.getIconSize()};`}getSpinStyle(){const t=this.$data.spin;return t?`--spin-direction: ${"counterclockwise"===t?"reverse":"normal"}; --spin-duration: ${this.$data.spinDuration||1}s;`:""}getColorStyle(){const t=this.$data.color;return t?`--icon-color: ${t};`:""}getIconClasses(){const t={icon:!0,"is-spinning":!!this.$data.spin},e=this.$data.size;return"small"!==e&&"medium"!==e&&"large"!==e||(t[`icon--${e}`]=!0),t}hasIcon(){return!(!this.$data.name||!p(this.$data.name)&&!r&&!this.$data.sprite)}updateHostStyles(){this.style.setProperty("--icon-size",this.getIconSize());const t=this.$data.color;t?this.style.setProperty("--icon-color",t):this.style.removeProperty("--icon-color");const e=this.$data.spin;if(e){const t=this.$data.spinDuration||1,n="counterclockwise"===e?"reverse":"normal";this.style.setProperty("--spin-duration",`${t}s`),this.style.setProperty("--spin-direction",n)}else this.style.removeProperty("--spin-duration"),this.style.removeProperty("--spin-direction");this.classList.remove("icon--small","icon--medium","icon--large");const n=this.$data.size;"small"!==n&&"medium"!==n&&"large"!==n||this.classList.add(`icon--${n}`)}async mounted(){this.updateHostStyles();const t=this.$data.sprite;t?(await a(t),this.updateSvgContent()):r?(await r,this.updateSvgContent()):this.updateSvgContent()}updated(){this.updateHostStyles(),this.updateSvgContent()}updateSvgContent(){const t=this.$refs.svgRef;t&&this.hasIcon()&&(t.innerHTML=this.getIconContent())}handleClick(t){if(this.$data.disabled)return t.preventDefault(),void t.stopPropagation()}focus(){var t;null==(t=this.$refs.svgRef)||t.focus()}blur(){var t;null==(t=this.$refs.svgRef)||t.blur()}};h=((t,e)=>{for(var n,s=e,i=t.length-1;i>=0;i--)(n=t[i])&&(s=n(s)||s);return s})([s({tagName:"solely-icon",template:e,styles:t,shadowDOM:{use:!0,mode:"open"},props:[{name:"name",type:"string",default:""},{name:"size",type:"string",default:"medium"},{name:"color",type:"string",default:""},{name:"spin",type:"string",default:""},{name:"spinDuration",type:"number",default:1},{name:"disabled",type:"boolean",default:!1},{name:"sprite",type:"string",default:""}]})],h);export{h as SolelyIcon,u as getIcon,d as getIconViewBox,m as getRegisteredIcons,p as hasIcon,a as loadIconSprite,c as registerIcon,l as registerIcons};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default=":host{display:inline-flex;align-items:center;justify-content:center;width:var(--icon-size, 16px);height:var(--icon-size, 16px);color:var(--icon-color, currentColor);font-size:var(--icon-size, 16px);line-height:1;vertical-align:middle}:host([hidden]){display:none!important}.icon-svg{width:100%;height:100%;fill:currentColor;transition:transform var(--solely-transition-duration, .2s) var(--solely-transition-timing, ease)}:host(.icon--small){--icon-size: 12px}:host(.icon--medium){--icon-size: 16px}:host(.icon--large){--icon-size: 24px}.is-spinning{animation:icon-spin var(--spin-duration, 1s) linear infinite;animation-direction:var(--spin-direction, normal)}@keyframes icon-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:host([disabled]){cursor:not-allowed;opacity:var(--solely-disabled-opacity, .6)}.icon-placeholder{display:inline-block;width:100%;height:100%}.icon-svg:not([disabled]){cursor:pointer}.icon-svg:not([disabled]):hover{opacity:.8}";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i=":host{display:inline-flex;align-items:center;justify-content:center;width:var(--icon-size, 16px);height:var(--icon-size, 16px);color:var(--icon-color, currentColor);font-size:var(--icon-size, 16px);line-height:1;vertical-align:middle}:host([hidden]){display:none!important}.icon-svg{width:100%;height:100%;fill:currentColor;transition:transform var(--solely-transition-duration, .2s) var(--solely-transition-timing, ease)}:host(.icon--small){--icon-size: 12px}:host(.icon--medium){--icon-size: 16px}:host(.icon--large){--icon-size: 24px}.is-spinning{animation:icon-spin var(--spin-duration, 1s) linear infinite;animation-direction:var(--spin-direction, normal)}@keyframes icon-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:host([disabled]){cursor:not-allowed;opacity:var(--solely-disabled-opacity, .6)}.icon-placeholder{display:inline-block;width:100%;height:100%}.icon-svg:not([disabled]){cursor:pointer}.icon-svg:not([disabled]):hover{opacity:.8}";export{i as default};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solely Icon 组件类型定义
|
|
3
|
+
*/
|
|
4
|
+
export type IconSize = 'small' | 'medium' | 'large' | number;
|
|
5
|
+
export type IconSpin = 'clockwise' | 'counterclockwise' | false;
|
|
6
|
+
export interface IconProps {
|
|
7
|
+
/** 图标名称 */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** 图标尺寸 */
|
|
10
|
+
size?: IconSize;
|
|
11
|
+
/** 图标颜色,支持 CSS 变量或具体颜色值 */
|
|
12
|
+
color?: string;
|
|
13
|
+
/** 是否旋转 */
|
|
14
|
+
spin?: IconSpin;
|
|
15
|
+
/** 旋转速度(秒/圈) */
|
|
16
|
+
spinDuration?: number;
|
|
17
|
+
/** 是否禁用 */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** SVG Sprite 文件路径 */
|
|
20
|
+
sprite?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IconRefs extends Record<string, Element> {
|
|
23
|
+
svgRef: SVGSVGElement;
|
|
24
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./button/index.cjs"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./button/index.cjs"),r=require("./icon/index.cjs"),t=require("./input/index.cjs"),o=require("./fab/index.cjs"),l=require("./card/index.cjs"),n=require("./tag/index.cjs"),i=require("./badge/index.cjs"),s=require("./alert/index.cjs"),c=require("./switch/index.cjs"),y=require("./checkbox/index.cjs"),d=require("./radio/index.cjs"),p=require("./select/index.cjs"),b=require("./progress/index.cjs"),u=require("./divider/index.cjs"),a=require("./tabs/index.cjs"),S=require("./table/index.cjs"),x=require("./skeleton/index.cjs"),j=require("./empty/index.cjs"),g=require("./pagination/index.cjs"),m=require("./breadcrumb/index.cjs"),P=require("./steps/index.cjs"),f=require("./timeline/index.cjs"),O=require("./backtop/index.cjs"),q=require("./upload/index.cjs"),I=require("./rate/index.cjs"),T=require("./slider/index.cjs"),k=require("./tree/index.cjs"),h=require("./coordinate-input/index.cjs"),B=require("./not-found/index.cjs");Object.defineProperty(exports,"SolelyButton",{enumerable:!0,get:()=>e.SolelyButton}),Object.defineProperty(exports,"SolelyIcon",{enumerable:!0,get:()=>r.SolelyIcon}),exports.getIcon=r.getIcon,exports.getRegisteredIcons=r.getRegisteredIcons,exports.hasIcon=r.hasIcon,exports.registerIcon=r.registerIcon,exports.registerIcons=r.registerIcons,Object.defineProperty(exports,"SolelyInput",{enumerable:!0,get:()=>t.SolelyInput}),Object.defineProperty(exports,"SolelyFab",{enumerable:!0,get:()=>o.SolelyFab}),Object.defineProperty(exports,"SolelyCard",{enumerable:!0,get:()=>l.SolelyCard}),Object.defineProperty(exports,"SolelyTag",{enumerable:!0,get:()=>n.SolelyTag}),Object.defineProperty(exports,"SolelyBadge",{enumerable:!0,get:()=>i.SolelyBadge}),Object.defineProperty(exports,"SolelyAlert",{enumerable:!0,get:()=>s.SolelyAlert}),Object.defineProperty(exports,"SolelySwitch",{enumerable:!0,get:()=>c.SolelySwitch}),Object.defineProperty(exports,"SolelyCheckbox",{enumerable:!0,get:()=>y.SolelyCheckbox}),Object.defineProperty(exports,"SolelyRadio",{enumerable:!0,get:()=>d.SolelyRadio}),Object.defineProperty(exports,"SolelySelect",{enumerable:!0,get:()=>p.SolelySelect}),Object.defineProperty(exports,"SolelyProgress",{enumerable:!0,get:()=>b.SolelyProgress}),Object.defineProperty(exports,"SolelyDivider",{enumerable:!0,get:()=>u.SolelyDivider}),Object.defineProperty(exports,"SolelyTabs",{enumerable:!0,get:()=>a.SolelyTabs}),Object.defineProperty(exports,"SolelyTable",{enumerable:!0,get:()=>S.SolelyTable}),Object.defineProperty(exports,"SolelySkeleton",{enumerable:!0,get:()=>x.SolelySkeleton}),Object.defineProperty(exports,"SolelyEmpty",{enumerable:!0,get:()=>j.SolelyEmpty}),Object.defineProperty(exports,"SolelyPagination",{enumerable:!0,get:()=>g.SolelyPagination}),Object.defineProperty(exports,"SolelyBreadcrumb",{enumerable:!0,get:()=>m.SolelyBreadcrumb}),Object.defineProperty(exports,"SolelySteps",{enumerable:!0,get:()=>P.SolelySteps}),Object.defineProperty(exports,"SolelyTimeline",{enumerable:!0,get:()=>f.SolelyTimeline}),Object.defineProperty(exports,"SolelyBackTop",{enumerable:!0,get:()=>O.SolelyBackTop}),Object.defineProperty(exports,"SolelyUpload",{enumerable:!0,get:()=>q.SolelyUpload}),Object.defineProperty(exports,"SolelyRate",{enumerable:!0,get:()=>I.SolelyRate}),Object.defineProperty(exports,"SolelySlider",{enumerable:!0,get:()=>T.SolelySlider}),Object.defineProperty(exports,"SolelyTree",{enumerable:!0,get:()=>k.SolelyTree}),Object.defineProperty(exports,"SolelyCoordinateInput",{enumerable:!0,get:()=>h.SolelyCoordinateInput}),Object.defineProperty(exports,"SolelyNotFound",{enumerable:!0,get:()=>B.SolelyNotFound});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Solely 组件库 - 自定义元素组件统一导出
|
|
3
3
|
*/
|
|
4
4
|
export { SolelyButton } from './button';
|
|
5
|
+
export { SolelyIcon, registerIcon, registerIcons, getIcon, hasIcon, getRegisteredIcons } from './icon';
|
|
5
6
|
export { SolelyInput } from './input';
|
|
6
7
|
export { SolelyFab } from './fab';
|
|
7
8
|
export { SolelyCard } from './card';
|
|
@@ -28,7 +29,9 @@ export { SolelyRate } from './rate';
|
|
|
28
29
|
export { SolelySlider } from './slider';
|
|
29
30
|
export { SolelyTree } from './tree';
|
|
30
31
|
export { SolelyCoordinateInput } from './coordinate-input';
|
|
32
|
+
export { SolelyNotFound } from './not-found';
|
|
31
33
|
export type { ButtonProps, ButtonType, ButtonSize, ButtonShape } from './button/types';
|
|
34
|
+
export type { IconProps, IconSize, IconSpin, IconRefs } from './icon/types';
|
|
32
35
|
export type { InputProps, InputType, InputSize } from './input/types';
|
|
33
36
|
export type { FabProps, FabPosition, FabSize, FabShape } from './fab/types';
|
|
34
37
|
export type { CardProps, CardSize } from './card/types';
|
|
@@ -55,3 +58,4 @@ export type { RateProps } from './rate/types';
|
|
|
55
58
|
export type { SliderProps } from './slider/types';
|
|
56
59
|
export type { TreeProps, TreeNode } from './tree/types';
|
|
57
60
|
export type { CoordinateInputProps, CoordinateType, DMS, Coordinate, DMSCoordinate } from './coordinate-input/types';
|
|
61
|
+
export type { NotFoundProps } from './not-found/types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SolelyButton as
|
|
1
|
+
import{SolelyButton as o}from"./button/index.js";import{SolelyIcon as i,getIcon as r,getRegisteredIcons as m,hasIcon as e,registerIcon as t,registerIcons as n}from"./icon/index.js";import{SolelyInput as d}from"./input/index.js";import{SolelyFab as p}from"./fab/index.js";import{SolelyCard as s}from"./card/index.js";import{SolelyTag as f}from"./tag/index.js";import{SolelyBadge as x}from"./badge/index.js";import{SolelyAlert as j}from"./alert/index.js";import{SolelySwitch as a}from"./switch/index.js";import{SolelyCheckbox as b}from"./checkbox/index.js";import{SolelyRadio as c}from"./radio/index.js";import{SolelySelect as l}from"./select/index.js";import{SolelyProgress as u}from"./progress/index.js";import{SolelyDivider as g}from"./divider/index.js";import{SolelyTabs as k}from"./tabs/index.js";import{SolelyTable as h}from"./table/index.js";import{SolelySkeleton as v}from"./skeleton/index.js";import{SolelyEmpty as w}from"./empty/index.js";import{SolelyPagination as y}from"./pagination/index.js";import{SolelyBreadcrumb as q}from"./breadcrumb/index.js";import{SolelySteps as z}from"./steps/index.js";import{SolelyTimeline as A}from"./timeline/index.js";import{SolelyBackTop as B}from"./backtop/index.js";import{SolelyUpload as C}from"./upload/index.js";import{SolelyRate as D}from"./rate/index.js";import{SolelySlider as E}from"./slider/index.js";import{SolelyTree as F}from"./tree/index.js";import{SolelyCoordinateInput as G}from"./coordinate-input/index.js";import{SolelyNotFound as H}from"./not-found/index.js";export{j as SolelyAlert,B as SolelyBackTop,x as SolelyBadge,q as SolelyBreadcrumb,o as SolelyButton,s as SolelyCard,b as SolelyCheckbox,G as SolelyCoordinateInput,g as SolelyDivider,w as SolelyEmpty,p as SolelyFab,i as SolelyIcon,d as SolelyInput,H as SolelyNotFound,y as SolelyPagination,u as SolelyProgress,c as SolelyRadio,D as SolelyRate,l as SolelySelect,v as SolelySkeleton,E as SolelySlider,z as SolelySteps,a as SolelySwitch,h as SolelyTable,k as SolelyTabs,f as SolelyTag,A as SolelyTimeline,F as SolelyTree,C as SolelyUpload,r as getIcon,m as getRegisteredIcons,e as hasIcon,t as registerIcon,n as registerIcons};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),o=require("../../../runtime/component/base-element.cjs"),n=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyNotFound=class extends o.default{handleBack(){const e=this.$data.backUrl||"/";if("undefined"!=typeof window){const t=window.__SOLELY_ROUTER__;t?t.push(e):window.location.href=e}}},exports.SolelyNotFound=((e,t)=>{for(var o,n=t,r=e.length-1;r>=0;r--)(o=e[r])&&(n=o(n)||n);return n})([n.CustomElement({tagName:"solely-not-found",template:t.default,styles:e.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"title",type:"string",default:"404"},{name:"subtitle",type:"string",default:"抱歉,您访问的页面不存在"},{name:"description",type:"string",default:"请检查网址是否正确,或点击下方按钮返回首页"},{name:"backText",type:"string",default:"返回首页"},{name:"backUrl",type:"string",default:"/"},{name:"embedded",type:"boolean",default:!1}]})],exports.SolelyNotFound);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseElement } from '../../../runtime/component';
|
|
2
|
+
import { NotFoundProps } from './types';
|
|
3
|
+
declare class SolelyNotFound extends BaseElement<NotFoundProps> {
|
|
4
|
+
/**
|
|
5
|
+
* 处理返回按钮点击
|
|
6
|
+
*/
|
|
7
|
+
handleBack(): void;
|
|
8
|
+
}
|
|
9
|
+
export default SolelyNotFound;
|
|
10
|
+
export { SolelyNotFound };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<div class="not-found" :class="{ \'not-found--embedded\': $data.embedbed }">\n <div class="not-found__container">\n \x3c!-- 404 数字动画 --\x3e\n <div class="not-found__numbers">\n <span class="not-found__number">4</span>\n <div class="not-found__icon-wrapper">\n <svg class="not-found__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <circle cx="12" cy="12" r="10"></circle>\n <line x1="12" y1="8" x2="12" y2="12"></line>\n <line x1="12" y1="16" x2="12.01" y2="16"></line>\n </svg>\n </div>\n <span class="not-found__number">4</span>\n </div>\n\n \x3c!-- 文字内容 --\x3e\n <h1 class="not-found__title">{{ $data.title }}</h1>\n <h2 class="not-found__subtitle">{{ $data.subtitle }}</h2>\n <p class="not-found__description">{{ $data.description }}</p>\n\n \x3c!-- 返回按钮 --\x3e\n <button class="not-found__button" @click="this.handleBack()">\n <svg class="not-found__button-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <line x1="19" y1="12" x2="5" y2="12"></line>\n <polyline points="12 19 5 12 12 5"></polyline>\n </svg>\n {{ $data.backText }}\n </button>\n </div>\n\n \x3c!-- 装饰性背景元素 --\x3e\n <div class="not-found__bg-decoration not-found__bg-decoration--1"></div>\n <div class="not-found__bg-decoration not-found__bg-decoration--2"></div>\n <div class="not-found__bg-decoration not-found__bg-decoration--3"></div>\n</div>\n';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n='<div class="not-found" :class="{ \'not-found--embedded\': $data.embedbed }">\n <div class="not-found__container">\n \x3c!-- 404 数字动画 --\x3e\n <div class="not-found__numbers">\n <span class="not-found__number">4</span>\n <div class="not-found__icon-wrapper">\n <svg class="not-found__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <circle cx="12" cy="12" r="10"></circle>\n <line x1="12" y1="8" x2="12" y2="12"></line>\n <line x1="12" y1="16" x2="12.01" y2="16"></line>\n </svg>\n </div>\n <span class="not-found__number">4</span>\n </div>\n\n \x3c!-- 文字内容 --\x3e\n <h1 class="not-found__title">{{ $data.title }}</h1>\n <h2 class="not-found__subtitle">{{ $data.subtitle }}</h2>\n <p class="not-found__description">{{ $data.description }}</p>\n\n \x3c!-- 返回按钮 --\x3e\n <button class="not-found__button" @click="this.handleBack()">\n <svg class="not-found__button-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <line x1="19" y1="12" x2="5" y2="12"></line>\n <polyline points="12 19 5 12 12 5"></polyline>\n </svg>\n {{ $data.backText }}\n </button>\n </div>\n\n \x3c!-- 装饰性背景元素 --\x3e\n <div class="not-found__bg-decoration not-found__bg-decoration--1"></div>\n <div class="not-found__bg-decoration not-found__bg-decoration--2"></div>\n <div class="not-found__bg-decoration not-found__bg-decoration--3"></div>\n</div>\n';export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./style.css.js";import t from"./index.html.js";import n from"../../../runtime/component/base-element.js";import{CustomElement as o}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let r=class extends n{handleBack(){const e=this.$data.backUrl||"/";if("undefined"!=typeof window){const t=window.__SOLELY_ROUTER__;t?t.push(e):window.location.href=e}}};r=((e,t)=>{for(var n,o=t,r=e.length-1;r>=0;r--)(n=e[r])&&(o=n(o)||o);return o})([o({tagName:"solely-not-found",template:t,styles:e,shadowDOM:{use:!0,mode:"open"},props:[{name:"title",type:"string",default:"404"},{name:"subtitle",type:"string",default:"抱歉,您访问的页面不存在"},{name:"description",type:"string",default:"请检查网址是否正确,或点击下方按钮返回首页"},{name:"backText",type:"string",default:"返回首页"},{name:"backUrl",type:"string",default:"/"},{name:"embedded",type:"boolean",default:!1}]})],r);export{r as SolelyNotFound};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='*,*:before,*:after{box-sizing:border-box}:host{display:flex;width:100%;min-height:100vh;align-items:center;justify-content:center;font-family:var(--solely-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);background:linear-gradient(135deg,#f5f7fa,#c3cfe2);position:relative;overflow:hidden}.not-found{display:flex;align-items:center;justify-content:center;width:100%;padding:var(--solely-spacing-xl, 32px);position:relative;z-index:1}.not-found__container{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:500px;animation:fadeInUp .6s ease-out}.not-found__numbers{display:flex;align-items:center;justify-content:center;gap:16px;margin-bottom:24px}.not-found__number{font-size:120px;font-weight:800;line-height:1;background:linear-gradient(135deg,var(--solely-primary, #1890ff) 0%,var(--solely-primary-hover, #40a9ff) 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;animation:float 3s ease-in-out infinite;text-shadow:none}.not-found__number:first-child{animation-delay:0s}.not-found__number:last-child{animation-delay:.5s}.not-found__icon-wrapper{width:80px;height:80px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#ff6b6b,#ee5a6f);border-radius:50%;animation:pulse 2s ease-in-out infinite,float 3s ease-in-out infinite;animation-delay:.25s,.25s;box-shadow:0 8px 32px #ee5a6f4d}.not-found__icon{width:40px;height:40px;color:#fff}.not-found__title{font-size:48px;font-weight:700;color:var(--solely-text-primary, #262626);margin:0 0 8px;line-height:1.2}.not-found__subtitle{font-size:20px;font-weight:500;color:var(--solely-text-secondary, #595959);margin:0 0 16px;line-height:1.4}.not-found__description{font-size:14px;color:var(--solely-text-tertiary, #8c8c8c);margin:0 0 32px;line-height:1.6;max-width:400px}.not-found__button{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 28px;font-size:15px;font-weight:500;color:#fff;background:linear-gradient(135deg,var(--solely-primary, #1890ff) 0%,var(--solely-primary-hover, #40a9ff) 100%);border:none;border-radius:22px;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 16px #1890ff4d;outline:none}.not-found__button:hover{transform:translateY(-2px);box-shadow:0 6px 24px #1890ff66}.not-found__button:active{transform:translateY(0)}.not-found__button-icon{width:18px;height:18px;transition:transform .3s ease}.not-found__button:hover .not-found__button-icon{transform:translate(-3px)}.not-found__bg-decoration{position:absolute;border-radius:50%;opacity:.1;pointer-events:none}.not-found__bg-decoration--1{width:300px;height:300px;background:var(--solely-primary, #1890ff);top:-100px;right:-100px;animation:float 8s ease-in-out infinite}.not-found__bg-decoration--2{width:200px;height:200px;background:#ff6b6b;bottom:-50px;left:-50px;animation:float 6s ease-in-out infinite reverse}.not-found__bg-decoration--3{width:150px;height:150px;background:#52c41a;top:50%;right:10%;animation:float 10s ease-in-out infinite;animation-delay:-2s}@keyframes fadeInUp{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes pulse{0%,to{transform:scale(1)}50%{transform:scale(1.05)}}@media (max-width: 576px){.not-found__number{font-size:80px}.not-found__icon-wrapper{width:60px;height:60px}.not-found__icon{width:30px;height:30px}.not-found__title{font-size:36px}.not-found__subtitle{font-size:18px}.not-found__description{font-size:13px}.not-found__numbers{gap:12px}}:host([embedded]){min-height:auto;background:var(--docs-bg-secondary, #f5f5f5)}.not-found--embedded{padding:var(--solely-spacing-lg, 24px)}.not-found--embedded .not-found__container{max-width:400px;animation:fadeInUp .4s ease-out}.not-found--embedded .not-found__number{font-size:64px}.not-found--embedded .not-found__icon-wrapper{width:48px;height:48px;box-shadow:0 4px 16px #ee5a6f33}.not-found--embedded .not-found__icon{width:24px;height:24px}.not-found--embedded .not-found__title{font-size:28px;margin-bottom:4px}.not-found--embedded .not-found__subtitle{font-size:16px;margin-bottom:12px}.not-found--embedded .not-found__description{font-size:13px;margin-bottom:20px}.not-found--embedded .not-found__button{height:36px;padding:0 20px;font-size:13px;border-radius:18px;box-shadow:0 2px 8px #1890ff40}.not-found--embedded .not-found__button-icon{width:14px;height:14px}.not-found--embedded .not-found__numbers{gap:10px;margin-bottom:16px}.not-found--embedded .not-found__bg-decoration{display:none}';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n='*,*:before,*:after{box-sizing:border-box}:host{display:flex;width:100%;min-height:100vh;align-items:center;justify-content:center;font-family:var(--solely-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);background:linear-gradient(135deg,#f5f7fa,#c3cfe2);position:relative;overflow:hidden}.not-found{display:flex;align-items:center;justify-content:center;width:100%;padding:var(--solely-spacing-xl, 32px);position:relative;z-index:1}.not-found__container{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:500px;animation:fadeInUp .6s ease-out}.not-found__numbers{display:flex;align-items:center;justify-content:center;gap:16px;margin-bottom:24px}.not-found__number{font-size:120px;font-weight:800;line-height:1;background:linear-gradient(135deg,var(--solely-primary, #1890ff) 0%,var(--solely-primary-hover, #40a9ff) 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;animation:float 3s ease-in-out infinite;text-shadow:none}.not-found__number:first-child{animation-delay:0s}.not-found__number:last-child{animation-delay:.5s}.not-found__icon-wrapper{width:80px;height:80px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#ff6b6b,#ee5a6f);border-radius:50%;animation:pulse 2s ease-in-out infinite,float 3s ease-in-out infinite;animation-delay:.25s,.25s;box-shadow:0 8px 32px #ee5a6f4d}.not-found__icon{width:40px;height:40px;color:#fff}.not-found__title{font-size:48px;font-weight:700;color:var(--solely-text-primary, #262626);margin:0 0 8px;line-height:1.2}.not-found__subtitle{font-size:20px;font-weight:500;color:var(--solely-text-secondary, #595959);margin:0 0 16px;line-height:1.4}.not-found__description{font-size:14px;color:var(--solely-text-tertiary, #8c8c8c);margin:0 0 32px;line-height:1.6;max-width:400px}.not-found__button{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 28px;font-size:15px;font-weight:500;color:#fff;background:linear-gradient(135deg,var(--solely-primary, #1890ff) 0%,var(--solely-primary-hover, #40a9ff) 100%);border:none;border-radius:22px;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 16px #1890ff4d;outline:none}.not-found__button:hover{transform:translateY(-2px);box-shadow:0 6px 24px #1890ff66}.not-found__button:active{transform:translateY(0)}.not-found__button-icon{width:18px;height:18px;transition:transform .3s ease}.not-found__button:hover .not-found__button-icon{transform:translate(-3px)}.not-found__bg-decoration{position:absolute;border-radius:50%;opacity:.1;pointer-events:none}.not-found__bg-decoration--1{width:300px;height:300px;background:var(--solely-primary, #1890ff);top:-100px;right:-100px;animation:float 8s ease-in-out infinite}.not-found__bg-decoration--2{width:200px;height:200px;background:#ff6b6b;bottom:-50px;left:-50px;animation:float 6s ease-in-out infinite reverse}.not-found__bg-decoration--3{width:150px;height:150px;background:#52c41a;top:50%;right:10%;animation:float 10s ease-in-out infinite;animation-delay:-2s}@keyframes fadeInUp{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes pulse{0%,to{transform:scale(1)}50%{transform:scale(1.05)}}@media (max-width: 576px){.not-found__number{font-size:80px}.not-found__icon-wrapper{width:60px;height:60px}.not-found__icon{width:30px;height:30px}.not-found__title{font-size:36px}.not-found__subtitle{font-size:18px}.not-found__description{font-size:13px}.not-found__numbers{gap:12px}}:host([embedded]){min-height:auto;background:var(--docs-bg-secondary, #f5f5f5)}.not-found--embedded{padding:var(--solely-spacing-lg, 24px)}.not-found--embedded .not-found__container{max-width:400px;animation:fadeInUp .4s ease-out}.not-found--embedded .not-found__number{font-size:64px}.not-found--embedded .not-found__icon-wrapper{width:48px;height:48px;box-shadow:0 4px 16px #ee5a6f33}.not-found--embedded .not-found__icon{width:24px;height:24px}.not-found--embedded .not-found__title{font-size:28px;margin-bottom:4px}.not-found--embedded .not-found__subtitle{font-size:16px;margin-bottom:12px}.not-found--embedded .not-found__description{font-size:13px;margin-bottom:20px}.not-found--embedded .not-found__button{height:36px;padding:0 20px;font-size:13px;border-radius:18px;box-shadow:0 2px 8px #1890ff40}.not-found--embedded .not-found__button-icon{width:14px;height:14px}.not-found--embedded .not-found__numbers{gap:10px;margin-bottom:16px}.not-found--embedded .not-found__bg-decoration{display:none}';export{n as default};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solely NotFound 组件类型定义
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* NotFound 组件属性接口
|
|
6
|
+
*/
|
|
7
|
+
export interface NotFoundProps {
|
|
8
|
+
/** 主标题,默认为 404 */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** 副标题,默认为"抱歉,您访问的页面不存在" */
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
/** 描述文字 */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** 返回按钮文字,默认为"返回首页" */
|
|
15
|
+
backText?: string;
|
|
16
|
+
/** 返回链接地址,默认为 / */
|
|
17
|
+
backUrl?: string;
|
|
18
|
+
/** 是否为嵌入模式(用于文档演示等场景),默认 false */
|
|
19
|
+
embedded?: boolean;
|
|
20
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),a=require("../utils/helpers.cjs"),s=require("../../../runtime/component/base-element.cjs"),i=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyPagination=class extends s.default{get current(){return this.$data.current}set current(e){this.$data.current=e,this.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),a=require("../utils/helpers.cjs"),s=require("../../../runtime/component/base-element.cjs"),i=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyPagination=class extends s.default{get current(){return this.$data.current}set current(e){this.$data.current=e,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}get pageSize(){return this.$data.pageSize}set pageSize(e){this.$data.pageSize=e,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}getPaginationClasses(){const e={};return"small"===this.$data.size?e["pagination--sm"]=!0:"large"===this.$data.size?e["pagination--lg"]=!0:e["pagination--md"]=!0,e["is-disabled"]=!!this.$data.disabled,e}getPrevClasses(){return{"pagination__item--disabled":(this.$data.current||1)<=1}}getNextClasses(){return{"pagination__item--disabled":(this.$data.current||1)>=this.totalPages}}getItemClasses(e){return{"pagination__item--active":e===this.$data.current}}mounted(){this.$data.jumperValue="",this.parsePageSizeOptions()}parsePageSizeOptions(){this.$data.parsedPageSizeOptions=a.safeJsonParse(this.$data.pageSizeOptions,[10,20,50,100])}get totalPages(){return Math.ceil((this.$data.total||0)/(this.$data.pageSize||10))}calculateVisiblePages(){const e=this.$data.current||1,t=this.totalPages,a=[];if(t<=7)for(let s=1;s<=t;s++)a.push(s);else e<=3?a.push(1,2,3,4,5,"...",t):e>=t-2?a.push(1,"...",t-4,t-3,t-2,t-1,t):a.push(1,"...",e-1,e,e+1,"...",t);return a}handlePageClick(e){this.$data.disabled||e===this.$data.current||(this.$data.current=e,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{current:e,pageSize:this.$data.pageSize}})))}handlePrev(){this.$data.disabled||this.$data.current<=1||this.handlePageClick(this.$data.current-1)}handleNext(){this.$data.disabled||this.$data.current>=this.totalPages||this.handlePageClick(this.$data.current+1)}handleSizeChange(e){if(this.$data.disabled)return;const t=e.target,a=parseInt(t.value,10);this.$data.pageSize=a,this.$data.current=1,this.dispatchEvent(new CustomEvent("showSizeChange",{bubbles:!0,composed:!0,detail:{current:1,pageSize:a}}))}handleJumperKeydown(e){if("Enter"!==e.key)return;const t=e.target,a=parseInt(t.value,10);a>=1&&a<=this.totalPages&&this.handlePageClick(a),this.$data.jumperValue=""}handleJumperStep(e){if(this.$data.disabled)return;const t=this.$data.current+e;t>=1&&t<=this.totalPages&&(this.handlePageClick(t),this.$data.jumperValue=String(t))}setCurrent(e){this.$data.current=e}getCurrent(){return this.$data.current}},exports.SolelyPagination=((e,t)=>{for(var a,s=t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=a(s)||s);return s})([i.CustomElement({tagName:"solely-pagination",template:t.default,styles:e.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"current",type:"number",default:1},{name:"total",type:"number",default:0},{name:"pageSize",type:"number",default:10},{name:"size",type:"string",default:"default"},{name:"simple",type:"boolean",default:!1},{name:"showQuickJumper",type:"boolean",default:!1},{name:"showSizeChanger",type:"boolean",default:!1},{name:"pageSizeOptions",type:"string",default:"[10, 20, 50, 100]"},{name:"disabled",type:"boolean",default:!1},{name:"showTotal",type:"boolean",default:!1}]})],exports.SolelyPagination);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseElement } from '../../../runtime/component';
|
|
2
2
|
import { PaginationProps } from './types';
|
|
3
3
|
declare class SolelyPagination extends BaseElement<PaginationProps & {
|
|
4
|
-
visiblePages: (number | string)[];
|
|
5
4
|
parsedPageSizeOptions: number[];
|
|
6
5
|
}> {
|
|
7
6
|
/**
|
|
@@ -42,7 +41,7 @@ declare class SolelyPagination extends BaseElement<PaginationProps & {
|
|
|
42
41
|
/**
|
|
43
42
|
* 计算可见页码
|
|
44
43
|
*/
|
|
45
|
-
calculateVisiblePages():
|
|
44
|
+
calculateVisiblePages(): (number | string)[];
|
|
46
45
|
/**
|
|
47
46
|
* 页码点击
|
|
48
47
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<div\n class="pagination"\n :class="this.getPaginationClasses()"\n>\n \x3c!-- 总数 --\x3e\n <If test="$data.showTotal">\n <span class="pagination__total">\n 共 {{$data.total}} 条\n </span>\n </If>\n\n \x3c!-- 上一页 --\x3e\n <span\n class="pagination__prev"\n :class="this.getPrevClasses()"\n @click="this.handlePrev(event)"\n >\n <\n </span>\n\n \x3c!-- 页码 --\x3e\n <For each="
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<div\n class="pagination"\n :class="this.getPaginationClasses()"\n>\n \x3c!-- 总数 --\x3e\n <If test="$data.showTotal">\n <span class="pagination__total">\n 共 {{$data.total}} 条\n </span>\n </If>\n\n \x3c!-- 上一页 --\x3e\n <span\n class="pagination__prev"\n :class="this.getPrevClasses()"\n @click="this.handlePrev(event)"\n >\n <\n </span>\n\n \x3c!-- 页码 --\x3e\n <For each="this.calculateVisiblePages()" item="page">\n <If test="page !== \'...\'">\n <span\n class="pagination__item"\n :class="this.getItemClasses(page)"\n @click="this.handlePageClick(page, event)"\n >\n {{page}}\n </span>\n </If>\n <If test="page === \'...\'">\n <span class="pagination__ellipsis">...</span>\n </If>\n </For>\n\n \x3c!-- 下一页 --\x3e\n <span\n class="pagination__next"\n :class="this.getNextClasses()"\n @click="this.handleNext(event)"\n >\n >\n </span>\n\n \x3c!-- 每页条数选择器 --\x3e\n <If test="$data.showSizeChanger">\n <span class="pagination__size-changer">\n <select @change="this.handleSizeChange(event)">\n <For each="$data.parsedPageSizeOptions" item="size">\n <option\n :value="size"\n :selected="size === $data.pageSize"\n >\n {{size}} 条/页\n </option>\n </For>\n </select>\n </span>\n </If>\n\n \x3c!-- 快速跳转 --\x3e\n <If test="$data.showQuickJumper">\n <span class="pagination__jumper">\n 跳至\n <span class="pagination__jumper-input-wrapper">\n <input\n type="number"\n min="1"\n :max="$data.totalPages"\n s-model="$data.jumperValue"\n @keydown="this.handleJumperKeydown(event)"\n />\n <span class="pagination__jumper-controls">\n <span class="pagination__jumper-up" @click="this.handleJumperStep(1)">▲</span>\n <span class="pagination__jumper-down" @click="this.handleJumperStep(-1)">▼</span>\n </span>\n </span>\n 页\n </span>\n </If>\n</div>\n';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const n='<div\n class="pagination"\n :class="this.getPaginationClasses()"\n>\n \x3c!-- 总数 --\x3e\n <If test="$data.showTotal">\n <span class="pagination__total">\n 共 {{$data.total}} 条\n </span>\n </If>\n\n \x3c!-- 上一页 --\x3e\n <span\n class="pagination__prev"\n :class="this.getPrevClasses()"\n @click="this.handlePrev(event)"\n >\n <\n </span>\n\n \x3c!-- 页码 --\x3e\n <For each="
|
|
1
|
+
const n='<div\n class="pagination"\n :class="this.getPaginationClasses()"\n>\n \x3c!-- 总数 --\x3e\n <If test="$data.showTotal">\n <span class="pagination__total">\n 共 {{$data.total}} 条\n </span>\n </If>\n\n \x3c!-- 上一页 --\x3e\n <span\n class="pagination__prev"\n :class="this.getPrevClasses()"\n @click="this.handlePrev(event)"\n >\n <\n </span>\n\n \x3c!-- 页码 --\x3e\n <For each="this.calculateVisiblePages()" item="page">\n <If test="page !== \'...\'">\n <span\n class="pagination__item"\n :class="this.getItemClasses(page)"\n @click="this.handlePageClick(page, event)"\n >\n {{page}}\n </span>\n </If>\n <If test="page === \'...\'">\n <span class="pagination__ellipsis">...</span>\n </If>\n </For>\n\n \x3c!-- 下一页 --\x3e\n <span\n class="pagination__next"\n :class="this.getNextClasses()"\n @click="this.handleNext(event)"\n >\n >\n </span>\n\n \x3c!-- 每页条数选择器 --\x3e\n <If test="$data.showSizeChanger">\n <span class="pagination__size-changer">\n <select @change="this.handleSizeChange(event)">\n <For each="$data.parsedPageSizeOptions" item="size">\n <option\n :value="size"\n :selected="size === $data.pageSize"\n >\n {{size}} 条/页\n </option>\n </For>\n </select>\n </span>\n </If>\n\n \x3c!-- 快速跳转 --\x3e\n <If test="$data.showQuickJumper">\n <span class="pagination__jumper">\n 跳至\n <span class="pagination__jumper-input-wrapper">\n <input\n type="number"\n min="1"\n :max="$data.totalPages"\n s-model="$data.jumperValue"\n @keydown="this.handleJumperKeydown(event)"\n />\n <span class="pagination__jumper-controls">\n <span class="pagination__jumper-up" @click="this.handleJumperStep(1)">▲</span>\n <span class="pagination__jumper-down" @click="this.handleJumperStep(-1)">▼</span>\n </span>\n </span>\n 页\n </span>\n </If>\n</div>\n';export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./style.css.js";import t from"./index.html.js";import{safeJsonParse as a}from"../utils/helpers.js";import s from"../../../runtime/component/base-element.js";import{CustomElement as i}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let n=class extends s{get current(){return this.$data.current}set current(e){this.$data.current=e,this.
|
|
1
|
+
import e from"./style.css.js";import t from"./index.html.js";import{safeJsonParse as a}from"../utils/helpers.js";import s from"../../../runtime/component/base-element.js";import{CustomElement as i}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let n=class extends s{get current(){return this.$data.current}set current(e){this.$data.current=e,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}get pageSize(){return this.$data.pageSize}set pageSize(e){this.$data.pageSize=e,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}getPaginationClasses(){const e={};return"small"===this.$data.size?e["pagination--sm"]=!0:"large"===this.$data.size?e["pagination--lg"]=!0:e["pagination--md"]=!0,e["is-disabled"]=!!this.$data.disabled,e}getPrevClasses(){return{"pagination__item--disabled":(this.$data.current||1)<=1}}getNextClasses(){return{"pagination__item--disabled":(this.$data.current||1)>=this.totalPages}}getItemClasses(e){return{"pagination__item--active":e===this.$data.current}}mounted(){this.$data.jumperValue="",this.parsePageSizeOptions()}parsePageSizeOptions(){this.$data.parsedPageSizeOptions=a(this.$data.pageSizeOptions,[10,20,50,100])}get totalPages(){return Math.ceil((this.$data.total||0)/(this.$data.pageSize||10))}calculateVisiblePages(){const e=this.$data.current||1,t=this.totalPages,a=[];if(t<=7)for(let s=1;s<=t;s++)a.push(s);else e<=3?a.push(1,2,3,4,5,"...",t):e>=t-2?a.push(1,"...",t-4,t-3,t-2,t-1,t):a.push(1,"...",e-1,e,e+1,"...",t);return a}handlePageClick(e){this.$data.disabled||e===this.$data.current||(this.$data.current=e,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{current:e,pageSize:this.$data.pageSize}})))}handlePrev(){this.$data.disabled||this.$data.current<=1||this.handlePageClick(this.$data.current-1)}handleNext(){this.$data.disabled||this.$data.current>=this.totalPages||this.handlePageClick(this.$data.current+1)}handleSizeChange(e){if(this.$data.disabled)return;const t=e.target,a=parseInt(t.value,10);this.$data.pageSize=a,this.$data.current=1,this.dispatchEvent(new CustomEvent("showSizeChange",{bubbles:!0,composed:!0,detail:{current:1,pageSize:a}}))}handleJumperKeydown(e){if("Enter"!==e.key)return;const t=e.target,a=parseInt(t.value,10);a>=1&&a<=this.totalPages&&this.handlePageClick(a),this.$data.jumperValue=""}handleJumperStep(e){if(this.$data.disabled)return;const t=this.$data.current+e;t>=1&&t<=this.totalPages&&(this.handlePageClick(t),this.$data.jumperValue=String(t))}setCurrent(e){this.$data.current=e}getCurrent(){return this.$data.current}};n=((e,t)=>{for(var a,s=t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=a(s)||s);return s})([i({tagName:"solely-pagination",template:t,styles:e,shadowDOM:{use:!0,mode:"open"},props:[{name:"current",type:"number",default:1},{name:"total",type:"number",default:0},{name:"pageSize",type:"number",default:10},{name:"size",type:"string",default:"default"},{name:"simple",type:"boolean",default:!1},{name:"showQuickJumper",type:"boolean",default:!1},{name:"showSizeChanger",type:"boolean",default:!1},{name:"pageSizeOptions",type:"string",default:"[10, 20, 50, 100]"},{name:"disabled",type:"boolean",default:!1},{name:"showTotal",type:"boolean",default:!1}]})],n);export{n as SolelyPagination};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseElement } from '../../../runtime/component';
|
|
2
|
+
declare class SelectOption extends BaseElement<{
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
}> {
|
|
7
|
+
/**
|
|
8
|
+
* 获取选项值
|
|
9
|
+
*/
|
|
10
|
+
getOptionData(): {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
element: SelectOption;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export default SelectOption;
|
|
18
|
+
export { SelectOption };
|