hy-app 0.2.16 → 0.3.0
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-form/README.md +301 -0
- package/components/hy-form/hy-form.vue +252 -533
- package/components/hy-form/index.ts +5 -0
- package/components/hy-form/typing.d.ts +57 -77
- package/components/hy-form-group/hy-form-group.vue +533 -0
- package/components/hy-form-group/typing.d.ts +77 -0
- package/components/hy-form-item/hy-form-item.vue +199 -0
- package/components/hy-form-item/index.scss +41 -0
- package/components/hy-form-item/typing.d.ts +43 -0
- 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 +17 -11
- 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-login/TheUserLogin.vue +82 -90
- 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 +31 -25
- package/components/hy-swipe-action/typing.d.ts +1 -1
- 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 +16 -13
- package/components/hy-textarea/index.scss +7 -2
- package/components/hy-textarea/typing.d.ts +1 -1
- 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/components/index.ts +7 -1
- package/global.d.ts +3 -1
- package/libs/css/common.scss +5 -0
- package/libs/css/mixin.scss +2 -1
- package/libs/css/vars.css +1 -1
- package/package.json +2 -2
- package/theme.scss +1 -1
- package/utils/inspect.ts +34 -34
- package/utils/utils.ts +1 -19
- package/web-types.json +1 -1
- /package/components/{hy-form → hy-form-group}/index.scss +0 -0
- /package/components/{hy-form → hy-form-group}/props.ts +0 -0
|
@@ -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: {
|
|
@@ -62,10 +57,17 @@ export default {
|
|
|
62
57
|
</script>
|
|
63
58
|
|
|
64
59
|
<script setup lang="ts">
|
|
65
|
-
import { computed, ref, toRefs, watch, nextTick } from 'vue'
|
|
60
|
+
import { computed, ref, toRefs, watch, nextTick, inject } from 'vue'
|
|
66
61
|
import type { CSSProperties, PropType } from 'vue'
|
|
67
62
|
import type { ITextareaEmits } from './typing'
|
|
68
63
|
import { addUnit } from '../../utils'
|
|
64
|
+
import { FormItemContext } from '@/package/components/hy-form-item/typing'
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 用于输入多行文本信息,聊天输入框等。
|
|
68
|
+
* @displayName hy-textarea
|
|
69
|
+
*/
|
|
70
|
+
defineOptions({})
|
|
69
71
|
|
|
70
72
|
// const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
71
73
|
const props = defineProps({
|
|
@@ -176,6 +178,7 @@ const props = defineProps({
|
|
|
176
178
|
})
|
|
177
179
|
const { modelValue, customStyle, border, disabled, formatter } = toRefs(props)
|
|
178
180
|
const emit = defineEmits<ITextareaEmits>()
|
|
181
|
+
const formItem = inject<FormItemContext>('formItem')
|
|
179
182
|
|
|
180
183
|
// 输入框的值
|
|
181
184
|
const innerValue = ref<string>('')
|
|
@@ -248,16 +251,17 @@ const onFocus = (e: FocusEvent) => {
|
|
|
248
251
|
isFocus.value = true
|
|
249
252
|
emit('focus', e)
|
|
250
253
|
}
|
|
251
|
-
const onBlur = (e:
|
|
254
|
+
const onBlur = (e: any) => {
|
|
252
255
|
isFocus.value = false
|
|
253
256
|
emit('blur', e)
|
|
257
|
+
formItem.handleBlur(e.detail.value)
|
|
254
258
|
// 尝试调用u-form的验证方法
|
|
255
259
|
// formValidate(this, "blur");
|
|
256
260
|
}
|
|
257
|
-
const onLinechange = (e:
|
|
258
|
-
emit('
|
|
261
|
+
const onLinechange = (e: any) => {
|
|
262
|
+
emit('lineChange', e)
|
|
259
263
|
}
|
|
260
|
-
const onInput = (e:
|
|
264
|
+
const onInput = (e: any) => {
|
|
261
265
|
let { value } = e?.detail
|
|
262
266
|
// 格式化过滤方法
|
|
263
267
|
const format = formatter.value || innerFormatter
|
|
@@ -279,8 +283,7 @@ const valueChange = () => {
|
|
|
279
283
|
// 标识value值的变化是由内部引起的
|
|
280
284
|
changeFromInner.value = true
|
|
281
285
|
emit('change', value)
|
|
282
|
-
|
|
283
|
-
// formValidate(this, "change");
|
|
286
|
+
formItem.handleChange(value)
|
|
284
287
|
})
|
|
285
288
|
}
|
|
286
289
|
const onConfirm = (e: Event) => {
|
|
@@ -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
|
+
}
|
|
@@ -36,7 +36,7 @@ export interface ITextareaEmits {
|
|
|
36
36
|
/** 点击完成时, 触发 confirm 事件 */
|
|
37
37
|
(e: 'confirm', event: any): void
|
|
38
38
|
/** 输入框行数变化时调用 */
|
|
39
|
-
(e: '
|
|
39
|
+
(e: 'lineChange', event: any): void
|
|
40
40
|
/** 当键盘输入时,触发 input 事件 */
|
|
41
41
|
(e: 'update:modelValue', value: string): void
|
|
42
42
|
/** 键盘高度发生变化的时候触发此事件 */
|
|
@@ -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/components/index.ts
CHANGED
|
@@ -19,7 +19,9 @@ import HyDropdownItem from './hy-dropdown-item/hy-dropdown-item.vue'
|
|
|
19
19
|
import YkEmpty from './hy-empty/hy-empty.vue'
|
|
20
20
|
import YkFloatButton from './hy-float-button/hy-float-button.vue'
|
|
21
21
|
import HyFoldingPanel from './hy-folding-panel/hy-folding-panel.vue'
|
|
22
|
-
import HyForm from '
|
|
22
|
+
import HyForm from '@/package/components/hy-form-group/hy-form.vue'
|
|
23
|
+
import HyFormSimple from '@/package/components/hy-form/hy-form-simple.vue'
|
|
24
|
+
import HyFormItem from './hy-form-item/hy-form-item.vue'
|
|
23
25
|
import HyGrid from './hy-grid/hy-grid.vue'
|
|
24
26
|
import HyIcon from './hy-icon/hy-icon.vue'
|
|
25
27
|
import HyImage from './hy-image/hy-image.vue'
|
|
@@ -80,6 +82,8 @@ const install = (Vue: any) => {
|
|
|
80
82
|
Vue.component('YkFloatButton', YkFloatButton)
|
|
81
83
|
Vue.component('HyFoldingPanel', HyFoldingPanel)
|
|
82
84
|
Vue.component('HyForm', HyForm)
|
|
85
|
+
Vue.component('HyFormSimple', HyFormSimple)
|
|
86
|
+
Vue.component('HyFormItem', HyFormItem)
|
|
83
87
|
Vue.component('HyGrid', HyGrid)
|
|
84
88
|
Vue.component('HyIcon', HyIcon)
|
|
85
89
|
Vue.component('HyImage', HyImage)
|
|
@@ -139,6 +143,8 @@ export {
|
|
|
139
143
|
YkFloatButton,
|
|
140
144
|
HyFoldingPanel,
|
|
141
145
|
HyForm,
|
|
146
|
+
HyFormSimple,
|
|
147
|
+
HyFormItem,
|
|
142
148
|
HyGrid,
|
|
143
149
|
HyIcon,
|
|
144
150
|
HyImage,
|
package/global.d.ts
CHANGED
|
@@ -24,7 +24,9 @@ declare module 'vue' {
|
|
|
24
24
|
HyEmpty: (typeof import('./components/hy-empty/hy-empty.vue'))['default']
|
|
25
25
|
HyFloatButton: (typeof import('./components/hy-float-button/hy-float-button.vue'))['default']
|
|
26
26
|
HyFloatingPanel: (typeof import('./components/hy-floating-panel/hy-floating-panel.vue'))['default']
|
|
27
|
-
HyForm: (typeof import('
|
|
27
|
+
HyForm: (typeof import('@/package/components/hy-form-group/hy-form.vue'))['default']
|
|
28
|
+
HyFormItem: (typeof import('./components/hy-form-item/hy-form-item.vue'))['default']
|
|
29
|
+
HyFormGroup: (typeof import('./components/hy-form-group/hy-form-group.vue'))['default']
|
|
28
30
|
HyGrid: (typeof import('./components/hy-grid/hy-grid.vue'))['default']
|
|
29
31
|
HyIcon: (typeof import('./components/hy-icon/hy-icon.vue'))['default']
|
|
30
32
|
HyImage: (typeof import('./components/hy-image/hy-image.vue'))['default']
|
package/libs/css/common.scss
CHANGED
package/libs/css/mixin.scss
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/* 加上-- */
|
|
14
15
|
@mixin m($modifier) {
|
|
15
16
|
$selector: &;
|
|
16
17
|
$currentSelector: '';
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
/* 定义元素(e
|
|
33
|
+
/* 定义元素(e)__,对于伪类,会自动将 e 嵌套在 伪类 底下 */
|
|
33
34
|
@mixin e($element...) {
|
|
34
35
|
$selector: &;
|
|
35
36
|
$selectors: "";
|
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;
|