solely 0.4.7 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/elements/select/index.cjs +1 -1
- package/dist/components/elements/select/index.d.ts +6 -0
- package/dist/components/elements/select/index.html.cjs +1 -1
- package/dist/components/elements/select/index.html.js +1 -1
- package/dist/components/elements/select/index.js +1 -1
- package/dist/components/elements/select/style.css.cjs +1 -1
- package/dist/components/elements/select/style.css.js +1 -1
- package/dist/components/elements/select/types.d.ts +2 -0
- package/dist/components/elements/skeleton/index.cjs +1 -1
- package/dist/components/elements/skeleton/index.d.ts +4 -0
- package/dist/components/elements/skeleton/index.html.cjs +1 -1
- package/dist/components/elements/skeleton/index.html.js +1 -1
- package/dist/components/elements/skeleton/index.js +1 -1
- package/dist/components/elements/skeleton/style.css.cjs +1 -1
- package/dist/components/elements/skeleton/style.css.js +1 -1
- package/dist/components/elements/skeleton/types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=Object.defineProperty,e=(e,a,s)=>((e,a,s)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s)(e,"symbol"!=typeof a?a+"":a,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./style.css.cjs"),s=require("./index.html.cjs"),l=require("../../../runtime/component/base-element.cjs"),i=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelySelect=class extends l.default{constructor(){super(...arguments),e(this,"clickOutsideHandler"),e(this,"slotObserver")}get value(){return this.$data.value||""}set value(t){this.$data.disabled||this.setValue(t)}getSelectClasses(){const t={};return"small"===this.$data.size?t["select--sm"]=!0:"large"===this.$data.size?t["select--lg"]=!0:t["select--md"]=!0,t["is-disabled"]=!!this.$data.disabled,t["is-focused"]=!!this.$data.focused,t["is-open"]=!!this.$data.isOpen,t["use-slot"]=this.$data.useSlot,t}getDropdownClasses(){return{"select__dropdown--closing":!!this.$data.closing,"select__dropdown--top":"top"===this.$data.dropdownPlacement,"select__dropdown--bottom":"bottom"===this.$data.dropdownPlacement}}getOptionClasses(t){return{"select__option--selected":t.value===this.$data.value,"select__option--disabled":!!t.disabled}}calculateDropdownPlacement(){const t=this.getBoundingClientRect(),e=window.innerHeight-t.bottom,a=t.top;this.$data.dropdownPlacement=e<256&&a>e?"top":"bottom"}collectSlotOptions(){const t=Array.from(this.children).
|
|
1
|
+
"use strict";var t=Object.defineProperty,e=(e,a,s)=>((e,a,s)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s)(e,"symbol"!=typeof a?a+"":a,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./style.css.cjs"),s=require("./index.html.cjs"),l=require("../../../runtime/component/base-element.cjs"),i=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelySelect=class extends l.default{constructor(){super(...arguments),e(this,"clickOutsideHandler"),e(this,"slotObserver")}get value(){return this.$data.value||""}set value(t){this.$data.disabled||this.setValue(t)}getSelectClasses(){const t={};return"small"===this.$data.size?t["select--sm"]=!0:"large"===this.$data.size?t["select--lg"]=!0:t["select--md"]=!0,t["is-disabled"]=!!this.$data.disabled,t["is-focused"]=!!this.$data.focused,t["is-open"]=!!this.$data.isOpen,t["use-slot"]=this.$data.useSlot,t}getDropdownClasses(){return{"select__dropdown--closing":!!this.$data.closing,"select__dropdown--top":"top"===this.$data.dropdownPlacement,"select__dropdown--bottom":"bottom"===this.$data.dropdownPlacement}}getOptionClasses(t){return{"select__option--selected":t.value===this.$data.value,"select__option--disabled":!!t.disabled}}calculateDropdownPlacement(){const t=this.getBoundingClientRect(),e=window.innerHeight-t.bottom,a=t.top;this.$data.dropdownPlacement=e<256&&a>e?"top":"bottom"}collectSlotOptions(){const t=Array.from(this.children);this.$data.hasHeaderSlot=t.some(t=>"header"===t.getAttribute("slot")),this.$data.hasFooterSlot=t.some(t=>"footer"===t.getAttribute("slot"));const e=t.filter(t=>!t.getAttribute("slot")&&t.hasAttribute("data-value"));0!==e.length?(this.$data.useSlot=!0,this.$data.slotOptions=e.map(t=>{var e;const a=t;return{value:a.getAttribute("data-value")||"",label:a.getAttribute("data-label")||(null==(e=a.textContent)?void 0:e.trim())||"",disabled:a.hasAttribute("disabled"),element:t}}),this.updateSelectedLabelFromSlot()):this.$data.useSlot=!1}updateSelectedLabelFromSlot(){if(!this.$data.slotOptions.length)return;const t=this.$data.slotOptions.find(t=>t.value===this.$data.value);this.$data.selectedLabel=(null==t?void 0:t.label)||""}mounted(){this.parseOptions(),this.setupSlotObserver(),this.clickOutsideHandler=t=>{t.composedPath().some(t=>t===this)||this.closeDropdown()},document.addEventListener("click",this.clickOutsideHandler)}setupSlotObserver(){setTimeout(()=>{this.collectSlotOptions()},0),this.slotObserver=new MutationObserver(()=>{this.collectSlotOptions()}),this.slotObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["data-value","data-label","disabled"]})}unmounted(){this.clickOutsideHandler&&document.removeEventListener("click",this.clickOutsideHandler),this.slotObserver&&this.slotObserver.disconnect()}updated(){const t=this.$data.selectedLabel,e=this.getCurrentLabel();t!==e&&(this.$data.selectedLabel=e)}getCurrentLabel(){if(this.$data.useSlot){const t=this.$data.slotOptions.find(t=>t.value===this.$data.value);return(null==t?void 0:t.label)||""}{const t=this.$data.parsedOptions.find(t=>t.value===this.$data.value);return(null==t?void 0:t.label)||""}}parseOptions(){this.$data.parsedOptions=Array.isArray(this.$data.options)?this.$data.options:[],this.$data.useSlot||this.updateSelectedLabel()}updateSelectedLabel(){if(!this.$data.parsedOptions.length)return;const t=this.$data.parsedOptions.find(t=>t.value===this.$data.value);this.$data.selectedLabel=(null==t?void 0:t.label)||""}handleClick(){if(this.$data.disabled)return;const t=!this.$data.isOpen;this.$data.isOpen=t,this.$data.focused=t,t&&this.calculateDropdownPlacement()}handleSelect(t,e){t.disabled||(this.$data.value=t.value,this.updateSelectedLabel(),this.closeDropdown(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}handleSlotClick(t){var e;const a=t.target.closest("[data-value]");if(!a)return;if(a.hasAttribute("data-group"))return void t.stopPropagation();const s=a.getAttribute("data-value")||"",l=a.getAttribute("data-label")||(null==(e=a.textContent)?void 0:e.trim())||"";a.hasAttribute("disabled")||(this.$data.value=s,this.$data.selectedLabel=l,this.closeDropdown(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}handleHeaderFooterClick(t){t.stopPropagation()}handleClear(t){t.stopPropagation(),this.$data.value="",this.$data.selectedLabel="",this.dispatchEvent(new Event("clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}closeDropdown(){this.$data.isOpen&&(this.$data.closing=!0,setTimeout(()=>{this.$data.isOpen=!1,this.$data.closing=!1,this.$data.focused=!1},200))}setValue(t,e=!1){this.$data.value=t,this.$data.useSlot?this.updateSelectedLabelFromSlot():this.updateSelectedLabel(),e||this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}getValue(){return this.$data.value||""}setOptions(t){this.$data.options=t,this.$data.useSlot=!1,this.parseOptions()}},exports.SolelySelect=((t,e)=>{for(var a,s=e,l=t.length-1;l>=0;l--)(a=t[l])&&(s=a(s)||s);return s})([i.CustomElement({tagName:"solely-select",template:s.default,styles:a.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"value",type:"string",default:""},{name:"placeholder",type:"string",default:"请选择"},{name:"disabled",type:"boolean",default:!1},{name:"size",type:"string",default:"medium"},{name:"clearable",type:"boolean",default:!1},{name:"options",type:"array",default:[]},{name:"multiple",type:"boolean",default:!1},{name:"block",type:"boolean",default:!1}]})],exports.SolelySelect);
|
|
@@ -14,6 +14,8 @@ declare class SolelySelect extends BaseElement<SelectProps & {
|
|
|
14
14
|
disabled: boolean;
|
|
15
15
|
element: Element;
|
|
16
16
|
}>;
|
|
17
|
+
hasHeaderSlot: boolean;
|
|
18
|
+
hasFooterSlot: boolean;
|
|
17
19
|
}> {
|
|
18
20
|
clickOutsideHandler?: (event: MouseEvent) => void;
|
|
19
21
|
slotObserver?: MutationObserver;
|
|
@@ -85,6 +87,10 @@ declare class SolelySelect extends BaseElement<SelectProps & {
|
|
|
85
87
|
* 处理插槽选项点击
|
|
86
88
|
*/
|
|
87
89
|
handleSlotClick(event: Event): void;
|
|
90
|
+
/**
|
|
91
|
+
* 处理 header/footer 点击,阻止事件冒泡避免关闭下拉框
|
|
92
|
+
*/
|
|
93
|
+
handleHeaderFooterClick(event: Event): void;
|
|
88
94
|
/**
|
|
89
95
|
* 清除选择
|
|
90
96
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<div class="select" :class="this.getSelectClasses()" @click="this.handleClick(event)">\n <div class="select__selector">\n <If test="!$data.selectedLabel">\n <span class="select__placeholder">{{$data.placeholder || \'请选择\'}}</span>\n </If>\n <If test="$data.selectedLabel">\n <span class="select__value">{{$data.selectedLabel}}</span>\n </If>\n <If test="$data.clearable && $data.selectedLabel && !$data.disabled">\n <span class="select__clear" @click="this.handleClear(event)">×</span>\n </If>\n <span class="select__arrow">▼</span>\n </div>\n\n \x3c!-- 下拉菜单 --\x3e\n <If test="$data.isOpen">\n <div class="select__dropdown" :class="this.getDropdownClasses()">\n \x3c!-- 使用 options 属性时的渲染 --\x3e\n
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<div class="select" :class="this.getSelectClasses()" @click="this.handleClick(event)">\n <div class="select__selector">\n <If test="!$data.selectedLabel">\n <span class="select__placeholder">{{$data.placeholder || \'请选择\'}}</span>\n </If>\n <If test="$data.selectedLabel">\n <span class="select__value">{{$data.selectedLabel}}</span>\n </If>\n <If test="$data.clearable && $data.selectedLabel && !$data.disabled">\n <span class="select__clear" @click="this.handleClear(event)">×</span>\n </If>\n <span class="select__arrow">▼</span>\n </div>\n\n \x3c!-- 下拉菜单 --\x3e\n <If test="$data.isOpen">\n <div class="select__dropdown" :class="this.getDropdownClasses()">\n \x3c!-- header 插槽 - 固定顶部 --\x3e\n <If test="$data.hasHeaderSlot">\n <div class="select__header" @click="this.handleHeaderFooterClick(event)">\n <slot name="header"></slot>\n </div>\n </If>\n\n \x3c!-- 滚动内容区域 --\x3e\n <div class="select__dropdown-content">\n \x3c!-- 使用 options 属性时的渲染 --\x3e\n <If test="!$data.useSlot">\n <If test="$data.parsedOptions.length === 0">\n <div class="select__empty">暂无数据</div>\n </If>\n <For each="$data.parsedOptions" item="option">\n <div class="select__option" :class="this.getOptionClasses(option)" @click="this.handleSelect(option, event)">\n <span class="select__option-label">{{option.label}}</span>\n </div>\n </For>\n </If>\n\n \x3c!-- 使用插槽时的渲染 --\x3e\n <If test="$data.useSlot">\n <div class="select__slot-options" @click="this.handleSlotClick(event)">\n <slot></slot>\n </div>\n </If>\n </div>\n\n \x3c!-- footer 插槽 - 固定底部 --\x3e\n <If test="$data.hasFooterSlot">\n <div class="select__footer" @click="this.handleHeaderFooterClick(event)">\n <slot name="footer"></slot>\n </div>\n </If>\n </div>\n </If>\n</div>\n';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e='<div class="select" :class="this.getSelectClasses()" @click="this.handleClick(event)">\n <div class="select__selector">\n <If test="!$data.selectedLabel">\n <span class="select__placeholder">{{$data.placeholder || \'请选择\'}}</span>\n </If>\n <If test="$data.selectedLabel">\n <span class="select__value">{{$data.selectedLabel}}</span>\n </If>\n <If test="$data.clearable && $data.selectedLabel && !$data.disabled">\n <span class="select__clear" @click="this.handleClear(event)">×</span>\n </If>\n <span class="select__arrow">▼</span>\n </div>\n\n \x3c!-- 下拉菜单 --\x3e\n <If test="$data.isOpen">\n <div class="select__dropdown" :class="this.getDropdownClasses()">\n \x3c!-- 使用 options 属性时的渲染 --\x3e\n
|
|
1
|
+
const e='<div class="select" :class="this.getSelectClasses()" @click="this.handleClick(event)">\n <div class="select__selector">\n <If test="!$data.selectedLabel">\n <span class="select__placeholder">{{$data.placeholder || \'请选择\'}}</span>\n </If>\n <If test="$data.selectedLabel">\n <span class="select__value">{{$data.selectedLabel}}</span>\n </If>\n <If test="$data.clearable && $data.selectedLabel && !$data.disabled">\n <span class="select__clear" @click="this.handleClear(event)">×</span>\n </If>\n <span class="select__arrow">▼</span>\n </div>\n\n \x3c!-- 下拉菜单 --\x3e\n <If test="$data.isOpen">\n <div class="select__dropdown" :class="this.getDropdownClasses()">\n \x3c!-- header 插槽 - 固定顶部 --\x3e\n <If test="$data.hasHeaderSlot">\n <div class="select__header" @click="this.handleHeaderFooterClick(event)">\n <slot name="header"></slot>\n </div>\n </If>\n\n \x3c!-- 滚动内容区域 --\x3e\n <div class="select__dropdown-content">\n \x3c!-- 使用 options 属性时的渲染 --\x3e\n <If test="!$data.useSlot">\n <If test="$data.parsedOptions.length === 0">\n <div class="select__empty">暂无数据</div>\n </If>\n <For each="$data.parsedOptions" item="option">\n <div class="select__option" :class="this.getOptionClasses(option)" @click="this.handleSelect(option, event)">\n <span class="select__option-label">{{option.label}}</span>\n </div>\n </For>\n </If>\n\n \x3c!-- 使用插槽时的渲染 --\x3e\n <If test="$data.useSlot">\n <div class="select__slot-options" @click="this.handleSlotClick(event)">\n <slot></slot>\n </div>\n </If>\n </div>\n\n \x3c!-- footer 插槽 - 固定底部 --\x3e\n <If test="$data.hasFooterSlot">\n <div class="select__footer" @click="this.handleHeaderFooterClick(event)">\n <slot name="footer"></slot>\n </div>\n </If>\n </div>\n </If>\n</div>\n';export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var t=Object.defineProperty,e=(e,a,s)=>((e,a,s)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s)(e,"symbol"!=typeof a?a+"":a,s);import a from"./style.css.js";import s from"./index.html.js";import l from"../../../runtime/component/base-element.js";import{CustomElement as i}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let o=class extends l{constructor(){super(...arguments),e(this,"clickOutsideHandler"),e(this,"slotObserver")}get value(){return this.$data.value||""}set value(t){this.$data.disabled||this.setValue(t)}getSelectClasses(){const t={};return"small"===this.$data.size?t["select--sm"]=!0:"large"===this.$data.size?t["select--lg"]=!0:t["select--md"]=!0,t["is-disabled"]=!!this.$data.disabled,t["is-focused"]=!!this.$data.focused,t["is-open"]=!!this.$data.isOpen,t["use-slot"]=this.$data.useSlot,t}getDropdownClasses(){return{"select__dropdown--closing":!!this.$data.closing,"select__dropdown--top":"top"===this.$data.dropdownPlacement,"select__dropdown--bottom":"bottom"===this.$data.dropdownPlacement}}getOptionClasses(t){return{"select__option--selected":t.value===this.$data.value,"select__option--disabled":!!t.disabled}}calculateDropdownPlacement(){const t=this.getBoundingClientRect(),e=window.innerHeight-t.bottom,a=t.top;this.$data.dropdownPlacement=e<256&&a>e?"top":"bottom"}collectSlotOptions(){const t=Array.from(this.children).
|
|
1
|
+
var t=Object.defineProperty,e=(e,a,s)=>((e,a,s)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s)(e,"symbol"!=typeof a?a+"":a,s);import a from"./style.css.js";import s from"./index.html.js";import l from"../../../runtime/component/base-element.js";import{CustomElement as i}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let o=class extends l{constructor(){super(...arguments),e(this,"clickOutsideHandler"),e(this,"slotObserver")}get value(){return this.$data.value||""}set value(t){this.$data.disabled||this.setValue(t)}getSelectClasses(){const t={};return"small"===this.$data.size?t["select--sm"]=!0:"large"===this.$data.size?t["select--lg"]=!0:t["select--md"]=!0,t["is-disabled"]=!!this.$data.disabled,t["is-focused"]=!!this.$data.focused,t["is-open"]=!!this.$data.isOpen,t["use-slot"]=this.$data.useSlot,t}getDropdownClasses(){return{"select__dropdown--closing":!!this.$data.closing,"select__dropdown--top":"top"===this.$data.dropdownPlacement,"select__dropdown--bottom":"bottom"===this.$data.dropdownPlacement}}getOptionClasses(t){return{"select__option--selected":t.value===this.$data.value,"select__option--disabled":!!t.disabled}}calculateDropdownPlacement(){const t=this.getBoundingClientRect(),e=window.innerHeight-t.bottom,a=t.top;this.$data.dropdownPlacement=e<256&&a>e?"top":"bottom"}collectSlotOptions(){const t=Array.from(this.children);this.$data.hasHeaderSlot=t.some(t=>"header"===t.getAttribute("slot")),this.$data.hasFooterSlot=t.some(t=>"footer"===t.getAttribute("slot"));const e=t.filter(t=>!t.getAttribute("slot")&&t.hasAttribute("data-value"));0!==e.length?(this.$data.useSlot=!0,this.$data.slotOptions=e.map(t=>{var e;const a=t;return{value:a.getAttribute("data-value")||"",label:a.getAttribute("data-label")||(null==(e=a.textContent)?void 0:e.trim())||"",disabled:a.hasAttribute("disabled"),element:t}}),this.updateSelectedLabelFromSlot()):this.$data.useSlot=!1}updateSelectedLabelFromSlot(){if(!this.$data.slotOptions.length)return;const t=this.$data.slotOptions.find(t=>t.value===this.$data.value);this.$data.selectedLabel=(null==t?void 0:t.label)||""}mounted(){this.parseOptions(),this.setupSlotObserver(),this.clickOutsideHandler=t=>{t.composedPath().some(t=>t===this)||this.closeDropdown()},document.addEventListener("click",this.clickOutsideHandler)}setupSlotObserver(){setTimeout(()=>{this.collectSlotOptions()},0),this.slotObserver=new MutationObserver(()=>{this.collectSlotOptions()}),this.slotObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["data-value","data-label","disabled"]})}unmounted(){this.clickOutsideHandler&&document.removeEventListener("click",this.clickOutsideHandler),this.slotObserver&&this.slotObserver.disconnect()}updated(){const t=this.$data.selectedLabel,e=this.getCurrentLabel();t!==e&&(this.$data.selectedLabel=e)}getCurrentLabel(){if(this.$data.useSlot){const t=this.$data.slotOptions.find(t=>t.value===this.$data.value);return(null==t?void 0:t.label)||""}{const t=this.$data.parsedOptions.find(t=>t.value===this.$data.value);return(null==t?void 0:t.label)||""}}parseOptions(){this.$data.parsedOptions=Array.isArray(this.$data.options)?this.$data.options:[],this.$data.useSlot||this.updateSelectedLabel()}updateSelectedLabel(){if(!this.$data.parsedOptions.length)return;const t=this.$data.parsedOptions.find(t=>t.value===this.$data.value);this.$data.selectedLabel=(null==t?void 0:t.label)||""}handleClick(){if(this.$data.disabled)return;const t=!this.$data.isOpen;this.$data.isOpen=t,this.$data.focused=t,t&&this.calculateDropdownPlacement()}handleSelect(t,e){t.disabled||(this.$data.value=t.value,this.updateSelectedLabel(),this.closeDropdown(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}handleSlotClick(t){var e;const a=t.target.closest("[data-value]");if(!a)return;if(a.hasAttribute("data-group"))return void t.stopPropagation();const s=a.getAttribute("data-value")||"",l=a.getAttribute("data-label")||(null==(e=a.textContent)?void 0:e.trim())||"";a.hasAttribute("disabled")||(this.$data.value=s,this.$data.selectedLabel=l,this.closeDropdown(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}handleHeaderFooterClick(t){t.stopPropagation()}handleClear(t){t.stopPropagation(),this.$data.value="",this.$data.selectedLabel="",this.dispatchEvent(new Event("clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}closeDropdown(){this.$data.isOpen&&(this.$data.closing=!0,setTimeout(()=>{this.$data.isOpen=!1,this.$data.closing=!1,this.$data.focused=!1},200))}setValue(t,e=!1){this.$data.value=t,this.$data.useSlot?this.updateSelectedLabelFromSlot():this.updateSelectedLabel(),e||this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}getValue(){return this.$data.value||""}setOptions(t){this.$data.options=t,this.$data.useSlot=!1,this.parseOptions()}};o=((t,e)=>{for(var a,s=e,l=t.length-1;l>=0;l--)(a=t[l])&&(s=a(s)||s);return s})([i({tagName:"solely-select",template:s,styles:a,shadowDOM:{use:!0,mode:"open"},props:[{name:"value",type:"string",default:""},{name:"placeholder",type:"string",default:"请选择"},{name:"disabled",type:"boolean",default:!1},{name:"size",type:"string",default:"medium"},{name:"clearable",type:"boolean",default:!1},{name:"options",type:"array",default:[]},{name:"multiple",type:"boolean",default:!1},{name:"block",type:"boolean",default:!1}]})],o);export{o as SolelySelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default="*,*:before,*:after{box-sizing:border-box}:host{display:inline-block;position:relative}:host([block]){display:block;width:100%}.select{cursor:pointer}.select__selector{display:flex;align-items:center;height:var(--solely-height-md);padding:0 var(--solely-spacing-md);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);color:var(--solely-text-primary);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);transition:all var(--solely-transition-duration) var(--solely-transition-timing);box-sizing:border-box}.select__selector:hover:not(.is-disabled){border-color:var(--solely-primary-hover)}.select--sm .select__selector{height:var(--solely-height-sm);padding:0 var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.select--lg .select__selector{height:var(--solely-height-lg);padding:0 var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.select__value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select__placeholder{color:var(--solely-text-tertiary)}.select__arrow{margin-left:auto;font-size:12px;color:var(--solely-text-tertiary);transition:transform var(--solely-transition-duration);flex-shrink:0}.select.is-open .select__arrow{transform:rotate(180deg)}.select.is-disabled{cursor:not-allowed;opacity:var(--solely-disabled-opacity)}.select.is-focused .select__selector{border-color:var(--solely-primary);box-shadow:0 0 0 2px var(--solely-primary-light)}.select__clear{margin-left:var(--solely-spacing-xs);font-size:14px;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration)}.select__clear:hover{color:var(--solely-text-secondary)}.select__dropdown{position:absolute;left:0;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default="*,*:before,*:after{box-sizing:border-box}:host{display:inline-block;position:relative}:host([block]){display:block;width:100%}.select{cursor:pointer}.select__selector{display:flex;align-items:center;height:var(--solely-height-md);padding:0 var(--solely-spacing-md);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);color:var(--solely-text-primary);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);transition:all var(--solely-transition-duration) var(--solely-transition-timing);box-sizing:border-box}.select__selector:hover:not(.is-disabled){border-color:var(--solely-primary-hover)}.select--sm .select__selector{height:var(--solely-height-sm);padding:0 var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.select--lg .select__selector{height:var(--solely-height-lg);padding:0 var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.select__value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select__placeholder{color:var(--solely-text-tertiary)}.select__arrow{margin-left:auto;font-size:12px;color:var(--solely-text-tertiary);transition:transform var(--solely-transition-duration);flex-shrink:0}.select.is-open .select__arrow{transform:rotate(180deg)}.select.is-disabled{cursor:not-allowed;opacity:var(--solely-disabled-opacity)}.select.is-focused .select__selector{border-color:var(--solely-primary);box-shadow:0 0 0 2px var(--solely-primary-light)}.select__clear{margin-left:var(--solely-spacing-xs);font-size:14px;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration)}.select__clear:hover{color:var(--solely-text-secondary)}.select__dropdown{position:absolute;left:0;width:auto;min-width:100%;max-height:400px;display:flex;flex-direction:column;background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);box-shadow:var(--solely-shadow-md);z-index:var(--solely-z-index-dropdown)}.select__dropdown-content{flex:1;overflow-y:auto;min-height:0}.select__dropdown--bottom{top:100%;margin-top:4px;animation:dropdown-in-bottom .2s ease-out}.select__dropdown--bottom.select__dropdown--closing{animation:dropdown-out-bottom .2s ease-in forwards}.select__dropdown--top{bottom:100%;margin-bottom:4px;animation:dropdown-in-top .2s ease-out}.select__dropdown--top.select__dropdown--closing{animation:dropdown-out-top .2s ease-in forwards}.select__option{padding:var(--solely-spacing-sm) var(--solely-spacing-md);cursor:pointer;transition:all var(--solely-transition-duration);color:var(--solely-text-primary);box-sizing:border-box;min-width:100%}.select__option:hover:not(.select__option--disabled){background-color:var(--solely-primary-light)}.select__option--selected{background-color:var(--solely-primary-light);color:var(--solely-primary);font-weight:500}.select__option--disabled{cursor:not-allowed;color:var(--solely-text-tertiary);opacity:var(--solely-disabled-opacity)}.select__option{display:flex;align-items:center;gap:8px}.select__option-icon{flex-shrink:0}.select__option-icon--img{width:20px;height:20px;object-fit:cover;border-radius:4px}.select__option-icon--class{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;font-size:16px}.select__option-label{flex:1;overflow:visible;text-overflow:clip;white-space:nowrap}.select__slot-options{display:flex;flex-direction:column;width:fit-content;min-width:100%}.select__slot-options ::slotted([data-value]),.select__slot-options>[data-value]{padding:var(--solely-spacing-sm) var(--solely-spacing-md);cursor:pointer;transition:all var(--solely-transition-duration);color:var(--solely-text-primary);display:flex;align-items:center;gap:8px;box-sizing:border-box}.select__slot-options ::slotted([data-value]:hover:not([disabled])),.select__slot-options>[data-value]:hover:not([disabled]){background-color:var(--solely-primary-light)}.select__slot-options ::slotted([data-value][data-selected]),.select__slot-options>[data-value][data-selected]{background-color:var(--solely-primary-light);color:var(--solely-primary);font-weight:500}.select__slot-options ::slotted([data-value][disabled]),.select__slot-options>[data-value][disabled]{cursor:not-allowed;color:var(--solely-text-tertiary);opacity:var(--solely-disabled-opacity)}.select__header,.select__footer{flex-shrink:0;color:var(--solely-text-secondary);font-size:var(--solely-font-size-sm);background-color:var(--solely-component-bg)}.select__group-label,.select__slot-options ::slotted([data-group]),.select__slot-options>[data-group]{padding:var(--solely-spacing-sm) var(--solely-spacing-md);color:var(--solely-text-secondary);font-size:var(--solely-font-size-sm);font-weight:600;cursor:default;background-color:transparent}.select__slot-options>[data-group]:not(:first-child){margin-top:var(--solely-spacing-sm)}.select__slot-options ::slotted([data-group]:hover),.select__slot-options>[data-group]:hover{background-color:transparent}.select__dropdown-content::-webkit-scrollbar{width:6px}.select__dropdown-content::-webkit-scrollbar-track{background:transparent}.select__dropdown-content::-webkit-scrollbar-thumb{background-color:var(--solely-border-color);border-radius:3px}.select__dropdown-content::-webkit-scrollbar-thumb:hover{background-color:var(--solely-text-tertiary)}.select__empty{padding:var(--solely-spacing-md);text-align:center;color:var(--solely-text-tertiary);font-size:var(--solely-font-size-sm)}@keyframes dropdown-in-bottom{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes dropdown-out-bottom{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-10px)}}@keyframes dropdown-in-top{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes dropdown-out-top{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(10px)}}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="*,*:before,*:after{box-sizing:border-box}:host{display:inline-block;position:relative}:host([block]){display:block;width:100%}.select{cursor:pointer}.select__selector{display:flex;align-items:center;height:var(--solely-height-md);padding:0 var(--solely-spacing-md);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);color:var(--solely-text-primary);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);transition:all var(--solely-transition-duration) var(--solely-transition-timing);box-sizing:border-box}.select__selector:hover:not(.is-disabled){border-color:var(--solely-primary-hover)}.select--sm .select__selector{height:var(--solely-height-sm);padding:0 var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.select--lg .select__selector{height:var(--solely-height-lg);padding:0 var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.select__value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select__placeholder{color:var(--solely-text-tertiary)}.select__arrow{margin-left:auto;font-size:12px;color:var(--solely-text-tertiary);transition:transform var(--solely-transition-duration);flex-shrink:0}.select.is-open .select__arrow{transform:rotate(180deg)}.select.is-disabled{cursor:not-allowed;opacity:var(--solely-disabled-opacity)}.select.is-focused .select__selector{border-color:var(--solely-primary);box-shadow:0 0 0 2px var(--solely-primary-light)}.select__clear{margin-left:var(--solely-spacing-xs);font-size:14px;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration)}.select__clear:hover{color:var(--solely-text-secondary)}.select__dropdown{position:absolute;left:0;
|
|
1
|
+
const o="*,*:before,*:after{box-sizing:border-box}:host{display:inline-block;position:relative}:host([block]){display:block;width:100%}.select{cursor:pointer}.select__selector{display:flex;align-items:center;height:var(--solely-height-md);padding:0 var(--solely-spacing-md);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);color:var(--solely-text-primary);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);transition:all var(--solely-transition-duration) var(--solely-transition-timing);box-sizing:border-box}.select__selector:hover:not(.is-disabled){border-color:var(--solely-primary-hover)}.select--sm .select__selector{height:var(--solely-height-sm);padding:0 var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.select--lg .select__selector{height:var(--solely-height-lg);padding:0 var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.select__value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select__placeholder{color:var(--solely-text-tertiary)}.select__arrow{margin-left:auto;font-size:12px;color:var(--solely-text-tertiary);transition:transform var(--solely-transition-duration);flex-shrink:0}.select.is-open .select__arrow{transform:rotate(180deg)}.select.is-disabled{cursor:not-allowed;opacity:var(--solely-disabled-opacity)}.select.is-focused .select__selector{border-color:var(--solely-primary);box-shadow:0 0 0 2px var(--solely-primary-light)}.select__clear{margin-left:var(--solely-spacing-xs);font-size:14px;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration)}.select__clear:hover{color:var(--solely-text-secondary)}.select__dropdown{position:absolute;left:0;width:auto;min-width:100%;max-height:400px;display:flex;flex-direction:column;background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);box-shadow:var(--solely-shadow-md);z-index:var(--solely-z-index-dropdown)}.select__dropdown-content{flex:1;overflow-y:auto;min-height:0}.select__dropdown--bottom{top:100%;margin-top:4px;animation:dropdown-in-bottom .2s ease-out}.select__dropdown--bottom.select__dropdown--closing{animation:dropdown-out-bottom .2s ease-in forwards}.select__dropdown--top{bottom:100%;margin-bottom:4px;animation:dropdown-in-top .2s ease-out}.select__dropdown--top.select__dropdown--closing{animation:dropdown-out-top .2s ease-in forwards}.select__option{padding:var(--solely-spacing-sm) var(--solely-spacing-md);cursor:pointer;transition:all var(--solely-transition-duration);color:var(--solely-text-primary);box-sizing:border-box;min-width:100%}.select__option:hover:not(.select__option--disabled){background-color:var(--solely-primary-light)}.select__option--selected{background-color:var(--solely-primary-light);color:var(--solely-primary);font-weight:500}.select__option--disabled{cursor:not-allowed;color:var(--solely-text-tertiary);opacity:var(--solely-disabled-opacity)}.select__option{display:flex;align-items:center;gap:8px}.select__option-icon{flex-shrink:0}.select__option-icon--img{width:20px;height:20px;object-fit:cover;border-radius:4px}.select__option-icon--class{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;font-size:16px}.select__option-label{flex:1;overflow:visible;text-overflow:clip;white-space:nowrap}.select__slot-options{display:flex;flex-direction:column;width:fit-content;min-width:100%}.select__slot-options ::slotted([data-value]),.select__slot-options>[data-value]{padding:var(--solely-spacing-sm) var(--solely-spacing-md);cursor:pointer;transition:all var(--solely-transition-duration);color:var(--solely-text-primary);display:flex;align-items:center;gap:8px;box-sizing:border-box}.select__slot-options ::slotted([data-value]:hover:not([disabled])),.select__slot-options>[data-value]:hover:not([disabled]){background-color:var(--solely-primary-light)}.select__slot-options ::slotted([data-value][data-selected]),.select__slot-options>[data-value][data-selected]{background-color:var(--solely-primary-light);color:var(--solely-primary);font-weight:500}.select__slot-options ::slotted([data-value][disabled]),.select__slot-options>[data-value][disabled]{cursor:not-allowed;color:var(--solely-text-tertiary);opacity:var(--solely-disabled-opacity)}.select__header,.select__footer{flex-shrink:0;color:var(--solely-text-secondary);font-size:var(--solely-font-size-sm);background-color:var(--solely-component-bg)}.select__group-label,.select__slot-options ::slotted([data-group]),.select__slot-options>[data-group]{padding:var(--solely-spacing-sm) var(--solely-spacing-md);color:var(--solely-text-secondary);font-size:var(--solely-font-size-sm);font-weight:600;cursor:default;background-color:transparent}.select__slot-options>[data-group]:not(:first-child){margin-top:var(--solely-spacing-sm)}.select__slot-options ::slotted([data-group]:hover),.select__slot-options>[data-group]:hover{background-color:transparent}.select__dropdown-content::-webkit-scrollbar{width:6px}.select__dropdown-content::-webkit-scrollbar-track{background:transparent}.select__dropdown-content::-webkit-scrollbar-thumb{background-color:var(--solely-border-color);border-radius:3px}.select__dropdown-content::-webkit-scrollbar-thumb:hover{background-color:var(--solely-text-tertiary)}.select__empty{padding:var(--solely-spacing-md);text-align:center;color:var(--solely-text-tertiary);font-size:var(--solely-font-size-sm)}@keyframes dropdown-in-bottom{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes dropdown-out-bottom{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-10px)}}@keyframes dropdown-in-top{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes dropdown-out-top{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(10px)}}";export{o as default};
|
|
@@ -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"),
|
|
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"),r=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelySkeleton=class extends a.default{getSkeletonClasses(){return{"is-active":!!this.$data.active}}getAvatarClasses(){const e={};return this.$data.avatarShape&&(e[`skeleton__avatar--${this.$data.avatarShape}`]=!0),e}getHeaderClasses(){return{"skeleton__header--right":"right"===this.$data.avatarPosition}}startLoading(){this.$data.loading=!0}finishLoading(){this.$data.loading=!1}setLoading(e){this.$data.loading=e}},exports.SolelySkeleton=((e,t)=>{for(var a,r=t,s=e.length-1;s>=0;s--)(a=e[s])&&(r=a(r)||r);return r})([r.CustomElement({tagName:"solely-skeleton",template:t.default,styles:e.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"active",type:"boolean",default:!1},{name:"avatar",type:"boolean",default:!1},{name:"avatarShape",type:"string",default:"circle"},{name:"avatarSize",type:"number",default:40},{name:"avatarPosition",type:"string",default:"left"},{name:"title",type:"boolean",default:!1},{name:"titleWidth",type:"string",default:""},{name:"paragraphRows",type:"number",default:3},{name:"loading",type:"boolean",default:!0}]})],exports.SolelySkeleton);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<div class="skeleton" :class="this.getSkeletonClasses()">\n \x3c!-- 加载中显示骨架屏 --\x3e\n <If test="$data.loading">\n <If test="$data.avatar || $data.title">\n \x3c!-- 有头像或标题时显示头部 --\x3e\n <div class="skeleton__header">\n <If test="$data.avatar">\n <div\n class="skeleton__element skeleton__avatar"\n :class="this.getAvatarClasses()"\n :style="\'width: \' + ($data.avatarSize || 40) + \'px; height: \' + ($data.avatarSize || 40) + \'px\'"\n ></div>\n </If>\n <div class="skeleton__content">\n <If test="$data.title">\n <div\n class="skeleton__element skeleton__title"\n :style="$data.titleWidth ? \'width: \' + (typeof $data.titleWidth === \'number\' ? $data.titleWidth + \'px\' : $data.titleWidth) : \'\'"\n ></div>\n </If>\n <If test="$data.paragraphRows > 0">\n <div class="skeleton__paragraph">\n <For each="Array.from({length: $data.paragraphRows})" item="i">\n <div class="skeleton__element skeleton__row"></div>\n </For>\n </div>\n </If>\n </div>\n </div>\n </If>\n <If test="!$data.avatar && !$data.title && $data.paragraphRows > 0">\n \x3c!-- 只有段落时显示段落 --\x3e\n <div class="skeleton__paragraph">\n <For each="Array.from({length: $data.paragraphRows})" item="i">\n <div class="skeleton__element skeleton__row"></div>\n </For>\n </div>\n </If>\n </If>\n\n \x3c!-- 加载完成显示真实内容 --\x3e\n <If test="!$data.loading">\n <div class="skeleton__real-content">\n <slot></slot>\n </div>\n </If>\n</div>\n';
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<div class="skeleton" :class="this.getSkeletonClasses()">\n \x3c!-- 加载中显示骨架屏 --\x3e\n <If test="$data.loading">\n <If test="$data.avatar || $data.title">\n \x3c!-- 有头像或标题时显示头部 --\x3e\n <div class="skeleton__header" :class="this.getHeaderClasses()">\n <If test="$data.avatar">\n <div\n class="skeleton__element skeleton__avatar"\n :class="this.getAvatarClasses()"\n :style="\'width: \' + ($data.avatarSize || 40) + \'px; height: \' + ($data.avatarSize || 40) + \'px\'"\n ></div>\n </If>\n <div class="skeleton__content">\n <If test="$data.title">\n <div\n class="skeleton__element skeleton__title"\n :style="$data.titleWidth ? \'width: \' + (typeof $data.titleWidth === \'number\' ? $data.titleWidth + \'px\' : $data.titleWidth) : \'\'"\n ></div>\n </If>\n <If test="$data.paragraphRows > 0">\n <div class="skeleton__paragraph">\n <For each="Array.from({length: $data.paragraphRows})" item="i">\n <div class="skeleton__element skeleton__row"></div>\n </For>\n </div>\n </If>\n </div>\n </div>\n </If>\n <If test="!$data.avatar && !$data.title && $data.paragraphRows > 0">\n \x3c!-- 只有段落时显示段落 --\x3e\n <div class="skeleton__paragraph">\n <For each="Array.from({length: $data.paragraphRows})" item="i">\n <div class="skeleton__element skeleton__row"></div>\n </For>\n </div>\n </If>\n </If>\n\n \x3c!-- 加载完成显示真实内容 --\x3e\n <If test="!$data.loading">\n <div class="skeleton__real-content">\n <slot></slot>\n </div>\n </If>\n</div>\n';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t='<div class="skeleton" :class="this.getSkeletonClasses()">\n \x3c!-- 加载中显示骨架屏 --\x3e\n <If test="$data.loading">\n <If test="$data.avatar || $data.title">\n \x3c!-- 有头像或标题时显示头部 --\x3e\n <div class="skeleton__header">\n <If test="$data.avatar">\n <div\n class="skeleton__element skeleton__avatar"\n :class="this.getAvatarClasses()"\n :style="\'width: \' + ($data.avatarSize || 40) + \'px; height: \' + ($data.avatarSize || 40) + \'px\'"\n ></div>\n </If>\n <div class="skeleton__content">\n <If test="$data.title">\n <div\n class="skeleton__element skeleton__title"\n :style="$data.titleWidth ? \'width: \' + (typeof $data.titleWidth === \'number\' ? $data.titleWidth + \'px\' : $data.titleWidth) : \'\'"\n ></div>\n </If>\n <If test="$data.paragraphRows > 0">\n <div class="skeleton__paragraph">\n <For each="Array.from({length: $data.paragraphRows})" item="i">\n <div class="skeleton__element skeleton__row"></div>\n </For>\n </div>\n </If>\n </div>\n </div>\n </If>\n <If test="!$data.avatar && !$data.title && $data.paragraphRows > 0">\n \x3c!-- 只有段落时显示段落 --\x3e\n <div class="skeleton__paragraph">\n <For each="Array.from({length: $data.paragraphRows})" item="i">\n <div class="skeleton__element skeleton__row"></div>\n </For>\n </div>\n </If>\n </If>\n\n \x3c!-- 加载完成显示真实内容 --\x3e\n <If test="!$data.loading">\n <div class="skeleton__real-content">\n <slot></slot>\n </div>\n </If>\n</div>\n';export{t as default};
|
|
1
|
+
const t='<div class="skeleton" :class="this.getSkeletonClasses()">\n \x3c!-- 加载中显示骨架屏 --\x3e\n <If test="$data.loading">\n <If test="$data.avatar || $data.title">\n \x3c!-- 有头像或标题时显示头部 --\x3e\n <div class="skeleton__header" :class="this.getHeaderClasses()">\n <If test="$data.avatar">\n <div\n class="skeleton__element skeleton__avatar"\n :class="this.getAvatarClasses()"\n :style="\'width: \' + ($data.avatarSize || 40) + \'px; height: \' + ($data.avatarSize || 40) + \'px\'"\n ></div>\n </If>\n <div class="skeleton__content">\n <If test="$data.title">\n <div\n class="skeleton__element skeleton__title"\n :style="$data.titleWidth ? \'width: \' + (typeof $data.titleWidth === \'number\' ? $data.titleWidth + \'px\' : $data.titleWidth) : \'\'"\n ></div>\n </If>\n <If test="$data.paragraphRows > 0">\n <div class="skeleton__paragraph">\n <For each="Array.from({length: $data.paragraphRows})" item="i">\n <div class="skeleton__element skeleton__row"></div>\n </For>\n </div>\n </If>\n </div>\n </div>\n </If>\n <If test="!$data.avatar && !$data.title && $data.paragraphRows > 0">\n \x3c!-- 只有段落时显示段落 --\x3e\n <div class="skeleton__paragraph">\n <For each="Array.from({length: $data.paragraphRows})" item="i">\n <div class="skeleton__element skeleton__row"></div>\n </For>\n </div>\n </If>\n </If>\n\n \x3c!-- 加载完成显示真实内容 --\x3e\n <If test="!$data.loading">\n <div class="skeleton__real-content">\n <slot></slot>\n </div>\n </If>\n</div>\n';export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"./style.css.js";import e from"./index.html.js";import a from"../../../runtime/component/base-element.js";import{CustomElement as r}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let n=class extends a{getSkeletonClasses(){return{"is-active":!!this.$data.active}}getAvatarClasses(){const t={};return this.$data.avatarShape&&(t[`skeleton__avatar--${this.$data.avatarShape}`]=!0),t}getHeaderClasses(){return{"skeleton__header--right":"right"===this.$data.avatarPosition}}startLoading(){this.$data.loading=!0}finishLoading(){this.$data.loading=!1}setLoading(t){this.$data.loading=t}};n=((t,e)=>{for(var a,r=e,n=t.length-1;n>=0;n--)(a=t[n])&&(r=a(r)||r);return r})([r({tagName:"solely-skeleton",template:e,styles:t,shadowDOM:{use:!0,mode:"open"},props:[{name:"active",type:"boolean",default:!1},{name:"avatar",type:"boolean",default:!1},{name:"avatarShape",type:"string",default:"circle"},{name:"avatarSize",type:"number",default:40},{name:"avatarPosition",type:"string",default:"left"},{name:"title",type:"boolean",default:!1},{name:"titleWidth",type:"string",default:""},{name:"paragraphRows",type:"number",default:3},{name:"loading",type:"boolean",default:!0}]})],n);export{n as SolelySkeleton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default="*,*:before,*:after{box-sizing:border-box}:host{display:block;width:100%}.skeleton{width:100%;font-family:var(--solely-font-family)}.skeleton__header{display:flex;align-items:flex-start;gap:var(--solely-spacing-md);margin-bottom:var(--solely-spacing-md)}.skeleton__content{flex:1}.skeleton__element{background-color:var(--solely-fill-color);border-radius:var(--solely-border-radius-sm)}.skeleton.is-active .skeleton__element{background:linear-gradient(90deg,var(--solely-fill-color) 25%,var(--solely-fill-color-light) 37%,var(--solely-fill-color) 63%);background-size:400% 100%;animation:skeleton-loading 1.4s ease infinite}@keyframes skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.skeleton__avatar{flex-shrink:0}.skeleton__avatar--circle{border-radius:50%}.skeleton__avatar--square{border-radius:var(--solely-border-radius-md)}.skeleton__title{width:100%;height:16px;margin-bottom:var(--solely-spacing-sm)}.skeleton__paragraph{display:flex;flex-direction:column;gap:var(--solely-spacing-sm)}.skeleton__row{width:100%;height:14px}.skeleton__paragraph .skeleton__row:not(:only-child):last-child{width:60%}.skeleton__real-content{animation:skeleton-fade-in .4s ease-out}@keyframes skeleton-fade-in{0%{opacity:0}to{opacity:1}}";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default="*,*:before,*:after{box-sizing:border-box}:host{display:block;width:100%}.skeleton{width:100%;font-family:var(--solely-font-family)}.skeleton__header{display:flex;align-items:flex-start;gap:var(--solely-spacing-md);margin-bottom:var(--solely-spacing-md)}.skeleton__header--right{flex-direction:row-reverse}.skeleton__content{flex:1}.skeleton__element{background-color:var(--solely-fill-color);border-radius:var(--solely-border-radius-sm)}.skeleton.is-active .skeleton__element{background:linear-gradient(90deg,var(--solely-fill-color) 25%,var(--solely-fill-color-light) 37%,var(--solely-fill-color) 63%);background-size:400% 100%;animation:skeleton-loading 1.4s ease infinite}@keyframes skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.skeleton__avatar{flex-shrink:0}.skeleton__avatar--circle{border-radius:50%}.skeleton__avatar--square{border-radius:var(--solely-border-radius-md)}.skeleton__title{width:100%;height:16px;margin-bottom:var(--solely-spacing-sm)}.skeleton__paragraph{display:flex;flex-direction:column;gap:var(--solely-spacing-sm)}.skeleton__row{width:100%;height:14px}.skeleton__paragraph .skeleton__row:not(:only-child):last-child{width:60%}.skeleton__real-content{animation:skeleton-fade-in .4s ease-out}@keyframes skeleton-fade-in{0%{opacity:0}to{opacity:1}}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="*,*:before,*:after{box-sizing:border-box}:host{display:block;width:100%}.skeleton{width:100%;font-family:var(--solely-font-family)}.skeleton__header{display:flex;align-items:flex-start;gap:var(--solely-spacing-md);margin-bottom:var(--solely-spacing-md)}.skeleton__content{flex:1}.skeleton__element{background-color:var(--solely-fill-color);border-radius:var(--solely-border-radius-sm)}.skeleton.is-active .skeleton__element{background:linear-gradient(90deg,var(--solely-fill-color) 25%,var(--solely-fill-color-light) 37%,var(--solely-fill-color) 63%);background-size:400% 100%;animation:skeleton-loading 1.4s ease infinite}@keyframes skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.skeleton__avatar{flex-shrink:0}.skeleton__avatar--circle{border-radius:50%}.skeleton__avatar--square{border-radius:var(--solely-border-radius-md)}.skeleton__title{width:100%;height:16px;margin-bottom:var(--solely-spacing-sm)}.skeleton__paragraph{display:flex;flex-direction:column;gap:var(--solely-spacing-sm)}.skeleton__row{width:100%;height:14px}.skeleton__paragraph .skeleton__row:not(:only-child):last-child{width:60%}.skeleton__real-content{animation:skeleton-fade-in .4s ease-out}@keyframes skeleton-fade-in{0%{opacity:0}to{opacity:1}}";export{e as default};
|
|
1
|
+
const e="*,*:before,*:after{box-sizing:border-box}:host{display:block;width:100%}.skeleton{width:100%;font-family:var(--solely-font-family)}.skeleton__header{display:flex;align-items:flex-start;gap:var(--solely-spacing-md);margin-bottom:var(--solely-spacing-md)}.skeleton__header--right{flex-direction:row-reverse}.skeleton__content{flex:1}.skeleton__element{background-color:var(--solely-fill-color);border-radius:var(--solely-border-radius-sm)}.skeleton.is-active .skeleton__element{background:linear-gradient(90deg,var(--solely-fill-color) 25%,var(--solely-fill-color-light) 37%,var(--solely-fill-color) 63%);background-size:400% 100%;animation:skeleton-loading 1.4s ease infinite}@keyframes skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.skeleton__avatar{flex-shrink:0}.skeleton__avatar--circle{border-radius:50%}.skeleton__avatar--square{border-radius:var(--solely-border-radius-md)}.skeleton__title{width:100%;height:16px;margin-bottom:var(--solely-spacing-sm)}.skeleton__paragraph{display:flex;flex-direction:column;gap:var(--solely-spacing-sm)}.skeleton__row{width:100%;height:14px}.skeleton__paragraph .skeleton__row:not(:only-child):last-child{width:60%}.skeleton__real-content{animation:skeleton-fade-in .4s ease-out}@keyframes skeleton-fade-in{0%{opacity:0}to{opacity:1}}";export{e as default};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Skeleton 组件类型定义
|
|
3
3
|
*/
|
|
4
4
|
export type SkeletonAvatarShape = 'circle' | 'square';
|
|
5
|
+
export type SkeletonAvatarPosition = 'left' | 'right';
|
|
5
6
|
export type SkeletonElement = 'avatar' | 'title' | 'paragraph' | 'button' | 'input' | 'image';
|
|
6
7
|
export interface SkeletonProps {
|
|
7
8
|
/** 是否显示动画效果 */
|
|
@@ -12,6 +13,8 @@ export interface SkeletonProps {
|
|
|
12
13
|
avatarShape: SkeletonAvatarShape;
|
|
13
14
|
/** 头像大小 */
|
|
14
15
|
avatarSize: number;
|
|
16
|
+
/** 头像位置 */
|
|
17
|
+
avatarPosition: SkeletonAvatarPosition;
|
|
15
18
|
/** 是否显示标题占位图 */
|
|
16
19
|
title: boolean;
|
|
17
20
|
/** 标题宽度 */
|
package/package.json
CHANGED