@aplus-frontend/ui 7.11.3 → 7.11.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.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as P, ref as S, computed as C, unref as a, watchEffect as U, createElementBlock as g, openBlock as m, normalizeClass as c, createCommentVNode as b, createElementVNode as z, normalizeStyle as T, createBlock as D, resolveDynamicComponent as F, createVNode as B } from "vue";
|
|
2
2
|
import { UpOutlined as A, DownOutlined as R, LeftOutlined as $, RightOutlined as j } from "@ant-design/icons-vue";
|
|
3
3
|
import "../config-provider/index.mjs";
|
|
4
4
|
import { useNamespace as q } from "../config-provider/hooks/use-namespace.mjs";
|
|
5
|
-
const G = ["aria-valuenow", "aria-valuemin", "aria-valuemax"], W = /* @__PURE__ */
|
|
5
|
+
const G = ["aria-valuenow", "aria-valuemin", "aria-valuemax"], W = /* @__PURE__ */ P({
|
|
6
6
|
name: "SplitBar",
|
|
7
7
|
__name: "SplitBar",
|
|
8
8
|
props: {
|
|
@@ -48,34 +48,34 @@ const G = ["aria-valuenow", "aria-valuemin", "aria-valuemax"], W = /* @__PURE__
|
|
|
48
48
|
type: [Boolean, String]
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
setup(
|
|
52
|
-
function
|
|
51
|
+
setup(L) {
|
|
52
|
+
function y(e) {
|
|
53
53
|
return typeof e == "number" && !Number.isNaN(e) ? Math.round(e) : 0;
|
|
54
54
|
}
|
|
55
|
-
const
|
|
55
|
+
const o = L, {
|
|
56
56
|
b: t,
|
|
57
|
-
cssVar:
|
|
58
|
-
} = q("splitter-bar"), w =
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
w.value = [
|
|
57
|
+
cssVar: N
|
|
58
|
+
} = q("splitter-bar"), w = S(null), d = S(0), k = C(() => o.vertical ? 0 : a(d)), x = C(() => o.vertical ? a(d) : 0), V = (e) => {
|
|
59
|
+
o.resizable && e.currentTarget && (w.value = [e.pageX, e.pageY], o.onOffsetStart(o.index));
|
|
60
|
+
}, X = (e) => {
|
|
61
|
+
if (o.resizable && e.touches.length === 1) {
|
|
62
|
+
const n = e.touches[0];
|
|
63
|
+
w.value = [n.pageX, n.pageY], o.onOffsetStart(o.index);
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, Y = (e) => {
|
|
66
66
|
const {
|
|
67
|
-
containerSize:
|
|
67
|
+
containerSize: n,
|
|
68
68
|
ariaMax: s,
|
|
69
69
|
ariaMin: r,
|
|
70
70
|
ariaNow: i
|
|
71
|
-
} =
|
|
72
|
-
return Math.max(
|
|
73
|
-
},
|
|
74
|
-
const s =
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
71
|
+
} = o, l = n * i / 100, u = l + e, p = Math.max(0, n * r / 100), f = Math.max(n, n * s / 100);
|
|
72
|
+
return Math.max(p, Math.min(f, u)) - l;
|
|
73
|
+
}, O = (e, n) => {
|
|
74
|
+
const s = Y(o.vertical ? n : e);
|
|
75
|
+
d.value = s;
|
|
76
|
+
}, E = () => {
|
|
77
|
+
o.onOffsetUpdate(o.index, a(k), a(x)), d.value = 0;
|
|
78
|
+
}, M = (e) => {
|
|
79
79
|
switch (e) {
|
|
80
80
|
case !0:
|
|
81
81
|
return t("collapse-bar-always-visible");
|
|
@@ -85,24 +85,24 @@ const G = ["aria-valuenow", "aria-valuemin", "aria-valuemax"], W = /* @__PURE__
|
|
|
85
85
|
return t("collapse-bar-hover-only");
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
const s = (
|
|
88
|
+
U((e) => {
|
|
89
|
+
const n = a(w);
|
|
90
|
+
if (n) {
|
|
91
|
+
const s = (u) => {
|
|
92
92
|
const {
|
|
93
|
-
pageX:
|
|
94
|
-
pageY:
|
|
95
|
-
} =
|
|
96
|
-
|
|
93
|
+
pageX: p,
|
|
94
|
+
pageY: f
|
|
95
|
+
} = u, v = p - n[0], I = f - n[1];
|
|
96
|
+
o.lazy ? O(v, I) : o.onOffsetUpdate(o.index, v, I);
|
|
97
97
|
}, r = () => {
|
|
98
|
-
|
|
99
|
-
}, i = (
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
|
|
98
|
+
o.lazy && E(), w.value = null, o.onOffsetEnd();
|
|
99
|
+
}, i = (u) => {
|
|
100
|
+
if (u.touches.length === 1) {
|
|
101
|
+
const p = u.touches[0], f = p.pageX - n[0], v = p.pageY - n[1];
|
|
102
|
+
o.lazy ? O(f, v) : o.onOffsetUpdate(o.index, f, v);
|
|
103
103
|
}
|
|
104
104
|
}, l = () => {
|
|
105
|
-
|
|
105
|
+
o.lazy && E(), w.value = null, o.onOffsetEnd();
|
|
106
106
|
};
|
|
107
107
|
window.addEventListener("touchmove", i), window.addEventListener("touchend", l), window.addEventListener("mousemove", s), window.addEventListener("mouseup", r), e(() => {
|
|
108
108
|
window.removeEventListener("touchmove", i), window.removeEventListener("touchend", l), window.removeEventListener("mousemove", s), window.removeEventListener("mouseup", r);
|
|
@@ -111,58 +111,58 @@ const G = ["aria-valuenow", "aria-valuemin", "aria-valuemax"], W = /* @__PURE__
|
|
|
111
111
|
}, {
|
|
112
112
|
flush: "post"
|
|
113
113
|
});
|
|
114
|
-
const h =
|
|
114
|
+
const h = C(() => {
|
|
115
115
|
const {
|
|
116
116
|
collapsibleIcon: e,
|
|
117
|
-
vertical:
|
|
118
|
-
} =
|
|
117
|
+
vertical: n
|
|
118
|
+
} = o;
|
|
119
119
|
let s = null, r = null;
|
|
120
120
|
const i = e?.start !== void 0, l = e?.end !== void 0;
|
|
121
|
-
return
|
|
122
|
-
startIcon:
|
|
123
|
-
endIcon:
|
|
121
|
+
return n ? (s = i ? () => e.start : A, r = l ? () => e.end : R) : (s = i ? () => e.start : $, r = l ? () => e.end : j), {
|
|
122
|
+
startIcon: s,
|
|
123
|
+
endIcon: r,
|
|
124
124
|
startCustomize: i,
|
|
125
125
|
endCustomize: l
|
|
126
126
|
};
|
|
127
127
|
});
|
|
128
|
-
return (e,
|
|
129
|
-
class:
|
|
128
|
+
return (e, n) => (m(), g("div", {
|
|
129
|
+
class: c(a(t)()),
|
|
130
130
|
role: "separator",
|
|
131
|
-
"aria-valuenow":
|
|
132
|
-
"aria-valuemin":
|
|
133
|
-
"aria-valuemax":
|
|
134
|
-
}, [
|
|
131
|
+
"aria-valuenow": y(o.ariaNow),
|
|
132
|
+
"aria-valuemin": y(o.ariaMin),
|
|
133
|
+
"aria-valuemax": y(o.ariaMax)
|
|
134
|
+
}, [o.lazy ? (m(), g("div", {
|
|
135
135
|
key: 0,
|
|
136
|
-
class:
|
|
137
|
-
[
|
|
136
|
+
class: c([a(t)("preview"), {
|
|
137
|
+
[a(t)("preview-active")]: !!d.value
|
|
138
138
|
}]),
|
|
139
|
-
style:
|
|
140
|
-
"preview-offset": `${
|
|
139
|
+
style: T(a(N)({
|
|
140
|
+
"preview-offset": `${d.value}px`
|
|
141
141
|
}))
|
|
142
|
-
}, null, 6)) :
|
|
143
|
-
class:
|
|
144
|
-
[
|
|
145
|
-
[
|
|
146
|
-
[
|
|
142
|
+
}, null, 6)) : b("", !0), z("div", {
|
|
143
|
+
class: c([a(t)("dragger"), {
|
|
144
|
+
[a(t)("dragger-disabled")]: !e.resizable,
|
|
145
|
+
[a(t)("dragger-active")]: e.active,
|
|
146
|
+
[a(t)("dragger-customize")]: e.draggerIcon !== void 0
|
|
147
147
|
}]),
|
|
148
|
-
onMousedown:
|
|
149
|
-
onTouchstart:
|
|
150
|
-
}, [e.draggerIcon !== void 0 ? (
|
|
148
|
+
onMousedown: V,
|
|
149
|
+
onTouchstart: X
|
|
150
|
+
}, [e.draggerIcon !== void 0 ? (m(), g("div", {
|
|
151
151
|
key: 0,
|
|
152
|
-
class:
|
|
153
|
-
}, [(
|
|
152
|
+
class: c(a(t)("dragger-icon"))
|
|
153
|
+
}, [(m(), D(F(e.draggerIcon)))], 2)) : b("", !0)], 34), e.startCollapsible ? (m(), g("div", {
|
|
154
154
|
key: 1,
|
|
155
|
-
class:
|
|
156
|
-
onClick:
|
|
157
|
-
}, [
|
|
158
|
-
class:
|
|
159
|
-
}, [(
|
|
155
|
+
class: c([a(t)("collapse-bar"), a(t)("collapse-bar-start"), h.value.startCustomize ? a(t)("collapse-bar-customize") : "", M(e.showStartCollapsibleIcon)]),
|
|
156
|
+
onClick: n[0] || (n[0] = () => e.onCollapse(e.index, "start"))
|
|
157
|
+
}, [z("span", {
|
|
158
|
+
class: c([a(t)("collapse-icon"), a(t)("collapse-start")])
|
|
159
|
+
}, [B(a(h).startIcon)], 2)], 2)) : b("", !0), e.endCollapsible ? (m(), g("div", {
|
|
160
160
|
key: 2,
|
|
161
|
-
class:
|
|
162
|
-
onClick:
|
|
163
|
-
}, [
|
|
164
|
-
class:
|
|
165
|
-
}, [(
|
|
161
|
+
class: c([a(t)("collapse-bar"), a(t)("collapse-bar-end"), h.value.endCustomize ? a(t)("collapse-bar-customize") : "", M(e.showEndCollapsibleIcon)]),
|
|
162
|
+
onClick: n[1] || (n[1] = () => e.onCollapse(e.index, "end"))
|
|
163
|
+
}, [z("span", {
|
|
164
|
+
class: c([a(t)("collapse-icon"), a(t)("collapse-end")])
|
|
165
|
+
}, [B(a(h).endIcon)], 2)], 2)) : b("", !0)], 10, G));
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
export {
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.11.
|
|
1
|
+
declare const _default: "7.11.4";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("@ant-design/icons-vue");require("../config-provider/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("@ant-design/icons-vue");require("../config-provider/index.js");const S=require("../config-provider/hooks/use-namespace.js"),I=["aria-valuenow","aria-valuemin","aria-valuemax"],V=e.defineComponent({name:"SplitBar",__name:"SplitBar",props:{index:{},active:{type:Boolean},resizable:{type:Boolean},startCollapsible:{type:Boolean},endCollapsible:{type:Boolean},onOffsetStart:{type:Function},onOffsetUpdate:{type:Function},onOffsetEnd:{},onCollapse:{type:Function},vertical:{type:Boolean},ariaNow:{},ariaMin:{},ariaMax:{},lazy:{type:Boolean},containerSize:{},draggerIcon:{},collapsibleIcon:{},showStartCollapsibleIcon:{type:[Boolean,String]},showEndCollapsibleIcon:{type:[Boolean,String]}},setup(z){function g(n){return typeof n=="number"&&!Number.isNaN(n)?Math.round(n):0}const o=z,{b:t,cssVar:E}=S.useNamespace("splitter-bar"),m=e.ref(null),c=e.ref(0),B=e.computed(()=>o.vertical?0:e.unref(c)),M=e.computed(()=>o.vertical?e.unref(c):0),O=n=>{o.resizable&&n.currentTarget&&(m.value=[n.pageX,n.pageY],o.onOffsetStart(o.index))},k=n=>{if(o.resizable&&n.touches.length===1){const a=n.touches[0];m.value=[a.pageX,a.pageY],o.onOffsetStart(o.index)}},N=n=>{const{containerSize:a,ariaMax:s,ariaMin:r,ariaNow:i}=o,l=a*i/100,u=l+n,d=Math.max(0,a*r/100),f=Math.max(a,a*s/100);return Math.max(d,Math.min(f,u))-l},C=(n,a)=>{const s=N(o.vertical?a:n);c.value=s},b=()=>{o.onOffsetUpdate(o.index,e.unref(B),e.unref(M)),c.value=0},h=n=>{switch(n){case!0:return t("collapse-bar-always-visible");case!1:return t("collapse-bar-always-hidden");case"auto":return t("collapse-bar-hover-only")}};e.watchEffect(n=>{const a=e.unref(m);if(a){const s=u=>{const{pageX:d,pageY:f}=u,p=d-a[0],y=f-a[1];o.lazy?C(p,y):o.onOffsetUpdate(o.index,p,y)},r=()=>{o.lazy&&b(),m.value=null,o.onOffsetEnd()},i=u=>{if(u.touches.length===1){const d=u.touches[0],f=d.pageX-a[0],p=d.pageY-a[1];o.lazy?C(f,p):o.onOffsetUpdate(o.index,f,p)}},l=()=>{o.lazy&&b(),m.value=null,o.onOffsetEnd()};window.addEventListener("touchmove",i),window.addEventListener("touchend",l),window.addEventListener("mousemove",s),window.addEventListener("mouseup",r),n(()=>{window.removeEventListener("touchmove",i),window.removeEventListener("touchend",l),window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",r)})}},{flush:"post"});const v=e.computed(()=>{const{collapsibleIcon:n,vertical:a}=o;let s=null,r=null;const i=n?.start!==void 0,l=n?.end!==void 0;return a?(s=i?()=>n.start:w.UpOutlined,r=l?()=>n.end:w.DownOutlined):(s=i?()=>n.start:w.LeftOutlined,r=l?()=>n.end:w.RightOutlined),{startIcon:s,endIcon:r,startCustomize:i,endCustomize:l}});return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(t)()),role:"separator","aria-valuenow":g(o.ariaNow),"aria-valuemin":g(o.ariaMin),"aria-valuemax":g(o.ariaMax)},[o.lazy?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(t)("preview"),{[e.unref(t)("preview-active")]:!!c.value}]),style:e.normalizeStyle(e.unref(E)({"preview-offset":`${c.value}px`}))},null,6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(t)("dragger"),{[e.unref(t)("dragger-disabled")]:!n.resizable,[e.unref(t)("dragger-active")]:n.active,[e.unref(t)("dragger-customize")]:n.draggerIcon!==void 0}]),onMousedown:O,onTouchstart:k},[n.draggerIcon!==void 0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t)("dragger-icon"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.draggerIcon)))],2)):e.createCommentVNode("",!0)],34),n.startCollapsible?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([e.unref(t)("collapse-bar"),e.unref(t)("collapse-bar-start"),v.value.startCustomize?e.unref(t)("collapse-bar-customize"):"",h(n.showStartCollapsibleIcon)]),onClick:a[0]||(a[0]=()=>n.onCollapse(n.index,"start"))},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(t)("collapse-icon"),e.unref(t)("collapse-start")])},[e.createVNode(e.unref(v).startIcon)],2)],2)):e.createCommentVNode("",!0),n.endCollapsible?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(t)("collapse-bar"),e.unref(t)("collapse-bar-end"),v.value.endCustomize?e.unref(t)("collapse-bar-customize"):"",h(n.showEndCollapsibleIcon)]),onClick:a[1]||(a[1]=()=>n.onCollapse(n.index,"end"))},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(t)("collapse-icon"),e.unref(t)("collapse-end")])},[e.createVNode(e.unref(v).endIcon)],2)],2)):e.createCommentVNode("",!0)],10,I))}});exports.default=V;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.11.
|
|
1
|
+
declare const _default: "7.11.4";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.11.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.11.4";exports.default=e;
|