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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<HyTransition
|
|
3
3
|
:show="show"
|
|
4
|
-
:custom-class="
|
|
4
|
+
:custom-class="`hy-overlay ${customClass}`"
|
|
5
5
|
:duration="duration"
|
|
6
6
|
:custom-style="overlayStyle"
|
|
7
7
|
@click="clickHandler"
|
|
@@ -11,11 +11,6 @@
|
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script lang="ts">
|
|
14
|
-
/**
|
|
15
|
-
* 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
|
|
16
|
-
* @displayName hy-overlay
|
|
17
|
-
*/
|
|
18
|
-
defineOptions({})
|
|
19
14
|
export default {
|
|
20
15
|
name: 'hy-overlay',
|
|
21
16
|
options: {
|
|
@@ -32,6 +27,12 @@ import type { CSSProperties, PropType } from 'vue'
|
|
|
32
27
|
import type { IOverlayEmits } from './typing'
|
|
33
28
|
import HyTransition from '../hy-transition/hy-transition.vue'
|
|
34
29
|
|
|
30
|
+
/**
|
|
31
|
+
* 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
|
|
32
|
+
* @displayName hy-overlay
|
|
33
|
+
*/
|
|
34
|
+
defineOptions({})
|
|
35
|
+
|
|
35
36
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
36
37
|
const props = defineProps({
|
|
37
38
|
/** 是否显示遮罩 */
|
|
@@ -55,9 +56,7 @@ const props = defineProps({
|
|
|
55
56
|
default: 0.5,
|
|
56
57
|
},
|
|
57
58
|
/** 定义需要用到的外部样式 */
|
|
58
|
-
customStyle:
|
|
59
|
-
type: Object as PropType<CSSProperties>,
|
|
60
|
-
},
|
|
59
|
+
customStyle: Object as PropType<CSSProperties>,
|
|
61
60
|
/** 自定义外部类名 */
|
|
62
61
|
customClass: String,
|
|
63
62
|
})
|
|
@@ -53,11 +53,6 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script lang="ts">
|
|
56
|
-
/**
|
|
57
|
-
* 当数据量过多时,使用分页分解数据。
|
|
58
|
-
* @displayName hy-pagination
|
|
59
|
-
*/
|
|
60
|
-
defineOptions({})
|
|
61
56
|
export default {
|
|
62
57
|
name: 'hy-pagination',
|
|
63
58
|
options: {
|
|
@@ -69,11 +64,19 @@ export default {
|
|
|
69
64
|
</script>
|
|
70
65
|
|
|
71
66
|
<script lang="ts" setup>
|
|
67
|
+
import { ref, toRefs, watch } from 'vue'
|
|
68
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
69
|
+
import type { IPaginationEmits } from './typing'
|
|
70
|
+
import { IconConfig } from '../../config'
|
|
71
|
+
// 组件
|
|
72
72
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
73
73
|
import HyButton from '../hy-button/hy-button.vue'
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 当数据量过多时,使用分页分解数据。
|
|
77
|
+
* @displayName hy-pagination
|
|
78
|
+
*/
|
|
79
|
+
defineOptions({})
|
|
77
80
|
|
|
78
81
|
// const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
79
82
|
const props = defineProps({
|
|
@@ -95,11 +95,6 @@
|
|
|
95
95
|
</template>
|
|
96
96
|
|
|
97
97
|
<script lang="ts">
|
|
98
|
-
/**
|
|
99
|
-
* 此选择器用于单列,多列,多列联动的选择场景。
|
|
100
|
-
* @displayName hy-picker
|
|
101
|
-
*/
|
|
102
|
-
defineOptions({})
|
|
103
98
|
export default {
|
|
104
99
|
name: 'hy-picker',
|
|
105
100
|
options: {
|
|
@@ -115,17 +110,22 @@ import { computed, PropType, ref, toRefs, watch } from 'vue'
|
|
|
115
110
|
import { deepClone, sleep, addUnit } from '../../utils'
|
|
116
111
|
import { IconConfig } from '../../config'
|
|
117
112
|
import type { IPickerEmits, PickerColumnVo } from './typing'
|
|
118
|
-
|
|
113
|
+
import type HyInputProps from '../hy-input/typing'
|
|
119
114
|
// 组件
|
|
120
115
|
import HyInput from '../hy-input/hy-input.vue'
|
|
121
116
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
122
117
|
import HyPopup from '../hy-popup/hy-popup.vue'
|
|
123
|
-
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 此选择器用于单列,多列,多列联动的选择场景。
|
|
121
|
+
* @displayName hy-picker
|
|
122
|
+
*/
|
|
123
|
+
defineOptions({})
|
|
124
124
|
|
|
125
125
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
126
126
|
const props = defineProps({
|
|
127
127
|
/** 显示到输入框值 */
|
|
128
|
-
modelValue: String,
|
|
128
|
+
modelValue: [String, Array],
|
|
129
129
|
/** 是否显示弹窗 */
|
|
130
130
|
show: {
|
|
131
131
|
type: Boolean,
|
|
@@ -329,7 +329,7 @@ const inputValue = computed(() => {
|
|
|
329
329
|
* @description 显示
|
|
330
330
|
* */
|
|
331
331
|
const onShowByClickInput = () => {
|
|
332
|
-
if (!input.value
|
|
332
|
+
if (!input.value?.disabled) {
|
|
333
333
|
showByClickInput.value = !showByClickInput.value
|
|
334
334
|
}
|
|
335
335
|
}
|
|
@@ -93,11 +93,6 @@
|
|
|
93
93
|
</template>
|
|
94
94
|
|
|
95
95
|
<script lang="ts">
|
|
96
|
-
/**
|
|
97
|
-
* 常用于展示提示信息。
|
|
98
|
-
* @displayName hy-popover
|
|
99
|
-
*/
|
|
100
|
-
defineOptions({})
|
|
101
96
|
export default {
|
|
102
97
|
name: 'hy-popover',
|
|
103
98
|
options: {
|
|
@@ -119,17 +114,22 @@ import {
|
|
|
119
114
|
useSlots,
|
|
120
115
|
watch,
|
|
121
116
|
inject,
|
|
122
|
-
PropType,
|
|
123
117
|
} from 'vue'
|
|
118
|
+
import type { PropType, CSSProperties } from 'vue'
|
|
124
119
|
import type { IOffset, IPopoverEmits, PopoverContentVo, PopoverExpose } from './typing'
|
|
125
120
|
import { isArray } from '../../utils'
|
|
126
121
|
import { type Queue, queueKey, usePopover } from '../../composables'
|
|
127
122
|
import { closeOther, pushToQueue, removeFromQueue } from '../../common'
|
|
128
|
-
|
|
129
123
|
// 组件
|
|
130
124
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
131
125
|
import HyTransition from '../hy-transition/hy-transition.vue'
|
|
132
126
|
|
|
127
|
+
/**
|
|
128
|
+
* 常用于展示提示信息。
|
|
129
|
+
* @displayName hy-popover
|
|
130
|
+
*/
|
|
131
|
+
defineOptions({})
|
|
132
|
+
|
|
133
133
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
134
134
|
const props = defineProps({
|
|
135
135
|
/** 控制 popover 的显示状态 */
|
|
@@ -170,6 +170,10 @@ const props = defineProps({
|
|
|
170
170
|
type: String,
|
|
171
171
|
default: 'normal',
|
|
172
172
|
},
|
|
173
|
+
/** 定义需要用到的外部样式 */
|
|
174
|
+
customStyle: Object as PropType<CSSProperties>,
|
|
175
|
+
/** 自定义外部类名 */
|
|
176
|
+
customClass: String,
|
|
173
177
|
})
|
|
174
178
|
const { modelValue, content, mode, placement } = toRefs(props)
|
|
175
179
|
const emit = defineEmits<IPopoverEmits>()
|
|
@@ -38,11 +38,6 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
40
|
<script lang="ts">
|
|
41
|
-
/**
|
|
42
|
-
* 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义。
|
|
43
|
-
* @displayName hy-popup
|
|
44
|
-
*/
|
|
45
|
-
defineOptions({})
|
|
46
41
|
export default {
|
|
47
42
|
name: 'hy-popup',
|
|
48
43
|
options: {
|
|
@@ -54,7 +49,8 @@ export default {
|
|
|
54
49
|
</script>
|
|
55
50
|
|
|
56
51
|
<script setup lang="ts">
|
|
57
|
-
import { computed,
|
|
52
|
+
import { computed, ref, toRefs, watch } from 'vue'
|
|
53
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
58
54
|
import type { IPopupEmits } from './typing'
|
|
59
55
|
import { addUnit, getWindowInfo } from '../../utils'
|
|
60
56
|
import { IconConfig } from '../../config'
|
|
@@ -64,6 +60,12 @@ import HyTransition from '../hy-transition/hy-transition.vue'
|
|
|
64
60
|
import HyOverlay from '../hy-overlay/hy-overlay.vue'
|
|
65
61
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
66
62
|
|
|
63
|
+
/**
|
|
64
|
+
* 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义。
|
|
65
|
+
* @displayName hy-popup
|
|
66
|
+
*/
|
|
67
|
+
defineOptions({})
|
|
68
|
+
|
|
67
69
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
68
70
|
const props = defineProps({
|
|
69
71
|
/** 是否展示弹窗 */
|
|
@@ -127,7 +129,7 @@ const props = defineProps({
|
|
|
127
129
|
default: 'top-right',
|
|
128
130
|
},
|
|
129
131
|
/** 圆角值 */
|
|
130
|
-
round: String,
|
|
132
|
+
round: [String, Number],
|
|
131
133
|
/** 当mode=center时 是否开启缩放 */
|
|
132
134
|
zoom: {
|
|
133
135
|
type: Boolean,
|
|
@@ -15,11 +15,6 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script lang="ts">
|
|
18
|
-
/**
|
|
19
|
-
* 业务组件,突出金额小数点前大,小数点后小
|
|
20
|
-
* @displayName hy-price
|
|
21
|
-
*/
|
|
22
|
-
defineOptions({})
|
|
23
18
|
export default {
|
|
24
19
|
name: 'hy-price',
|
|
25
20
|
options: {
|
|
@@ -35,6 +30,12 @@ import { computed, toRefs } from 'vue'
|
|
|
35
30
|
import type { CSSProperties, PropType } from 'vue'
|
|
36
31
|
import { addUnit, getPx } from '../../utils'
|
|
37
32
|
|
|
33
|
+
/**
|
|
34
|
+
* 业务组件,突出金额小数点前大,小数点后小
|
|
35
|
+
* @displayName hy-price
|
|
36
|
+
*/
|
|
37
|
+
defineOptions({})
|
|
38
|
+
|
|
38
39
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
39
40
|
const props = defineProps({
|
|
40
41
|
/** 传入金额值 */
|
|
@@ -21,11 +21,6 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script lang="ts">
|
|
24
|
-
/**
|
|
25
|
-
* 根据提供的字符串前端JS生成二维码展示
|
|
26
|
-
* @displayName hy-qrcode
|
|
27
|
-
*/
|
|
28
|
-
defineOptions({})
|
|
29
24
|
export default {
|
|
30
25
|
name: 'hy-qrcode',
|
|
31
26
|
options: {
|
|
@@ -41,12 +36,15 @@ import { getCurrentInstance, toRefs, ref, onMounted } from 'vue'
|
|
|
41
36
|
import type { IQrcodeEmits } from './typing'
|
|
42
37
|
import QRCode from './qrcode.js'
|
|
43
38
|
import { addUnit, error } from '../../utils'
|
|
44
|
-
import { IconConfig } from '../../config'
|
|
45
|
-
|
|
46
39
|
// 组件
|
|
47
|
-
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
48
40
|
import HyLoading from '../hy-loading/hy-loading.vue'
|
|
49
41
|
|
|
42
|
+
/**
|
|
43
|
+
* 根据提供的字符串前端JS生成二维码展示
|
|
44
|
+
* @displayName hy-qrcode
|
|
45
|
+
*/
|
|
46
|
+
defineOptions({})
|
|
47
|
+
|
|
50
48
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
51
49
|
const props = defineProps({
|
|
52
50
|
/** 实例ID字符串(如果有多个二维码组件必须设置不一样的cid) */
|
|
@@ -47,11 +47,6 @@
|
|
|
47
47
|
</template>
|
|
48
48
|
|
|
49
49
|
<script lang="ts">
|
|
50
|
-
/**
|
|
51
|
-
* 复选框组件一般用于需要多个选择的场景,该组件功能完整,使用方便
|
|
52
|
-
* @displayName hy-radio
|
|
53
|
-
*/
|
|
54
|
-
defineOptions({})
|
|
55
50
|
export default {
|
|
56
51
|
name: 'hy-radio',
|
|
57
52
|
options: {
|
|
@@ -69,10 +64,15 @@ import type { IRadioEmits } from './typing'
|
|
|
69
64
|
import type { CheckboxColumnsVo, IFieldNames } from '../hy-check-button/typing'
|
|
70
65
|
import { addUnit, bem, error } from '../../utils'
|
|
71
66
|
import { IconConfig } from '../../config'
|
|
72
|
-
|
|
73
67
|
// 组件
|
|
74
68
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
75
69
|
|
|
70
|
+
/**
|
|
71
|
+
* 复选框组件一般用于需要多个选择的场景,该组件功能完整,使用方便
|
|
72
|
+
* @displayName hy-radio
|
|
73
|
+
*/
|
|
74
|
+
defineOptions({})
|
|
75
|
+
|
|
76
76
|
// const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
77
77
|
const props = defineProps({
|
|
78
78
|
/** 双向绑定值,数组类型 */
|
|
@@ -296,18 +296,16 @@ const iconClickHandler = (e: Event, temp: CheckboxColumnsVo) => {
|
|
|
296
296
|
* */
|
|
297
297
|
const wrapperClickHandler = (e: Event, temp: CheckboxColumnsVo) => {
|
|
298
298
|
e.stopPropagation()
|
|
299
|
-
if (
|
|
300
|
-
|
|
301
|
-
}
|
|
299
|
+
if (labelDisabled.value || isDisabled(temp?.disabled)) return
|
|
300
|
+
setRadioCheckedStatus(temp)
|
|
302
301
|
}
|
|
303
302
|
/**
|
|
304
303
|
* @description 点击label
|
|
305
304
|
* */
|
|
306
305
|
const labelClickHandler = (e: Event, temp: CheckboxColumnsVo) => {
|
|
307
306
|
e.stopPropagation()
|
|
308
|
-
if (
|
|
309
|
-
|
|
310
|
-
}
|
|
307
|
+
if (labelDisabled.value || isDisabled(temp?.disabled)) return
|
|
308
|
+
setRadioCheckedStatus(temp)
|
|
311
309
|
}
|
|
312
310
|
|
|
313
311
|
/**
|
|
@@ -51,11 +51,6 @@
|
|
|
51
51
|
</template>
|
|
52
52
|
|
|
53
53
|
<script lang="ts">
|
|
54
|
-
/**
|
|
55
|
-
* 该组件一般用于满意度调查,星型评分的场景。
|
|
56
|
-
* @displayName hy-rate
|
|
57
|
-
*/
|
|
58
|
-
defineOptions({})
|
|
59
54
|
export default {
|
|
60
55
|
name: 'hy-rate',
|
|
61
56
|
options: {
|
|
@@ -71,10 +66,15 @@ import { addUnit, getRect, guid, range, sleep } from '../../utils'
|
|
|
71
66
|
import { ref, watch, toRefs, onMounted, getCurrentInstance } from 'vue'
|
|
72
67
|
import type { CSSProperties, PropType } from 'vue'
|
|
73
68
|
import type { IRateEmits } from './typing'
|
|
74
|
-
|
|
69
|
+
import { IconConfig } from '../../config'
|
|
75
70
|
// 组件
|
|
76
71
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
77
|
-
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 该组件一般用于满意度调查,星型评分的场景。
|
|
75
|
+
* @displayName hy-rate
|
|
76
|
+
*/
|
|
77
|
+
defineOptions({})
|
|
78
78
|
|
|
79
79
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
80
80
|
const props = defineProps({
|
|
@@ -42,11 +42,6 @@
|
|
|
42
42
|
</template>
|
|
43
43
|
|
|
44
44
|
<script lang="ts">
|
|
45
|
-
/**
|
|
46
|
-
* 该组件一般用于内容较长,预先收起一部分,点击展开全部内容的场景。
|
|
47
|
-
* @displayName hy-read-more
|
|
48
|
-
*/
|
|
49
|
-
defineOptions({})
|
|
50
45
|
export default {
|
|
51
46
|
name: 'hy-read-more',
|
|
52
47
|
options: {
|
|
@@ -67,6 +62,12 @@ import { IconConfig } from '../../config'
|
|
|
67
62
|
// 组件
|
|
68
63
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
69
64
|
|
|
65
|
+
/**
|
|
66
|
+
* 该组件一般用于内容较长,预先收起一部分,点击展开全部内容的场景。
|
|
67
|
+
* @displayName hy-read-more
|
|
68
|
+
*/
|
|
69
|
+
defineOptions({})
|
|
70
|
+
|
|
70
71
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
71
72
|
const props = defineProps({
|
|
72
73
|
/** 内容超出此高度才会显示展开全文按钮,单位px */
|
|
@@ -32,11 +32,6 @@
|
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
34
|
<script lang="ts">
|
|
35
|
-
/**
|
|
36
|
-
* 该组件一般用于同时展示多个商品、分类的场景,也可以完成左右滑动的列表。
|
|
37
|
-
* @displayName hy-scroll-list
|
|
38
|
-
*/
|
|
39
|
-
defineOptions({})
|
|
40
35
|
export default {
|
|
41
36
|
name: 'hy-scroll-list',
|
|
42
37
|
options: {
|
|
@@ -52,6 +47,12 @@ import { computed, type CSSProperties, toRefs, ref, onMounted, getCurrentInstanc
|
|
|
52
47
|
import type { IScrollListEmits } from './typing'
|
|
53
48
|
import { addUnit, colorGradient, getRect, sleep } from '../../utils'
|
|
54
49
|
|
|
50
|
+
/**
|
|
51
|
+
* 该组件一般用于同时展示多个商品、分类的场景,也可以完成左右滑动的列表。
|
|
52
|
+
* @displayName hy-scroll-list
|
|
53
|
+
*/
|
|
54
|
+
defineOptions({})
|
|
55
|
+
|
|
55
56
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
56
57
|
const props = defineProps({
|
|
57
58
|
/** 指示器的整体宽度 */
|
|
@@ -94,11 +94,6 @@
|
|
|
94
94
|
</template>
|
|
95
95
|
|
|
96
96
|
<script lang="ts">
|
|
97
|
-
/**
|
|
98
|
-
* 搜索组件,集成了常见搜索框所需功能,用户可以一键引入,开箱即用。
|
|
99
|
-
* @displayName hy-search
|
|
100
|
-
*/
|
|
101
|
-
defineOptions({})
|
|
102
97
|
export default {
|
|
103
98
|
name: 'hy-search',
|
|
104
99
|
options: {
|
|
@@ -110,13 +105,20 @@ export default {
|
|
|
110
105
|
</script>
|
|
111
106
|
|
|
112
107
|
<script setup lang="ts">
|
|
113
|
-
import { computed, nextTick, toRefs, ref, watch
|
|
108
|
+
import { computed, nextTick, toRefs, ref, watch } from 'vue'
|
|
109
|
+
import type { PropType, CSSProperties } from 'vue'
|
|
114
110
|
import type { ISearchEmits } from './typing'
|
|
115
111
|
import { sleep, addUnit } from '../../utils'
|
|
116
112
|
import { IconConfig } from '../../config'
|
|
117
113
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
118
114
|
import type HyIconProps from '../hy-icon/typing'
|
|
119
115
|
|
|
116
|
+
/**
|
|
117
|
+
* 搜索组件,集成了常见搜索框所需功能,用户可以一键引入,开箱即用。
|
|
118
|
+
* @displayName hy-search
|
|
119
|
+
*/
|
|
120
|
+
defineOptions({})
|
|
121
|
+
|
|
120
122
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
121
123
|
const props = defineProps({
|
|
122
124
|
/** 输入框初始值 */
|
|
@@ -73,11 +73,6 @@
|
|
|
73
73
|
</view>
|
|
74
74
|
</template>
|
|
75
75
|
<script lang="ts">
|
|
76
|
-
/**
|
|
77
|
-
* 用于签名场景,基于 Canvas 实现的签名组件。提供了基础签名、历史记录、笔锋效果等功能。
|
|
78
|
-
* @displayName hy-signature
|
|
79
|
-
*/
|
|
80
|
-
defineOptions({})
|
|
81
76
|
export default {
|
|
82
77
|
name: 'hy-signature',
|
|
83
78
|
options: {
|
|
@@ -99,6 +94,12 @@ import { canvas2dAdapter } from './canvasHelper'
|
|
|
99
94
|
// 组件
|
|
100
95
|
import HyButton from '../hy-button/hy-button.vue'
|
|
101
96
|
|
|
97
|
+
/**
|
|
98
|
+
* 用于签名场景,基于 Canvas 实现的签名组件。提供了基础签名、历史记录、笔锋效果等功能。
|
|
99
|
+
* @displayName hy-signature
|
|
100
|
+
*/
|
|
101
|
+
defineOptions({})
|
|
102
|
+
|
|
102
103
|
// const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
103
104
|
const props = defineProps({
|
|
104
105
|
/** 签名笔颜色 */
|
|
@@ -140,11 +140,6 @@
|
|
|
140
140
|
</template>
|
|
141
141
|
|
|
142
142
|
<script lang="ts">
|
|
143
|
-
/**
|
|
144
|
-
* 一般用于表单中,手动选择一个区间范围的场景。
|
|
145
|
-
* @displayName hy-slider
|
|
146
|
-
*/
|
|
147
|
-
defineOptions({})
|
|
148
143
|
export default {
|
|
149
144
|
name: 'hy-slider',
|
|
150
145
|
options: {
|
|
@@ -159,7 +154,13 @@ export default {
|
|
|
159
154
|
import { computed, getCurrentInstance, onMounted, ref, toRefs, watch } from 'vue'
|
|
160
155
|
import type { CSSProperties, PropType } from 'vue'
|
|
161
156
|
import { addUnit, error, getRect, getPx } from '../../utils'
|
|
162
|
-
import { ISliderEmits } from '
|
|
157
|
+
import type { ISliderEmits } from './typing'
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 一般用于表单中,手动选择一个区间范围的场景。
|
|
161
|
+
* @displayName hy-slider
|
|
162
|
+
*/
|
|
163
|
+
defineOptions({})
|
|
163
164
|
|
|
164
165
|
// const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
165
166
|
const props = defineProps({
|
|
@@ -216,7 +217,7 @@ const props = defineProps({
|
|
|
216
217
|
},
|
|
217
218
|
/** 双滑块时值 */
|
|
218
219
|
rangeValue: {
|
|
219
|
-
type: Array as unknown as number[]
|
|
220
|
+
type: Array as unknown as PropType<number[]>,
|
|
220
221
|
default: [0, 0],
|
|
221
222
|
},
|
|
222
223
|
/** 是否区间的模式 */
|
|
@@ -104,11 +104,6 @@
|
|
|
104
104
|
</template>
|
|
105
105
|
|
|
106
106
|
<script lang="ts">
|
|
107
|
-
/**
|
|
108
|
-
* 一般用于完成一个任务要分几个步骤,标识目前处于第几步的场景。
|
|
109
|
-
* @displayName hy-steps
|
|
110
|
-
*/
|
|
111
|
-
defineOptions({})
|
|
112
107
|
export default {
|
|
113
108
|
name: 'hy-steps',
|
|
114
109
|
options: {
|
|
@@ -120,21 +115,19 @@ export default {
|
|
|
120
115
|
</script>
|
|
121
116
|
|
|
122
117
|
<script setup lang="ts">
|
|
123
|
-
import {
|
|
124
|
-
|
|
125
|
-
type CSSProperties,
|
|
126
|
-
toRefs,
|
|
127
|
-
ref,
|
|
128
|
-
onMounted,
|
|
129
|
-
getCurrentInstance,
|
|
130
|
-
watch,
|
|
131
|
-
PropType,
|
|
132
|
-
} from 'vue'
|
|
118
|
+
import { computed, toRefs, ref, onMounted, getCurrentInstance, watch } from 'vue'
|
|
119
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
133
120
|
import type { IStepsEmits } from './typing'
|
|
134
121
|
import type { StepListVo } from './typing'
|
|
135
122
|
import { addUnit, getRect } from '../../utils'
|
|
136
123
|
import { ColorConfig, IconConfig } from '../../config'
|
|
137
124
|
|
|
125
|
+
/**
|
|
126
|
+
* 一般用于完成一个任务要分几个步骤,标识目前处于第几步的场景。
|
|
127
|
+
* @displayName hy-steps
|
|
128
|
+
*/
|
|
129
|
+
defineOptions({})
|
|
130
|
+
|
|
138
131
|
// 组件
|
|
139
132
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
140
133
|
|
|
@@ -213,8 +206,8 @@ const lineStyle = computed(() => {
|
|
|
213
206
|
style.backgroundColor = temp.error
|
|
214
207
|
? ''
|
|
215
208
|
: index < current.value
|
|
216
|
-
|
|
217
|
-
|
|
209
|
+
? activeColor.value
|
|
210
|
+
: inactiveColor.value
|
|
218
211
|
return style
|
|
219
212
|
}
|
|
220
213
|
})
|
|
@@ -67,11 +67,6 @@
|
|
|
67
67
|
</template>
|
|
68
68
|
|
|
69
69
|
<script lang="ts">
|
|
70
|
-
/**
|
|
71
|
-
* 该布局一般用于商品详情页底部引导用户快速购买商品的场景,开发者可以根据自己的需求修改布局结构和样式。
|
|
72
|
-
* @displayName hy-submit-bar
|
|
73
|
-
*/
|
|
74
|
-
defineOptions({})
|
|
75
70
|
export default {
|
|
76
71
|
name: 'hy-submit-bar',
|
|
77
72
|
options: {
|
|
@@ -86,13 +81,18 @@ export default {
|
|
|
86
81
|
import { computed, toRefs } from 'vue'
|
|
87
82
|
import type { CSSProperties, PropType } from 'vue'
|
|
88
83
|
import type { IconMenus, ISubmitBarEmits } from './typing'
|
|
89
|
-
import { debounce } from '../../utils'
|
|
90
84
|
|
|
91
85
|
// 组件
|
|
92
86
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
93
87
|
import HyLoading from '../hy-loading/hy-loading.vue'
|
|
94
88
|
import HyBadge from '../hy-badge/hy-badge.vue'
|
|
95
89
|
|
|
90
|
+
/**
|
|
91
|
+
* 该布局一般用于商品详情页底部引导用户快速购买商品的场景,开发者可以根据自己的需求修改布局结构和样式。
|
|
92
|
+
* @displayName hy-submit-bar
|
|
93
|
+
*/
|
|
94
|
+
defineOptions({})
|
|
95
|
+
|
|
96
96
|
// const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
97
97
|
const props = defineProps({
|
|
98
98
|
/** 左边菜单栏 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view
|
|
3
3
|
ref="hy-subsection"
|
|
4
|
-
:class="[`hy-subsection--${mode}`, 'hy-subsection']"
|
|
4
|
+
:class="[`hy-subsection--${mode}`, 'hy-subsection', customClass]"
|
|
5
5
|
:style="[customStyle, wrapperStyle]"
|
|
6
6
|
>
|
|
7
7
|
<view ref="hy-subsection__bar" :style="barStyle" :class="barClass"></view>
|
|
@@ -19,11 +19,6 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script lang="ts">
|
|
22
|
-
/**
|
|
23
|
-
* 该分段器一般用于用户从几个选项中选择某一个的场景
|
|
24
|
-
* @displayName hy-subsection
|
|
25
|
-
*/
|
|
26
|
-
defineOptions({})
|
|
27
22
|
export default {
|
|
28
23
|
name: 'hy-subsection',
|
|
29
24
|
options: {
|
|
@@ -36,15 +31,20 @@ export default {
|
|
|
36
31
|
|
|
37
32
|
<script setup lang="ts">
|
|
38
33
|
import { computed, toRefs, ref, onMounted, getCurrentInstance } from 'vue'
|
|
39
|
-
import type { CSSProperties } from 'vue'
|
|
40
|
-
import type { ISubsectionEmits } from './typing'
|
|
41
|
-
import type { SubSectionVo } from './typing'
|
|
34
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
35
|
+
import type { ISubsectionEmits, SubSectionVo } from './typing'
|
|
42
36
|
import { addUnit, getRect, guid } from '../../utils'
|
|
43
37
|
|
|
38
|
+
/**
|
|
39
|
+
* 该分段器一般用于用户从几个选项中选择某一个的场景
|
|
40
|
+
* @displayName hy-subsection
|
|
41
|
+
*/
|
|
42
|
+
defineOptions({})
|
|
43
|
+
|
|
44
44
|
// const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
45
45
|
const props = defineProps({
|
|
46
46
|
/** 接收值 */
|
|
47
|
-
modelValue: String,
|
|
47
|
+
modelValue: [String, Number],
|
|
48
48
|
/** 默认值 */
|
|
49
49
|
current: {
|
|
50
50
|
type: Number,
|
|
@@ -53,19 +53,12 @@ const props = defineProps({
|
|
|
53
53
|
/** tab的数据 */
|
|
54
54
|
list: {
|
|
55
55
|
type: Array,
|
|
56
|
-
default()
|
|
57
|
-
return []
|
|
58
|
-
},
|
|
56
|
+
default: () => [],
|
|
59
57
|
},
|
|
60
58
|
/** list的键值 */
|
|
61
59
|
customKeys: {
|
|
62
60
|
type: Object,
|
|
63
|
-
default() {
|
|
64
|
-
return {
|
|
65
|
-
name: 'name',
|
|
66
|
-
value: 'value',
|
|
67
|
-
}
|
|
68
|
-
},
|
|
61
|
+
default: () => ({ name: 'name', value: 'value' }),
|
|
69
62
|
},
|
|
70
63
|
/** 激活时的颜色 */
|
|
71
64
|
activeColor: String,
|
|
@@ -91,6 +84,10 @@ const props = defineProps({
|
|
|
91
84
|
},
|
|
92
85
|
/** 组件背景颜色,mode为button时有效 */
|
|
93
86
|
bgColor: String,
|
|
87
|
+
/** 定义需要用到的外部样式 */
|
|
88
|
+
customStyle: Object as PropType<CSSProperties>,
|
|
89
|
+
/** 自定义外部类名 */
|
|
90
|
+
customClass: String,
|
|
94
91
|
})
|
|
95
92
|
const {
|
|
96
93
|
modelValue,
|