x-next 0.0.0-alpha.2 → 0.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -84
- package/dist/index.umd.js +1 -0
- package/package.json +35 -48
- package/LICENSE +0 -21
- package/dist/favicon.ico +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/types/_hooks/use-overflow.d.ts +0 -5
- package/dist/types/_hooks/use-popup-manager.d.ts +0 -11
- package/dist/types/_props/css.d.ts +0 -13
- package/dist/types/_props/global.d.ts +0 -1
- package/dist/types/_utils/config.d.ts +0 -9
- package/dist/types/_utils/convert-case.d.ts +0 -3
- package/dist/types/_utils/dom.d.ts +0 -10
- package/dist/types/_utils/helpers.d.ts +0 -12
- package/dist/types/_utils/icon.d.ts +0 -59
- package/dist/types/_utils/is.d.ts +0 -25
- package/dist/types/_utils/keyboard.d.ts +0 -24
- package/dist/types/_utils/number.d.ts +0 -0
- package/dist/types/_utils/vue-eco.d.ts +0 -32
- package/dist/types/componets/button/index.vue.d.ts +0 -107
- package/dist/types/componets/button/props.d.ts +0 -45
- package/dist/types/componets/dialog/index.vue.d.ts +0 -221
- package/dist/types/componets/dialog/props.d.ts +0 -83
- package/dist/types/componets/dialog/use-props.d.ts +0 -33
- package/dist/types/componets/dialog/use.d.ts +0 -3
- package/dist/types/componets/dialog/warp.d.ts +0 -2
- package/dist/types/componets/message/index.vue.d.ts +0 -116
- package/dist/types/componets/message/props.d.ts +0 -31
- package/dist/types/componets/message/warp.d.ts +0 -3
- package/dist/types/componets/message-box/index.d.ts +0 -3
- package/dist/types/componets/message-box/props.d.ts +0 -52
- package/dist/types/componets/message-box/warp.d.ts +0 -2
- package/dist/types/componets/notification/index.vue.d.ts +0 -160
- package/dist/types/componets/notification/props.d.ts +0 -54
- package/dist/types/componets/notification/warp.d.ts +0 -3
- package/dist/types/componets/space/index.d.ts +0 -42
- package/dist/types/componets/tag-cloud/index.d.ts +0 -0
- package/dist/types/componets/trend-chart/components/trend-chart-curve.d.ts +0 -114
- package/dist/types/componets/trend-chart/components/trend-chart-grid.d.ts +0 -55
- package/dist/types/componets/trend-chart/components/trend-chart-labels.d.ts +0 -22
- package/dist/types/componets/trend-chart/components/trend-chart.d.ts +0 -270
- package/dist/types/componets/trend-chart/helpers/genPath.d.ts +0 -8
- package/dist/types/componets/trend-chart/helpers/genPoints.d.ts +0 -3
- package/dist/types/componets/trend-chart/helpers/getPadding.d.ts +0 -7
- package/dist/types/componets/trend-chart/helpers/validatePadding.d.ts +0 -2
- package/dist/types/componets/trend-chart/index.d.ts +0 -2
- package/dist/types/componets/trend-chart/props.d.ts +0 -206
- package/dist/types/icons/animation/animation-loading.vue.d.ts +0 -55
- package/dist/types/icons/default/check-circle-fill.vue.d.ts +0 -55
- package/dist/types/icons/default/close-circle-fill.vue.d.ts +0 -55
- package/dist/types/icons/default/exclamation-circle-fill.vue.d.ts +0 -55
- package/dist/types/icons/default/info-circle-fill.vue.d.ts +0 -55
- package/dist/types/icons/default/minus-circle-fill.vue.d.ts +0 -55
- package/dist/types/icons/index.d.ts +0 -7
- package/dist/types/ui.d.ts +0 -5
- package/dist/ui.cjs.js +0 -2
- package/dist/ui.es.js +0 -1395
- package/dist/ui.umd.js +0 -3
package/README.md
CHANGED
@@ -1,95 +1,26 @@
|
|
1
|
-
#
|
1
|
+
# 简介
|
2
2
|
|
3
|
-
|
3
|
+
X-Next是Ringing Tech的基础UI库。
|
4
4
|
|
5
|
-
|
5
|
+
# 安装
|
6
6
|
|
7
|
-
|
7
|
+
### 运行
|
8
8
|
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
Package is available on NPM: https://www.npmjs.com/package/vue3-datepicker
|
12
|
-
|
13
|
-
```sh
|
14
|
-
npm i vue3-datepicker
|
15
9
|
```
|
16
|
-
|
17
|
-
The component is packaged mainly for use with bundlers, if you require a browser build - post an issue.
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
For more examples see https://icehaunter.github.io/vue3-datepicker/examples.html
|
22
|
-
|
23
|
-
```vue
|
24
|
-
<template>
|
25
|
-
<datepicker
|
26
|
-
v-model="selected"
|
27
|
-
:locale="locale"
|
28
|
-
:upperLimit="to"
|
29
|
-
:lowerLimit="from"
|
30
|
-
:clearable="true"
|
31
|
-
/>
|
32
|
-
</template>
|
10
|
+
pnpm i x-next
|
33
11
|
```
|
34
12
|
|
35
|
-
|
36
|
-
|
37
|
-
Attribute fallthrough is enabled, so any attribute you apply to the component will be passed down to the input.
|
38
|
-
|
39
|
-
All props which accept formatting strings for dates use [`date-fns` formatting function](https://date-fns.org/docs/format) under the hood, so see that function's documentation for patterns.
|
13
|
+
### 引入
|
40
14
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
| `upperLimit` | `Date` | | Upper limit for available dates for picking |
|
48
|
-
| `lowerLimit` | `Date` | | Lower limit for available dates for picking |
|
49
|
-
| `startingViewDate` | `Date` | `() => new Date()` | Date on which to focus when empty datepicker is opened. Default is "right now" |
|
50
|
-
| `disabledDates` | `{ dates: Date[] }` | | Dates not available for picking |
|
51
|
-
| `disabledTime` | `{ dates: Date[] }` | | Dates not available for time picking |
|
52
|
-
| `startingView` | `'time' \| 'day' \| 'month' \| 'year'` | `'day'` | View on which the date picker should open. Can be either `year`, `month`, or `day` |
|
53
|
-
| `minimumView` | `'time' \| 'day' \| 'month' \| 'year'` | `'day'` | If set, lower-level views won't show |
|
54
|
-
| `dayPickerHeadingFormat` | `String` | `LLLL yyyy` | `date-fns`-type formatting for a day view heading |
|
55
|
-
| `dayFormat` | `String` | `dd` | `date-fns`-type formatting for each day on the day view |
|
56
|
-
| `weekdayFormat` | `String` | `EE` | `date-fns`-type formatting for a line of weekdays on day view |
|
57
|
-
| `inputFormat` | `String` | `yyyy-MM-dd` | `date-fns`-type format in which the string in the input should be both parsed and displayed |
|
58
|
-
| `locale` | [`Locale`](https://date-fns.org/v2.16.1/docs/I18n#usage) | `date-fns/locale/en` | [`date-fns` locale object](https://date-fns.org/v2.16.1/docs/I18n#usage). Used in string formatting (see default `dayPickerHeadingFormat`) |
|
59
|
-
| `disabled` | `Boolean` | `false` | Disables datepicker and prevents it's opening |
|
60
|
-
| `typeable` | `Boolean` | `false` | Allows user to input date manually |
|
61
|
-
| `weekStartsOn` | `Number` | 1 | Day on which the week should start. Number from 0 to 6, where 0 is Sunday and 6 is Saturday. Week starts with a Monday (1) by default |
|
62
|
-
| `clearable` | `Boolean` | `false` | Allows clearing the selected date and setting the value to `null` |
|
63
|
-
| `allowOutsideInterval` | `Boolean` | `false` | Allows user to click dates outside of current interval |
|
64
|
-
|
65
|
-
### Events
|
66
|
-
|
67
|
-
- `opened`: Emitted every time the popup opens, including on field focus
|
68
|
-
- `closed`: Emitted every time the popup closes, including on field blur
|
69
|
-
- `decadePageChanged`: Emitted when a page is changed on the year picker view, displaying a different decade. Has a date that is included in the shown decade as an argument.
|
70
|
-
- `yearPageChanged`: Emitted when a page is changed on the month picker view, displaying a different year. Has a date that is included in the shown year as an argument.
|
71
|
-
- `monthPageChanged`: Emitted when a page is changed on the day picker view, displaying a different month. Has a date that is included in the shown month as an argument.
|
72
|
-
|
73
|
-
## Compatibility
|
74
|
-
|
75
|
-
Package is transpiled and should be usable for everyone with ES6 and above, but the styling of the datepicker itself uses CSS Grid and CSS variables.
|
76
|
-
|
77
|
-
## Example
|
15
|
+
```
|
16
|
+
// main.ts
|
17
|
+
import { createApp } from 'vue'
|
18
|
+
import XNext from 'x-next'
|
19
|
+
import "x-next/dist/style.css"; //引入组件样式
|
20
|
+
import App from './App.vue'
|
78
21
|
|
79
|
-
|
80
|
-
<template>
|
81
|
-
<datepicker v-model="picked" />
|
82
|
-
</template>
|
22
|
+
const app = createApp(App)
|
83
23
|
|
84
|
-
|
85
|
-
|
86
|
-
components: {
|
87
|
-
Datepicker
|
88
|
-
},
|
89
|
-
data(): {
|
90
|
-
return {
|
91
|
-
picked: new Date();
|
92
|
-
}
|
93
|
-
}
|
94
|
-
</script>
|
24
|
+
app.use(XNext)
|
25
|
+
app.mount('#app')
|
95
26
|
```
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(k,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(k=typeof globalThis<"u"?globalThis:k||self,t(k.index={},k.Vue))})(this,function(k,t){"use strict";var Vt=Object.defineProperty;var Ot=(k,t,w)=>t in k?Vt(k,t,{enumerable:!0,configurable:!0,writable:!0,value:w}):k[t]=w;var S=(k,t,w)=>Ot(k,typeof t!="symbol"?t+"":t,w);const w="X",ye="x",_=e=>e?ye+"-"+e:e||"",$=e=>w+e,E=e=>{const n=_(e);return{block:n,element:r=>`${n}--${r}`,modifier:r=>`${n}-${r}`,is:r=>`${n}-is-${r}`}},ge=["px","%","vh","vw","calc"],v=(e,n="px")=>{if(e===void 0)return"";const l=String(e);return ge.some(o=>l.includes(o))?l:l+n},T=Object.prototype.toString;function ee(e){return T.call(e)==="[object Array]"}function te(e){return T.call(e)==="[object Object]"}const ne=e=>T.call(e)==="[object Promise]";function le(e){return T.call(e)==="[object String]"}function ke(e){return T.call(e)==="[object Number]"&&e===e}function p(e){return typeof e=="function"}function D(){return typeof window<"u"}const pe=1e3,he=3e3,Ne=1;class Ee{constructor(){S(this,"popupStack",{popup:new Set,dialog:new Set,message:new Set});S(this,"getNextZIndex",n=>(n==="message"?Array.from(this.popupStack.message).pop()||he:Array.from(this.popupStack.popup).pop()||pe)+Ne);S(this,"add",n=>{const l=this.getNextZIndex(n);return this.popupStack[n].add(l),n==="dialog"&&this.popupStack.popup.add(l),l});S(this,"delete",(n,l)=>{this.popupStack[l].delete(n),l==="dialog"&&this.popupStack.popup.delete(n)});S(this,"isLastDialog",n=>this.popupStack.dialog.size>1?n===Array.from(this.popupStack.dialog).pop():!0)}}const R=new Ee;function U(e,{visible:n,runOnMounted:l}={}){const o=t.ref(0),a=()=>{o.value=R.add(e)},r=()=>{R.delete(o.value,e)},f=()=>e==="dialog"?R.isLastDialog(o.value):!1;return t.watch(()=>n==null?void 0:n.value,s=>{s?a():r()},{immediate:!0}),l&&(t.onMounted(()=>{a()}),t.onBeforeUnmount(()=>{r()})),{zIndex:t.readonly(o),open:a,close:r,isLastDialog:f}}const oe=e=>e.replace(/^./,n=>n.toLowerCase()).replace(/-(\w)/g,(n,l)=>{var o;return(o=l==null?void 0:l.toUpperCase())!==null&&o!==void 0?o:""}),re=()=>{},Be=(e,n)=>{var l;if(D)return(l=document.querySelector(e))!==null&&l!==void 0?l:void 0},be=e=>{if(e.tagName==="BODY")return window.innerWidth-(document.documentElement.offsetWidth||document.body.offsetWidth);const{borderLeftWidth:n,borderRightWidth:l}=window.getComputedStyle(e),o=Number(n.replace("px",""))+Number(l.replace("px",""));return e.offsetWidth-(e.clientWidth+o)},we=e=>e.tagName==="BODY"?document.documentElement.scrollHeight>window.innerHeight:e.scrollHeight>e.offsetHeight,Ve=(e,n)=>{var l;if(!D||!e||!n)return"";let o=oe(n);o==="float"&&(o="cssFloat");try{const a=e.style[o];if(a)return a;const r=(l=document.defaultView)===null||l===void 0?void 0:l.getComputedStyle(e,"");return r?r[o]:""}catch{return e.style[o]}},z=(e,n,l)=>{if(!(!e||!n))if(te(n))Object.entries(n).forEach(([o,a])=>z(e,o,a));else{const o=oe(n);e.style[o]=l}},W=(e,n)=>{if(le(e)){const l=e[0]==="#"?`[id='${e.slice(1)}']`:e;return Be(l)}return e},Oe=D?(e,n,l,o=!1)=>{e.addEventListener(n,l,o)}:re,Se=D?(e,n,l,o=!1)=>{e.removeEventListener(n,l,o)}:re,$e=(e,n)=>{let l=!1;const o={overflow:"",width:""},a=s=>s.tagName==="BODY",r=()=>{if(e.value){const s=e.value;if(!l&&s.style.overflow!=="hidden"){const m=be(s);if(m>0||we(s)){o.overflow=s.style.overflow,o.width=s.style.width;let u=0;a(s)&&(u=s.getBoundingClientRect().left||0),z(s,{width:`calc(100% - ${Math.ceil(m-u)}px)`,overflow:"hidden"}),l=!0}}}},f=()=>{if(e.value&&l){const s=e.value;z(s,{overflow:o.overflow,width:o.width}),l=!1}};return t.watch(()=>n==null?void 0:n.value,s=>{e.value&&!a(e.value)&&(s&&z(s,{position:"absolute"}),Ve(e.value,"position")==="static"&&z(e.value,{position:"relative"}))}),{setOverflowHidden:r,resetOverflow:f}},Te={ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",TAB:"Tab",SPACE:" ",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},M=e=>e;var V;(function(e){e[e.ELEMENT=1]="ELEMENT",e[e.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",e[e.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",e[e.COMPONENT=6]="COMPONENT",e[e.TEXT_CHILDREN=8]="TEXT_CHILDREN",e[e.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",e[e.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",e[e.TELEPORT=64]="TELEPORT",e[e.SUSPENSE=128]="SUSPENSE",e[e.COMPONENT_SHOULD_KEEP_ALIVE=256]="COMPONENT_SHOULD_KEEP_ALIVE",e[e.COMPONENT_KEPT_ALIVE=512]="COMPONENT_KEPT_ALIVE"})(V||(V={}));const ze=e=>!!(e&&e.shapeFlag&V.ELEMENT),Me=(e,n)=>!!(e&&e.shapeFlag&V.COMPONENT),Le=(e,n)=>!!(e&&e.shapeFlag&8),Ae=(e,n)=>!!(e&&e.shapeFlag&V.ARRAY_CHILDREN),De=(e,n)=>!!(e&&e.shapeFlag&V.SLOTS_CHILDREN),I=(e,n=!1)=>{var l,o;const a=[];for(const r of e??[])ze(r)||Me(r)||n&&Le(r,r.children)?a.push(r):Ae(r,r.children)?a.push(...I(r.children,n)):De(r,r.children)?a.push(...I((o=(l=r.children).default)===null||o===void 0?void 0:o.call(l),n)):ee(r)&&a.push(...I(r,n));return a},Ie={renderTo:{type:M([String,Object]),default:"body"},disabled:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},top:{type:[String,Number],default:"3vh"},center:{type:Boolean,default:!1},width:{type:[String,Number],default:0},height:{type:[String,Number],default:0},minWidth:{type:[String,Number],default:0},minHeight:{type:[String,Number],default:0},title:{type:String,default:""},mask:{type:Boolean,default:!0},destroyOnClosed:{type:Boolean,default:!0},onBeforeCancel:{type:Function},maskToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!1},messageBox:{type:Boolean,default:!1},popupClass:{type:String,default:void 0},showClose:{type:Boolean,default:!0},showHeaderBottomLine:{type:Boolean,default:!1}},Pe=["width","minWidth","height","minHeight"],He=t.defineComponent({name:$("Dialog"),inheritAttrs:!1,props:Ie,emits:["closed","close","open","opened","update:modelValue"],setup(e,{emit:n}){const l=E("dialog"),o=l.block,a=E("message-box"),r=a.block,f=t.computed(()=>[o,e.messageBox&&"is-message-box",e.popupClass&&e.popupClass]),s=t.computed(()=>W(e.renderTo)),m=t.ref(),u=t.computed(()=>e.disabled||!s.value),C=t.computed(()=>({zIndex:h.value})),c=t.computed(()=>{const y={};return e.fullscreen||(!e.center&&e.top&&(y.top=v(e.top)),Pe.forEach(B=>{e[B]&&(y[B]=v(e[B]))})),y}),i=t.ref(!1),d=t.computed(()=>e.modelValue),g=t.computed(()=>d.value||i.value),{zIndex:h,isLastDialog:b}=U("dialog",{visible:d}),{setOverflowHidden:kt,resetOverflow:fe}=$e(s,m),me=(y,B)=>{n("update:modelValue",!1),n("close",e.messageBox?y:void 0,e.messageBox?B:void 0)},pt=()=>{i.value=!1,fe(),n("closed")},ht=()=>{n("opened")},j=t.reactive({ok:!1,cancel:!1}),A=(y,B)=>{let F=!0;if(j[y]=!0,p(e.onBeforeCancel)&&(F=e.onBeforeCancel(y)??!1),ne(F)){F.then(wt=>{j[y]=!1,wt&&me(y,B)});return}j[y]=!1,F&&me(y,B)},Nt=()=>{e.maskToClose&&e.mask&&A("cancel")},Et=y=>{A("cancel",y)},Bt=y=>{A("ok",y)};let Q=!1;const ue=y=>{e.escToClose&&y.key===Te.ESC&&b()&&A("cancel")},bt=()=>{e.escToClose&&!Q&&(Q=!0,Oe(document.documentElement,"keydown",ue))},Ce=()=>{Q=!1,Se(document.documentElement,"keydown",ue)};return t.onBeforeUnmount(()=>{fe(),Ce()}),t.watch(()=>d.value,y=>{y?(n("open"),kt(),i.value=!0,bt()):Ce()},{immediate:!0}),{cls:f,ns:o,cn:l,cnOMB:a,messageBoxNs:r,containerStyle:c,dialogStyle:C,dialogRef:m,teleportContainer:s,teleportDisabled:u,modelVisible:d,mergeVisible:g,interceptClose:A,afterLeave:pt,afterEnter:ht,handleMaskClick:Nt,handleCancel:Et,handleOk:Bt,loadingObj:j}}}),N=(e,n)=>{const l=e.__vccOpts||e;for(const[o,a]of n)l[o]=a;return l};function je(e,n,l,o,a,r){return t.openBlock(),t.createBlock(t.Teleport,{to:e.teleportContainer,disabled:e.teleportDisabled},[!e.destroyOnClosed||e.mergeVisible?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,ref:"dialogRef",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.dialogStyle)},[t.createVNode(t.Transition,{name:"x-fade-in-standard",appear:""},{default:t.withCtx(()=>[e.mask?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([e.cn.element("mask")])},null,2)),[[t.vShow,e.modelVisible]]):t.createCommentVNode("",!0)]),_:1}),t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("wrapper"),{"is-center":e.center}]),onClick:n[1]||(n[1]=t.withModifiers((...f)=>e.handleMaskClick&&e.handleMaskClick(...f),["self"]))},[t.createVNode(t.Transition,{name:"x-zoom-in",appear:"",onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("container"),{"is-fullscreen":e.fullscreen}]),style:t.normalizeStyle(e.containerStyle)},[t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("header"):e.cn.element("header"),e.showHeaderBottomLine&&"is-bottom-line"])},[t.renderSlot(e.$slots,"title",{},()=>[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("header-title")])},t.toDisplayString(e.title),3)])],2),t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("body"):e.cn.element("body")])},[t.renderSlot(e.$slots,"default")],2),t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("footer"):e.cn.element("footer")])},[t.renderSlot(e.$slots,"footer",{cancel:e.handleCancel,ok:e.handleOk,loadingObj:e.loadingObj})],2),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("close-icon"),e.messageBox&&e.cnOMB.element("close-icon")]),onClick:n[0]||(n[0]=f=>e.interceptClose("cancel"))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.modelVisible]])]),_:3},8,["onAfterEnter","onAfterLeave"])],2)],6)),[[t.vShow,e.mergeVisible]]):t.createCommentVNode("",!0)],8,["to","disabled"])}const se=N(He,[["render",je]]),Fe={disabled:Boolean,block:Boolean,loading:Boolean,loadingFill:{type:Boolean,default:!1},debounce:{type:Number,default:0},shape:{type:M(String),default:void 0},link:{type:Boolean,default:!1},type:{type:M(String),default:void 0},status:{type:M(String),default:void 0},plain:{type:Boolean,default:!1},size:{type:M(String),default:"medium"},border:{type:Boolean,default:!0}},Re=e=>le(e)?e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(""):"",Ue=(e,n="px")=>{if(e===void 0)return"";const l=typeof e=="number"?`${e}`:e;return["px","%","vh","vw","calc"].some(a=>l.includes(a))?l:l+n};function O(e){return t.defineComponent({name:_(`Icon${Re(e)}`),props:{size:{type:[Number,String],default:void 0},rotate:{type:Number,default:void 0},spin:{type:Boolean,default:!1},color:{type:String,default:void 0},fillColor:{type:Array,default:void 0}},setup(n){const l="x-icon",o=t.computed(()=>{const r={};return n.size&&(r.fontSize=Ue(n.size)),n.rotate&&(r.transform=`rotate(${n.rotate}deg)`),n.color&&(r.color=n.color),r});return{cls:t.computed(()=>[l,{[`${l}-loading`]:n.spin}]),styles:o}}})}const We=O("animation-loading");function Ze(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 50 50",class:"icon-loading-svg"},[t.createElementVNode("circle",{cx:"25",cy:"25",r:"20",class:"path",fill:"none",stroke:"currentColor"})],-1)]),6)}const Ke=N(We,[["render",Ze],["__scopeId","data-v-62d46830"]]),Xe=t.defineComponent({name:$("Button"),components:{AnimationLoading:Ke},props:Fe,emits:["click"],setup(e){const n=t.reactive({clicked:!1,isDebounce:!1}),l=E("button"),o=t.computed(()=>[l.block,e.type&&l.modifier(e.type),e.status&&l.modifier(e.status),e.disabled&&l.is("disabled"),e.block&&l.modifier("block"),e.plain&&l.is("plain"),e.shape&&l.modifier(e.shape),e.link&&l.modifier("is-link"),e.size&&l.modifier(e.size),!e.border&&l.modifier("is-hide-border"),r.value&&l.modifier("is-loading")]),a=()=>{e.debounce>0&&!n.isDebounce&&(n.isDebounce=!0,setTimeout(()=>{n.isDebounce=!1},e.debounce))},r=t.computed(()=>e.loading||n.clicked||n.isDebounce),f=t.getCurrentInstance(),s=(u,C)=>{const c=u(C);ne(c)&&(n.clicked=!0,c.finally(()=>{n.clicked=!1}))};return{cn:l,cls:o,handleClick:async u=>{var c,i,d,g;if((i=(c=u.target).blur)==null||i.call(c),r.value)return;a();const C=(g=(d=f==null?void 0:f.vnode)==null?void 0:d.props)==null?void 0:g.onClick;ee(C)?C.forEach(h=>s(h,u)):p(C)&&s(C,u)},isLoading:r}}}),Ye=["disabled"];function Ge(e,n,l,o,a,r){const f=t.resolveComponent("AnimationLoading");return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(e.cls),type:"button",disabled:e.disabled,onClick:n[0]||(n[0]=(...s)=>e.handleClick&&e.handleClick(...s))},[t.withDirectives(t.createElementVNode("span",{class:t.normalizeClass([e.cn.element("loading")])},[t.createVNode(f)],2),[[t.vShow,e.isLoading]]),e.$slots.prefix?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("prefix")])},[t.renderSlot(e.$slots,"prefix")],2)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default"),e.$slots.suffix?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass([e.cn.element("suffix")])},[t.renderSlot(e.$slots,"suffix")],2)):t.createCommentVNode("",!0)],10,Ye)}const P=N(Xe,[["render",Ge]]),ae=t.defineComponent({name:$("Space"),props:{direction:{type:String,default:"horizontal"},size:{type:[Number,String],default:"small"},align:{type:String,default:"center"},fill:{type:Boolean,default:!1}},setup(e,{slots:n}){const l=E("space"),o=t.computed(()=>[l.block,l.element(e.direction),e.fill&&"is-fill",l.element(`${e.direction}-${e.align}`)]);function a(f){if(ke(f))return f;switch(f){case"mini":return 4;case"small":return 8;case"medium":return 16;case"large":return 24;default:return 8}}const r=f=>{const s={};if(f)return s;const m=`${a(e.size)}px`,u=`${a(e.size)}px`;return e.direction==="horizontal"&&(s.marginRight=m),e.direction==="vertical"&&(s.marginBottom=u),s};return()=>{var s;const f=I((s=n.default)==null?void 0:s.call(n),!0).filter(m=>m.type!==t.Comment);return t.createVNode("div",{class:[o.value]},[f.map((m,u)=>{var c;const C=n.split&&u>0;return t.createVNode(t.Fragment,{key:`space-item-${u}`},[C&&t.createVNode("div",{className:l.element("split"),style:r(!1)},[(c=n.split)==null?void 0:c.call(n)]),t.createVNode("div",{className:l.element("item"),style:r(u===f.length-1)},[m])])})])}}});function ie(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const ce=E("dialog"),qe=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=c=>{if(c==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(c==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(c,i)=>{c==="cancel"&&e.onCancel&&e.onCancel(i),c==="ok"&&e.onOk&&e.onOk(i)},r=c=>{if(t.isVNode(c))return c;if(p(c)){const i=c();return t.isVNode(i)?i:null}return t.createVNode("div",{className:ce.element("header-title")},[t.createTextVNode(" "),c,t.createTextVNode(" ")])},f=c=>{if(t.isVNode(c))return c;if(p(c)){const i=c();return t.isVNode(i)?i:null}return t.createVNode("div",{className:ce.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},s=()=>()=>t.createVNode(t.Fragment,null,[e.title&&r(e.title)]),m=()=>()=>t.createVNode(t.Fragment,null,[e.content&&f(e.content)]),u=()=>{if(t.isVNode(e.footer)||p(e.footer))return e.footer;const c=(e==null?void 0:e.cancelText)||"取消",i=(e==null?void 0:e.okText)||"确认";return d=>t.createVNode(ae,{size:12},{default:()=>{var g,h;return[!e.hideCancel&&t.createVNode(P,{size:"small",onClick:d.cancel,loading:(g=d.loadingObj)==null?void 0:g.cancel},ie(c)?c:{default:()=>[c]}),!e.hideOk&&t.createVNode(P,{type:"primary",size:"small",onClick:d.ok,loading:(h=d.loadingObj)==null?void 0:h.ok},ie(i)?i:{default:()=>[i]})]}})},C=t.createVNode(se,{width:(e==null?void 0:e.width)??368,height:(e==null?void 0:e.height)??"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(e==null?void 0:e.center)??!0,top:(e==null?void 0:e.top)??0,mask:(e==null?void 0:e.mask)??!0,maskToClose:(e==null?void 0:e.maskToClose)??!0,popupClass:e.popupClass,onClose:a,onBeforeCancel:o,"onUpdate:modelValue":()=>{C.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:s(),default:m(),footer:u()});t.render(C,n)},xe=["success","warning","error","strong","info"],Je=O("close-circle-fill");function Qe(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const Z=N(Je,[["render",Qe]]),_e=O("check-circle-fill");function ve(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const K=N(_e,[["render",ve]]),et=O("exclamation-circle-fill");function tt(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-2-11a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2Zm4-18a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V15Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const X=N(et,[["render",tt]]),nt=O("info-circle-fill");function lt(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const Y=N(nt,[["render",lt]]),ot=O("minus-circle-fill");function rt(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-7-22a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H17Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const G=N(ot,[["render",rt]]),st=t.defineComponent({name:$("Message"),components:{CloseCircleFill:Z,CheckCircleFill:K,ExclamationCircleFill:X,InfoCircleFill:Y,MinusCircleFill:G},props:{id:{type:String,default:""},message:{type:[String,Number,Object],default:""},type:{type:String,default:"success"},duration:{type:Number,default:1500},center:{type:Boolean,default:!1},onClose:{type:Function,default:()=>{}},offset:{type:Number,default:20},zIndex:{type:Number,default:0},showClose:{type:Boolean,default:!1},useHTML:Boolean,popupClass:{type:String,default:void 0}},emits:["destroy"],setup(e){const n=E("message"),l=t.computed(()=>[n.block,n.modifier(e.type),e.center&&n.modifier("center"),e.showClose&&!e.center&&n.element("show-close"),e.popupClass&&e.popupClass]),o=t.ref(!1);let a=null;const r=()=>{a=setTimeout(()=>{o.value=!1},e.duration)};t.onMounted(()=>{o.value=!0,e.duration!==0&&r()}),t.onUnmounted(()=>{clearTimeout(a)});const{zIndex:f}=U("message",{runOnMounted:!0}),s=t.computed(()=>({top:`${e.offset}px`,zIndex:f.value}));return{cn:n,cls:l,styles:s,visible:o,handleClose:()=>{o.value=!1}}}}),at=["innerHTML"],it={key:1};function ct(e,n,l,o,a,r){const f=t.resolveComponent("CheckCircleFill"),s=t.resolveComponent("ExclamationCircleFill"),m=t.resolveComponent("MinusCircleFill"),u=t.resolveComponent("CloseCircleFill"),C=t.resolveComponent("InfoCircleFill");return t.openBlock(),t.createBlock(t.Transition,{name:"x-message-slide-top",onBeforeLeave:e.onClose,onAfterLeave:n[1]||(n[1]=c=>e.$emit("destroy"))},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},[e.$slots.icon?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("icon"),e.cn.modifier(`icon-${e.type}`)])},[t.renderSlot(e.$slots,"icon",{},()=>[e.type==="success"?(t.openBlock(),t.createBlock(f,{key:0})):e.type==="warning"?(t.openBlock(),t.createBlock(s,{key:1})):e.type==="strong"?(t.openBlock(),t.createBlock(m,{key:2})):e.type==="error"?(t.openBlock(),t.createBlock(u,{key:3})):e.type==="info"?(t.openBlock(),t.createBlock(C,{key:4})):t.createCommentVNode("",!0)])],2)),t.renderSlot(e.$slots,"default",{},()=>[e.useHTML?(t.openBlock(),t.createElementBlock("span",{key:0,innerHTML:e.message},null,8,at)):(t.openBlock(),t.createElementBlock("span",it,t.toDisplayString(e.message),1)),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:2,class:t.normalizeClass([e.cn.element("close-icon")]),onClick:n[0]||(n[0]=(...c)=>e.handleClose&&e.handleClose(...c))},null,2)):t.createCommentVNode("",!0)])],6),[[t.vShow,e.visible]])]),_:3},8,["onBeforeLeave"])}const dt=N(st,[["render",ct]]),q=new WeakMap,H=e=>{(typeof e=="string"||t.isVNode(e))&&(e={message:e});const n=W(e.renderTo||"body");q.has(n)||q.set(n,[]);const l=q.get(n);let o=e.offset||20;l.forEach(c=>{var i;o+=((i=c.el)==null?void 0:i.offsetHeight)+20});const a=e.onClose;let r={};r={...e,onClose:()=>{var d;const c=l.findIndex(g=>g===m);if(c<0)return;const i=((d=m.el)==null?void 0:d.offsetHeight)+20;l.slice(c+1).forEach(g=>{var b;const h=(b=g.component)==null?void 0:b.props.offset;g.component.props.offset=h-i}),l.splice(c,1),a&&a(m)},onDestroy:()=>{t.render(null,u)},offset:o};const m=t.createVNode(dt,r,p(r.message)||t.isVNode(r.message)?{default:p(r.message)?r.message:()=>r.message}:null),u=document.createElement("div");return t.render(m,u),n.tagName==="BODY"?m.el.style.position="fixed":(n.style.position="relative",m.el.style.position="absolute"),n.appendChild(u.firstElementChild),l.push(m),{close:()=>{m.component.proxy.handleClose()}}};(()=>{xe.forEach(e=>{H[e]=n=>te(n)?H({type:e,...n}):H({message:n,type:e})})})();const ft=["info","success","warning","strong","error"];function de(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const x=E("message-box"),J=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=i=>{if(i==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(i==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(i,d)=>{i==="cancel"&&e.onCancel&&e.onCancel(d),i==="ok"&&e.onOk&&e.onOk(d)},r=i=>{let d;switch(i){case"warning":d=t.createVNode(X,{size:"22px",color:"#f6c64b"},null);break;case"strong":d=t.createVNode(G,{size:"22px",color:"#ff7125"},null);break;case"error":d=t.createVNode(Z,{size:"22px",color:"#e24f48"},null);break;case"success":d=t.createVNode(K,{size:"22px",color:"#68d1ab"},null);break;case"info":d=t.createVNode(Y,{size:"22px",color:"#2355f5"},null);break}return t.createVNode("div",{className:x.element("icon")},[d])},f=i=>{if(t.isVNode(i))return i;if(p(i)){const d=i();return t.isVNode(d)?d:null}return t.createVNode("div",{className:x.element("title")},[t.createTextVNode(" "),i,t.createTextVNode(" ")])},s=i=>{if(t.isVNode(i))return i;if(p(i)){const d=i();return t.isVNode(d)?d:null}return t.createVNode("div",{className:x.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},m=()=>()=>t.createVNode(t.Fragment,null,[r(e.type||"success"),e.title&&f(e.title)]),u=()=>()=>t.createVNode(t.Fragment,null,[e.content&&s(e.content)]),C=()=>{if(t.isVNode(e.footer)||p(e.footer))return e.footer;const i=(e==null?void 0:e.cancelText)||"取消",d=(e==null?void 0:e.okText)||"确认";return g=>t.createVNode(ae,{size:12},{default:()=>{var h,b;return[!e.hideCancel&&t.createVNode(P,{size:"small",onClick:g.cancel,loading:(h=g.loadingObj)==null?void 0:h.cancel},de(i)?i:{default:()=>[i]}),!e.hideOk&&t.createVNode(P,{type:"primary",size:"small",onClick:g.ok,loading:(b=g.loadingObj)==null?void 0:b.ok},de(d)?d:{default:()=>[d]})]}})},c=t.createVNode(se,{messageBox:!0,width:(e==null?void 0:e.width)??358,height:(e==null?void 0:e.height)??"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(e==null?void 0:e.center)??!0,top:(e==null?void 0:e.top)??0,mask:(e==null?void 0:e.mask)??!0,maskToClose:(e==null?void 0:e.maskToClose)??!0,popupClass:e.popupClass,onClose:a,onBeforeCancel:o,"onUpdate:modelValue":()=>{c.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:m(),default:u(),footer:C()});t.render(c,n)};(()=>{ft.forEach(e=>{J[e]=(n,l)=>{const o=[],a=[];let r=()=>!0,f=()=>!0;return setTimeout(()=>{J({title:n,content:l,type:e,beforeOnCancel:f,beforeOnOk:r,onOk:()=>{o.forEach(s=>p(s)&&s())},onCancel:()=>{a.forEach(s=>p(s)&&s())}})},0),{ok(...s){return s.length===1&&o.push(s[0]),s.length===2&&(r=s[0],o.push(s[1])),this},cancel(...s){return s.length===1&&a.push(s[0]),s.length===2&&(f=s[0],a.push(s[1])),this}}}})})();const mt={position:{type:String,default:"top-right"},offset:{type:Number,default:0},title:{type:String,default:""},type:{type:String,default:"info"},message:{type:String,default:void 0},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},onClose:{type:Function,default:()=>{}},renderToBody:{type:Boolean,default:!1}},ut=t.defineComponent({name:$("Notification"),props:mt,emits:["close","destroy"],setup(e){const n=E("notification"),l=n.block,o=t.computed(()=>[l,n.modifier(r.value.ver)]),{zIndex:a}=U("message",{runOnMounted:!0}),r=t.computed(()=>{const d=e.position.split("-");return{hor:d[1],ver:d[0]}}),f=t.computed(()=>`x-notification-slide-${r.value.hor}`),s=t.computed(()=>{const d={};return d.position=e.renderToBody?"fixed":"absolute",d.zIndex=a.value,d[r.value.hor]="20px",d[r.value.ver]=`${e.offset}px`,d}),m=t.ref(!1);let u=0;const C=()=>{setTimeout(()=>{m.value=!1},e.duration)},c=t.computed(()=>e.type==="info"?Y:e.type==="warning"?X:e.type==="strong"?G:e.type==="success"?K:e.type==="error"?Z:""),i=()=>{m.value=!1};return t.onMounted(()=>{e.duration!==0&&C(),m.value=!0}),t.onUnmounted(()=>{clearTimeout(u)}),{ns:l,cn:n,cls:o,animationClsName:f,positionStyle:s,visible:m,positionPropMap:r,currentIcon:c,handleClose:i}}});function Ct(e,n,l,o,a,r){return t.openBlock(),t.createBlock(t.Transition,{name:e.animationClsName,onBeforeLeave:n[1]||(n[1]=f=>e.$emit("close")),onAfterLeave:n[2]||(n[2]=f=>e.$emit("destroy"))},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.positionStyle)},[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("header")])},[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("icon"),e.cn.modifier(`icon-${e.type}`)])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.currentIcon)))],2),t.createElementVNode("div",null,[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("title")])},t.toDisplayString(e.title),3),t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("message")])},[t.renderSlot(e.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(e.message),1)])],2)])],2),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("close-icon")]),onClick:n[0]||(n[0]=t.withModifiers((...f)=>e.handleClose&&e.handleClose(...f),["self"]))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.visible]])]),_:3},8,["name"])}const yt=N(ut,[["render",Ct]]),L=new WeakMap,gt=e=>{const n=W(e.renderTo||"body"),l=document.createElement("div");L.get(n)||L.set(n,{}),L.get(n)[e.position]||(L.get(n)[e.position]=[]);const o=L.get(n)[e.position];let a=e.offset||20;o.forEach(C=>{var c;a+=((c=C.el)==null?void 0:c.offsetHeight)+20});const r=n.tagName==="BODY";r||(n.style.position="relative",n.style.overflowX="hidden");const f=e.onClose,s=()=>{var i;const C=o.findIndex(d=>d===u);if(C<0)return;const c=((i=u.el)==null?void 0:i.offsetHeight)+20;o.slice(C+1).forEach(d=>{var h;const g=(h=d.component)==null?void 0:h.props.offset;d.component.props.offset=g-c}),o.splice(C,1),f&&f(u)},m=()=>{t.render(null,l)},u=t.createVNode(yt,{message:e.message,title:e.title,type:e.type,offset:a,renderToBody:r,position:e.position,duration:e.duration??3e3,showClose:e.showClose??!0,onClose:s,onDestroy:m},p(e.message)||t.isVNode(e.message)?{default:p(e.message)?e.message:()=>e.message}:null);t.render(u,l),o.push(u),n==null||n.appendChild(l.firstChild)};k.Dialog=qe,k.Message=H,k.MessageBox=J,k.Notification=gt,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
@@ -1,66 +1,53 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
"
|
7
|
-
"
|
8
|
-
|
2
|
+
"name": "x-next",
|
3
|
+
"private": false,
|
4
|
+
"version": "0.0.0-alpha.4",
|
5
|
+
"description": "An amazing Vue3 UI library.",
|
6
|
+
"type": "module",
|
7
|
+
"main": "dist/index.umd.js",
|
8
|
+
"module": "dist/index.es.js",
|
9
|
+
"types": "dist/ui.d.ts",
|
10
|
+
"scripts": {
|
11
|
+
"dev": "vite",
|
12
|
+
"build": "vue-tsc && vite build",
|
13
|
+
"preview": "vite preview",
|
14
|
+
"publish": "npm publish --access=public"
|
9
15
|
},
|
10
16
|
"repository": {
|
11
17
|
"type": "git",
|
12
|
-
"url": "https://github.com/ztes/x-next.git"
|
18
|
+
"url": "git+https://github.com/ztes/x-next.git"
|
13
19
|
},
|
14
20
|
"bugs": {
|
15
21
|
"url": "https://github.com/ztes/x-next/issues"
|
16
22
|
},
|
17
|
-
"
|
18
|
-
|
19
|
-
|
23
|
+
"dependencies": {
|
24
|
+
"dayjs": "^1.11.11",
|
25
|
+
"vue": "^3.5.12"
|
26
|
+
},
|
27
|
+
"devDependencies": {
|
28
|
+
"@types/node": "^20.12.7",
|
29
|
+
"@vitejs/plugin-vue": "^5.0.4",
|
30
|
+
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
31
|
+
"sass": "^1.80.3",
|
32
|
+
"typescript": "^5.2.2",
|
33
|
+
"vite": "^5.2.0",
|
34
|
+
"vite-plugin-dts": "^4.3.0",
|
35
|
+
"vue-tsc": "^2.0.6"
|
36
|
+
},
|
20
37
|
"publishConfig": {
|
21
38
|
"access": "public"
|
22
39
|
},
|
23
|
-
"description": "A simple Vue 3 UI component. ",
|
24
40
|
"keywords": [
|
25
41
|
"vue",
|
26
42
|
"vue 3",
|
27
43
|
"component"
|
28
44
|
],
|
29
|
-
"
|
30
|
-
|
31
|
-
|
32
|
-
"files": [
|
33
|
-
"dist"
|
34
|
-
],
|
35
|
-
"scripts": {
|
36
|
-
"dev": "vite",
|
37
|
-
"dev:docs": "vitepress dev docs",
|
38
|
-
"build:component": "vite build",
|
39
|
-
"build:docs": "vitepress build docs",
|
40
|
-
"preview:docs": "vitepress preview docs",
|
41
|
-
"format": "prettier -w ."
|
42
|
-
},
|
43
|
-
"devDependencies": {
|
44
|
-
"@babel/types": "^7.22.4",
|
45
|
-
"@types/node": "^20.2.5",
|
46
|
-
"@vitejs/plugin-vue": "^4.2.3",
|
47
|
-
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
48
|
-
"@vue/compiler-sfc": "^3.5.12",
|
49
|
-
"prettier": "^2.8.8",
|
50
|
-
"sass": "^1.80.3",
|
51
|
-
"sass-loader": "^16.0.2",
|
52
|
-
"typescript": "^5.4.5",
|
53
|
-
"vite": "^5.2.13",
|
54
|
-
"vite-plugin-css-injected-by-js": "^3.1.1",
|
55
|
-
"vite-plugin-dts": "^2.3.0",
|
56
|
-
"vitepress": "^1.4.1",
|
57
|
-
"vue": "^3.5.12"
|
58
|
-
},
|
59
|
-
"peerDependencies": {
|
60
|
-
"vue": "^3.0.0"
|
45
|
+
"author": {
|
46
|
+
"email": "xy@ztes.com",
|
47
|
+
"name": "XuYu"
|
61
48
|
},
|
62
|
-
"
|
63
|
-
|
64
|
-
"
|
65
|
-
|
49
|
+
"license": "MIT",
|
50
|
+
"files": [
|
51
|
+
"x-next"
|
52
|
+
]
|
66
53
|
}
|
package/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2020 Ilia Borovitinov
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
package/dist/favicon.ico
DELETED
Binary file
|
package/dist/index.d.ts
DELETED
File without changes
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import type { Ref } from 'vue';
|
2
|
-
export type PopupType = 'popup' | 'dialog' | 'message';
|
3
|
-
export default function usePopupManager(type: PopupType, { visible, runOnMounted, }?: {
|
4
|
-
visible?: Ref<boolean>;
|
5
|
-
runOnMounted?: boolean;
|
6
|
-
}): {
|
7
|
-
zIndex: Readonly<Ref<number, number>>;
|
8
|
-
open: () => void;
|
9
|
-
close: () => void;
|
10
|
-
isLastDialog: () => boolean;
|
11
|
-
};
|
@@ -1,13 +0,0 @@
|
|
1
|
-
type NamedColor = 'aliceblue' | 'antiquewhite' | 'aqua' | 'aquamarine' | 'azure' | 'beige' | 'bisque' | 'black' | 'blanchedalmond' | 'blue' | 'blueviolet' | 'brown' | 'burlywood' | 'cadetblue' | 'chartreuse' | 'chocolate' | 'coral' | 'cornflowerblue' | 'cornsilk' | 'crimson' | 'cyan' | 'darkblue' | 'darkcyan' | 'darkgoldenrod' | 'darkgray' | 'darkgreen' | 'darkgrey' | 'darkkhaki' | 'darkmagenta' | 'darkolivegreen' | 'darkorange' | 'darkorchid' | 'darkred' | 'darksalmon' | 'darkseagreen' | 'darkslateblue' | 'darkslategray' | 'darkslategrey' | 'darkturquoise' | 'darkviolet' | 'deeppink' | 'deepskyblue' | 'dimgray' | 'dimgrey' | 'dodgerblue' | 'firebrick' | 'floralwhite' | 'forestgreen' | 'fuchsia' | 'gainsboro' | 'ghostwhite' | 'gold' | 'goldenrod' | 'gray' | 'green' | 'greenyellow' | 'grey' | 'honeydew' | 'hotpink' | 'indianred' | 'indigo' | 'ivory' | 'khaki' | 'lavender' | 'lavenderblush' | 'lawngreen' | 'lemonchiffon' | 'lightblue' | 'lightcoral' | 'lightcyan' | 'lightgoldenrodyellow' | 'lightgray' | 'lightgreen' | 'lightgrey' | 'lightpink' | 'lightsalmon' | 'lightseagreen' | 'lightskyblue' | 'lightslategray' | 'lightslategrey' | 'lightsteelblue' | 'lightyellow' | 'lime' | 'limegreen' | 'linen' | 'magenta' | 'maroon' | 'mediumaquamarine' | 'mediumblue' | 'mediumorchid' | 'mediumpurple' | 'mediumseagreen' | 'mediumslateblue' | 'mediumspringgreen' | 'mediumturquoise' | 'mediumvioletred' | 'midnightblue' | 'mintcream' | 'mistyrose' | 'moccasin' | 'navajowhite' | 'navy' | 'oldlace' | 'olive' | 'olivedrab' | 'orange' | 'orangered' | 'orchid' | 'palegoldenrod' | 'palegreen' | 'paleturquoise' | 'palevioletred' | 'papayawhip' | 'peachpuff' | 'peru' | 'pink' | 'plum' | 'powderblue' | 'purple' | 'red' | 'rosybrown' | 'royalblue' | 'saddlebrown' | 'salmon' | 'sandybrown' | 'seagreen' | 'seashell' | 'sienna' | 'silver' | 'skyblue' | 'slateblue' | 'slategray' | 'slategrey' | 'snow' | 'springgreen' | 'steelblue' | 'tan' | 'teal' | 'thistle' | 'tomato' | 'turquoise' | 'violet' | 'wheat' | 'white' | 'whitesmoke' | 'yellow' | 'yellowgreen';
|
2
|
-
type HexColor = `#${string}`;
|
3
|
-
type RgbColor = `rgb(${number}, ${number}, ${number})`;
|
4
|
-
type RgbaColor = `rgba(${number}, ${number}, ${number}, ${number})`;
|
5
|
-
type HslColor = `hsl(${number}, ${number}%, ${number}%)`;
|
6
|
-
type HslaColor = `hsla(${number}, ${number}%, ${number}%, ${number})`;
|
7
|
-
export type CSSColor = NamedColor | HexColor | RgbColor | RgbaColor | HslColor | HslaColor;
|
8
|
-
type CSSUnit = 'px' | 'em' | 'rem' | 'vw' | 'vh' | 'vmin' | 'vmax' | '%' | 'pt' | 'cm' | 'mm' | 'in' | 'pc' | 'ex' | 'ch';
|
9
|
-
export type LengthValue = `${number}${CSSUnit}`;
|
10
|
-
type GlobalValues = 'auto' | 'inherit' | 'initial' | 'unset';
|
11
|
-
type PaddingMarginValue = LengthValue | `${number}` | GlobalValues;
|
12
|
-
export type PaddingMargin = PaddingMarginValue | [PaddingMarginValue, PaddingMarginValue] | [PaddingMarginValue, PaddingMarginValue, PaddingMarginValue] | [PaddingMarginValue, PaddingMarginValue, PaddingMarginValue, PaddingMarginValue];
|
13
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export type ComponentSize = 'mini' | 'small' | 'medium' | 'large';
|
@@ -1,9 +0,0 @@
|
|
1
|
-
export declare const COMPONENT_INSTALLED_KEY: unique symbol;
|
2
|
-
export declare const getClassPrefix: (name?: string) => string;
|
3
|
-
export declare const getComponentPrefix: (name: string) => string;
|
4
|
-
export declare const getClassNameMixin: (name: string) => {
|
5
|
-
block: string;
|
6
|
-
element: (className: string) => string;
|
7
|
-
modifier: (className: string) => string;
|
8
|
-
is: (className: string) => string;
|
9
|
-
};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { CSSProperties } from 'vue';
|
2
|
-
export declare const NOOP: () => void;
|
3
|
-
export declare const querySelector: (selectors: string, container?: Document | HTMLElement) => HTMLElement | undefined;
|
4
|
-
export declare const getScrollBarWidth: (element: HTMLElement) => number;
|
5
|
-
export declare const isScroll: (element: HTMLElement) => boolean;
|
6
|
-
export declare const getStyle: (element: HTMLElement, styleName: keyof CSSProperties) => string;
|
7
|
-
export declare const setStyle: (element: HTMLElement, styleName: CSSProperties | keyof CSSProperties, value?: string | number) => void;
|
8
|
-
export declare const getElement: (target: string | HTMLElement | undefined, container?: Document | HTMLElement) => HTMLElement | undefined;
|
9
|
-
export declare const on: <K extends keyof HTMLElementEventMap>(element: HTMLElement | Window, event: K, handler: (ev: HTMLElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
|
10
|
-
export declare const off: <K extends keyof HTMLElementEventMap>(element: HTMLElement | Window, type: K, handler: (ev: HTMLElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
export declare const getProp: (target: any, path: any, defVal?: any) => any;
|
2
|
-
export declare const setProp: (target: any, path: any, value: any) => any;
|
3
|
-
export declare const deepClone: (obj: any, set?: any) => any;
|
4
|
-
export declare const NOOP: () => void;
|
5
|
-
export declare const addUnit: (value: string | number | undefined, unit?: string) => string;
|
6
|
-
export declare const upperFirstChar: (text: string) => string | undefined;
|
7
|
-
export declare const compose: <T>(...fns: ((...v: T[]) => T)[]) => (...v: T[]) => T;
|
8
|
-
export declare const pipe: <T>(...fns: ((...v: T[]) => T)[]) => (...v: T[]) => T;
|
9
|
-
export declare const findLastIndex: (arr: never[] | undefined, callback: (item: any, i: number, origin: any[]) => boolean) => number;
|
10
|
-
export declare const getUniqueId: (size?: number) => string;
|
11
|
-
export declare const genMatrix: (list: any[], row: number) => any[];
|
12
|
-
export declare const sleep: (delay?: number) => Promise<unknown>;
|
@@ -1,59 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* 首字母大写及-符号仅跟的字母大写
|
3
|
-
* @param str
|
4
|
-
*/
|
5
|
-
export declare const toPascalCase: (str: string) => string;
|
6
|
-
export declare function createIconComponent(name: string): import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
7
|
-
size: {
|
8
|
-
type: (StringConstructor | NumberConstructor)[];
|
9
|
-
default: undefined;
|
10
|
-
};
|
11
|
-
rotate: {
|
12
|
-
type: NumberConstructor;
|
13
|
-
default: undefined;
|
14
|
-
};
|
15
|
-
spin: {
|
16
|
-
type: BooleanConstructor;
|
17
|
-
default: boolean;
|
18
|
-
};
|
19
|
-
color: {
|
20
|
-
type: StringConstructor;
|
21
|
-
default: undefined;
|
22
|
-
};
|
23
|
-
fillColor: {
|
24
|
-
type: ArrayConstructor;
|
25
|
-
default: undefined;
|
26
|
-
};
|
27
|
-
}>, {
|
28
|
-
cls: import("vue").ComputedRef<(string | {
|
29
|
-
[x: string]: boolean;
|
30
|
-
})[]>;
|
31
|
-
styles: import("vue").ComputedRef<import("vue").CSSProperties>;
|
32
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
33
|
-
size: {
|
34
|
-
type: (StringConstructor | NumberConstructor)[];
|
35
|
-
default: undefined;
|
36
|
-
};
|
37
|
-
rotate: {
|
38
|
-
type: NumberConstructor;
|
39
|
-
default: undefined;
|
40
|
-
};
|
41
|
-
spin: {
|
42
|
-
type: BooleanConstructor;
|
43
|
-
default: boolean;
|
44
|
-
};
|
45
|
-
color: {
|
46
|
-
type: StringConstructor;
|
47
|
-
default: undefined;
|
48
|
-
};
|
49
|
-
fillColor: {
|
50
|
-
type: ArrayConstructor;
|
51
|
-
default: undefined;
|
52
|
-
};
|
53
|
-
}>> & Readonly<{}>, {
|
54
|
-
color: string;
|
55
|
-
rotate: number;
|
56
|
-
size: string | number;
|
57
|
-
spin: boolean;
|
58
|
-
fillColor: unknown[];
|
59
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import type { ComponentPublicInstance, VNodeNormalizedChildren } from 'vue';
|
2
|
-
import { Dayjs } from 'dayjs';
|
3
|
-
import { VNode } from 'vue';
|
4
|
-
export declare function isArray(obj: any): obj is any[];
|
5
|
-
export declare function isNull(obj: any): obj is null;
|
6
|
-
export declare function isBoolean(obj: unknown): obj is boolean;
|
7
|
-
export declare function isObject<T>(obj: T): obj is Extract<T, Record<string, any>>;
|
8
|
-
export declare const isPromise: <T>(obj: unknown) => obj is Promise<T>;
|
9
|
-
export declare function isString(obj: any): obj is string;
|
10
|
-
export declare function isNumber(obj: any): obj is number;
|
11
|
-
export declare function isRegExp(obj: any): boolean;
|
12
|
-
export declare function isDate(obj: any): boolean;
|
13
|
-
export declare function isColor(color: any): boolean;
|
14
|
-
export declare function isUndefined(obj: any): obj is undefined;
|
15
|
-
export declare function isFunction(obj: any): obj is (...args: any[]) => any;
|
16
|
-
export declare function isEmptyObject(obj: any): boolean;
|
17
|
-
export declare function isExist(obj: any): boolean;
|
18
|
-
export declare function isWindow(el: any): el is Window;
|
19
|
-
export declare const isComponentInstance: (value: any) => value is ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}, {}, {}, string, import("vue").ComponentProvideOptions>, {}, {}, "", {}, any>;
|
20
|
-
export declare const isArrayChildren: (children: VNodeNormalizedChildren) => children is VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
21
|
-
[key: string]: any;
|
22
|
-
}>[];
|
23
|
-
export declare const isQuarter: (fromat: string) => boolean;
|
24
|
-
export declare function isDayjs(time: any): time is Dayjs;
|
25
|
-
export declare function isClient(): boolean;
|
@@ -1,24 +0,0 @@
|
|
1
|
-
export declare const KEYBOARD_KEY: {
|
2
|
-
ENTER: string;
|
3
|
-
ESC: string;
|
4
|
-
BACKSPACE: string;
|
5
|
-
TAB: string;
|
6
|
-
SPACE: string;
|
7
|
-
ARROW_UP: string;
|
8
|
-
ARROW_DOWN: string;
|
9
|
-
ARROW_LEFT: string;
|
10
|
-
ARROW_RIGHT: string;
|
11
|
-
};
|
12
|
-
export interface CodeKey {
|
13
|
-
/** Keyboard key */
|
14
|
-
key: string;
|
15
|
-
/** Ctrl / ⌃ */
|
16
|
-
ctrl?: boolean;
|
17
|
-
/** Shift key */
|
18
|
-
shift?: boolean;
|
19
|
-
/** Alt / ⌥ */
|
20
|
-
alt?: boolean;
|
21
|
-
/** meta ⌘ / ⊞ */
|
22
|
-
meta?: boolean;
|
23
|
-
}
|
24
|
-
export declare const getKeyDownHandler: (codeKeyMap: Map<string | CodeKey, (e: Event) => void>) => (event: KeyboardEvent) => void;
|
File without changes
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import type { VNodeTypes, VNode, PropType, Component, Plugin } from 'vue';
|
2
|
-
export type SFCWithInstall<T> = T & Plugin;
|
3
|
-
/**
|
4
|
-
* @description Vue生态操作封装
|
5
|
-
*/
|
6
|
-
export declare const definePropType: <T>(val: unknown) => PropType<T>;
|
7
|
-
export declare enum ShapeFlags {
|
8
|
-
ELEMENT = 1,
|
9
|
-
FUNCTIONAL_COMPONENT = 2,
|
10
|
-
STATEFUL_COMPONENT = 4,
|
11
|
-
COMPONENT = 6,
|
12
|
-
TEXT_CHILDREN = 8,
|
13
|
-
ARRAY_CHILDREN = 16,
|
14
|
-
SLOTS_CHILDREN = 32,
|
15
|
-
TELEPORT = 64,
|
16
|
-
SUSPENSE = 128,
|
17
|
-
COMPONENT_SHOULD_KEEP_ALIVE = 256,
|
18
|
-
COMPONENT_KEPT_ALIVE = 512
|
19
|
-
}
|
20
|
-
export declare const isElement: (vn: VNode) => boolean;
|
21
|
-
export declare const isComponent: (vn: VNode, type?: VNodeTypes) => type is Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>;
|
22
|
-
export declare const isTextChildren: (child: VNode, children: VNode['children']) => children is string;
|
23
|
-
export declare const isArrayChildren: (vn: VNode, children: VNode['children']) => children is VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
24
|
-
[key: string]: any;
|
25
|
-
}>[];
|
26
|
-
export declare const isSlotsChildren: (vn: VNode, children: VNode['children']) => children is Readonly<{
|
27
|
-
[name: string]: import("vue").Slot<any> | undefined;
|
28
|
-
}>;
|
29
|
-
export declare const getAllElements: (children: VNode[] | undefined, includeText?: boolean) => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
30
|
-
[key: string]: any;
|
31
|
-
}>[];
|
32
|
-
export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E | undefined) => SFCWithInstall<T> & E;
|