vue-devui 1.5.4-alpha.0 → 1.5.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/action-timeline/index.es.js +161 -0
- package/action-timeline/index.umd.js +1 -0
- package/action-timeline/package.json +8 -0
- package/action-timeline/style.css +1 -0
- package/code-editor/index.es.js +1 -1
- package/code-editor/index.umd.js +1 -1
- package/global.d.ts +5 -4
- package/modal/index.es.js +10 -10
- package/modal/index.umd.js +1 -1
- package/nuxt/components/ActionTimeline.js +3 -0
- package/nuxt/components/ModalBody.js +3 -0
- package/nuxt/components/ModalFooter.js +3 -0
- package/nuxt/components/ModalHeader.js +3 -0
- package/nuxt/components/SplitterPane.js +3 -0
- package/nuxt/components/actionTimelineProps.js +3 -0
- package/package.json +1 -1
- package/splitter/index.es.js +1 -1
- package/splitter/index.umd.js +7 -7
- package/style.css +1 -1
- package/types/action-timeline/index.d.ts +11 -0
- package/types/action-timeline/src/action-timeline-types.d.ts +46 -0
- package/types/action-timeline/src/action-timeline.d.ts +55 -0
- package/types/auto-complete/src/auto-complete.d.ts +1 -1
- package/types/carousel/index.d.ts +1 -2
- package/types/modal/index.d.ts +4 -1
- package/types/splitter/index.d.ts +2 -1
- package/types/upload/index.d.ts +2 -1
- package/types/vue-devui.d.ts +5 -4
- package/upload/index.es.js +1 -1
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +176 -16
- package/vue-devui.umd.js +10 -10
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { defineComponent, toRefs, computed, createVNode, Fragment } from "vue";
|
|
2
|
+
const actionTimelineProps = {
|
|
3
|
+
data: {
|
|
4
|
+
type: Array
|
|
5
|
+
},
|
|
6
|
+
layout: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "horizontal"
|
|
9
|
+
},
|
|
10
|
+
loadMoreConfig: {
|
|
11
|
+
type: Object
|
|
12
|
+
},
|
|
13
|
+
showTailLine: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: true
|
|
16
|
+
},
|
|
17
|
+
showStatusBgColor: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
showStatusLineColor: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var actionTimeline = "";
|
|
27
|
+
var ActionTimeline = defineComponent({
|
|
28
|
+
name: "DActionTimeline",
|
|
29
|
+
props: actionTimelineProps,
|
|
30
|
+
emits: ["actionLoadMore"],
|
|
31
|
+
setup(props, ctx) {
|
|
32
|
+
const {
|
|
33
|
+
layout,
|
|
34
|
+
data,
|
|
35
|
+
showTailLine,
|
|
36
|
+
showStatusBgColor,
|
|
37
|
+
showStatusLineColor,
|
|
38
|
+
loadMoreConfig
|
|
39
|
+
} = toRefs(props);
|
|
40
|
+
const isVertical = computed(() => layout.value === "vertical");
|
|
41
|
+
const containerClass = computed(() => ({
|
|
42
|
+
"dp-action-timeline": true,
|
|
43
|
+
"dp-action-timeline-status-bg": showStatusBgColor.value,
|
|
44
|
+
"dp-action-timeline-status-line": showStatusLineColor.value
|
|
45
|
+
}));
|
|
46
|
+
const timelineItemClass = (childIndex, parentIndex, actionData, item) => ({
|
|
47
|
+
"dp-action-timeline-item": true,
|
|
48
|
+
"dp-action-timeline-item-info": showStatusLineColor.value && item.status === "color-info",
|
|
49
|
+
"dp-action-timeline-item-danger": showStatusLineColor.value && item.status === "color-danger",
|
|
50
|
+
"dp-action-timeline-item-success": showStatusLineColor.value && item.status === "color-info",
|
|
51
|
+
"vertical-list-item": isVertical.value,
|
|
52
|
+
"list-last-item": actionData.actions && (data == null ? void 0 : data.value) && childIndex === actionData.actions.length - 1 && parentIndex === data.value.length - 1 && showTailLine.value
|
|
53
|
+
});
|
|
54
|
+
const itemIconClass = (item, flag = false) => {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
if (flag) {
|
|
57
|
+
return {
|
|
58
|
+
"dp-action-timeline-list-icon": true,
|
|
59
|
+
"item-empty-icon": !item.icon,
|
|
60
|
+
[(_a = item.status) != null ? _a : ""]: true
|
|
61
|
+
};
|
|
62
|
+
} else {
|
|
63
|
+
return {
|
|
64
|
+
icon: true,
|
|
65
|
+
[(_b = item.icon) != null ? _b : ""]: true
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const renderVerticalBody = (actionData, parentIndex) => {
|
|
70
|
+
var _a;
|
|
71
|
+
return (_a = actionData.actions) == null ? void 0 : _a.map((item, index2) => {
|
|
72
|
+
var _a2, _b, _c, _d;
|
|
73
|
+
return createVNode("div", {
|
|
74
|
+
"class": timelineItemClass(index2, parentIndex, actionData, item)
|
|
75
|
+
}, [createVNode("div", {
|
|
76
|
+
"class": "vertical-list-item-top"
|
|
77
|
+
}, [createVNode("div", {
|
|
78
|
+
"class": "vertical-list-item-top-left"
|
|
79
|
+
}, [createVNode("div", {
|
|
80
|
+
"class": itemIconClass(item, true)
|
|
81
|
+
}, [!item.icon && createVNode("div", {
|
|
82
|
+
"class": "list-empty-icon-dot"
|
|
83
|
+
}, null), createVNode("em", {
|
|
84
|
+
"class": itemIconClass(item)
|
|
85
|
+
}, null)]), createVNode("div", {
|
|
86
|
+
"class": "vertical-list-item-top-left-title"
|
|
87
|
+
}, [(_b = (_a2 = ctx.slots).title) == null ? void 0 : _b.call(_a2, {
|
|
88
|
+
option: item
|
|
89
|
+
})])]), createVNode("div", {
|
|
90
|
+
"class": "dp-action-timeline-item-data"
|
|
91
|
+
}, [item.createdAt])]), createVNode("div", {
|
|
92
|
+
"class": "vertical-list-item-bottom"
|
|
93
|
+
}, [(_d = (_c = ctx.slots).content) == null ? void 0 : _d.call(_c, {
|
|
94
|
+
option: item
|
|
95
|
+
})])]);
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
const renderHorizontalBody = (actionData, parentIndex) => {
|
|
99
|
+
var _a;
|
|
100
|
+
return (_a = actionData.actions) == null ? void 0 : _a.map((item, index2) => {
|
|
101
|
+
var _a2, _b, _c;
|
|
102
|
+
return createVNode("div", {
|
|
103
|
+
"class": timelineItemClass(index2, parentIndex, actionData, item)
|
|
104
|
+
}, [createVNode("div", {
|
|
105
|
+
"class": itemIconClass(item, true)
|
|
106
|
+
}, [!item.icon && createVNode("div", {
|
|
107
|
+
"class": "list-empty-icon-dot"
|
|
108
|
+
}, null), createVNode("em", {
|
|
109
|
+
"class": itemIconClass(item)
|
|
110
|
+
}, null)]), createVNode("div", {
|
|
111
|
+
"class": "dp-action-timeline-list-data"
|
|
112
|
+
}, [(_b = (_a2 = ctx.slots).content) == null ? void 0 : _b.call(_a2, {
|
|
113
|
+
option: item
|
|
114
|
+
})]), createVNode("div", {
|
|
115
|
+
"class": "dp-action-timeline-item-date"
|
|
116
|
+
}, [item.createdAt]), !(actionData.actions && (data == null ? void 0 : data.value) && index2 === actionData.actions.length - 1 && parentIndex === ((_c = data == null ? void 0 : data.value) == null ? void 0 : _c.length) - 1) && createVNode("div", {
|
|
117
|
+
"class": "border-bottom"
|
|
118
|
+
}, null)]);
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
const handleLoadMoreClicked = () => {
|
|
122
|
+
ctx.emit("actionLoadMore");
|
|
123
|
+
};
|
|
124
|
+
const handleBackTopClicked = () => {
|
|
125
|
+
window.scrollTo(0, 0);
|
|
126
|
+
};
|
|
127
|
+
const renderLoadMore = () => {
|
|
128
|
+
var _a, _b;
|
|
129
|
+
return createVNode("div", {
|
|
130
|
+
"class": "dp-action-timeline-operation-container"
|
|
131
|
+
}, [((_a = loadMoreConfig == null ? void 0 : loadMoreConfig.value) == null ? void 0 : _a.loadMore) && createVNode("div", {
|
|
132
|
+
"class": "dp-action-timeline-operation",
|
|
133
|
+
"onClick": handleLoadMoreClicked
|
|
134
|
+
}, [loadMoreConfig.value.loadMoreText]), ((_b = loadMoreConfig == null ? void 0 : loadMoreConfig.value) == null ? void 0 : _b.isToTop) && createVNode("div", {
|
|
135
|
+
"class": "dp-action-timeline-operation",
|
|
136
|
+
"onClick": handleBackTopClicked
|
|
137
|
+
}, [loadMoreConfig.value.toTopText])]);
|
|
138
|
+
};
|
|
139
|
+
return () => {
|
|
140
|
+
var _a, _b;
|
|
141
|
+
return createVNode(Fragment, null, [(_a = data == null ? void 0 : data.value) == null ? void 0 : _a.map((item, parentIndex) => createVNode("div", {
|
|
142
|
+
"class": containerClass.value
|
|
143
|
+
}, [createVNode("div", {
|
|
144
|
+
"class": "dp-action-timeline-title"
|
|
145
|
+
}, [createVNode("p", null, [item.time])]), createVNode("div", {
|
|
146
|
+
"class": "dp-action-timeline-body"
|
|
147
|
+
}, [isVertical.value ? renderVerticalBody(item, parentIndex) : renderHorizontalBody(item, parentIndex)]), createVNode("div", {
|
|
148
|
+
"class": "border-left"
|
|
149
|
+
}, null)])), Boolean((_b = data == null ? void 0 : data.value) == null ? void 0 : _b.length) && renderLoadMore()]);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
var index = {
|
|
154
|
+
title: "ActionTimeline \u64CD\u4F5C\u65F6\u95F4\u8F74",
|
|
155
|
+
category: "\u6F14\u8FDB\u4E2D",
|
|
156
|
+
status: "100%",
|
|
157
|
+
install(app) {
|
|
158
|
+
app.component(ActionTimeline.name, ActionTimeline);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
export { ActionTimeline, actionTimelineProps, index as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.index={},a.Vue))})(this,function(a,e){"use strict";const v={data:{type:Array},layout:{type:String,default:"horizontal"},loadMoreConfig:{type:Object},showTailLine:{type:Boolean,default:!0},showStatusBgColor:{type:Boolean,default:!1},showStatusLineColor:{type:Boolean,default:!1}};var k="",f=e.defineComponent({name:"DActionTimeline",props:v,emits:["actionLoadMore"],setup(N,u){const{layout:C,data:i,showTailLine:B,showStatusBgColor:b,showStatusLineColor:p,loadMoreConfig:s}=e.toRefs(N),y=e.computed(()=>C.value==="vertical"),w=e.computed(()=>({"dp-action-timeline":!0,"dp-action-timeline-status-bg":b.value,"dp-action-timeline-status-line":p.value})),T=(o,n,l,t)=>({"dp-action-timeline-item":!0,"dp-action-timeline-item-info":p.value&&t.status==="color-info","dp-action-timeline-item-danger":p.value&&t.status==="color-danger","dp-action-timeline-item-success":p.value&&t.status==="color-info","vertical-list-item":y.value,"list-last-item":l.actions&&(i==null?void 0:i.value)&&o===l.actions.length-1&&n===i.value.length-1&&B.value}),m=(o,n=!1)=>{var l,t;return n?{"dp-action-timeline-list-icon":!0,"item-empty-icon":!o.icon,[(l=o.status)!=null?l:""]:!0}:{icon:!0,[(t=o.icon)!=null?t:""]:!0}},L=(o,n)=>{var l;return(l=o.actions)==null?void 0:l.map((t,V)=>{var c,d,r,h;return e.createVNode("div",{class:T(V,n,o,t)},[e.createVNode("div",{class:"vertical-list-item-top"},[e.createVNode("div",{class:"vertical-list-item-top-left"},[e.createVNode("div",{class:m(t,!0)},[!t.icon&&e.createVNode("div",{class:"list-empty-icon-dot"},null),e.createVNode("em",{class:m(t)},null)]),e.createVNode("div",{class:"vertical-list-item-top-left-title"},[(d=(c=u.slots).title)==null?void 0:d.call(c,{option:t})])]),e.createVNode("div",{class:"dp-action-timeline-item-data"},[t.createdAt])]),e.createVNode("div",{class:"vertical-list-item-bottom"},[(h=(r=u.slots).content)==null?void 0:h.call(r,{option:t})])])})},A=(o,n)=>{var l;return(l=o.actions)==null?void 0:l.map((t,V)=>{var c,d,r;return e.createVNode("div",{class:T(V,n,o,t)},[e.createVNode("div",{class:m(t,!0)},[!t.icon&&e.createVNode("div",{class:"list-empty-icon-dot"},null),e.createVNode("em",{class:m(t)},null)]),e.createVNode("div",{class:"dp-action-timeline-list-data"},[(d=(c=u.slots).content)==null?void 0:d.call(c,{option:t})]),e.createVNode("div",{class:"dp-action-timeline-item-date"},[t.createdAt]),!(o.actions&&(i==null?void 0:i.value)&&V===o.actions.length-1&&n===((r=i==null?void 0:i.value)==null?void 0:r.length)-1)&&e.createVNode("div",{class:"border-bottom"},null)])})},F=()=>{u.emit("actionLoadMore")},S=()=>{window.scrollTo(0,0)},M=()=>{var o,n;return e.createVNode("div",{class:"dp-action-timeline-operation-container"},[((o=s==null?void 0:s.value)==null?void 0:o.loadMore)&&e.createVNode("div",{class:"dp-action-timeline-operation",onClick:F},[s.value.loadMoreText]),((n=s==null?void 0:s.value)==null?void 0:n.isToTop)&&e.createVNode("div",{class:"dp-action-timeline-operation",onClick:S},[s.value.toTopText])])};return()=>{var o,n;return e.createVNode(e.Fragment,null,[(o=i==null?void 0:i.value)==null?void 0:o.map((l,t)=>e.createVNode("div",{class:w.value},[e.createVNode("div",{class:"dp-action-timeline-title"},[e.createVNode("p",null,[l.time])]),e.createVNode("div",{class:"dp-action-timeline-body"},[y.value?L(l,t):A(l,t)]),e.createVNode("div",{class:"border-left"},null)])),Boolean((n=i==null?void 0:i.value)==null?void 0:n.length)&&M()])}}}),g={title:"ActionTimeline \u64CD\u4F5C\u65F6\u95F4\u8F74",category:"\u6F14\u8FDB\u4E2D",status:"100%",install(N){N.component(f.name,f)}};a.ActionTimeline=f,a.actionTimelineProps=v,a.default=g,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.dp-action-timeline{background-color:var(--devui-base-bg, #ffffff);padding:0 20px;position:relative}.dp-action-timeline .dp-action-timeline-title{font-size:var(--devui-font-size-sm, 12px);padding-top:12px}.dp-action-timeline .dp-action-timeline-title>p{position:relative;z-index:2;background-color:var(--devui-base-bg, #ffffff);padding:8px 0}.dp-action-timeline .dp-action-timeline-item{display:flex;position:relative;padding:12px 0}.dp-action-timeline .dp-action-timeline-item.list-last-item:before{content:"";position:absolute;top:24px;height:calc(100% - 24px);left:10px;border-left:4px solid var(--devui-base-bg, #ffffff);z-index:2}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon{width:24px;height:24px;margin-right:8px;border-radius:50%;background-color:var(--devui-list-item-hover-bg, #f2f2f3);position:relative;z-index:3}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon:before,.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon:after{content:"";position:absolute;height:2px;width:2px;left:11px;background-color:var(--devui-base-bg, #ffffff);z-index:3}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon:before{top:-2px}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon:after{bottom:-2px}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon.item-empty-icon{background:none}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon.item-empty-icon:before{top:7px}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon.item-empty-icon:before{bottom:7px}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon.item-empty-icon .list-empty-icon-dot{position:absolute;width:6px;height:6px;background-color:var(--devui-list-item-hover-bg, #f2f2f3);top:9px;left:9px;border-radius:50%}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon .icon{width:24px;font-size:var(--devui-font-size-icon, 16px);color:var(--devui-icon-text, #71757f);text-align:center;line-height:24px}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon.color-info .icon{color:var(--devui-info, #5e7ce0)}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon.color-danger .icon{color:var(--devui-danger, #f66f6a)}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon.color-success .icon{color:var(--devui-success, #50d4ab)}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-icon.color-warning .icon{color:var(--devui-warning, #fac20a)}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-list-data{flex:1;word-break:break-all}.dp-action-timeline .dp-action-timeline-item .dp-action-timeline-item-date{font-size:var(--devui-font-size-sm, 12px);color:var(--devui-aide-text, #71757f)}.dp-action-timeline .dp-action-timeline-item .border-bottom{position:absolute;bottom:0;width:calc(100% - 12px);height:1px;margin-left:12px;background-color:var(--devui-dividing-line, #f2f2f3)}.dp-action-timeline .dp-action-timeline-item.vertical-list-item{display:flex;flex-direction:column}.dp-action-timeline .dp-action-timeline-item.vertical-list-item .vertical-list-item-top{display:flex;align-items:center;justify-content:space-between}.dp-action-timeline .dp-action-timeline-item.vertical-list-item .vertical-list-item-top .vertical-list-item-top-left{display:flex;align-items:center}.dp-action-timeline .border-left{position:absolute;bottom:0;left:31px;width:2px;height:100%;background-color:var(--devui-dividing-line, #f2f2f3);z-index:1}.dp-action-timeline:first-child .border-left{height:calc(100% - 26px)}.dp-action-timeline-operation-container .dp-action-timeline-operation{margin:0 18px;padding:4px 0;height:32px;font-size:var(--devui-font-size-lg, 14px);text-align:center;border:1px solid var(--devui-form-control-line, #d7d8da);background-color:var(--devui-base-bg, #ffffff);border-radius:4px;cursor:pointer;transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),border-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.dp-action-timeline-operation-container .dp-action-timeline-operation:hover{color:var(--devui-brand-active, #526ecc);border-color:var(--devui-form-control-line-active, #5e7ce0)}.dp-action-timeline-status-bg .dp-action-timeline-list-icon.color-info{background-color:var(--devui-info-bg, #f2f5fc)}.dp-action-timeline-status-bg .dp-action-timeline-list-icon.color-danger{background-color:var(--devui-danger-bg, #ffeeed)}.dp-action-timeline-status-bg .dp-action-timeline-list-icon.color-success{background-color:var(--devui-success-bg, #edfff9)}.dp-action-timeline-status-bg .dp-action-timeline-list-icon.color-warning{background-color:var(--devui-warning-bg, #fff3e8)}.dp-action-timeline-status-line .border-left{display:none}.dp-action-timeline-status-line .dp-action-timeline-item:before{content:"";position:absolute;top:40px;height:calc(100% - 40px);left:11px;border-left:2px solid transparent;z-index:2;border-color:var(--devui-line, #d7d8da)}.dp-action-timeline-status-line .dp-action-timeline-item.dp-action-timeline-item-info:before{content:"";position:absolute;top:40px;height:calc(100% - 40px);left:11px;border-left:2px solid transparent;z-index:2;border-color:var(--devui-info-line, #5e7ce0)}.dp-action-timeline-status-line .dp-action-timeline-item.dp-action-timeline-item-danger:before{content:"";position:absolute;top:40px;height:calc(100% - 40px);left:11px;border-left:2px solid transparent;z-index:2;border-color:var(--devui-danger-line, #f66f6a)}.dp-action-timeline-status-line .dp-action-timeline-item.dp-action-timeline-item-success:before{content:"";position:absolute;top:40px;height:calc(100% - 40px);left:11px;border-left:2px solid transparent;z-index:2;border-color:var(--devui-success-line, #50d4ab)}.dp-action-timeline-status-line .dp-action-timeline-item.dp-action-timeline-item-warning:before{content:"";position:absolute;top:40px;height:calc(100% - 40px);left:11px;border-left:2px solid transparent;z-index:2;border-color:var(--devui-warning-line, #fa9841)}.dp-action-timeline-status-line .dp-action-timeline-item.list-last-item:before{content:"";position:absolute;top:40px;height:calc(100% - 40px);left:11px;border-left:2px solid transparent;z-index:2;border-color:var(--devui-base-bg, #ffffff)}
|
package/code-editor/index.es.js
CHANGED
|
@@ -5865,7 +5865,7 @@ var CodeEditor = defineComponent({
|
|
|
5865
5865
|
});
|
|
5866
5866
|
var index = {
|
|
5867
5867
|
title: "Code Editor \u4EE3\u7801\u7F16\u8F91\u5668",
|
|
5868
|
-
category: "\
|
|
5868
|
+
category: "\u6F14\u8FDB\u4E2D",
|
|
5869
5869
|
status: "100%",
|
|
5870
5870
|
install(app) {
|
|
5871
5871
|
app.component(CodeEditor.name, CodeEditor);
|
package/code-editor/index.umd.js
CHANGED
|
@@ -24,4 +24,4 @@ __p += '`),b&&(_+=`' +
|
|
|
24
24
|
function print() { __p += __j.call(arguments, '') }
|
|
25
25
|
`:`;
|
|
26
26
|
`)+_+`return __p
|
|
27
|
-
}`;var L=Co(function(){return P(f,m+"return "+_).apply(l,o)});if(L.source=_,Hi(L))throw L;return L}function mp(n){return B(n).toLowerCase()}function Ap(n){return B(n).toUpperCase()}function yp(n,e,t){if(n=B(n),n&&(t||e===l))return Wu(n);if(!n||!(e=En(e)))return n;var r=Un(n),i=Un(e),f=Du(r,i),o=Pu(r,i)+1;return we(r,f,o).join("")}function Ep(n,e,t){if(n=B(n),n&&(t||e===l))return n.slice(0,Nu(n)+1);if(!n||!(e=En(e)))return n;var r=Un(n),i=Pu(r,Un(e))+1;return we(r,0,i).join("")}function Ip(n,e,t){if(n=B(n),n&&(t||e===l))return n.replace(Hr,"");if(!n||!(e=En(e)))return n;var r=Un(n),i=Du(r,Un(e));return we(r,i).join("")}function Tp(n,e){var t=ft,r=mr;if(Z(e)){var i="separator"in e?e.separator:i;t="length"in e?S(e.length):t,r="omission"in e?En(e.omission):r}n=B(n);var f=n.length;if(ze(n)){var o=Un(n);f=o.length}if(t>=f)return n;var a=t-Ye(r);if(a<1)return r;var c=o?we(o,0,a).join(""):n.slice(0,a);if(i===l)return c+r;if(o&&(a+=c.length-a),Gi(i)){if(n.slice(a).search(i)){var p,d=c;for(i.global||(i=ri(i.source,B(eu.exec(i))+"g")),i.lastIndex=0;p=i.exec(d);)var _=p.index;c=c.slice(0,_===l?a:_)}}else if(n.indexOf(En(i),a)!=a){var v=c.lastIndexOf(i);v>-1&&(c=c.slice(0,v))}return c+r}function Cp(n){return n=B(n),n&&No.test(n)?n.replace(ki,ea):n}var Sp=nt(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),Ki=Cf("toUpperCase");function To(n,e,t){return n=B(n),e=t?l:e,e===l?Ql(n)?ia(n):Gl(n):n.match(e)||[]}var Co=R(function(n,e){try{return An(n,l,e)}catch(t){return Hi(t)?t:new I(t)}}),Lp=re(function(n,e){return Rn(e,function(t){t=Qn(t),ee(n,t,Fi(n[t],n))}),n});function Rp(n){var e=n==null?0:n.length,t=A();return n=e?q(n,function(r){if(typeof r[1]!="function")throw new On(K);return[t(r[0]),r[1]]}):[],R(function(r){for(var i=-1;++i<e;){var f=n[i];if(An(f[0],this,r))return An(f[1],this,r)}})}function Op(n){return es(bn(n,Kn))}function Zi(n){return function(){return n}}function Mp(n,e){return n==null||n!==n?e:n}var bp=Lf(),Wp=Lf(!0);function vn(n){return n}function zi(n){return rf(typeof n=="function"?n:bn(n,Kn))}function Dp(n){return ff(bn(n,Kn))}function Pp(n,e){return of(n,bn(e,Kn))}var Bp=R(function(n,e){return function(t){return vt(t,n,e)}}),Np=R(function(n,e){return function(t){return vt(n,t,e)}});function Yi(n,e,t){var r=rn(e),i=kt(e,r);t==null&&!(Z(e)&&(i.length||!r.length))&&(t=e,e=n,n=this,i=kt(e,rn(e)));var f=!(Z(t)&&"chain"in t)||!!t.chain,o=ue(n);return Rn(i,function(a){var c=e[a];n[a]=c,o&&(n.prototype[a]=function(){var p=this.__chain__;if(f||p){var d=n(this.__wrapped__),_=d.__actions__=pn(this.__actions__);return _.push({func:c,args:arguments,thisArg:n}),d.__chain__=p,d}return c.apply(n,he([this.value()],arguments))})}),n}function Fp(){return fn._===this&&(fn._=sa),this}function Xi(){}function Up(n){return n=S(n),R(function(e){return lf(e,n)})}var Hp=Ti(q),Gp=Ti(Lu),$p=Ti(Qr);function So(n){return bi(n)?Vr(Qn(n)):ws(n)}function qp(n){return function(e){return n==null?l:be(n,e)}}var Kp=Of(),Zp=Of(!0);function Ji(){return[]}function Qi(){return!1}function zp(){return{}}function Yp(){return""}function Xp(){return!0}function Jp(n,e){if(n=S(n),n<1||n>Yn)return[];var t=Sn,r=ln(n,Sn);e=A(e),n-=Sn;for(var i=ni(r,e);++t<n;)e(t);return i}function Qp(n){return T(n)?q(n,Qn):In(n)?[n]:pn(zf(B(n)))}function Vp(n){var e=++la;return B(n)+e}var kp=ir(function(n,e){return n+e},0),jp=Ci("ceil"),nd=ir(function(n,e){return n/e},1),ed=Ci("floor");function td(n){return n&&n.length?Vt(n,vn,ci):l}function rd(n,e){return n&&n.length?Vt(n,A(e,2),ci):l}function id(n){return Mu(n,vn)}function ud(n,e){return Mu(n,A(e,2))}function fd(n){return n&&n.length?Vt(n,vn,di):l}function od(n,e){return n&&n.length?Vt(n,A(e,2),di):l}var ld=ir(function(n,e){return n*e},1),ad=Ci("round"),sd=ir(function(n,e){return n-e},0);function cd(n){return n&&n.length?jr(n,vn):0}function hd(n,e){return n&&n.length?jr(n,A(e,2)):0}return u.after=Dh,u.ary=ro,u.assign=Ag,u.assignIn=wo,u.assignInWith=vr,u.assignWith=yg,u.at=Eg,u.before=io,u.bind=Fi,u.bindAll=Lp,u.bindKey=uo,u.castArray=zh,u.chain=no,u.chunk=ec,u.compact=tc,u.concat=rc,u.cond=Rp,u.conforms=Op,u.constant=Zi,u.countBy=ch,u.create=Ig,u.curry=fo,u.curryRight=oo,u.debounce=lo,u.defaults=Tg,u.defaultsDeep=Cg,u.defer=Ph,u.delay=Bh,u.difference=ic,u.differenceBy=uc,u.differenceWith=fc,u.drop=oc,u.dropRight=lc,u.dropRightWhile=ac,u.dropWhile=sc,u.fill=cc,u.filter=gh,u.flatMap=_h,u.flatMapDeep=vh,u.flatMapDepth=wh,u.flatten=Qf,u.flattenDeep=hc,u.flattenDepth=gc,u.flip=Nh,u.flow=bp,u.flowRight=Wp,u.fromPairs=pc,u.functions=Wg,u.functionsIn=Dg,u.groupBy=xh,u.initial=_c,u.intersection=vc,u.intersectionBy=wc,u.intersectionWith=xc,u.invert=Bg,u.invertBy=Ng,u.invokeMap=Ah,u.iteratee=zi,u.keyBy=yh,u.keys=rn,u.keysIn=_n,u.map=cr,u.mapKeys=Ug,u.mapValues=Hg,u.matches=Dp,u.matchesProperty=Pp,u.memoize=gr,u.merge=Gg,u.mergeWith=xo,u.method=Bp,u.methodOf=Np,u.mixin=Yi,u.negate=pr,u.nthArg=Up,u.omit=$g,u.omitBy=qg,u.once=Fh,u.orderBy=Eh,u.over=Hp,u.overArgs=Uh,u.overEvery=Gp,u.overSome=$p,u.partial=Ui,u.partialRight=ao,u.partition=Ih,u.pick=Kg,u.pickBy=mo,u.property=So,u.propertyOf=qp,u.pull=Ec,u.pullAll=kf,u.pullAllBy=Ic,u.pullAllWith=Tc,u.pullAt=Cc,u.range=Kp,u.rangeRight=Zp,u.rearg=Hh,u.reject=Sh,u.remove=Sc,u.rest=Gh,u.reverse=Bi,u.sampleSize=Rh,u.set=zg,u.setWith=Yg,u.shuffle=Oh,u.slice=Lc,u.sortBy=Wh,u.sortedUniq=Pc,u.sortedUniqBy=Bc,u.split=_p,u.spread=$h,u.tail=Nc,u.take=Fc,u.takeRight=Uc,u.takeRightWhile=Hc,u.takeWhile=Gc,u.tap=th,u.throttle=qh,u.thru=sr,u.toArray=po,u.toPairs=Ao,u.toPairsIn=yo,u.toPath=Qp,u.toPlainObject=vo,u.transform=Xg,u.unary=Kh,u.union=$c,u.unionBy=qc,u.unionWith=Kc,u.uniq=Zc,u.uniqBy=zc,u.uniqWith=Yc,u.unset=Jg,u.unzip=Ni,u.unzipWith=jf,u.update=Qg,u.updateWith=Vg,u.values=rt,u.valuesIn=kg,u.without=Xc,u.words=To,u.wrap=Zh,u.xor=Jc,u.xorBy=Qc,u.xorWith=Vc,u.zip=kc,u.zipObject=jc,u.zipObjectDeep=nh,u.zipWith=eh,u.entries=Ao,u.entriesIn=yo,u.extend=wo,u.extendWith=vr,Yi(u,u),u.add=kp,u.attempt=Co,u.camelCase=tp,u.capitalize=Eo,u.ceil=jp,u.clamp=jg,u.clone=Yh,u.cloneDeep=Jh,u.cloneDeepWith=Qh,u.cloneWith=Xh,u.conformsTo=Vh,u.deburr=Io,u.defaultTo=Mp,u.divide=nd,u.endsWith=rp,u.eq=Gn,u.escape=ip,u.escapeRegExp=up,u.every=hh,u.find=ph,u.findIndex=Xf,u.findKey=Sg,u.findLast=dh,u.findLastIndex=Jf,u.findLastKey=Lg,u.floor=ed,u.forEach=eo,u.forEachRight=to,u.forIn=Rg,u.forInRight=Og,u.forOwn=Mg,u.forOwnRight=bg,u.get=$i,u.gt=kh,u.gte=jh,u.has=Pg,u.hasIn=qi,u.head=Vf,u.identity=vn,u.includes=mh,u.indexOf=dc,u.inRange=np,u.invoke=Fg,u.isArguments=Pe,u.isArray=T,u.isArrayBuffer=ng,u.isArrayLike=dn,u.isArrayLikeObject=Y,u.isBoolean=eg,u.isBuffer=xe,u.isDate=tg,u.isElement=rg,u.isEmpty=ig,u.isEqual=ug,u.isEqualWith=fg,u.isError=Hi,u.isFinite=og,u.isFunction=ue,u.isInteger=so,u.isLength=dr,u.isMap=co,u.isMatch=lg,u.isMatchWith=ag,u.isNaN=sg,u.isNative=cg,u.isNil=gg,u.isNull=hg,u.isNumber=ho,u.isObject=Z,u.isObjectLike=z,u.isPlainObject=Et,u.isRegExp=Gi,u.isSafeInteger=pg,u.isSet=go,u.isString=_r,u.isSymbol=In,u.isTypedArray=tt,u.isUndefined=dg,u.isWeakMap=_g,u.isWeakSet=vg,u.join=mc,u.kebabCase=fp,u.last=Dn,u.lastIndexOf=Ac,u.lowerCase=op,u.lowerFirst=lp,u.lt=wg,u.lte=xg,u.max=td,u.maxBy=rd,u.mean=id,u.meanBy=ud,u.min=fd,u.minBy=od,u.stubArray=Ji,u.stubFalse=Qi,u.stubObject=zp,u.stubString=Yp,u.stubTrue=Xp,u.multiply=ld,u.nth=yc,u.noConflict=Fp,u.noop=Xi,u.now=hr,u.pad=ap,u.padEnd=sp,u.padStart=cp,u.parseInt=hp,u.random=ep,u.reduce=Th,u.reduceRight=Ch,u.repeat=gp,u.replace=pp,u.result=Zg,u.round=ad,u.runInContext=s,u.sample=Lh,u.size=Mh,u.snakeCase=dp,u.some=bh,u.sortedIndex=Rc,u.sortedIndexBy=Oc,u.sortedIndexOf=Mc,u.sortedLastIndex=bc,u.sortedLastIndexBy=Wc,u.sortedLastIndexOf=Dc,u.startCase=vp,u.startsWith=wp,u.subtract=sd,u.sum=cd,u.sumBy=hd,u.template=xp,u.times=Jp,u.toFinite=fe,u.toInteger=S,u.toLength=_o,u.toLower=mp,u.toNumber=Pn,u.toSafeInteger=mg,u.toString=B,u.toUpper=Ap,u.trim=yp,u.trimEnd=Ep,u.trimStart=Ip,u.truncate=Tp,u.unescape=Cp,u.uniqueId=Vp,u.upperCase=Sp,u.upperFirst=Ki,u.each=eo,u.eachRight=to,u.first=Vf,Yi(u,function(){var n={};return Xn(u,function(e,t){N.call(u.prototype,t)||(n[t]=e)}),n}(),{chain:!1}),u.VERSION=me,Rn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){u[n].placeholder=u}),Rn(["drop","take"],function(n,e){M.prototype[n]=function(t){t=t===l?1:k(S(t),0);var r=this.__filtered__&&!e?new M(this):this.clone();return r.__filtered__?r.__takeCount__=ln(t,r.__takeCount__):r.__views__.push({size:ln(t,Sn),type:n+(r.__dir__<0?"Right":"")}),r},M.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Rn(["filter","map","takeWhile"],function(n,e){var t=e+1,r=t==It||t==Ir;M.prototype[n]=function(i){var f=this.clone();return f.__iteratees__.push({iteratee:A(i,3),type:t}),f.__filtered__=f.__filtered__||r,f}}),Rn(["head","last"],function(n,e){var t="take"+(e?"Right":"");M.prototype[n]=function(){return this[t](1).value()[0]}}),Rn(["initial","tail"],function(n,e){var t="drop"+(e?"":"Right");M.prototype[n]=function(){return this.__filtered__?new M(this):this[t](1)}}),M.prototype.compact=function(){return this.filter(vn)},M.prototype.find=function(n){return this.filter(n).head()},M.prototype.findLast=function(n){return this.reverse().find(n)},M.prototype.invokeMap=R(function(n,e){return typeof n=="function"?new M(this):this.map(function(t){return vt(t,n,e)})}),M.prototype.reject=function(n){return this.filter(pr(A(n)))},M.prototype.slice=function(n,e){n=S(n);var t=this;return t.__filtered__&&(n>0||e<0)?new M(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==l&&(e=S(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},M.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},M.prototype.toArray=function(){return this.take(Sn)},Xn(M.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],f=r||/^find/.test(e);!i||(u.prototype[e]=function(){var o=this.__wrapped__,a=r?[1]:arguments,c=o instanceof M,p=a[0],d=c||T(o),_=function(O){var b=i.apply(u,he([O],a));return r&&v?b[0]:b};d&&t&&typeof p=="function"&&p.length!=1&&(c=d=!1);var v=this.__chain__,m=!!this.__actions__.length,y=f&&!v,L=c&&!m;if(!f&&d){o=L?o:new M(this);var E=n.apply(o,a);return E.__actions__.push({func:sr,args:[_],thisArg:l}),new Mn(E,v)}return y&&L?n.apply(this,a):(E=this.thru(_),y?r?E.value()[0]:E.value():E)})}),Rn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Bt[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var f=this.value();return e.apply(T(f)?f:[],i)}return this[t](function(o){return e.apply(T(o)?o:[],i)})}}),Xn(M.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";N.call(Ve,r)||(Ve[r]=[]),Ve[r].push({name:e,func:t})}}),Ve[rr(l,C).name]=[{name:"wrapper",func:l}],M.prototype.clone=Ca,M.prototype.reverse=Sa,M.prototype.value=La,u.prototype.at=rh,u.prototype.chain=ih,u.prototype.commit=uh,u.prototype.next=fh,u.prototype.plant=lh,u.prototype.reverse=ah,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=sh,u.prototype.first=u.prototype.head,st&&(u.prototype[st]=oh),u},Xe=ua();Se?((Se.exports=Xe)._=Xe,zr._=Xe):fn._=Xe}).call(it)})(wr,wr.exports);function bo(Vn,qn){const l=F.ref(),{modelValue:me,originalText:Ae,options:xn,mode:K,theme:ut,autoHeight:Be,offsetLeft:le,refreshAll:Ne,mouseTargetTypes:Kn,editorDecorations:ye,comments:J,addCommentIcon:ae,expandCommentIcon:Fe}=F.toRefs(Vn);let H,C,nn,en,Bn,sn=[],Zn=new Map,un=[],kn=[],zn=[],ft=!1;F.watch(ye,Ct,{deep:!0}),F.watch(J,()=>{St(),Lt()},{deep:!0}),F.watch(xn,()=>{Sn(),Cr()},{deep:!0}),F.watch(Ae,Ue),F.watch(ut,Nn),F.watch(me,()=>{ft?ft=!1:It()}),F.onBeforeMount(()=>{window.devuiThemeService&&(en=window.devuiThemeService,en.eventBus&&en.eventBus.add("themeChanged",Nn))}),F.onMounted(async()=>{Mo&&(H=await import("monaco-editor"),Nn(),mr(),K.value==="review"&&F.nextTick(()=>{Ct(),Lt(),St()}))});function mr(){K.value==="normal"||K.value==="review"?Ar():K.value.includes("diff")&&yr(),xn.value.theme||H.editor.setTheme(Bn),Yn(),Tr()}function Ar(){C||(C=H.editor.create(l.value,xn.value),C.setModel(H.editor.createModel(me.value,xn.value.language)),qn.emit("afterEditorInit",C),K.value==="review"&&(C.onMouseMove(Sr),C.onMouseLeave(se),C.onMouseDown(He)))}function yr(){nn||(nn=H.editor.createDiffEditor(l.value,xn.value),nn.setModel({original:H.editor.createModel(Ae.value,xn.value.language),modified:H.editor.createModel(me.value,xn.value.language)}),qn.emit("afterEditorInit",nn))}function It(){K.value==="normal"||K.value==="review"?Er():K.value==="diff"&&Ir()}function Er(){var w;!C||!C.getModel()||(w=C.getModel().modified)==null||w.setValue(me.value)}function Ir(){var w;!nn||!nn.getModel()||(w=nn.getModel().modified)==null||w.setValue(me.value)}function Nn(){xn.value.theme||(ut.value==="light"?Bn=en&&en.currentTheme.isDark?"vs-dark":"vs":ut.value==="dark"&&(Bn=en&&en.currentTheme.isDark?"vs":"vs-dark"),C&&H.editor.setTheme(Bn))}function Yn(){Be.value&&C.onDidChangeModelDecorations(()=>{setTimeout(Tt)})}function Tr(){let w;C?w=C.getModel():nn&&(w=nn.getModel().modified),w.onDidChangeContent(wr.exports.throttle(()=>{ft=!0,qn.emit("update: modelValue",w.getValue())},100))}function Ue(){var w;!nn||!nn.getModel()||(w=nn.getModel().original)==null||w.setValue(Ae.value)}function Sn(){const w=xn.value.language;if(C&&(K.value==="normal"||K.value==="review")){const W=nn.getModel();H.editor.setModelLanguage(W.modified,w),H.editor.setModelLanguage(W.original,w)}}function Cr(){C&&C.updateOptions(Vi({},xn.value)),nn&&nn.updateOptions(Vi({},xn.value))}function Tt(){var tn;const w=C.getOption(H.editor.EditorOption.lineHeight),W=((tn=C.getModel())==null?void 0:tn.getLineCount())||1,D=C.getTopForLineNumber(W+1)+w;l.value&&(l.value.style.height=`${D}px`),C.layout()}function Sr(w){if(w.target&&w.target.position){const W=w.target.position.lineNumber;if(Ie(W))zn=C.deltaDecorations(zn,[]);else{const D=[{range:new H.Range(W,0,W,0),option:{isWholeLine:!0,glyphMarginClassName:`icon-pointer ${ae.value}`}}];zn=C.deltaDecorations(zn,D)}}}function se(){C.deltaDecorations(zn,[])}function He(w){Kn.value.includes(w.target.type)&&qn.emit("click",w)}function Ct(){if(ye.value.length>=0&&C){const w=ye.value.map(Ee);setTimeout(()=>{kn=C.deltaDecorations(kn,w)}),kn=C.deltaDecorations(zn,[])}}function Ee(w){return{range:new H.Range(w.lineNumber,1,w.lineNumber,1),options:{isWholeLine:!0,className:w.customClasses||"",glyphMarginClassName:`icon-pointer ${w.icon||Fe.value} ${w.glyphClassName||""}`}}}function Ie(w){return ye.value.some(W=>W.lineNumber===w)}function St(){C&&C.changeViewZones(w=>{Ge(w),$e(w),Be.value&&Tt()})}function Ge(w){sn.length>0&&(sn.forEach(W=>{w.removeZone(W.id)}),sn=[],Zn=new Map)}function $e(w){J.value&&J.value.length&&J.value.filter(D=>D.isExpanded).forEach(D=>{const tn=w.addZone({afterLineNumber:D.lineNumber,heightInPx:D.heightInPx?D.heightInPx:0,afterColumn:1,domNode:document.createElement("div"),ondomNodeTop:Q=>{ot(D.lineNumber,{top:Q})},onComputedHeight:Q=>{ot(D.lineNumber,{height:Q})}});sn.push({lineNumber:D.lineNumber,id:tn})})}function ot(w,...W){const D=J.value.findIndex(Rr=>Rr.lineNumber===w),tn=C.getLayoutInfo(),Q=mn(W,tn,D);Q.height&&Zn.set(D,Q.height),J.value[D].domNode.style.width=`${tn.width-Q.minimapWidth-Q.offsetLeft}px`,Te(Q.top,Q.height,D)}function mn(w,W,D){let tn=0;const Q=J.value[D].offserLeft;return Q?tn=Q:tn=(le==null?void 0:le.value)?le==null?void 0:le.value:0,{top:w[0].top,height:w[0].height,minimapWidth:W.minimap.minimapWidth,offsetLeft:tn}}function Te(w,W,D){J.value[D].domNode.style.height=`${W}px`,Zn.get(D)===0?J.value[D].domNode.style.top=`-${1e4+w}px`:J.value[D].domNode.style.top=`${w}px`}function Lt(){C&&Fn()}function Fn(){Ne.value?Lr():Rt();const w=J.value.filter(W=>W.isExpanded);w==null||w.forEach(W=>{if(un.findIndex(tn=>tn.lineNumber===W.lineNumber)===-1){const tn=Ce(W);un.push({lineNumber:W.lineNumber,widget:tn}),C.addOverlayWidget(tn)}})}function Rt(){J.value.forEach(w=>{if(!w.isExpanded){const W=un.findIndex(D=>D.lineNumber===w.lineNumber);if(W!==-1){const D=un.splice(W,1)[0];C.removeOverlayWidget(D.widget)}}})}function Lr(){un.length>0&&(un.forEach(w=>{C.removeOverlayWidget(w.widget)}),un=[])}function Ce(w){return{getId:()=>`widget-lineNumber${w.lineNumber}`,getDomNode:()=>w.domNode,getPosition:()=>null}}return{editorEl:l}}var _d="",xr=F.defineComponent({name:"DCodeEditor",props:wn,emits:["update: modelValue","afterEditorInit","click"],setup(Vn,qn){const{editorEl:l}=bo(Vn,qn);return()=>F.createVNode("div",{ref:l,class:"devui-code-editor"},null)}}),Wo={title:"Code Editor \u4EE3\u7801\u7F16\u8F91\u5668",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(Vn){Vn.component(xr.name,xr)}};j.CodeEditor=xr,j.codeEditorProps=wn,j.default=Wo,Object.defineProperty(j,"__esModule",{value:!0}),j[Symbol.toStringTag]="Module"});
|
|
27
|
+
}`;var L=Co(function(){return P(f,m+"return "+_).apply(l,o)});if(L.source=_,Hi(L))throw L;return L}function mp(n){return B(n).toLowerCase()}function Ap(n){return B(n).toUpperCase()}function yp(n,e,t){if(n=B(n),n&&(t||e===l))return Wu(n);if(!n||!(e=En(e)))return n;var r=Un(n),i=Un(e),f=Du(r,i),o=Pu(r,i)+1;return we(r,f,o).join("")}function Ep(n,e,t){if(n=B(n),n&&(t||e===l))return n.slice(0,Nu(n)+1);if(!n||!(e=En(e)))return n;var r=Un(n),i=Pu(r,Un(e))+1;return we(r,0,i).join("")}function Ip(n,e,t){if(n=B(n),n&&(t||e===l))return n.replace(Hr,"");if(!n||!(e=En(e)))return n;var r=Un(n),i=Du(r,Un(e));return we(r,i).join("")}function Tp(n,e){var t=ft,r=mr;if(Z(e)){var i="separator"in e?e.separator:i;t="length"in e?S(e.length):t,r="omission"in e?En(e.omission):r}n=B(n);var f=n.length;if(ze(n)){var o=Un(n);f=o.length}if(t>=f)return n;var a=t-Ye(r);if(a<1)return r;var c=o?we(o,0,a).join(""):n.slice(0,a);if(i===l)return c+r;if(o&&(a+=c.length-a),Gi(i)){if(n.slice(a).search(i)){var p,d=c;for(i.global||(i=ri(i.source,B(eu.exec(i))+"g")),i.lastIndex=0;p=i.exec(d);)var _=p.index;c=c.slice(0,_===l?a:_)}}else if(n.indexOf(En(i),a)!=a){var v=c.lastIndexOf(i);v>-1&&(c=c.slice(0,v))}return c+r}function Cp(n){return n=B(n),n&&No.test(n)?n.replace(ki,ea):n}var Sp=nt(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),Ki=Cf("toUpperCase");function To(n,e,t){return n=B(n),e=t?l:e,e===l?Ql(n)?ia(n):Gl(n):n.match(e)||[]}var Co=R(function(n,e){try{return An(n,l,e)}catch(t){return Hi(t)?t:new I(t)}}),Lp=re(function(n,e){return Rn(e,function(t){t=Qn(t),ee(n,t,Fi(n[t],n))}),n});function Rp(n){var e=n==null?0:n.length,t=A();return n=e?q(n,function(r){if(typeof r[1]!="function")throw new On(K);return[t(r[0]),r[1]]}):[],R(function(r){for(var i=-1;++i<e;){var f=n[i];if(An(f[0],this,r))return An(f[1],this,r)}})}function Op(n){return es(bn(n,Kn))}function Zi(n){return function(){return n}}function Mp(n,e){return n==null||n!==n?e:n}var bp=Lf(),Wp=Lf(!0);function vn(n){return n}function zi(n){return rf(typeof n=="function"?n:bn(n,Kn))}function Dp(n){return ff(bn(n,Kn))}function Pp(n,e){return of(n,bn(e,Kn))}var Bp=R(function(n,e){return function(t){return vt(t,n,e)}}),Np=R(function(n,e){return function(t){return vt(n,t,e)}});function Yi(n,e,t){var r=rn(e),i=kt(e,r);t==null&&!(Z(e)&&(i.length||!r.length))&&(t=e,e=n,n=this,i=kt(e,rn(e)));var f=!(Z(t)&&"chain"in t)||!!t.chain,o=ue(n);return Rn(i,function(a){var c=e[a];n[a]=c,o&&(n.prototype[a]=function(){var p=this.__chain__;if(f||p){var d=n(this.__wrapped__),_=d.__actions__=pn(this.__actions__);return _.push({func:c,args:arguments,thisArg:n}),d.__chain__=p,d}return c.apply(n,he([this.value()],arguments))})}),n}function Fp(){return fn._===this&&(fn._=sa),this}function Xi(){}function Up(n){return n=S(n),R(function(e){return lf(e,n)})}var Hp=Ti(q),Gp=Ti(Lu),$p=Ti(Qr);function So(n){return bi(n)?Vr(Qn(n)):ws(n)}function qp(n){return function(e){return n==null?l:be(n,e)}}var Kp=Of(),Zp=Of(!0);function Ji(){return[]}function Qi(){return!1}function zp(){return{}}function Yp(){return""}function Xp(){return!0}function Jp(n,e){if(n=S(n),n<1||n>Yn)return[];var t=Sn,r=ln(n,Sn);e=A(e),n-=Sn;for(var i=ni(r,e);++t<n;)e(t);return i}function Qp(n){return T(n)?q(n,Qn):In(n)?[n]:pn(zf(B(n)))}function Vp(n){var e=++la;return B(n)+e}var kp=ir(function(n,e){return n+e},0),jp=Ci("ceil"),nd=ir(function(n,e){return n/e},1),ed=Ci("floor");function td(n){return n&&n.length?Vt(n,vn,ci):l}function rd(n,e){return n&&n.length?Vt(n,A(e,2),ci):l}function id(n){return Mu(n,vn)}function ud(n,e){return Mu(n,A(e,2))}function fd(n){return n&&n.length?Vt(n,vn,di):l}function od(n,e){return n&&n.length?Vt(n,A(e,2),di):l}var ld=ir(function(n,e){return n*e},1),ad=Ci("round"),sd=ir(function(n,e){return n-e},0);function cd(n){return n&&n.length?jr(n,vn):0}function hd(n,e){return n&&n.length?jr(n,A(e,2)):0}return u.after=Dh,u.ary=ro,u.assign=Ag,u.assignIn=wo,u.assignInWith=vr,u.assignWith=yg,u.at=Eg,u.before=io,u.bind=Fi,u.bindAll=Lp,u.bindKey=uo,u.castArray=zh,u.chain=no,u.chunk=ec,u.compact=tc,u.concat=rc,u.cond=Rp,u.conforms=Op,u.constant=Zi,u.countBy=ch,u.create=Ig,u.curry=fo,u.curryRight=oo,u.debounce=lo,u.defaults=Tg,u.defaultsDeep=Cg,u.defer=Ph,u.delay=Bh,u.difference=ic,u.differenceBy=uc,u.differenceWith=fc,u.drop=oc,u.dropRight=lc,u.dropRightWhile=ac,u.dropWhile=sc,u.fill=cc,u.filter=gh,u.flatMap=_h,u.flatMapDeep=vh,u.flatMapDepth=wh,u.flatten=Qf,u.flattenDeep=hc,u.flattenDepth=gc,u.flip=Nh,u.flow=bp,u.flowRight=Wp,u.fromPairs=pc,u.functions=Wg,u.functionsIn=Dg,u.groupBy=xh,u.initial=_c,u.intersection=vc,u.intersectionBy=wc,u.intersectionWith=xc,u.invert=Bg,u.invertBy=Ng,u.invokeMap=Ah,u.iteratee=zi,u.keyBy=yh,u.keys=rn,u.keysIn=_n,u.map=cr,u.mapKeys=Ug,u.mapValues=Hg,u.matches=Dp,u.matchesProperty=Pp,u.memoize=gr,u.merge=Gg,u.mergeWith=xo,u.method=Bp,u.methodOf=Np,u.mixin=Yi,u.negate=pr,u.nthArg=Up,u.omit=$g,u.omitBy=qg,u.once=Fh,u.orderBy=Eh,u.over=Hp,u.overArgs=Uh,u.overEvery=Gp,u.overSome=$p,u.partial=Ui,u.partialRight=ao,u.partition=Ih,u.pick=Kg,u.pickBy=mo,u.property=So,u.propertyOf=qp,u.pull=Ec,u.pullAll=kf,u.pullAllBy=Ic,u.pullAllWith=Tc,u.pullAt=Cc,u.range=Kp,u.rangeRight=Zp,u.rearg=Hh,u.reject=Sh,u.remove=Sc,u.rest=Gh,u.reverse=Bi,u.sampleSize=Rh,u.set=zg,u.setWith=Yg,u.shuffle=Oh,u.slice=Lc,u.sortBy=Wh,u.sortedUniq=Pc,u.sortedUniqBy=Bc,u.split=_p,u.spread=$h,u.tail=Nc,u.take=Fc,u.takeRight=Uc,u.takeRightWhile=Hc,u.takeWhile=Gc,u.tap=th,u.throttle=qh,u.thru=sr,u.toArray=po,u.toPairs=Ao,u.toPairsIn=yo,u.toPath=Qp,u.toPlainObject=vo,u.transform=Xg,u.unary=Kh,u.union=$c,u.unionBy=qc,u.unionWith=Kc,u.uniq=Zc,u.uniqBy=zc,u.uniqWith=Yc,u.unset=Jg,u.unzip=Ni,u.unzipWith=jf,u.update=Qg,u.updateWith=Vg,u.values=rt,u.valuesIn=kg,u.without=Xc,u.words=To,u.wrap=Zh,u.xor=Jc,u.xorBy=Qc,u.xorWith=Vc,u.zip=kc,u.zipObject=jc,u.zipObjectDeep=nh,u.zipWith=eh,u.entries=Ao,u.entriesIn=yo,u.extend=wo,u.extendWith=vr,Yi(u,u),u.add=kp,u.attempt=Co,u.camelCase=tp,u.capitalize=Eo,u.ceil=jp,u.clamp=jg,u.clone=Yh,u.cloneDeep=Jh,u.cloneDeepWith=Qh,u.cloneWith=Xh,u.conformsTo=Vh,u.deburr=Io,u.defaultTo=Mp,u.divide=nd,u.endsWith=rp,u.eq=Gn,u.escape=ip,u.escapeRegExp=up,u.every=hh,u.find=ph,u.findIndex=Xf,u.findKey=Sg,u.findLast=dh,u.findLastIndex=Jf,u.findLastKey=Lg,u.floor=ed,u.forEach=eo,u.forEachRight=to,u.forIn=Rg,u.forInRight=Og,u.forOwn=Mg,u.forOwnRight=bg,u.get=$i,u.gt=kh,u.gte=jh,u.has=Pg,u.hasIn=qi,u.head=Vf,u.identity=vn,u.includes=mh,u.indexOf=dc,u.inRange=np,u.invoke=Fg,u.isArguments=Pe,u.isArray=T,u.isArrayBuffer=ng,u.isArrayLike=dn,u.isArrayLikeObject=Y,u.isBoolean=eg,u.isBuffer=xe,u.isDate=tg,u.isElement=rg,u.isEmpty=ig,u.isEqual=ug,u.isEqualWith=fg,u.isError=Hi,u.isFinite=og,u.isFunction=ue,u.isInteger=so,u.isLength=dr,u.isMap=co,u.isMatch=lg,u.isMatchWith=ag,u.isNaN=sg,u.isNative=cg,u.isNil=gg,u.isNull=hg,u.isNumber=ho,u.isObject=Z,u.isObjectLike=z,u.isPlainObject=Et,u.isRegExp=Gi,u.isSafeInteger=pg,u.isSet=go,u.isString=_r,u.isSymbol=In,u.isTypedArray=tt,u.isUndefined=dg,u.isWeakMap=_g,u.isWeakSet=vg,u.join=mc,u.kebabCase=fp,u.last=Dn,u.lastIndexOf=Ac,u.lowerCase=op,u.lowerFirst=lp,u.lt=wg,u.lte=xg,u.max=td,u.maxBy=rd,u.mean=id,u.meanBy=ud,u.min=fd,u.minBy=od,u.stubArray=Ji,u.stubFalse=Qi,u.stubObject=zp,u.stubString=Yp,u.stubTrue=Xp,u.multiply=ld,u.nth=yc,u.noConflict=Fp,u.noop=Xi,u.now=hr,u.pad=ap,u.padEnd=sp,u.padStart=cp,u.parseInt=hp,u.random=ep,u.reduce=Th,u.reduceRight=Ch,u.repeat=gp,u.replace=pp,u.result=Zg,u.round=ad,u.runInContext=s,u.sample=Lh,u.size=Mh,u.snakeCase=dp,u.some=bh,u.sortedIndex=Rc,u.sortedIndexBy=Oc,u.sortedIndexOf=Mc,u.sortedLastIndex=bc,u.sortedLastIndexBy=Wc,u.sortedLastIndexOf=Dc,u.startCase=vp,u.startsWith=wp,u.subtract=sd,u.sum=cd,u.sumBy=hd,u.template=xp,u.times=Jp,u.toFinite=fe,u.toInteger=S,u.toLength=_o,u.toLower=mp,u.toNumber=Pn,u.toSafeInteger=mg,u.toString=B,u.toUpper=Ap,u.trim=yp,u.trimEnd=Ep,u.trimStart=Ip,u.truncate=Tp,u.unescape=Cp,u.uniqueId=Vp,u.upperCase=Sp,u.upperFirst=Ki,u.each=eo,u.eachRight=to,u.first=Vf,Yi(u,function(){var n={};return Xn(u,function(e,t){N.call(u.prototype,t)||(n[t]=e)}),n}(),{chain:!1}),u.VERSION=me,Rn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){u[n].placeholder=u}),Rn(["drop","take"],function(n,e){M.prototype[n]=function(t){t=t===l?1:k(S(t),0);var r=this.__filtered__&&!e?new M(this):this.clone();return r.__filtered__?r.__takeCount__=ln(t,r.__takeCount__):r.__views__.push({size:ln(t,Sn),type:n+(r.__dir__<0?"Right":"")}),r},M.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Rn(["filter","map","takeWhile"],function(n,e){var t=e+1,r=t==It||t==Ir;M.prototype[n]=function(i){var f=this.clone();return f.__iteratees__.push({iteratee:A(i,3),type:t}),f.__filtered__=f.__filtered__||r,f}}),Rn(["head","last"],function(n,e){var t="take"+(e?"Right":"");M.prototype[n]=function(){return this[t](1).value()[0]}}),Rn(["initial","tail"],function(n,e){var t="drop"+(e?"":"Right");M.prototype[n]=function(){return this.__filtered__?new M(this):this[t](1)}}),M.prototype.compact=function(){return this.filter(vn)},M.prototype.find=function(n){return this.filter(n).head()},M.prototype.findLast=function(n){return this.reverse().find(n)},M.prototype.invokeMap=R(function(n,e){return typeof n=="function"?new M(this):this.map(function(t){return vt(t,n,e)})}),M.prototype.reject=function(n){return this.filter(pr(A(n)))},M.prototype.slice=function(n,e){n=S(n);var t=this;return t.__filtered__&&(n>0||e<0)?new M(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==l&&(e=S(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},M.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},M.prototype.toArray=function(){return this.take(Sn)},Xn(M.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],f=r||/^find/.test(e);!i||(u.prototype[e]=function(){var o=this.__wrapped__,a=r?[1]:arguments,c=o instanceof M,p=a[0],d=c||T(o),_=function(O){var b=i.apply(u,he([O],a));return r&&v?b[0]:b};d&&t&&typeof p=="function"&&p.length!=1&&(c=d=!1);var v=this.__chain__,m=!!this.__actions__.length,y=f&&!v,L=c&&!m;if(!f&&d){o=L?o:new M(this);var E=n.apply(o,a);return E.__actions__.push({func:sr,args:[_],thisArg:l}),new Mn(E,v)}return y&&L?n.apply(this,a):(E=this.thru(_),y?r?E.value()[0]:E.value():E)})}),Rn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Bt[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var f=this.value();return e.apply(T(f)?f:[],i)}return this[t](function(o){return e.apply(T(o)?o:[],i)})}}),Xn(M.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";N.call(Ve,r)||(Ve[r]=[]),Ve[r].push({name:e,func:t})}}),Ve[rr(l,C).name]=[{name:"wrapper",func:l}],M.prototype.clone=Ca,M.prototype.reverse=Sa,M.prototype.value=La,u.prototype.at=rh,u.prototype.chain=ih,u.prototype.commit=uh,u.prototype.next=fh,u.prototype.plant=lh,u.prototype.reverse=ah,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=sh,u.prototype.first=u.prototype.head,st&&(u.prototype[st]=oh),u},Xe=ua();Se?((Se.exports=Xe)._=Xe,zr._=Xe):fn._=Xe}).call(it)})(wr,wr.exports);function bo(Vn,qn){const l=F.ref(),{modelValue:me,originalText:Ae,options:xn,mode:K,theme:ut,autoHeight:Be,offsetLeft:le,refreshAll:Ne,mouseTargetTypes:Kn,editorDecorations:ye,comments:J,addCommentIcon:ae,expandCommentIcon:Fe}=F.toRefs(Vn);let H,C,nn,en,Bn,sn=[],Zn=new Map,un=[],kn=[],zn=[],ft=!1;F.watch(ye,Ct,{deep:!0}),F.watch(J,()=>{St(),Lt()},{deep:!0}),F.watch(xn,()=>{Sn(),Cr()},{deep:!0}),F.watch(Ae,Ue),F.watch(ut,Nn),F.watch(me,()=>{ft?ft=!1:It()}),F.onBeforeMount(()=>{window.devuiThemeService&&(en=window.devuiThemeService,en.eventBus&&en.eventBus.add("themeChanged",Nn))}),F.onMounted(async()=>{Mo&&(H=await import("monaco-editor"),Nn(),mr(),K.value==="review"&&F.nextTick(()=>{Ct(),Lt(),St()}))});function mr(){K.value==="normal"||K.value==="review"?Ar():K.value.includes("diff")&&yr(),xn.value.theme||H.editor.setTheme(Bn),Yn(),Tr()}function Ar(){C||(C=H.editor.create(l.value,xn.value),C.setModel(H.editor.createModel(me.value,xn.value.language)),qn.emit("afterEditorInit",C),K.value==="review"&&(C.onMouseMove(Sr),C.onMouseLeave(se),C.onMouseDown(He)))}function yr(){nn||(nn=H.editor.createDiffEditor(l.value,xn.value),nn.setModel({original:H.editor.createModel(Ae.value,xn.value.language),modified:H.editor.createModel(me.value,xn.value.language)}),qn.emit("afterEditorInit",nn))}function It(){K.value==="normal"||K.value==="review"?Er():K.value==="diff"&&Ir()}function Er(){var w;!C||!C.getModel()||(w=C.getModel().modified)==null||w.setValue(me.value)}function Ir(){var w;!nn||!nn.getModel()||(w=nn.getModel().modified)==null||w.setValue(me.value)}function Nn(){xn.value.theme||(ut.value==="light"?Bn=en&&en.currentTheme.isDark?"vs-dark":"vs":ut.value==="dark"&&(Bn=en&&en.currentTheme.isDark?"vs":"vs-dark"),C&&H.editor.setTheme(Bn))}function Yn(){Be.value&&C.onDidChangeModelDecorations(()=>{setTimeout(Tt)})}function Tr(){let w;C?w=C.getModel():nn&&(w=nn.getModel().modified),w.onDidChangeContent(wr.exports.throttle(()=>{ft=!0,qn.emit("update: modelValue",w.getValue())},100))}function Ue(){var w;!nn||!nn.getModel()||(w=nn.getModel().original)==null||w.setValue(Ae.value)}function Sn(){const w=xn.value.language;if(C&&(K.value==="normal"||K.value==="review")){const W=nn.getModel();H.editor.setModelLanguage(W.modified,w),H.editor.setModelLanguage(W.original,w)}}function Cr(){C&&C.updateOptions(Vi({},xn.value)),nn&&nn.updateOptions(Vi({},xn.value))}function Tt(){var tn;const w=C.getOption(H.editor.EditorOption.lineHeight),W=((tn=C.getModel())==null?void 0:tn.getLineCount())||1,D=C.getTopForLineNumber(W+1)+w;l.value&&(l.value.style.height=`${D}px`),C.layout()}function Sr(w){if(w.target&&w.target.position){const W=w.target.position.lineNumber;if(Ie(W))zn=C.deltaDecorations(zn,[]);else{const D=[{range:new H.Range(W,0,W,0),option:{isWholeLine:!0,glyphMarginClassName:`icon-pointer ${ae.value}`}}];zn=C.deltaDecorations(zn,D)}}}function se(){C.deltaDecorations(zn,[])}function He(w){Kn.value.includes(w.target.type)&&qn.emit("click",w)}function Ct(){if(ye.value.length>=0&&C){const w=ye.value.map(Ee);setTimeout(()=>{kn=C.deltaDecorations(kn,w)}),kn=C.deltaDecorations(zn,[])}}function Ee(w){return{range:new H.Range(w.lineNumber,1,w.lineNumber,1),options:{isWholeLine:!0,className:w.customClasses||"",glyphMarginClassName:`icon-pointer ${w.icon||Fe.value} ${w.glyphClassName||""}`}}}function Ie(w){return ye.value.some(W=>W.lineNumber===w)}function St(){C&&C.changeViewZones(w=>{Ge(w),$e(w),Be.value&&Tt()})}function Ge(w){sn.length>0&&(sn.forEach(W=>{w.removeZone(W.id)}),sn=[],Zn=new Map)}function $e(w){J.value&&J.value.length&&J.value.filter(D=>D.isExpanded).forEach(D=>{const tn=w.addZone({afterLineNumber:D.lineNumber,heightInPx:D.heightInPx?D.heightInPx:0,afterColumn:1,domNode:document.createElement("div"),ondomNodeTop:Q=>{ot(D.lineNumber,{top:Q})},onComputedHeight:Q=>{ot(D.lineNumber,{height:Q})}});sn.push({lineNumber:D.lineNumber,id:tn})})}function ot(w,...W){const D=J.value.findIndex(Rr=>Rr.lineNumber===w),tn=C.getLayoutInfo(),Q=mn(W,tn,D);Q.height&&Zn.set(D,Q.height),J.value[D].domNode.style.width=`${tn.width-Q.minimapWidth-Q.offsetLeft}px`,Te(Q.top,Q.height,D)}function mn(w,W,D){let tn=0;const Q=J.value[D].offserLeft;return Q?tn=Q:tn=(le==null?void 0:le.value)?le==null?void 0:le.value:0,{top:w[0].top,height:w[0].height,minimapWidth:W.minimap.minimapWidth,offsetLeft:tn}}function Te(w,W,D){J.value[D].domNode.style.height=`${W}px`,Zn.get(D)===0?J.value[D].domNode.style.top=`-${1e4+w}px`:J.value[D].domNode.style.top=`${w}px`}function Lt(){C&&Fn()}function Fn(){Ne.value?Lr():Rt();const w=J.value.filter(W=>W.isExpanded);w==null||w.forEach(W=>{if(un.findIndex(tn=>tn.lineNumber===W.lineNumber)===-1){const tn=Ce(W);un.push({lineNumber:W.lineNumber,widget:tn}),C.addOverlayWidget(tn)}})}function Rt(){J.value.forEach(w=>{if(!w.isExpanded){const W=un.findIndex(D=>D.lineNumber===w.lineNumber);if(W!==-1){const D=un.splice(W,1)[0];C.removeOverlayWidget(D.widget)}}})}function Lr(){un.length>0&&(un.forEach(w=>{C.removeOverlayWidget(w.widget)}),un=[])}function Ce(w){return{getId:()=>`widget-lineNumber${w.lineNumber}`,getDomNode:()=>w.domNode,getPosition:()=>null}}return{editorEl:l}}var _d="",xr=F.defineComponent({name:"DCodeEditor",props:wn,emits:["update: modelValue","afterEditorInit","click"],setup(Vn,qn){const{editorEl:l}=bo(Vn,qn);return()=>F.createVNode("div",{ref:l,class:"devui-code-editor"},null)}}),Wo={title:"Code Editor \u4EE3\u7801\u7F16\u8F91\u5668",category:"\u6F14\u8FDB\u4E2D",status:"100%",install(Vn){Vn.component(xr.name,xr)}};j.CodeEditor=xr,j.codeEditorProps=wn,j.default=Wo,Object.defineProperty(j,"__esModule",{value:!0}),j[Symbol.toStringTag]="Module"});
|
package/global.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export{}
|
|
|
4
4
|
declare module '@vue/runtime-core' {
|
|
5
5
|
|
|
6
6
|
export interface GlobalComponents{
|
|
7
|
-
|
|
7
|
+
DActionTimeline: typeof import('./types/vue-devui')['ActionTimeline']
|
|
8
|
+
DAlert: typeof import('./types/vue-devui')['Alert']
|
|
8
9
|
DAutoComplete: typeof import('./types/vue-devui')['AutoComplete']
|
|
9
10
|
DAvatar: typeof import('./types/vue-devui')['Avatar']
|
|
10
11
|
DBadge: typeof import('./types/vue-devui')['Badge']
|
|
@@ -46,9 +47,9 @@ DMenu: typeof import('./types/vue-devui')['Menu']
|
|
|
46
47
|
DMenuItem: typeof import('./types/vue-devui')['MenuItem']
|
|
47
48
|
DSubMenu: typeof import('./types/vue-devui')['SubMenu']
|
|
48
49
|
DModal: typeof import('./types/vue-devui')['Modal']
|
|
49
|
-
DModalHeader: typeof import('./types/vue-devui')['
|
|
50
|
-
DModalBody: typeof import('./types/vue-devui')['
|
|
51
|
-
DModalFooter: typeof import('./types/vue-devui')['
|
|
50
|
+
DModalHeader: typeof import('./types/vue-devui')['ModalHeader']
|
|
51
|
+
DModalBody: typeof import('./types/vue-devui')['ModalBody']
|
|
52
|
+
DModalFooter: typeof import('./types/vue-devui')['ModalFooter']
|
|
52
53
|
DNotification: typeof import('./types/vue-devui')['Notification']
|
|
53
54
|
DFixedOverlay: typeof import('./types/vue-devui')['FixedOverlay']
|
|
54
55
|
DFlexibleOverlay: typeof import('./types/vue-devui')['FlexibleOverlay']
|
package/modal/index.es.js
CHANGED
|
@@ -678,7 +678,7 @@ const useDraggable = (targetRef, dragRef, draggable) => {
|
|
|
678
678
|
modalPosition
|
|
679
679
|
};
|
|
680
680
|
};
|
|
681
|
-
var
|
|
681
|
+
var ModalHeader = defineComponent({
|
|
682
682
|
name: "DModalHeader",
|
|
683
683
|
setup(props, {
|
|
684
684
|
slots
|
|
@@ -692,7 +692,7 @@ var Header = defineComponent({
|
|
|
692
692
|
};
|
|
693
693
|
}
|
|
694
694
|
});
|
|
695
|
-
var
|
|
695
|
+
var ModalBody = defineComponent({
|
|
696
696
|
name: "DModalBody",
|
|
697
697
|
setup(props, {
|
|
698
698
|
slots
|
|
@@ -777,7 +777,7 @@ var Modal = defineComponent({
|
|
|
777
777
|
cursor: props.draggable ? "move" : "default"
|
|
778
778
|
},
|
|
779
779
|
"ref": headerRef
|
|
780
|
-
}, [createVNode(
|
|
780
|
+
}, [createVNode(ModalHeader, null, {
|
|
781
781
|
default: () => [createVNode("div", {
|
|
782
782
|
"class": "type-content"
|
|
783
783
|
}, [createVNode("div", {
|
|
@@ -829,9 +829,9 @@ var Modal = defineComponent({
|
|
|
829
829
|
cursor: props.draggable ? "move" : "default"
|
|
830
830
|
},
|
|
831
831
|
"ref": headerRef
|
|
832
|
-
}, [slots.header ? slots.header() : title.value && createVNode(
|
|
832
|
+
}, [slots.header ? slots.header() : title.value && createVNode(ModalHeader, null, {
|
|
833
833
|
default: () => [title.value]
|
|
834
|
-
})]), createVNode(
|
|
834
|
+
})]), createVNode(ModalBody, null, {
|
|
835
835
|
default: () => {
|
|
836
836
|
var _a2;
|
|
837
837
|
return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
|
|
@@ -842,7 +842,7 @@ var Modal = defineComponent({
|
|
|
842
842
|
});
|
|
843
843
|
}
|
|
844
844
|
});
|
|
845
|
-
var
|
|
845
|
+
var ModalFooter = defineComponent({
|
|
846
846
|
name: "DModalFooter",
|
|
847
847
|
setup(props, {
|
|
848
848
|
slots
|
|
@@ -920,9 +920,9 @@ var index = {
|
|
|
920
920
|
status: "100%",
|
|
921
921
|
install(app) {
|
|
922
922
|
app.component(Modal.name, Modal);
|
|
923
|
-
app.component(
|
|
924
|
-
app.component(
|
|
925
|
-
app.component(
|
|
923
|
+
app.component(ModalHeader.name, ModalHeader);
|
|
924
|
+
app.component(ModalBody.name, ModalBody);
|
|
925
|
+
app.component(ModalFooter.name, ModalFooter);
|
|
926
926
|
if (!inBrowser) {
|
|
927
927
|
return;
|
|
928
928
|
}
|
|
@@ -935,4 +935,4 @@ var index = {
|
|
|
935
935
|
app.provide(ModalService.token, new ModalService(anchorsContainer));
|
|
936
936
|
}
|
|
937
937
|
};
|
|
938
|
-
export { Modal, index as default, modalProps };
|
|
938
|
+
export { Modal, ModalBody, ModalFooter, ModalHeader, index as default, modalProps };
|
package/modal/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ve=Object.defineProperty,ge=Object.defineProperties;var we=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var A=(c,e,u)=>e in c?ve(c,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):c[e]=u,T=(c,e)=>{for(var u in e||(e={}))_.call(e,u)&&A(c,u,e[u]);if(P)for(var u of P(e))q.call(e,u)&&A(c,u,e[u]);return c},$=(c,e)=>ge(c,we(e));var W=(c,e)=>{var u={};for(var b in c)_.call(c,b)&&e.indexOf(b)<0&&(u[b]=c[b]);if(c!=null&&P)for(var b of P(c))e.indexOf(b)<0&&q.call(c,b)&&(u[b]=c[b]);return u};var G=(c,e,u)=>(A(c,typeof e!="symbol"?e+"":e,u),u);(function(c,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],e):(c=typeof globalThis!="undefined"?globalThis:c||self,e(c.index={},c.Vue,c.dom))})(this,function(c,e,u){"use strict";const b={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function},escapable:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showAnimation:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!0},type:{type:String,default:""},keepLast:{type:Boolean,default:!1}},K={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},J={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function O(t,o,n){let l=t;return o&&(l+=`__${o}`),n&&(l+=`--${n}`),l}function V(t,o=!1){const n=o?`.devui-${t}`:`devui-${t}`;return{b:()=>O(n),e:r=>r?O(n,r):"",m:r=>r?O(n,"",r):"",em:(r,d)=>r&&d?O(n,r,d):""}}var Ve="",Q=e.defineComponent({name:"DSvgIcon",props:J,setup(t){const{name:o,color:n,size:l}=e.toRefs(t),a=V("svg-icon"),i=e.computed(()=>`#icon-${o.value}`),s=e.computed(()=>typeof l.value=="number"?`${l.value}px`:l.value),r={width:s.value,height:s.value};return()=>e.createVNode("svg",{class:a.b(),style:r},[e.createVNode("use",{"xlink:href":i.value,fill:n.value},null)])}});function Z(t){return/^((http|https):)?\/\//.test(t)}function ee(t,o){const{component:n,name:l,size:a,color:i,classPrefix:s,rotate:r}=e.toRefs(t),d=V("icon"),f=e.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),m=n.value?e.resolveDynamicComponent(n.value):e.resolveDynamicComponent(Q),p=()=>e.createVNode("img",e.mergeProps({src:l.value,alt:l.value.split("/")[l.value.split("/").length-1],class:[(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{width:f.value||"",transform:`rotate(${r==null?void 0:r.value}deg)`,verticalAlign:"middle"}},o.attrs),null),h=()=>e.createVNode(m,e.mergeProps({name:l.value,color:i.value,size:f.value,class:[(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{transform:`rotate(${r==null?void 0:r.value}deg)`}},o.attrs),null),v=()=>{const w=/^icon-/.test(l.value)?l.value:`${s.value}-${l.value}`;return e.createVNode("i",e.mergeProps({class:[s.value,w,(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{fontSize:f.value,color:i.value,transform:`rotate(${r==null?void 0:r.value}deg)`}},o.attrs),null)};return{iconDom:()=>n.value?h():Z(l.value)?p():v()}}var I=e.defineComponent({name:"DIcon",props:K,emits:["click"],setup(t,o){const{disabled:n,operable:l}=e.toRefs(t),{iconDom:a}=ee(t,o),i=V("icon"),s=e.computed(()=>({[i.e("container")]:!0,[i.m("disabled")]:n.value,[i.m("operable")]:l.value,[i.m("no-slots")]:!Object.keys(o.slots).length})),r=d=>{n.value||o.emit("click",d)};return()=>{var d,f,m,p;return e.createVNode("div",{class:s.value,onClick:r},[(f=(d=o.slots).prefix)==null?void 0:f.call(d),a(),(p=(m=o.slots).suffix)==null?void 0:p.call(m)])}}}),Ee="";e.defineComponent({name:"DIconGroup",setup(t,o){const n=V("icon-group");return()=>{var l,a;return e.createVNode("div",{class:n.b()},[(a=(l=o.slots).default)==null?void 0:a.call(l)])}}});const te={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function R(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const t=document.documentElement.scrollTop,o=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${t}px`,document.documentElement.style.width=document.documentElement.style.width||"100%",document.documentElement.style.overflowY="scroll",()=>{o?document.documentElement.setAttribute("style",o):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=t}}}function oe(t,o){let n;const l=i=>{i.preventDefault(),o.emit("click",i),t.closeOnClickOverlay&&o.emit("update:modelValue",!1)},a=()=>{n==null||n()};return e.watch(()=>t.modelValue,i=>{i?t.lockScroll&&(n=R()):a()}),e.onUnmounted(a),{onClick:l}}var Ce="";const ne=e.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:te,emits:["update:modelValue","click"],setup(t,o){const{modelValue:n}=e.toRefs(t),l=V("fixed-overlay"),{onClick:a}=oe(t,o);return()=>e.createVNode(e.Transition,{name:l.m("fade")},{default:()=>{var i,s;return[n.value&&e.createVNode("div",e.mergeProps({class:l.b()},o.attrs,{onClick:a}),[(s=(i=o.slots).default)==null?void 0:s.call(i)])]}})}}),le={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0},clickEventBubble:{type:Boolean,default:!1}};function ae(t){const o=/(auto|scroll|hidden)/;for(let n=t;n=n.parentElement;n.parentElement!==document.body){const l=window.getComputedStyle(n);if(o.test(l.overflow+l.overflowX+l.overflowY))return n}return window}function re(t,o,n,l){let{x:a,y:i}=o;if(!t){const{width:s,height:r}=l;a&&n.includes("start")&&(a=12),a&&n.includes("end")&&(a=Math.round(s-24)),i&&n.includes("start")&&(i=10),i&&n.includes("end")&&(i=r-14)}return{x:a,y:i}}function ie(t,o){const n=e.ref(),l=e.ref();let a=null;const i=(r,d,f,m)=>{const{x:p,y:h}=re(t.isArrowCenter,f,d,m.getBoundingClientRect()),v={top:"bottom",right:"left",bottom:"top",left:"right"}[d.split("-")[0]];Object.assign(r.style,{left:p?`${p}px`:"",top:h?`${h}px`:"",right:"",bottom:"",[v]:"-4px"})},s=async()=>{const r=t.origin,d=e.unref(n.value),f=e.unref(l.value),m=[u.offset(t.offset),u.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&m.push(u.arrow({element:f})),t.shiftOffset!==void 0&&m.push(u.shift());const{x:p,y:h,placement:v,middlewareData:g}=await u.computePosition(r,d,{strategy:"fixed",middleware:m});let w=p,E=h;if(t.shiftOffset!==void 0){const{x,y:N}=g.shift;x<0&&(w-=t.shiftOffset),x>0&&(w+=t.shiftOffset),N<0&&(E-=t.shiftOffset),N>0&&(E+=t.shiftOffset)}o("positionChange",v),Object.assign(d.style,{top:`${E}px`,left:`${w}px`}),t.showArrow&&i(f,v,g.arrow,d)};return e.watch(()=>t.modelValue,()=>{t.modelValue&&t.origin?(a=ae(t.origin),e.nextTick(s),a==null||a.addEventListener("scroll",s),a!==window&&window.addEventListener("scroll",s),window.addEventListener("resize",s)):(a==null||a.removeEventListener("scroll",s),a!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s))}),e.onUnmounted(()=>{a==null||a.removeEventListener("scroll",s),a!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}),{arrowRef:l,overlayRef:n,updatePosition:s}}var xe="";e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:le,emits:["update:modelValue","positionChange"],setup(t,{slots:o,attrs:n,emit:l,expose:a}){const i=V("flexible-overlay"),{clickEventBubble:s}=e.toRefs(t),{arrowRef:r,overlayRef:d,updatePosition:f}=ie(t,l);return a({updatePosition:f}),()=>{var m;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:d,class:i.b()},n,{onClick:e.withModifiers(()=>({}),[s.value?"":"stop"]),onPointerup:e.withModifiers(()=>({}),["stop"])}),[(m=o.default)==null?void 0:m.call(o),t.showArrow&&e.createVNode("div",{ref:r,class:i.e("arrow")},null)])}}});const se=typeof window!="undefined";function ce(t,o){function n(){o("update:modelValue",!1)}function l(){t.beforeClose?t.beforeClose(n):n()}function a(i){i.code==="Escape"&&l()}return e.onMounted(()=>{t.escapable&&window.addEventListener("keydown",a)}),e.onUnmounted(()=>{t.escapable&&window.addEventListener("keydown",a)}),{execClose:l}}function de(t){let o;const n=()=>{o==null||o()};e.watch(()=>t.modelValue,l=>{l?t.lockScroll&&(o=R()):n()},{immediate:!0}),e.onUnmounted(n)}function z(t,o="px"){return t?typeof t=="string"?t:typeof t=="number"?`${t}${o}`:"":""}const ue=(t,o,n)=>{const l=e.ref("translate(-50%, -50%)");let a={offsetX:0,offsetY:0};const i=f=>{const m=f.clientX,p=f.clientY,{offsetX:h,offsetY:v}=a,g=t.value.getBoundingClientRect(),w=g.left,E=g.top,x=g.width,N=g.height,C=document.documentElement.clientWidth,y=document.documentElement.clientHeight,S=-w+h,pe=-E+v,ye=C-w-x+h,he=y-E-N+v,F=U=>{const j=Math.min(Math.max(h+U.clientX-m,S),ye),H=Math.min(Math.max(v+U.clientY-p,pe),he);a={offsetX:j,offsetY:H},l.value=`translate(calc(-50% + ${z(j)}), calc(-50% + ${z(H)}))`},Y=()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",Y)};document.addEventListener("mousemove",F),document.addEventListener("mouseup",Y)},s=()=>{o.value&&t.value&&o.value.addEventListener("mousedown",i)},r=()=>{o.value&&t.value&&o.value.removeEventListener("mousedown",i)};return e.onMounted(()=>{e.watchEffect(()=>{n.value?s():r()})}),e.onBeforeUnmount(()=>{r()}),{clearPosition:()=>{a={offsetX:0,offsetY:0},l.value="translate(-50%, -50%)"},modalPosition:l}};var B=e.defineComponent({name:"DModalHeader",setup(t,{slots:o}){const n=V("modal");return()=>{var l;return e.createVNode("div",{class:n.e("header")},[(l=o.default)==null?void 0:l.call(o)])}}}),D=e.defineComponent({name:"DModalBody",setup(t,{slots:o}){const n=V("modal");return()=>{var l;return e.createVNode("div",{class:n.e("body")},[(l=o.default)==null?void 0:l.call(o)])}}}),Ne="",k=e.defineComponent({name:"DModal",inheritAttrs:!1,props:b,emits:["update:modelValue"],setup(t,{slots:o,attrs:n,emit:l}){const a=V("modal"),{modelValue:i,title:s,showClose:r,showOverlay:d,appendToBody:f,closeOnClickOverlay:m,keepLast:p}=e.toRefs(t),{execClose:h}=ce(t,l);de(t);const v=e.ref(),g=e.ref(),w=e.computed(()=>t.draggable),{clearPosition:E,modalPosition:x}=ue(v,g,w);e.watch(i,C=>{C&&!p.value&&(E(),e.nextTick(()=>{const y=document==null?void 0:document.querySelector("[autofocus]");y&&y.focus()}))});const N=()=>{const y=[{type:"success",text:"\u6210\u529F",icon:"right-o",color:"var(--devui-success)"},{type:"failed",text:"\u9519\u8BEF",icon:"error-o",color:"var(--devui-danger)"},{type:"warning",text:"\u8B66\u544A",icon:"warning-o",color:"var(--devui-warning)"},{type:"info",text:"\u4FE1\u606F",icon:"info-o",color:"var(--devui-info)"}].find(S=>S.type===t.type);return e.createVNode("div",{style:{cursor:t.draggable?"move":"default"},ref:g},[e.createVNode(B,null,{default:()=>[e.createVNode("div",{class:"type-content"},[e.createVNode("div",{class:"type-content-icon"},[e.createVNode(I,{name:y==null?void 0:y.icon,color:y==null?void 0:y.color},null)]),e.createVNode("div",{class:"type-content-text"},[y==null?void 0:y.text])])]})])};return()=>e.createVNode(e.Teleport,{to:"body",disabled:!f.value},{default:()=>[d.value&&e.createVNode(ne,e.mergeProps({modelValue:i.value},{"onUpdate:modelValue":h},{class:a.e("overlay"),"lock-scroll":!1,"close-on-click-overlay":m.value,style:{zIndex:"calc(var(--devui-z-index-modal, 1050) - 1)"}}),null),e.createVNode(e.Transition,{name:t.showAnimation?a.m("wipe"):""},{default:()=>{var C;return[i.value&&e.createVNode("div",e.mergeProps({ref:v,class:a.b()},n,{onClick:y=>y.stopPropagation(),style:{transform:x.value}}),[r.value&&e.createVNode("div",{onClick:h,class:"btn-close"},[e.createVNode(I,{name:"close",size:"20px"},null)]),t.type?N():e.createVNode("div",{style:{cursor:t.draggable?"move":"default"},ref:g},[o.header?o.header():s.value&&e.createVNode(B,null,{default:()=>[s.value]})]),e.createVNode(D,null,{default:()=>{var y;return[(y=o.default)==null?void 0:y.call(o)]}}),(C=o.footer)==null?void 0:C.call(o)])]}})]})}}),X=e.defineComponent({name:"DModalFooter",setup(t,{slots:o}){const n=V("modal");return()=>{var l;return e.createVNode("div",{class:n.e("footer")},[(l=o.default)==null?void 0:l.call(o)])}}});class fe{constructor(o){this.anchorContainer=o}renderModal(o,n,l){const a=e.h(this.component(),n,l);return e.render(a,o),a}renderNull(o){setTimeout(()=>{e.render(null,o)},500)}}let M;class L extends fe{component(){return k}open(o={}){const n=document.createElement("div");this.anchorContainer.appendChild(n);const m=o,{header:l,content:a,footer:i}=m,s=W(m,["header","content","footer"]),r=(p,h)=>this.renderModal(n,$(T({},p),{modelValue:!0,"onUpdate:modelValue":h}),{header:l,default:a,footer:i}),d=()=>{var h,v,g;const p=w=>{w||d()};r(s,w=>{w?r(s,p):(this.renderModal(n,$(T({},s),{modelValue:!1})),this.renderNull(n))}),(g=(v=(h=M==null?void 0:M.component)==null?void 0:h.exposed)==null?void 0:v.handleVisibleChange)==null||g.call(v,!1)},f=p=>{p||d()};return this.renderModal(n,{modelValue:!1}),M=r(s,f),{hide:d}}}G(L,"token","MODAL_SERVICE_TOKEN");var me={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(t){if(t.component(k.name,k),t.component(B.name,B),t.component(D.name,D),t.component(X.name,X),!se)return;let o=document.getElementById("d-modal-anchors-container");o||(o=document.createElement("div"),o.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(o)),t.provide(L.token,new L(o))}};c.Modal=k,c.default=me,c.modalProps=b,Object.defineProperty(c,"__esModule",{value:!0}),c[Symbol.toStringTag]="Module"});
|
|
1
|
+
var ve=Object.defineProperty,ge=Object.defineProperties;var we=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var T=(c,e,u)=>e in c?ve(c,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):c[e]=u,$=(c,e)=>{for(var u in e||(e={}))_.call(e,u)&&T(c,u,e[u]);if(D)for(var u of D(e))q.call(e,u)&&T(c,u,e[u]);return c},I=(c,e)=>ge(c,we(e));var W=(c,e)=>{var u={};for(var b in c)_.call(c,b)&&e.indexOf(b)<0&&(u[b]=c[b]);if(c!=null&&D)for(var b of D(c))e.indexOf(b)<0&&q.call(c,b)&&(u[b]=c[b]);return u};var G=(c,e,u)=>(T(c,typeof e!="symbol"?e+"":e,u),u);(function(c,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],e):(c=typeof globalThis!="undefined"?globalThis:c||self,e(c.index={},c.Vue,c.dom))})(this,function(c,e,u){"use strict";const b={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function},escapable:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showAnimation:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!0},type:{type:String,default:""},keepLast:{type:Boolean,default:!1}},K={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},J={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function M(t,o,n){let l=t;return o&&(l+=`__${o}`),n&&(l+=`--${n}`),l}function V(t,o=!1){const n=o?`.devui-${t}`:`devui-${t}`;return{b:()=>M(n),e:r=>r?M(n,r):"",m:r=>r?M(n,"",r):"",em:(r,d)=>r&&d?M(n,r,d):""}}var Ve="",Q=e.defineComponent({name:"DSvgIcon",props:J,setup(t){const{name:o,color:n,size:l}=e.toRefs(t),a=V("svg-icon"),i=e.computed(()=>`#icon-${o.value}`),s=e.computed(()=>typeof l.value=="number"?`${l.value}px`:l.value),r={width:s.value,height:s.value};return()=>e.createVNode("svg",{class:a.b(),style:r},[e.createVNode("use",{"xlink:href":i.value,fill:n.value},null)])}});function Z(t){return/^((http|https):)?\/\//.test(t)}function ee(t,o){const{component:n,name:l,size:a,color:i,classPrefix:s,rotate:r}=e.toRefs(t),d=V("icon"),f=e.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),m=n.value?e.resolveDynamicComponent(n.value):e.resolveDynamicComponent(Q),p=()=>e.createVNode("img",e.mergeProps({src:l.value,alt:l.value.split("/")[l.value.split("/").length-1],class:[(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{width:f.value||"",transform:`rotate(${r==null?void 0:r.value}deg)`,verticalAlign:"middle"}},o.attrs),null),h=()=>e.createVNode(m,e.mergeProps({name:l.value,color:i.value,size:f.value,class:[(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{transform:`rotate(${r==null?void 0:r.value}deg)`}},o.attrs),null),v=()=>{const w=/^icon-/.test(l.value)?l.value:`${s.value}-${l.value}`;return e.createVNode("i",e.mergeProps({class:[s.value,w,(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{fontSize:f.value,color:i.value,transform:`rotate(${r==null?void 0:r.value}deg)`}},o.attrs),null)};return{iconDom:()=>n.value?h():Z(l.value)?p():v()}}var R=e.defineComponent({name:"DIcon",props:K,emits:["click"],setup(t,o){const{disabled:n,operable:l}=e.toRefs(t),{iconDom:a}=ee(t,o),i=V("icon"),s=e.computed(()=>({[i.e("container")]:!0,[i.m("disabled")]:n.value,[i.m("operable")]:l.value,[i.m("no-slots")]:!Object.keys(o.slots).length})),r=d=>{n.value||o.emit("click",d)};return()=>{var d,f,m,p;return e.createVNode("div",{class:s.value,onClick:r},[(f=(d=o.slots).prefix)==null?void 0:f.call(d),a(),(p=(m=o.slots).suffix)==null?void 0:p.call(m)])}}}),Ee="";e.defineComponent({name:"DIconGroup",setup(t,o){const n=V("icon-group");return()=>{var l,a;return e.createVNode("div",{class:n.b()},[(a=(l=o.slots).default)==null?void 0:a.call(l)])}}});const te={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function z(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const t=document.documentElement.scrollTop,o=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${t}px`,document.documentElement.style.width=document.documentElement.style.width||"100%",document.documentElement.style.overflowY="scroll",()=>{o?document.documentElement.setAttribute("style",o):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=t}}}function oe(t,o){let n;const l=i=>{i.preventDefault(),o.emit("click",i),t.closeOnClickOverlay&&o.emit("update:modelValue",!1)},a=()=>{n==null||n()};return e.watch(()=>t.modelValue,i=>{i?t.lockScroll&&(n=z()):a()}),e.onUnmounted(a),{onClick:l}}var Ce="";const ne=e.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:te,emits:["update:modelValue","click"],setup(t,o){const{modelValue:n}=e.toRefs(t),l=V("fixed-overlay"),{onClick:a}=oe(t,o);return()=>e.createVNode(e.Transition,{name:l.m("fade")},{default:()=>{var i,s;return[n.value&&e.createVNode("div",e.mergeProps({class:l.b()},o.attrs,{onClick:a}),[(s=(i=o.slots).default)==null?void 0:s.call(i)])]}})}}),le={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0},clickEventBubble:{type:Boolean,default:!1}};function ae(t){const o=/(auto|scroll|hidden)/;for(let n=t;n=n.parentElement;n.parentElement!==document.body){const l=window.getComputedStyle(n);if(o.test(l.overflow+l.overflowX+l.overflowY))return n}return window}function re(t,o,n,l){let{x:a,y:i}=o;if(!t){const{width:s,height:r}=l;a&&n.includes("start")&&(a=12),a&&n.includes("end")&&(a=Math.round(s-24)),i&&n.includes("start")&&(i=10),i&&n.includes("end")&&(i=r-14)}return{x:a,y:i}}function ie(t,o){const n=e.ref(),l=e.ref();let a=null;const i=(r,d,f,m)=>{const{x:p,y:h}=re(t.isArrowCenter,f,d,m.getBoundingClientRect()),v={top:"bottom",right:"left",bottom:"top",left:"right"}[d.split("-")[0]];Object.assign(r.style,{left:p?`${p}px`:"",top:h?`${h}px`:"",right:"",bottom:"",[v]:"-4px"})},s=async()=>{const r=t.origin,d=e.unref(n.value),f=e.unref(l.value),m=[u.offset(t.offset),u.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&m.push(u.arrow({element:f})),t.shiftOffset!==void 0&&m.push(u.shift());const{x:p,y:h,placement:v,middlewareData:g}=await u.computePosition(r,d,{strategy:"fixed",middleware:m});let w=p,E=h;if(t.shiftOffset!==void 0){const{x:N,y:x}=g.shift;N<0&&(w-=t.shiftOffset),N>0&&(w+=t.shiftOffset),x<0&&(E-=t.shiftOffset),x>0&&(E+=t.shiftOffset)}o("positionChange",v),Object.assign(d.style,{top:`${E}px`,left:`${w}px`}),t.showArrow&&i(f,v,g.arrow,d)};return e.watch(()=>t.modelValue,()=>{t.modelValue&&t.origin?(a=ae(t.origin),e.nextTick(s),a==null||a.addEventListener("scroll",s),a!==window&&window.addEventListener("scroll",s),window.addEventListener("resize",s)):(a==null||a.removeEventListener("scroll",s),a!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s))}),e.onUnmounted(()=>{a==null||a.removeEventListener("scroll",s),a!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}),{arrowRef:l,overlayRef:n,updatePosition:s}}var Ne="";e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:le,emits:["update:modelValue","positionChange"],setup(t,{slots:o,attrs:n,emit:l,expose:a}){const i=V("flexible-overlay"),{clickEventBubble:s}=e.toRefs(t),{arrowRef:r,overlayRef:d,updatePosition:f}=ie(t,l);return a({updatePosition:f}),()=>{var m;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:d,class:i.b()},n,{onClick:e.withModifiers(()=>({}),[s.value?"":"stop"]),onPointerup:e.withModifiers(()=>({}),["stop"])}),[(m=o.default)==null?void 0:m.call(o),t.showArrow&&e.createVNode("div",{ref:r,class:i.e("arrow")},null)])}}});const se=typeof window!="undefined";function ce(t,o){function n(){o("update:modelValue",!1)}function l(){t.beforeClose?t.beforeClose(n):n()}function a(i){i.code==="Escape"&&l()}return e.onMounted(()=>{t.escapable&&window.addEventListener("keydown",a)}),e.onUnmounted(()=>{t.escapable&&window.addEventListener("keydown",a)}),{execClose:l}}function de(t){let o;const n=()=>{o==null||o()};e.watch(()=>t.modelValue,l=>{l?t.lockScroll&&(o=z()):n()},{immediate:!0}),e.onUnmounted(n)}function F(t,o="px"){return t?typeof t=="string"?t:typeof t=="number"?`${t}${o}`:"":""}const ue=(t,o,n)=>{const l=e.ref("translate(-50%, -50%)");let a={offsetX:0,offsetY:0};const i=f=>{const m=f.clientX,p=f.clientY,{offsetX:h,offsetY:v}=a,g=t.value.getBoundingClientRect(),w=g.left,E=g.top,N=g.width,x=g.height,C=document.documentElement.clientWidth,y=document.documentElement.clientHeight,A=-w+h,pe=-E+v,ye=C-w-N+h,he=y-E-x+v,X=U=>{const H=Math.min(Math.max(h+U.clientX-m,A),ye),j=Math.min(Math.max(v+U.clientY-p,pe),he);a={offsetX:H,offsetY:j},l.value=`translate(calc(-50% + ${F(H)}), calc(-50% + ${F(j)}))`},Y=()=>{document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",Y)};document.addEventListener("mousemove",X),document.addEventListener("mouseup",Y)},s=()=>{o.value&&t.value&&o.value.addEventListener("mousedown",i)},r=()=>{o.value&&t.value&&o.value.removeEventListener("mousedown",i)};return e.onMounted(()=>{e.watchEffect(()=>{n.value?s():r()})}),e.onBeforeUnmount(()=>{r()}),{clearPosition:()=>{a={offsetX:0,offsetY:0},l.value="translate(-50%, -50%)"},modalPosition:l}};var O=e.defineComponent({name:"DModalHeader",setup(t,{slots:o}){const n=V("modal");return()=>{var l;return e.createVNode("div",{class:n.e("header")},[(l=o.default)==null?void 0:l.call(o)])}}}),B=e.defineComponent({name:"DModalBody",setup(t,{slots:o}){const n=V("modal");return()=>{var l;return e.createVNode("div",{class:n.e("body")},[(l=o.default)==null?void 0:l.call(o)])}}}),xe="",k=e.defineComponent({name:"DModal",inheritAttrs:!1,props:b,emits:["update:modelValue"],setup(t,{slots:o,attrs:n,emit:l}){const a=V("modal"),{modelValue:i,title:s,showClose:r,showOverlay:d,appendToBody:f,closeOnClickOverlay:m,keepLast:p}=e.toRefs(t),{execClose:h}=ce(t,l);de(t);const v=e.ref(),g=e.ref(),w=e.computed(()=>t.draggable),{clearPosition:E,modalPosition:N}=ue(v,g,w);e.watch(i,C=>{C&&!p.value&&(E(),e.nextTick(()=>{const y=document==null?void 0:document.querySelector("[autofocus]");y&&y.focus()}))});const x=()=>{const y=[{type:"success",text:"\u6210\u529F",icon:"right-o",color:"var(--devui-success)"},{type:"failed",text:"\u9519\u8BEF",icon:"error-o",color:"var(--devui-danger)"},{type:"warning",text:"\u8B66\u544A",icon:"warning-o",color:"var(--devui-warning)"},{type:"info",text:"\u4FE1\u606F",icon:"info-o",color:"var(--devui-info)"}].find(A=>A.type===t.type);return e.createVNode("div",{style:{cursor:t.draggable?"move":"default"},ref:g},[e.createVNode(O,null,{default:()=>[e.createVNode("div",{class:"type-content"},[e.createVNode("div",{class:"type-content-icon"},[e.createVNode(R,{name:y==null?void 0:y.icon,color:y==null?void 0:y.color},null)]),e.createVNode("div",{class:"type-content-text"},[y==null?void 0:y.text])])]})])};return()=>e.createVNode(e.Teleport,{to:"body",disabled:!f.value},{default:()=>[d.value&&e.createVNode(ne,e.mergeProps({modelValue:i.value},{"onUpdate:modelValue":h},{class:a.e("overlay"),"lock-scroll":!1,"close-on-click-overlay":m.value,style:{zIndex:"calc(var(--devui-z-index-modal, 1050) - 1)"}}),null),e.createVNode(e.Transition,{name:t.showAnimation?a.m("wipe"):""},{default:()=>{var C;return[i.value&&e.createVNode("div",e.mergeProps({ref:v,class:a.b()},n,{onClick:y=>y.stopPropagation(),style:{transform:N.value}}),[r.value&&e.createVNode("div",{onClick:h,class:"btn-close"},[e.createVNode(R,{name:"close",size:"20px"},null)]),t.type?x():e.createVNode("div",{style:{cursor:t.draggable?"move":"default"},ref:g},[o.header?o.header():s.value&&e.createVNode(O,null,{default:()=>[s.value]})]),e.createVNode(B,null,{default:()=>{var y;return[(y=o.default)==null?void 0:y.call(o)]}}),(C=o.footer)==null?void 0:C.call(o)])]}})]})}}),L=e.defineComponent({name:"DModalFooter",setup(t,{slots:o}){const n=V("modal");return()=>{var l;return e.createVNode("div",{class:n.e("footer")},[(l=o.default)==null?void 0:l.call(o)])}}});class fe{constructor(o){this.anchorContainer=o}renderModal(o,n,l){const a=e.h(this.component(),n,l);return e.render(a,o),a}renderNull(o){setTimeout(()=>{e.render(null,o)},500)}}let P;class S extends fe{component(){return k}open(o={}){const n=document.createElement("div");this.anchorContainer.appendChild(n);const m=o,{header:l,content:a,footer:i}=m,s=W(m,["header","content","footer"]),r=(p,h)=>this.renderModal(n,I($({},p),{modelValue:!0,"onUpdate:modelValue":h}),{header:l,default:a,footer:i}),d=()=>{var h,v,g;const p=w=>{w||d()};r(s,w=>{w?r(s,p):(this.renderModal(n,I($({},s),{modelValue:!1})),this.renderNull(n))}),(g=(v=(h=P==null?void 0:P.component)==null?void 0:h.exposed)==null?void 0:v.handleVisibleChange)==null||g.call(v,!1)},f=p=>{p||d()};return this.renderModal(n,{modelValue:!1}),P=r(s,f),{hide:d}}}G(S,"token","MODAL_SERVICE_TOKEN");var me={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(t){if(t.component(k.name,k),t.component(O.name,O),t.component(B.name,B),t.component(L.name,L),!se)return;let o=document.getElementById("d-modal-anchors-container");o||(o=document.createElement("div"),o.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(o)),t.provide(S.token,new S(o))}};c.Modal=k,c.ModalBody=B,c.ModalFooter=L,c.ModalHeader=O,c.default=me,c.modalProps=b,Object.defineProperty(c,"__esModule",{value:!0}),c[Symbol.toStringTag]="Module"});
|
package/package.json
CHANGED
package/splitter/index.es.js
CHANGED