rappel-ui 1.0.41 → 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/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 +13 -10
- 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
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { CreateComponentPublicInstanceWithMixins, VNode, ShallowRef, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps } from 'vue';
|
|
2
|
+
import { EllipsisMenuProps } from './index.ts';
|
|
3
|
+
export * from './src/types.ts';
|
|
4
|
+
export declare const ReEllipsisMenu: {
|
|
5
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< EllipsisMenuProps> & Readonly<{
|
|
6
|
+
onUpdated?: ((args_0: {
|
|
7
|
+
showMore: boolean;
|
|
8
|
+
moreSlots: VNode[];
|
|
9
|
+
splitIndex: number;
|
|
10
|
+
}) => any) | undefined;
|
|
11
|
+
}>, {
|
|
12
|
+
wrapper: Readonly< ShallowRef<HTMLElement | null>>;
|
|
13
|
+
moreRef: Readonly< ShallowRef<HTMLElement | null>>;
|
|
14
|
+
update: () => Promise<void>;
|
|
15
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
16
|
+
updated: (args_0: {
|
|
17
|
+
showMore: boolean;
|
|
18
|
+
moreSlots: VNode[];
|
|
19
|
+
splitIndex: number;
|
|
20
|
+
}) => any;
|
|
21
|
+
}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
22
|
+
P: {};
|
|
23
|
+
B: {};
|
|
24
|
+
D: {};
|
|
25
|
+
C: {};
|
|
26
|
+
M: {};
|
|
27
|
+
Defaults: {};
|
|
28
|
+
}, Readonly< EllipsisMenuProps> & Readonly<{
|
|
29
|
+
onUpdated?: ((args_0: {
|
|
30
|
+
showMore: boolean;
|
|
31
|
+
moreSlots: VNode[];
|
|
32
|
+
splitIndex: number;
|
|
33
|
+
}) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
wrapper: Readonly< ShallowRef<HTMLElement | null>>;
|
|
36
|
+
moreRef: Readonly< ShallowRef<HTMLElement | null>>;
|
|
37
|
+
update: () => Promise<void>;
|
|
38
|
+
}, {}, {}, {}, {}>;
|
|
39
|
+
__isFragment?: never;
|
|
40
|
+
__isTeleport?: never;
|
|
41
|
+
__isSuspense?: never;
|
|
42
|
+
} & ComponentOptionsBase<Readonly< EllipsisMenuProps> & Readonly<{
|
|
43
|
+
onUpdated?: ((args_0: {
|
|
44
|
+
showMore: boolean;
|
|
45
|
+
moreSlots: VNode[];
|
|
46
|
+
splitIndex: number;
|
|
47
|
+
}) => any) | undefined;
|
|
48
|
+
}>, {
|
|
49
|
+
wrapper: Readonly< ShallowRef<HTMLElement | null>>;
|
|
50
|
+
moreRef: Readonly< ShallowRef<HTMLElement | null>>;
|
|
51
|
+
update: () => Promise<void>;
|
|
52
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
53
|
+
updated: (args_0: {
|
|
54
|
+
showMore: boolean;
|
|
55
|
+
moreSlots: VNode[];
|
|
56
|
+
splitIndex: number;
|
|
57
|
+
}) => any;
|
|
58
|
+
}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
59
|
+
$slots: {
|
|
60
|
+
default?: (props: {}) => any;
|
|
61
|
+
} & {
|
|
62
|
+
icon?: (props: {}) => any;
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
export default ReEllipsisMenu;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { withInstall as e } from "../../utils/vue/index.mjs";
|
|
2
|
+
import "../../utils/index.mjs";
|
|
3
|
+
import t from "./src/ellipsis-menu.mjs";
|
|
4
|
+
//#region packages/components/ellipsis-menu/index.ts
|
|
5
|
+
var n = e(t);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as ReEllipsisMenu, n as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { VNode, DefineComponent, ShallowRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { EllipsisMenuProps } from './types';
|
|
3
|
+
declare var __VLS_1: {}, __VLS_9: {};
|
|
4
|
+
type __VLS_Slots = {} & {
|
|
5
|
+
default?: (props: typeof __VLS_1) => any;
|
|
6
|
+
} & {
|
|
7
|
+
icon?: (props: typeof __VLS_9) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: DefineComponent<EllipsisMenuProps, {
|
|
10
|
+
wrapper: Readonly< ShallowRef<HTMLElement | null>>;
|
|
11
|
+
moreRef: Readonly< ShallowRef<HTMLElement | null>>;
|
|
12
|
+
update: () => Promise<void>;
|
|
13
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
14
|
+
updated: (args_0: {
|
|
15
|
+
showMore: boolean;
|
|
16
|
+
moreSlots: VNode[];
|
|
17
|
+
splitIndex: number;
|
|
18
|
+
}) => any;
|
|
19
|
+
}, string, PublicProps, Readonly<EllipsisMenuProps> & Readonly<{
|
|
20
|
+
onUpdated?: ((args_0: {
|
|
21
|
+
showMore: boolean;
|
|
22
|
+
moreSlots: VNode[];
|
|
23
|
+
splitIndex: number;
|
|
24
|
+
}) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { useNamespace as e } from "../../../composables/use-namespace/index.mjs";
|
|
2
|
+
import { useSlotNodes as t } from "../../../composables/use-slot-nodes/index.mjs";
|
|
3
|
+
import "../../../composables/index.mjs";
|
|
4
|
+
import { ReDropdown as n, ReDropdownItem as r, ReDropdownMenu as i } from "../../dropdown/index.mjs";
|
|
5
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, nextTick as p, normalizeClass as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as b, resolveDynamicComponent as x, unref as S, useSlots as C, useTemplateRef as w, watch as T, withCtx as E } from "vue";
|
|
6
|
+
import { useDebounceFn as D, useElementSize as O } from "@vueuse/core";
|
|
7
|
+
import { MoreDotCircleHorizontal as k } from "@rappel-ui/svg-icons";
|
|
8
|
+
//#region packages/components/ellipsis-menu/src/ellipsis-menu.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var A = f({
|
|
10
|
+
__name: "ellipsis-menu",
|
|
11
|
+
props: {
|
|
12
|
+
icon: { default: () => k },
|
|
13
|
+
trigger: { default: "hover" },
|
|
14
|
+
placement: { default: "bottom-end" },
|
|
15
|
+
debounce: { default: 150 },
|
|
16
|
+
showArrow: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !0
|
|
19
|
+
},
|
|
20
|
+
offset: { default: 10 },
|
|
21
|
+
gap: { default: 0 },
|
|
22
|
+
floatingClass: {}
|
|
23
|
+
},
|
|
24
|
+
emits: ["updated"],
|
|
25
|
+
setup(f, { expose: k, emit: A }) {
|
|
26
|
+
var j;
|
|
27
|
+
let M = A, { n: N, ns: P, nm: F } = e("ellipsis-menu"), I = w("wrapper"), L = w("moreRef"), R = v([]), z = v(!1), B = o(() => [N()]), V = o(() => [F("dropdown"), f.floatingClass]), H = C(), U = () => {
|
|
28
|
+
let e = I.value;
|
|
29
|
+
return e ? e.scrollWidth > e.clientWidth : !1;
|
|
30
|
+
}, W = () => {
|
|
31
|
+
let e = L.value, t = I.value;
|
|
32
|
+
if (!e || !t) return -1;
|
|
33
|
+
let n = t.offsetWidth, r = Array.from(t.children), i = e.offsetWidth;
|
|
34
|
+
return r.findIndex((e) => {
|
|
35
|
+
let t = getComputedStyle(e);
|
|
36
|
+
return i += e.offsetWidth + f.gap + parseFloat(t.marginLeft) + parseFloat(t.marginRight), i - f.gap > n;
|
|
37
|
+
});
|
|
38
|
+
}, G = (e, n) => {
|
|
39
|
+
var r;
|
|
40
|
+
let i = t(e), a = i == null ? [] : i, o = (r = a == null ? void 0 : a.length) == null ? 0 : r;
|
|
41
|
+
for (let e = n; e < o; e++) {
|
|
42
|
+
var s;
|
|
43
|
+
(s = I.value) == null || s.children[e].setAttribute("is-hidden", "true");
|
|
44
|
+
}
|
|
45
|
+
R.value = a.slice(n);
|
|
46
|
+
}, K = async () => {
|
|
47
|
+
if (z.value = !1, I.value) {
|
|
48
|
+
if (I.value.querySelectorAll("[is-hidden=\"true\"]").forEach((e) => {
|
|
49
|
+
e.removeAttribute("is-hidden");
|
|
50
|
+
}), await p(), U()) {
|
|
51
|
+
z.value = !0, await p();
|
|
52
|
+
let e = W();
|
|
53
|
+
if (e === -1) return;
|
|
54
|
+
G(H, e), M("updated", {
|
|
55
|
+
showMore: z.value,
|
|
56
|
+
moreSlots: R.value,
|
|
57
|
+
splitIndex: e
|
|
58
|
+
});
|
|
59
|
+
} else z.value = !1, R.value = [], M("updated", {
|
|
60
|
+
showMore: z.value,
|
|
61
|
+
moreSlots: R.value,
|
|
62
|
+
splitIndex: -1
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}, q = D(K, (j = f.debounce) == null ? 0 : j), J = () => {
|
|
66
|
+
let e = [], { width: t, stop: n } = O(I), { stop: r } = T(t, q);
|
|
67
|
+
return e.push(n, r), { cleanup: () => {
|
|
68
|
+
e.forEach((e) => e());
|
|
69
|
+
} };
|
|
70
|
+
}, Y = [], X = () => {
|
|
71
|
+
Y.forEach((e) => e());
|
|
72
|
+
}, Z = async () => {
|
|
73
|
+
await K();
|
|
74
|
+
let { cleanup: e } = J(), { stop: t } = T(() => H == null ? void 0 : H.default, q);
|
|
75
|
+
Y.push(e, t);
|
|
76
|
+
};
|
|
77
|
+
return h(() => {
|
|
78
|
+
Z();
|
|
79
|
+
}), g(() => {
|
|
80
|
+
X();
|
|
81
|
+
}), k({
|
|
82
|
+
wrapper: I,
|
|
83
|
+
moreRef: L,
|
|
84
|
+
update: K
|
|
85
|
+
}), (e, t) => (_(), l("div", {
|
|
86
|
+
ref_key: "wrapper",
|
|
87
|
+
ref: I,
|
|
88
|
+
class: m(B.value)
|
|
89
|
+
}, [b(e.$slots, "default"), z.value ? (_(), s(S(n), {
|
|
90
|
+
key: 0,
|
|
91
|
+
trigger: f.trigger,
|
|
92
|
+
placement: f.placement,
|
|
93
|
+
"show-arrow": f.showArrow,
|
|
94
|
+
offset: f.offset,
|
|
95
|
+
"floating-class": V.value
|
|
96
|
+
}, {
|
|
97
|
+
menu: E(() => [d(S(i), null, {
|
|
98
|
+
default: E(() => [(_(!0), l(a, null, y(R.value, (e) => {
|
|
99
|
+
var t, n;
|
|
100
|
+
return _(), s(S(r), {
|
|
101
|
+
key: e == null || (t = e.props) == null ? void 0 : t.value,
|
|
102
|
+
value: e == null || (n = e.props) == null ? void 0 : n.value
|
|
103
|
+
}, {
|
|
104
|
+
default: E(() => [(_(), s(x(e), { key: e.key }))]),
|
|
105
|
+
_: 2
|
|
106
|
+
}, 1032, ["value"]);
|
|
107
|
+
}), 128))]),
|
|
108
|
+
_: 1
|
|
109
|
+
})]),
|
|
110
|
+
default: E(() => [u("span", {
|
|
111
|
+
ref_key: "moreRef",
|
|
112
|
+
ref: L,
|
|
113
|
+
class: m([S(P)("icon")])
|
|
114
|
+
}, [b(e.$slots, "icon", {}, () => [f.icon ? (_(), l(a, { key: 0 }, [typeof f.icon == "string" ? (_(), l("i", {
|
|
115
|
+
key: 0,
|
|
116
|
+
class: m([f.icon]),
|
|
117
|
+
"aria-hidden": "true"
|
|
118
|
+
}, null, 2)) : (_(), s(x(f.icon), {
|
|
119
|
+
key: 1,
|
|
120
|
+
"aria-hidden": "true"
|
|
121
|
+
}))], 64)) : c("", !0)])], 2)]),
|
|
122
|
+
_: 3
|
|
123
|
+
}, 8, [
|
|
124
|
+
"trigger",
|
|
125
|
+
"placement",
|
|
126
|
+
"show-arrow",
|
|
127
|
+
"offset",
|
|
128
|
+
"floating-class"
|
|
129
|
+
])) : c("", !0)], 2));
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
//#endregion
|
|
133
|
+
export { A as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { MaybeClass } from '../../../types';
|
|
3
|
+
import { Placement, Trigger } from '../../tooltip';
|
|
4
|
+
export interface EllipsisMenuProps {
|
|
5
|
+
icon?: string | Component;
|
|
6
|
+
trigger?: Trigger;
|
|
7
|
+
placement?: Placement;
|
|
8
|
+
debounce?: number;
|
|
9
|
+
showArrow?: boolean;
|
|
10
|
+
offset?: number;
|
|
11
|
+
gap?: number;
|
|
12
|
+
floatingClass?: MaybeClass;
|
|
13
|
+
}
|
|
File without changes
|
|
File without changes
|
package/es/components/index.d.ts
CHANGED
package/es/components/index.mjs
CHANGED
|
@@ -21,14 +21,16 @@ import { useDropdownEmits as C } from "./dropdown/src/use-dropdown-emit.mjs";
|
|
|
21
21
|
import { ReDropdown as w, ReDropdownItem as T, ReDropdownMenu as E, ReDropdownSubmenu as D } from "./dropdown/index.mjs";
|
|
22
22
|
import { useMenuEmits as O } from "./menu/src/use-menu-emit.mjs";
|
|
23
23
|
import { ReMenu as k, ReMenuItem as A, ReSubmenu as j } from "./menu/index.mjs";
|
|
24
|
+
import { ReEllipsisMenu as M } from "./ellipsis-menu/index.mjs";
|
|
24
25
|
//#region packages/components/index.ts
|
|
25
|
-
var
|
|
26
|
+
var N = e({
|
|
26
27
|
ReButton: () => a,
|
|
27
28
|
ReButtonGroup: () => o,
|
|
28
29
|
ReDropdown: () => w,
|
|
29
30
|
ReDropdownItem: () => T,
|
|
30
31
|
ReDropdownMenu: () => E,
|
|
31
32
|
ReDropdownSubmenu: () => D,
|
|
33
|
+
ReEllipsisMenu: () => M,
|
|
32
34
|
ReFilterPanel: () => f,
|
|
33
35
|
ReInput: () => s,
|
|
34
36
|
ReMenu: () => k,
|
|
@@ -56,4 +58,4 @@ var M = e({
|
|
|
56
58
|
useTransitionEmits: () => m
|
|
57
59
|
});
|
|
58
60
|
//#endregion
|
|
59
|
-
export { a as ReButton, o as ReButtonGroup, w as ReDropdown, T as ReDropdownItem, E as ReDropdownMenu, D as ReDropdownSubmenu, f as ReFilterPanel, s as ReInput, k as ReMenu, A as ReMenuItem, S as ReMessage, d as ReNeutralColor, b as RePopconfirm, y as RePopover, l as RePrimaryColor, u as ReSecondaryColor, j as ReSubmenu, p as ReSvgIcon, c as ReTabs, _ as ReTooltip, h as ReTransition, t as _buttonGroupProvideKey, n as buttonNativeTypes, r as buttonSizes, i as buttonTypes,
|
|
61
|
+
export { a as ReButton, o as ReButtonGroup, w as ReDropdown, T as ReDropdownItem, E as ReDropdownMenu, D as ReDropdownSubmenu, M as ReEllipsisMenu, f as ReFilterPanel, s as ReInput, k as ReMenu, A as ReMenuItem, S as ReMessage, d as ReNeutralColor, b as RePopconfirm, y as RePopover, l as RePrimaryColor, u as ReSecondaryColor, j as ReSubmenu, p as ReSvgIcon, c as ReTabs, _ as ReTooltip, h as ReTransition, t as _buttonGroupProvideKey, n as buttonNativeTypes, r as buttonSizes, i as buttonTypes, N as components_exports, x as createMessage, C as useDropdownEmits, O as useMenuEmits, v as usePopoverEmits, g as useTooltipEmits, m as useTransitionEmits };
|
|
@@ -3,7 +3,7 @@ import "../../../composables/index.mjs";
|
|
|
3
3
|
import { _menuProvideKey as t } from "./constants.mjs";
|
|
4
4
|
import n from "./menu-item.mjs";
|
|
5
5
|
import r from "./submenu.mjs";
|
|
6
|
-
import { Fragment as i, cloneVNode as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createSlots as u, defineComponent as d, inject as f, mergeProps as p, nextTick as m, onMounted as h, onUnmounted as g, openBlock as _, ref as
|
|
6
|
+
import { Fragment as i, cloneVNode as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createSlots as u, defineComponent as d, inject as f, mergeProps as p, nextTick as m, onMounted as h, onUnmounted as g, openBlock as _, ref as ee, renderList as v, renderSlot as y, resolveDynamicComponent as b, shallowRef as x, unref as S, useSlots as C, useTemplateRef as w, watch as T, withCtx as E } from "vue";
|
|
7
7
|
import { computedAsync as D, useDebounceFn as O, useElementSize as k } from "@vueuse/core";
|
|
8
8
|
import { getAsyncIcon as A } from "@rappel-ui/svg-icons";
|
|
9
9
|
//#region packages/components/menu/src/loop.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -11,7 +11,7 @@ var j = d({
|
|
|
11
11
|
__name: "loop",
|
|
12
12
|
props: { options: { default: () => void 0 } },
|
|
13
13
|
setup(d, { expose: j }) {
|
|
14
|
-
let M = w("loopRef"), N = w("moreRef"), P = x([]), F = x([]), I =
|
|
14
|
+
let M = w("loopRef"), N = w("moreRef"), P = x([]), F = x([]), I = ee([]), { depth: L, hasOptions: R, direction: z, ellipsis: B, ellipsisIcon: V } = f(t), H = o(() => {
|
|
15
15
|
var e;
|
|
16
16
|
return z.value === "horizontal" && B != null && B.value ? P.value : (e = d.options) == null ? [] : e;
|
|
17
17
|
}), U = D(async () => await A(V == null ? void 0 : V.value) || ""), W = x(!1), G = () => {
|
|
@@ -22,7 +22,10 @@ var j = d({
|
|
|
22
22
|
let n = (e = (t = N.value) == null ? void 0 : t.itemRef) == null ? N.value : e, r = M.value;
|
|
23
23
|
if (!n || !r) return -1;
|
|
24
24
|
let i = r.offsetWidth, a = Array.from(r.children), o = n.offsetWidth;
|
|
25
|
-
return a.findIndex((e) =>
|
|
25
|
+
return a.findIndex((e) => {
|
|
26
|
+
let t = getComputedStyle(e);
|
|
27
|
+
return o += e.offsetWidth + parseFloat(t.marginLeft) + parseFloat(t.marginRight), o > i;
|
|
28
|
+
});
|
|
26
29
|
}, J = (e, t) => {
|
|
27
30
|
F.value = e.splice(t, e.length - t);
|
|
28
31
|
}, Y = (t, n) => {
|
|
@@ -35,7 +38,7 @@ var j = d({
|
|
|
35
38
|
I.value = c.slice(n).map((e) => a(e, { "is-more": !0 }));
|
|
36
39
|
}, X = async () => {
|
|
37
40
|
var e;
|
|
38
|
-
if (P.value = [...(e = d.options) == null ? [] : e], L.value === 0 && z.value !== "vertical" && B.value) {
|
|
41
|
+
if (W.value = !1, P.value = [...(e = d.options) == null ? [] : e], L.value === 0 && z.value !== "vertical" && B.value) {
|
|
39
42
|
if (!R.value && M.value && M.value.querySelectorAll("li[is-hidden=\"true\"]").forEach((e) => {
|
|
40
43
|
e.setAttribute("is-hidden", "false");
|
|
41
44
|
}), await m(), G()) {
|
|
@@ -48,7 +51,7 @@ var j = d({
|
|
|
48
51
|
}, Z = O(X, 100), Q = () => {
|
|
49
52
|
let e = [];
|
|
50
53
|
if (B.value) {
|
|
51
|
-
let { width: t, stop: n } = k(M
|
|
54
|
+
let { width: t, stop: n } = k(M), { stop: r } = T(t, () => {
|
|
52
55
|
Z();
|
|
53
56
|
});
|
|
54
57
|
e.push(n, r);
|
|
@@ -61,8 +64,8 @@ var j = d({
|
|
|
61
64
|
}, ne = async () => {
|
|
62
65
|
if (B.value) {
|
|
63
66
|
await X();
|
|
64
|
-
let { cleanup: e } = Q();
|
|
65
|
-
$.push(e);
|
|
67
|
+
let { cleanup: e } = Q(), { stop: t } = T(() => K == null ? void 0 : K.default, Z);
|
|
68
|
+
$.push(e, t);
|
|
66
69
|
}
|
|
67
70
|
};
|
|
68
71
|
return h(() => {
|
|
@@ -75,7 +78,7 @@ var j = d({
|
|
|
75
78
|
}), (e, t) => (_(), l("ul", {
|
|
76
79
|
ref_key: "loopRef",
|
|
77
80
|
ref: M
|
|
78
|
-
}, [
|
|
81
|
+
}, [y(e.$slots, "default", {}, () => [(_(!0), l(i, null, v(H.value, (t) => {
|
|
79
82
|
var a;
|
|
80
83
|
return _(), l(i, { key: typeof t.value == "boolean" ? t.label : t.value }, [t != null && (a = t.children) != null && a.length ? (_(), s(r, {
|
|
81
84
|
key: 0,
|
|
@@ -98,11 +101,11 @@ var j = d({
|
|
|
98
101
|
class: "is-more",
|
|
99
102
|
icon: S(U)
|
|
100
103
|
}, u({
|
|
101
|
-
icon: E(() => [
|
|
104
|
+
icon: E(() => [y(e.$slots, "ellipsis-icon")]),
|
|
102
105
|
_: 2
|
|
103
106
|
}, [S(R) ? void 0 : {
|
|
104
107
|
name: "item-submenu",
|
|
105
|
-
fn: E(() => [(_(!0), l(i, null,
|
|
108
|
+
fn: E(() => [(_(!0), l(i, null, v(I.value, (e) => (_(), s(b(e), { key: e.key }))), 128))]),
|
|
106
109
|
key: "0"
|
|
107
110
|
}]), 1032, ["children", "icon"])) : c("", !0)], 512));
|
|
108
111
|
}
|
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 };
|