@toolmain/components 1.1.0 → 1.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolmain/components",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,10 +27,11 @@
27
27
  "peerDependencies": {
28
28
  "@vueuse/core": "^13.7.0",
29
29
  "unocss": "^66.4.2",
30
- "vue": "^3.5.0"
30
+ "vue": "^3.5.0",
31
+ "vue-router": "^4.5.1"
31
32
  },
32
33
  "dependencies": {
33
- "@toolmain/shared": "^1.1.0",
34
+ "@toolmain/shared": "^1.1.2",
34
35
  "@toolmain/libs": "^1.1.0"
35
36
  },
36
37
  "scripts": {
package/dist/index.d.ts DELETED
@@ -1,242 +0,0 @@
1
- import { ComponentOptionsMixin } from 'vue';
2
- import { ComponentProvideOptions } from 'vue';
3
- import type * as CSS_2 from 'csstype';
4
- import { DefineComponent } from 'vue';
5
- import type { MaybeRef } from 'vue';
6
- import { PublicProps } from 'vue';
7
-
8
- declare const __VLS_component: DefineComponent<__VLS_Props, {
9
- update: () => void;
10
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
11
-
12
- declare const __VLS_component_2: DefineComponent<ScaleProps, ScaleInstance, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
13
- moving: (pos: MoveParams) => any;
14
- scaling: (scaleEl: HTMLElement) => any;
15
- beforeMove: (pos: MoveParams) => any;
16
- afterMove: (pos: MoveParams) => any;
17
- afterScale: (scaleEl: HTMLElement) => any;
18
- maskClick: () => any;
19
- "update:modelValue": (data: ScaleConfig) => any;
20
- }, string, PublicProps, Readonly<ScaleProps> & Readonly<{
21
- onMoving?: ((pos: MoveParams) => any) | undefined;
22
- onScaling?: ((scaleEl: HTMLElement) => any) | undefined;
23
- onBeforeMove?: ((pos: MoveParams) => any) | undefined;
24
- onAfterMove?: ((pos: MoveParams) => any) | undefined;
25
- onAfterScale?: ((scaleEl: HTMLElement) => any) | undefined;
26
- onMaskClick?: (() => any) | undefined;
27
- "onUpdate:modelValue"?: ((data: ScaleConfig) => any) | undefined;
28
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
29
-
30
- declare type __VLS_Props = {
31
- /**
32
- * 选择top时,如果元素滚动到[底部]消失或即将消失,会回到原位置
33
- *
34
- * 选择bottom时则是滚动到[顶部]时触发
35
- */
36
- position?: "top" | "bottom";
37
- target?: string;
38
- offset?: number;
39
- };
40
-
41
- declare type __VLS_Slots = {} & {
42
- default?: (props: typeof __VLS_1) => any;
43
- };
44
-
45
- declare type __VLS_Slots_2 = {} & {
46
- header?: (props: typeof __VLS_1) => any;
47
- } & {
48
- default?: (props: typeof __VLS_7) => any;
49
- };
50
-
51
- declare type __VLS_WithSlots<T, S> = T & {
52
- new (): {
53
- $slots: S;
54
- };
55
- };
56
-
57
- declare type __VLS_WithSlots_2<T, S> = T & {
58
- new (): {
59
- $slots: S;
60
- };
61
- };
62
-
63
- export declare const Affix: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
64
-
65
- declare type AnimateDir = "left" | "top" | "bottom" | "right" | "self" | "center" | {
66
- x?: number;
67
- y?: number;
68
- };
69
-
70
- declare type ArrMutKeys = "splice" | "push" | "pop" | "shift" | "unshift";
71
-
72
- declare interface CSSProperties extends CSS_2.Properties<string | number>, CSS_2.PropertiesHyphen<string | number> {
73
- [v: `--${string}`]: string | number | undefined;
74
- }
75
-
76
- declare type Dir = "horizontal" | "vertical" | "any";
77
-
78
- declare interface DragAttr {
79
- /**
80
- * 元素x轴坐标
81
- */
82
- x: number;
83
- /**
84
- * 元素y轴坐标
85
- */
86
- y: number;
87
- /**
88
- * 指针x坐标
89
- */
90
- clientX: number;
91
- /**
92
- * 指针y坐标
93
- */
94
- clientY: number;
95
- width: number | InitType;
96
- height: number | InitType;
97
- }
98
-
99
- /**
100
- * 定长数组类型
101
- */
102
- declare type FixedArray<T, L extends number> = Pick<T[], Exclude<keyof T[], ArrMutKeys>> & {
103
- readonly length: L;
104
- };
105
-
106
- declare type InitType = "auto" | "inherit" | "initial" | "unset";
107
-
108
- declare interface MoveHook {
109
- x?: (oldVal: number, newVal: number, width: number, height: number) => number;
110
- y?: (oldVal: number, newVal: number, width: number, height: number) => number;
111
- scale?: (oldVal: FixedArray<number, 2>, newVal: FixedArray<number, 2>) => [FixedArray<number, 2>, FixedArray<number, 2>];
112
- }
113
-
114
- declare interface MoveOptions {
115
- /**
116
- * 移动方向
117
- */
118
- direction?: Dir;
119
- }
120
-
121
- declare type MoveParams = DragAttr & {
122
- translateX: number;
123
- translateY: number;
124
- };
125
-
126
- declare interface ScaleConfig {
127
- /**
128
- * 组件可改变尺寸
129
- */
130
- scalable?: boolean;
131
- /**
132
- * 组件可移动
133
- */
134
- movable?: boolean;
135
- /**
136
- * 变成正常元素
137
- */
138
- normal?: boolean;
139
- /**
140
- * 拖动后自动靠边
141
- */
142
- autoStick?: boolean | AnimateDir;
143
- /**
144
- * 是否显示
145
- */
146
- visible?: boolean;
147
- /**
148
- * 初始移动位置 `translateX`
149
- */
150
- x?: number;
151
- /**
152
- * 初始移动位置 `translateY`
153
- */
154
- y?: number;
155
- /**
156
- * 是否拥有头部
157
- */
158
- header?: boolean;
159
- /**
160
- * 当组件`position`不为`fixed`时
161
- * 是否相对于window定位,否则相对于父元素定位
162
- *
163
- * @default false
164
- */
165
- attachWindow?: boolean;
166
- /**
167
- * 移动功能的配置项
168
- */
169
- moveConfig?: MoveOptions;
170
- /**
171
- * 外壳样式
172
- */
173
- containerStyle?: CSSProperties;
174
- /**
175
- * 内容样式,初始宽高应该在这里设置
176
- */
177
- contentStyle?: CSSProperties;
178
- /**
179
- * 头部样式
180
- */
181
- headerStyle?: CSSProperties;
182
- /**
183
- * 是否显示遮罩层
184
- */
185
- mask?: boolean;
186
- /**
187
- * 遮罩层样式
188
- */
189
- maskStyle?: CSSProperties;
190
- }
191
-
192
- declare interface ScaleInstance {
193
- /**
194
- * 智能移动到屏幕边界
195
- * @param animate - 是否有动画效果 default: true
196
- */
197
- autoStick: (animate: boolean) => Promise<void>;
198
- /**
199
- * 自动隐藏
200
- * @param animate - 是否有动画效果 default: true
201
- */
202
- autoHide: (animate: boolean) => Promise<void>;
203
- /**
204
- * 移动到屏幕边界
205
- * @param animate - 是否有动画效果 default: true
206
- */
207
- stickTo: (dir: AnimateDir, animate: boolean) => Promise<void>;
208
- /**
209
- * 移动到屏幕 `dir`位置并隐藏
210
- * @param animate - 是否有动画效果 default: true
211
- */
212
- hideTo: (dir: AnimateDir, animate: boolean) => Promise<void>;
213
- /**
214
- * 显示组件
215
- */
216
- show: (animate: boolean, dir?: AnimateDir) => Promise<void>;
217
- /**
218
- * 当组件`position:fixed`或者`attachWindow:true`时坐标相对于屏幕左上角;否则相对于父元素
219
- */
220
- moveTo: (animate: boolean, dir: AnimateDir, hooks?: MoveHook) => Promise<void>;
221
- /**
222
- * 获取当前状态
223
- */
224
- getStatus: () => Status | undefined;
225
- }
226
-
227
- export declare const ScalePanel: __VLS_WithSlots_2<typeof __VLS_component_2, __VLS_Slots_2>;
228
-
229
- declare interface ScaleProps {
230
- modelValue: ScaleConfig;
231
- /**
232
- * 按下目标元素并拖动组件,默认按下头部拖动。
233
- */
234
- dragTarget?: MaybeRef<HTMLElement | null | undefined>;
235
- }
236
-
237
- declare enum Status {
238
- NORMAL = "NORMAL",
239
- HIDDEN = "HIDDEN"
240
- }
241
-
242
- export { }
package/dist/index.js DELETED
@@ -1,879 +0,0 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}[top~="0"]{top:0}.hidden{display:none}.flex{display:flex}.flex-shrink{flex-shrink:1}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.resize,[resize=""]{resize:both}.px,[px=""]{padding-left:1rem;padding-right:1rem}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.comp-affix .comp-affix-inner[data-v-4c40ccd8]{transition:box-shadow .3s;border-radius:1rem}.comp-affix .comp-affix-inner.fix[data-v-4c40ccd8]{position:fixed;box-shadow:var(--el-box-shadow);background-color:var(--el-card-bg-color)}.p-t[data-v-cb7f9cc6],.p-r[data-v-cb7f9cc6],.p-b[data-v-cb7f9cc6],.p-l[data-v-cb7f9cc6],.p-lt[data-v-cb7f9cc6],.p-rt[data-v-cb7f9cc6],.p-lb[data-v-cb7f9cc6],.p-rb[data-v-cb7f9cc6]{z-index:var(--61c40759);position:absolute}.p-b[data-v-cb7f9cc6],.p-t[data-v-cb7f9cc6],.p-r[data-v-cb7f9cc6],.p-l[data-v-cb7f9cc6]{background-color:transparent;border-radius:4px}.p-b[data-v-cb7f9cc6],.p-t[data-v-cb7f9cc6]{height:4px;left:4px;right:4px}.p-r[data-v-cb7f9cc6],.p-l[data-v-cb7f9cc6]{width:4px;top:4px;bottom:4px}.p-lt[data-v-cb7f9cc6],.p-rt[data-v-cb7f9cc6],.p-lb[data-v-cb7f9cc6],.p-rb[data-v-cb7f9cc6]{width:0;height:0}.p-b[data-v-cb7f9cc6]{bottom:0;cursor:ns-resize}.p-t[data-v-cb7f9cc6]{top:0;cursor:ns-resize}.p-r[data-v-cb7f9cc6]{right:0;cursor:ew-resize}.p-l[data-v-cb7f9cc6]{left:0;cursor:ew-resize}.p-lt[data-v-cb7f9cc6]{left:0;top:0;cursor:nwse-resize;border-top:.4rem solid transparent;border-left:.4rem solid transparent;border-right:.4rem solid transparent;border-bottom:.4rem solid transparent}.p-rt[data-v-cb7f9cc6]{right:0;top:0;cursor:nesw-resize;border-top:.4rem solid transparent;border-left:.4rem solid transparent;border-right:.4rem solid transparent;border-bottom:.4rem solid transparent}.p-lb[data-v-cb7f9cc6]{left:0;bottom:0;cursor:nesw-resize;border-top:.4rem solid transparent;border-left:.4rem solid transparent;border-right:.4rem solid transparent;border-bottom:.4rem solid transparent}.p-rb[data-v-cb7f9cc6]{right:0;bottom:0;cursor:nwse-resize;border-top:.4rem solid transparent;border-left:.4rem solid transparent;border-right:.4rem solid transparent;border-bottom:.4rem solid transparent}.dragContainer[data-v-d123b73c]{display:flex;flex-direction:column;transform-origin:0 0}.dragContainer>.dragHeader[data-v-d123b73c]{flex-shrink:0;display:flex}.dragContainer>.scaleContent[data-v-d123b73c]{flex:1;overflow:hidden;position:relative;display:flex}.dragMask[data-v-d123b73c]{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:100}')),document.head.appendChild(r)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- import { defineComponent as be, useTemplateRef as te, shallowRef as ee, computed as $, reactive as Ae, onMounted as De, onBeforeUnmount as Me, createElementBlock as Q, openBlock as j, normalizeStyle as J, normalizeClass as pe, createElementVNode as Oe, renderSlot as we, useCssVars as ze, createCommentVNode as re, Fragment as Be, renderList as $e, withDirectives as Ve, vShow as We, unref as Pe, ref as Te, toValue as ye, watch as q, toRef as oe, createBlock as Ce, Teleport as Ue } from "vue";
3
- import { px as X, useEvent as ue, z as je, getStyleValue as Se, isBoolean as ke, isNumber as G, toNumber as w, useFlip as Ge, merge as Ke } from "@toolmain/shared";
4
- import { useElementBounding as le, useIntersectionObserver as _e, useThrottleFn as qe, useDebounceFn as Je } from "@vueuse/core";
5
- const ae = 2, Qe = /* @__PURE__ */ be({
6
- __name: "index",
7
- props: {
8
- position: { default: "top" },
9
- target: { default: "" },
10
- offset: { default: 0 }
11
- },
12
- setup(e, { expose: l }) {
13
- const c = te("affix"), s = te("affixInner"), h = ee(), d = ee(), { width: i, height: R } = le(h), T = $(() => !!d.value), y = ee({}), S = ee({}), a = Ae({
14
- disableTeleport: !0,
15
- target: {
16
- isIntersecting: !1,
17
- intersectionRatio: 0,
18
- directions: []
19
- },
20
- affix: {
21
- isIntersecting: !1,
22
- intersectionRatio: 0,
23
- needFloat: !1,
24
- directions: []
25
- }
26
- }), {
27
- x,
28
- y: n,
29
- // width: affixWidth,
30
- height: L,
31
- update: A
32
- } = le(c), m = () => {
33
- if (T.value) {
34
- if (a.target.isIntersecting && (!a.affix.isIntersecting || a.affix.intersectionRatio < 0.5))
35
- return !0;
36
- } else if (!a.affix.isIntersecting || a.affix.intersectionRatio < 0.5)
37
- return !0;
38
- return !1;
39
- }, g = () => {
40
- if (A(), a.affix.needFloat = !1, a.affix.directions.includes(
41
- "left"
42
- /* Left */
43
- ) || a.affix.directions.includes(
44
- "right"
45
- /* Right */
46
- ) || a.target.directions.includes(
47
- "left"
48
- /* Left */
49
- ) || a.target.directions.includes(
50
- "right"
51
- /* Right */
52
- ))
53
- a.affix.needFloat = !1;
54
- else if (m()) {
55
- const C = n.value + L.value / 2 <= window.innerHeight / 2;
56
- a.affix.needFloat = e.position === "top" ? C : !C;
57
- }
58
- a.affix.needFloat ? (y.value = {
59
- zIndex: 100,
60
- left: X(x.value),
61
- [e.position === "bottom" ? "bottom" : "top"]: X(e.offset)
62
- }, S.value = {
63
- minWidth: X(i.value),
64
- height: X(R.value)
65
- }) : (y.value = {}, S.value = {});
66
- };
67
- function P(C, F) {
68
- const { boundingClientRect: z, intersectionRect: V, rootBounds: Z } = C;
69
- Z && C.isIntersecting && (F.length = 0, V.y - z.y > ae && F.push(
70
- "top"
71
- /* Top */
72
- ), z.y - V.y > ae && F.push(
73
- "bottom"
74
- /* Bottom */
75
- ), V.x - z.x > ae && F.push(
76
- "left"
77
- /* Left */
78
- ), z.x + z.width - (V.x + V.width) > ae && F.push(
79
- "right"
80
- /* Right */
81
- ));
82
- }
83
- const N = ([C]) => {
84
- a.affix.isIntersecting = C.isIntersecting, P(C, a.affix.directions), a.affix.intersectionRatio = C.intersectionRatio, g();
85
- }, H = ([C]) => {
86
- a.target.isIntersecting = C.isIntersecting, P(C, a.target.directions), a.target.intersectionRatio = C.intersectionRatio, g();
87
- }, o = _e(c, N, {
88
- root: window.document.documentElement,
89
- threshold: [0, 0.01, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.99, 1]
90
- }), u = _e(d, H, {
91
- root: window.document.documentElement,
92
- threshold: [0, 0.01, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.99, 1]
93
- });
94
- function I() {
95
- h.value = s.value?.firstElementChild, e.target && (d.value = document.querySelector(e.target)), A();
96
- }
97
- const D = qe(g, 250, !0);
98
- return De(() => {
99
- I(), window.addEventListener("resize", D);
100
- }), Me(() => {
101
- window.removeEventListener("resize", D), o.stop(), u.stop();
102
- }), l({
103
- update: () => {
104
- m() && g();
105
- }
106
- }), (C, F) => (j(), Q("div", {
107
- class: pe(["comp-affix", { fix: a.affix.needFloat }]),
108
- style: J(S.value),
109
- ref: "affix"
110
- }, [
111
- Oe("div", {
112
- ref_key: "affixInner",
113
- ref: s,
114
- style: J([y.value, S.value]),
115
- class: pe(["comp-affix-inner", { fix: a.affix.needFloat }])
116
- }, [
117
- we(C.$slots, "default", {}, void 0, !0)
118
- ], 6)
119
- ], 6));
120
- }
121
- }), Ee = (e, l) => {
122
- const c = e.__vccOpts || e;
123
- for (const [s, h] of l)
124
- c[s] = h;
125
- return c;
126
- }, ft = /* @__PURE__ */ Ee(Qe, [["__scopeId", "data-v-4c40ccd8"]]);
127
- function Re() {
128
- return {
129
- x: 0,
130
- y: 0,
131
- clientX: 0,
132
- clientY: 0,
133
- width: 0,
134
- height: 0
135
- };
136
- }
137
- function Le() {
138
- return {
139
- x: 0,
140
- y: 0,
141
- width: 0,
142
- height: 0,
143
- left: 0,
144
- top: 0,
145
- right: 0,
146
- bottom: 0
147
- };
148
- }
149
- const Ze = () => {
150
- let e, l = Le(), c = Re(), s = !1, h = !1;
151
- const d = ue(), i = {
152
- emit: (n, ...L) => {
153
- s || d.emit(n, ...L);
154
- },
155
- setTargetAttr: (n) => {
156
- R(), T({
157
- x: l.x,
158
- y: l.y,
159
- clientX: n.clientX,
160
- clientY: n.clientY,
161
- width: l.width,
162
- height: l.height
163
- });
164
- },
165
- onSelectStart: (n) => h ? (n.preventDefault(), !1) : !0,
166
- onDomPointerUp: (n) => {
167
- if (!s) {
168
- if (!e) {
169
- h = !1;
170
- return;
171
- }
172
- h && i.emit("aftermove", { ...c }), h = !1;
173
- }
174
- },
175
- onDomPointerMove: (n) => {
176
- s || h && (i.setTargetAttr(n), i.emit("moving", { ...c }));
177
- },
178
- onElePointerDown: (n) => {
179
- s || (h = !0, i.setTargetAttr(n), i.emit("beforemove", { ...c }));
180
- },
181
- clearEvent: () => {
182
- document.removeEventListener("selectstart", i.onSelectStart), e?.removeEventListener("pointerdown", i.onElePointerDown), document.removeEventListener("pointerup", i.onDomPointerUp), document.removeEventListener("pointermove", i.onDomPointerMove);
183
- },
184
- listenEvent: () => {
185
- e && (document.addEventListener("selectstart", i.onSelectStart), e.addEventListener("pointerdown", i.onElePointerDown), document.addEventListener("pointerup", i.onDomPointerUp), document.addEventListener("pointermove", i.onDomPointerMove));
186
- }
187
- };
188
- function R() {
189
- l = e?.getBoundingClientRect() ?? Le();
190
- }
191
- function T(n) {
192
- c = { ...n };
193
- }
194
- function y(n) {
195
- i.clearEvent(), e = n, d.removeAllListeners(), T(Re()), R(), i.listenEvent();
196
- }
197
- function S(n, L) {
198
- d.on(n, L);
199
- }
200
- function a() {
201
- s = !0;
202
- }
203
- function x() {
204
- s = !1;
205
- }
206
- return {
207
- ele: e,
208
- rect: l,
209
- attr: c,
210
- updateRect: R,
211
- setAttr: T,
212
- setTarget: y,
213
- on: S,
214
- disable: a,
215
- enable: x
216
- };
217
- };
218
- function et() {
219
- const e = ue();
220
- let l = !1;
221
- const c = {
222
- direction: "any"
223
- }, s = Ze(), h = (m) => {
224
- c.direction === "horizontal" ? (m.clientY = 0, m.y = 0) : c.direction === "vertical" && (m.clientX = 0, m.x = 0);
225
- };
226
- function d(m) {
227
- l = !1, s.setTarget(m), s.on("beforemove", (g) => {
228
- h(g), l = !1, R("beforemove", g);
229
- }), s.on("moving", (g) => {
230
- h(g), l = !0, R("moving", g);
231
- }), s.on("aftermove", (g) => {
232
- h(g), l = !1, R("aftermove", g);
233
- });
234
- }
235
- function i() {
236
- return s.ele;
237
- }
238
- function R(m, g) {
239
- e.emit(m, g);
240
- }
241
- function T(m) {
242
- c.direction = m;
243
- }
244
- function y(m, g) {
245
- e.on(m, g);
246
- }
247
- function S(m, g) {
248
- e.once(m, g);
249
- }
250
- function a(m, g) {
251
- e.removeAllListeners(m), e.on(m, g);
252
- }
253
- function x(m) {
254
- m && Object.assign(c, m);
255
- }
256
- function n() {
257
- s.enable();
258
- }
259
- function L() {
260
- s.disable();
261
- }
262
- function A() {
263
- return l;
264
- }
265
- return {
266
- every: a,
267
- setTarget: d,
268
- getTarget: i,
269
- setDirection: T,
270
- isMoving: A,
271
- on: y,
272
- once: S,
273
- updateOption: x,
274
- enable: n,
275
- disable: L
276
- };
277
- }
278
- const tt = ["onMousedown"], nt = /* @__PURE__ */ be({
279
- __name: "resize",
280
- props: {
281
- config: {},
282
- scale: {},
283
- handle: {},
284
- move: {}
285
- },
286
- setup(e) {
287
- ze((s) => ({
288
- "61c40759": c.value
289
- }));
290
- const l = e, c = $(() => l.config.normal ? void 0 : je.ABSOLUTE);
291
- return (s, h) => s.scale ? (j(!0), Q(Be, { key: 0 }, $e(s.scale.pointer, (d) => Ve((j(), Q("i", {
292
- key: d,
293
- class: pe([`p-${d}`]),
294
- onMousedown: (i) => s.scale.onMouseDown(i, d)
295
- }, null, 42, tt)), [
296
- [We, s.config.scalable]
297
- ])), 128)) : re("", !0);
298
- }
299
- }), at = /* @__PURE__ */ Ee(nt, [["__scopeId", "data-v-cb7f9cc6"]]), ie = (e) => {
300
- if (!e) return {};
301
- const l = {};
302
- for (const [c, s] of Object.entries(e))
303
- l[c] = Se(c, s);
304
- return l;
305
- };
306
- function Xe(e) {
307
- function l() {
308
- return {
309
- scaleX: e.scale[0],
310
- scaleY: e.scale[1]
311
- };
312
- }
313
- function c() {
314
- return {
315
- translateX: e.translateX,
316
- translateY: e.translateY
317
- };
318
- }
319
- function s(a, x, n) {
320
- e.translateX = n ? e.translateX + a : a, e.translateY = n ? e.translateY + x : x;
321
- }
322
- function h(a, x) {
323
- e.prevClientX = a, e.prevClientY = x;
324
- }
325
- function d(a, x) {
326
- e.prevTranslateX = a, e.prevTranslateY = x;
327
- }
328
- function i() {
329
- return {
330
- clientX: e.prevClientX,
331
- clientY: e.prevClientY
332
- };
333
- }
334
- function R() {
335
- return {
336
- translateX: e.prevTranslateX,
337
- translateY: e.prevTranslateY
338
- };
339
- }
340
- function T(a, x) {
341
- e.scale = [a, x];
342
- }
343
- function y() {
344
- e.scale = [1, 1], e.prevClientX = 0, e.prevTranslateX = 0, e.prevClientY = 0, e.prevTranslateY = 0, e.translateX = 0, e.translateY = 0;
345
- }
346
- function S(a) {
347
- Object.assign(e, a);
348
- }
349
- return {
350
- setData: S,
351
- getTranslate: c,
352
- setTranslate: s,
353
- getScale: l,
354
- setScale: T,
355
- setNormal: y,
356
- setPrevClientPos: h,
357
- getPrevClientPos: i,
358
- getPrevTranslate: R,
359
- setPrevTranslate: d
360
- };
361
- }
362
- function Ye(e) {
363
- function l(h, d) {
364
- e.value && (e.value[h] = d);
365
- }
366
- function c(h) {
367
- for (const [d, i] of Object.entries(h))
368
- l(d, i);
369
- }
370
- function s(h) {
371
- if (e.value)
372
- return e.value[h];
373
- }
374
- return {
375
- get: s,
376
- set: l,
377
- sets: c
378
- };
379
- }
380
- function it(e, l, c, s, h, d, i) {
381
- const { setNormal: R, setTranslate: T, setPrevTranslate: y } = Xe(s), { get: S, set: a } = Ye(h), x = Te(ye(S("position"))), n = Je(
382
- async () => {
383
- e.value.autoStick && (typeof e.value.autoStick == "boolean" ? await c.value?.autoStick(!0) : await c.value?.stickTo(e.value.autoStick, !0));
384
- },
385
- 200,
386
- { maxWait: 1e3 }
387
- );
388
- function L() {
389
- l.value && l.value.setTarget(ye(d) ?? i.value ?? null);
390
- }
391
- function A() {
392
- c.value?.setStatus(He.NORMAL), g(e.value.movable), N(e.value.moveConfig), H(e.value.x, e.value.y), P(e.value.normal), ke(e.value.visible) ? m(e.value.visible, !1) : c.value?.hideTo("self", !1);
393
- }
394
- function m(o, u) {
395
- if (!ke(o)) return;
396
- const I = G(e.value.x) || G(e.value.y);
397
- o ? c.value?.show(u, I ? { x: e.value.x, y: e.value.y } : "self") : c.value?.hideTo(I ? { x: e.value.x, y: e.value.y } : "self", u);
398
- }
399
- function g(o) {
400
- o ? l.value?.enable() : l.value?.disable();
401
- }
402
- function P(o) {
403
- o ? (l.value?.setTarget(), x.value = S("position"), e.value.movable = !1, e.value.scalable = !1, R(), a("position", "static")) : (L(), a("position", x.value));
404
- }
405
- function N(o) {
406
- o && l.value?.updateOption(o);
407
- }
408
- function H(o, u) {
409
- if (!l.value?.isMoving() && (G(e.value.x) || G(e.value.y))) {
410
- const I = w(o), D = w(u);
411
- T(I, D), y(I, D);
412
- }
413
- }
414
- return q(() => e.value.movable, g), q(() => e.value.normal, P), q(() => e.value.moveConfig, N, { deep: !0 }), q(
415
- () => e.value.visible,
416
- (o) => m(o, !0)
417
- ), q([() => e.value.x, () => e.value.y], ([o, u]) => H(o, u)), q(d, () => {
418
- e.value.normal || L();
419
- }), {
420
- autoStick: n,
421
- onInit: A,
422
- onMovableChange: g,
423
- onNormalChange: P
424
- };
425
- }
426
- function Ie(e, l) {
427
- const c = Pe(e);
428
- return c ? window.getComputedStyle(c).getPropertyValue(l) : Se(l, void 0);
429
- }
430
- var He = /* @__PURE__ */ ((e) => (e.NORMAL = "NORMAL", e.HIDDEN = "HIDDEN", e))(He || {}), se = /* @__PURE__ */ ((e) => (e.AFTER_SHOW = "after_show", e.AFTER_HIDE = "after_hide", e.AFTER_STICK = "after_stick", e))(se || {});
431
- const rt = (e) => {
432
- const { getTranslate: l, setTranslate: c, setScale: s, setPrevTranslate: h, getScale: d } = Xe(e.dragOffset);
433
- let i = e.parent;
434
- const R = Ge(), T = ue(), y = Te(
435
- "NORMAL"
436
- /* NORMAL */
437
- ), S = {
438
- stick: 160
439
- }, a = {
440
- transX: { old: 0, final: 0 },
441
- transY: { old: 0, final: 0 }
442
- }, x = [], n = [];
443
- function L() {
444
- const { translateX: t, translateY: f } = l();
445
- a.transX.old = t, a.transX.final = t, a.transY.old = f, a.transY.final = f;
446
- }
447
- const { x: A, y: m, width: g, left: P } = le(e.targetEle);
448
- function N(t, f) {
449
- const r = {
450
- width: window.innerWidth,
451
- height: window.innerHeight
452
- };
453
- if (!e.targetEle.value || t.position === "fixed")
454
- return r;
455
- {
456
- if (f) return r;
457
- const Y = ne();
458
- return r.width = Y.offsetWidth, r.height = Y.offsetHeight, r;
459
- }
460
- }
461
- function H(t, f, r, v, Y) {
462
- return () => {
463
- s(Y[0], Y[1]), c(t, f), h(t, f);
464
- };
465
- }
466
- function o(t, f) {
467
- const r = { x: 0, y: 0, w: 0, h: 0 };
468
- if (!e.targetEle.value) return r;
469
- const v = Ke(
470
- {
471
- x: (W, U, Fe, Ne) => U,
472
- y: (W, U, Fe, Ne) => U,
473
- scale: (W, U) => [W, U]
474
- },
475
- f
476
- ), Y = !!e.config.value.attachWindow, k = window.getComputedStyle(e.targetEle.value), B = N(k, Y);
477
- let M = 0, O = 0;
478
- const p = w(k.width), b = w(k.height);
479
- r.w = p, r.h = b;
480
- const { translateX: E, translateY: _ } = l();
481
- if (k.position === "fixed" ? (M = w(k.left), O = w(k.top)) : Y ? (M = w(A.value - E), O = w(m.value - _)) : (M = w(k.left), O = w(k.top)), typeof t == "string")
482
- switch (t) {
483
- case "left": {
484
- r.x = v.x(E, -w(M), p, b), r.y = v.y(_, _, p, b);
485
- break;
486
- }
487
- case "top": {
488
- r.x = v.x(E, E, p, b), r.y = v.y(_, -w(O), p, b);
489
- break;
490
- }
491
- case "right": {
492
- r.x = v.x(E, -w(M) + B.width - p, p, b), r.y = v.y(_, _, p, b);
493
- break;
494
- }
495
- case "bottom": {
496
- r.x = v.x(E, E, p, b), r.y = v.y(_, -w(O) + B.height - b, p, b);
497
- break;
498
- }
499
- case "self": {
500
- r.x = v.x(E, E, p, b), r.y = v.y(_, _, p, b);
501
- break;
502
- }
503
- case "center":
504
- default:
505
- r.x = v.x(E, -w(M) + B.width / 2 - p / 2, p, b), r.y = v.y(_, -w(O) + B.height / 2 - b / 2, p, b);
506
- }
507
- else
508
- G(t.x) ? r.x = v.x(E, -w(M) + (t.x ?? E), p, b) : r.x = v.x(E, E, p, b), G(t.y) ? r.y = v.y(_, -w(O) + (t.y ?? _), p, b) : r.y = v.y(_, _, p, b);
509
- return r;
510
- }
511
- async function u(t, f, r, v) {
512
- await new Promise((Y) => {
513
- if (r(), !f) {
514
- Y();
515
- return;
516
- }
517
- R.animate(
518
- t,
519
- v,
520
- { duration: S.stick, iterations: 1 },
521
- {
522
- finish(k, B) {
523
- Y();
524
- }
525
- }
526
- );
527
- });
528
- }
529
- function I() {
530
- return w(P.value) + w(g.value) / 2 >= window.innerWidth / 2 ? "right" : "left";
531
- }
532
- async function D(t = !0, f, r) {
533
- if (!e.targetEle.value) return;
534
- const { x: v, y: Y, w: k, h: B } = o(f, r), { scaleX: M, scaleY: O } = d(), p = {
535
- old: [M, O],
536
- final: [M, O]
537
- };
538
- if (r?.scale) {
539
- const U = r.scale(p.old, p.final);
540
- p.old = U[0], p.final = U[1];
541
- }
542
- const b = H(v, Y, k, B, p.final), { translateX: E, translateY: _ } = l(), W = [
543
- { scale: p.old, translate: [X(E), X(_)] },
544
- { scale: p.final, translate: [X(v), X(Y)] }
545
- ];
546
- await u(e.targetEle.value, t, b, W);
547
- }
548
- async function C(t = !0, f) {
549
- if (y.value !== "HIDDEN" || !e.targetEle.value) return;
550
- const r = [0, 0], v = [1, 1], Y = [
551
- { scale: v, translate: [X(a.transX.final), X(a.transY.final)] },
552
- { scale: v, translate: [X(a.transX.old), X(a.transY.old)] }
553
- ], k = () => {
554
- s(v[0], v[1]), c(a.transX.old, a.transY.old), h(a.transX.old, a.transY.old);
555
- };
556
- f ? await D(t, f, {
557
- scale(B, M) {
558
- return f === "self" || f === "center" ? [r, v] : [v, v];
559
- }
560
- }) : await u(e.targetEle.value, t, k, Y), y.value = "NORMAL", T.emit(
561
- "after_show"
562
- /* AFTER_SHOW */
563
- );
564
- }
565
- async function F(t, f = !0) {
566
- if (y.value !== "NORMAL" || !e.targetEle.value) return;
567
- for await (const b of x)
568
- await b();
569
- L();
570
- const { x: r, y: v, w: Y, h: k } = o(t, {
571
- x: (b, E, _, W) => {
572
- switch (t) {
573
- case "left":
574
- return E -= w(_);
575
- case "right":
576
- return E += w(_);
577
- }
578
- return E;
579
- },
580
- y: (b, E, _, W) => {
581
- switch (t) {
582
- case "top":
583
- return E -= w(W);
584
- case "bottom":
585
- return E += w(W);
586
- }
587
- return E;
588
- }
589
- }), { translateX: B, translateY: M } = l();
590
- let O = [
591
- { scale: [1, 1], translate: [X(B), X(M)] },
592
- { scale: [1, 1], translate: [X(r), X(v)] }
593
- ];
594
- (t === "self" || t === "center") && (O = [
595
- { scale: [1, 1], translate: [X(r), X(v)] },
596
- { scale: [0, 0], translate: [X(r), X(v)] }
597
- ]), a.transX.final = r, a.transY.final = v;
598
- const p = H(r, v, Y, k, [0, 0]);
599
- await u(e.targetEle.value, f, p, O), y.value = "HIDDEN", T.emit(
600
- "after_hide"
601
- /* AFTER_HIDE */
602
- );
603
- }
604
- async function z(t, f = !0) {
605
- if (y.value === "NORMAL" && e.targetEle.value) {
606
- for await (const r of n)
607
- await r();
608
- await D(f, t), T.emit(
609
- "after_stick"
610
- /* AFTER_STICK */
611
- );
612
- }
613
- }
614
- async function V(t = !0) {
615
- y.value === "NORMAL" && await F(I(), t);
616
- }
617
- async function Z(t = !0) {
618
- y.value === "NORMAL" && await z(I(), t);
619
- }
620
- function ce(t) {
621
- y.value = t;
622
- }
623
- function K() {
624
- return y.value;
625
- }
626
- function fe() {
627
- return e.targetEle.value;
628
- }
629
- function ve(t, f) {
630
- T.on(t, f);
631
- }
632
- function de(t) {
633
- x.push(t);
634
- }
635
- function he(t) {
636
- n.push(t);
637
- }
638
- function ge(t) {
639
- t && (i = t);
640
- }
641
- function ne() {
642
- return i ?? e.targetEle.value?.parentElement ?? document.body;
643
- }
644
- function me() {
645
- T.removeAllListeners(), x.length = 0, n.length = 0;
646
- }
647
- return {
648
- getTarget: fe,
649
- setStatus: ce,
650
- getStatus: K,
651
- show: C,
652
- autoHide: V,
653
- autoStick: Z,
654
- stickTo: z,
655
- hideTo: F,
656
- moveTo: D,
657
- dispose: me,
658
- registerBeforeHideHook: de,
659
- registerBeforeStickHook: he,
660
- on: ve,
661
- setTargetParent: ge,
662
- getTargetParent: ne
663
- };
664
- };
665
- var xe = /* @__PURE__ */ ((e) => (e.SCALING = "scaling", e.AFTER_SCALE = "after_scale", e))(xe || {});
666
- const ot = (e) => {
667
- const l = oe(e.config.value, "containerStyle"), { set: c, sets: s } = Ye(l), h = ue(), d = ["t", "r", "b", "l", "lt", "rt", "lb", "rb"];
668
- let i = "";
669
- const { x: R, y: T, width: y, height: S, update: a } = le(e.targetEle), x = {
670
- t: (o, u) => {
671
- o.clientY >= n.y + n.height || s({ top: u.t, height: u.h });
672
- },
673
- r: (o, u) => {
674
- c("width", u.w);
675
- },
676
- b: (o, u) => {
677
- c("height", u.h);
678
- },
679
- l: (o, u) => {
680
- o.clientX >= n.x + n.width || s({ left: u.l, width: u.w });
681
- },
682
- lt: (o, u) => {
683
- o.clientX >= n.x + n.width || o.clientY >= n.y + n.height || s({ left: u.l, top: u.t, width: u.w, height: u.h });
684
- },
685
- rt: (o, u) => {
686
- o.clientY >= n.y + n.height || s({ top: u.t, width: u.w, height: u.h });
687
- },
688
- lb: (o, u) => {
689
- o.clientX >= n.x + n.width || s({ left: u.l, width: u.w, height: u.h });
690
- },
691
- rb: (o, u) => {
692
- s({ width: u.w, height: u.h });
693
- }
694
- }, n = { x: 0, y: 0, clientX: 0, clientY: 0, left: 0, top: 0, width: 0, height: 0 };
695
- function L(o) {
696
- o.preventDefault();
697
- }
698
- function A(o) {
699
- const u = n.top + o.clientY - n.clientY, I = n.left + o.clientX - n.clientX, D = i.startsWith("r") ? o.clientX - n.x : n.width + n.clientX - o.clientX, C = i.endsWith("t") ? n.height + n.clientY - o.clientY : o.clientY - n.y;
700
- x[i](o, {
701
- l: I,
702
- t: u,
703
- w: D,
704
- h: C
705
- }), h.emit(
706
- "scaling"
707
- /* SCALING */
708
- );
709
- }
710
- function m() {
711
- document.removeEventListener("mouseup", m), document.removeEventListener("mousemove", A), document.removeEventListener("selectstart", L), h.emit(
712
- "after_scale"
713
- /* AFTER_SCALE */
714
- );
715
- }
716
- function g(o, u) {
717
- document.addEventListener("selectstart", L), i = u, o.stopPropagation(), o.preventDefault(), a(), n.x = R.value, n.y = T.value, n.clientX = o.clientX, n.clientY = o.clientY, n.left = w(e.config.value.containerStyle?.left), n.top = w(e.config.value.containerStyle?.top) || w(e.targetEle.value?.offsetTop), n.width = y.value, n.height = S.value, document.addEventListener("mousemove", A), document.addEventListener("mouseup", m);
718
- }
719
- function P(o, u) {
720
- h.on(o, u);
721
- }
722
- function N() {
723
- h.removeAllListeners();
724
- }
725
- function H() {
726
- return e.targetEle.value;
727
- }
728
- return {
729
- pointer: d,
730
- getTarget: H,
731
- onMouseDown: g,
732
- on: P,
733
- dispose: N
734
- };
735
- }, st = /* @__PURE__ */ be({
736
- __name: "index",
737
- props: {
738
- modelValue: {},
739
- dragTarget: {}
740
- },
741
- emits: ["beforeMove", "moving", "afterMove", "scaling", "afterScale", "maskClick", "update:modelValue"],
742
- setup(e, { expose: l, emit: c }) {
743
- const s = c, h = e, d = Te(), i = $({
744
- get: () => h.modelValue,
745
- set: (t) => s("update:modelValue", t)
746
- }), R = te("header"), T = te("scales"), y = te("drag"), S = ee(), a = oe(i.value, "containerStyle"), x = oe(i.value, "contentStyle"), n = oe(i.value, "headerStyle"), { get: L } = Ye(a), A = Ae({
747
- prevClientX: 0,
748
- prevClientY: 0,
749
- prevTranslateX: 0,
750
- prevTranslateY: 0,
751
- translateX: 0,
752
- translateY: 0,
753
- scale: [0, 0]
754
- }), { getScale: m, getTranslate: g, setTranslate: P, setPrevClientPos: N, getPrevClientPos: H, setPrevTranslate: o, getPrevTranslate: u } = Xe(A), I = ot({
755
- config: i,
756
- targetEle: y
757
- }), D = $(() => ye(h.dragTarget)), C = $(() => !!i.value.header), F = $(() => ie(x.value)), z = $(() => ie(n.value)), V = $(() => ie(a.value)), Z = $(() => {
758
- const { scaleX: t, scaleY: f } = m(), { translateX: r, translateY: v } = g(), Y = L("width") ?? Ie(y, "width"), k = L("height") ?? Ie(y, "height");
759
- return {
760
- transform: `scale(${t},${f}) translate(${X(r)},${X(v)})`,
761
- zIndex: i.value.normal ? void 0 : Se("zIndex", L("zIndex")),
762
- // 计算其transform中心点,用于优化动画效果。元素移动时,其left和top并没有发生变化
763
- transformOrigin: `${X(parseFloat((r + w(Y) / 2).toFixed(2)))}
764
- ${X(parseFloat((v + w(k) / 2).toFixed(2)))}`
765
- };
766
- }), ce = $(() => ie(i.value.maskStyle)), { autoStick: K, onInit: fe, onMovableChange: ve, onNormalChange: de } = it(
767
- i,
768
- S,
769
- d,
770
- A,
771
- a,
772
- D,
773
- R
774
- );
775
- function he() {
776
- S.value = et(), S.value.every("beforemove", (t) => {
777
- N(t.clientX, t.clientY), s("beforeMove", Object.assign({}, t, g()));
778
- }), S.value.every("moving", (t) => {
779
- const { clientX: f, clientY: r } = H(), { translateX: v, translateY: Y } = u();
780
- P(v + t.clientX - f, Y + t.clientY - r);
781
- const k = g();
782
- (G(i.value.x) || G(i.value.y)) && (i.value.x = k.translateX, i.value.y = k.translateY), s("moving", { ...t, ...k });
783
- }), S.value.every("aftermove", async (t) => {
784
- const { translateX: f, translateY: r } = g();
785
- o(f, r), await K(), s("afterMove", { ...t, ...g() });
786
- });
787
- }
788
- function ge() {
789
- I.on(xe.AFTER_SCALE, async () => {
790
- await K(), T.value && s("afterScale", T.value);
791
- }), I.on(xe.SCALING, async () => {
792
- T.value && s("scaling", T.value);
793
- });
794
- }
795
- function ne() {
796
- d.value = rt({
797
- config: i,
798
- targetEle: y,
799
- dragOffset: A
800
- }), d.value.on(se.AFTER_HIDE, () => {
801
- i.value.visible = !1;
802
- }), d.value.on(se.AFTER_SHOW, () => {
803
- i.value.visible = !0;
804
- }), d.value.on(se.AFTER_STICK, () => {
805
- const { translateX: t, translateY: f } = g();
806
- i.value.x = t, i.value.y = f;
807
- });
808
- }
809
- async function me() {
810
- ge(), he(), ne(), ve(i.value.movable), de(i.value.normal), fe(), window.addEventListener("resize", K);
811
- }
812
- return De(me), Me(() => {
813
- window.removeEventListener("resize", K), I.dispose(), d.value?.dispose();
814
- }), l({
815
- async autoStick(t) {
816
- return d.value?.autoStick(t);
817
- },
818
- async stickTo(t, f) {
819
- return d.value?.stickTo(t, f);
820
- },
821
- async hideTo(t, f) {
822
- return d.value?.hideTo(t, f);
823
- },
824
- async autoHide(t) {
825
- return d.value?.autoHide(t);
826
- },
827
- async show(t, f) {
828
- return d.value?.show(t, f);
829
- },
830
- async moveTo(t, f, r) {
831
- return d.value?.moveTo(t, f, r);
832
- },
833
- getStatus: function() {
834
- return d.value?.getStatus();
835
- }
836
- }), (t, f) => (j(), Q("div", {
837
- ref: "drag",
838
- class: "dragContainer",
839
- style: J([V.value, Z.value])
840
- }, [
841
- C.value ? (j(), Q("div", {
842
- key: 0,
843
- ref: "header",
844
- class: "dragHeader",
845
- style: J(z.value)
846
- }, [
847
- we(t.$slots, "header", {}, void 0, !0)
848
- ], 4)) : re("", !0),
849
- i.value.scalable ? (j(), Ce(at, {
850
- key: 1,
851
- config: i.value,
852
- scale: Pe(I),
853
- move: S.value
854
- }, null, 8, ["config", "scale", "move"])) : re("", !0),
855
- Oe("div", {
856
- ref: "scales",
857
- class: "scaleContent",
858
- style: J(F.value)
859
- }, [
860
- we(t.$slots, "default", {}, void 0, !0)
861
- ], 4),
862
- (j(), Ce(Ue, {
863
- to: "body",
864
- disabled: !i.value.mask
865
- }, [
866
- i.value.mask ? (j(), Q("div", {
867
- key: 0,
868
- class: "dragMask",
869
- style: J(ce.value),
870
- onClick: f[0] || (f[0] = (r) => s("maskClick"))
871
- }, null, 4)) : re("", !0)
872
- ], 8, ["disabled"]))
873
- ], 4));
874
- }
875
- }), vt = /* @__PURE__ */ Ee(st, [["__scopeId", "data-v-d123b73c"]]);
876
- export {
877
- ft as Affix,
878
- vt as ScalePanel
879
- };