hy-app 0.2.16 → 0.2.18
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/components/hy-action-sheet/hy-action-sheet.vue +5 -5
- package/components/hy-action-sheet/index.scss +6 -1
- package/components/hy-address-picker/hy-address-picker.vue +5 -5
- package/components/hy-avatar/hy-avatar.vue +5 -5
- package/components/hy-back-top/hy-back-top.vue +5 -5
- package/components/hy-badge/hy-badge.vue +5 -5
- package/components/hy-button/hy-button.vue +5 -5
- package/components/hy-calendar/hy-calendar.vue +22 -18
- package/components/hy-calendar/typing.d.ts +1 -1
- package/components/hy-card/hy-card.vue +5 -5
- package/components/hy-cell/hy-cell.vue +10 -11
- package/components/hy-check-button/hy-check-button.vue +7 -6
- package/components/hy-checkbox/hy-checkbox.vue +14 -14
- package/components/hy-code-input/hy-code-input.vue +8 -15
- package/components/hy-code-input/index.scss +1 -1
- package/components/hy-config-provider/hy-config-provider.vue +8 -6
- package/components/hy-count-down/hy-count-down.vue +7 -6
- package/components/hy-count-to/hy-count-to.vue +6 -5
- package/components/hy-datetime-picker/hy-datetime-picker.vue +7 -7
- package/components/hy-divider/hy-divider.vue +10 -7
- package/components/hy-dropdown/hy-dropdown.vue +6 -5
- package/components/hy-dropdown-item/hy-dropdown-item.vue +7 -5
- package/components/hy-empty/hy-empty.vue +6 -5
- package/components/hy-float-button/hy-float-button.vue +6 -6
- package/components/hy-folding-panel/hy-folding-panel.vue +6 -5
- package/components/hy-grid/hy-grid.vue +11 -13
- package/components/hy-grid/typing.d.ts +1 -1
- package/components/hy-icon/hy-icon.vue +15 -15
- package/components/hy-image/hy-image.vue +15 -9
- package/components/hy-input/hy-input.vue +7 -6
- package/components/hy-line/hy-line.vue +8 -6
- package/components/hy-line-progress/hy-line-progress.vue +9 -16
- package/components/hy-list/hy-list.vue +6 -5
- package/components/hy-loading/hy-loading.vue +9 -10
- package/components/hy-menu/hy-menu.vue +11 -8
- package/components/hy-modal/hy-modal.vue +6 -6
- package/components/hy-modal/index.scss +1 -1
- package/components/hy-navbar/hy-navbar.vue +6 -6
- package/components/hy-notice-bar/hy-notice-bar.vue +14 -9
- package/components/hy-notify/hy-notify.vue +6 -6
- package/components/hy-number-step/hy-number-step.vue +8 -6
- package/components/hy-overlay/hy-overlay.vue +8 -9
- package/components/hy-pagination/hy-pagination.vue +11 -8
- package/components/hy-picker/hy-picker.vue +9 -9
- package/components/hy-popover/hy-popover.vue +11 -7
- package/components/hy-popup/hy-popup.vue +9 -7
- package/components/hy-price/hy-price.vue +6 -5
- package/components/hy-qrcode/hy-qrcode.vue +6 -8
- package/components/hy-radio/hy-radio.vue +10 -12
- package/components/hy-rate/hy-rate.vue +7 -7
- package/components/hy-read-more/hy-read-more.vue +6 -5
- package/components/hy-scroll-list/hy-scroll-list.vue +6 -5
- package/components/hy-search/hy-search.vue +8 -6
- package/components/hy-signature/hy-signature.vue +6 -5
- package/components/hy-slider/hy-slider.vue +8 -7
- package/components/hy-steps/hy-steps.vue +10 -17
- package/components/hy-submit-bar/hy-submit-bar.vue +6 -6
- package/components/hy-subsection/hy-subsection.vue +16 -19
- package/components/hy-swipe-action/hy-swipe-action.vue +18 -19
- package/components/hy-swiper/hy-swiper.vue +15 -15
- package/components/hy-swiper/typing.d.ts +13 -1
- package/components/hy-switch/hy-switch.vue +17 -10
- package/components/hy-tabBar/hy-tabBar.vue +35 -26
- package/components/hy-tabs/hy-tabs.vue +28 -21
- package/components/hy-tag/hy-tag.vue +13 -17
- package/components/hy-tag/typing.d.ts +1 -1
- package/components/hy-text/hy-text.vue +12 -14
- package/components/hy-textarea/hy-textarea.vue +7 -6
- package/components/hy-textarea/index.scss +7 -2
- package/components/hy-toast/hy-toast.vue +72 -75
- package/components/hy-tooltip/hy-tooltip.vue +8 -14
- package/components/hy-transition/hy-transition.vue +8 -6
- package/components/hy-upload/hy-upload.vue +6 -5
- package/components/hy-warn/hy-warn.vue +6 -6
- package/components/hy-waterfall/hy-waterfall.vue +8 -7
- package/components/hy-watermark/hy-watermark.vue +20 -10
- package/libs/css/common.scss +5 -0
- package/libs/css/vars.css +1 -1
- package/package.json +2 -2
- package/theme.scss +1 -1
- package/utils/inspect.ts +1 -1
- package/web-types.json +1 -1
|
@@ -52,11 +52,6 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script lang="ts">
|
|
55
|
-
/**
|
|
56
|
-
* 此组件集成了文本类在项目中的常用功能,包括状态,拨打电话,格式化日期,*替换,超链接...等功能。 您大可不必在使用特殊文本时自己定义,text组件几乎涵盖您能使用的大部分场景。
|
|
57
|
-
* @displayName hy-text
|
|
58
|
-
*/
|
|
59
|
-
defineOptions({})
|
|
60
55
|
export default {
|
|
61
56
|
name: 'hy-text',
|
|
62
57
|
options: {
|
|
@@ -68,17 +63,24 @@ export default {
|
|
|
68
63
|
</script>
|
|
69
64
|
|
|
70
65
|
<script setup lang="ts">
|
|
71
|
-
import { computed,
|
|
66
|
+
import { computed, nextTick, toRefs } from 'vue'
|
|
67
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
72
68
|
import type { ITextEmits } from './typing'
|
|
73
69
|
import { addUnit, error, formatName, formatTime, isDate, priceFormat } from '../../utils'
|
|
74
70
|
|
|
75
71
|
// 组件
|
|
76
72
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
77
73
|
|
|
74
|
+
/**
|
|
75
|
+
* 此组件集成了文本类在项目中的常用功能,包括状态,拨打电话,格式化日期,*替换,超链接...等功能。 您大可不必在使用特殊文本时自己定义,text组件几乎涵盖您能使用的大部分场景。
|
|
76
|
+
* @displayName hy-text
|
|
77
|
+
*/
|
|
78
|
+
defineOptions({})
|
|
79
|
+
|
|
78
80
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
79
81
|
const props = defineProps({
|
|
80
82
|
/** 显示的值 */
|
|
81
|
-
text: String,
|
|
83
|
+
text: [String, Number],
|
|
82
84
|
/** 主题颜色 */
|
|
83
85
|
type: String,
|
|
84
86
|
/** 是否显示 */
|
|
@@ -120,22 +122,18 @@ const props = defineProps({
|
|
|
120
122
|
default: false,
|
|
121
123
|
},
|
|
122
124
|
/** 文本显示的行数,如果设置,超出此行数,将会显示省略号 */
|
|
123
|
-
lines: String,
|
|
125
|
+
lines: [String, Number],
|
|
124
126
|
/** 文本颜色 */
|
|
125
127
|
color: String,
|
|
126
128
|
/** 字体大小 */
|
|
127
129
|
size: {
|
|
128
|
-
type: Number,
|
|
130
|
+
type: [String, Number],
|
|
129
131
|
default: 15,
|
|
130
132
|
},
|
|
131
133
|
/** 图标的样式 */
|
|
132
134
|
iconStyle: {
|
|
133
135
|
type: Object as unknown as PropType<CSSProperties>,
|
|
134
|
-
default() {
|
|
135
|
-
return {
|
|
136
|
-
fontSize: '15px',
|
|
137
|
-
}
|
|
138
|
-
},
|
|
136
|
+
default: () => ({ fontSize: '15px' }),
|
|
139
137
|
},
|
|
140
138
|
/**
|
|
141
139
|
* 文字装饰,下划线,中划线等,可选值
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<textarea
|
|
7
7
|
class="hy-textarea--field"
|
|
8
8
|
:value="innerValue"
|
|
9
|
-
:style="{ height: addUnit(height) }"
|
|
9
|
+
:style="{ height: autoHeight ? 'auto' : addUnit(height) }"
|
|
10
10
|
:placeholder="placeholder || ''"
|
|
11
11
|
:placeholder-style="placeholderStyle"
|
|
12
12
|
:placeholder-class="placeholderClass"
|
|
@@ -46,11 +46,6 @@
|
|
|
46
46
|
</template>
|
|
47
47
|
|
|
48
48
|
<script lang="ts">
|
|
49
|
-
/**
|
|
50
|
-
* 用于输入多行文本信息,聊天输入框等。
|
|
51
|
-
* @displayName hy-textarea
|
|
52
|
-
*/
|
|
53
|
-
defineOptions({})
|
|
54
49
|
export default {
|
|
55
50
|
name: 'hy-textarea',
|
|
56
51
|
options: {
|
|
@@ -67,6 +62,12 @@ import type { CSSProperties, PropType } from 'vue'
|
|
|
67
62
|
import type { ITextareaEmits } from './typing'
|
|
68
63
|
import { addUnit } from '../../utils'
|
|
69
64
|
|
|
65
|
+
/**
|
|
66
|
+
* 用于输入多行文本信息,聊天输入框等。
|
|
67
|
+
* @displayName hy-textarea
|
|
68
|
+
*/
|
|
69
|
+
defineOptions({})
|
|
70
|
+
|
|
70
71
|
// const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
71
72
|
const props = defineProps({
|
|
72
73
|
/** 输入框的内容 */
|
|
@@ -6,7 +6,12 @@
|
|
|
6
6
|
position: relative;
|
|
7
7
|
@include flex;
|
|
8
8
|
flex: 1;
|
|
9
|
-
padding: $hy-border-margin-padding-
|
|
9
|
+
padding: $hy-border-margin-padding-sm;
|
|
10
|
+
|
|
11
|
+
@include m(field) {
|
|
12
|
+
min-height: 50rpx;
|
|
13
|
+
max-height: 200rpx;
|
|
14
|
+
}
|
|
10
15
|
|
|
11
16
|
@include m(radius) {
|
|
12
17
|
border-radius: $hy-border-radius-sm;
|
|
@@ -36,4 +41,4 @@
|
|
|
36
41
|
padding: 1px 4px;
|
|
37
42
|
border-radius: $hy-border-radius-sm;
|
|
38
43
|
}
|
|
39
|
-
}
|
|
44
|
+
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<HyOverlay
|
|
3
|
-
:show="isShow"
|
|
4
|
-
:zIndex="tmpConfig.overlay ? 10070 : -1"
|
|
5
|
-
:custom-style="overlayStyle"
|
|
6
|
-
>
|
|
2
|
+
<HyOverlay :show="isShow" :zIndex="tmpConfig.overlay ? 10070 : -1" :custom-style="overlayStyle">
|
|
7
3
|
<view
|
|
8
4
|
:style="[contentStyle]"
|
|
9
5
|
:class="[
|
|
10
6
|
'hy-toast__content',
|
|
11
7
|
'hy-toast--' + tmpConfig.type,
|
|
12
|
-
tmpConfig.type === 'loading' || tmpConfig.loading
|
|
13
|
-
? 'hy-toast__content--loading'
|
|
14
|
-
: '',
|
|
8
|
+
tmpConfig.type === 'loading' || tmpConfig.loading ? 'hy-toast__content--loading' : '',
|
|
15
9
|
]"
|
|
16
10
|
>
|
|
17
11
|
<HyLoading
|
|
@@ -30,13 +24,11 @@
|
|
|
30
24
|
:customStyle="iconStyle"
|
|
31
25
|
></HyIcon>
|
|
32
26
|
<text
|
|
33
|
-
:class="[
|
|
34
|
-
'hy-toast__content__text',
|
|
35
|
-
'hy-toast__content__text--' + tmpConfig.type,
|
|
36
|
-
]"
|
|
27
|
+
:class="['hy-toast__content__text', 'hy-toast__content__text--' + tmpConfig.type]"
|
|
37
28
|
style="max-width: 400rpx"
|
|
38
|
-
>{{ tmpConfig.message }}</text
|
|
39
29
|
>
|
|
30
|
+
{{ tmpConfig.message }}
|
|
31
|
+
</text>
|
|
40
32
|
</view>
|
|
41
33
|
</HyOverlay>
|
|
42
34
|
</template>
|
|
@@ -47,140 +39,145 @@ export default {
|
|
|
47
39
|
options: {
|
|
48
40
|
addGlobalClass: true,
|
|
49
41
|
virtualHost: true,
|
|
50
|
-
styleIsolation: 'shared'
|
|
51
|
-
}
|
|
42
|
+
styleIsolation: 'shared',
|
|
43
|
+
},
|
|
52
44
|
}
|
|
53
45
|
</script>
|
|
54
46
|
|
|
55
47
|
<script setup lang="ts">
|
|
56
|
-
import { computed, type CSSProperties, reactive, ref
|
|
57
|
-
import type ToastParamsVo from
|
|
58
|
-
import { getWindowInfo, hexToRgb } from
|
|
59
|
-
import { ColorConfig, iconName } from
|
|
48
|
+
import { computed, type CSSProperties, reactive, ref } from 'vue'
|
|
49
|
+
import type ToastParamsVo from './typing'
|
|
50
|
+
import { getWindowInfo, hexToRgb } from '../../utils'
|
|
51
|
+
import { ColorConfig, iconName } from '../../config'
|
|
60
52
|
|
|
61
53
|
// 组件
|
|
62
|
-
import HyOverlay from
|
|
63
|
-
import HyIcon from
|
|
64
|
-
import HyLoading from
|
|
54
|
+
import HyOverlay from '../hy-overlay/hy-overlay.vue'
|
|
55
|
+
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
56
|
+
import HyLoading from '../hy-loading/hy-loading.vue'
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Toast 组件主要用于消息通知、加载提示、操作结果提示等醒目提示效果,我们为其提供了多种丰富的API。
|
|
60
|
+
* @displayName hy-toast
|
|
61
|
+
*/
|
|
62
|
+
defineOptions({})
|
|
65
63
|
|
|
66
|
-
const isShow = ref(false)
|
|
67
|
-
const tmpConfig = ref<ToastParamsVo>({})
|
|
64
|
+
const isShow = ref(false)
|
|
65
|
+
const tmpConfig = ref<ToastParamsVo>({})
|
|
68
66
|
const config: ToastParamsVo = reactive({
|
|
69
|
-
message:
|
|
70
|
-
type:
|
|
67
|
+
message: '',
|
|
68
|
+
type: 'info',
|
|
71
69
|
duration: 2000,
|
|
72
70
|
icon: false,
|
|
73
|
-
position:
|
|
71
|
+
position: 'center',
|
|
74
72
|
complete: null,
|
|
75
73
|
overlay: true,
|
|
76
74
|
loading: false,
|
|
77
|
-
})
|
|
78
|
-
let timer: any = null
|
|
75
|
+
})
|
|
76
|
+
let timer: any = null
|
|
79
77
|
|
|
80
78
|
const isThemeType = (type: string): boolean =>
|
|
81
|
-
[
|
|
79
|
+
['error', 'warning', 'success', 'primary', 'info'].includes(type)
|
|
82
80
|
|
|
83
81
|
const overlayStyle = computed(() => {
|
|
84
82
|
const style: CSSProperties = {
|
|
85
|
-
justifyContent:
|
|
86
|
-
alignItems:
|
|
87
|
-
display:
|
|
88
|
-
}
|
|
83
|
+
justifyContent: 'center',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
display: 'flex',
|
|
86
|
+
}
|
|
89
87
|
// 将遮罩设置为100%透明度,避免出现灰色背景
|
|
90
|
-
style.backgroundColor =
|
|
91
|
-
return style
|
|
92
|
-
})
|
|
88
|
+
style.backgroundColor = 'rgba(0, 0, 0, 0)'
|
|
89
|
+
return style
|
|
90
|
+
})
|
|
93
91
|
|
|
94
92
|
const iconNameCom = computed(() => {
|
|
95
93
|
// 只有不为none,并且type为error|warning|succes|info时候,才显示图标
|
|
96
94
|
if (!tmpConfig.value.icon || !tmpConfig.value.type) {
|
|
97
|
-
return
|
|
95
|
+
return ''
|
|
98
96
|
}
|
|
99
97
|
if (tmpConfig.value.icon === true) {
|
|
100
98
|
if (isThemeType(tmpConfig.value.type)) {
|
|
101
|
-
return iconName(tmpConfig.value.type)
|
|
99
|
+
return iconName(tmpConfig.value.type)
|
|
102
100
|
} else {
|
|
103
|
-
return
|
|
101
|
+
return ''
|
|
104
102
|
}
|
|
105
103
|
} else {
|
|
106
|
-
return tmpConfig.value.icon
|
|
104
|
+
return tmpConfig.value.icon
|
|
107
105
|
}
|
|
108
|
-
})
|
|
106
|
+
})
|
|
109
107
|
const iconStyle = computed(() => {
|
|
110
|
-
const style: CSSProperties = {}
|
|
108
|
+
const style: CSSProperties = {}
|
|
111
109
|
// 图标需要一个右边距,以跟右边的文字有隔开的距离
|
|
112
|
-
style.marginRight =
|
|
113
|
-
return style
|
|
114
|
-
})
|
|
110
|
+
style.marginRight = '4px'
|
|
111
|
+
return style
|
|
112
|
+
})
|
|
115
113
|
|
|
116
114
|
/**
|
|
117
115
|
* @description 内容盒子的样式
|
|
118
116
|
* */
|
|
119
117
|
const contentStyle = computed(() => {
|
|
120
118
|
const windowHeight = getWindowInfo().windowHeight,
|
|
121
|
-
style: CSSProperties = {}
|
|
122
|
-
let value = 0
|
|
119
|
+
style: CSSProperties = {}
|
|
120
|
+
let value = 0
|
|
123
121
|
// 根据top和bottom,对Y轴进行窗体高度的百分比偏移
|
|
124
|
-
if (tmpConfig.value.position ===
|
|
125
|
-
value = -windowHeight * 0.25
|
|
126
|
-
} else if (tmpConfig.value.position ===
|
|
127
|
-
value = windowHeight * 0.25
|
|
122
|
+
if (tmpConfig.value.position === 'top') {
|
|
123
|
+
value = -windowHeight * 0.25
|
|
124
|
+
} else if (tmpConfig.value.position === 'bottom') {
|
|
125
|
+
value = windowHeight * 0.25
|
|
128
126
|
}
|
|
129
|
-
style.transform = `translateY(${value}px)
|
|
130
|
-
return style
|
|
131
|
-
})
|
|
127
|
+
style.transform = `translateY(${value}px)`
|
|
128
|
+
return style
|
|
129
|
+
})
|
|
132
130
|
|
|
133
131
|
const loadingIconColor = computed(() => {
|
|
134
|
-
let colorTmp =
|
|
132
|
+
let colorTmp = 'rgb(255, 255, 255)'
|
|
135
133
|
if (isThemeType(tmpConfig.value.type)) {
|
|
136
134
|
// loading-icon组件内部会对color参数进行一个透明度处理,该方法要求传入的颜色值
|
|
137
135
|
// 必须为rgb格式的,所以这里做一个处理
|
|
138
|
-
colorTmp = hexToRgb(ColorConfig[tmpConfig.value.type]) as string
|
|
136
|
+
colorTmp = hexToRgb(ColorConfig[tmpConfig.value.type]) as string
|
|
139
137
|
}
|
|
140
|
-
return colorTmp
|
|
141
|
-
})
|
|
138
|
+
return colorTmp
|
|
139
|
+
})
|
|
142
140
|
|
|
143
141
|
/**
|
|
144
142
|
* @description 显示toast组件,由父组件通过xxx.show(options)形式调用
|
|
145
143
|
* */
|
|
146
144
|
const show = (options: ToastParamsVo) => {
|
|
147
145
|
// 不将结果合并到this.config变量,避免多次调用u-toast,前后的配置造成混乱
|
|
148
|
-
tmpConfig.value = Object.assign(config, options)
|
|
146
|
+
tmpConfig.value = Object.assign(config, options)
|
|
149
147
|
// 清除定时器
|
|
150
|
-
clearTimer()
|
|
151
|
-
isShow.value = true
|
|
148
|
+
clearTimer()
|
|
149
|
+
isShow.value = true
|
|
152
150
|
// -1时不自动关闭
|
|
153
151
|
if (tmpConfig.value.duration !== -1) {
|
|
154
152
|
timer = setTimeout(() => {
|
|
155
153
|
// 倒计时结束,清除定时器,隐藏toast组件
|
|
156
|
-
clearTimer()
|
|
154
|
+
clearTimer()
|
|
157
155
|
// 判断是否存在callback方法,如果存在就执行
|
|
158
|
-
typeof tmpConfig.value.complete ===
|
|
159
|
-
|
|
160
|
-
}, tmpConfig.value.duration);
|
|
156
|
+
typeof tmpConfig.value.complete === 'function' && tmpConfig.value.complete()
|
|
157
|
+
}, tmpConfig.value.duration)
|
|
161
158
|
}
|
|
162
|
-
}
|
|
159
|
+
}
|
|
163
160
|
|
|
164
161
|
// 隐藏toast组件,由父组件通过this.$refs.xxx.hide()形式调用
|
|
165
162
|
const hide = () => {
|
|
166
|
-
clearTimer()
|
|
167
|
-
}
|
|
163
|
+
clearTimer()
|
|
164
|
+
}
|
|
168
165
|
/**
|
|
169
166
|
* @description 清除定时任务
|
|
170
167
|
* */
|
|
171
168
|
const clearTimer = () => {
|
|
172
|
-
isShow.value = false
|
|
169
|
+
isShow.value = false
|
|
173
170
|
// 清除定时器
|
|
174
|
-
clearTimeout(timer)
|
|
175
|
-
timer = null
|
|
176
|
-
}
|
|
171
|
+
clearTimeout(timer)
|
|
172
|
+
timer = null
|
|
173
|
+
}
|
|
177
174
|
|
|
178
175
|
defineExpose({
|
|
179
176
|
show,
|
|
180
177
|
hide,
|
|
181
|
-
})
|
|
178
|
+
})
|
|
182
179
|
</script>
|
|
183
180
|
|
|
184
181
|
<style scoped lang="scss">
|
|
185
|
-
@import
|
|
182
|
+
@import './index.scss';
|
|
186
183
|
</style>
|
|
@@ -89,11 +89,6 @@
|
|
|
89
89
|
</template>
|
|
90
90
|
|
|
91
91
|
<script lang="ts">
|
|
92
|
-
/**
|
|
93
|
-
* Tooltip组件主要用于长按操作,类似微信的长按气泡
|
|
94
|
-
* @displayName hy-tooltip
|
|
95
|
-
*/
|
|
96
|
-
defineOptions({})
|
|
97
92
|
export default {
|
|
98
93
|
name: 'hy-tooltip',
|
|
99
94
|
options: {
|
|
@@ -105,15 +100,8 @@ export default {
|
|
|
105
100
|
</script>
|
|
106
101
|
|
|
107
102
|
<script setup lang="ts">
|
|
108
|
-
import {
|
|
109
|
-
|
|
110
|
-
type CSSProperties,
|
|
111
|
-
toRefs,
|
|
112
|
-
ref,
|
|
113
|
-
onMounted,
|
|
114
|
-
getCurrentInstance,
|
|
115
|
-
type PropType,
|
|
116
|
-
} from 'vue'
|
|
103
|
+
import { computed, toRefs, ref, onMounted, getCurrentInstance } from 'vue'
|
|
104
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
117
105
|
import type { ITooltipEmits } from './typing'
|
|
118
106
|
import { addUnit, getRect, guid, sleep } from '../../utils'
|
|
119
107
|
|
|
@@ -122,6 +110,12 @@ import HyOverlay from '../hy-overlay/hy-overlay.vue'
|
|
|
122
110
|
import HyTransition from '../hy-transition/hy-transition.vue'
|
|
123
111
|
import HyLine from '../hy-line/hy-line.vue'
|
|
124
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Tooltip组件主要用于长按操作,类似微信的长按气泡
|
|
115
|
+
* @displayName hy-tooltip
|
|
116
|
+
*/
|
|
117
|
+
defineOptions({})
|
|
118
|
+
|
|
125
119
|
// const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
126
120
|
const props = defineProps({
|
|
127
121
|
/** 需要显示的提示文字 */
|
|
@@ -12,11 +12,6 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script lang="ts">
|
|
15
|
-
/**
|
|
16
|
-
* 该组件用于组件的动画过渡效果。
|
|
17
|
-
* @displayName hy-transition
|
|
18
|
-
*/
|
|
19
|
-
defineOptions({})
|
|
20
15
|
export default {
|
|
21
16
|
name: 'hy-transition',
|
|
22
17
|
options: {
|
|
@@ -28,10 +23,17 @@ export default {
|
|
|
28
23
|
</script>
|
|
29
24
|
|
|
30
25
|
<script setup lang="ts">
|
|
31
|
-
import { computed,
|
|
26
|
+
import { computed, ref, watch, nextTick, toRefs } from 'vue'
|
|
27
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
32
28
|
import { sleep } from '../../utils'
|
|
33
29
|
import type { ITransitionEmits } from './typing'
|
|
34
30
|
|
|
31
|
+
/**
|
|
32
|
+
* 该组件用于组件的动画过渡效果。
|
|
33
|
+
* @displayName hy-transition
|
|
34
|
+
*/
|
|
35
|
+
defineOptions({})
|
|
36
|
+
|
|
35
37
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
36
38
|
const props = defineProps({
|
|
37
39
|
/** 是否展示组件 */
|
|
@@ -96,11 +96,6 @@
|
|
|
96
96
|
</template>
|
|
97
97
|
|
|
98
98
|
<script lang="ts">
|
|
99
|
-
/**
|
|
100
|
-
* 该组件用于上传图片或者视频等场景
|
|
101
|
-
* @displayName hy-upload
|
|
102
|
-
*/
|
|
103
|
-
defineOptions({})
|
|
104
99
|
export default {
|
|
105
100
|
name: 'hy-upload',
|
|
106
101
|
options: {
|
|
@@ -121,6 +116,12 @@ import { IconConfig } from '../../config'
|
|
|
121
116
|
// 组件
|
|
122
117
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
123
118
|
|
|
119
|
+
/**
|
|
120
|
+
* 该组件用于上传图片或者视频等场景
|
|
121
|
+
* @displayName hy-upload
|
|
122
|
+
*/
|
|
123
|
+
defineOptions({})
|
|
124
|
+
|
|
124
125
|
const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
125
126
|
const {
|
|
126
127
|
accept,
|
|
@@ -51,11 +51,6 @@
|
|
|
51
51
|
</template>
|
|
52
52
|
|
|
53
53
|
<script lang="ts">
|
|
54
|
-
/**
|
|
55
|
-
* 警告提示,展现需要关注的信息
|
|
56
|
-
* @displayName hy-warn
|
|
57
|
-
*/
|
|
58
|
-
defineOptions({})
|
|
59
54
|
export default {
|
|
60
55
|
name: 'hy-warn',
|
|
61
56
|
options: {
|
|
@@ -72,11 +67,16 @@ import type { CSSProperties, PropType } from 'vue'
|
|
|
72
67
|
import type { IWarnEmits } from './typing'
|
|
73
68
|
import { addUnit } from '../../utils'
|
|
74
69
|
import { IconConfig, iconName } from '../../config'
|
|
75
|
-
|
|
76
70
|
// 组件
|
|
77
71
|
import HyTransition from '../hy-transition/hy-transition.vue'
|
|
78
72
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
79
73
|
|
|
74
|
+
/**
|
|
75
|
+
* 警告提示,展现需要关注的信息
|
|
76
|
+
* @displayName hy-warn
|
|
77
|
+
*/
|
|
78
|
+
defineOptions({})
|
|
79
|
+
|
|
80
80
|
// const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
81
81
|
const props = defineProps({
|
|
82
82
|
/** 显示的文字 */
|
|
@@ -10,13 +10,6 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script lang="ts">
|
|
13
|
-
/**
|
|
14
|
-
* 这是一个瀑布流形式的组件,内容分为左右两列,结合uview的懒加载组件效果更佳。
|
|
15
|
-
* 相较于某些只是奇偶数左右分别,或者没有利用vue作用域插槽的做法,
|
|
16
|
-
* uView的瀑布流实现了真正的 组件化,搭配LazyLoad 懒加载和loadMore 加载更多组件,让您开箱即用,眼前一亮。
|
|
17
|
-
* @displayName hy-waterfall
|
|
18
|
-
*/
|
|
19
|
-
defineOptions({})
|
|
20
13
|
export default {
|
|
21
14
|
name: 'hy-waterfall',
|
|
22
15
|
options: {
|
|
@@ -31,6 +24,14 @@ export default {
|
|
|
31
24
|
import { computed, getCurrentInstance, ref, toRefs, watch } from 'vue'
|
|
32
25
|
import { getRect, isArray } from '../../utils'
|
|
33
26
|
|
|
27
|
+
/**
|
|
28
|
+
* 这是一个瀑布流形式的组件,内容分为左右两列,结合uview的懒加载组件效果更佳。
|
|
29
|
+
* 相较于某些只是奇偶数左右分别,或者没有利用vue作用域插槽的做法,
|
|
30
|
+
* uView的瀑布流实现了真正的 组件化,搭配LazyLoad 懒加载和loadMore 加载更多组件,让您开箱即用,眼前一亮。
|
|
31
|
+
* @displayName hy-waterfall
|
|
32
|
+
*/
|
|
33
|
+
defineOptions({})
|
|
34
|
+
|
|
34
35
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
35
36
|
const props = defineProps({
|
|
36
37
|
/** 数据列表 */
|
|
@@ -15,11 +15,6 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script lang="ts">
|
|
18
|
-
/**
|
|
19
|
-
* 在页面或组件上添加指定的图片或文字,可用于版权保护、品牌宣传等场景。
|
|
20
|
-
* @displayName hy-watermark
|
|
21
|
-
*/
|
|
22
|
-
defineOptions({})
|
|
23
18
|
export default {
|
|
24
19
|
name: 'hy-watermark',
|
|
25
20
|
options: {
|
|
@@ -31,15 +26,24 @@ export default {
|
|
|
31
26
|
</script>
|
|
32
27
|
|
|
33
28
|
<script lang="ts" setup>
|
|
34
|
-
import { computed, onMounted, ref, watch, nextTick, type CSSProperties
|
|
29
|
+
import { computed, onMounted, ref, watch, nextTick, type CSSProperties } from 'vue'
|
|
35
30
|
import { addUnit, guid } from '../../utils'
|
|
36
31
|
|
|
32
|
+
/**
|
|
33
|
+
* 在页面或组件上添加指定的图片或文字,可用于版权保护、品牌宣传等场景。
|
|
34
|
+
* @displayName hy-watermark
|
|
35
|
+
*/
|
|
36
|
+
defineOptions({})
|
|
37
|
+
|
|
37
38
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
38
39
|
const props = defineProps({
|
|
39
40
|
/** 显示内容 */
|
|
40
41
|
content: String,
|
|
41
42
|
/** 显示图片的地址,支持网络图片和base64(钉钉小程序仅支持网络图片) */
|
|
42
|
-
image:
|
|
43
|
+
image: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: '',
|
|
46
|
+
},
|
|
43
47
|
/** 图片高度 */
|
|
44
48
|
imageHeight: {
|
|
45
49
|
type: Number,
|
|
@@ -86,9 +90,15 @@ const props = defineProps({
|
|
|
86
90
|
default: 14,
|
|
87
91
|
},
|
|
88
92
|
/** 水印字体样式(仅微信和h5支持) */
|
|
89
|
-
fontStyle:
|
|
93
|
+
fontStyle: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: '',
|
|
96
|
+
},
|
|
90
97
|
/** 水印字体的粗细 */
|
|
91
|
-
fontWeight:
|
|
98
|
+
fontWeight: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: '',
|
|
101
|
+
},
|
|
92
102
|
/** 水印字体系列(仅微信和h5支持) */
|
|
93
103
|
fontFamily: {
|
|
94
104
|
type: String,
|
|
@@ -507,7 +517,7 @@ function drawTextOffScreen(
|
|
|
507
517
|
ctx.textAlign = 'center'
|
|
508
518
|
ctx.translate(contentWidth / 2, contentWidth / 2)
|
|
509
519
|
ctx.rotate((Math.PI / 180) * rotate)
|
|
510
|
-
ctx.font = `${fontStyle} normal ${fontWeight} ${fontSize}px
|
|
520
|
+
ctx.font = `${fontStyle} normal ${fontWeight} ${fontSize}px ${fontFamily}`
|
|
511
521
|
ctx.fillStyle = color
|
|
512
522
|
ctx.fillText(content, 0, 0)
|
|
513
523
|
ctx.restore()
|
package/libs/css/common.scss
CHANGED
package/libs/css/vars.css
CHANGED
package/package.json
CHANGED
package/theme.scss
CHANGED
|
@@ -88,4 +88,4 @@ $hy-border-margin-padding-sm: var(--hy-border-margin-padding-sm, 10rpx) !default
|
|
|
88
88
|
$hy-border-margin-padding-base: var(--hy-border-margin-padding-base, 20rpx) !default;
|
|
89
89
|
$hy-border-margin-padding-lg: var(--hy-border-margin-padding-lg, 30rpx) !default;
|
|
90
90
|
/* 底部线条 */
|
|
91
|
-
$hy-border-line: var(--hy-border-line,
|
|
91
|
+
$hy-border-line: var(--hy-border-line, 1rpx solid rgba(0, 0, 0, 0.02)) !default;
|
package/utils/inspect.ts
CHANGED
|
@@ -35,7 +35,7 @@ export const isArray = (arr: any): arr is Array<any> => {
|
|
|
35
35
|
* @param obj 传入对象值
|
|
36
36
|
* @return {boolean}
|
|
37
37
|
*/
|
|
38
|
-
export const isObject = (obj: any):
|
|
38
|
+
export const isObject = (obj: any): obj is Object => {
|
|
39
39
|
return Object.prototype.toString.call(obj) === '[object Object]'
|
|
40
40
|
}
|
|
41
41
|
|