@touchvue/ui 1.0.0-beta.46 → 1.0.0-beta.47
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/components/float/index.d.ts +15 -0
- package/es/components/float/src/Float.vue.d.ts +9 -0
- package/es/components/float/src/float.d.ts +4 -0
- package/es/components/grid/src/grid-item.vue.d.ts +2 -9
- package/es/components/scroll/index.d.ts +3 -3
- package/es/components/scroll/src/Scroll.vue.d.ts +1 -1
- package/es/packages/components/float/src/Float.vue2.mjs +81 -71
- package/es/packages/components/float/src/Float.vue2.mjs.map +1 -1
- package/es/packages/components/float/src/float.mjs +2 -1
- package/es/packages/components/float/src/float.mjs.map +1 -1
- package/es/packages/components/grid/src/grid-item.vue2.mjs +9 -52
- package/es/packages/components/grid/src/grid-item.vue2.mjs.map +1 -1
- package/es/packages/hooks/useDevice.mjs.map +1 -1
- package/lib/components/float/index.d.ts +15 -0
- package/lib/components/float/src/Float.vue.d.ts +9 -0
- package/lib/components/float/src/float.d.ts +4 -0
- package/lib/components/grid/src/grid-item.vue.d.ts +2 -9
- package/lib/components/scroll/index.d.ts +3 -3
- package/lib/components/scroll/src/Scroll.vue.d.ts +1 -1
- package/lib/packages/components/float/src/Float.vue2.js +81 -71
- package/lib/packages/components/float/src/Float.vue2.js.map +1 -1
- package/lib/packages/components/float/src/float.js +2 -1
- package/lib/packages/components/float/src/float.js.map +1 -1
- package/lib/packages/components/grid/src/grid-item.vue2.js +8 -51
- package/lib/packages/components/grid/src/grid-item.vue2.js.map +1 -1
- package/lib/packages/hooks/useDevice.js.map +1 -1
- package/package.json +1 -1
- package/theme/components/index.css +27 -3
- package/theme/index.css +27 -3
- package/theme/skin/default.css +27 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, renderSlot } from 'vue';
|
|
2
2
|
|
|
3
3
|
const __default__ = defineComponent({
|
|
4
4
|
name: "ToGridItem"
|
|
@@ -6,41 +6,13 @@ const __default__ = defineComponent({
|
|
|
6
6
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
7
|
...__default__,
|
|
8
8
|
props: {
|
|
9
|
-
merge: { default: 1 },
|
|
10
9
|
width: { default: "" },
|
|
11
|
-
|
|
10
|
+
flex: { type: Boolean, default: false }
|
|
12
11
|
},
|
|
13
12
|
setup(__props) {
|
|
14
13
|
const props = __props;
|
|
15
|
-
const grid = inject("grid", {});
|
|
16
|
-
function parseVal(val) {
|
|
17
|
-
return Number(val != null ? val : 0);
|
|
18
|
-
}
|
|
19
14
|
const setStyle = computed(() => {
|
|
20
15
|
const style = {};
|
|
21
|
-
const space = parseVal(grid == null ? void 0 : grid.space);
|
|
22
|
-
const spaceX = parseVal(grid == null ? void 0 : grid.spaceX);
|
|
23
|
-
const spaceY = parseVal(grid == null ? void 0 : grid.spaceY);
|
|
24
|
-
if (space > 0) {
|
|
25
|
-
style.paddingTop = `${space}em`;
|
|
26
|
-
style.paddingLeft = `${space}em`;
|
|
27
|
-
}
|
|
28
|
-
if (spaceY > 0) {
|
|
29
|
-
style.paddingTop = `${spaceY}em`;
|
|
30
|
-
}
|
|
31
|
-
if (spaceX > 0) {
|
|
32
|
-
style.paddingLeft = `${spaceX}em`;
|
|
33
|
-
}
|
|
34
|
-
if (space === -1) {
|
|
35
|
-
style.marginTop = "-1px";
|
|
36
|
-
style.marginLeft = "-1px";
|
|
37
|
-
}
|
|
38
|
-
if (spaceY === -1) {
|
|
39
|
-
style.marginTop = "-1px";
|
|
40
|
-
}
|
|
41
|
-
if (spaceX === -1) {
|
|
42
|
-
style.marginLeft = "-1px";
|
|
43
|
-
}
|
|
44
16
|
if (props.width) {
|
|
45
17
|
if (!isNaN(Number(props.width))) {
|
|
46
18
|
style.width = `${props.width}em`;
|
|
@@ -52,29 +24,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
24
|
}
|
|
53
25
|
return style;
|
|
54
26
|
});
|
|
55
|
-
const setClass = computed(() => {
|
|
56
|
-
const arr = [];
|
|
57
|
-
if (Number(props.merge) > 1) {
|
|
58
|
-
arr.push(`merge-${props.merge}`);
|
|
59
|
-
}
|
|
60
|
-
if (props.side) {
|
|
61
|
-
arr.push("is-side");
|
|
62
|
-
}
|
|
63
|
-
return arr;
|
|
64
|
-
});
|
|
65
27
|
return (_ctx, _cache) => {
|
|
66
|
-
return openBlock(), createElementBlock(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
renderSlot(_ctx.$slots, "default")
|
|
74
|
-
],
|
|
75
|
-
6
|
|
76
|
-
/* CLASS, STYLE */
|
|
77
|
-
);
|
|
28
|
+
return openBlock(), createElementBlock("div", {
|
|
29
|
+
flex: _ctx.flex ? _ctx.flex : null,
|
|
30
|
+
class: "to-grid-item",
|
|
31
|
+
style: normalizeStyle(setStyle.value)
|
|
32
|
+
}, [
|
|
33
|
+
renderSlot(_ctx.$slots, "default")
|
|
34
|
+
], 12, ["flex"]);
|
|
78
35
|
};
|
|
79
36
|
}
|
|
80
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-item.vue2.mjs","sources":["../../../../../../packages/components/grid/src/grid-item.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as DO_defineComponent } from 'vue';\nexport default /*#__PURE__*/ DO_defineComponent({\n\tname: 'ToGridItem'
|
|
1
|
+
{"version":3,"file":"grid-item.vue2.mjs","sources":["../../../../../../packages/components/grid/src/grid-item.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as DO_defineComponent } from 'vue';\nexport default /*#__PURE__*/ DO_defineComponent({\n\tname: 'ToGridItem'\n});\n</script>\n<template>\n\t<div :flex=\"flex ? flex : null\" class=\"to-grid-item\" :style=\"setStyle\">\n\t\t<slot></slot>\n\t</div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\n\n\n\nexport interface Props {\n\twidth?: number | string\n\tflex?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n\twidth: '',\n\tflex: false\n})\n\nconst setStyle = computed(() => {\n\tconst style: Record<string, string> = {}\n\n\tif (props.width) {\n\t\tif (!isNaN(Number(props.width))) {\n\t\t\tstyle.width = `${props.width}em`\n\t\t} else if (props.width === 'full') {\n\t\t\tstyle.width = '100%'\n\t\t} else {\n\t\t\tstyle.width = props.width.toString()\n\t\t}\n\t}\n\n\treturn style\n})\n</script>\n"],"names":["DO_defineComponent","_createElementBlock","flex","_renderSlot"],"mappings":";;AAEA,MAAA,cAA6BA,eAAmB,CAAA;AAAA,EAC/C,IAAM,EAAA,YAAA;AACP,CAAC,CAAA,CAAA;;;;;;;;AAkBD,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAKd,IAAM,MAAA,QAAA,GAAW,SAAS,MAAM;AAC/B,MAAA,MAAM,QAAgC,EAAC,CAAA;AAEvC,MAAA,IAAI,MAAM,KAAO,EAAA;AAChB,QAAA,IAAI,CAAC,KAAM,CAAA,MAAA,CAAO,KAAM,CAAA,KAAK,CAAC,CAAG,EAAA;AAChC,UAAM,KAAA,CAAA,KAAA,GAAQ,GAAG,KAAM,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA;AAAA,SACxB,MAAA,IAAW,KAAM,CAAA,KAAA,KAAU,MAAQ,EAAA;AAClC,UAAA,KAAA,CAAM,KAAQ,GAAA,MAAA,CAAA;AAAA,SACR,MAAA;AACN,UAAM,KAAA,CAAA,KAAA,GAAQ,KAAM,CAAA,KAAA,CAAM,QAAS,EAAA,CAAA;AAAA,SACpC;AAAA,OACD;AAEA,MAAO,OAAA,KAAA,CAAA;AAAA,KACP,CAAA,CAAA;;wBAlCA,EAAAC,kBAAA,CAEM,KAAA,EAAA;AAAA,QAFA,IAAMC,EAAAA,IAAAA,CAAI,IAAGA,GAAAA,IAAAA,CAAI,IAAA,GAAA,IAAA;AAAA,QAAS,KAAM,EAAA,cAAA;AAAA,QAAgB,KAAA,gBAAO,CAAA,QAAA,CAAQ,KAAA,CAAA;AAAA;QACpEC,UAAA,CAAa,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDevice.mjs","sources":["../../../../packages/hooks/useDevice.ts"],"sourcesContent":["import { ref, computed, onMounted, onUnmounted } from 'vue'
|
|
1
|
+
{"version":3,"file":"useDevice.mjs","sources":["../../../../packages/hooks/useDevice.ts"],"sourcesContent":["import { ref, computed, onMounted, onUnmounted } from 'vue'\nimport { getMedia } from '@touchvue/utils'\n\n/**\n * 设备类型\n */\nexport type DeviceType = 'pc' | 'pad' | 'phone'\n\n/**\n * 全局设备检测管理器\n * 使用单例模式避免重复注册resize事件\n */\nclass DeviceManager {\n\tprivate static instance: DeviceManager\n\tprivate deviceType = ref<DeviceType>(getMedia())\n\tprivate listeners = new Set<() => void>()\n\tprivate resizeHandler: (() => void) | null = null\n\n\tprivate constructor() {\n\t\tthis.initResizeListener()\n\t}\n\n\tstatic getInstance(): DeviceManager {\n\t\tif (!DeviceManager.instance) {\n\t\t\tDeviceManager.instance = new DeviceManager()\n\t\t}\n\t\treturn DeviceManager.instance\n\t}\n\n\tprivate initResizeListener() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\tthis.resizeHandler = () => {\n\t\t\t\tconst newDeviceType = getMedia()\n\t\t\t\tif (this.deviceType.value !== newDeviceType) {\n\t\t\t\t\tthis.deviceType.value = newDeviceType\n\t\t\t\t\t// 通知所有监听器\n\t\t\t\t\tthis.listeners.forEach(listener => listener())\n\t\t\t\t}\n\t\t\t}\n\t\t\twindow.addEventListener('resize', this.resizeHandler)\n\t\t}\n\t}\n\n\tgetDeviceType() {\n\t\treturn this.deviceType\n\t}\n\n\taddListener(listener: () => void) {\n\t\tthis.listeners.add(listener)\n\t}\n\n\tremoveListener(listener: () => void) {\n\t\tthis.listeners.delete(listener)\n\n\t\t// 如果没有监听器了,移除resize事件\n\t\tif (this.listeners.size === 0 && this.resizeHandler && typeof window !== 'undefined') {\n\t\t\twindow.removeEventListener('resize', this.resizeHandler)\n\t\t\tthis.resizeHandler = null\n\t\t}\n\t}\n\n\tdestroy() {\n\t\tif (this.resizeHandler && typeof window !== 'undefined') {\n\t\t\twindow.removeEventListener('resize', this.resizeHandler)\n\t\t}\n\t\tthis.listeners.clear()\n\t\tthis.resizeHandler = null\n\t}\n}\n\n/**\n * 设备检测 Hook\n * 提供响应式的设备类型判断,替代 Vue2 中的 $phone、$pc、$pad\n * 使用单例模式避免重复注册resize事件监听器\n */\nexport function useDevice() {\n\tconst manager = DeviceManager.getInstance()\n\tconst deviceType = manager.getDeviceType()\n\n\t// 计算属性:是否为手机\n\tconst isPhone = computed(() => deviceType.value === 'phone')\n\n\t// 计算属性:是否为平板\n\tconst isPad = computed(() => deviceType.value === 'pad')\n\n\t// 计算属性:是否为PC\n\tconst isPc = computed(() => deviceType.value === 'pc')\n\n\t// 计算属性:是否为移动设备(手机或平板)\n\tconst isMobile = computed(() => deviceType.value === 'phone' || deviceType.value === 'pad')\n\n\t// 更新设备类型的回调\n\tconst updateCallback = () => {\n\t\t// 这里不需要做任何事情,因为deviceType是响应式的\n\t\t// 当manager更新deviceType时,所有计算属性会自动更新\n\t}\n\n\t// 手动更新设备类型\n\tconst updateDeviceType = () => {\n\t\tconst newDeviceType = getMedia()\n\t\tif (deviceType.value !== newDeviceType) {\n\t\t\t// 直接更新manager中的deviceType\n\t\t\t;(deviceType as any).value = newDeviceType\n\t\t}\n\t}\n\n\t// 组件挂载时添加监听器\n\tonMounted(() => {\n\t\tmanager.addListener(updateCallback)\n\t})\n\n\t// 组件卸载时移除监听器\n\tonUnmounted(() => {\n\t\tmanager.removeListener(updateCallback)\n\t})\n\n\treturn {\n\t\t// 设备类型(响应式)\n\t\tdeviceType,\n\n\t\t// 响应式判断\n\t\tisPhone,\n\t\tisPad,\n\t\tisPc,\n\t\tisMobile,\n\n\t\t// 手动更新设备类型\n\t\tupdateDeviceType\n\t}\n}\n\n/**\n * 获取当前设备类型(非响应式)\n * @returns 设备类型字符串\n */\nexport function getDeviceType(): DeviceType {\n\treturn getMedia()\n}\n\n/**\n * 判断是否为手机设备(非响应式)\n * @returns 是否为手机\n */\nexport function isPhoneDevice(): boolean {\n\treturn getMedia() === 'phone'\n}\n\n/**\n * 判断是否为平板设备(非响应式)\n * @returns 是否为平板\n */\nexport function isPadDevice(): boolean {\n\treturn getMedia() === 'pad'\n}\n\n/**\n * 判断是否为PC设备(非响应式)\n * @returns 是否为PC\n */\nexport function isPcDevice(): boolean {\n\treturn getMedia() === 'pc'\n}\n\n/**\n * 判断是否为移动设备(非响应式)\n * @returns 是否为移动设备(手机或平板)\n */\nexport function isMobileDevice(): boolean {\n\tconst device = getMedia()\n\treturn device === 'phone' || device === 'pad'\n}\n"],"names":[],"mappings":";;;AAYA,MAAM,aAAc,CAAA;AAAA,EAMX,WAAc,GAAA;AAJtB,IAAQ,IAAA,CAAA,UAAA,GAAa,GAAgB,CAAA,QAAA,EAAU,CAAA,CAAA;AAC/C,IAAQ,IAAA,CAAA,SAAA,uBAAgB,GAAgB,EAAA,CAAA;AACxC,IAAA,IAAA,CAAQ,aAAqC,GAAA,IAAA,CAAA;AAG5C,IAAA,IAAA,CAAK,kBAAmB,EAAA,CAAA;AAAA,GACzB;AAAA,EAEA,OAAO,WAA6B,GAAA;AACnC,IAAI,IAAA,CAAC,cAAc,QAAU,EAAA;AAC5B,MAAc,aAAA,CAAA,QAAA,GAAW,IAAI,aAAc,EAAA,CAAA;AAAA,KAC5C;AACA,IAAA,OAAO,aAAc,CAAA,QAAA,CAAA;AAAA,GACtB;AAAA,EAEQ,kBAAqB,GAAA;AAC5B,IAAI,IAAA,OAAO,WAAW,WAAa,EAAA;AAClC,MAAA,IAAA,CAAK,gBAAgB,MAAM;AAC1B,QAAA,MAAM,gBAAgB,QAAS,EAAA,CAAA;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AACvB,CAAA;AAMO,SAAS,WAAuB,GAAA;AACtC,EAAA,OAAO,UAAe,KAAA,KAAA,CAAA;AACvB,CAAA;AAMO,SAAS,UAAsB,GAAA;AACrC,EAAA,OAAO,UAAe,KAAA,IAAA,CAAA;AACvB,CAAA;AAMO,SAAS,cAA0B,GAAA;AACzC,EAAA,MAAM,SAAS,QAAS,EAAA,CAAA;AACxB,EAAO,OAAA,MAAA,KAAW,WAAW,MAAW,KAAA,KAAA,CAAA;AACzC;;;;"}
|
|
@@ -76,6 +76,10 @@ export declare const ToFloat: import("@touchvue/ui/lib/utils").SFCWithInstall<{
|
|
|
76
76
|
type: BooleanConstructor;
|
|
77
77
|
default: boolean;
|
|
78
78
|
};
|
|
79
|
+
speed: {
|
|
80
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
81
|
+
default: number;
|
|
82
|
+
};
|
|
79
83
|
}>> & Readonly<{}>, {
|
|
80
84
|
open: (by?: any) => void;
|
|
81
85
|
close: (e?: Event) => void;
|
|
@@ -101,6 +105,7 @@ export declare const ToFloat: import("@touchvue/ui/lib/utils").SFCWithInstall<{
|
|
|
101
105
|
mask: boolean;
|
|
102
106
|
dx: string | number;
|
|
103
107
|
dy: string | number;
|
|
108
|
+
speed: string | number;
|
|
104
109
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
105
110
|
P: {};
|
|
106
111
|
B: {};
|
|
@@ -185,6 +190,10 @@ export declare const ToFloat: import("@touchvue/ui/lib/utils").SFCWithInstall<{
|
|
|
185
190
|
type: BooleanConstructor;
|
|
186
191
|
default: boolean;
|
|
187
192
|
};
|
|
193
|
+
speed: {
|
|
194
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
195
|
+
default: number;
|
|
196
|
+
};
|
|
188
197
|
}>> & Readonly<{}>, {
|
|
189
198
|
open: (by?: any) => void;
|
|
190
199
|
close: (e?: Event) => void;
|
|
@@ -210,6 +219,7 @@ export declare const ToFloat: import("@touchvue/ui/lib/utils").SFCWithInstall<{
|
|
|
210
219
|
mask: boolean;
|
|
211
220
|
dx: string | number;
|
|
212
221
|
dy: string | number;
|
|
222
|
+
speed: string | number;
|
|
213
223
|
}>;
|
|
214
224
|
__isFragment?: never;
|
|
215
225
|
__isTeleport?: never;
|
|
@@ -291,6 +301,10 @@ export declare const ToFloat: import("@touchvue/ui/lib/utils").SFCWithInstall<{
|
|
|
291
301
|
type: BooleanConstructor;
|
|
292
302
|
default: boolean;
|
|
293
303
|
};
|
|
304
|
+
speed: {
|
|
305
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
306
|
+
default: number;
|
|
307
|
+
};
|
|
294
308
|
}>> & Readonly<{}>, {
|
|
295
309
|
open: (by?: any) => void;
|
|
296
310
|
close: (e?: Event) => void;
|
|
@@ -316,6 +330,7 @@ export declare const ToFloat: import("@touchvue/ui/lib/utils").SFCWithInstall<{
|
|
|
316
330
|
mask: boolean;
|
|
317
331
|
dx: string | number;
|
|
318
332
|
dy: string | number;
|
|
333
|
+
speed: string | number;
|
|
319
334
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
320
335
|
$slots: {
|
|
321
336
|
default?(_: {}): any;
|
|
@@ -82,6 +82,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
82
82
|
type: BooleanConstructor;
|
|
83
83
|
default: boolean;
|
|
84
84
|
};
|
|
85
|
+
speed: {
|
|
86
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
87
|
+
default: number;
|
|
88
|
+
};
|
|
85
89
|
}>, {
|
|
86
90
|
open: typeof open;
|
|
87
91
|
close: typeof close;
|
|
@@ -164,6 +168,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
164
168
|
type: BooleanConstructor;
|
|
165
169
|
default: boolean;
|
|
166
170
|
};
|
|
171
|
+
speed: {
|
|
172
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
173
|
+
default: number;
|
|
174
|
+
};
|
|
167
175
|
}>> & Readonly<{}>, {
|
|
168
176
|
mode: string;
|
|
169
177
|
left: string | number;
|
|
@@ -184,6 +192,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
184
192
|
mask: boolean;
|
|
185
193
|
dx: string | number;
|
|
186
194
|
dy: string | number;
|
|
195
|
+
speed: string | number;
|
|
187
196
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
188
197
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
189
198
|
export default _default;
|
|
@@ -76,6 +76,10 @@ export declare const floatProps: {
|
|
|
76
76
|
type: BooleanConstructor;
|
|
77
77
|
default: boolean;
|
|
78
78
|
};
|
|
79
|
+
speed: {
|
|
80
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
81
|
+
default: number;
|
|
82
|
+
};
|
|
79
83
|
};
|
|
80
84
|
export type FloatProps = ExtractPropTypes<typeof floatProps>;
|
|
81
85
|
export declare const floatEmits: string[];
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
export interface GridProps {
|
|
2
|
-
space?: number | string;
|
|
3
|
-
spaceX?: number | string;
|
|
4
|
-
spaceY?: number | string;
|
|
5
|
-
}
|
|
6
1
|
export interface Props {
|
|
7
|
-
merge?: number | string;
|
|
8
2
|
width?: number | string;
|
|
9
|
-
|
|
3
|
+
flex?: boolean;
|
|
10
4
|
}
|
|
11
5
|
declare function __VLS_template(): {
|
|
12
6
|
default?(_: {}): any;
|
|
13
7
|
};
|
|
14
8
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
|
+
flex: boolean;
|
|
15
10
|
width: number | string;
|
|
16
|
-
merge: number | string;
|
|
17
|
-
side: boolean;
|
|
18
11
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
19
12
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
20
13
|
export default _default;
|
|
@@ -88,8 +88,8 @@ export declare const ToScroll: import("@touchvue/ui/lib/utils").SFCWithInstall<{
|
|
|
88
88
|
modelValue: string | number;
|
|
89
89
|
bottom: string | number;
|
|
90
90
|
top: string | number;
|
|
91
|
-
virtual: boolean;
|
|
92
91
|
speed: number;
|
|
92
|
+
virtual: boolean;
|
|
93
93
|
barDisplay: string;
|
|
94
94
|
except: string;
|
|
95
95
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
@@ -180,8 +180,8 @@ export declare const ToScroll: import("@touchvue/ui/lib/utils").SFCWithInstall<{
|
|
|
180
180
|
modelValue: string | number;
|
|
181
181
|
bottom: string | number;
|
|
182
182
|
top: string | number;
|
|
183
|
-
virtual: boolean;
|
|
184
183
|
speed: number;
|
|
184
|
+
virtual: boolean;
|
|
185
185
|
barDisplay: string;
|
|
186
186
|
except: string;
|
|
187
187
|
}>;
|
|
@@ -277,8 +277,8 @@ export declare const ToScroll: import("@touchvue/ui/lib/utils").SFCWithInstall<{
|
|
|
277
277
|
modelValue: string | number;
|
|
278
278
|
bottom: string | number;
|
|
279
279
|
top: string | number;
|
|
280
|
-
virtual: boolean;
|
|
281
280
|
speed: number;
|
|
281
|
+
virtual: boolean;
|
|
282
282
|
barDisplay: string;
|
|
283
283
|
except: string;
|
|
284
284
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
@@ -145,8 +145,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
145
145
|
modelValue: string | number;
|
|
146
146
|
bottom: string | number;
|
|
147
147
|
top: string | number;
|
|
148
|
-
virtual: boolean;
|
|
149
148
|
speed: number;
|
|
149
|
+
virtual: boolean;
|
|
150
150
|
barDisplay: string;
|
|
151
151
|
except: string;
|
|
152
152
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -63,6 +63,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
63
63
|
arr.push("is-mask");
|
|
64
64
|
return arr;
|
|
65
65
|
});
|
|
66
|
+
const transitionTransform = vue.computed(() => `transform ${props.speed}ms ease-out`);
|
|
66
67
|
const setStyle = vue.computed(() => {
|
|
67
68
|
var _a;
|
|
68
69
|
const obj = {};
|
|
@@ -151,6 +152,10 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
151
152
|
} else if (link2) {
|
|
152
153
|
if (wrapper.value)
|
|
153
154
|
wrapper.value.style.height = "";
|
|
155
|
+
if (el.value) {
|
|
156
|
+
el.value.style.transition = "none";
|
|
157
|
+
el.value.style.transform = "";
|
|
158
|
+
}
|
|
154
159
|
vue.nextTick(() => {
|
|
155
160
|
var _a, _b;
|
|
156
161
|
if (!props.width && el.value) {
|
|
@@ -213,71 +218,77 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
213
218
|
}
|
|
214
219
|
}
|
|
215
220
|
}
|
|
216
|
-
if (el.value
|
|
217
|
-
|
|
218
|
-
if (iposition.value === "top") {
|
|
219
|
-
el.value.style.top = "";
|
|
220
|
-
el.value.style.bottom = bottomSpace + linkHeight - 1 - dy + "px";
|
|
221
|
-
}
|
|
222
|
-
if (iposition.value === "bottom") {
|
|
223
|
-
el.value.style.top = topSpace + linkHeight - 1 + dy + "px";
|
|
224
|
-
el.value.style.bottom = "";
|
|
225
|
-
}
|
|
226
|
-
if (iposition.value === "top" || iposition.value === "bottom") {
|
|
227
|
-
if (ialign.value === "left") {
|
|
228
|
-
el.value.style.left = leftSpace + dx + "px";
|
|
229
|
-
el.value.style.right = "";
|
|
230
|
-
} else if (ialign.value === "center") {
|
|
231
|
-
el.value.style.left = leftSpace - wrapperWidth / 2 + linkWidth / 2 + "px";
|
|
232
|
-
el.value.style.right = "";
|
|
233
|
-
} else {
|
|
234
|
-
el.value.style.right = rightSpace - dx + "px";
|
|
235
|
-
el.value.style.left = "";
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
if (iposition.value === "left") {
|
|
239
|
-
el.value.style.right = rightSpace + linkWidth - dx - 1 + "px";
|
|
240
|
-
el.value.style.left = "";
|
|
241
|
-
}
|
|
242
|
-
if (iposition.value === "right") {
|
|
243
|
-
el.value.style.left = leftSpace + linkWidth + dx - 1 + "px";
|
|
244
|
-
el.value.style.right = "";
|
|
245
|
-
}
|
|
246
|
-
if (iposition.value === "left" || iposition.value === "right") {
|
|
247
|
-
if (ialign.value === "bottom") {
|
|
221
|
+
if (el.value) {
|
|
222
|
+
if (iposition.value === "top") {
|
|
248
223
|
el.value.style.top = "";
|
|
249
|
-
el.value.style.bottom = bottomSpace - dy + "px";
|
|
250
|
-
}
|
|
251
|
-
|
|
224
|
+
el.value.style.bottom = bottomSpace + linkHeight - 1 - dy + "px";
|
|
225
|
+
}
|
|
226
|
+
if (iposition.value === "bottom") {
|
|
227
|
+
el.value.style.top = topSpace + linkHeight - 1 + dy + "px";
|
|
252
228
|
el.value.style.bottom = "";
|
|
253
229
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
|
|
230
|
+
if (iposition.value === "top" || iposition.value === "bottom") {
|
|
231
|
+
if (ialign.value === "left") {
|
|
232
|
+
el.value.style.left = leftSpace + dx + "px";
|
|
233
|
+
el.value.style.right = "";
|
|
234
|
+
} else if (ialign.value === "center") {
|
|
235
|
+
el.value.style.left = leftSpace - wrapperWidth / 2 + linkWidth / 2 + "px";
|
|
236
|
+
el.value.style.right = "";
|
|
237
|
+
} else {
|
|
238
|
+
el.value.style.right = rightSpace - dx + "px";
|
|
239
|
+
el.value.style.left = "";
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
if (iposition.value === "left") {
|
|
243
|
+
el.value.style.right = rightSpace + linkWidth - dx - 1 + "px";
|
|
244
|
+
el.value.style.left = "";
|
|
245
|
+
}
|
|
246
|
+
if (iposition.value === "right") {
|
|
247
|
+
el.value.style.left = leftSpace + linkWidth + dx - 1 + "px";
|
|
248
|
+
el.value.style.right = "";
|
|
249
|
+
}
|
|
250
|
+
if (iposition.value === "left" || iposition.value === "right") {
|
|
251
|
+
if (ialign.value === "bottom") {
|
|
252
|
+
el.value.style.top = "";
|
|
253
|
+
el.value.style.bottom = bottomSpace - dy + "px";
|
|
254
|
+
} else {
|
|
255
|
+
el.value.style.top = topSpace + dy + "px";
|
|
256
|
+
el.value.style.bottom = "";
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (iposition.value === "bottom") {
|
|
260
|
+
useSpace = bottomSpace;
|
|
267
261
|
origin.value = "top";
|
|
262
|
+
} else if (iposition.value === "top") {
|
|
263
|
+
useSpace = topSpace;
|
|
264
|
+
origin.value = "bottom";
|
|
268
265
|
} else {
|
|
269
|
-
|
|
266
|
+
if (ialign.value === "bottom") {
|
|
267
|
+
useSpace = topSpace + linkHeight;
|
|
268
|
+
origin.value = "bottom";
|
|
269
|
+
} else if (ialign.value === "top") {
|
|
270
|
+
useSpace = bottomSpace + linkHeight;
|
|
271
|
+
origin.value = "top";
|
|
272
|
+
} else {
|
|
273
|
+
console.error("[ToFloat] \u6D6E\u5C42\u5BF9\u9F50\u65B9\u5F0F\u8BBE\u7F6E\u9519\u8BEF\uFF01position \u5728\u5DE6\u53F3\u4E24\u4FA7\u65F6\uFF0C\u5BF9\u9F50\u65B9\u5F0F\u5E94\u662F\u9876\u90E8\u6216\u5E95\u90E8");
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
if (useSpace < wrapperHeight && wrapper.value) {
|
|
277
|
+
isOver.value = true;
|
|
278
|
+
wrapper.value.style.height = useSpace + "px";
|
|
279
|
+
}
|
|
280
|
+
if (link2) {
|
|
281
|
+
const ratio = link2.getBoundingClientRect().width / link2.offsetWidth;
|
|
282
|
+
const ratio2 = Number(getComputedStyle(link2).fontSize.trim().toLowerCase().replace(/px$/, "")) / Number(getComputedStyle(document.body).fontSize.trim().toLowerCase().replace(/px$/, ""));
|
|
283
|
+
size.value = ratio * ratio2;
|
|
270
284
|
}
|
|
271
285
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
const ratio2 = Number(getComputedStyle(link2).fontSize.trim().toLowerCase().replace(/px$/, "")) / Number(getComputedStyle(document.body).fontSize.trim().toLowerCase().replace(/px$/, ""));
|
|
279
|
-
size.value = ratio * ratio2;
|
|
280
|
-
}
|
|
286
|
+
}
|
|
287
|
+
if (el.value) {
|
|
288
|
+
setOpenStyle();
|
|
289
|
+
}
|
|
290
|
+
if (link2 && !("x" in link2) && !("touches" in link2)) {
|
|
291
|
+
setScrollStatus();
|
|
281
292
|
}
|
|
282
293
|
});
|
|
283
294
|
}
|
|
@@ -318,7 +329,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
318
329
|
emit("opened");
|
|
319
330
|
clearTimeout(timer);
|
|
320
331
|
timer = null;
|
|
321
|
-
},
|
|
332
|
+
}, Number(props.speed));
|
|
322
333
|
isOpen.value = true;
|
|
323
334
|
} else {
|
|
324
335
|
document.body.addEventListener("mousedown", blur);
|
|
@@ -347,10 +358,6 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
347
358
|
}
|
|
348
359
|
setTimeout(() => {
|
|
349
360
|
set(link.value);
|
|
350
|
-
setOpenStyle();
|
|
351
|
-
if (link.value && !("x" in link.value) && !("touches" in link.value)) {
|
|
352
|
-
setScrollStatus();
|
|
353
|
-
}
|
|
354
361
|
}, 0);
|
|
355
362
|
if (props.afterOpen && Object.prototype.toString.call(props.afterOpen) === "[object Function]") {
|
|
356
363
|
props.afterOpen();
|
|
@@ -376,22 +383,24 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
376
383
|
wrapper.value.style.transform = "translateX(-100%)";
|
|
377
384
|
}
|
|
378
385
|
setTimeout(() => {
|
|
379
|
-
wrapper.value.style.transition =
|
|
386
|
+
wrapper.value.style.transition = transitionTransform.value;
|
|
380
387
|
wrapper.value.style.transform = "translateY(0)";
|
|
381
388
|
setTimeout(() => {
|
|
382
389
|
wrapper.value.style.transform = "";
|
|
383
|
-
},
|
|
390
|
+
}, Number(props.speed));
|
|
384
391
|
}, 0);
|
|
385
392
|
} else {
|
|
393
|
+
el.value.style.transition = "none";
|
|
386
394
|
el.value.style.transform = "scale(1, 0)";
|
|
387
395
|
el.value.style.visibility = "visible";
|
|
388
|
-
|
|
389
|
-
el.value.style.transition =
|
|
396
|
+
requestAnimationFrame(() => {
|
|
397
|
+
el.value.style.transition = transitionTransform.value;
|
|
390
398
|
el.value.style.transform = "scale(1)";
|
|
391
399
|
setTimeout(() => {
|
|
392
400
|
el.value.style.transform = "";
|
|
393
|
-
|
|
394
|
-
|
|
401
|
+
el.value.style.transition = "";
|
|
402
|
+
}, Number(props.speed));
|
|
403
|
+
});
|
|
395
404
|
}
|
|
396
405
|
el.value.style.zIndex = (_a = window.$TouchUI) == null ? void 0 : _a.zIndex;
|
|
397
406
|
}
|
|
@@ -441,7 +450,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
441
450
|
if (props.afterClose && Object.prototype.toString.call(props.afterClose) === "[object Function]") {
|
|
442
451
|
props.afterClose();
|
|
443
452
|
}
|
|
444
|
-
},
|
|
453
|
+
}, Number(props.speed));
|
|
445
454
|
}
|
|
446
455
|
function setCloseStyle() {
|
|
447
456
|
if (props.slide) {
|
|
@@ -458,7 +467,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
458
467
|
wrapper.value.style.transform = "translateX(-100%)";
|
|
459
468
|
}
|
|
460
469
|
} else {
|
|
461
|
-
el.value.style.
|
|
470
|
+
el.value.style.transition = transitionTransform.value;
|
|
471
|
+
el.value.style.transform = "scale(1, 0)";
|
|
462
472
|
}
|
|
463
473
|
}
|
|
464
474
|
function toggle(by) {
|