@web-utils/component 1.0.4 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +550 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1,550 @@
|
|
|
1
|
-
var H=Object.defineProperty,V=Object.defineProperties;var X=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var w=(e,t,n)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f=(e,t)=>{for(var n in t||(t={}))U.call(t,n)&&w(e,n,t[n]);if(z)for(var n of z(t))k.call(t,n)&&w(e,n,t[n]);return e},c=(e,t)=>V(e,X(t));import{isPlainObject as L,isString as J,isArray as Y}from"@web-utils/core";var Ae="";const q="1.0.4";var D=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"empty-view",style:{fontSize:e.fontSize,height:e.height}},[e._t("default",function(){return[e._v(e._s(e.emptyTips))]})],2)},G=[],He="";function a(e,t,n,s,r,u,C,W){var i=typeof e=="function"?e.options:e;t&&(i.render=t,i.staticRenderFns=n,i._compiled=!0),s&&(i.functional=!0),u&&(i._scopeId="data-v-"+u);var l;if(C?(l=function(o){o=o||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!o&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(o=__VUE_SSR_CONTEXT__),r&&r.call(this,o),o&&o._registeredComponents&&o._registeredComponents.add(C)},i._ssrRegister=l):r&&(l=W?function(){r.call(this,(i.functional?this.parent:this).$root.$options.shadowRoot)}:r),l)if(i.functional){i._injectStyles=l;var j=i.render;i.render=function(A,S){return l.call(S),j(A,S)}}else{var y=i.beforeCreate;i.beforeCreate=y?[].concat(y,l):[l]}return{exports:e,options:i}}const K={name:"EmptyView",props:{emptyTips:{type:String,default:"\u6682\u65E0\u6570\u636E"},fontSize:{type:String,default:"20px"},height:{type:String,default:"100%"}}},M={};var Q=a(K,D,G,!1,Z,null,null,null);function Z(e){for(let t in M)this[t]=M[t]}var _=function(){return Q.exports}();_.install=function(e){e.component(_.name,_)};var ee=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex-scroller-wrapper"},[n("div",{class:["flex-scroller",{"flex-column":e.flexColumn,"flex-row":e.flexRow,"content-scroll":e.contentScroll},e.contentClass]},[e._t("default")],2)])},te=[],Ve="";const ne={name:"FlexScroller",props:{flexColumn:Boolean,flexRow:Boolean,contentClass:String,contentScroll:{type:Boolean,default:!0}}},F={};var re=a(ne,ee,te,!1,se,null,null,null);function se(e){for(let t in F)this[t]=F[t]}var h=function(){return re.exports}();h.install=function(e){e.component(h.name,h)};var ie=function(){var e=this,t=e.$createElement;return e._self._c,e._m(0)},oe=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"not-implement"},[n("div",[n("i",{staticClass:"fa fa-wrench"}),e._v(" \u5EFA\u8BBE\u4E2D... ")])])}],Xe="";const le={name:"NotImplement"},B={};var ae=a(le,ie,oe,!1,ue,"f91d5e80",null,null);function ue(e){for(let t in B)this[t]=B[t]}var p=function(){return ae.exports}();p.install=function(e){e.component(p.name,p)};function fe(e,t){for(let n=0;n<t.length;n++)if(e===t[n])return!0;return!1}const O=function(){return document.addEventListener?function(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}:function(e,t,n){e&&t&&n&&e.attachEvent(`on${t}`,n)}}(),R=function(){return document.removeEventListener?function(e,t,n){e&&t&&e.removeEventListener(t,n,!1)}:function(e,t,n){e&&t&&e.detachEvent(`on${t}`,n)}}();var ce=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.classes},[e.showIcon?n("div",{class:e.barConClasses},e._m(0),0):e._e()])},_e=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return e._l(8,function(s){return n("i",{key:`trigger-${s}`,class:`${e.prefix}-bar`})})}],Ue="";const he={name:"Trigger",props:{mode:String,showIcon:Boolean,line:{type:Boolean,default:!0}},data(){return{prefix:"egd-split-trigger"}},computed:{isVertical(){return this.mode==="vertical"},classes(){return[this.prefix,this.line?this.isVertical?` ${this.prefix}-vertical-line`:`${this.prefix}-horizontal-line`:"",this.isVertical?`${this.prefix}-vertical`:`${this.prefix}-horizontal`]},barConClasses(){return[`${this.prefix}-bar-con`,this.isVertical?"vertical":"horizontal"]}}},b={};var pe=a(he,ce,_e,!1,ve,null,null,null);function ve(e){for(let t in b)this[t]=b[t]}var de=function(){return pe.exports}(),me=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"outerWrapper",class:e.wrapperClasses},[e.isHorizontal?n("div",{class:`${e.prefix}-horizontal`},[n("div",{class:[`${e.prefix}-pane`,"left-pane"],style:{right:`${e.anotherOffset}%`}},[e._t("left")],2),n("div",{class:`${e.prefix}-trigger-con`,style:{left:`calc(${e.offset}% + ${e.triggerSize/2}px)`,width:`${e.triggerSize}px`},on:{mousedown:e.handleMousedown}},[e._t("trigger",function(){return[n("Trigger",{attrs:{mode:"vertical"}})]})],2),n("div",{class:[`${e.prefix}-pane`,"right-pane"],style:{left:`calc(${e.offset}% + ${e.triggerSize}px)`}},[e._t("right")],2)]):n("div",{class:`${e.prefix}-vertical`},[n("div",{class:[`${e.prefix}-pane`,"top-pane"],style:{bottom:`${e.anotherOffset}%`}},[e._t("top")],2),n("div",{class:`${e.prefix}-trigger-con`,style:{top:`calc(${e.offset}% + ${e.triggerSize/2}px)`,height:`${e.triggerSize}px`},on:{mousedown:e.handleMousedown}},[e._t("trigger",function(){return[n("Trigger",{attrs:{mode:"horizontal"}})]})],2),n("div",{class:[`${e.prefix}-pane`,"bottom-pane"],style:{top:`calc(${e.offset}% + ${e.triggerSize}px)`}},[e._t("bottom")],2)])])},xe=[],ke="";const $e={name:"SplitPane",components:{Trigger:de},props:{value:{type:[Number,String],default:.5},mode:{validator(e){return fe(e,["horizontal","vertical"])},default:"horizontal"},triggerSize:{type:Number,default:6},min:{type:[Number,String],default:"40px"},max:{type:[Number,String],default:"40px"}},data(){return{prefix:"egd-split",offset:0,oldOffset:0,isMoving:!1}},computed:{wrapperClasses(){return[`${this.prefix}-wrapper`,this.isMoving?"no-select":""]},isHorizontal(){return this.mode==="horizontal"},anotherOffset(){return 100-this.offset},valueIsPx(){return typeof this.value=="string"},offsetSize(){return this.isHorizontal?"offsetWidth":"offsetHeight"},computedMin(){return this.getComputedThresholdValue("min")},computedMax(){return this.getComputedThresholdValue("max")}},watch:{value(){this.offset=(this.valueIsPx?this.px2percent(this.value,this.$refs.outerWrapper[this.offsetSize]):this.value)*1e4/100}},mounted(){this.$nextTick(()=>{this.offset=(this.valueIsPx?this.px2percent(this.value,this.$refs.outerWrapper[this.offsetSize]):this.value)*1e4/100})},methods:{px2percent(e,t){return parseFloat(e)/parseFloat(t)},getComputedThresholdValue(e){const t=this.$refs.outerWrapper[this.offsetSize];return this.valueIsPx?typeof this[e]=="string"?this[e]:t*this[e]:typeof this[e]=="string"?this.px2percent(this[e],t):this[e]},getMin(e,t){return this.valueIsPx?`${Math.min(parseFloat(e),parseFloat(t))}px`:Math.min(e,t)},getMax(e,t){return this.valueIsPx?`${Math.max(parseFloat(e),parseFloat(t))}px`:Math.max(e,t)},getAnotherOffset(e){let t=0;return this.valueIsPx?t=`${this.$refs.outerWrapper[this.offsetSize]-parseFloat(e)}px`:t=1-e,t},handleMove(e){const n=(this.isHorizontal?e.pageX:e.pageY)-this.initOffset,s=this.$refs.outerWrapper[this.offsetSize];let r=this.valueIsPx?`${parseFloat(this.oldOffset)+n}px`:this.px2percent(s*this.oldOffset+n,s);const u=this.getAnotherOffset(r);parseFloat(r)<=parseFloat(this.computedMin)&&(r=this.getMax(r,this.computedMin)),parseFloat(u)<=parseFloat(this.computedMax)&&(r=this.getAnotherOffset(this.getMax(u,this.computedMax))),e.atMin=this.value===this.computedMin,e.atMax=this.valueIsPx?this.getAnotherOffset(this.value)===this.computedMax:this.getAnotherOffset(this.value).toFixed(5)===this.computedMax.toFixed(5),this.$emit("input",r),this.$emit("on-moving",e)},handleUp(){this.isMoving=!1,R(window,"mousemove",this.handleMove),R(window,"mouseup",this.handleUp),this.$emit("on-move-end")},handleMousedown(e){this.initOffset=this.isHorizontal?e.pageX:e.pageY,this.oldOffset=this.value,this.isMoving=!0,O(window,"mousemove",this.handleMove),O(window,"mouseup",this.handleUp),this.$emit("on-move-start")}}},I={};var ge=a($e,me,xe,!1,Ce,null,null,null);function Ce(e){for(let t in I)this[t]=I[t]}var v=function(){return ge.exports}();v.install=function(e){e.component(v.name,v)};var $={name:"JSXComponent",props:{msg:{type:String,default:""}},render(){return arguments[0]("div",[this.msg])}};const g=(e,t)=>L(e)||J(e)?[t,e]:Y(e)?[t,...e]:[t],ye={name:"FlexColumn",functional:!0,props:{verticalCenter:{type:Boolean,default:!1},horizonCenter:{type:Boolean,default:!1},center:{type:Boolean,default:!1},textCenter:{type:Boolean,default:!1}},render(e,{data:t,children:n,props:s}){const r=g(t.class,"flex-column");return s.center||s.horizonCenter&&s.verticalCenter?(r.push("horizon-center"),r.push("vertical-center")):(s.horizonCenter&&r.push("horizon-center"),s.verticalCenter&&r.push("vertical-center")),s.textCenter&&r.push("text-center"),e("div",c(f({},t),{class:r}),n)}};let Se,ze;const E={};var we=a(ye,Se,ze,!1,Me,null,null,null);function Me(e){for(let t in E)this[t]=E[t]}var d=function(){return we.exports}();const Fe={name:"FlexItem",functional:!0,props:{flexRow:{type:Boolean,default:!1},flexColumn:{type:Boolean,default:!1},verticalCenter:{type:Boolean,default:!1},horizonCenter:{type:Boolean,default:!1},center:{type:Boolean,default:!1},textCenter:{type:Boolean,default:!1},relative:{type:Boolean,default:!1},absolute:{type:Boolean,default:!1}},render(e,{children:t,data:n,props:s}){const r=g(n.class,s.relative?"flex-item-relative":"flex-item");return s.absolute&&!s.relative&&r.push("flex-item-relative"),s.center||s.horizonCenter&&s.verticalCenter?(r.push("horizon-center"),r.push("vertical-center")):(s.horizonCenter&&r.push("horizon-center"),s.verticalCenter&&r.push("vertical-center")),s.textCenter&&r.push("text-center"),s.flexColumn&&r.push("flex-column"),s.flexRow&&r.push("flex-row"),s.absolute?e("div",c(f({},n),{class:r}),[e("div",{class:"absolute",style:"overflow:auto"},t)]):e("div",c(f({},n),{class:r}),t)}};let Be,Oe;const T={};var Re=a(Fe,Be,Oe,!1,be,null,null,null);function be(e){for(let t in T)this[t]=T[t]}var m=function(){return Re.exports}();const Ie={name:"FlexRow",functional:!0,props:{verticalCenter:{type:Boolean,default:!1},horizonCenter:{type:Boolean,default:!1},center:{type:Boolean,default:!1},textCenter:{type:Boolean,default:!1}},render(e,{data:t,children:n,props:s}){const r=g(t.class,"flex-row");return s.center||s.horizonCenter&&s.verticalCenter?(r.push("horizon-center"),r.push("vertical-center")):(s.horizonCenter&&r.push("horizon-center"),s.verticalCenter&&r.push("vertical-center")),s.textCenter&&r.push("text-center"),e("div",c(f({},t),{class:r}),n)}};let Ee,Te;const P={};var Pe=a(Ie,Ee,Te,!1,Ne,null,null,null);function Ne(e){for(let t in P)this[t]=P[t]}var x=function(){return Pe.exports}();d.install=function(e){e.component(d.name,d)},m.install=function(e){e.component(m.name,m)},x.install=function(e){e.component(x.name,x)};function N(e){e.use(_),e.use(h),e.use(p),e.use(v),e.use(d),e.use(m),e.use(x),e.component($.name,$)}export{_ as EmptyView,d as FlexColumn,m as FlexItem,x as FlexRow,h as FlexScroller,$ as JSXComponent,p as NotImplement,v as SplitPane,N as default,N as install,q as version};
|
|
1
|
+
/*!
|
|
2
|
+
* @web-utils/component
|
|
3
|
+
* (c) 2022-2022 Simple
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
var H = Object.defineProperty, V = Object.defineProperties;
|
|
7
|
+
var X = Object.getOwnPropertyDescriptors;
|
|
8
|
+
var z = Object.getOwnPropertySymbols;
|
|
9
|
+
var U = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var w = (e, t, n) => t in e ? H(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t) => {
|
|
11
|
+
for (var n in t || (t = {}))
|
|
12
|
+
U.call(t, n) && w(e, n, t[n]);
|
|
13
|
+
if (z)
|
|
14
|
+
for (var n of z(t))
|
|
15
|
+
k.call(t, n) && w(e, n, t[n]);
|
|
16
|
+
return e;
|
|
17
|
+
}, c = (e, t) => V(e, X(t));
|
|
18
|
+
import { isPlainObject as L, isString as J, isArray as Y } from "@web-utils/core";
|
|
19
|
+
const q = "1.0.7";
|
|
20
|
+
var D = function() {
|
|
21
|
+
var e = this, t = e.$createElement, n = e._self._c || t;
|
|
22
|
+
return n("div", {
|
|
23
|
+
staticClass: "empty-view",
|
|
24
|
+
style: {
|
|
25
|
+
fontSize: e.fontSize,
|
|
26
|
+
height: e.height
|
|
27
|
+
}
|
|
28
|
+
}, [e._t("default", function() {
|
|
29
|
+
return [e._v(e._s(e.emptyTips))];
|
|
30
|
+
})], 2);
|
|
31
|
+
}, G = [];
|
|
32
|
+
function a(e, t, n, s, r, u, C, W) {
|
|
33
|
+
var i = typeof e == "function" ? e.options : e;
|
|
34
|
+
t && (i.render = t, i.staticRenderFns = n, i._compiled = !0), s && (i.functional = !0), u && (i._scopeId = "data-v-" + u);
|
|
35
|
+
var l;
|
|
36
|
+
if (C ? (l = function(o) {
|
|
37
|
+
o = o || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !o && typeof __VUE_SSR_CONTEXT__ != "undefined" && (o = __VUE_SSR_CONTEXT__), r && r.call(this, o), o && o._registeredComponents && o._registeredComponents.add(C);
|
|
38
|
+
}, i._ssrRegister = l) : r && (l = W ? function() {
|
|
39
|
+
r.call(this, (i.functional ? this.parent : this).$root.$options.shadowRoot);
|
|
40
|
+
} : r), l)
|
|
41
|
+
if (i.functional) {
|
|
42
|
+
i._injectStyles = l;
|
|
43
|
+
var j = i.render;
|
|
44
|
+
i.render = function(A, S) {
|
|
45
|
+
return l.call(S), j(A, S);
|
|
46
|
+
};
|
|
47
|
+
} else {
|
|
48
|
+
var y = i.beforeCreate;
|
|
49
|
+
i.beforeCreate = y ? [].concat(y, l) : [l];
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
exports: e,
|
|
53
|
+
options: i
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const K = {
|
|
57
|
+
name: "EmptyView",
|
|
58
|
+
props: {
|
|
59
|
+
emptyTips: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "\u6682\u65E0\u6570\u636E"
|
|
62
|
+
},
|
|
63
|
+
fontSize: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "20px"
|
|
66
|
+
},
|
|
67
|
+
height: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "100%"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, M = {};
|
|
73
|
+
var Q = /* @__PURE__ */ a(K, D, G, !1, Z, null, null, null);
|
|
74
|
+
function Z(e) {
|
|
75
|
+
for (let t in M)
|
|
76
|
+
this[t] = M[t];
|
|
77
|
+
}
|
|
78
|
+
var _ = /* @__PURE__ */ function() {
|
|
79
|
+
return Q.exports;
|
|
80
|
+
}();
|
|
81
|
+
_.install = function(e) {
|
|
82
|
+
e.component(_.name, _);
|
|
83
|
+
};
|
|
84
|
+
var ee = function() {
|
|
85
|
+
var e = this, t = e.$createElement, n = e._self._c || t;
|
|
86
|
+
return n("div", {
|
|
87
|
+
staticClass: "flex-scroller-wrapper"
|
|
88
|
+
}, [n("div", {
|
|
89
|
+
class: ["flex-scroller", {
|
|
90
|
+
"flex-column": e.flexColumn,
|
|
91
|
+
"flex-row": e.flexRow,
|
|
92
|
+
"content-scroll": e.contentScroll
|
|
93
|
+
}, e.contentClass]
|
|
94
|
+
}, [e._t("default")], 2)]);
|
|
95
|
+
}, te = [];
|
|
96
|
+
const ne = {
|
|
97
|
+
name: "FlexScroller",
|
|
98
|
+
props: {
|
|
99
|
+
flexColumn: Boolean,
|
|
100
|
+
flexRow: Boolean,
|
|
101
|
+
contentClass: String,
|
|
102
|
+
contentScroll: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: !0
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}, F = {};
|
|
108
|
+
var re = /* @__PURE__ */ a(ne, ee, te, !1, se, null, null, null);
|
|
109
|
+
function se(e) {
|
|
110
|
+
for (let t in F)
|
|
111
|
+
this[t] = F[t];
|
|
112
|
+
}
|
|
113
|
+
var h = /* @__PURE__ */ function() {
|
|
114
|
+
return re.exports;
|
|
115
|
+
}();
|
|
116
|
+
h.install = function(e) {
|
|
117
|
+
e.component(h.name, h);
|
|
118
|
+
};
|
|
119
|
+
var ie = function() {
|
|
120
|
+
var e = this, t = e.$createElement;
|
|
121
|
+
return e._self._c, e._m(0);
|
|
122
|
+
}, oe = [function() {
|
|
123
|
+
var e = this, t = e.$createElement, n = e._self._c || t;
|
|
124
|
+
return n("div", {
|
|
125
|
+
staticClass: "not-implement"
|
|
126
|
+
}, [n("div", [n("i", {
|
|
127
|
+
staticClass: "fa fa-wrench"
|
|
128
|
+
}), e._v(" \u5EFA\u8BBE\u4E2D... ")])]);
|
|
129
|
+
}];
|
|
130
|
+
const le = {
|
|
131
|
+
name: "NotImplement"
|
|
132
|
+
}, B = {};
|
|
133
|
+
var ae = /* @__PURE__ */ a(le, ie, oe, !1, ue, "f91d5e80", null, null);
|
|
134
|
+
function ue(e) {
|
|
135
|
+
for (let t in B)
|
|
136
|
+
this[t] = B[t];
|
|
137
|
+
}
|
|
138
|
+
var p = /* @__PURE__ */ function() {
|
|
139
|
+
return ae.exports;
|
|
140
|
+
}();
|
|
141
|
+
p.install = function(e) {
|
|
142
|
+
e.component(p.name, p);
|
|
143
|
+
};
|
|
144
|
+
function fe(e, t) {
|
|
145
|
+
for (let n = 0; n < t.length; n++)
|
|
146
|
+
if (e === t[n])
|
|
147
|
+
return !0;
|
|
148
|
+
return !1;
|
|
149
|
+
}
|
|
150
|
+
const O = function() {
|
|
151
|
+
return document.addEventListener ? function(e, t, n) {
|
|
152
|
+
e && t && n && e.addEventListener(t, n, !1);
|
|
153
|
+
} : function(e, t, n) {
|
|
154
|
+
e && t && n && e.attachEvent(`on${t}`, n);
|
|
155
|
+
};
|
|
156
|
+
}(), R = function() {
|
|
157
|
+
return document.removeEventListener ? function(e, t, n) {
|
|
158
|
+
e && t && e.removeEventListener(t, n, !1);
|
|
159
|
+
} : function(e, t, n) {
|
|
160
|
+
e && t && e.detachEvent(`on${t}`, n);
|
|
161
|
+
};
|
|
162
|
+
}();
|
|
163
|
+
var ce = function() {
|
|
164
|
+
var e = this, t = e.$createElement, n = e._self._c || t;
|
|
165
|
+
return n("div", {
|
|
166
|
+
class: e.classes
|
|
167
|
+
}, [e.showIcon ? n("div", {
|
|
168
|
+
class: e.barConClasses
|
|
169
|
+
}, e._m(0), 0) : e._e()]);
|
|
170
|
+
}, _e = [function() {
|
|
171
|
+
var e = this, t = e.$createElement, n = e._self._c || t;
|
|
172
|
+
return e._l(8, function(s) {
|
|
173
|
+
return n("i", {
|
|
174
|
+
key: `trigger-${s}`,
|
|
175
|
+
class: `${e.prefix}-bar`
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}];
|
|
179
|
+
const he = {
|
|
180
|
+
name: "Trigger",
|
|
181
|
+
props: {
|
|
182
|
+
mode: String,
|
|
183
|
+
showIcon: Boolean,
|
|
184
|
+
line: {
|
|
185
|
+
type: Boolean,
|
|
186
|
+
default: !0
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
data() {
|
|
190
|
+
return {
|
|
191
|
+
prefix: "egd-split-trigger"
|
|
192
|
+
};
|
|
193
|
+
},
|
|
194
|
+
computed: {
|
|
195
|
+
isVertical() {
|
|
196
|
+
return this.mode === "vertical";
|
|
197
|
+
},
|
|
198
|
+
classes() {
|
|
199
|
+
return [
|
|
200
|
+
this.prefix,
|
|
201
|
+
this.line ? this.isVertical ? ` ${this.prefix}-vertical-line` : `${this.prefix}-horizontal-line` : "",
|
|
202
|
+
this.isVertical ? `${this.prefix}-vertical` : `${this.prefix}-horizontal`
|
|
203
|
+
];
|
|
204
|
+
},
|
|
205
|
+
barConClasses() {
|
|
206
|
+
return [
|
|
207
|
+
`${this.prefix}-bar-con`,
|
|
208
|
+
this.isVertical ? "vertical" : "horizontal"
|
|
209
|
+
];
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}, b = {};
|
|
213
|
+
var pe = /* @__PURE__ */ a(he, ce, _e, !1, ve, null, null, null);
|
|
214
|
+
function ve(e) {
|
|
215
|
+
for (let t in b)
|
|
216
|
+
this[t] = b[t];
|
|
217
|
+
}
|
|
218
|
+
var de = /* @__PURE__ */ function() {
|
|
219
|
+
return pe.exports;
|
|
220
|
+
}(), me = function() {
|
|
221
|
+
var e = this, t = e.$createElement, n = e._self._c || t;
|
|
222
|
+
return n("div", {
|
|
223
|
+
ref: "outerWrapper",
|
|
224
|
+
class: e.wrapperClasses
|
|
225
|
+
}, [e.isHorizontal ? n("div", {
|
|
226
|
+
class: `${e.prefix}-horizontal`
|
|
227
|
+
}, [n("div", {
|
|
228
|
+
class: [`${e.prefix}-pane`, "left-pane"],
|
|
229
|
+
style: {
|
|
230
|
+
right: `${e.anotherOffset}%`
|
|
231
|
+
}
|
|
232
|
+
}, [e._t("left")], 2), n("div", {
|
|
233
|
+
class: `${e.prefix}-trigger-con`,
|
|
234
|
+
style: {
|
|
235
|
+
left: `calc(${e.offset}% + ${e.triggerSize / 2}px)`,
|
|
236
|
+
width: `${e.triggerSize}px`
|
|
237
|
+
},
|
|
238
|
+
on: {
|
|
239
|
+
mousedown: e.handleMousedown
|
|
240
|
+
}
|
|
241
|
+
}, [e._t("trigger", function() {
|
|
242
|
+
return [n("Trigger", {
|
|
243
|
+
attrs: {
|
|
244
|
+
mode: "vertical"
|
|
245
|
+
}
|
|
246
|
+
})];
|
|
247
|
+
})], 2), n("div", {
|
|
248
|
+
class: [`${e.prefix}-pane`, "right-pane"],
|
|
249
|
+
style: {
|
|
250
|
+
left: `calc(${e.offset}% + ${e.triggerSize}px)`
|
|
251
|
+
}
|
|
252
|
+
}, [e._t("right")], 2)]) : n("div", {
|
|
253
|
+
class: `${e.prefix}-vertical`
|
|
254
|
+
}, [n("div", {
|
|
255
|
+
class: [`${e.prefix}-pane`, "top-pane"],
|
|
256
|
+
style: {
|
|
257
|
+
bottom: `${e.anotherOffset}%`
|
|
258
|
+
}
|
|
259
|
+
}, [e._t("top")], 2), n("div", {
|
|
260
|
+
class: `${e.prefix}-trigger-con`,
|
|
261
|
+
style: {
|
|
262
|
+
top: `calc(${e.offset}% + ${e.triggerSize / 2}px)`,
|
|
263
|
+
height: `${e.triggerSize}px`
|
|
264
|
+
},
|
|
265
|
+
on: {
|
|
266
|
+
mousedown: e.handleMousedown
|
|
267
|
+
}
|
|
268
|
+
}, [e._t("trigger", function() {
|
|
269
|
+
return [n("Trigger", {
|
|
270
|
+
attrs: {
|
|
271
|
+
mode: "horizontal"
|
|
272
|
+
}
|
|
273
|
+
})];
|
|
274
|
+
})], 2), n("div", {
|
|
275
|
+
class: [`${e.prefix}-pane`, "bottom-pane"],
|
|
276
|
+
style: {
|
|
277
|
+
top: `calc(${e.offset}% + ${e.triggerSize}px)`
|
|
278
|
+
}
|
|
279
|
+
}, [e._t("bottom")], 2)])]);
|
|
280
|
+
}, xe = [];
|
|
281
|
+
const $e = {
|
|
282
|
+
name: "SplitPane",
|
|
283
|
+
components: {
|
|
284
|
+
Trigger: de
|
|
285
|
+
},
|
|
286
|
+
props: {
|
|
287
|
+
value: {
|
|
288
|
+
type: [Number, String],
|
|
289
|
+
default: 0.5
|
|
290
|
+
},
|
|
291
|
+
mode: {
|
|
292
|
+
validator(e) {
|
|
293
|
+
return fe(e, ["horizontal", "vertical"]);
|
|
294
|
+
},
|
|
295
|
+
default: "horizontal"
|
|
296
|
+
},
|
|
297
|
+
triggerSize: {
|
|
298
|
+
type: Number,
|
|
299
|
+
default: 6
|
|
300
|
+
},
|
|
301
|
+
min: {
|
|
302
|
+
type: [Number, String],
|
|
303
|
+
default: "40px"
|
|
304
|
+
},
|
|
305
|
+
max: {
|
|
306
|
+
type: [Number, String],
|
|
307
|
+
default: "40px"
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
data() {
|
|
311
|
+
return {
|
|
312
|
+
prefix: "egd-split",
|
|
313
|
+
offset: 0,
|
|
314
|
+
oldOffset: 0,
|
|
315
|
+
isMoving: !1
|
|
316
|
+
};
|
|
317
|
+
},
|
|
318
|
+
computed: {
|
|
319
|
+
wrapperClasses() {
|
|
320
|
+
return [
|
|
321
|
+
`${this.prefix}-wrapper`,
|
|
322
|
+
this.isMoving ? "no-select" : ""
|
|
323
|
+
];
|
|
324
|
+
},
|
|
325
|
+
isHorizontal() {
|
|
326
|
+
return this.mode === "horizontal";
|
|
327
|
+
},
|
|
328
|
+
anotherOffset() {
|
|
329
|
+
return 100 - this.offset;
|
|
330
|
+
},
|
|
331
|
+
valueIsPx() {
|
|
332
|
+
return typeof this.value == "string";
|
|
333
|
+
},
|
|
334
|
+
offsetSize() {
|
|
335
|
+
return this.isHorizontal ? "offsetWidth" : "offsetHeight";
|
|
336
|
+
},
|
|
337
|
+
computedMin() {
|
|
338
|
+
return this.getComputedThresholdValue("min");
|
|
339
|
+
},
|
|
340
|
+
computedMax() {
|
|
341
|
+
return this.getComputedThresholdValue("max");
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
watch: {
|
|
345
|
+
value() {
|
|
346
|
+
this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 1e4 / 100;
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
mounted() {
|
|
350
|
+
this.$nextTick(() => {
|
|
351
|
+
this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 1e4 / 100;
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
methods: {
|
|
355
|
+
px2percent(e, t) {
|
|
356
|
+
return parseFloat(e) / parseFloat(t);
|
|
357
|
+
},
|
|
358
|
+
getComputedThresholdValue(e) {
|
|
359
|
+
const t = this.$refs.outerWrapper[this.offsetSize];
|
|
360
|
+
return this.valueIsPx ? typeof this[e] == "string" ? this[e] : t * this[e] : typeof this[e] == "string" ? this.px2percent(this[e], t) : this[e];
|
|
361
|
+
},
|
|
362
|
+
getMin(e, t) {
|
|
363
|
+
return this.valueIsPx ? `${Math.min(parseFloat(e), parseFloat(t))}px` : Math.min(e, t);
|
|
364
|
+
},
|
|
365
|
+
getMax(e, t) {
|
|
366
|
+
return this.valueIsPx ? `${Math.max(parseFloat(e), parseFloat(t))}px` : Math.max(e, t);
|
|
367
|
+
},
|
|
368
|
+
getAnotherOffset(e) {
|
|
369
|
+
let t = 0;
|
|
370
|
+
return this.valueIsPx ? t = `${this.$refs.outerWrapper[this.offsetSize] - parseFloat(e)}px` : t = 1 - e, t;
|
|
371
|
+
},
|
|
372
|
+
handleMove(e) {
|
|
373
|
+
const n = (this.isHorizontal ? e.pageX : e.pageY) - this.initOffset, s = this.$refs.outerWrapper[this.offsetSize];
|
|
374
|
+
let r = this.valueIsPx ? `${parseFloat(this.oldOffset) + n}px` : this.px2percent(s * this.oldOffset + n, s);
|
|
375
|
+
const u = this.getAnotherOffset(r);
|
|
376
|
+
parseFloat(r) <= parseFloat(this.computedMin) && (r = this.getMax(r, this.computedMin)), parseFloat(u) <= parseFloat(this.computedMax) && (r = this.getAnotherOffset(this.getMax(u, this.computedMax))), e.atMin = this.value === this.computedMin, e.atMax = this.valueIsPx ? this.getAnotherOffset(this.value) === this.computedMax : this.getAnotherOffset(this.value).toFixed(5) === this.computedMax.toFixed(5), this.$emit("input", r), this.$emit("on-moving", e);
|
|
377
|
+
},
|
|
378
|
+
handleUp() {
|
|
379
|
+
this.isMoving = !1, R(window, "mousemove", this.handleMove), R(window, "mouseup", this.handleUp), this.$emit("on-move-end");
|
|
380
|
+
},
|
|
381
|
+
handleMousedown(e) {
|
|
382
|
+
this.initOffset = this.isHorizontal ? e.pageX : e.pageY, this.oldOffset = this.value, this.isMoving = !0, O(window, "mousemove", this.handleMove), O(window, "mouseup", this.handleUp), this.$emit("on-move-start");
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}, I = {};
|
|
386
|
+
var ge = /* @__PURE__ */ a($e, me, xe, !1, Ce, null, null, null);
|
|
387
|
+
function Ce(e) {
|
|
388
|
+
for (let t in I)
|
|
389
|
+
this[t] = I[t];
|
|
390
|
+
}
|
|
391
|
+
var v = /* @__PURE__ */ function() {
|
|
392
|
+
return ge.exports;
|
|
393
|
+
}();
|
|
394
|
+
v.install = function(e) {
|
|
395
|
+
e.component(v.name, v);
|
|
396
|
+
};
|
|
397
|
+
var $ = {
|
|
398
|
+
name: "JSXComponent",
|
|
399
|
+
props: {
|
|
400
|
+
msg: {
|
|
401
|
+
type: String,
|
|
402
|
+
default: ""
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
render() {
|
|
406
|
+
return arguments[0]("div", [this.msg]);
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
/*!
|
|
410
|
+
* @web-utils/component
|
|
411
|
+
* (c) 2022-2022 Simple
|
|
412
|
+
* Released under the MIT License.
|
|
413
|
+
*/
|
|
414
|
+
const g = (e, t) => L(e) || J(e) ? [t, e] : Y(e) ? [t, ...e] : [t], ye = {
|
|
415
|
+
name: "FlexColumn",
|
|
416
|
+
functional: !0,
|
|
417
|
+
props: {
|
|
418
|
+
verticalCenter: {
|
|
419
|
+
type: Boolean,
|
|
420
|
+
default: !1
|
|
421
|
+
},
|
|
422
|
+
horizonCenter: {
|
|
423
|
+
type: Boolean,
|
|
424
|
+
default: !1
|
|
425
|
+
},
|
|
426
|
+
center: {
|
|
427
|
+
type: Boolean,
|
|
428
|
+
default: !1
|
|
429
|
+
},
|
|
430
|
+
textCenter: {
|
|
431
|
+
type: Boolean,
|
|
432
|
+
default: !1
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
render(e, { data: t, children: n, props: s }) {
|
|
436
|
+
const r = g(t.class, "flex-column");
|
|
437
|
+
return s.center || s.horizonCenter && s.verticalCenter ? (r.push("horizon-center"), r.push("vertical-center")) : (s.horizonCenter && r.push("horizon-center"), s.verticalCenter && r.push("vertical-center")), s.textCenter && r.push("text-center"), e("div", c(f({}, t), { class: r }), n);
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
let Se, ze;
|
|
441
|
+
const E = {};
|
|
442
|
+
var we = /* @__PURE__ */ a(ye, Se, ze, !1, Me, null, null, null);
|
|
443
|
+
function Me(e) {
|
|
444
|
+
for (let t in E)
|
|
445
|
+
this[t] = E[t];
|
|
446
|
+
}
|
|
447
|
+
var d = /* @__PURE__ */ function() {
|
|
448
|
+
return we.exports;
|
|
449
|
+
}();
|
|
450
|
+
const Fe = {
|
|
451
|
+
name: "FlexItem",
|
|
452
|
+
functional: !0,
|
|
453
|
+
props: {
|
|
454
|
+
flexRow: {
|
|
455
|
+
type: Boolean,
|
|
456
|
+
default: !1
|
|
457
|
+
},
|
|
458
|
+
flexColumn: {
|
|
459
|
+
type: Boolean,
|
|
460
|
+
default: !1
|
|
461
|
+
},
|
|
462
|
+
verticalCenter: {
|
|
463
|
+
type: Boolean,
|
|
464
|
+
default: !1
|
|
465
|
+
},
|
|
466
|
+
horizonCenter: {
|
|
467
|
+
type: Boolean,
|
|
468
|
+
default: !1
|
|
469
|
+
},
|
|
470
|
+
center: {
|
|
471
|
+
type: Boolean,
|
|
472
|
+
default: !1
|
|
473
|
+
},
|
|
474
|
+
textCenter: {
|
|
475
|
+
type: Boolean,
|
|
476
|
+
default: !1
|
|
477
|
+
},
|
|
478
|
+
relative: {
|
|
479
|
+
type: Boolean,
|
|
480
|
+
default: !1
|
|
481
|
+
},
|
|
482
|
+
absolute: {
|
|
483
|
+
type: Boolean,
|
|
484
|
+
default: !1
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
render(e, { children: t, data: n, props: s }) {
|
|
488
|
+
const r = g(n.class, s.relative ? "flex-item-relative" : "flex-item");
|
|
489
|
+
return s.absolute && !s.relative && r.push("flex-item-relative"), s.center || s.horizonCenter && s.verticalCenter ? (r.push("horizon-center"), r.push("vertical-center")) : (s.horizonCenter && r.push("horizon-center"), s.verticalCenter && r.push("vertical-center")), s.textCenter && r.push("text-center"), s.flexColumn && r.push("flex-column"), s.flexRow && r.push("flex-row"), s.absolute ? e("div", c(f({}, n), { class: r }), [e("div", { class: "absolute", style: "overflow:auto" }, t)]) : e("div", c(f({}, n), { class: r }), t);
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
let Be, Oe;
|
|
493
|
+
const T = {};
|
|
494
|
+
var Re = /* @__PURE__ */ a(Fe, Be, Oe, !1, be, null, null, null);
|
|
495
|
+
function be(e) {
|
|
496
|
+
for (let t in T)
|
|
497
|
+
this[t] = T[t];
|
|
498
|
+
}
|
|
499
|
+
var m = /* @__PURE__ */ function() {
|
|
500
|
+
return Re.exports;
|
|
501
|
+
}();
|
|
502
|
+
const Ie = {
|
|
503
|
+
name: "FlexRow",
|
|
504
|
+
functional: !0,
|
|
505
|
+
props: {
|
|
506
|
+
verticalCenter: {
|
|
507
|
+
type: Boolean,
|
|
508
|
+
default: !1
|
|
509
|
+
},
|
|
510
|
+
horizonCenter: {
|
|
511
|
+
type: Boolean,
|
|
512
|
+
default: !1
|
|
513
|
+
},
|
|
514
|
+
center: {
|
|
515
|
+
type: Boolean,
|
|
516
|
+
default: !1
|
|
517
|
+
},
|
|
518
|
+
textCenter: {
|
|
519
|
+
type: Boolean,
|
|
520
|
+
default: !1
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
render(e, { data: t, children: n, props: s }) {
|
|
524
|
+
const r = g(t.class, "flex-row");
|
|
525
|
+
return s.center || s.horizonCenter && s.verticalCenter ? (r.push("horizon-center"), r.push("vertical-center")) : (s.horizonCenter && r.push("horizon-center"), s.verticalCenter && r.push("vertical-center")), s.textCenter && r.push("text-center"), e("div", c(f({}, t), { class: r }), n);
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
let Ee, Te;
|
|
529
|
+
const P = {};
|
|
530
|
+
var Pe = /* @__PURE__ */ a(Ie, Ee, Te, !1, Ne, null, null, null);
|
|
531
|
+
function Ne(e) {
|
|
532
|
+
for (let t in P)
|
|
533
|
+
this[t] = P[t];
|
|
534
|
+
}
|
|
535
|
+
var x = /* @__PURE__ */ function() {
|
|
536
|
+
return Pe.exports;
|
|
537
|
+
}();
|
|
538
|
+
d.install = function(e) {
|
|
539
|
+
e.component(d.name, d);
|
|
540
|
+
};
|
|
541
|
+
m.install = function(e) {
|
|
542
|
+
e.component(m.name, m);
|
|
543
|
+
};
|
|
544
|
+
x.install = function(e) {
|
|
545
|
+
e.component(x.name, x);
|
|
546
|
+
};
|
|
547
|
+
function N(e) {
|
|
548
|
+
e.use(_), e.use(h), e.use(p), e.use(v), e.use(d), e.use(m), e.use(x), e.component($.name, $);
|
|
549
|
+
}
|
|
550
|
+
export { _ as EmptyView, d as FlexColumn, m as FlexItem, x as FlexRow, h as FlexScroller, $ as JSXComponent, p as NotImplement, v as SplitPane, N as default, N as install, q as version };
|