zartui 3.1.10 → 3.1.12
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/README.md +23 -23
- package/es/cascader/Cascader.d.ts +1 -1
- package/es/cascader/index.d.ts +1 -1
- package/es/cell/Cell.d.ts +24 -1
- package/es/cell/Cell.mjs +30 -5
- package/es/cell/index.css +1 -1
- package/es/cell/index.d.ts +14 -1
- package/es/checkbox/Checkbox.d.ts +1 -1
- package/es/checkbox/index.d.ts +1 -1
- package/es/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/es/checkbox-group/index.d.ts +1 -1
- package/es/collapse/Collapse.d.ts +1 -1
- package/es/collapse/index.d.ts +1 -1
- package/es/composables/use-touch.d.ts +1 -0
- package/es/composables/use-touch.mjs +8 -1
- package/es/config-provider/types.d.ts +1 -1
- package/es/date-time-picker/DateTimePicker.d.ts +1 -1
- package/es/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
- package/es/date-time-picker/index.d.ts +1 -1
- package/es/dropdown-item/DropdownItem.d.ts +1 -1
- package/es/dropdown-item/index.d.ts +1 -1
- package/es/field/Field.d.ts +17 -2
- package/es/field/index.d.ts +12 -2
- package/es/floating-bubble/FloatingBubble.d.ts +81 -0
- package/es/floating-bubble/FloatingBubble.mjs +181 -0
- package/es/floating-bubble/index.css +1 -0
- package/es/floating-bubble/index.d.ts +63 -0
- package/es/floating-bubble/index.mjs +10 -0
- package/es/floating-bubble/style/index.d.ts +1 -0
- package/es/floating-bubble/style/index.mjs +4 -0
- package/es/floating-bubble/types.d.ts +20 -0
- package/es/floating-bubble/types.mjs +0 -0
- package/es/hierarchy-select/HierarchySelect.mjs +1 -0
- package/es/index-bar/IndexBar.mjs +27 -19
- package/es/index-bar/index.css +1 -1
- package/es/index-bar/types.d.ts +1 -0
- package/es/index.d.ts +2 -1
- package/es/index.mjs +4 -1
- package/es/lazyload/vue-lazyload/index.d.ts +55 -55
- package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
- package/es/number-keyboard/index.d.ts +1 -1
- package/es/picker/Picker.d.ts +1 -1
- package/es/picker/index.d.ts +1 -1
- package/es/pull-refresh/PullRefresh.d.ts +1 -1
- package/es/pull-refresh/index.d.ts +1 -1
- package/es/radio-group/RadioGroup.d.ts +1 -1
- package/es/radio-group/index.d.ts +1 -1
- package/es/radio-picker/RadioPicker.d.ts +1 -1
- package/es/radio-picker/index.d.ts +1 -1
- package/es/rate/Rate.d.ts +1 -1
- package/es/rate/index.d.ts +1 -1
- package/es/search/Search.d.ts +2 -2
- package/es/search/index.d.ts +2 -2
- package/es/stepper/Stepper.d.ts +1 -1
- package/es/stepper/index.d.ts +1 -1
- package/es/switch/Switch.d.ts +1 -1
- package/es/switch/index.d.ts +1 -1
- package/es/tabbar/Tabbar.d.ts +1 -1
- package/es/tabbar/index.d.ts +1 -1
- package/es/tabbar-item/index.css +1 -1
- package/es/time-picker/TimePicker.d.ts +1 -1
- package/es/time-picker/index.d.ts +1 -1
- package/es/utils/closest.d.ts +1 -0
- package/es/utils/closest.mjs +8 -0
- package/es/utils/constant.d.ts +1 -0
- package/es/utils/constant.mjs +3 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.mjs +1 -0
- package/es/vue-sfc-shim.d.ts +6 -6
- package/es/vue-tsx-shim.d.ts +23 -23
- package/lib/cascader/Cascader.d.ts +1 -1
- package/lib/cascader/index.d.ts +1 -1
- package/lib/cell/Cell.d.ts +24 -1
- package/lib/cell/Cell.js +28 -3
- package/lib/cell/index.css +1 -1
- package/lib/cell/index.d.ts +14 -1
- package/lib/checkbox/Checkbox.d.ts +1 -1
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/lib/checkbox-group/index.d.ts +1 -1
- package/lib/collapse/Collapse.d.ts +1 -1
- package/lib/collapse/index.d.ts +1 -1
- package/lib/composables/use-touch.d.ts +1 -0
- package/lib/composables/use-touch.js +8 -1
- package/lib/config-provider/types.d.ts +1 -1
- package/lib/date-time-picker/DateTimePicker.d.ts +1 -1
- package/lib/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
- package/lib/date-time-picker/index.d.ts +1 -1
- package/lib/dropdown-item/DropdownItem.d.ts +1 -1
- package/lib/dropdown-item/index.d.ts +1 -1
- package/lib/field/Field.d.ts +17 -2
- package/lib/field/index.d.ts +12 -2
- package/lib/floating-bubble/FloatingBubble.d.ts +81 -0
- package/lib/floating-bubble/FloatingBubble.js +210 -0
- package/lib/floating-bubble/index.css +1 -0
- package/lib/floating-bubble/index.d.ts +63 -0
- package/lib/floating-bubble/index.js +39 -0
- package/lib/floating-bubble/style/index.d.ts +1 -0
- package/lib/floating-bubble/style/index.js +4 -0
- package/lib/floating-bubble/types.d.ts +20 -0
- package/lib/floating-bubble/types.js +15 -0
- package/lib/hierarchy-select/HierarchySelect.js +1 -0
- package/lib/index-bar/IndexBar.js +27 -19
- package/lib/index-bar/index.css +1 -1
- package/lib/index-bar/types.d.ts +1 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/lazyload/vue-lazyload/index.d.ts +55 -55
- package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
- package/lib/number-keyboard/index.d.ts +1 -1
- package/lib/picker/Picker.d.ts +1 -1
- package/lib/picker/index.d.ts +1 -1
- package/lib/pull-refresh/PullRefresh.d.ts +1 -1
- package/lib/pull-refresh/index.d.ts +1 -1
- package/lib/radio-group/RadioGroup.d.ts +1 -1
- package/lib/radio-group/index.d.ts +1 -1
- package/lib/radio-picker/RadioPicker.d.ts +1 -1
- package/lib/radio-picker/index.d.ts +1 -1
- package/lib/rate/Rate.d.ts +1 -1
- package/lib/rate/index.d.ts +1 -1
- package/lib/search/Search.d.ts +2 -2
- package/lib/search/index.d.ts +2 -2
- package/lib/stepper/Stepper.d.ts +1 -1
- package/lib/stepper/index.d.ts +1 -1
- package/lib/switch/Switch.d.ts +1 -1
- package/lib/switch/index.d.ts +1 -1
- package/lib/tabbar/Tabbar.d.ts +1 -1
- package/lib/tabbar/index.d.ts +1 -1
- package/lib/tabbar-item/index.css +1 -1
- package/lib/time-picker/TimePicker.d.ts +1 -1
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/utils/closest.d.ts +1 -0
- package/lib/utils/closest.js +27 -0
- package/lib/utils/constant.d.ts +1 -0
- package/lib/utils/constant.js +3 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/vue-sfc-shim.d.ts +6 -6
- package/lib/vue-tsx-shim.d.ts +23 -23
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +698 -478
- package/lib/zartui.es.js +698 -478
- package/lib/zartui.js +698 -478
- package/lib/zartui.min.js +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { PropType, type ExtractPropTypes } from 'vue';
|
|
2
|
+
import { FloatingBubbleAxis, FloatingBubbleMagnetic, FloatingBubbleOffset } from './types';
|
|
3
|
+
export declare const floatingBubbleProps: {
|
|
4
|
+
gap: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
icon: StringConstructor;
|
|
9
|
+
axis: {
|
|
10
|
+
type: PropType<FloatingBubbleAxis>;
|
|
11
|
+
default: FloatingBubbleAxis;
|
|
12
|
+
};
|
|
13
|
+
magnetic: PropType<FloatingBubbleMagnetic>;
|
|
14
|
+
offset: {
|
|
15
|
+
type: PropType<FloatingBubbleOffset>;
|
|
16
|
+
default: () => {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
teleport: {
|
|
22
|
+
type: PropType<string | import("vue").RendererElement | null | undefined>;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type FloatingBubbleProps = ExtractPropTypes<typeof floatingBubbleProps>;
|
|
27
|
+
declare const _default: import("vue").DefineComponent<{
|
|
28
|
+
gap: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
icon: StringConstructor;
|
|
33
|
+
axis: {
|
|
34
|
+
type: PropType<FloatingBubbleAxis>;
|
|
35
|
+
default: FloatingBubbleAxis;
|
|
36
|
+
};
|
|
37
|
+
magnetic: PropType<FloatingBubbleMagnetic>;
|
|
38
|
+
offset: {
|
|
39
|
+
type: PropType<FloatingBubbleOffset>;
|
|
40
|
+
default: () => {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
teleport: {
|
|
46
|
+
type: PropType<string | import("vue").RendererElement | null | undefined>;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:offset" | "offsetChange")[], "click" | "update:offset" | "offsetChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
50
|
+
gap: {
|
|
51
|
+
type: NumberConstructor;
|
|
52
|
+
default: number;
|
|
53
|
+
};
|
|
54
|
+
icon: StringConstructor;
|
|
55
|
+
axis: {
|
|
56
|
+
type: PropType<FloatingBubbleAxis>;
|
|
57
|
+
default: FloatingBubbleAxis;
|
|
58
|
+
};
|
|
59
|
+
magnetic: PropType<FloatingBubbleMagnetic>;
|
|
60
|
+
offset: {
|
|
61
|
+
type: PropType<FloatingBubbleOffset>;
|
|
62
|
+
default: () => {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
teleport: {
|
|
68
|
+
type: PropType<string | import("vue").RendererElement | null | undefined>;
|
|
69
|
+
default: string;
|
|
70
|
+
};
|
|
71
|
+
}>> & {
|
|
72
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
73
|
+
"onUpdate:offset"?: ((...args: any[]) => any) | undefined;
|
|
74
|
+
onOffsetChange?: ((...args: any[]) => any) | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
offset: FloatingBubbleOffset;
|
|
77
|
+
teleport: string | import("vue").RendererElement | null | undefined;
|
|
78
|
+
gap: number;
|
|
79
|
+
axis: FloatingBubbleAxis;
|
|
80
|
+
}, {}>;
|
|
81
|
+
export default _default;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { withDirectives as _withDirectives, mergeProps as _mergeProps, vShow as _vShow, createVNode as _createVNode } from "vue";
|
|
2
|
+
import { Teleport, computed, defineComponent, nextTick, onMounted, ref, watch, onActivated, onDeactivated } from "vue";
|
|
3
|
+
import { pick, addUnit, closest, createNamespace, makeNumberProp, makeStringProp, windowWidth, windowHeight } from "../utils/index.mjs";
|
|
4
|
+
import { useRect, useEventListener } from "@zartui/use";
|
|
5
|
+
import { useTouch } from "../composables/use-touch.mjs";
|
|
6
|
+
import Icon from "../icon/index.mjs";
|
|
7
|
+
const floatingBubbleProps = {
|
|
8
|
+
gap: makeNumberProp(24),
|
|
9
|
+
icon: String,
|
|
10
|
+
axis: makeStringProp("y"),
|
|
11
|
+
magnetic: String,
|
|
12
|
+
offset: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({
|
|
15
|
+
x: -1,
|
|
16
|
+
y: -1
|
|
17
|
+
})
|
|
18
|
+
},
|
|
19
|
+
teleport: {
|
|
20
|
+
type: [String, Object],
|
|
21
|
+
default: "body"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const [name, bem] = createNamespace("floating-bubble");
|
|
25
|
+
var stdin_default = defineComponent({
|
|
26
|
+
name,
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
props: floatingBubbleProps,
|
|
29
|
+
emits: ["click", "update:offset", "offsetChange"],
|
|
30
|
+
setup(props, {
|
|
31
|
+
slots,
|
|
32
|
+
emit,
|
|
33
|
+
attrs
|
|
34
|
+
}) {
|
|
35
|
+
const rootRef = ref();
|
|
36
|
+
const state = ref({
|
|
37
|
+
x: 0,
|
|
38
|
+
y: 0,
|
|
39
|
+
width: 0,
|
|
40
|
+
height: 0
|
|
41
|
+
});
|
|
42
|
+
const boundary = computed(() => ({
|
|
43
|
+
top: props.gap,
|
|
44
|
+
right: windowWidth.value - state.value.width - props.gap,
|
|
45
|
+
bottom: windowHeight.value - state.value.height - props.gap,
|
|
46
|
+
left: props.gap
|
|
47
|
+
}));
|
|
48
|
+
const dragging = ref(false);
|
|
49
|
+
let initialized = false;
|
|
50
|
+
const rootStyle = computed(() => {
|
|
51
|
+
const style = {};
|
|
52
|
+
const x = addUnit(state.value.x);
|
|
53
|
+
const y = addUnit(state.value.y);
|
|
54
|
+
style.transform = `translate3d(${x}, ${y}, 0)`;
|
|
55
|
+
if (dragging.value || !initialized) {
|
|
56
|
+
style.transition = "none";
|
|
57
|
+
}
|
|
58
|
+
return style;
|
|
59
|
+
});
|
|
60
|
+
const updateState = () => {
|
|
61
|
+
if (!show.value)
|
|
62
|
+
return;
|
|
63
|
+
const {
|
|
64
|
+
width,
|
|
65
|
+
height
|
|
66
|
+
} = useRect(rootRef.value);
|
|
67
|
+
const {
|
|
68
|
+
offset
|
|
69
|
+
} = props;
|
|
70
|
+
state.value = {
|
|
71
|
+
x: offset.x > -1 ? offset.x : windowWidth.value - width - props.gap,
|
|
72
|
+
y: offset.y > -1 ? offset.y : windowHeight.value - height - props.gap,
|
|
73
|
+
width,
|
|
74
|
+
height
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
const touch = useTouch();
|
|
78
|
+
let prevX = 0;
|
|
79
|
+
let prevY = 0;
|
|
80
|
+
const onTouchStart = (e) => {
|
|
81
|
+
touch.start(e);
|
|
82
|
+
dragging.value = true;
|
|
83
|
+
prevX = state.value.x;
|
|
84
|
+
prevY = state.value.y;
|
|
85
|
+
};
|
|
86
|
+
const onTouchMove = (e) => {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
touch.move(e);
|
|
89
|
+
if (props.axis === "lock")
|
|
90
|
+
return;
|
|
91
|
+
if (!touch.isTap.value) {
|
|
92
|
+
if (props.axis === "x" || props.axis === "xy") {
|
|
93
|
+
let nextX = prevX + touch.deltaX.value;
|
|
94
|
+
if (nextX < boundary.value.left)
|
|
95
|
+
nextX = boundary.value.left;
|
|
96
|
+
if (nextX > boundary.value.right)
|
|
97
|
+
nextX = boundary.value.right;
|
|
98
|
+
state.value.x = nextX;
|
|
99
|
+
}
|
|
100
|
+
if (props.axis === "y" || props.axis === "xy") {
|
|
101
|
+
let nextY = prevY + touch.deltaY.value;
|
|
102
|
+
if (nextY < boundary.value.top)
|
|
103
|
+
nextY = boundary.value.top;
|
|
104
|
+
if (nextY > boundary.value.bottom)
|
|
105
|
+
nextY = boundary.value.bottom;
|
|
106
|
+
state.value.y = nextY;
|
|
107
|
+
}
|
|
108
|
+
const offset = pick(state.value, ["x", "y"]);
|
|
109
|
+
emit("update:offset", offset);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
useEventListener("touchmove", onTouchMove, {
|
|
113
|
+
target: rootRef
|
|
114
|
+
});
|
|
115
|
+
const onTouchEnd = () => {
|
|
116
|
+
dragging.value = false;
|
|
117
|
+
nextTick(() => {
|
|
118
|
+
if (props.magnetic === "x") {
|
|
119
|
+
const nextX = closest([boundary.value.left, boundary.value.right], state.value.x);
|
|
120
|
+
state.value.x = nextX;
|
|
121
|
+
}
|
|
122
|
+
if (props.magnetic === "y") {
|
|
123
|
+
const nextY = closest([boundary.value.top, boundary.value.bottom], state.value.y);
|
|
124
|
+
state.value.y = nextY;
|
|
125
|
+
}
|
|
126
|
+
if (!touch.isTap.value) {
|
|
127
|
+
const offset = pick(state.value, ["x", "y"]);
|
|
128
|
+
emit("update:offset", offset);
|
|
129
|
+
if (prevX !== offset.x || prevY !== offset.y) {
|
|
130
|
+
emit("offsetChange", offset);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
const onClick = (e) => {
|
|
136
|
+
if (touch.isTap.value)
|
|
137
|
+
emit("click", e);
|
|
138
|
+
else
|
|
139
|
+
e.stopPropagation();
|
|
140
|
+
};
|
|
141
|
+
onMounted(() => {
|
|
142
|
+
updateState();
|
|
143
|
+
nextTick(() => {
|
|
144
|
+
initialized = true;
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
watch([windowWidth, windowHeight, () => props.gap, () => props.offset], updateState);
|
|
148
|
+
const show = ref(true);
|
|
149
|
+
onActivated(() => {
|
|
150
|
+
show.value = true;
|
|
151
|
+
});
|
|
152
|
+
onDeactivated(() => {
|
|
153
|
+
if (props.teleport) {
|
|
154
|
+
show.value = false;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
return () => {
|
|
158
|
+
const Content = _withDirectives(_createVNode("div", _mergeProps({
|
|
159
|
+
"class": bem(),
|
|
160
|
+
"ref": rootRef,
|
|
161
|
+
"onTouchstartPassive": onTouchStart,
|
|
162
|
+
"onTouchend": onTouchEnd,
|
|
163
|
+
"onTouchcancel": onTouchEnd,
|
|
164
|
+
"onClick": onClick,
|
|
165
|
+
"style": rootStyle.value
|
|
166
|
+
}, attrs), [slots.default ? slots.default() : _createVNode(Icon, {
|
|
167
|
+
"name": props.icon,
|
|
168
|
+
"class": bem("icon")
|
|
169
|
+
}, null)]), [[_vShow, show.value]]);
|
|
170
|
+
return props.teleport ? _createVNode(Teleport, {
|
|
171
|
+
"to": props.teleport
|
|
172
|
+
}, {
|
|
173
|
+
default: () => [Content]
|
|
174
|
+
}) : Content;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
export {
|
|
179
|
+
stdin_default as default,
|
|
180
|
+
floatingBubbleProps
|
|
181
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--zt-floating-bubble-size: 48px;--zt-floating-bubble-initial-gap: 24px;--zt-floating-bubble-icon-size: 28px;--zt-floating-bubble-background: var(--zt-primary-color);--zt-floating-bubble-color: var(--zt-background-2);--zt-floating-bubble-z-index: 999;--zt-floating-bubble-border-radius: var(--zt-radius-max)}.zt-floating-bubble{position:fixed;left:0;top:0;right:var(--zt-floating-bubble-initial-gap);bottom:var(--zt-floating-bubble-initial-gap);width:var(--zt-floating-bubble-size);height:var(--zt-floating-bubble-size);box-sizing:border-box;display:flex;justify-content:center;align-items:center;overflow:hidden;cursor:pointer;touch-action:none;background:var(--zt-floating-bubble-background);color:var(--zt-floating-bubble-color);border-radius:var(--zt-floating-bubble-border-radius);z-index:var(--zt-floating-bubble-z-index);transition:transform var(--zt-duration-base);-webkit-user-select:none;user-select:none}.zt-floating-bubble:active{opacity:.7}.zt-floating-bubble__icon{font-size:var(--zt-floating-bubble-icon-size)}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const FloatingBubble: import("../utils").WithInstall<import("vue").DefineComponent<{
|
|
2
|
+
gap: {
|
|
3
|
+
type: NumberConstructor;
|
|
4
|
+
default: number;
|
|
5
|
+
};
|
|
6
|
+
icon: StringConstructor;
|
|
7
|
+
axis: {
|
|
8
|
+
type: import("vue").PropType<import("./types").FloatingBubbleAxis>;
|
|
9
|
+
default: import("./types").FloatingBubbleAxis;
|
|
10
|
+
};
|
|
11
|
+
magnetic: import("vue").PropType<import("./types").FloatingBubbleMagnetic>;
|
|
12
|
+
offset: {
|
|
13
|
+
type: import("vue").PropType<import("./types").FloatingBubbleOffset>;
|
|
14
|
+
default: () => {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
teleport: {
|
|
20
|
+
type: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:offset" | "offsetChange")[], "click" | "update:offset" | "offsetChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
gap: {
|
|
25
|
+
type: NumberConstructor;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
icon: StringConstructor;
|
|
29
|
+
axis: {
|
|
30
|
+
type: import("vue").PropType<import("./types").FloatingBubbleAxis>;
|
|
31
|
+
default: import("./types").FloatingBubbleAxis;
|
|
32
|
+
};
|
|
33
|
+
magnetic: import("vue").PropType<import("./types").FloatingBubbleMagnetic>;
|
|
34
|
+
offset: {
|
|
35
|
+
type: import("vue").PropType<import("./types").FloatingBubbleOffset>;
|
|
36
|
+
default: () => {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
teleport: {
|
|
42
|
+
type: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
45
|
+
}>> & {
|
|
46
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
47
|
+
"onUpdate:offset"?: ((...args: any[]) => any) | undefined;
|
|
48
|
+
onOffsetChange?: ((...args: any[]) => any) | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
offset: import("./types").FloatingBubbleOffset;
|
|
51
|
+
teleport: string | import("vue").RendererElement | null | undefined;
|
|
52
|
+
gap: number;
|
|
53
|
+
axis: import("./types").FloatingBubbleAxis;
|
|
54
|
+
}, {}>>;
|
|
55
|
+
export default FloatingBubble;
|
|
56
|
+
export { floatingBubbleProps } from './FloatingBubble';
|
|
57
|
+
export type { FloatingBubbleProps } from './FloatingBubble';
|
|
58
|
+
export type { FloatingBubbleThemeVars, FloatingBubbleAxis, FloatingBubbleMagnetic, FloatingBubbleOffset, } from './types';
|
|
59
|
+
declare module 'vue' {
|
|
60
|
+
interface GlobalComponents {
|
|
61
|
+
ZtFloatingBubble: typeof FloatingBubble;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { withInstall } from "../utils/index.mjs";
|
|
2
|
+
import _FloatingBubble from "./FloatingBubble.mjs";
|
|
3
|
+
const FloatingBubble = withInstall(_FloatingBubble);
|
|
4
|
+
var stdin_default = FloatingBubble;
|
|
5
|
+
import { floatingBubbleProps } from "./FloatingBubble.mjs";
|
|
6
|
+
export {
|
|
7
|
+
FloatingBubble,
|
|
8
|
+
stdin_default as default,
|
|
9
|
+
floatingBubbleProps
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type FloatingBubbleThemeVars = {
|
|
2
|
+
floatingBubbleSize?: string;
|
|
3
|
+
floatingBubbleInitialGap?: string;
|
|
4
|
+
floatingBubbleIconSize?: string;
|
|
5
|
+
floatingBubbleBackground?: string;
|
|
6
|
+
floatingBubbleColor?: string;
|
|
7
|
+
floatingBubbleZIndex?: number | string;
|
|
8
|
+
};
|
|
9
|
+
export type FloatingBubbleAxis = 'x' | 'y' | 'xy' | 'lock';
|
|
10
|
+
export type FloatingBubbleMagnetic = 'x' | 'y';
|
|
11
|
+
export type FloatingBubbleOffset = {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
export type FloatingBubbleBoundary = {
|
|
16
|
+
top: number;
|
|
17
|
+
right: number;
|
|
18
|
+
bottom: number;
|
|
19
|
+
left: number;
|
|
20
|
+
};
|
|
File without changes
|
|
@@ -25,7 +25,7 @@ const indexBarProps = {
|
|
|
25
25
|
default: genAlphabet
|
|
26
26
|
},
|
|
27
27
|
indexBarMaxHeight: makeNumericProp("70vh"),
|
|
28
|
-
contractionPointText: makeStringProp("\
|
|
28
|
+
contractionPointText: makeStringProp("\u2022")
|
|
29
29
|
};
|
|
30
30
|
const INDEX_BAR_KEY = Symbol(name);
|
|
31
31
|
const MIN_CONTRACTION_NUM = 2;
|
|
@@ -41,9 +41,9 @@ var stdin_default = defineComponent({
|
|
|
41
41
|
const sidebar = ref();
|
|
42
42
|
const activeAnchor = useSyncPropRef(() => props.activeAnchor, (value) => emit("update:activeAnchor", value));
|
|
43
43
|
const touchIndex = ref("");
|
|
44
|
-
const indexBarMaxHeight = () => {
|
|
44
|
+
const indexBarMaxHeight = computed(() => {
|
|
45
45
|
return props.indexBarMaxHeight ? unitToPx(props.indexBarMaxHeight) : unitToPx("100vh");
|
|
46
|
-
};
|
|
46
|
+
});
|
|
47
47
|
const touch = useTouch();
|
|
48
48
|
const scrollParent = useScrollParent(root);
|
|
49
49
|
const {
|
|
@@ -242,9 +242,9 @@ var stdin_default = defineComponent({
|
|
|
242
242
|
};
|
|
243
243
|
const adaptorIndexListByHeight = () => {
|
|
244
244
|
const actualIndexListHeight = props.indexList.length * getIndexHeight();
|
|
245
|
-
if (actualIndexListHeight && actualIndexListHeight > indexBarMaxHeight
|
|
245
|
+
if (actualIndexListHeight && actualIndexListHeight > indexBarMaxHeight.value) {
|
|
246
246
|
const adaptedIndexList = deepClone(props.indexList);
|
|
247
|
-
const renderedNum = Math.floor(indexBarMaxHeight
|
|
247
|
+
const renderedNum = Math.floor(indexBarMaxHeight.value / getIndexHeight());
|
|
248
248
|
const renderedPointNum = Math.floor(renderedNum / MIN_CONTRACTION_NUM);
|
|
249
249
|
const renderedIndexNum = renderedNum - renderedPointNum;
|
|
250
250
|
const hiddenIndexNum = adaptedIndexList.length - renderedIndexNum;
|
|
@@ -302,23 +302,31 @@ var stdin_default = defineComponent({
|
|
|
302
302
|
}, [_createVNode("div", {
|
|
303
303
|
"class": bem("touch-text")
|
|
304
304
|
}, [touchActiveText]), _createVNode("svg", {
|
|
305
|
-
"class": bem("icon"),
|
|
306
305
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
307
|
-
"viewBox": "0 0 20 32"
|
|
308
|
-
}, [_createVNode("defs", null, [_createVNode("path", {
|
|
309
|
-
"id": "7rkhbmqvk__gc482iacwa",
|
|
310
|
-
"d": "M0 0H20V32H0z"
|
|
311
|
-
}, null)]), _createVNode("g", {
|
|
312
306
|
"fill": "none",
|
|
313
|
-
"
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
"
|
|
317
|
-
|
|
307
|
+
"viewBox": "0 0 20 32",
|
|
308
|
+
"class": bem("icon")
|
|
309
|
+
}, [_createVNode("defs", null, [_createVNode("mask", {
|
|
310
|
+
"id": "ei8r0nsyx__b6fjzymnfa"
|
|
311
|
+
}, [_createVNode("rect", {
|
|
312
|
+
"width": "20",
|
|
313
|
+
"height": "32",
|
|
314
|
+
"rx": "0",
|
|
315
|
+
"fill": "#FFF"
|
|
316
|
+
}, null)])]), _createVNode("g", {
|
|
317
|
+
"mask": "url(#ei8r0nsyx__b6fjzymnfa)"
|
|
318
|
+
}, [_createVNode("rect", {
|
|
319
|
+
"width": "20",
|
|
320
|
+
"height": "32",
|
|
321
|
+
"rx": "0"
|
|
322
|
+
}, null), _createVNode("path", {
|
|
323
|
+
"d": "M-1.0000000000000497,0C7.83656,0,15,7.16344,15,16C15,24.8366,7.83656,32,-1,32L-1.0000000000000497,0Z",
|
|
324
|
+
"fill-rule": "evenodd",
|
|
325
|
+
"class": bem("icon-fill")
|
|
318
326
|
}, null), _createVNode("path", {
|
|
319
|
-
"d": "M12.
|
|
320
|
-
"fill": "
|
|
321
|
-
"
|
|
327
|
+
"d": "M12.243150099299784,24.98157383041382L19.435507386779786,16.65358383041382C19.759737386779786,16.27815383041382,19.759737386779786,15.721773830413818,19.435507386779786,15.346343830413819L12.243151433939785,7.018357001713818C13.983177386779785,9.578993830413818,14.999997386779786,12.670733830413818,14.999997386779786,15.999963830413819C14.999997386779786,19.32917383041382,13.983177386779785,22.420973830413818,12.243150099299784,24.98157383041382Z",
|
|
328
|
+
"fill-rule": "evenodd",
|
|
329
|
+
"class": bem("icon-fill")
|
|
322
330
|
}, null)])])]), _createVNode("div", {
|
|
323
331
|
"data-index": index,
|
|
324
332
|
"data-index-map": contractionPointMapList,
|
package/es/index-bar/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-index-bar-sidebar-z-index: 2}.zt-index-bar__sidebar{position:fixed;top:50%;right:var(--zt-padding-xs);z-index:var(--zt-index-bar-sidebar-z-index);display:flex;flex-direction:column;align-items:
|
|
1
|
+
:root{--zt-index-bar-sidebar-z-index: 2;--zt-index-bar-sidebar-touch-index-background-color: #8093ab}.zt-index-bar__sidebar{position:fixed;top:50%;right:var(--zt-padding-xs);z-index:var(--zt-index-bar-sidebar-z-index);display:flex;flex-direction:column;align-items:center;text-align:center;transform:translateY(-50%);cursor:pointer;-webkit-user-select:none;user-select:none}.zt-index-bar__index{position:relative;color:var(--zt-text-color);padding:0 var(--zt-padding-base);font-size:var(--zt-font-size-sm);line-height:var(--zt-line-height-sm);display:flex;height:var(--zt-line-height-sm)}.zt-index-bar__index--active{color:var(--zt-primary-color);font-weight:700}.zt-index-bar__index--touch{position:relative;color:var(--zt-white)}.zt-index-bar__index--touch:after{content:"";position:absolute;top:0;left:50%;transform:translate(-50%);width:100%;height:100%;z-index:-1;padding:0;background:var(--zt-primary-color);border-radius:calc(var(--zt-line-height-sm) / 2)}.zt-index-bar__touch{display:none}.zt-index-bar__touch-text{width:-webkit-max-content;width:max-content;margin-right:-1px;height:32px;line-height:32px;border-radius:16px 0 0 16px;padding:0 1px 0 14px;font-size:var(--zt-font-size-lg);color:var(--zt-white);text-align:center;background:var(--zt-index-bar-sidebar-touch-index-background-color)}.zt-index-bar__touch--active{display:flex;position:absolute;top:-6px;right:100%}.zt-index-bar__icon{position:relative;width:20px;height:32px}.zt-index-bar__icon-fill{fill:var(--zt-index-bar-sidebar-touch-index-background-color)}
|
package/es/index-bar/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type IndexBarExpose = {
|
|
|
10
10
|
export type IndexBarInstance = ComponentPublicInstance<IndexBarProps, IndexBarExpose>;
|
|
11
11
|
export type IndexBarThemeVars = {
|
|
12
12
|
indexBarSidebarZIndex?: number | string;
|
|
13
|
+
indexBarSidebarTouchIndexBackgroundColor?: string;
|
|
13
14
|
};
|
|
14
15
|
export interface IndexBarContractionItem {
|
|
15
16
|
index: Numeric;
|
package/es/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./dropdown-item";
|
|
|
19
19
|
export * from "./dropdown-menu";
|
|
20
20
|
export * from "./empty";
|
|
21
21
|
export * from "./field";
|
|
22
|
+
export * from "./floating-bubble";
|
|
22
23
|
export * from "./form";
|
|
23
24
|
export * from "./grid";
|
|
24
25
|
export * from "./grid-item";
|
|
@@ -78,4 +79,4 @@ declare namespace _default {
|
|
|
78
79
|
}
|
|
79
80
|
export default _default;
|
|
80
81
|
export function install(app: any): void;
|
|
81
|
-
export const version: "3.1.
|
|
82
|
+
export const version: "3.1.12";
|
package/es/index.mjs
CHANGED
|
@@ -19,6 +19,7 @@ import { DropdownItem } from "./dropdown-item/index.mjs";
|
|
|
19
19
|
import { DropdownMenu } from "./dropdown-menu/index.mjs";
|
|
20
20
|
import { Empty } from "./empty/index.mjs";
|
|
21
21
|
import { Field } from "./field/index.mjs";
|
|
22
|
+
import { FloatingBubble } from "./floating-bubble/index.mjs";
|
|
22
23
|
import { Form } from "./form/index.mjs";
|
|
23
24
|
import { Grid } from "./grid/index.mjs";
|
|
24
25
|
import { GridItem } from "./grid-item/index.mjs";
|
|
@@ -71,7 +72,7 @@ import { TimePicker } from "./time-picker/index.mjs";
|
|
|
71
72
|
import { Timeline } from "./timeline/index.mjs";
|
|
72
73
|
import { Toast } from "./toast/index.mjs";
|
|
73
74
|
import { Uploader } from "./uploader/index.mjs";
|
|
74
|
-
const version = "3.1.
|
|
75
|
+
const version = "3.1.12";
|
|
75
76
|
function install(app) {
|
|
76
77
|
const components = [
|
|
77
78
|
ActionSheet,
|
|
@@ -95,6 +96,7 @@ function install(app) {
|
|
|
95
96
|
DropdownMenu,
|
|
96
97
|
Empty,
|
|
97
98
|
Field,
|
|
99
|
+
FloatingBubble,
|
|
98
100
|
Form,
|
|
99
101
|
Grid,
|
|
100
102
|
GridItem,
|
|
@@ -177,6 +179,7 @@ export * from "./dropdown-item/index.mjs";
|
|
|
177
179
|
export * from "./dropdown-menu/index.mjs";
|
|
178
180
|
export * from "./empty/index.mjs";
|
|
179
181
|
export * from "./field/index.mjs";
|
|
182
|
+
export * from "./floating-bubble/index.mjs";
|
|
180
183
|
export * from "./form/index.mjs";
|
|
181
184
|
export * from "./grid/index.mjs";
|
|
182
185
|
export * from "./grid-item/index.mjs";
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import type { App } from 'vue';
|
|
2
|
-
|
|
3
|
-
declare type ListenEvent =
|
|
4
|
-
| 'scroll'
|
|
5
|
-
| 'wheel'
|
|
6
|
-
| 'mousewheel'
|
|
7
|
-
| 'resize'
|
|
8
|
-
| 'animationend'
|
|
9
|
-
| 'transitionend'
|
|
10
|
-
| 'touchmove';
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line
|
|
13
|
-
declare type Callback = (listener: any, options: LazyloadOptions) => void;
|
|
14
|
-
|
|
15
|
-
declare type Filter = {
|
|
16
|
-
webp?: Callback;
|
|
17
|
-
progressive?: Callback;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
declare type Adapter = {
|
|
21
|
-
error?: Callback;
|
|
22
|
-
loaded?: Callback;
|
|
23
|
-
loading?: Callback;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export declare type LazyloadOptions = {
|
|
27
|
-
error?: string;
|
|
28
|
-
filter?: Filter;
|
|
29
|
-
silent?: boolean;
|
|
30
|
-
adapter?: Adapter;
|
|
31
|
-
loading?: string;
|
|
32
|
-
attempt?: number;
|
|
33
|
-
preLoad?: number;
|
|
34
|
-
observer?: boolean;
|
|
35
|
-
lazyImage?: boolean;
|
|
36
|
-
throttleWait?: number;
|
|
37
|
-
listenEvents?: ListenEvent[];
|
|
38
|
-
dispatchEvent?: boolean;
|
|
39
|
-
lazyComponent?: boolean;
|
|
40
|
-
observerOptions?: IntersectionObserverInit;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export declare const Lazyload: {
|
|
44
|
-
install(app: App, options?: LazyloadOptions): void;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
declare module '@vue/runtime-core' {
|
|
48
|
-
interface ComponentCustomProperties {
|
|
49
|
-
$Lazyload: {
|
|
50
|
-
$on: (event: string, handler: Callback) => void;
|
|
51
|
-
$off: (event: string, handler?: Callback) => void;
|
|
52
|
-
$once: (event: string, handler: Callback) => void;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
|
|
3
|
+
declare type ListenEvent =
|
|
4
|
+
| 'scroll'
|
|
5
|
+
| 'wheel'
|
|
6
|
+
| 'mousewheel'
|
|
7
|
+
| 'resize'
|
|
8
|
+
| 'animationend'
|
|
9
|
+
| 'transitionend'
|
|
10
|
+
| 'touchmove';
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line
|
|
13
|
+
declare type Callback = (listener: any, options: LazyloadOptions) => void;
|
|
14
|
+
|
|
15
|
+
declare type Filter = {
|
|
16
|
+
webp?: Callback;
|
|
17
|
+
progressive?: Callback;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
declare type Adapter = {
|
|
21
|
+
error?: Callback;
|
|
22
|
+
loaded?: Callback;
|
|
23
|
+
loading?: Callback;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export declare type LazyloadOptions = {
|
|
27
|
+
error?: string;
|
|
28
|
+
filter?: Filter;
|
|
29
|
+
silent?: boolean;
|
|
30
|
+
adapter?: Adapter;
|
|
31
|
+
loading?: string;
|
|
32
|
+
attempt?: number;
|
|
33
|
+
preLoad?: number;
|
|
34
|
+
observer?: boolean;
|
|
35
|
+
lazyImage?: boolean;
|
|
36
|
+
throttleWait?: number;
|
|
37
|
+
listenEvents?: ListenEvent[];
|
|
38
|
+
dispatchEvent?: boolean;
|
|
39
|
+
lazyComponent?: boolean;
|
|
40
|
+
observerOptions?: IntersectionObserverInit;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export declare const Lazyload: {
|
|
44
|
+
install(app: App, options?: LazyloadOptions): void;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
declare module '@vue/runtime-core' {
|
|
48
|
+
interface ComponentCustomProperties {
|
|
49
|
+
$Lazyload: {
|
|
50
|
+
$on: (event: string, handler: Callback) => void;
|
|
51
|
+
$off: (event: string, handler?: Callback) => void;
|
|
52
|
+
$once: (event: string, handler: Callback) => void;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -92,7 +92,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
92
92
|
type: PropType<string | string[]>;
|
|
93
93
|
default: string;
|
|
94
94
|
};
|
|
95
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "hide" | "show" | "blur" | "
|
|
95
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "hide" | "show" | "blur" | "close" | "update:modelValue" | "delete")[], "input" | "hide" | "show" | "blur" | "close" | "update:modelValue" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
96
96
|
show: BooleanConstructor;
|
|
97
97
|
title: StringConstructor;
|
|
98
98
|
theme: {
|
|
@@ -43,7 +43,7 @@ export declare const NumberKeyboard: import("../utils").WithInstall<import("vue"
|
|
|
43
43
|
type: import("vue").PropType<string | string[]>;
|
|
44
44
|
default: string;
|
|
45
45
|
};
|
|
46
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "hide" | "show" | "blur" | "
|
|
46
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "hide" | "show" | "blur" | "close" | "update:modelValue" | "delete")[], "input" | "hide" | "show" | "blur" | "close" | "update:modelValue" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
47
47
|
show: BooleanConstructor;
|
|
48
48
|
title: StringConstructor;
|
|
49
49
|
theme: {
|