solely 0.4.19 → 0.4.21

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.
@@ -1,8 +1,5 @@
1
- /**
2
- * Tooltip 组件类型定义
3
- */
4
- export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
5
- export type TooltipTrigger = 'hover' | 'click' | 'focus' | 'manual';
1
+ import { TooltipPlacement, TooltipTrigger } from '../../tooltip-types';
2
+ export type { TooltipPlacement, TooltipTrigger };
6
3
  export interface TooltipOptions {
7
4
  /** 提示内容 */
8
5
  content?: string | HTMLElement;
@@ -1 +1 @@
1
- "use strict";var t=Object.defineProperty,e=(e,s,a)=>((e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a)(e,"symbol"!=typeof s?s+"":s,a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./style.css.cjs"),a=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"),e(this,"closeTimer")}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,s=t.top;this.$data.dropdownPlacement=e<256&&s>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 s=t;return{value:s.getAttribute("data-value")||"",label:s.getAttribute("data-label")||(null==(e=s.textContent)?void 0:e.trim())||"",disabled:s.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.refresh(),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(),this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=void 0)}updated(){const t=this.$data.selectedLabel,e=this.getCurrentLabel();t!==e&&(this.$data.selectedLabel=e),this.updateAriaAttributes()}updateAriaAttributes(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector(".select__trigger");e&&(e.setAttribute("aria-expanded",this.$data.isOpen?"true":"false"),e.setAttribute("aria-disabled",this.$data.disabled?"true":"false"))}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 s=t.target.closest("[data-value]");if(!s)return;if(s.hasAttribute("data-group"))return void t.stopPropagation();const a=s.getAttribute("data-value")||"",l=s.getAttribute("data-label")||(null==(e=s.textContent)?void 0:e.trim())||"";s.hasAttribute("disabled")||(this.$data.value=a,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,this.closeTimer=setTimeout(()=>{this.$data.isOpen=!1,this.$data.closing=!1,this.$data.focused=!1,this.closeTimer=void 0},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 s,a=e,l=t.length-1;l>=0;l--)(s=t[l])&&(a=s(a)||a);return a})([i.CustomElement({tagName:"solely-select",template:a.__SOLELY_IR__,styles:s.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);
1
+ "use strict";var t=Object.defineProperty,e=(e,s,a)=>((e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a)(e,"symbol"!=typeof s?s+"":s,a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./style.css.cjs"),a=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"),e(this,"closeTimer")}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,s=t.top;this.$data.dropdownPlacement=e<256&&s>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 s=t;return{value:s.getAttribute("data-value")||"",label:s.getAttribute("data-label")||(null==(e=s.textContent)?void 0:e.trim())||"",disabled:s.hasAttribute("disabled"),element:t}}),this.syncSelectedLabel()):this.$data.useSlot=!1}mounted(){this.collectSlotOptions(),this.$data.useSlot||this.parseOptions(),this.setupSlotObserver(),this.clickOutsideHandler=t=>{t.composedPath().some(t=>t===this)||this.closeDropdown()},document.addEventListener("click",this.clickOutsideHandler)}setupSlotObserver(){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(),this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=void 0)}updated(){const t=this.$data.selectedLabel,e=this.getCurrentLabel();t!==e&&(this.$data.selectedLabel=e),this.updateAriaAttributes()}updateAriaAttributes(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector(".select__trigger");e&&(e.setAttribute("aria-expanded",this.$data.isOpen?"true":"false"),e.setAttribute("aria-disabled",this.$data.disabled?"true":"false"))}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.syncSelectedLabel()}syncSelectedLabel(){var t,e;if(this.$data.useSlot){const e=null==(t=this.$data.slotOptions)?void 0:t.find(t=>t.value===this.$data.value);this.$data.selectedLabel=(null==e?void 0:e.label)||""}else{const t=null==(e=this.$data.parsedOptions)?void 0:e.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.syncSelectedLabel(),this.closeDropdown(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}handleSlotClick(t){var e;const s=t.target.closest("[data-value]");if(!s)return;if(s.hasAttribute("data-group"))return void t.stopPropagation();const a=s.getAttribute("data-value")||"",l=s.getAttribute("data-label")||(null==(e=s.textContent)?void 0:e.trim())||"";s.hasAttribute("disabled")||(this.$data.value=a,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,this.closeTimer=setTimeout(()=>{this.$data.isOpen=!1,this.$data.closing=!1,this.$data.focused=!1,this.closeTimer=void 0},200))}setValue(t,e=!1){this.$data.value=t,this.syncSelectedLabel(),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 s,a=e,l=t.length-1;l>=0;l--)(s=t[l])&&(a=s(a)||a);return a})([i.CustomElement({tagName:"solely-select",template:a.__SOLELY_IR__,styles:s.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);
@@ -49,10 +49,6 @@ declare class SolelySelect extends BaseElement<SelectProps & {
49
49
  * 从插槽收集选项
50
50
  */
51
51
  collectSlotOptions(): void;
52
- /**
53
- * 从插槽更新选中的标签
54
- */
55
- updateSelectedLabelFromSlot(): void;
56
52
  mounted(): void;
57
53
  /**
58
54
  * 设置插槽观察器
@@ -76,7 +72,7 @@ declare class SolelySelect extends BaseElement<SelectProps & {
76
72
  /**
77
73
  * 更新选中的标签
78
74
  */
79
- updateSelectedLabel(): void;
75
+ syncSelectedLabel(): void;
80
76
  /**
81
77
  * 点击事件处理
82
78
  */
@@ -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{__SOLELY_IR__ as s}from"./index.html.js";import i from"../../../runtime/component/base-element.js";import{CustomElement as l}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let o=class extends i{constructor(){super(...arguments),e(this,"clickOutsideHandler"),e(this,"slotObserver"),e(this,"closeTimer")}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.refresh(),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(),this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=void 0)}updated(){const t=this.$data.selectedLabel,e=this.getCurrentLabel();t!==e&&(this.$data.selectedLabel=e),this.updateAriaAttributes()}updateAriaAttributes(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector(".select__trigger");e&&(e.setAttribute("aria-expanded",this.$data.isOpen?"true":"false"),e.setAttribute("aria-disabled",this.$data.disabled?"true":"false"))}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")||"",i=a.getAttribute("data-label")||(null==(e=a.textContent)?void 0:e.trim())||"";a.hasAttribute("disabled")||(this.$data.value=s,this.$data.selectedLabel=i,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,this.closeTimer=setTimeout(()=>{this.$data.isOpen=!1,this.$data.closing=!1,this.$data.focused=!1,this.closeTimer=void 0},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,i=t.length-1;i>=0;i--)(a=t[i])&&(s=a(s)||s);return s})([l({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
+ var t=Object.defineProperty,e=(e,s,a)=>((e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a)(e,"symbol"!=typeof s?s+"":s,a);import s from"./style.css.js";import{__SOLELY_IR__ as a}from"./index.html.js";import i from"../../../runtime/component/base-element.js";import{CustomElement as l}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let o=class extends i{constructor(){super(...arguments),e(this,"clickOutsideHandler"),e(this,"slotObserver"),e(this,"closeTimer")}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,s=t.top;this.$data.dropdownPlacement=e<256&&s>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 s=t;return{value:s.getAttribute("data-value")||"",label:s.getAttribute("data-label")||(null==(e=s.textContent)?void 0:e.trim())||"",disabled:s.hasAttribute("disabled"),element:t}}),this.syncSelectedLabel()):this.$data.useSlot=!1}mounted(){this.collectSlotOptions(),this.$data.useSlot||this.parseOptions(),this.setupSlotObserver(),this.clickOutsideHandler=t=>{t.composedPath().some(t=>t===this)||this.closeDropdown()},document.addEventListener("click",this.clickOutsideHandler)}setupSlotObserver(){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(),this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=void 0)}updated(){const t=this.$data.selectedLabel,e=this.getCurrentLabel();t!==e&&(this.$data.selectedLabel=e),this.updateAriaAttributes()}updateAriaAttributes(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector(".select__trigger");e&&(e.setAttribute("aria-expanded",this.$data.isOpen?"true":"false"),e.setAttribute("aria-disabled",this.$data.disabled?"true":"false"))}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.syncSelectedLabel()}syncSelectedLabel(){var t,e;if(this.$data.useSlot){const e=null==(t=this.$data.slotOptions)?void 0:t.find(t=>t.value===this.$data.value);this.$data.selectedLabel=(null==e?void 0:e.label)||""}else{const t=null==(e=this.$data.parsedOptions)?void 0:e.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.syncSelectedLabel(),this.closeDropdown(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}handleSlotClick(t){var e;const s=t.target.closest("[data-value]");if(!s)return;if(s.hasAttribute("data-group"))return void t.stopPropagation();const a=s.getAttribute("data-value")||"",i=s.getAttribute("data-label")||(null==(e=s.textContent)?void 0:e.trim())||"";s.hasAttribute("disabled")||(this.$data.value=a,this.$data.selectedLabel=i,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,this.closeTimer=setTimeout(()=>{this.$data.isOpen=!1,this.$data.closing=!1,this.$data.focused=!1,this.closeTimer=void 0},200))}setValue(t,e=!1){this.$data.value=t,this.syncSelectedLabel(),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 s,a=e,i=t.length-1;i>=0;i--)(s=t[i])&&(a=s(a)||a);return a})([l({tagName:"solely-select",template:a,styles:s,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";var e=Object.defineProperty,t=(t,i,s)=>((t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s)(t,"symbol"!=typeof i?i+"":i,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./style.css.cjs"),s=require("./index.html.cjs"),o=require("../../../runtime/component/base-element.cjs"),n=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyTooltip=class extends o.default{constructor(){super(...arguments),t(this,"_clickOutsideHandler"),t(this,"_boundFocusHandler"),t(this,"_boundBlurHandler"),t(this,"_boundFocusable")}getTooltipClasses(){return{[`tooltip--${this.$data.placement}`]:!0,"is-visible":this.$data.visible}}show(){this.$data.visible||(this.$data.visible=!0,this.emit("show"))}hide(){this.$data.visible&&(this.$data.visible=!1,this.emit("hide"))}handleMouseEnter(e){"hover"===this.$data.trigger&&(e.stopPropagation(),this.show())}handleMouseLeave(e){"hover"===this.$data.trigger&&(e.stopPropagation(),this.hide())}handleFocus(e){"focus"===this.$data.trigger&&(e.stopPropagation(),this.show())}handleBlur(e){"focus"===this.$data.trigger&&(e.stopPropagation(),this.hide())}bindSlotEvents(){var e;if("focus"!==this.$data.trigger)return;const t=null==(e=this.shadowRoot)?void 0:e.querySelector("slot");t&&(this.unbindSlotEvents(),t.assignedElements().forEach(e=>{const t=e.querySelector("input, textarea, select, button, a, [tabindex]")||e;t&&(this._boundFocusHandler=this.handleFocus.bind(this),this._boundBlurHandler=this.handleBlur.bind(this),this._boundFocusable=t,t.addEventListener("focus",this._boundFocusHandler),t.addEventListener("blur",this._boundBlurHandler))}))}unbindSlotEvents(){this._boundFocusable&&(this._boundFocusHandler&&this._boundFocusable.removeEventListener("focus",this._boundFocusHandler),this._boundBlurHandler&&this._boundFocusable.removeEventListener("blur",this._boundBlurHandler),this._boundFocusable=void 0,this._boundFocusHandler=void 0,this._boundBlurHandler=void 0)}handleClick(e){"click"===this.$data.trigger&&(e.stopPropagation(),this.$data.visible?(this.hide(),this.unbindClickOutside()):(this.show(),this.bindClickOutside()))}bindClickOutside(){this._clickOutsideHandler||(this._clickOutsideHandler=e=>{e.composedPath().includes(this)||(this.hide(),this.unbindClickOutside())},document.addEventListener("click",this._clickOutsideHandler))}unbindClickOutside(){this._clickOutsideHandler&&(document.removeEventListener("click",this._clickOutsideHandler),this._clickOutsideHandler=void 0)}mounted(){this.refresh(),this.bindSlotEvents()}unmounted(){this.unbindClickOutside(),this.unbindSlotEvents()}},exports.SolelyTooltip=((e,t)=>{for(var i,s=t,o=e.length-1;o>=0;o--)(i=e[o])&&(s=i(s)||s);return s})([n.CustomElement({tagName:"solely-tooltip",template:s.__SOLELY_IR__,styles:i.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"content",type:"string",default:""},{name:"placement",type:"string",default:"top"},{name:"trigger",type:"string",default:"hover"},{name:"visible",type:"boolean",default:!1},{name:"color",type:"string",default:""},{name:"maxWidth",type:"number",default:250}]})],exports.SolelyTooltip);
1
+ "use strict";var t=Object.defineProperty,e=(e,i,s)=>((e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s)(e,"symbol"!=typeof i?i+"":i,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./style.css.cjs"),s=require("./index.html.cjs"),n=require("../../../runtime/component/base-element.cjs"),o=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyTooltip=class extends n.default{constructor(){super(...arguments),e(this,"_clickOutsideHandler"),e(this,"_boundFocusHandler"),e(this,"_boundBlurHandler"),e(this,"_boundFocusable")}getTooltipClasses(){return{[`tooltip--${this.$data.placement}`]:!0,"is-visible":this.$data.visible}}show(){this.$data.visible||(this.$data.visible=!0,this.emit("show"))}hide(){this.$data.visible&&(this.$data.visible=!1,this.emit("hide"))}handleMouseEnter(t){"hover"===this.$data.trigger&&(t.stopPropagation(),this.show())}handleMouseLeave(t){"hover"===this.$data.trigger&&(t.stopPropagation(),this.hide())}handleFocus(t){"focus"===this.$data.trigger&&(t.stopPropagation(),this.show())}handleBlur(t){"focus"===this.$data.trigger&&(t.stopPropagation(),this.hide())}bindSlotEvents(){var t;if("manual"===this.$data.trigger)return;if("focus"!==this.$data.trigger)return;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("slot");e&&(this.unbindSlotEvents(),e.assignedElements().forEach(t=>{const e=t.querySelector("input, textarea, select, button, a, [tabindex]")||t;e&&(this._boundFocusHandler=this.handleFocus.bind(this),this._boundBlurHandler=this.handleBlur.bind(this),this._boundFocusable=e,e.addEventListener("focus",this._boundFocusHandler),e.addEventListener("blur",this._boundBlurHandler))}))}unbindSlotEvents(){this._boundFocusable&&(this._boundFocusHandler&&this._boundFocusable.removeEventListener("focus",this._boundFocusHandler),this._boundBlurHandler&&this._boundFocusable.removeEventListener("blur",this._boundBlurHandler),this._boundFocusable=void 0,this._boundFocusHandler=void 0,this._boundBlurHandler=void 0)}handleClick(t){"manual"!==this.$data.trigger&&"click"===this.$data.trigger&&(t.stopPropagation(),this.$data.visible?(this.hide(),this.unbindClickOutside()):(this.show(),this.bindClickOutside()))}bindClickOutside(){this._clickOutsideHandler||(this._clickOutsideHandler=t=>{t.composedPath().includes(this)||(this.hide(),this.unbindClickOutside())},document.addEventListener("click",this._clickOutsideHandler))}unbindClickOutside(){this._clickOutsideHandler&&(document.removeEventListener("click",this._clickOutsideHandler),this._clickOutsideHandler=void 0)}mounted(){this.refresh(),this.bindSlotEvents()}unmounted(){this.unbindClickOutside(),this.unbindSlotEvents()}},exports.SolelyTooltip=((t,e)=>{for(var i,s=e,n=t.length-1;n>=0;n--)(i=t[n])&&(s=i(s)||s);return s})([o.CustomElement({tagName:"solely-tooltip",template:s.__SOLELY_IR__,styles:i.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"content",type:"string",default:""},{name:"placement",type:"string",default:"top"},{name:"trigger",type:"string",default:"hover"},{name:"visible",type:"boolean",default:!1},{name:"color",type:"string",default:""},{name:"maxWidth",type:"number",default:250}]})],exports.SolelyTooltip);
@@ -1 +1 @@
1
- var t=Object.defineProperty,e=(e,i,s)=>((e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s)(e,"symbol"!=typeof i?i+"":i,s);import i from"./style.css.js";import{__SOLELY_IR__ as s}from"./index.html.js";import n from"../../../runtime/component/base-element.js";import{CustomElement as o}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let d=class extends n{constructor(){super(...arguments),e(this,"_clickOutsideHandler"),e(this,"_boundFocusHandler"),e(this,"_boundBlurHandler"),e(this,"_boundFocusable")}getTooltipClasses(){return{[`tooltip--${this.$data.placement}`]:!0,"is-visible":this.$data.visible}}show(){this.$data.visible||(this.$data.visible=!0,this.emit("show"))}hide(){this.$data.visible&&(this.$data.visible=!1,this.emit("hide"))}handleMouseEnter(t){"hover"===this.$data.trigger&&(t.stopPropagation(),this.show())}handleMouseLeave(t){"hover"===this.$data.trigger&&(t.stopPropagation(),this.hide())}handleFocus(t){"focus"===this.$data.trigger&&(t.stopPropagation(),this.show())}handleBlur(t){"focus"===this.$data.trigger&&(t.stopPropagation(),this.hide())}bindSlotEvents(){var t;if("focus"!==this.$data.trigger)return;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("slot");e&&(this.unbindSlotEvents(),e.assignedElements().forEach(t=>{const e=t.querySelector("input, textarea, select, button, a, [tabindex]")||t;e&&(this._boundFocusHandler=this.handleFocus.bind(this),this._boundBlurHandler=this.handleBlur.bind(this),this._boundFocusable=e,e.addEventListener("focus",this._boundFocusHandler),e.addEventListener("blur",this._boundBlurHandler))}))}unbindSlotEvents(){this._boundFocusable&&(this._boundFocusHandler&&this._boundFocusable.removeEventListener("focus",this._boundFocusHandler),this._boundBlurHandler&&this._boundFocusable.removeEventListener("blur",this._boundBlurHandler),this._boundFocusable=void 0,this._boundFocusHandler=void 0,this._boundBlurHandler=void 0)}handleClick(t){"click"===this.$data.trigger&&(t.stopPropagation(),this.$data.visible?(this.hide(),this.unbindClickOutside()):(this.show(),this.bindClickOutside()))}bindClickOutside(){this._clickOutsideHandler||(this._clickOutsideHandler=t=>{t.composedPath().includes(this)||(this.hide(),this.unbindClickOutside())},document.addEventListener("click",this._clickOutsideHandler))}unbindClickOutside(){this._clickOutsideHandler&&(document.removeEventListener("click",this._clickOutsideHandler),this._clickOutsideHandler=void 0)}mounted(){this.refresh(),this.bindSlotEvents()}unmounted(){this.unbindClickOutside(),this.unbindSlotEvents()}};d=((t,e)=>{for(var i,s=e,n=t.length-1;n>=0;n--)(i=t[n])&&(s=i(s)||s);return s})([o({tagName:"solely-tooltip",template:s,styles:i,shadowDOM:{use:!0,mode:"open"},props:[{name:"content",type:"string",default:""},{name:"placement",type:"string",default:"top"},{name:"trigger",type:"string",default:"hover"},{name:"visible",type:"boolean",default:!1},{name:"color",type:"string",default:""},{name:"maxWidth",type:"number",default:250}]})],d);export{d as SolelyTooltip};
1
+ var t=Object.defineProperty,e=(e,i,s)=>((e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s)(e,"symbol"!=typeof i?i+"":i,s);import i from"./style.css.js";import{__SOLELY_IR__ as s}from"./index.html.js";import n from"../../../runtime/component/base-element.js";import{CustomElement as o}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let d=class extends n{constructor(){super(...arguments),e(this,"_clickOutsideHandler"),e(this,"_boundFocusHandler"),e(this,"_boundBlurHandler"),e(this,"_boundFocusable")}getTooltipClasses(){return{[`tooltip--${this.$data.placement}`]:!0,"is-visible":this.$data.visible}}show(){this.$data.visible||(this.$data.visible=!0,this.emit("show"))}hide(){this.$data.visible&&(this.$data.visible=!1,this.emit("hide"))}handleMouseEnter(t){"hover"===this.$data.trigger&&(t.stopPropagation(),this.show())}handleMouseLeave(t){"hover"===this.$data.trigger&&(t.stopPropagation(),this.hide())}handleFocus(t){"focus"===this.$data.trigger&&(t.stopPropagation(),this.show())}handleBlur(t){"focus"===this.$data.trigger&&(t.stopPropagation(),this.hide())}bindSlotEvents(){var t;if("manual"===this.$data.trigger)return;if("focus"!==this.$data.trigger)return;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("slot");e&&(this.unbindSlotEvents(),e.assignedElements().forEach(t=>{const e=t.querySelector("input, textarea, select, button, a, [tabindex]")||t;e&&(this._boundFocusHandler=this.handleFocus.bind(this),this._boundBlurHandler=this.handleBlur.bind(this),this._boundFocusable=e,e.addEventListener("focus",this._boundFocusHandler),e.addEventListener("blur",this._boundBlurHandler))}))}unbindSlotEvents(){this._boundFocusable&&(this._boundFocusHandler&&this._boundFocusable.removeEventListener("focus",this._boundFocusHandler),this._boundBlurHandler&&this._boundFocusable.removeEventListener("blur",this._boundBlurHandler),this._boundFocusable=void 0,this._boundFocusHandler=void 0,this._boundBlurHandler=void 0)}handleClick(t){"manual"!==this.$data.trigger&&"click"===this.$data.trigger&&(t.stopPropagation(),this.$data.visible?(this.hide(),this.unbindClickOutside()):(this.show(),this.bindClickOutside()))}bindClickOutside(){this._clickOutsideHandler||(this._clickOutsideHandler=t=>{t.composedPath().includes(this)||(this.hide(),this.unbindClickOutside())},document.addEventListener("click",this._clickOutsideHandler))}unbindClickOutside(){this._clickOutsideHandler&&(document.removeEventListener("click",this._clickOutsideHandler),this._clickOutsideHandler=void 0)}mounted(){this.refresh(),this.bindSlotEvents()}unmounted(){this.unbindClickOutside(),this.unbindSlotEvents()}};d=((t,e)=>{for(var i,s=e,n=t.length-1;n>=0;n--)(i=t[n])&&(s=i(s)||s);return s})([o({tagName:"solely-tooltip",template:s,styles:i,shadowDOM:{use:!0,mode:"open"},props:[{name:"content",type:"string",default:""},{name:"placement",type:"string",default:"top"},{name:"trigger",type:"string",default:"hover"},{name:"visible",type:"boolean",default:!1},{name:"color",type:"string",default:""},{name:"maxWidth",type:"number",default:250}]})],d);export{d as SolelyTooltip};
@@ -1,8 +1,5 @@
1
- /**
2
- * Tooltip 组件类型定义
3
- */
4
- export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
5
- export type TooltipTrigger = 'hover' | 'click' | 'focus';
1
+ import { TooltipPlacement, TooltipTrigger } from '../../tooltip-types';
2
+ export type { TooltipPlacement, TooltipTrigger };
6
3
  export interface TooltipProps {
7
4
  /** 提示内容 */
8
5
  content: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./theme/index.cjs"),r=require("./elements/button/index.cjs"),t=require("./elements/icon/index.cjs"),o=require("./elements/input/index.cjs"),l=require("./elements/fab/index.cjs"),n=require("./elements/card/index.cjs"),s=require("./elements/tag/index.cjs"),i=require("./elements/badge/index.cjs"),p=require("./elements/alert/index.cjs"),c=require("./elements/switch/index.cjs"),d=require("./elements/checkbox/index.cjs"),m=require("./elements/radio/index.cjs"),y=require("./elements/select/index.cjs"),a=require("./elements/progress/index.cjs"),u=require("./elements/divider/index.cjs"),x=require("./elements/tabs/index.cjs"),b=require("./elements/table/index.cjs"),S=require("./elements/skeleton/index.cjs"),j=require("./elements/empty/index.cjs"),g=require("./elements/pagination/index.cjs"),P=require("./elements/breadcrumb/index.cjs"),f=require("./elements/steps/index.cjs"),q=require("./elements/timeline/index.cjs"),O=require("./elements/backtop/index.cjs"),T=require("./elements/upload/index.cjs"),h=require("./elements/rate/index.cjs"),I=require("./elements/slider/index.cjs"),k=require("./elements/tree/index.cjs"),B=require("./elements/coordinate-input/index.cjs"),w=require("./elements/tooltip/index.cjs"),C=require("./elements/not-found/index.cjs"),R=require("./commands/message/index.cjs"),M=require("./commands/modal/index.cjs"),v=require("./commands/tooltip/index.cjs"),D=require("./commands/drawer/index.cjs"),F=require("./commands/popconfirm/index.cjs");exports.getTheme=e.getTheme,exports.initTheme=e.initTheme,exports.persistTheme=e.persistTheme,exports.setTheme=e.setTheme,exports.toggleTheme=e.toggleTheme,Object.defineProperty(exports,"SolelyButton",{enumerable:!0,get:()=>r.SolelyButton}),Object.defineProperty(exports,"SolelyIcon",{enumerable:!0,get:()=>t.SolelyIcon}),exports.getIcon=t.getIcon,exports.getRegisteredIcons=t.getRegisteredIcons,exports.hasIcon=t.hasIcon,exports.registerIcon=t.registerIcon,exports.registerIcons=t.registerIcons,Object.defineProperty(exports,"SolelyInput",{enumerable:!0,get:()=>o.SolelyInput}),Object.defineProperty(exports,"SolelyFab",{enumerable:!0,get:()=>l.SolelyFab}),Object.defineProperty(exports,"SolelyCard",{enumerable:!0,get:()=>n.SolelyCard}),Object.defineProperty(exports,"SolelyTag",{enumerable:!0,get:()=>s.SolelyTag}),Object.defineProperty(exports,"SolelyBadge",{enumerable:!0,get:()=>i.SolelyBadge}),Object.defineProperty(exports,"SolelyAlert",{enumerable:!0,get:()=>p.SolelyAlert}),Object.defineProperty(exports,"SolelySwitch",{enumerable:!0,get:()=>c.SolelySwitch}),Object.defineProperty(exports,"SolelyCheckbox",{enumerable:!0,get:()=>d.SolelyCheckbox}),Object.defineProperty(exports,"SolelyRadio",{enumerable:!0,get:()=>m.SolelyRadio}),Object.defineProperty(exports,"SolelySelect",{enumerable:!0,get:()=>y.SolelySelect}),Object.defineProperty(exports,"SolelyProgress",{enumerable:!0,get:()=>a.SolelyProgress}),Object.defineProperty(exports,"SolelyDivider",{enumerable:!0,get:()=>u.SolelyDivider}),Object.defineProperty(exports,"SolelyTabs",{enumerable:!0,get:()=>x.SolelyTabs}),Object.defineProperty(exports,"SolelyTable",{enumerable:!0,get:()=>b.SolelyTable}),Object.defineProperty(exports,"SolelySkeleton",{enumerable:!0,get:()=>S.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:()=>P.SolelyBreadcrumb}),Object.defineProperty(exports,"SolelySteps",{enumerable:!0,get:()=>f.SolelySteps}),Object.defineProperty(exports,"SolelyTimeline",{enumerable:!0,get:()=>q.SolelyTimeline}),Object.defineProperty(exports,"SolelyBackTop",{enumerable:!0,get:()=>O.SolelyBackTop}),Object.defineProperty(exports,"SolelyUpload",{enumerable:!0,get:()=>T.SolelyUpload}),Object.defineProperty(exports,"SolelyRate",{enumerable:!0,get:()=>h.SolelyRate}),Object.defineProperty(exports,"SolelySlider",{enumerable:!0,get:()=>I.SolelySlider}),Object.defineProperty(exports,"SolelyTree",{enumerable:!0,get:()=>k.SolelyTree}),Object.defineProperty(exports,"SolelyCoordinateInput",{enumerable:!0,get:()=>B.SolelyCoordinateInput}),Object.defineProperty(exports,"SolelyTooltip",{enumerable:!0,get:()=>w.SolelyTooltip}),Object.defineProperty(exports,"SolelyNotFound",{enumerable:!0,get:()=>C.SolelyNotFound}),exports.Message=R.Message,exports.Modal=M.Modal,exports.Tooltip=v.Tooltip,exports.Drawer=D.Drawer,exports.Popconfirm=F.Popconfirm;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./theme/index.cjs"),r=require("./elements/button/index.cjs"),t=require("./elements/icon/index.cjs"),o=require("./elements/input/index.cjs"),l=require("./elements/fab/index.cjs"),n=require("./elements/card/index.cjs"),s=require("./elements/tag/index.cjs"),i=require("./elements/badge/index.cjs"),c=require("./elements/alert/index.cjs"),p=require("./elements/switch/index.cjs"),d=require("./elements/checkbox/index.cjs"),a=require("./elements/radio/index.cjs"),m=require("./elements/select/index.cjs"),y=require("./elements/progress/index.cjs"),x=require("./elements/divider/index.cjs"),u=require("./elements/tabs/index.cjs"),b=require("./elements/table/index.cjs"),S=require("./elements/skeleton/index.cjs"),j=require("./elements/empty/index.cjs"),g=require("./elements/pagination/index.cjs"),P=require("./elements/breadcrumb/index.cjs"),f=require("./elements/steps/index.cjs"),q=require("./elements/timeline/index.cjs"),O=require("./elements/backtop/index.cjs"),T=require("./elements/upload/index.cjs"),I=require("./elements/rate/index.cjs"),h=require("./elements/slider/index.cjs"),A=require("./elements/tree/index.cjs"),k=require("./elements/coordinate-input/index.cjs"),C=require("./elements/tooltip/index.cjs"),N=require("./elements/not-found/index.cjs"),B=require("./commands/message/index.cjs"),D=require("./commands/modal/index.cjs"),R=require("./commands/tooltip/index.cjs"),M=require("./commands/drawer/index.cjs"),v=require("./commands/popconfirm/index.cjs"),w=require("./commands/utils.cjs");exports.getTheme=e.getTheme,exports.initTheme=e.initTheme,exports.persistTheme=e.persistTheme,exports.setTheme=e.setTheme,exports.toggleTheme=e.toggleTheme,Object.defineProperty(exports,"SolelyButton",{enumerable:!0,get:()=>r.SolelyButton}),Object.defineProperty(exports,"SolelyIcon",{enumerable:!0,get:()=>t.SolelyIcon}),exports.getIcon=t.getIcon,exports.getRegisteredIcons=t.getRegisteredIcons,exports.hasIcon=t.hasIcon,exports.registerIcon=t.registerIcon,exports.registerIcons=t.registerIcons,Object.defineProperty(exports,"SolelyInput",{enumerable:!0,get:()=>o.SolelyInput}),Object.defineProperty(exports,"SolelyFab",{enumerable:!0,get:()=>l.SolelyFab}),Object.defineProperty(exports,"SolelyCard",{enumerable:!0,get:()=>n.SolelyCard}),Object.defineProperty(exports,"SolelyTag",{enumerable:!0,get:()=>s.SolelyTag}),Object.defineProperty(exports,"SolelyBadge",{enumerable:!0,get:()=>i.SolelyBadge}),Object.defineProperty(exports,"SolelyAlert",{enumerable:!0,get:()=>c.SolelyAlert}),Object.defineProperty(exports,"SolelySwitch",{enumerable:!0,get:()=>p.SolelySwitch}),Object.defineProperty(exports,"SolelyCheckbox",{enumerable:!0,get:()=>d.SolelyCheckbox}),Object.defineProperty(exports,"SolelyRadio",{enumerable:!0,get:()=>a.SolelyRadio}),Object.defineProperty(exports,"SolelySelect",{enumerable:!0,get:()=>m.SolelySelect}),Object.defineProperty(exports,"SolelyProgress",{enumerable:!0,get:()=>y.SolelyProgress}),Object.defineProperty(exports,"SolelyDivider",{enumerable:!0,get:()=>x.SolelyDivider}),Object.defineProperty(exports,"SolelyTabs",{enumerable:!0,get:()=>u.SolelyTabs}),Object.defineProperty(exports,"SolelyTable",{enumerable:!0,get:()=>b.SolelyTable}),Object.defineProperty(exports,"SolelySkeleton",{enumerable:!0,get:()=>S.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:()=>P.SolelyBreadcrumb}),Object.defineProperty(exports,"SolelySteps",{enumerable:!0,get:()=>f.SolelySteps}),Object.defineProperty(exports,"SolelyTimeline",{enumerable:!0,get:()=>q.SolelyTimeline}),Object.defineProperty(exports,"SolelyBackTop",{enumerable:!0,get:()=>O.SolelyBackTop}),Object.defineProperty(exports,"SolelyUpload",{enumerable:!0,get:()=>T.SolelyUpload}),Object.defineProperty(exports,"SolelyRate",{enumerable:!0,get:()=>I.SolelyRate}),Object.defineProperty(exports,"SolelySlider",{enumerable:!0,get:()=>h.SolelySlider}),Object.defineProperty(exports,"SolelyTree",{enumerable:!0,get:()=>A.SolelyTree}),Object.defineProperty(exports,"SolelyCoordinateInput",{enumerable:!0,get:()=>k.SolelyCoordinateInput}),Object.defineProperty(exports,"SolelyTooltip",{enumerable:!0,get:()=>C.SolelyTooltip}),Object.defineProperty(exports,"SolelyNotFound",{enumerable:!0,get:()=>N.SolelyNotFound}),exports.Message=B.Message,exports.Modal=D.Modal,exports.Tooltip=R.Tooltip,exports.Drawer=M.Drawer,exports.Popconfirm=v.Popconfirm,exports.ANIMATION_DURATION=w.ANIMATION_DURATION,exports.Z_INDEX=w.Z_INDEX,exports.addClosingAnimation=w.addClosingAnimation,exports.calculatePosition=w.calculatePosition,exports.createElement=w.createElement,exports.generateId=w.generateId,exports.injectStyle=w.injectStyle,exports.removeStyle=w.removeStyle,exports.safeAsyncCallback=w.safeAsyncCallback;
@@ -18,5 +18,4 @@
18
18
  */
19
19
  export * from './theme';
20
20
  export * from './elements';
21
- export { Message, Modal, Tooltip, Drawer, Popconfirm } from './commands';
22
- export type { MessageOptions, MessageInstance, MessageConfig, MessageType, MessagePlacement, ModalOptions, ModalInstance, ModalConfig, ModalType, ModalButton, TooltipOptions, TooltipInstance, TooltipConfig, DrawerOptions, DrawerInstance, DrawerConfig, DrawerPlacement, PopconfirmOptions, PopconfirmInstance, PopconfirmConfig, PopconfirmPlacement, } from './commands';
21
+ export * from './commands';
@@ -1 +1 @@
1
- import{getTheme as e,initTheme as m,persistTheme as o,setTheme as t,toggleTheme as i}from"./theme/index.js";import{SolelyButton as r}from"./elements/button/index.js";import{SolelyIcon as n,getIcon as s,getRegisteredIcons as d,hasIcon as p,registerIcon as l,registerIcons as f}from"./elements/icon/index.js";import{SolelyInput as x}from"./elements/input/index.js";import{SolelyFab as j}from"./elements/fab/index.js";import{SolelyCard as a}from"./elements/card/index.js";import{SolelyTag as c}from"./elements/tag/index.js";import{SolelyBadge as b}from"./elements/badge/index.js";import{SolelyAlert as u}from"./elements/alert/index.js";import{SolelySwitch as g}from"./elements/switch/index.js";import{SolelyCheckbox as h}from"./elements/checkbox/index.js";import{SolelyRadio as k}from"./elements/radio/index.js";import{SolelySelect as w}from"./elements/select/index.js";import{SolelyProgress as v}from"./elements/progress/index.js";import{SolelyDivider as y}from"./elements/divider/index.js";import{SolelyTabs as q}from"./elements/tabs/index.js";import{SolelyTable as z}from"./elements/table/index.js";import{SolelySkeleton as A}from"./elements/skeleton/index.js";import{SolelyEmpty as B}from"./elements/empty/index.js";import{SolelyPagination as C}from"./elements/pagination/index.js";import{SolelyBreadcrumb as D}from"./elements/breadcrumb/index.js";import{SolelySteps as E}from"./elements/steps/index.js";import{SolelyTimeline as F}from"./elements/timeline/index.js";import{SolelyBackTop as G}from"./elements/backtop/index.js";import{SolelyUpload as H}from"./elements/upload/index.js";import{SolelyRate as I}from"./elements/rate/index.js";import{SolelySlider as J}from"./elements/slider/index.js";import{SolelyTree as K}from"./elements/tree/index.js";import{SolelyCoordinateInput as L}from"./elements/coordinate-input/index.js";import{SolelyTooltip as M}from"./elements/tooltip/index.js";import{SolelyNotFound as N}from"./elements/not-found/index.js";import{Message as O}from"./commands/message/index.js";import{Modal as P}from"./commands/modal/index.js";import{Tooltip as Q}from"./commands/tooltip/index.js";import{Drawer as R}from"./commands/drawer/index.js";import{Popconfirm as S}from"./commands/popconfirm/index.js";export{R as Drawer,O as Message,P as Modal,S as Popconfirm,u as SolelyAlert,G as SolelyBackTop,b as SolelyBadge,D as SolelyBreadcrumb,r as SolelyButton,a as SolelyCard,h as SolelyCheckbox,L as SolelyCoordinateInput,y as SolelyDivider,B as SolelyEmpty,j as SolelyFab,n as SolelyIcon,x as SolelyInput,N as SolelyNotFound,C as SolelyPagination,v as SolelyProgress,k as SolelyRadio,I as SolelyRate,w as SolelySelect,A as SolelySkeleton,J as SolelySlider,E as SolelySteps,g as SolelySwitch,z as SolelyTable,q as SolelyTabs,c as SolelyTag,F as SolelyTimeline,M as SolelyTooltip,K as SolelyTree,H as SolelyUpload,Q as Tooltip,s as getIcon,d as getRegisteredIcons,e as getTheme,p as hasIcon,m as initTheme,o as persistTheme,l as registerIcon,f as registerIcons,t as setTheme,i as toggleTheme};
1
+ import{getTheme as e,initTheme as m,persistTheme as o,setTheme as t,toggleTheme as i}from"./theme/index.js";import{SolelyButton as r}from"./elements/button/index.js";import{SolelyIcon as s,getIcon as n,getRegisteredIcons as d,hasIcon as p,registerIcon as l,registerIcons as f}from"./elements/icon/index.js";import{SolelyInput as x}from"./elements/input/index.js";import{SolelyFab as j}from"./elements/fab/index.js";import{SolelyCard as a}from"./elements/card/index.js";import{SolelyTag as c}from"./elements/tag/index.js";import{SolelyBadge as b}from"./elements/badge/index.js";import{SolelyAlert as u}from"./elements/alert/index.js";import{SolelySwitch as g}from"./elements/switch/index.js";import{SolelyCheckbox as h}from"./elements/checkbox/index.js";import{SolelyRadio as k}from"./elements/radio/index.js";import{SolelySelect as w}from"./elements/select/index.js";import{SolelyProgress as v}from"./elements/progress/index.js";import{SolelyDivider as y}from"./elements/divider/index.js";import{SolelyTabs as q}from"./elements/tabs/index.js";import{SolelyTable as z}from"./elements/table/index.js";import{SolelySkeleton as A}from"./elements/skeleton/index.js";import{SolelyEmpty as B}from"./elements/empty/index.js";import{SolelyPagination as C}from"./elements/pagination/index.js";import{SolelyBreadcrumb as D}from"./elements/breadcrumb/index.js";import{SolelySteps as E}from"./elements/steps/index.js";import{SolelyTimeline as F}from"./elements/timeline/index.js";import{SolelyBackTop as G}from"./elements/backtop/index.js";import{SolelyUpload as H}from"./elements/upload/index.js";import{SolelyRate as I}from"./elements/rate/index.js";import{SolelySlider as J}from"./elements/slider/index.js";import{SolelyTree as K}from"./elements/tree/index.js";import{SolelyCoordinateInput as L}from"./elements/coordinate-input/index.js";import{SolelyTooltip as M}from"./elements/tooltip/index.js";import{SolelyNotFound as N}from"./elements/not-found/index.js";import{Message as O}from"./commands/message/index.js";import{Modal as P}from"./commands/modal/index.js";import{Tooltip as Q}from"./commands/tooltip/index.js";import{Drawer as R}from"./commands/drawer/index.js";import{Popconfirm as S}from"./commands/popconfirm/index.js";import{ANIMATION_DURATION as T,Z_INDEX as U,addClosingAnimation as V,calculatePosition as W,createElement as X,generateId as Y,injectStyle as Z,removeStyle as $,safeAsyncCallback as _}from"./commands/utils.js";export{T as ANIMATION_DURATION,R as Drawer,O as Message,P as Modal,S as Popconfirm,u as SolelyAlert,G as SolelyBackTop,b as SolelyBadge,D as SolelyBreadcrumb,r as SolelyButton,a as SolelyCard,h as SolelyCheckbox,L as SolelyCoordinateInput,y as SolelyDivider,B as SolelyEmpty,j as SolelyFab,s as SolelyIcon,x as SolelyInput,N as SolelyNotFound,C as SolelyPagination,v as SolelyProgress,k as SolelyRadio,I as SolelyRate,w as SolelySelect,A as SolelySkeleton,J as SolelySlider,E as SolelySteps,g as SolelySwitch,z as SolelyTable,q as SolelyTabs,c as SolelyTag,F as SolelyTimeline,M as SolelyTooltip,K as SolelyTree,H as SolelyUpload,Q as Tooltip,U as Z_INDEX,V as addClosingAnimation,W as calculatePosition,X as createElement,Y as generateId,n as getIcon,d as getRegisteredIcons,e as getTheme,p as hasIcon,m as initTheme,Z as injectStyle,o as persistTheme,l as registerIcon,f as registerIcons,$ as removeStyle,_ as safeAsyncCallback,t as setTheme,i as toggleTheme};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Tooltip 共享类型定义
3
+ * 供 elements 和 commands 模块复用
4
+ */
5
+ export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
6
+ export type TooltipTrigger = 'hover' | 'click' | 'focus' | 'manual';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "solely",
3
3
  "private": false,
4
- "version": "0.4.19",
4
+ "version": "0.4.21",
5
5
  "description": "A lightweight TypeScript framework for building web components with compile-time optimizations",
6
6
  "type": "module",
7
7
  "sideEffects": false,