rappel-ui 1.0.40 → 1.0.42
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/cjs/components/ellipsis-menu/index.d.ts +65 -0
- package/cjs/components/ellipsis-menu/index.js +1 -0
- package/cjs/components/ellipsis-menu/src/ellipsis-menu.js +1 -0
- package/cjs/components/ellipsis-menu/src/ellipsis-menu.vue.d.ts +33 -0
- package/cjs/components/ellipsis-menu/src/ellipsis-menu.vue_vue_type_script_setup_true_lang.js +1 -0
- package/cjs/components/ellipsis-menu/src/types.d.ts +13 -0
- package/cjs/components/ellipsis-menu/style/css.d.ts +0 -0
- package/cjs/components/ellipsis-menu/style/css.js +2 -0
- package/cjs/components/ellipsis-menu/style/index.d.ts +0 -0
- package/cjs/components/ellipsis-menu/style/index.js +2 -0
- package/cjs/components/index.d.ts +1 -0
- package/cjs/components/index.js +1 -1
- package/cjs/components/menu/src/loop.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/menu/src/menu-item.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/composables/index.d.ts +1 -0
- package/cjs/composables/index.js +1 -1
- package/cjs/composables/use-resizable/index.d.ts +4 -0
- package/cjs/composables/use-resizable/index.js +1 -0
- package/cjs/directives/vResizable.d.ts +30 -2
- package/cjs/directives/vResizable.js +11 -8
- package/cjs/index.d.ts +61 -0
- package/cjs/index.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.umd.js +17 -14
- package/es/components/ellipsis-menu/index.d.ts +65 -0
- package/es/components/ellipsis-menu/index.mjs +7 -0
- package/es/components/ellipsis-menu/src/ellipsis-menu.mjs +5 -0
- package/es/components/ellipsis-menu/src/ellipsis-menu.vue.d.ts +33 -0
- package/es/components/ellipsis-menu/src/ellipsis-menu.vue_vue_type_script_setup_true_lang.mjs +133 -0
- package/es/components/ellipsis-menu/src/types.d.ts +13 -0
- package/es/components/ellipsis-menu/style/css.d.ts +0 -0
- package/es/components/ellipsis-menu/style/css.mjs +2 -0
- package/es/components/ellipsis-menu/style/index.d.ts +0 -0
- package/es/components/ellipsis-menu/style/index.mjs +2 -0
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +4 -2
- package/es/components/menu/src/loop.vue_vue_type_script_setup_true_lang.mjs +65 -68
- package/es/components/menu/src/menu-item.vue_vue_type_script_setup_true_lang.mjs +74 -74
- package/es/composables/index.d.ts +1 -0
- package/es/composables/index.mjs +2 -1
- package/es/composables/use-resizable/index.d.ts +4 -0
- package/es/composables/use-resizable/index.mjs +8 -0
- package/es/directives/vResizable.d.ts +30 -2
- package/es/directives/vResizable.mjs +101 -68
- package/es/index.d.ts +61 -0
- package/es/index.mjs +72 -70
- package/package.json +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/re-ellipsis-menu.css +1 -0
- package/theme-chalk/src/ellipsis-menu.scss +39 -0
- package/theme-chalk/src/index.scss +1 -0
|
@@ -6,11 +6,11 @@ import "../../../composables/index.mjs";
|
|
|
6
6
|
import { ReTooltip as te } from "../../tooltip/index.mjs";
|
|
7
7
|
import { _menuProvideKey as n } from "./constants.mjs";
|
|
8
8
|
import r from "./loop.mjs";
|
|
9
|
-
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as ne, defineComponent as u, inject as
|
|
10
|
-
import { computedAsync as
|
|
11
|
-
import { ArrowDownward as
|
|
9
|
+
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as ne, defineComponent as u, inject as re, normalizeClass as d, normalizeStyle as f, onMounted as ie, openBlock as p, ref as ae, renderSlot as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, useAttrs as oe, useSlots as se, useTemplateRef as ce, withCtx as v } from "vue";
|
|
10
|
+
import { computedAsync as y } from "@vueuse/core";
|
|
11
|
+
import { ArrowDownward as b, getAsyncIcon as x } from "@rappel-ui/svg-icons";
|
|
12
12
|
//#region packages/components/menu/src/menu-item.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var
|
|
13
|
+
var le = ["depth"], S = u({
|
|
14
14
|
name: "ReMenuItem",
|
|
15
15
|
__name: "menu-item",
|
|
16
16
|
props: {
|
|
@@ -28,16 +28,16 @@ var ce = ["depth"], C = u({
|
|
|
28
28
|
icon: { default: "" },
|
|
29
29
|
subIcon: {
|
|
30
30
|
type: [String, Boolean],
|
|
31
|
-
default: () =>
|
|
31
|
+
default: () => b
|
|
32
32
|
},
|
|
33
33
|
depth: { default: () => void 0 }
|
|
34
34
|
},
|
|
35
|
-
setup(u, { expose:
|
|
36
|
-
let { n:
|
|
35
|
+
setup(u, { expose: b }) {
|
|
36
|
+
let { n: S, nm: C, ns: w, is: T, has: ue } = t("menu"), E = i(() => {
|
|
37
37
|
var e, t;
|
|
38
38
|
return (e = u.hasChildren) == null ? ((t = u.children) == null ? void 0 : t.length) > 0 : e;
|
|
39
|
-
}),
|
|
40
|
-
e !== u.value ||
|
|
39
|
+
}), D = i(() => !(E.value && !u.disabled)), O = oe(), k = ae(!1), { currentItem: de, theme: A, collapse: fe, cssDuration: j, depth: pe, offset: me, submenuOffset: he, closeOnSelect: M, direction: N, selectedKey: P, labelPadding: F, trigger: I, topSubMenusKeys: L, submenuClosers: R, select: z, showArrow: B, placement: V, registerDescendant: H } = re(n), ge = (e) => {
|
|
40
|
+
e !== u.value || E.value || u.disabled || z(u.value, {
|
|
41
41
|
label: u.label,
|
|
42
42
|
disabled: u.disabled,
|
|
43
43
|
value: u.value,
|
|
@@ -47,8 +47,8 @@ var ce = ["depth"], C = u({
|
|
|
47
47
|
subIcon: u.subIcon,
|
|
48
48
|
depth: X.value
|
|
49
49
|
}, !1);
|
|
50
|
-
},
|
|
51
|
-
e.stopPropagation(), !(
|
|
50
|
+
}, _e = (e) => {
|
|
51
|
+
e.stopPropagation(), !(E.value || u.disabled || X.value === -1) && (z(u.value, {
|
|
52
52
|
label: u.label,
|
|
53
53
|
disabled: u.disabled,
|
|
54
54
|
value: u.value,
|
|
@@ -57,49 +57,49 @@ var ce = ["depth"], C = u({
|
|
|
57
57
|
icon: u.icon,
|
|
58
58
|
subIcon: u.subIcon,
|
|
59
59
|
depth: X.value
|
|
60
|
-
}),
|
|
60
|
+
}), M != null && M.value && (R == null || R.forEach((e) => {
|
|
61
61
|
var t;
|
|
62
62
|
return e == null || (t = e.close) == null ? void 0 : t.call(e);
|
|
63
63
|
})));
|
|
64
|
-
},
|
|
64
|
+
}, U = y(async () => await x(u.icon)), W = y(async () => await x(u.subIcon || "")), ve = i(() => {
|
|
65
65
|
var e;
|
|
66
|
-
return ((e =
|
|
67
|
-
}), { currentTheme:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
]),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
return ((e = de.value) == null ? void 0 : e.value) === u.value;
|
|
67
|
+
}), { currentTheme: G } = ee(A.value, D.value), K = i(() => [
|
|
68
|
+
S(),
|
|
69
|
+
C("tooltip"),
|
|
70
|
+
T(G.value, !!G.value)
|
|
71
|
+
]), ye = i(() => X.value === 0 && !(O != null && O["is-more"]) || X.value === -1 ? me.value : he.value), q = i(() => X.value === 0 && !(O != null && O["is-more"]) || X.value === -1), J = se(), be = i(() => !(J != null && J["item-submenu"]) && !E.value ? "hover" : I.value), Y = i(() => ({ "--menu-transition-duration": `${j.value}ms` })), xe = i(() => [{ padding: `0 ${e(F.value)}` }]), Se = i(() => [
|
|
72
|
+
w("item"),
|
|
73
|
+
T("disabled", u.disabled),
|
|
74
|
+
ue("children", E.value),
|
|
75
|
+
T("selected", ve.value)
|
|
76
76
|
]), X = i(() => {
|
|
77
77
|
var e;
|
|
78
|
-
return (e = u.depth) == null ?
|
|
79
|
-
}), Z = i(typeof
|
|
80
|
-
if (
|
|
78
|
+
return (e = u.depth) == null ? pe.value : e;
|
|
79
|
+
}), Z = i(typeof V == "function" ? () => V(N.value, X.value, E.value) : () => N.value === "vertical" ? X.value === 0 ? "right" : "right-start" : X.value === -1 ? "bottom-end" : X.value === 0 && !(O != null && O["is-more"]) ? "bottom" : "right-start"), Ce = i(() => N.value === "vertical" ? !fe.value || !E.value && X.value !== 0 || E.value && X.value !== 0 && u.disabled : u.disabled || !E.value), Q = i(typeof B == "function" ? () => B(X.value) : () => X.value === 0 && !(O != null && O["is-more"]));
|
|
80
|
+
if (M.value && !u.disabled) {
|
|
81
81
|
let e = {
|
|
82
82
|
value: u.value,
|
|
83
83
|
close: () => {
|
|
84
|
-
|
|
84
|
+
k.value = !1;
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
R.some((e) => e.value === u.value) || R.push(e);
|
|
88
88
|
}
|
|
89
89
|
let we = () => {
|
|
90
|
-
if (X.value === 0 &&
|
|
90
|
+
if (X.value === 0 && E.value) {
|
|
91
91
|
var e;
|
|
92
|
-
(e =
|
|
92
|
+
(e = L.value) == null || e.push(u.value);
|
|
93
93
|
}
|
|
94
|
-
}, $ =
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
}),
|
|
94
|
+
}, $ = ce("itemRef");
|
|
95
|
+
return ie(() => {
|
|
96
|
+
H == null || H(u.value), we(), ge(P == null ? void 0 : P.value);
|
|
97
|
+
}), b({
|
|
98
98
|
itemRef: $,
|
|
99
|
-
hasChild:
|
|
99
|
+
hasChild: E,
|
|
100
100
|
showArrow: Q,
|
|
101
101
|
placement: Z,
|
|
102
|
-
visible:
|
|
102
|
+
visible: k,
|
|
103
103
|
value: u.value,
|
|
104
104
|
label: u.label,
|
|
105
105
|
disabled: u.disabled,
|
|
@@ -107,46 +107,46 @@ var ce = ["depth"], C = u({
|
|
|
107
107
|
subIcon: u.subIcon,
|
|
108
108
|
depth: X.value,
|
|
109
109
|
children: u.children
|
|
110
|
-
}), (e, t) => (
|
|
110
|
+
}), (e, t) => (p(), s("li", {
|
|
111
111
|
ref_key: "itemRef",
|
|
112
112
|
ref: $,
|
|
113
|
-
class:
|
|
113
|
+
class: d(Se.value),
|
|
114
114
|
depth: X.value,
|
|
115
|
-
onClick:
|
|
116
|
-
}, [ne(
|
|
117
|
-
visible:
|
|
118
|
-
"onUpdate:visible": t[0] || (t[0] = (e) =>
|
|
119
|
-
"floating-class": [
|
|
115
|
+
onClick: _e
|
|
116
|
+
}, [ne(_(te), {
|
|
117
|
+
visible: k.value,
|
|
118
|
+
"onUpdate:visible": t[0] || (t[0] = (e) => k.value = e),
|
|
119
|
+
"floating-class": [E.value && !u.disabled ? _(C)("tooltip") : _(C)("cover"), _(T)("disabled", u.disabled)],
|
|
120
120
|
disabled: Ce.value,
|
|
121
|
-
teleported:
|
|
121
|
+
teleported: q.value,
|
|
122
122
|
placement: Z.value,
|
|
123
123
|
"show-arrow": Q.value,
|
|
124
|
-
theme:
|
|
125
|
-
"reverse-theme":
|
|
126
|
-
"css-duration":
|
|
124
|
+
theme: _(A),
|
|
125
|
+
"reverse-theme": D.value,
|
|
126
|
+
"css-duration": _(j),
|
|
127
127
|
transform: !1,
|
|
128
|
-
offset:
|
|
128
|
+
offset: ye.value,
|
|
129
129
|
transition: "menu",
|
|
130
130
|
trigger: be.value
|
|
131
131
|
}, {
|
|
132
|
-
content:
|
|
132
|
+
content: v(() => {
|
|
133
133
|
var t;
|
|
134
|
-
return [(t = e.$slots) != null && t["item-submenu"] && !u.disabled ? (
|
|
134
|
+
return [(t = e.$slots) != null && t["item-submenu"] && !u.disabled ? (p(), a(r, {
|
|
135
135
|
key: 0,
|
|
136
|
-
class:
|
|
136
|
+
class: d(K.value),
|
|
137
137
|
"is-more": e.$attrs["is-more"],
|
|
138
|
-
style:
|
|
138
|
+
style: f(Y.value)
|
|
139
139
|
}, {
|
|
140
|
-
default:
|
|
140
|
+
default: v(() => [m(e.$slots, "item-submenu")]),
|
|
141
141
|
_: 3
|
|
142
142
|
}, 8, [
|
|
143
143
|
"class",
|
|
144
144
|
"is-more",
|
|
145
145
|
"style"
|
|
146
|
-
])) :
|
|
146
|
+
])) : E.value && !u.disabled ? (p(), a(r, {
|
|
147
147
|
key: 1,
|
|
148
|
-
class:
|
|
149
|
-
style:
|
|
148
|
+
class: d(K.value),
|
|
149
|
+
style: f(Y.value),
|
|
150
150
|
"is-more": e.$attrs["is-more"],
|
|
151
151
|
options: u.children
|
|
152
152
|
}, null, 8, [
|
|
@@ -154,35 +154,35 @@ var ce = ["depth"], C = u({
|
|
|
154
154
|
"style",
|
|
155
155
|
"is-more",
|
|
156
156
|
"options"
|
|
157
|
-
])) :
|
|
157
|
+
])) : m(e.$slots, "default", {}, () => [l(g(u.label), 1)], void 0, 2)];
|
|
158
158
|
}),
|
|
159
|
-
default:
|
|
160
|
-
class:
|
|
161
|
-
style:
|
|
159
|
+
default: v(() => [c("div", {
|
|
160
|
+
class: d([_(w)("label-wrap")]),
|
|
161
|
+
style: f(xe.value),
|
|
162
162
|
tabindex: "0"
|
|
163
163
|
}, [
|
|
164
|
-
|
|
164
|
+
m(e.$slots, "icon", {}, () => [u.icon ? (p(), s("div", {
|
|
165
165
|
key: 0,
|
|
166
|
-
class:
|
|
167
|
-
}, [typeof
|
|
166
|
+
class: d([_(w)("icon")])
|
|
167
|
+
}, [typeof _(U) == "string" ? (p(), s("i", {
|
|
168
168
|
key: 0,
|
|
169
|
-
class:
|
|
169
|
+
class: d([_(U)]),
|
|
170
170
|
"aria-hidden": "true"
|
|
171
|
-
}, null, 2)) : (
|
|
171
|
+
}, null, 2)) : (p(), a(h(_(U)), {
|
|
172
172
|
key: 1,
|
|
173
173
|
"aria-hidden": "true"
|
|
174
174
|
}))], 2)) : o("", !0)]),
|
|
175
|
-
c("div", { class:
|
|
176
|
-
|
|
175
|
+
c("div", { class: d([_(w)("label")]) }, [m(e.$slots, "default", {}, () => [l(g(u.label), 1)])], 2),
|
|
176
|
+
m(e.$slots, "sub-icon", {}, () => [u.subIcon && E.value ? (p(), s("div", {
|
|
177
177
|
key: 0,
|
|
178
|
-
class:
|
|
179
|
-
}, [typeof
|
|
178
|
+
class: d([_(w)("subicon")])
|
|
179
|
+
}, [typeof _(W) == "string" ? (p(), s("i", {
|
|
180
180
|
key: 0,
|
|
181
|
-
class:
|
|
181
|
+
class: d([_(W), _(S)("svg-icon")]),
|
|
182
182
|
"aria-hidden": "true"
|
|
183
|
-
}, null, 2)) : (
|
|
183
|
+
}, null, 2)) : (p(), a(h(_(W)), {
|
|
184
184
|
key: 1,
|
|
185
|
-
class:
|
|
185
|
+
class: d([_(S)("svg-icon")]),
|
|
186
186
|
"aria-hidden": "true"
|
|
187
187
|
}, null, 8, ["class"]))], 2)) : o("", !0)])
|
|
188
188
|
], 6)]),
|
|
@@ -199,8 +199,8 @@ var ce = ["depth"], C = u({
|
|
|
199
199
|
"css-duration",
|
|
200
200
|
"offset",
|
|
201
201
|
"trigger"
|
|
202
|
-
]),
|
|
202
|
+
]), m(e.$slots, "submenu")], 10, le));
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
205
|
//#endregion
|
|
206
|
-
export {
|
|
206
|
+
export { S as default };
|
package/es/composables/index.mjs
CHANGED
|
@@ -7,4 +7,5 @@ import { useNamespace as a } from "./use-namespace/index.mjs";
|
|
|
7
7
|
import { useZIndex as o } from "./use-z-index/index.mjs";
|
|
8
8
|
import { useTheme as s } from "./use-theme/index.mjs";
|
|
9
9
|
import { useSlotFirstNode as c, useSlotNodes as l } from "./use-slot-nodes/index.mjs";
|
|
10
|
-
|
|
10
|
+
import { useResizable as u } from "./use-resizable/index.mjs";
|
|
11
|
+
export { t as useDateFormat, e as useDraggable, a as useNamespace, n as useOnceFn, u as useResizable, c as useSlotFirstNode, l as useSlotNodes, s as useTheme, r as useTimeNodes, i as useWaterFallLayout, o as useZIndex };
|
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
import { DirectiveBinding } from 'vue';
|
|
2
|
-
|
|
2
|
+
type Side = 'left' | 'right' | 'top' | 'bottom' | 'bottom-right';
|
|
3
|
+
export interface ResizeOptions {
|
|
3
4
|
minWidth?: number;
|
|
4
5
|
minHeight?: number;
|
|
5
6
|
maxWidth?: number;
|
|
6
7
|
maxHeight?: number;
|
|
8
|
+
left: boolean;
|
|
9
|
+
right: boolean;
|
|
10
|
+
top: boolean;
|
|
11
|
+
bottom: boolean;
|
|
12
|
+
bottomRight: boolean;
|
|
13
|
+
handleSize: number;
|
|
14
|
+
showHandlers: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ResizeState {
|
|
17
|
+
side?: Side;
|
|
18
|
+
startX: number;
|
|
19
|
+
startY: number;
|
|
20
|
+
startW: number;
|
|
21
|
+
startH: number;
|
|
22
|
+
startL: number;
|
|
23
|
+
startT: number;
|
|
24
|
+
minW: number;
|
|
25
|
+
minH: number;
|
|
26
|
+
maxW?: number;
|
|
27
|
+
maxH?: number;
|
|
28
|
+
pointerId?: number;
|
|
29
|
+
handlers: HTMLElement[];
|
|
30
|
+
onMove?: (e: PointerEvent) => void;
|
|
31
|
+
onUp?: (e: PointerEvent) => void;
|
|
32
|
+
ro?: ResizeObserver;
|
|
7
33
|
}
|
|
8
34
|
/** main directive */
|
|
9
35
|
declare const vResizable: {
|
|
10
36
|
mounted(el: HTMLElement, binding: DirectiveBinding): void;
|
|
11
37
|
beforeUnmount(el: HTMLElement): void;
|
|
12
38
|
};
|
|
13
|
-
declare function applyResizable(el: HTMLElement, options?: ResizeOptions):
|
|
39
|
+
declare function applyResizable(el: HTMLElement, options?: ResizeOptions): {
|
|
40
|
+
destroy: () => void;
|
|
41
|
+
};
|
|
14
42
|
export { vResizable, applyResizable };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region packages/directives/vResizable.ts
|
|
2
|
-
var e = "v-resizable-handle",
|
|
3
|
-
function
|
|
4
|
-
if (document.getElementById(
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
.${
|
|
2
|
+
var e = 4, t = "v-resizable-handle", n = "v-resizable-handle-style";
|
|
3
|
+
function r() {
|
|
4
|
+
if (document.getElementById(n)) return;
|
|
5
|
+
let e = document.createElement("style");
|
|
6
|
+
e.id = n, e.textContent = `
|
|
7
|
+
.${t} {
|
|
8
8
|
position: absolute;
|
|
9
9
|
background: transparent;
|
|
10
10
|
z-index: 9999;
|
|
@@ -12,111 +12,145 @@ function n() {
|
|
|
12
12
|
touch-action: none;
|
|
13
13
|
opacity: 0;
|
|
14
14
|
}
|
|
15
|
-
.${
|
|
15
|
+
.${t}::after {
|
|
16
16
|
content: '';
|
|
17
17
|
display:block;
|
|
18
18
|
width:100%;
|
|
19
19
|
height:100%;
|
|
20
20
|
border-radius:2px;
|
|
21
|
-
background:
|
|
21
|
+
background-color:rgb(168, 149, 255);
|
|
22
22
|
}
|
|
23
|
-
.${
|
|
24
|
-
|
|
25
|
-
.${e}.corner { cursor: nwse-resize; }
|
|
26
|
-
`, document.head.appendChild(n);
|
|
23
|
+
.${t}.is-visible:hover{
|
|
24
|
+
opacity: 1;
|
|
27
25
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
.${t}.hr { cursor: ew-resize; }
|
|
27
|
+
.${t}.vr { cursor: ns-resize; }
|
|
28
|
+
.${t}.corner { cursor: nwse-resize; }
|
|
29
|
+
`, document.head.appendChild(e);
|
|
30
|
+
}
|
|
31
|
+
function i(t, n, r) {
|
|
32
|
+
let i = 0, a = 0;
|
|
33
|
+
switch (t) {
|
|
31
34
|
case "hr":
|
|
32
|
-
|
|
35
|
+
i = e, a = r.height - e * 2;
|
|
33
36
|
break;
|
|
34
37
|
case "vr":
|
|
35
|
-
|
|
38
|
+
i = r.width - e * 2, a = e;
|
|
36
39
|
break;
|
|
37
|
-
case "corner":
|
|
40
|
+
case "corner": i = e * 2, a = e * 2;
|
|
38
41
|
}
|
|
39
|
-
return
|
|
42
|
+
return n.style.width = `${i}px`, n.style.height = `${a}px`, n;
|
|
40
43
|
}
|
|
41
|
-
function
|
|
42
|
-
let
|
|
43
|
-
return
|
|
44
|
+
function a(e, n, r) {
|
|
45
|
+
let a = document.createElement("div"), o = n.getBoundingClientRect();
|
|
46
|
+
return a.className = `${t} ${e}`, r.showHandlers && a.classList.add("is-visible"), i(e, a, o);
|
|
44
47
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
48
|
+
function o(t, n, r) {
|
|
49
|
+
let a = e / 2;
|
|
50
|
+
switch (n) {
|
|
47
51
|
case "left":
|
|
48
|
-
|
|
52
|
+
t.style.left = `${-a}px`, t.style.top = `${e}px`, i("hr", t, r);
|
|
49
53
|
break;
|
|
50
54
|
case "right":
|
|
51
|
-
|
|
55
|
+
t.style.left = `${r.width - a}px`, t.style.top = `${e}px`, i("hr", t, r);
|
|
52
56
|
break;
|
|
53
57
|
case "top":
|
|
54
|
-
|
|
58
|
+
t.style.left = `${e}px`, t.style.top = `${-a}px`, i("vr", t, r);
|
|
55
59
|
break;
|
|
56
60
|
case "bottom":
|
|
57
|
-
|
|
61
|
+
t.style.left = `${e}px`, t.style.top = `${r.height - a}px`, i("vr", t, r);
|
|
58
62
|
break;
|
|
59
|
-
case "bottom-right":
|
|
63
|
+
case "bottom-right": t.style.left = `${r.width - a}px`, t.style.top = `${r.height - a}px`;
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
|
-
function
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
function s(t, n) {
|
|
67
|
+
var i, s, c;
|
|
68
|
+
let l = Object.assign({}, {
|
|
69
|
+
left: !0,
|
|
70
|
+
right: !0,
|
|
71
|
+
top: !0,
|
|
72
|
+
bottom: !0,
|
|
73
|
+
bottomRight: !0,
|
|
74
|
+
handleSize: 4,
|
|
75
|
+
showHandlers: !1
|
|
76
|
+
}, n);
|
|
77
|
+
r(), e = (i = l == null ? void 0 : l.handleSize) == null ? e : i;
|
|
78
|
+
let { width: u } = t.getBoundingClientRect();
|
|
79
|
+
getComputedStyle(t).position === "static" && (t.style.position = "relative"), t.style.boxSizing = t.style.boxSizing || "border-box", l != null && l.maxWidth && u > l.maxWidth && (t.style.width = `${l.maxWidth}px`);
|
|
80
|
+
let d = {
|
|
66
81
|
startX: 0,
|
|
67
82
|
startY: 0,
|
|
68
83
|
startW: 0,
|
|
69
84
|
startH: 0,
|
|
70
85
|
startL: 0,
|
|
71
86
|
startT: 0,
|
|
72
|
-
minW: (
|
|
73
|
-
minH: (
|
|
74
|
-
maxW:
|
|
75
|
-
maxH:
|
|
87
|
+
minW: (s = l == null ? void 0 : l.minWidth) == null ? 0 : s,
|
|
88
|
+
minH: (c = l == null ? void 0 : l.minHeight) == null ? 0 : c,
|
|
89
|
+
maxW: l == null ? void 0 : l.maxWidth,
|
|
90
|
+
maxH: l == null ? void 0 : l.maxHeight,
|
|
76
91
|
handlers: []
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
92
|
+
};
|
|
93
|
+
if (l != null && l.left) {
|
|
94
|
+
let e = a("hr", t, l);
|
|
95
|
+
e.dataset.side = "left", t.appendChild(e), d.handlers.push(e);
|
|
96
|
+
}
|
|
97
|
+
if (l != null && l.right) {
|
|
98
|
+
let e = a("hr", t, l);
|
|
99
|
+
e.dataset.side = "right", t.appendChild(e), d.handlers.push(e);
|
|
100
|
+
}
|
|
101
|
+
if (l != null && l.top) {
|
|
102
|
+
let e = a("vr", t, l);
|
|
103
|
+
e.dataset.side = "top", t.appendChild(e), d.handlers.push(e);
|
|
104
|
+
}
|
|
105
|
+
if (l != null && l.bottom) {
|
|
106
|
+
let e = a("vr", t, l);
|
|
107
|
+
e.dataset.side = "bottom", t.appendChild(e), d.handlers.push(e);
|
|
108
|
+
}
|
|
109
|
+
if (l != null && l.bottomRight) {
|
|
110
|
+
let e = a("corner", t, l);
|
|
111
|
+
e.dataset.side = "bottom-right", t.appendChild(e), d.handlers.push(e);
|
|
112
|
+
}
|
|
113
|
+
let f = (e) => {
|
|
80
114
|
var n, r, i;
|
|
81
|
-
let a =
|
|
115
|
+
let a = e.target;
|
|
82
116
|
if (!a || !((n = a.dataset) != null && n.side)) return;
|
|
83
117
|
let o = a.dataset.side;
|
|
84
|
-
(r = (i =
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
let
|
|
88
|
-
|
|
89
|
-
},
|
|
118
|
+
(r = (i = e.target).setPointerCapture) == null || r.call(i, e.pointerId), d.side = o, d.pointerId = e.pointerId;
|
|
119
|
+
let s = t.getBoundingClientRect();
|
|
120
|
+
d.startX = e.clientX, d.startY = e.clientY, d.startW = s.width, d.startH = s.height;
|
|
121
|
+
let c = getComputedStyle(t), l = parseFloat(c.left || "0"), u = parseFloat(c.top || "0");
|
|
122
|
+
d.startL = l, d.startT = u, d.onMove = (e) => p(e, t, d), d.onUp = (e) => m(e, t, d), window.addEventListener("pointermove", d.onMove), window.addEventListener("pointerup", d.onUp), window.addEventListener("pointercancel", d.onUp), e.preventDefault();
|
|
123
|
+
}, p = (e, t, n) => {
|
|
90
124
|
if (n.side === void 0) return;
|
|
91
|
-
let r = e.clientX - n.startX, i = e.clientY - n.startY,
|
|
92
|
-
n.side === "right" ? (
|
|
125
|
+
let r = e.clientX - n.startX, i = e.clientY - n.startY, a = n.startW, s = n.startH, c = n.startL, l = n.startT;
|
|
126
|
+
n.side === "right" ? (a = Math.max(n.minW, n.startW + r), n.maxW && (a = Math.min(a, n.maxW))) : n.side === "left" ? (a = Math.max(n.minW, n.startW - r), n.maxW && (a = Math.min(a, n.maxW)), c = n.startL + (n.startW - a)) : n.side === "bottom" ? (s = Math.max(n.minH, n.startH + i), n.maxH && (s = Math.min(s, n.maxH))) : n.side === "top" ? (s = Math.max(n.minH, n.startH - i), n.maxH && (s = Math.min(s, n.maxH)), l = n.startT + (n.startH - s)) : n.side === "bottom-right" && (a = Math.max(n.minW, n.startW + r), s = Math.max(n.minH, n.startH + i), n.maxW && (a = Math.min(a, n.maxW)), n.maxH && (s = Math.min(s, n.maxH))), t.style.width = `${a}px`, t.style.height = `${s}px`;
|
|
93
127
|
let u = getComputedStyle(t).position;
|
|
94
128
|
(u === "absolute" || u === "relative" || u === "fixed") && (t.style.left = `${c}px`, t.style.top = `${l}px`);
|
|
95
129
|
let d = t.getBoundingClientRect();
|
|
96
130
|
n.handlers.forEach((e) => {
|
|
97
131
|
let t = e.dataset.side;
|
|
98
|
-
|
|
132
|
+
o(e, t, d);
|
|
99
133
|
}), e.preventDefault();
|
|
100
|
-
},
|
|
134
|
+
}, m = (e, t, n) => {
|
|
101
135
|
n.onMove && (window.removeEventListener("pointermove", n.onMove), window.removeEventListener("pointerup", n.onUp), window.removeEventListener("pointercancel", n.onUp)), n.side = void 0, n.pointerId = void 0;
|
|
102
|
-
},
|
|
103
|
-
let
|
|
104
|
-
|
|
105
|
-
let n =
|
|
106
|
-
|
|
136
|
+
}, h = () => {
|
|
137
|
+
let e = t.getBoundingClientRect();
|
|
138
|
+
d.handlers.forEach((t) => {
|
|
139
|
+
let n = t.dataset.side;
|
|
140
|
+
t.style.position = "absolute", t.style.boxSizing = "content-box", o(t, n, e);
|
|
107
141
|
});
|
|
108
142
|
};
|
|
109
|
-
|
|
110
|
-
let
|
|
111
|
-
return
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}),
|
|
143
|
+
d.handlers.forEach((e) => e.addEventListener("pointerdown", f));
|
|
144
|
+
let g = new ResizeObserver(h);
|
|
145
|
+
return g.observe(t), d.ro = g, h(), { destroy: () => {
|
|
146
|
+
d.handlers.forEach((e) => {
|
|
147
|
+
e.removeEventListener("pointerdown", f), e.parentElement === t && t.removeChild(e);
|
|
148
|
+
}), d.onMove && (window.removeEventListener("pointermove", d.onMove), window.removeEventListener("pointerup", d.onUp), window.removeEventListener("pointercancel", d.onUp)), d.ro && d.ro.disconnect();
|
|
115
149
|
} };
|
|
116
150
|
}
|
|
117
|
-
var
|
|
151
|
+
var c = {
|
|
118
152
|
mounted(e, t) {
|
|
119
|
-
let n = t.value, { destroy: r } =
|
|
153
|
+
let n = t.value, { destroy: r } = s(e, n);
|
|
120
154
|
e.__v_resizable_cleanup = r;
|
|
121
155
|
},
|
|
122
156
|
beforeUnmount(e) {
|
|
@@ -124,9 +158,8 @@ var s = {
|
|
|
124
158
|
t && (t(), delete e.__v_resizable_cleanup);
|
|
125
159
|
}
|
|
126
160
|
};
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
-
return n;
|
|
161
|
+
function l(e, t) {
|
|
162
|
+
return s(e, t);
|
|
130
163
|
}
|
|
131
164
|
//#endregion
|
|
132
|
-
export {
|
|
165
|
+
export { l as applyResizable, c as vResizable };
|
package/es/index.d.ts
CHANGED
|
@@ -2148,6 +2148,67 @@ declare const _default: {
|
|
|
2148
2148
|
useMenuEmits(emits: EmitFn<components.MenuEmits>): {
|
|
2149
2149
|
select: (value: any, item: components.MenuOption) => void;
|
|
2150
2150
|
};
|
|
2151
|
+
ReEllipsisMenu: {
|
|
2152
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<components.EllipsisMenuProps> & Readonly<{
|
|
2153
|
+
onUpdated?: ((args_0: {
|
|
2154
|
+
showMore: boolean;
|
|
2155
|
+
moreSlots: VNode[];
|
|
2156
|
+
splitIndex: number;
|
|
2157
|
+
}) => any) | undefined;
|
|
2158
|
+
}>, {
|
|
2159
|
+
wrapper: Readonly< ShallowRef<HTMLElement | null>>;
|
|
2160
|
+
moreRef: Readonly< ShallowRef<HTMLElement | null>>;
|
|
2161
|
+
update: () => Promise<void>;
|
|
2162
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
2163
|
+
updated: (args_0: {
|
|
2164
|
+
showMore: boolean;
|
|
2165
|
+
moreSlots: VNode[];
|
|
2166
|
+
splitIndex: number;
|
|
2167
|
+
}) => any;
|
|
2168
|
+
}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
2169
|
+
P: {};
|
|
2170
|
+
B: {};
|
|
2171
|
+
D: {};
|
|
2172
|
+
C: {};
|
|
2173
|
+
M: {};
|
|
2174
|
+
Defaults: {};
|
|
2175
|
+
}, Readonly<components.EllipsisMenuProps> & Readonly<{
|
|
2176
|
+
onUpdated?: ((args_0: {
|
|
2177
|
+
showMore: boolean;
|
|
2178
|
+
moreSlots: VNode[];
|
|
2179
|
+
splitIndex: number;
|
|
2180
|
+
}) => any) | undefined;
|
|
2181
|
+
}>, {
|
|
2182
|
+
wrapper: Readonly< ShallowRef<HTMLElement | null>>;
|
|
2183
|
+
moreRef: Readonly< ShallowRef<HTMLElement | null>>;
|
|
2184
|
+
update: () => Promise<void>;
|
|
2185
|
+
}, {}, {}, {}, {}>;
|
|
2186
|
+
__isFragment?: never;
|
|
2187
|
+
__isTeleport?: never;
|
|
2188
|
+
__isSuspense?: never;
|
|
2189
|
+
} & ComponentOptionsBase<Readonly<components.EllipsisMenuProps> & Readonly<{
|
|
2190
|
+
onUpdated?: ((args_0: {
|
|
2191
|
+
showMore: boolean;
|
|
2192
|
+
moreSlots: VNode[];
|
|
2193
|
+
splitIndex: number;
|
|
2194
|
+
}) => any) | undefined;
|
|
2195
|
+
}>, {
|
|
2196
|
+
wrapper: Readonly< ShallowRef<HTMLElement | null>>;
|
|
2197
|
+
moreRef: Readonly< ShallowRef<HTMLElement | null>>;
|
|
2198
|
+
update: () => Promise<void>;
|
|
2199
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
2200
|
+
updated: (args_0: {
|
|
2201
|
+
showMore: boolean;
|
|
2202
|
+
moreSlots: VNode[];
|
|
2203
|
+
splitIndex: number;
|
|
2204
|
+
}) => any;
|
|
2205
|
+
}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
2206
|
+
$slots: {
|
|
2207
|
+
default?: (props: {}) => any;
|
|
2208
|
+
} & {
|
|
2209
|
+
icon?: (props: {}) => any;
|
|
2210
|
+
};
|
|
2211
|
+
});
|
|
2151
2212
|
install: (app: App) => void;
|
|
2152
2213
|
version: string;
|
|
2153
2214
|
};
|