@aplus-frontend/ui 7.11.1 → 7.11.3
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/es/src/ag-grid/editable/utils.mjs +28 -22
- package/es/src/business/ap-copy/constans.mjs +1 -1
- package/es/src/business/ap-copy/style/index.mjs +1 -1
- package/es/src/business/ap-product-info/ApProductInfo.d.ts +9 -0
- package/es/src/business/ap-product-info/ApProductInfo.mjs +5 -5
- package/es/src/business/ap-product-info/constans.d.ts +4 -0
- package/es/src/business/ap-product-info/constans.mjs +4 -0
- package/es/src/business/ap-product-info/index.d.ts +15 -0
- package/es/src/business/ap-product-info/interface.d.ts +1 -0
- package/es/src/business/ap-product-info/style/index.mjs +2 -1
- package/es/src/business/ap-view/ap-view.vue2.mjs +36 -33
- package/es/src/business/ap-view/interface.d.ts +4 -0
- package/es/src/business/batch-input-group/form-item.vue.mjs +24 -22
- package/es/src/business/batch-input-group/index.vue.mjs +1 -1
- package/es/src/splitter/SplitBar.vue2.mjs +152 -112
- package/es/src/splitter/Splitter.vue2.mjs +67 -61
- package/es/src/splitter/hooks/useItems.d.ts +1 -0
- package/es/src/splitter/hooks/useItems.mjs +20 -16
- package/es/src/splitter/hooks/useResizable.d.ts +3 -0
- package/es/src/splitter/hooks/useResizable.mjs +50 -27
- package/es/src/splitter/interface.d.ts +12 -1
- package/es/src/splitter/style/index.mjs +51 -15
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/utils.js +1 -1
- package/lib/src/business/ap-copy/constans.js +1 -1
- package/lib/src/business/ap-copy/style/index.js +1 -1
- package/lib/src/business/ap-product-info/ApProductInfo.d.ts +9 -0
- package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
- package/lib/src/business/ap-product-info/constans.d.ts +4 -0
- package/lib/src/business/ap-product-info/constans.js +1 -1
- package/lib/src/business/ap-product-info/index.d.ts +15 -0
- package/lib/src/business/ap-product-info/interface.d.ts +1 -0
- package/lib/src/business/ap-product-info/style/index.js +1 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/interface.d.ts +4 -0
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.js +1 -1
- package/lib/src/splitter/SplitBar.vue2.js +1 -1
- package/lib/src/splitter/Splitter.vue2.js +1 -1
- package/lib/src/splitter/hooks/useItems.d.ts +1 -0
- package/lib/src/splitter/hooks/useItems.js +1 -1
- package/lib/src/splitter/hooks/useResizable.d.ts +3 -0
- package/lib/src/splitter/hooks/useResizable.js +1 -1
- package/lib/src/splitter/interface.d.ts +12 -1
- package/lib/src/splitter/style/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
|
@@ -1,130 +1,170 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { UpOutlined as A,
|
|
1
|
+
import { defineComponent as T, ref as N, computed as z, unref as o, watchEffect as D, createVNode as b, createElementBlock as g, openBlock as c, normalizeClass as d, createCommentVNode as y, createElementVNode as O, normalizeStyle as F, createBlock as E, resolveDynamicComponent as M } from "vue";
|
|
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
|
-
import { useNamespace as
|
|
5
|
-
const
|
|
4
|
+
import { useNamespace as q } from "../config-provider/hooks/use-namespace.mjs";
|
|
5
|
+
const G = ["aria-valuenow", "aria-valuemin", "aria-valuemax"], W = /* @__PURE__ */ T({
|
|
6
6
|
name: "SplitBar",
|
|
7
7
|
__name: "SplitBar",
|
|
8
8
|
props: {
|
|
9
9
|
index: {},
|
|
10
|
-
active: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
active: {
|
|
11
|
+
type: Boolean
|
|
12
|
+
},
|
|
13
|
+
resizable: {
|
|
14
|
+
type: Boolean
|
|
15
|
+
},
|
|
16
|
+
startCollapsible: {
|
|
17
|
+
type: Boolean
|
|
18
|
+
},
|
|
19
|
+
endCollapsible: {
|
|
20
|
+
type: Boolean
|
|
21
|
+
},
|
|
22
|
+
onOffsetStart: {
|
|
23
|
+
type: Function
|
|
24
|
+
},
|
|
25
|
+
onOffsetUpdate: {
|
|
26
|
+
type: Function
|
|
27
|
+
},
|
|
16
28
|
onOffsetEnd: {},
|
|
17
|
-
onCollapse: {
|
|
18
|
-
|
|
29
|
+
onCollapse: {
|
|
30
|
+
type: Function
|
|
31
|
+
},
|
|
32
|
+
vertical: {
|
|
33
|
+
type: Boolean
|
|
34
|
+
},
|
|
19
35
|
ariaNow: {},
|
|
20
36
|
ariaMin: {},
|
|
21
37
|
ariaMax: {},
|
|
22
|
-
lazy: {
|
|
23
|
-
|
|
38
|
+
lazy: {
|
|
39
|
+
type: Boolean
|
|
40
|
+
},
|
|
41
|
+
containerSize: {},
|
|
42
|
+
draggerIcon: {},
|
|
43
|
+
collapsibleIcon: {},
|
|
44
|
+
showStartCollapsibleIcon: {
|
|
45
|
+
type: [Boolean, String]
|
|
46
|
+
},
|
|
47
|
+
showEndCollapsibleIcon: {
|
|
48
|
+
type: [Boolean, String]
|
|
49
|
+
}
|
|
24
50
|
},
|
|
25
|
-
setup(
|
|
26
|
-
function
|
|
27
|
-
return typeof
|
|
51
|
+
setup(k) {
|
|
52
|
+
function C(e) {
|
|
53
|
+
return typeof e == "number" && !Number.isNaN(e) ? Math.round(e) : 0;
|
|
28
54
|
}
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
const n = k, {
|
|
56
|
+
b: t,
|
|
57
|
+
cssVar: x
|
|
58
|
+
} = q("splitter-bar"), w = N(null), u = N(0), V = z(() => n.vertical ? 0 : o(u)), X = z(() => n.vertical ? o(u) : 0), Y = (e) => {
|
|
59
|
+
n.resizable && e.currentTarget && (w.value = [e.pageX, e.pageY], n.onOffsetStart(n.index));
|
|
60
|
+
}, P = (e) => {
|
|
61
|
+
if (n.resizable && e.touches.length === 1) {
|
|
62
|
+
const a = e.touches[0];
|
|
63
|
+
w.value = [a.pageX, a.pageY], n.onOffsetStart(n.index);
|
|
64
|
+
}
|
|
65
|
+
}, U = (e) => {
|
|
66
|
+
const {
|
|
67
|
+
containerSize: a,
|
|
68
|
+
ariaMax: s,
|
|
69
|
+
ariaMin: r,
|
|
70
|
+
ariaNow: i
|
|
71
|
+
} = n, l = a * i / 100, p = l + e, f = Math.max(0, a * r / 100), v = Math.max(a, a * s / 100);
|
|
72
|
+
return Math.max(f, Math.min(v, p)) - l;
|
|
73
|
+
}, I = (e, a) => {
|
|
74
|
+
const s = U(n.vertical ? a : e);
|
|
75
|
+
u.value = s;
|
|
76
|
+
}, S = () => {
|
|
77
|
+
n.onOffsetUpdate(n.index, o(V), o(X)), u.value = 0;
|
|
78
|
+
}, B = (e) => {
|
|
79
|
+
switch (e) {
|
|
80
|
+
case !0:
|
|
81
|
+
return t("collapse-bar-always-visible");
|
|
82
|
+
case !1:
|
|
83
|
+
return t("collapse-bar-always-hidden");
|
|
84
|
+
case "auto":
|
|
85
|
+
return t("collapse-bar-hover-only");
|
|
39
86
|
}
|
|
40
|
-
}, X = (o) => {
|
|
41
|
-
const { containerSize: a, ariaMax: i, ariaMin: v, ariaNow: m } = e, f = a * m / 100, r = f + o, c = Math.max(0, a * v / 100), d = Math.max(
|
|
42
|
-
a,
|
|
43
|
-
a * i / 100
|
|
44
|
-
);
|
|
45
|
-
return Math.max(c, Math.min(d, r)) - f;
|
|
46
|
-
}, b = (o, a) => {
|
|
47
|
-
const i = X(
|
|
48
|
-
e.vertical ? a : o
|
|
49
|
-
);
|
|
50
|
-
l.value = i;
|
|
51
|
-
}, M = () => {
|
|
52
|
-
e.onOffsetUpdate(
|
|
53
|
-
e.index,
|
|
54
|
-
t(N),
|
|
55
|
-
t(S)
|
|
56
|
-
), l.value = 0;
|
|
57
87
|
};
|
|
58
|
-
|
|
59
|
-
(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
D((e) => {
|
|
89
|
+
const a = o(w);
|
|
90
|
+
if (a) {
|
|
91
|
+
const s = (p) => {
|
|
92
|
+
const {
|
|
93
|
+
pageX: f,
|
|
94
|
+
pageY: v
|
|
95
|
+
} = p, m = f - a[0], L = v - a[1];
|
|
96
|
+
n.lazy ? I(m, L) : n.onOffsetUpdate(n.index, m, L);
|
|
97
|
+
}, r = () => {
|
|
98
|
+
n.lazy && S(), w.value = null, n.onOffsetEnd();
|
|
99
|
+
}, i = (p) => {
|
|
100
|
+
if (p.touches.length === 1) {
|
|
101
|
+
const f = p.touches[0], v = f.pageX - a[0], m = f.pageY - a[1];
|
|
102
|
+
n.lazy ? I(v, m) : n.onOffsetUpdate(n.index, v, m);
|
|
103
|
+
}
|
|
104
|
+
}, l = () => {
|
|
105
|
+
n.lazy && S(), w.value = null, n.onOffsetEnd();
|
|
106
|
+
};
|
|
107
|
+
window.addEventListener("touchmove", i), window.addEventListener("touchend", l), window.addEventListener("mousemove", s), window.addEventListener("mouseup", r), e(() => {
|
|
108
|
+
window.removeEventListener("touchmove", i), window.removeEventListener("touchend", l), window.removeEventListener("mousemove", s), window.removeEventListener("mouseup", r);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
flush: "post"
|
|
113
|
+
});
|
|
114
|
+
const h = z(() => {
|
|
115
|
+
const {
|
|
116
|
+
collapsibleIcon: e,
|
|
117
|
+
vertical: a
|
|
118
|
+
} = n;
|
|
119
|
+
let s = null, r = null;
|
|
120
|
+
const i = e?.start !== void 0, l = e?.end !== void 0;
|
|
121
|
+
return a ? (s = i ? e.start : b(A, null, null), r = l ? e.end : b(R, null, null)) : (s = i ? e.start : b($, null, null), r = l ? e.end : b(j, null, null)), {
|
|
122
|
+
startIcon: () => s,
|
|
123
|
+
endIcon: () => r,
|
|
124
|
+
startCustomize: i,
|
|
125
|
+
endCustomize: l
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
return (e, a) => (c(), g("div", {
|
|
129
|
+
class: d(o(t)()),
|
|
89
130
|
role: "separator",
|
|
90
|
-
"aria-valuenow":
|
|
91
|
-
"aria-valuemin":
|
|
92
|
-
"aria-valuemax":
|
|
93
|
-
}, [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
]
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
]
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
], 10, j));
|
|
131
|
+
"aria-valuenow": C(n.ariaNow),
|
|
132
|
+
"aria-valuemin": C(n.ariaMin),
|
|
133
|
+
"aria-valuemax": C(n.ariaMax)
|
|
134
|
+
}, [n.lazy ? (c(), g("div", {
|
|
135
|
+
key: 0,
|
|
136
|
+
class: d([o(t)("preview"), {
|
|
137
|
+
[o(t)("preview-active")]: !!u.value
|
|
138
|
+
}]),
|
|
139
|
+
style: F(o(x)({
|
|
140
|
+
"preview-offset": `${u.value}px`
|
|
141
|
+
}))
|
|
142
|
+
}, null, 6)) : y("", !0), O("div", {
|
|
143
|
+
class: d([o(t)("dragger"), {
|
|
144
|
+
[o(t)("dragger-disabled")]: !e.resizable,
|
|
145
|
+
[o(t)("dragger-active")]: e.active,
|
|
146
|
+
[o(t)("dragger-customize")]: e.draggerIcon !== void 0
|
|
147
|
+
}]),
|
|
148
|
+
onMousedown: Y,
|
|
149
|
+
onTouchstart: P
|
|
150
|
+
}, [e.draggerIcon !== void 0 ? (c(), g("div", {
|
|
151
|
+
key: 0,
|
|
152
|
+
class: d(o(t)("dragger-icon"))
|
|
153
|
+
}, [(c(), E(M(e.draggerIcon)))], 2)) : y("", !0)], 34), e.startCollapsible ? (c(), g("div", {
|
|
154
|
+
key: 1,
|
|
155
|
+
class: d([o(t)("collapse-bar"), o(t)("collapse-bar-start"), h.value.startCustomize ? o(t)("collapse-bar-customize") : "", B(e.showStartCollapsibleIcon)]),
|
|
156
|
+
onClick: a[0] || (a[0] = () => e.onCollapse(e.index, "start"))
|
|
157
|
+
}, [O("span", {
|
|
158
|
+
class: d([o(t)("collapse-icon"), o(t)("collapse-start")])
|
|
159
|
+
}, [(c(), E(M(h.value.startIcon)))], 2)], 2)) : y("", !0), e.endCollapsible ? (c(), g("div", {
|
|
160
|
+
key: 2,
|
|
161
|
+
class: d([o(t)("collapse-bar"), o(t)("collapse-bar-end"), h.value.endCustomize ? o(t)("collapse-bar-customize") : "", B(e.showEndCollapsibleIcon)]),
|
|
162
|
+
onClick: a[1] || (a[1] = () => e.onCollapse(e.index, "end"))
|
|
163
|
+
}, [O("span", {
|
|
164
|
+
class: d([o(t)("collapse-icon"), o(t)("collapse-end")])
|
|
165
|
+
}, [(c(), E(M(h.value.endIcon)))], 2)], 2)) : y("", !0)], 10, G));
|
|
126
166
|
}
|
|
127
167
|
});
|
|
128
168
|
export {
|
|
129
|
-
|
|
169
|
+
W as default
|
|
130
170
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as q, ref as G, unref as
|
|
1
|
+
import { defineComponent as q, ref as G, unref as o, computed as v, createBlock as d, openBlock as r, withCtx as C, createElementVNode as J, normalizeClass as R, normalizeStyle as K, createElementBlock as f, createCommentVNode as I, Fragment as b, renderList as E, createVNode as Q, mergeProps as T, resolveDynamicComponent as X } from "vue";
|
|
2
2
|
import { omit as Y } from "lodash-unified";
|
|
3
3
|
import "../config-provider/index.mjs";
|
|
4
4
|
import "../resize-observer/index.mjs";
|
|
@@ -8,12 +8,12 @@ import { useResize as ee } from "./hooks/useResize.mjs";
|
|
|
8
8
|
import { useSizes as te } from "./hooks/useSizes.mjs";
|
|
9
9
|
import "./Panel.vue.mjs";
|
|
10
10
|
import "./SplitBar.vue.mjs";
|
|
11
|
-
import
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
import
|
|
11
|
+
import oe from "./style/index.mjs";
|
|
12
|
+
import { useNamespace as ae } from "../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import se from "../resize-observer/index.vue.mjs";
|
|
14
14
|
import ne from "./Panel.vue2.mjs";
|
|
15
|
-
import
|
|
16
|
-
const
|
|
15
|
+
import le from "./SplitBar.vue2.mjs";
|
|
16
|
+
const Ce = /* @__PURE__ */ q({
|
|
17
17
|
name: "Splitter",
|
|
18
18
|
__name: "Splitter",
|
|
19
19
|
props: {
|
|
@@ -25,85 +25,91 @@ const ge = /* @__PURE__ */ q({
|
|
|
25
25
|
onResizeStart: {},
|
|
26
26
|
onResize: {},
|
|
27
27
|
onResizeEnd: {},
|
|
28
|
-
lazy: { type: Boolean }
|
|
28
|
+
lazy: { type: Boolean },
|
|
29
|
+
draggerIcon: {},
|
|
30
|
+
collapsibleIcon: {}
|
|
29
31
|
},
|
|
30
|
-
setup(
|
|
31
|
-
const n =
|
|
32
|
-
const { offsetWidth:
|
|
33
|
-
|
|
32
|
+
setup(_) {
|
|
33
|
+
const n = _, { b: m } = ae("splitter"), k = oe("splitter"), i = Z(), c = G(), w = (e) => {
|
|
34
|
+
const { offsetWidth: s, offsetHeight: a } = e.target, t = n.layout === "vertical" ? a : s;
|
|
35
|
+
c.value !== 0 && (c.value = t);
|
|
34
36
|
}, [
|
|
35
|
-
|
|
37
|
+
N,
|
|
36
38
|
u,
|
|
37
|
-
|
|
39
|
+
g,
|
|
40
|
+
O,
|
|
38
41
|
P,
|
|
39
|
-
M
|
|
40
|
-
|
|
41
|
-
] = te(i, l), m = x(i, u, !1), [U, $, w, V, C] = ee(
|
|
42
|
+
M
|
|
43
|
+
] = te(i, c), l = x(i, u, !1), [B, U, $, V, y] = ee(
|
|
42
44
|
i,
|
|
43
|
-
m,
|
|
44
|
-
v,
|
|
45
45
|
l,
|
|
46
|
-
|
|
46
|
+
g,
|
|
47
|
+
c,
|
|
48
|
+
M,
|
|
47
49
|
!1
|
|
48
50
|
), A = (e) => {
|
|
49
|
-
|
|
50
|
-
}, D = (e,
|
|
51
|
-
const
|
|
52
|
-
n.onResize?.(
|
|
51
|
+
B(e), n.onResizeStart?.(o(u));
|
|
52
|
+
}, D = (e, s) => {
|
|
53
|
+
const a = U(e, s);
|
|
54
|
+
n.onResize?.(a);
|
|
53
55
|
}, F = () => {
|
|
54
|
-
|
|
55
|
-
}, H = (e,
|
|
56
|
-
const
|
|
57
|
-
n.onResize?.(
|
|
58
|
-
}, L =
|
|
56
|
+
$(), n.onResizeEnd?.(o(u));
|
|
57
|
+
}, H = (e, s) => {
|
|
58
|
+
const a = V(e, s);
|
|
59
|
+
n.onResize?.(a), n.onResizeEnd?.(a);
|
|
60
|
+
}, L = v(() => [m(), n.className, m(n.layout), k.value]), h = v(() => {
|
|
59
61
|
const e = [];
|
|
60
|
-
let
|
|
61
|
-
for (let
|
|
62
|
-
|
|
62
|
+
let s = 0;
|
|
63
|
+
for (let a = 0; a < i.value.length; a += 1)
|
|
64
|
+
s += o(g)[a], e.push(s);
|
|
63
65
|
return e;
|
|
64
|
-
}),
|
|
65
|
-
const
|
|
66
|
+
}), p = (e) => {
|
|
67
|
+
const s = o(h), a = o(O), t = o(P);
|
|
66
68
|
return {
|
|
67
|
-
minStart: (
|
|
68
|
-
minEnd: (
|
|
69
|
-
maxStart: (
|
|
70
|
-
maxEnd: (
|
|
69
|
+
minStart: (s[e - 1] || 0) + a[e],
|
|
70
|
+
minEnd: (s[e + 1] || 100) - t[e + 1],
|
|
71
|
+
maxStart: (s[e - 1] || 0) + t[e],
|
|
72
|
+
maxEnd: (s[e + 1] || 100) - a[e + 1]
|
|
71
73
|
};
|
|
72
74
|
};
|
|
73
|
-
return (e,
|
|
74
|
-
default:
|
|
75
|
+
return (e, s) => (r(), d(o(se), { onResize: w }, {
|
|
76
|
+
default: C(() => [
|
|
75
77
|
J("div", {
|
|
76
78
|
style: K(e.style),
|
|
77
|
-
class:
|
|
79
|
+
class: R(L.value)
|
|
78
80
|
}, [
|
|
79
|
-
(r(!0),
|
|
80
|
-
Q(ne, T({ ref_for: !0 },
|
|
81
|
-
size:
|
|
81
|
+
(r(!0), f(b, null, E(o(i), (a, t) => (r(), f(b, { key: t }, [
|
|
82
|
+
Q(ne, T({ ref_for: !0 }, o(Y)(a, "_child"), {
|
|
83
|
+
size: o(N)[t]
|
|
82
84
|
}), {
|
|
83
|
-
default:
|
|
84
|
-
(r(!0),
|
|
85
|
+
default: C(() => [
|
|
86
|
+
(r(!0), f(b, null, E(a._child, (z, S) => (r(), d(X(z), { key: S }))), 128))
|
|
85
87
|
]),
|
|
86
88
|
_: 2
|
|
87
89
|
}, 1040, ["size"]),
|
|
88
|
-
|
|
90
|
+
o(l)[t] ? (r(), d(le, {
|
|
89
91
|
key: 0,
|
|
90
92
|
lazy: e.lazy,
|
|
91
93
|
index: t,
|
|
92
|
-
active:
|
|
94
|
+
active: o(y) === t,
|
|
93
95
|
vertical: e.layout === "vertical",
|
|
94
|
-
resizable:
|
|
95
|
-
"aria-now":
|
|
96
|
+
resizable: o(l)[t].resizable,
|
|
97
|
+
"aria-now": h.value[t] * 100,
|
|
96
98
|
"aria-min": Math.max(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
p(t).minStart,
|
|
100
|
+
p(t).minEnd
|
|
99
101
|
) * 100,
|
|
100
102
|
"aria-max": Math.min(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
p(t).maxStart,
|
|
104
|
+
p(t).maxEnd
|
|
103
105
|
) * 100,
|
|
104
|
-
"start-collapsible":
|
|
105
|
-
"end-collapsible":
|
|
106
|
-
"
|
|
106
|
+
"start-collapsible": o(l)[t].startCollapsible,
|
|
107
|
+
"end-collapsible": o(l)[t].endCollapsible,
|
|
108
|
+
"show-start-collapsible-icon": o(l)[t].showStartCollapsibleIcon,
|
|
109
|
+
"show-end-collapsible-icon": o(l)[t].showEndCollapsibleIcon,
|
|
110
|
+
"container-size": c.value || 0,
|
|
111
|
+
"dragger-icon": e.draggerIcon,
|
|
112
|
+
"collapsible-icon": e.collapsibleIcon,
|
|
107
113
|
onOffsetStart: A,
|
|
108
114
|
onOffsetUpdate: (z, S, W) => {
|
|
109
115
|
let j = e.layout === "vertical" ? W : S;
|
|
@@ -111,13 +117,13 @@ const ge = /* @__PURE__ */ q({
|
|
|
111
117
|
},
|
|
112
118
|
onOffsetEnd: F,
|
|
113
119
|
onCollapse: H
|
|
114
|
-
}, null, 8, ["lazy", "index", "active", "vertical", "resizable", "aria-now", "aria-min", "aria-max", "start-collapsible", "end-collapsible", "container-size", "onOffsetUpdate"])) :
|
|
120
|
+
}, null, 8, ["lazy", "index", "active", "vertical", "resizable", "aria-now", "aria-min", "aria-max", "start-collapsible", "end-collapsible", "show-start-collapsible-icon", "show-end-collapsible-icon", "container-size", "dragger-icon", "collapsible-icon", "onOffsetUpdate"])) : I("", !0)
|
|
115
121
|
], 64))), 128)),
|
|
116
|
-
typeof
|
|
122
|
+
typeof o(y) == "number" ? (r(), f("div", {
|
|
117
123
|
key: 0,
|
|
118
124
|
"aria-hidden": "",
|
|
119
|
-
class:
|
|
120
|
-
}, null, 2)) :
|
|
125
|
+
class: R([o(m)("mask"), o(m)(`mask-${e.layout}`)])
|
|
126
|
+
}, null, 2)) : I("", !0)
|
|
121
127
|
], 6)
|
|
122
128
|
]),
|
|
123
129
|
_: 1
|
|
@@ -125,5 +131,5 @@ const ge = /* @__PURE__ */ q({
|
|
|
125
131
|
}
|
|
126
132
|
});
|
|
127
133
|
export {
|
|
128
|
-
|
|
134
|
+
Ce as default
|
|
129
135
|
};
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import { useSlots as
|
|
2
|
-
import { genRealChildren as
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
5
|
-
return
|
|
6
|
-
|
|
1
|
+
import { useSlots as n, computed as s } from "vue";
|
|
2
|
+
import { genRealChildren as l } from "../../ap-form/item-group/helper.mjs";
|
|
3
|
+
function u(o) {
|
|
4
|
+
if (o && typeof o == "object")
|
|
5
|
+
return {
|
|
6
|
+
...o,
|
|
7
|
+
showCollapsibleIcon: o.showCollapsibleIcon === void 0 ? "auto" : o.showCollapsibleIcon
|
|
8
|
+
};
|
|
9
|
+
const t = !!o || o === "";
|
|
7
10
|
return {
|
|
8
|
-
start:
|
|
9
|
-
end:
|
|
11
|
+
start: t,
|
|
12
|
+
end: t,
|
|
13
|
+
showCollapsibleIcon: "auto"
|
|
10
14
|
};
|
|
11
15
|
}
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
return s(() =>
|
|
15
|
-
const { props:
|
|
16
|
+
const d = () => {
|
|
17
|
+
const o = n();
|
|
18
|
+
return s(() => o.default ? l(o.default()).map((e) => {
|
|
19
|
+
const { props: r } = e;
|
|
16
20
|
return {
|
|
17
|
-
...
|
|
18
|
-
collapsible:
|
|
19
|
-
_child:
|
|
21
|
+
...r,
|
|
22
|
+
collapsible: u(r?.collapsible),
|
|
23
|
+
_child: e.children.default?.()
|
|
20
24
|
};
|
|
21
25
|
}) : []);
|
|
22
26
|
};
|
|
23
27
|
export {
|
|
24
|
-
|
|
28
|
+
d as useItems
|
|
25
29
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { ShowCollapsibleIconMode } from '../interface';
|
|
2
3
|
import { ItemType } from './useItems';
|
|
3
4
|
export type ResizableInfo = {
|
|
4
5
|
resizable: boolean;
|
|
5
6
|
startCollapsible: boolean;
|
|
6
7
|
endCollapsible: boolean;
|
|
8
|
+
showStartCollapsibleIcon: ShowCollapsibleIconMode;
|
|
9
|
+
showEndCollapsibleIcon: ShowCollapsibleIconMode;
|
|
7
10
|
};
|
|
8
11
|
export declare const useResizable: (items: Ref<ItemType[]>, pxSizes: Ref<number[]>, isRTL: boolean) => ComputedRef<ResizableInfo[]>;
|
|
@@ -1,37 +1,60 @@
|
|
|
1
|
-
import { computed as R, unref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { computed as R, unref as u } from "vue";
|
|
2
|
+
function w(l, o) {
|
|
3
|
+
return l.collapsible && o.collapsible ? l.showCollapsibleIcon === !0 || o.showCollapsibleIcon === !0 ? !0 : l.showCollapsibleIcon === "auto" || o.showCollapsibleIcon === "auto" ? "auto" : !1 : l.collapsible ? l.showCollapsibleIcon : o.collapsible ? o.showCollapsibleIcon : !1;
|
|
4
|
+
}
|
|
5
|
+
const k = (l, o, i) => R(() => {
|
|
6
|
+
const b = [], c = u(l), p = u(o);
|
|
7
|
+
for (let e = 0; e < c.length - 1; e += 1) {
|
|
8
|
+
const d = c[e], f = c[e + 1], s = p[e], n = p[e + 1], {
|
|
9
|
+
resizable: z = !0,
|
|
10
|
+
min: m,
|
|
11
|
+
collapsible: t
|
|
12
|
+
} = d, {
|
|
13
|
+
resizable: S = !0,
|
|
14
|
+
min: x,
|
|
12
15
|
collapsible: a
|
|
13
|
-
} =
|
|
16
|
+
} = f, E = (
|
|
14
17
|
// Both need to be resizable
|
|
15
|
-
|
|
16
|
-
(
|
|
17
|
-
(
|
|
18
|
-
),
|
|
18
|
+
z && S && // Prev is not collapsed and limit min size
|
|
19
|
+
(s !== 0 || !m) && // Next is not collapsed and limit min size
|
|
20
|
+
(n !== 0 || !x)
|
|
21
|
+
), g = !!t.end && s > 0, v = !!a.start && n === 0 && s > 0, r = (
|
|
19
22
|
// Self is collapsible
|
|
20
|
-
|
|
21
|
-
a.start &&
|
|
22
|
-
),
|
|
23
|
+
t.end && s > 0 || // Collapsed and can be collapsed
|
|
24
|
+
a.start && n === 0 && s > 0
|
|
25
|
+
), M = !!a.start && n > 0, _ = !!t.end && s === 0 && n > 0, C = (
|
|
23
26
|
// Self is collapsible
|
|
24
|
-
a.start &&
|
|
25
|
-
|
|
27
|
+
a.start && n > 0 || // Collapsed and can be collapsed
|
|
28
|
+
t.end && s === 0 && n > 0
|
|
29
|
+
), I = w(
|
|
30
|
+
{
|
|
31
|
+
collapsible: g,
|
|
32
|
+
showCollapsibleIcon: t.showCollapsibleIcon
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
collapsible: v,
|
|
36
|
+
showCollapsibleIcon: a.showCollapsibleIcon
|
|
37
|
+
}
|
|
38
|
+
), h = w(
|
|
39
|
+
{
|
|
40
|
+
collapsible: M,
|
|
41
|
+
showCollapsibleIcon: a.showCollapsibleIcon
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
collapsible: _,
|
|
45
|
+
showCollapsibleIcon: t.showCollapsibleIcon
|
|
46
|
+
}
|
|
26
47
|
);
|
|
27
|
-
|
|
28
|
-
resizable:
|
|
29
|
-
startCollapsible: !!(
|
|
30
|
-
endCollapsible: !!(
|
|
48
|
+
b[e] = {
|
|
49
|
+
resizable: E,
|
|
50
|
+
startCollapsible: !!(i ? C : r),
|
|
51
|
+
endCollapsible: !!(i ? r : C),
|
|
52
|
+
showStartCollapsibleIcon: i ? h : I,
|
|
53
|
+
showEndCollapsibleIcon: i ? I : h
|
|
31
54
|
};
|
|
32
55
|
}
|
|
33
|
-
return
|
|
56
|
+
return b;
|
|
34
57
|
});
|
|
35
58
|
export {
|
|
36
|
-
|
|
59
|
+
k as useResizable
|
|
37
60
|
};
|