hy-app 0.4.6 → 0.4.8
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.
|
@@ -4,38 +4,39 @@
|
|
|
4
4
|
:style="submitBarStyle"
|
|
5
5
|
>
|
|
6
6
|
<view class="hy-submit-bar__left">
|
|
7
|
-
<slot name="left">
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</
|
|
7
|
+
<slot v-if="$slots.left" name="left"></slot>
|
|
8
|
+
<view
|
|
9
|
+
v-else-if="menus.length"
|
|
10
|
+
class="hy-submit-bar__left--item"
|
|
11
|
+
v-for="(item, i) in menus"
|
|
12
|
+
:key="i"
|
|
13
|
+
@tap="clickMenuFn(i)"
|
|
14
|
+
>
|
|
15
|
+
<HyIcon
|
|
16
|
+
:name="item.icon"
|
|
17
|
+
:label="item.text"
|
|
18
|
+
:color="iconColor"
|
|
19
|
+
:label-color="iconLabelColor"
|
|
20
|
+
labelPos="bottom"
|
|
21
|
+
space="7"
|
|
22
|
+
:size="20"
|
|
23
|
+
></HyIcon>
|
|
24
|
+
<HyBadge
|
|
25
|
+
:value="item?.badge?.value"
|
|
26
|
+
:absolute="true"
|
|
27
|
+
:offset="item?.badge?.offset || [-5, 20]"
|
|
28
|
+
:isDot="item?.badge?.isDot"
|
|
29
|
+
:type="item?.badge?.type"
|
|
30
|
+
:color="item?.badge?.color"
|
|
31
|
+
:shape="item?.badge?.shape"
|
|
32
|
+
:numberType="item?.badge?.numberType"
|
|
33
|
+
:inverted="item?.badge?.inverted"
|
|
34
|
+
></HyBadge>
|
|
35
|
+
</view>
|
|
36
36
|
</view>
|
|
37
37
|
<view class="hy-submit-bar__right">
|
|
38
|
-
<slot name="right">
|
|
38
|
+
<slot v-if="$slots.right" name="right"></slot>
|
|
39
|
+
<template v-else>
|
|
39
40
|
<view
|
|
40
41
|
class="hy-submit-bar__right--button"
|
|
41
42
|
v-if="showLeftBtn"
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
></HyLoading>
|
|
65
66
|
{{ rightBtnText }}
|
|
66
67
|
</view>
|
|
67
|
-
</
|
|
68
|
+
</template>
|
|
68
69
|
</view>
|
|
69
70
|
</view>
|
|
70
71
|
</template>
|
|
@@ -169,6 +170,11 @@ const props = defineProps({
|
|
|
169
170
|
type: String,
|
|
170
171
|
default: "circle",
|
|
171
172
|
},
|
|
173
|
+
/** 层级 */
|
|
174
|
+
zIndex: {
|
|
175
|
+
type: [Number, String],
|
|
176
|
+
default: 999,
|
|
177
|
+
},
|
|
172
178
|
/** 定义需要用到的外部样式 */
|
|
173
179
|
customStyle: {
|
|
174
180
|
type: Object as PropType<CSSProperties>,
|
|
@@ -186,6 +192,7 @@ const submitBarStyle = computed(() => {
|
|
|
186
192
|
const style: CSSProperties = {
|
|
187
193
|
bottom: 0,
|
|
188
194
|
left: 0,
|
|
195
|
+
zIndex: props.zIndex,
|
|
189
196
|
};
|
|
190
197
|
if (props.fixed) style.position = "fixed";
|
|
191
198
|
return Object.assign(style, props.customStyle);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
3
|
-
:class="['hy-tooltip', customClass]"
|
|
4
|
-
:style="customStyle"
|
|
5
|
-
@click.stop="closeHandler"
|
|
6
|
-
>
|
|
2
|
+
<view class="hy-tooltip">
|
|
7
3
|
<HyOverlay
|
|
8
4
|
:show="showTooltip && tooltipTop !== -10000 && overlay"
|
|
9
5
|
:customStyle="{ backgroundColor: 'rgba(0, 0, 0, 0)' }"
|
|
@@ -11,17 +7,22 @@
|
|
|
11
7
|
></HyOverlay>
|
|
12
8
|
<!-- 文本内容区域 -->
|
|
13
9
|
<view
|
|
14
|
-
class="hy-tooltip__content"
|
|
10
|
+
:class="`hy-tooltip__content ${customClass}`"
|
|
15
11
|
id="target"
|
|
16
12
|
@longpress.stop="longPressHandler"
|
|
17
13
|
@tap.stop="clickHandler"
|
|
18
|
-
:style="
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
:style="[
|
|
15
|
+
{
|
|
16
|
+
color: color,
|
|
17
|
+
fontSize: addUnit(size),
|
|
18
|
+
fontWeight: bold ? 'bold' : '',
|
|
19
|
+
backgroundColor:
|
|
20
|
+
bgColor && showTooltip && tooltipTop !== -10000
|
|
21
|
+
? bgColor
|
|
22
|
+
: 'transparent',
|
|
23
|
+
},
|
|
24
|
+
customStyle,
|
|
25
|
+
]"
|
|
25
26
|
>
|
|
26
27
|
<slot v-if="$slots.default"></slot>
|
|
27
28
|
<text class="hy-tooltip__content--text" v-else>{{ text }}</text>
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
v-if="showCopy"
|
|
36
37
|
class="hy-tooltip__container--list__btn"
|
|
37
38
|
hover-class="hy-tooltip__container--list__btn--hover"
|
|
38
|
-
@tap="setClipboardData"
|
|
39
|
+
@tap.stop="setClipboardData"
|
|
39
40
|
>
|
|
40
41
|
<text class="hy-tooltip__container--list__btn--text">复制</text>
|
|
41
42
|
</view>
|
|
@@ -73,12 +74,14 @@
|
|
|
73
74
|
:show="showTooltip"
|
|
74
75
|
:duration="300"
|
|
75
76
|
custom-class="hy-tooltip__popup"
|
|
76
|
-
:custom-style="
|
|
77
|
+
:custom-style="{
|
|
78
|
+
...popover.popStyle.value,
|
|
79
|
+
zIndex: zIndex,
|
|
80
|
+
}"
|
|
77
81
|
>
|
|
78
82
|
<view class="hy-tooltip__container">
|
|
79
83
|
<!-- 三角形 -->
|
|
80
84
|
<view
|
|
81
|
-
v-if="showCopy"
|
|
82
85
|
:class="`hy-tooltip__arrow ${popover.arrowClass.value}`"
|
|
83
86
|
:style="popover.arrowStyle.value"
|
|
84
87
|
></view>
|
|
@@ -154,6 +157,7 @@ import {
|
|
|
154
157
|
closeOther,
|
|
155
158
|
removeFromQueue,
|
|
156
159
|
pushToQueue,
|
|
160
|
+
addUnit,
|
|
157
161
|
} from "../../libs";
|
|
158
162
|
|
|
159
163
|
// 组件
|
|
@@ -179,11 +183,6 @@ const props = defineProps({
|
|
|
179
183
|
type: String,
|
|
180
184
|
default: "",
|
|
181
185
|
},
|
|
182
|
-
/** 文本大小 */
|
|
183
|
-
size: {
|
|
184
|
-
type: [String, Number],
|
|
185
|
-
default: 14,
|
|
186
|
-
},
|
|
187
186
|
/**
|
|
188
187
|
* 触发模式
|
|
189
188
|
* @values longpress,click
|
|
@@ -200,21 +199,23 @@ const props = defineProps({
|
|
|
200
199
|
type: String as PropType<IPlacementVo>,
|
|
201
200
|
default: "bottom",
|
|
202
201
|
},
|
|
202
|
+
/** 文本大小 */
|
|
203
|
+
size: {
|
|
204
|
+
type: [String, Number],
|
|
205
|
+
default: 14,
|
|
206
|
+
},
|
|
203
207
|
/** 字体颜色 */
|
|
204
208
|
color: String,
|
|
209
|
+
/** 字体粗细 */
|
|
210
|
+
bold: {
|
|
211
|
+
type: Boolean,
|
|
212
|
+
default: false,
|
|
213
|
+
},
|
|
205
214
|
/** 弹出提示框时,文本的背景色 */
|
|
206
215
|
bgColor: {
|
|
207
216
|
type: String,
|
|
208
217
|
default: "transparent",
|
|
209
218
|
},
|
|
210
|
-
/**
|
|
211
|
-
* 弹出提示的方向
|
|
212
|
-
* @values top,bottom
|
|
213
|
-
* */
|
|
214
|
-
direction: {
|
|
215
|
-
type: String,
|
|
216
|
-
default: "top",
|
|
217
|
-
},
|
|
218
219
|
/** 弹出提示的z-index,nvue无效 */
|
|
219
220
|
zIndex: {
|
|
220
221
|
type: Number,
|
|
@@ -237,7 +238,7 @@ const props = defineProps({
|
|
|
237
238
|
type: Boolean,
|
|
238
239
|
default: true,
|
|
239
240
|
},
|
|
240
|
-
/**
|
|
241
|
+
/** 是否显示提示 */
|
|
241
242
|
showToast: {
|
|
242
243
|
type: Boolean,
|
|
243
244
|
default: true,
|
|
@@ -16,7 +16,6 @@ $hy-tooltip--background-color: rgb(50, 50, 51);
|
|
|
16
16
|
background-clip: padding-box;
|
|
17
17
|
text-align: center;
|
|
18
18
|
min-height: 36px;
|
|
19
|
-
z-index: $hy-tooltip--z-index;
|
|
20
19
|
transition: opacity 0.2s;
|
|
21
20
|
box-shadow: $hy-box-shadow;
|
|
22
21
|
border-radius: $hy-border-radius-sm;
|
|
@@ -49,10 +48,6 @@ $hy-tooltip--background-color: rgb(50, 50, 51);
|
|
|
49
48
|
/* #ifndef APP-NVUE */
|
|
50
49
|
white-space: nowrap;
|
|
51
50
|
/* #endif */
|
|
52
|
-
|
|
53
|
-
@include m(text) {
|
|
54
|
-
font-size: 28rpx;
|
|
55
|
-
}
|
|
56
51
|
}
|
|
57
52
|
|
|
58
53
|
@include e(container) {
|
|
@@ -67,7 +62,6 @@ $hy-tooltip--background-color: rgb(50, 50, 51);
|
|
|
67
62
|
padding: 0;
|
|
68
63
|
@include flex(row);
|
|
69
64
|
align-items: center;
|
|
70
|
-
z-index: 999;
|
|
71
65
|
|
|
72
66
|
@include e(btn) {
|
|
73
67
|
padding: $hy-border-margin-padding-base;
|