hy-app 0.5.20 → 0.6.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-address-picker/hy-address-picker.vue +3 -1
- package/components/hy-address-picker/props.ts +103 -100
- package/components/hy-calendar/header.vue +58 -60
- package/components/hy-calendar/hy-calendar.vue +375 -362
- package/components/hy-calendar/month.vue +402 -537
- package/components/hy-calendar/props.ts +169 -159
- package/components/hy-calendar/typing.d.ts +45 -6
- package/components/hy-config-provider/hy-config-provider.vue +53 -53
- package/components/hy-config-provider/props.ts +30 -28
- package/components/hy-datetime-picker/hy-datetime-picker.vue +3 -2
- package/components/hy-datetime-picker/props.ts +144 -142
- package/components/hy-divider/props.ts +83 -80
- package/components/hy-input/props.ts +1 -1
- package/components/hy-modal/props.ts +94 -90
- package/components/hy-pagination/hy-pagination.vue +136 -135
- package/components/hy-pagination/props.ts +58 -55
- package/components/hy-parse/hy-parse.vue +550 -499
- package/components/hy-parse/parser.js +13 -88
- package/components/hy-picker/hy-picker.vue +4 -3
- package/components/hy-picker/props.ts +8 -3
- package/components/hy-qrcode/props.ts +72 -70
- package/components/hy-read-more/props.ts +48 -45
- package/components/hy-search/index.scss +1 -1
- package/components/hy-search/props.ts +133 -131
- package/components/hy-signature/props.ts +121 -118
- package/components/hy-upload/hy-upload.vue +384 -385
- package/components/hy-upload/index.scss +6 -9
- package/libs/api/http.ts +119 -140
- package/libs/composables/index.ts +1 -0
- package/libs/composables/useMessage.ts +1 -1
- package/libs/composables/useTouch.md +237 -0
- package/libs/composables/useTranslate.ts +13 -0
- package/libs/index.ts +8 -7
- package/libs/locale/index.ts +32 -0
- package/libs/locale/lang/en-US.ts +84 -0
- package/libs/locale/lang/zh-CN.ts +87 -0
- package/libs/typing/index.ts +2 -4
- package/libs/typing/modules/http.d.ts +19 -0
- package/libs/typing/modules/index.d.ts +12 -0
- package/libs/utils/inside.ts +4 -4
- package/libs/utils/utils.ts +30 -7
- package/package.json +77 -77
- package/web-types.json +8356 -1
- package/libs/typing/modules/http.ts +0 -17
- package/libs/typing/modules/icon.d.ts +0 -366
- package/libs/typing/modules/rect.ts +0 -10
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:color="input?.color"
|
|
16
16
|
:fontSize="input?.fontSize"
|
|
17
17
|
:inputAlign="input?.inputAlign"
|
|
18
|
-
:placeholder="input?.placeholder || '
|
|
18
|
+
:placeholder="input?.placeholder || t('placeholder')"
|
|
19
19
|
:placeholderStyle="input?.placeholderStyle"
|
|
20
20
|
:placeholderClass="input?.placeholderClass"
|
|
21
21
|
:customStyle="Object.assign({ 'pointer-events': 'none' }, input?.customStyle)"
|
|
@@ -75,6 +75,7 @@ import { onMounted, ref, toRefs } from 'vue'
|
|
|
75
75
|
import type { IAddressPickerEmits } from './typing'
|
|
76
76
|
import address from '../../libs/utils/address.json'
|
|
77
77
|
import addressPickerProps from './props'
|
|
78
|
+
import { useTranslate } from '../../libs'
|
|
78
79
|
// 组件
|
|
79
80
|
import HyInput from '../hy-input/hy-input.vue'
|
|
80
81
|
import HyPicker from '../hy-picker/hy-picker.vue'
|
|
@@ -89,6 +90,7 @@ const props = defineProps(addressPickerProps)
|
|
|
89
90
|
const { show, modelValue, hasInput, input, separator, closeOnClickOverlay } = toRefs(props)
|
|
90
91
|
const emit = defineEmits<IAddressPickerEmits>()
|
|
91
92
|
|
|
93
|
+
const { t } = useTranslate('addressPicker')
|
|
92
94
|
// 原来的日期选择器不方便,这里增加一个hasInput选项支持类似element的自带输入框的功能。
|
|
93
95
|
const inputValue = ref<string>('') // 表单显示值
|
|
94
96
|
const showByClickInput = ref<boolean>(false) // 是否在hasInput模式下显示日期选择
|
|
@@ -1,100 +1,103 @@
|
|
|
1
|
-
import type { CSSProperties, PropType } from
|
|
2
|
-
import type HyInputProps from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
1
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
2
|
+
import type { HyInputProps } from '../hy-input/typing'
|
|
3
|
+
import { useTranslate } from '../../libs'
|
|
4
|
+
|
|
5
|
+
const { t } = useTranslate('addressPicker')
|
|
6
|
+
|
|
7
|
+
const addressPickerProps = {
|
|
8
|
+
/** 用于控制选择器的弹出和收起 */
|
|
9
|
+
show: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false
|
|
12
|
+
},
|
|
13
|
+
/**
|
|
14
|
+
* 弹出层弹出方向
|
|
15
|
+
* @values top,bottom
|
|
16
|
+
* */
|
|
17
|
+
popupMode: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'bottom'
|
|
20
|
+
},
|
|
21
|
+
/** 是否显示顶部的操作栏 */
|
|
22
|
+
showToolbar: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
/** 绑定值 */
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: '',
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
/** 顶部标题 */
|
|
33
|
+
title: String,
|
|
34
|
+
/** 字符串截取数组条件 */
|
|
35
|
+
separator: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ' '
|
|
38
|
+
},
|
|
39
|
+
/** 是否显示加载中状态 */
|
|
40
|
+
loading: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
/** 各列中,单个选项的高度 */
|
|
45
|
+
itemHeight: {
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 44
|
|
48
|
+
},
|
|
49
|
+
/** 取消按钮的文字 */
|
|
50
|
+
cancelText: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: () => t('cancel')
|
|
53
|
+
},
|
|
54
|
+
/** 确认按钮的文字 */
|
|
55
|
+
confirmText: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: () => t('confirm')
|
|
58
|
+
},
|
|
59
|
+
/** 取消按钮的颜色 */
|
|
60
|
+
cancelColor: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '#909193'
|
|
63
|
+
},
|
|
64
|
+
/** 确认按钮的颜色 */
|
|
65
|
+
confirmColor: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: '#3c9cff'
|
|
68
|
+
},
|
|
69
|
+
/** 每列中可见选项的数量 */
|
|
70
|
+
visibleItemCount: {
|
|
71
|
+
type: Number,
|
|
72
|
+
default: 5
|
|
73
|
+
},
|
|
74
|
+
/** 是否允许点击遮罩关闭选择器 */
|
|
75
|
+
closeOnClickOverlay: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
78
|
+
},
|
|
79
|
+
/** 各列的默认索引 */
|
|
80
|
+
defaultIndex: {
|
|
81
|
+
type: Array as PropType<Array<any>>
|
|
82
|
+
},
|
|
83
|
+
/** 是否显示输入框 */
|
|
84
|
+
hasInput: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: false
|
|
87
|
+
},
|
|
88
|
+
/** 输入框集合属性 */
|
|
89
|
+
input: {
|
|
90
|
+
type: Object as PropType<HyInputProps>
|
|
91
|
+
},
|
|
92
|
+
/** 右边插槽 */
|
|
93
|
+
toolbarRightSlot: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
97
|
+
/** 自定义输入框外部样式 */
|
|
98
|
+
customStyle: {
|
|
99
|
+
type: Object as PropType<CSSProperties>
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export default addressPickerProps
|
|
@@ -1,60 +1,58 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="hy-calendar--header hy-border-bottom">
|
|
3
|
-
<text class="hy-calendar--header__title" v-if="showTitle">{{ title }}</text>
|
|
4
|
-
<text class="hy-calendar--header__subtitle" v-if="showSubtitle">{{ subtitle }}</text>
|
|
5
|
-
<view class="hy-calendar--header__weekdays">
|
|
6
|
-
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[0] }}</text>
|
|
7
|
-
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[1] }}</text>
|
|
8
|
-
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[2] }}</text>
|
|
9
|
-
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[3] }}</text>
|
|
10
|
-
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[4] }}</text>
|
|
11
|
-
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[5] }}</text>
|
|
12
|
-
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[6] }}</text>
|
|
13
|
-
</view>
|
|
14
|
-
</view>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
export default {
|
|
19
|
-
name: 'hy-calendar-header',
|
|
20
|
-
props: {
|
|
21
|
-
// 标题
|
|
22
|
-
title: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: ''
|
|
25
|
-
},
|
|
26
|
-
// 副标题
|
|
27
|
-
subtitle: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: ''
|
|
30
|
-
},
|
|
31
|
-
// 是否显示标题
|
|
32
|
-
showTitle: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: true
|
|
35
|
-
},
|
|
36
|
-
// 是否显示副标题
|
|
37
|
-
showSubtitle: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: true
|
|
40
|
-
},
|
|
41
|
-
// 星期文本
|
|
42
|
-
weekText: {
|
|
43
|
-
type: Array,
|
|
44
|
-
default: () =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@import './index.scss';
|
|
60
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="hy-calendar--header hy-border-bottom">
|
|
3
|
+
<text class="hy-calendar--header__title" v-if="showTitle">{{ title }}</text>
|
|
4
|
+
<text class="hy-calendar--header__subtitle" v-if="showSubtitle">{{ subtitle }}</text>
|
|
5
|
+
<view class="hy-calendar--header__weekdays">
|
|
6
|
+
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[0] }}</text>
|
|
7
|
+
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[1] }}</text>
|
|
8
|
+
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[2] }}</text>
|
|
9
|
+
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[3] }}</text>
|
|
10
|
+
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[4] }}</text>
|
|
11
|
+
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[5] }}</text>
|
|
12
|
+
<text class="hy-calendar--header__weekdays__weekday">{{ weekText[6] }}</text>
|
|
13
|
+
</view>
|
|
14
|
+
</view>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
export default {
|
|
19
|
+
name: 'hy-calendar-header',
|
|
20
|
+
props: {
|
|
21
|
+
// 标题
|
|
22
|
+
title: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ''
|
|
25
|
+
},
|
|
26
|
+
// 副标题
|
|
27
|
+
subtitle: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ''
|
|
30
|
+
},
|
|
31
|
+
// 是否显示标题
|
|
32
|
+
showTitle: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true
|
|
35
|
+
},
|
|
36
|
+
// 是否显示副标题
|
|
37
|
+
showSubtitle: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
// 星期文本
|
|
42
|
+
weekText: {
|
|
43
|
+
type: Array,
|
|
44
|
+
default: () => []
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
data() {
|
|
48
|
+
return {}
|
|
49
|
+
},
|
|
50
|
+
methods: {
|
|
51
|
+
name() {}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped>
|
|
57
|
+
@import './index.scss';
|
|
58
|
+
</style>
|