hy-app 0.1.4 → 0.2.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 +31 -10
- package/components/hy-address-picker/index.scss +1 -1
- package/components/hy-address-picker/props.ts +1 -3
- package/components/hy-address-picker/typing.d.ts +4 -11
- package/components/hy-avatar/hy-avatar.vue +11 -0
- package/components/hy-avatar/index.scss +8 -8
- package/components/hy-avatar/typing.d.ts +1 -1
- package/components/hy-back-top/hy-back-top.vue +27 -2
- package/components/hy-back-top/index.scss +11 -1
- package/components/hy-back-top/props.ts +1 -6
- package/components/hy-back-top/typing.d.ts +4 -7
- package/components/hy-badge/hy-badge.vue +11 -0
- package/components/hy-badge/index.scss +18 -40
- package/components/hy-badge/typing.d.ts +1 -1
- package/components/hy-button/hy-button.vue +44 -17
- package/components/hy-button/index.scss +25 -45
- package/components/hy-button/props.ts +1 -2
- package/components/hy-button/typing.d.ts +4 -7
- package/components/hy-calendar/header.vue +12 -12
- package/components/hy-calendar/hy-calendar.vue +11 -2
- package/components/hy-calendar/index.scss +140 -131
- package/components/hy-calendar/month.vue +18 -18
- package/components/hy-calendar/typing.d.ts +1 -1
- package/components/hy-card/hy-card.vue +11 -0
- package/components/hy-card/index.scss +12 -12
- package/components/hy-card/props.ts +2 -2
- package/components/hy-card/typing.d.ts +1 -1
- package/components/hy-cell/hy-cell.vue +57 -19
- package/components/hy-cell/index.scss +55 -28
- package/components/hy-cell/props.ts +4 -5
- package/components/hy-cell/typing.d.ts +11 -21
- package/components/hy-check-button/hy-check-button.vue +13 -2
- package/components/hy-check-button/index.scss +0 -5
- package/components/hy-check-button/typing.d.ts +1 -1
- package/components/hy-checkbox/hy-checkbox.vue +34 -10
- package/components/hy-checkbox/index.scss +15 -5
- package/components/hy-checkbox/props.ts +2 -3
- package/components/hy-checkbox/typing.d.ts +3 -3
- package/components/hy-config-provider/hy-config-provider.vue +52 -0
- package/components/hy-config-provider/index.scss +21 -0
- package/components/hy-config-provider/props.ts +13 -0
- package/components/hy-config-provider/typing.d.ts +28 -0
- package/components/hy-count-down/hy-count-down.vue +11 -0
- package/components/hy-count-down/index.scss +13 -1
- package/components/hy-count-down/typing.d.ts +1 -1
- package/components/hy-count-to/hy-count-to.vue +12 -1
- package/components/hy-count-to/index.scss +14 -1
- package/components/hy-count-to/props.ts +1 -1
- package/components/hy-count-to/typing.d.ts +1 -3
- package/components/hy-datetime-picker/hy-datetime-picker.vue +29 -14
- package/components/hy-datetime-picker/index.scss +1 -1
- package/components/hy-datetime-picker/props.ts +1 -3
- package/components/hy-datetime-picker/typing.d.ts +6 -13
- package/components/hy-divider/hy-divider.vue +11 -0
- package/components/hy-divider/index.scss +1 -1
- package/components/hy-divider/typing.d.ts +1 -1
- package/components/hy-dropdown/hy-dropdown.vue +13 -1
- package/components/hy-dropdown/index.scss +4 -1
- package/components/hy-dropdown/props.ts +2 -2
- package/components/hy-dropdown/typing.d.ts +1 -1
- package/components/hy-dropdown-item/hy-dropdown-item.vue +21 -3
- package/components/hy-dropdown-item/index.scss +35 -2
- package/components/hy-dropdown-item/typing.d.ts +1 -3
- package/components/hy-empty/hy-empty.vue +22 -10
- package/components/hy-empty/index.scss +17 -3
- package/components/hy-empty/props.ts +1 -5
- package/components/hy-empty/typing.d.ts +4 -19
- package/components/hy-float-button/hy-float-button.vue +11 -0
- package/components/hy-float-button/index.scss +13 -2
- package/components/hy-float-button/props.ts +3 -3
- package/components/hy-float-button/typing.d.ts +1 -1
- package/components/hy-folding-panel/hy-folding-panel.vue +11 -0
- package/components/hy-folding-panel/index.scss +4 -1
- package/components/hy-folding-panel/typing.d.ts +1 -1
- package/components/hy-form/hy-form.vue +214 -36
- package/components/hy-form/index.scss +13 -3
- package/components/hy-form/props.ts +0 -2
- package/components/hy-form/typing.d.ts +25 -7
- package/components/hy-grid/hy-grid.vue +27 -5
- package/components/hy-grid/index.scss +1 -1
- package/components/hy-grid/props.ts +1 -3
- package/components/hy-grid/typing.d.ts +13 -16
- package/components/hy-icon/hy-icon.vue +17 -10
- package/components/hy-icon/index.scss +16 -7
- package/components/hy-icon/props.ts +2 -2
- package/components/hy-icon/typing.d.ts +1 -1
- package/components/hy-image/hy-image.vue +11 -0
- package/components/hy-image/index.scss +4 -3
- package/components/hy-image/typing.d.ts +1 -1
- package/components/hy-input/hy-input.vue +58 -19
- package/components/hy-input/index.scss +12 -2
- package/components/hy-input/props.ts +3 -5
- package/components/hy-input/typing.d.ts +13 -12
- package/components/hy-line/hy-line.vue +11 -0
- package/components/hy-line/index.scss +4 -1
- package/components/hy-line/typing.d.ts +1 -1
- package/components/hy-line-progress/hy-line-progress.vue +17 -2
- package/components/hy-line-progress/index.scss +20 -8
- package/components/hy-line-progress/props.ts +4 -4
- package/components/hy-line-progress/typing.d.ts +5 -1
- package/components/hy-list/hy-list.vue +23 -8
- package/components/hy-list/index.scss +1 -4
- package/components/hy-list/typing.d.ts +1 -1
- package/components/hy-loading/hy-loading.vue +11 -0
- package/components/hy-loading/index.scss +2 -2
- package/components/hy-loading/typing.d.ts +1 -2
- package/components/hy-login/TheUserLogin.vue +63 -106
- package/components/hy-login/hy-login.vue +15 -10
- package/components/hy-login/props.ts +1 -1
- package/components/hy-login/typing.d.ts +6 -1
- package/components/hy-modal/hy-modal.vue +15 -7
- package/components/hy-modal/index.scss +19 -3
- package/components/hy-modal/typing.d.ts +1 -1
- package/components/hy-navbar/hy-navbar.vue +11 -0
- package/components/hy-navbar/index.scss +14 -3
- package/components/hy-navbar/props.ts +1 -1
- package/components/hy-navbar/typing.d.ts +1 -2
- package/components/hy-notice-bar/hy-notice-bar.vue +11 -0
- package/components/hy-notice-bar/index.scss +35 -35
- package/components/hy-notice-bar/typing.d.ts +1 -1
- package/components/hy-number-step/hy-number-step.vue +40 -18
- package/components/hy-number-step/index.scss +34 -25
- package/components/hy-number-step/props.ts +4 -4
- package/components/hy-number-step/typing.d.ts +8 -3
- package/components/hy-overlay/index.scss +3 -1
- package/components/hy-overlay/typing.d.ts +1 -1
- package/components/hy-parse/typing.d.ts +1 -1
- package/components/hy-picker/hy-picker.vue +30 -8
- package/components/hy-picker/index.scss +7 -3
- package/components/hy-picker/props.ts +2 -5
- package/components/hy-picker/typing.d.ts +4 -15
- package/components/hy-popup/hy-popup.vue +11 -0
- package/components/hy-popup/index.scss +10 -1
- package/components/hy-popup/typing.d.ts +1 -1
- package/components/hy-price/hy-price.vue +11 -0
- package/components/hy-price/index.scss +4 -1
- package/components/hy-price/typing.d.ts +1 -1
- package/components/hy-qrcode/hy-qrcode.vue +11 -0
- package/components/hy-qrcode/index.scss +4 -1
- package/components/hy-qrcode/typing.d.ts +1 -1
- package/components/hy-radio/hy-radio.vue +25 -5
- package/components/hy-radio/index.scss +17 -5
- package/components/hy-radio/props.ts +2 -3
- package/components/hy-radio/typing.d.ts +2 -2
- package/components/hy-rate/hy-rate.vue +11 -0
- package/components/hy-rate/index.scss +6 -6
- package/components/hy-rate/typing.d.ts +1 -1
- package/components/hy-read-more/hy-read-more.vue +23 -2
- package/components/hy-read-more/index.scss +29 -2
- package/components/hy-read-more/props.ts +2 -7
- package/components/hy-read-more/typing.d.ts +1 -1
- package/components/hy-scroll-list/hy-scroll-list.vue +31 -9
- package/components/hy-scroll-list/index.scss +10 -1
- package/components/hy-scroll-list/props.ts +2 -2
- package/components/hy-scroll-list/typing.d.ts +1 -1
- package/components/hy-search/hy-search.vue +23 -3
- package/components/hy-search/index.scss +25 -4
- package/components/hy-search/props.ts +3 -5
- package/components/hy-search/typing.d.ts +6 -13
- package/components/hy-slider/hy-slider.vue +11 -0
- package/components/hy-slider/index.scss +3 -2
- package/components/hy-slider/props.ts +1 -1
- package/components/hy-slider/typing.d.ts +1 -1
- package/components/hy-status-bar/typing.d.ts +1 -1
- package/components/hy-steps/hy-steps.vue +38 -20
- package/components/hy-steps/index.scss +57 -17
- package/components/hy-steps/props.ts +2 -2
- package/components/hy-steps/typing.d.ts +1 -1
- package/components/{hy-submitBar/hy-submitBar.vue → hy-submit-bar/hy-submit-bar.vue} +13 -34
- package/components/hy-submit-bar/index.scss +45 -0
- package/components/{hy-submitBar → hy-submit-bar}/typing.d.ts +1 -1
- package/components/hy-subsection/hy-subsection.vue +12 -0
- package/components/hy-subsection/index.scss +28 -8
- package/components/hy-subsection/props.ts +3 -3
- package/components/hy-subsection/typing.d.ts +1 -1
- package/components/hy-swipe-action/typing.d.ts +1 -1
- package/components/hy-swiper/hy-swiper.vue +11 -0
- package/components/hy-swiper/index.scss +13 -2
- package/components/hy-swiper/typing.d.ts +2 -5
- package/components/hy-switch/hy-switch.vue +28 -5
- package/components/hy-switch/index.scss +25 -7
- package/components/hy-switch/props.ts +1 -3
- package/components/hy-switch/typing.d.ts +6 -5
- package/components/hy-tabs/hy-tabs.vue +27 -15
- package/components/hy-tabs/index.scss +25 -4
- package/components/hy-tabs/props.ts +4 -10
- package/components/hy-tabs/typing.d.ts +1 -1
- package/components/hy-tag/hy-tag.vue +38 -22
- package/components/hy-tag/index.scss +27 -115
- package/components/hy-tag/props.ts +1 -2
- package/components/hy-tag/typing.d.ts +3 -10
- package/components/hy-text/hy-text.vue +12 -1
- package/components/hy-text/index.scss +20 -37
- package/components/hy-text/typing.d.ts +1 -1
- package/components/hy-textarea/hy-textarea.vue +17 -6
- package/components/hy-textarea/index.scss +16 -5
- package/components/hy-textarea/typing.d.ts +2 -2
- package/components/hy-toast/hy-toast.vue +13 -2
- package/components/hy-toast/index.scss +26 -26
- package/components/hy-toast/typing.d.ts +1 -1
- package/components/hy-tooltip/hy-tooltip.vue +11 -0
- package/components/hy-tooltip/index.scss +3 -3
- package/components/hy-tooltip/props.ts +1 -1
- package/components/hy-tooltip/typing.d.ts +1 -1
- package/components/hy-transition/typing.d.ts +1 -1
- package/components/hy-upload/hy-upload.vue +11 -0
- package/components/hy-upload/index.scss +12 -1
- package/components/hy-upload/typing.d.ts +1 -1
- package/components/hy-warn/hy-warn.vue +22 -11
- package/components/hy-warn/index.scss +46 -1
- package/components/hy-warn/typing.d.ts +1 -1
- package/components/hy-waterfall/hy-waterfall.vue +11 -0
- package/components/hy-waterfall/index.scss +1 -1
- package/components/hy-waterfall/typing.d.ts +1 -3
- package/components/index.ts +2 -2
- package/config/icon.ts +4 -0
- package/libs/css/common.scss +9 -0
- package/libs/css/mixin.scss +78 -0
- package/package.json +3 -3
- package/public/font/iconfont.css +3 -3
- package/store/userInfo.ts +26 -25
- package/theme.scss +76 -60
- package/typing/modules/common.d.ts +5 -1
- package/typing/modules/form.ts +29 -14
- package/utils/colorGradient.ts +1 -1
- package/utils/inside.ts +3 -0
- package/components/hy-submitBar/Index.vue +0 -17
- package/components/hy-submitBar/index.scss +0 -9
- /package/components/{hy-submitBar → hy-submit-bar}/props.ts +0 -0
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { CSSProperties } from "vue";
|
|
2
|
+
import type HyIconProps from "../hy-icon/typing";
|
|
2
3
|
|
|
3
|
-
interface
|
|
4
|
+
interface GridItemVo {
|
|
4
5
|
/**
|
|
5
|
-
* @description
|
|
6
|
+
* @description 图标名称或图片地址
|
|
6
7
|
* */
|
|
7
|
-
icon
|
|
8
|
+
icon?: string;
|
|
8
9
|
/**
|
|
9
10
|
* @description 名称
|
|
10
11
|
* */
|
|
11
|
-
name
|
|
12
|
+
name?: string;
|
|
13
|
+
/**
|
|
14
|
+
* @description 图标属性api配置
|
|
15
|
+
* */
|
|
16
|
+
iconConfig?: Partial<HyIconProps>;
|
|
12
17
|
/**
|
|
13
18
|
* @description 自定义内容键值对
|
|
14
19
|
* */
|
|
15
20
|
[key: string]: any;
|
|
16
21
|
}
|
|
17
|
-
export default interface
|
|
22
|
+
export default interface HyGridProps {
|
|
18
23
|
/**
|
|
19
24
|
* @description 数据集
|
|
20
25
|
* */
|
|
21
|
-
list:
|
|
26
|
+
list: GridItemVo[];
|
|
22
27
|
/**
|
|
23
28
|
* @description 宫格的列数(默认 3 )
|
|
24
29
|
* */
|
|
@@ -44,17 +49,9 @@ export default interface IProps {
|
|
|
44
49
|
* */
|
|
45
50
|
bgColor?: string;
|
|
46
51
|
/**
|
|
47
|
-
* @description
|
|
48
|
-
* */
|
|
49
|
-
iconSize?: number | string;
|
|
50
|
-
/**
|
|
51
|
-
* @description icon图片圆角
|
|
52
|
-
* */
|
|
53
|
-
round?: number | string;
|
|
54
|
-
/**
|
|
55
|
-
* @description icon图片和文字间距
|
|
52
|
+
* @description 图标属性api配置集合
|
|
56
53
|
* */
|
|
57
|
-
|
|
54
|
+
iconConfig?: Partial<HyIconProps>;
|
|
58
55
|
/**
|
|
59
56
|
* @description 定义需要用到的外部样式
|
|
60
57
|
* */
|
|
@@ -28,9 +28,19 @@
|
|
|
28
28
|
</view>
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
|
+
<script lang="ts">
|
|
32
|
+
export default {
|
|
33
|
+
name: 'hy-icon',
|
|
34
|
+
options: {
|
|
35
|
+
addGlobalClass: true,
|
|
36
|
+
virtualHost: true,
|
|
37
|
+
styleIsolation: 'shared'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
31
42
|
<script setup lang="ts">
|
|
32
43
|
import { computed, type CSSProperties, toRefs } from "vue";
|
|
33
|
-
import { ColorConfig, IconConfig } from "../../config";
|
|
34
44
|
import { addUnit } from "../../utils";
|
|
35
45
|
import defaultProps from "./props";
|
|
36
46
|
import type IProps from "./typing";
|
|
@@ -53,10 +63,11 @@ const {
|
|
|
53
63
|
const emit = defineEmits(["click"]);
|
|
54
64
|
|
|
55
65
|
const uClasses = computed(() => {
|
|
56
|
-
let classes = [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
let classes: string | string[] = [
|
|
67
|
+
"iconfont",
|
|
68
|
+
`${customPrefix.value}-${name.value}`,
|
|
69
|
+
customPrefix.value,
|
|
70
|
+
];
|
|
60
71
|
if (isRotate.value) classes.push("hy-rotate");
|
|
61
72
|
if (color.value)
|
|
62
73
|
// 主题色,通过类配置
|
|
@@ -77,11 +88,7 @@ const iconStyle = computed<CSSProperties>(() => {
|
|
|
77
88
|
// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
|
|
78
89
|
top: addUnit(top.value),
|
|
79
90
|
borderRadius: addUnit(round.value),
|
|
80
|
-
color: color.value
|
|
81
|
-
? color.value
|
|
82
|
-
: name.value === IconConfig.LOADING
|
|
83
|
-
? ColorConfig.primary
|
|
84
|
-
: "#606266",
|
|
91
|
+
color: color.value,
|
|
85
92
|
};
|
|
86
93
|
|
|
87
94
|
return style;
|
|
@@ -2,29 +2,38 @@
|
|
|
2
2
|
@use "../../public/font/iconfont.css" as *;
|
|
3
3
|
@use "../../theme.scss" as *;
|
|
4
4
|
|
|
5
|
+
/* 暗色主题 */
|
|
6
|
+
@include b(theme){
|
|
7
|
+
@include m(dark) {
|
|
8
|
+
@include b(icon) {
|
|
9
|
+
color: $hy-dark-color;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
5
13
|
|
|
6
|
-
|
|
14
|
+
@include b(icon) {
|
|
7
15
|
/* #ifndef APP-NVUE */
|
|
8
16
|
display: flex;
|
|
9
17
|
/* #endif */
|
|
10
18
|
align-items: center;
|
|
19
|
+
color: $hy-text-color-grey;
|
|
11
20
|
|
|
12
|
-
|
|
21
|
+
@include m(left) {
|
|
13
22
|
flex-direction: row-reverse;
|
|
14
23
|
align-items: center;
|
|
15
24
|
}
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
@include m(right) {
|
|
18
27
|
flex-direction: row;
|
|
19
28
|
align-items: center;
|
|
20
29
|
}
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
@include m(top) {
|
|
23
32
|
flex-direction: column-reverse;
|
|
24
33
|
justify-content: center;
|
|
25
34
|
}
|
|
26
35
|
|
|
27
|
-
|
|
36
|
+
@include m(bottom) {
|
|
28
37
|
flex-direction: column;
|
|
29
38
|
justify-content: center;
|
|
30
39
|
}
|
|
@@ -63,14 +72,14 @@
|
|
|
63
72
|
}
|
|
64
73
|
|
|
65
74
|
&__label {
|
|
66
|
-
@include
|
|
75
|
+
@include lineEllipsis;
|
|
67
76
|
overflow: hidden;
|
|
68
77
|
/* #ifndef APP-NVUE */
|
|
69
78
|
line-height: 1;
|
|
70
79
|
/* #endif */
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
|
-
|
|
82
|
+
@include b(rotate) {
|
|
74
83
|
animation: hy-rotate 1s infinite linear;
|
|
75
84
|
@keyframes hy-rotate {
|
|
76
85
|
0% {
|
|
@@ -54,6 +54,17 @@
|
|
|
54
54
|
</HyTransition>
|
|
55
55
|
</template>
|
|
56
56
|
|
|
57
|
+
<script lang="ts">
|
|
58
|
+
export default {
|
|
59
|
+
name: 'hy-image',
|
|
60
|
+
options: {
|
|
61
|
+
addGlobalClass: true,
|
|
62
|
+
virtualHost: true,
|
|
63
|
+
styleIsolation: 'shared'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
|
|
57
68
|
<script setup lang="ts">
|
|
58
69
|
import {
|
|
59
70
|
computed,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
+
@use "../../theme.scss" as *;
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
@include b(image) {
|
|
4
5
|
position: relative;
|
|
5
6
|
transition: opacity 0.5s ease-in-out;
|
|
6
7
|
|
|
@@ -19,8 +20,8 @@
|
|
|
19
20
|
@include flex;
|
|
20
21
|
align-items: center;
|
|
21
22
|
justify-content: center;
|
|
22
|
-
background-color:
|
|
23
|
-
color:
|
|
23
|
+
background-color: $hy-light-background-image;
|
|
24
|
+
color: $hy-text-color-grey;
|
|
24
25
|
font-size: 46px;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -6,13 +6,23 @@
|
|
|
6
6
|
<view class="hy-input__content">
|
|
7
7
|
<view
|
|
8
8
|
class="hy-input__content__prefix-icon"
|
|
9
|
-
v-if="prefixIcon || $slots.prefix"
|
|
9
|
+
v-if="prefixIcon?.name || $slots.prefix"
|
|
10
|
+
@tap="onPrefix"
|
|
10
11
|
>
|
|
11
12
|
<slot name="prefix">
|
|
12
13
|
<HyIcon
|
|
13
|
-
:name="prefixIcon"
|
|
14
|
-
size="
|
|
15
|
-
:
|
|
14
|
+
:name="prefixIcon?.name"
|
|
15
|
+
:size="prefixIcon?.size"
|
|
16
|
+
:color="prefixIcon?.color"
|
|
17
|
+
:bold="prefixIcon?.bold"
|
|
18
|
+
:customPrefix="prefixIcon?.customPrefix"
|
|
19
|
+
:imgMode="prefixIcon?.imgMode"
|
|
20
|
+
:width="prefixIcon?.width"
|
|
21
|
+
:height="prefixIcon?.height"
|
|
22
|
+
:top="prefixIcon?.top"
|
|
23
|
+
:stop="prefixIcon?.stop"
|
|
24
|
+
:round="prefixIcon?.round"
|
|
25
|
+
:customStyle="prefixIcon?.customStyle"
|
|
16
26
|
></HyIcon>
|
|
17
27
|
</slot>
|
|
18
28
|
</view>
|
|
@@ -65,13 +75,23 @@
|
|
|
65
75
|
</view>
|
|
66
76
|
<view
|
|
67
77
|
class="hy-input__content__subfix-icon"
|
|
68
|
-
v-if="suffixIcon || $slots.suffix"
|
|
78
|
+
v-if="suffixIcon?.name || $slots.suffix"
|
|
79
|
+
@tap="onSuffix"
|
|
69
80
|
>
|
|
70
81
|
<slot name="suffix">
|
|
71
82
|
<HyIcon
|
|
72
|
-
:name="suffixIcon"
|
|
73
|
-
size="
|
|
74
|
-
:
|
|
83
|
+
:name="suffixIcon?.name"
|
|
84
|
+
:size="suffixIcon?.size"
|
|
85
|
+
:color="suffixIcon?.color"
|
|
86
|
+
:bold="suffixIcon?.bold"
|
|
87
|
+
:customPrefix="suffixIcon?.customPrefix"
|
|
88
|
+
:imgMode="suffixIcon?.imgMode"
|
|
89
|
+
:width="suffixIcon?.width"
|
|
90
|
+
:height="suffixIcon?.height"
|
|
91
|
+
:top="suffixIcon?.top"
|
|
92
|
+
:stop="suffixIcon?.stop"
|
|
93
|
+
:round="suffixIcon?.round"
|
|
94
|
+
:customStyle="suffixIcon?.customStyle"
|
|
75
95
|
></HyIcon>
|
|
76
96
|
</slot>
|
|
77
97
|
</view>
|
|
@@ -79,6 +99,17 @@
|
|
|
79
99
|
</view>
|
|
80
100
|
</template>
|
|
81
101
|
|
|
102
|
+
<script lang="ts">
|
|
103
|
+
export default {
|
|
104
|
+
name: 'hy-input',
|
|
105
|
+
options: {
|
|
106
|
+
addGlobalClass: true,
|
|
107
|
+
virtualHost: true,
|
|
108
|
+
styleIsolation: 'shared'
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
</script>
|
|
112
|
+
|
|
82
113
|
<script setup lang="ts">
|
|
83
114
|
import {
|
|
84
115
|
computed,
|
|
@@ -92,7 +123,7 @@ import type { CSSProperties } from "vue";
|
|
|
92
123
|
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
93
124
|
import { addUnit, formatObject } from "../../utils";
|
|
94
125
|
import defaultProps from "./props";
|
|
95
|
-
import {
|
|
126
|
+
import { IconConfig } from "../../config";
|
|
96
127
|
import type IProps from "./typing";
|
|
97
128
|
|
|
98
129
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
@@ -116,6 +147,8 @@ const emit = defineEmits([
|
|
|
116
147
|
"change",
|
|
117
148
|
"update:modelValue",
|
|
118
149
|
"clear",
|
|
150
|
+
"onPrefix",
|
|
151
|
+
"onSuffix",
|
|
119
152
|
]);
|
|
120
153
|
|
|
121
154
|
const instance = getCurrentInstance();
|
|
@@ -215,10 +248,10 @@ const borderStyle = computed(() => {
|
|
|
215
248
|
if (isFocus) {
|
|
216
249
|
switch (border.value) {
|
|
217
250
|
case "surround":
|
|
218
|
-
style = { border: `1px solid
|
|
251
|
+
style = { border: `1px solid var(--hy-theme-color, #3c9cff)` };
|
|
219
252
|
break;
|
|
220
253
|
case "bottom":
|
|
221
|
-
style = { borderBottom: `1px solid
|
|
254
|
+
style = { borderBottom: `1px solid var(--hy-theme-color, #3c9cff)` };
|
|
222
255
|
break;
|
|
223
256
|
default:
|
|
224
257
|
break;
|
|
@@ -312,17 +345,23 @@ const onClear = () => {
|
|
|
312
345
|
* 无法触发u-form-item的点击事件,这里通过手动调用u-form-item的方法进行触发
|
|
313
346
|
*/
|
|
314
347
|
const clickHandler = () => {
|
|
348
|
+
// 隐藏键盘
|
|
315
349
|
if (disabled.value || readonly.value) {
|
|
316
350
|
uni.hideKeyboard();
|
|
317
351
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* @description 点击前缀
|
|
356
|
+
* */
|
|
357
|
+
const onPrefix = () => {
|
|
358
|
+
emit("onPrefix");
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* @description 点击后缀
|
|
362
|
+
* */
|
|
363
|
+
const onSuffix = () => {
|
|
364
|
+
emit("onSuffix");
|
|
326
365
|
};
|
|
327
366
|
</script>
|
|
328
367
|
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
2
|
@use "../../theme.scss" as *;
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/* 暗色主题 */
|
|
5
|
+
@include b(theme){
|
|
6
|
+
@include m(dark) {
|
|
7
|
+
@include b(input) {
|
|
8
|
+
color: $hy-dark-color;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@include b(input) {
|
|
5
14
|
@include flex(row);
|
|
6
15
|
align-items: center;
|
|
7
16
|
justify-content: space-between;
|
|
8
17
|
flex: 1;
|
|
18
|
+
color:
|
|
19
|
+
$hy-light-color;
|
|
9
20
|
|
|
10
21
|
&--radius,
|
|
11
22
|
&--square {
|
|
@@ -35,7 +46,6 @@
|
|
|
35
46
|
&__field {
|
|
36
47
|
line-height: 26px;
|
|
37
48
|
text-align: left;
|
|
38
|
-
color: $hy-text-color;
|
|
39
49
|
height: 24px;
|
|
40
50
|
font-size: 15px;
|
|
41
51
|
flex: 1;
|
|
@@ -26,11 +26,9 @@ const defaultProps: IProps = {
|
|
|
26
26
|
adjustPosition: true,
|
|
27
27
|
inputAlign: "left",
|
|
28
28
|
fontSize: "15px",
|
|
29
|
-
color: "
|
|
30
|
-
prefixIcon:
|
|
31
|
-
|
|
32
|
-
suffixIcon: "",
|
|
33
|
-
suffixIconStyle: {},
|
|
29
|
+
color: "",
|
|
30
|
+
prefixIcon: {},
|
|
31
|
+
suffixIcon: {},
|
|
34
32
|
border: "surround",
|
|
35
33
|
readonly: false,
|
|
36
34
|
shape: "square",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties } from "vue";
|
|
2
|
+
import type HyIconProps from "../hy-icon/typing";
|
|
2
3
|
|
|
3
|
-
export default interface
|
|
4
|
+
export default interface HyInputProps {
|
|
4
5
|
/**
|
|
5
6
|
* @description 输入的值
|
|
6
7
|
* */
|
|
@@ -96,7 +97,7 @@ export default interface IProps {
|
|
|
96
97
|
/**
|
|
97
98
|
* @description 输入框内容对齐方式( 默认 'left' )
|
|
98
99
|
* */
|
|
99
|
-
inputAlign?:
|
|
100
|
+
inputAlign?: HyApp.RowCenterType;
|
|
100
101
|
/**
|
|
101
102
|
* @description 输入框字体的大小 ( 默认 '15px' )
|
|
102
103
|
* */
|
|
@@ -108,19 +109,11 @@ export default interface IProps {
|
|
|
108
109
|
/**
|
|
109
110
|
* @description 输入框前置图标
|
|
110
111
|
* */
|
|
111
|
-
prefixIcon?:
|
|
112
|
-
/**
|
|
113
|
-
* @description 前置图标样式,对象或字符串
|
|
114
|
-
* */
|
|
115
|
-
prefixIconStyle?: CSSProperties;
|
|
112
|
+
prefixIcon?: Partial<HyIconProps>;
|
|
116
113
|
/**
|
|
117
114
|
* @description 输入框后置图标
|
|
118
115
|
* */
|
|
119
|
-
suffixIcon?:
|
|
120
|
-
/**
|
|
121
|
-
* @description 后置图标样式,对象或字符串
|
|
122
|
-
* */
|
|
123
|
-
suffixIconStyle?: CSSProperties;
|
|
116
|
+
suffixIcon?: Partial<HyIconProps>;
|
|
124
117
|
/**
|
|
125
118
|
* @description 边框类型,surround-四周边框,bottom-底部边框,none-无边框 ( 默认 'surround' )
|
|
126
119
|
* */
|
|
@@ -141,6 +134,14 @@ export default interface IProps {
|
|
|
141
134
|
* @description 定义需要用到的外部样式
|
|
142
135
|
* */
|
|
143
136
|
customStyle?: CSSProperties;
|
|
137
|
+
/**
|
|
138
|
+
* @description 值变化事件
|
|
139
|
+
* */
|
|
140
|
+
onChange?: Function;
|
|
141
|
+
/**
|
|
142
|
+
* @description 失去焦点事件
|
|
143
|
+
* */
|
|
144
|
+
onBlur?: Function;
|
|
144
145
|
/**
|
|
145
146
|
* @description 是否忽略组件内对文本合成系统事件的处理。
|
|
146
147
|
* */
|
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
<view class="hy-line" :style="lineStyle"> </view>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
export default {
|
|
7
|
+
name: 'hy-line',
|
|
8
|
+
options: {
|
|
9
|
+
addGlobalClass: true,
|
|
10
|
+
virtualHost: true,
|
|
11
|
+
styleIsolation: 'shared'
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
5
16
|
<script setup lang="ts">
|
|
6
17
|
import { computed, type CSSProperties, toRefs } from "vue";
|
|
7
18
|
import defaultProps from "./props";
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
<text
|
|
15
15
|
v-if="showText && percentage >= 10"
|
|
16
16
|
class="hy-line-progress__text"
|
|
17
|
+
:style="{
|
|
18
|
+
fontSize: fontSize ? addUnit(fontSize) : addUnit(getPx(height)),
|
|
19
|
+
}"
|
|
17
20
|
>{{ innserPercentage + "%" }}</text
|
|
18
21
|
>
|
|
19
22
|
</slot>
|
|
@@ -21,10 +24,22 @@
|
|
|
21
24
|
</view>
|
|
22
25
|
</template>
|
|
23
26
|
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
export default {
|
|
29
|
+
name: 'hy-line-progress',
|
|
30
|
+
options: {
|
|
31
|
+
addGlobalClass: true,
|
|
32
|
+
virtualHost: true,
|
|
33
|
+
styleIsolation: 'shared'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
24
38
|
<script setup lang="ts">
|
|
25
39
|
import {
|
|
26
40
|
computed,
|
|
27
|
-
type CSSProperties,
|
|
41
|
+
type CSSProperties,
|
|
42
|
+
getCurrentInstance,
|
|
28
43
|
onMounted,
|
|
29
44
|
ref,
|
|
30
45
|
toRefs,
|
|
@@ -32,7 +47,7 @@ import {
|
|
|
32
47
|
} from "vue";
|
|
33
48
|
import defaultProps from "./props";
|
|
34
49
|
import type IProps from "./typing";
|
|
35
|
-
import { addUnit, getRect, range, sleep } from "../../utils";
|
|
50
|
+
import { addUnit, getPx, getRect, range, sleep } from "../../utils";
|
|
36
51
|
|
|
37
52
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
38
53
|
const { percentage, activeColor, height } = toRefs(props);
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
+
@use "../../theme.scss" as *;
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
/* 暗色主题 */
|
|
5
|
+
@include b(theme){
|
|
6
|
+
@include m(dark) {
|
|
7
|
+
@include b(line-progress) {
|
|
8
|
+
&__background {
|
|
9
|
+
background-color: $hy-dark-background--track;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@include b(line-progress) {
|
|
4
16
|
align-items: stretch;
|
|
5
17
|
position: relative;
|
|
6
18
|
@include flex(row);
|
|
7
19
|
flex: 1;
|
|
8
20
|
overflow: hidden;
|
|
9
|
-
border-radius:
|
|
21
|
+
border-radius: $hy-border-radius-semicircle;
|
|
10
22
|
|
|
11
23
|
&__background {
|
|
12
|
-
background-color:
|
|
13
|
-
border-radius:
|
|
24
|
+
background-color: $hy-info-light;
|
|
25
|
+
border-radius: $hy-border-radius-semicircle;
|
|
14
26
|
flex: 1;
|
|
15
27
|
}
|
|
16
28
|
|
|
@@ -22,17 +34,17 @@
|
|
|
22
34
|
align-items: center;
|
|
23
35
|
@include flex(row);
|
|
24
36
|
color: #ffffff;
|
|
25
|
-
border-radius:
|
|
37
|
+
border-radius: $hy-border-radius-semicircle;
|
|
26
38
|
transition: width 0.5s ease;
|
|
27
39
|
justify-content: flex-end;
|
|
40
|
+
background-color: $hy-primary;
|
|
28
41
|
}
|
|
29
42
|
|
|
30
43
|
&__text {
|
|
31
44
|
font-size: 10px;
|
|
32
|
-
align-items: center;
|
|
33
|
-
text-align: right;
|
|
34
45
|
color: #ffffff;
|
|
46
|
+
margin-bottom: 1px;
|
|
35
47
|
margin-right: 5px;
|
|
36
|
-
transform: scale(0.
|
|
48
|
+
transform: scale(0.8);
|
|
37
49
|
}
|
|
38
50
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type IProps from "./typing";
|
|
2
|
-
import { ColorConfig } from "../../config";
|
|
3
2
|
|
|
4
3
|
const defaultProps: IProps = {
|
|
5
|
-
activeColor:
|
|
6
|
-
inactiveColor: "
|
|
4
|
+
activeColor: "",
|
|
5
|
+
inactiveColor: "",
|
|
7
6
|
percentage: 0,
|
|
8
7
|
showText: true,
|
|
9
|
-
height:
|
|
8
|
+
height: 8,
|
|
9
|
+
fontSize: "",
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export default defaultProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties } from "vue";
|
|
2
2
|
|
|
3
|
-
export default interface
|
|
3
|
+
export default interface HyLineProgressProps {
|
|
4
4
|
/**
|
|
5
5
|
* @description 激活部分的颜色 ( 默认 '#19be6b' )
|
|
6
6
|
* */
|
|
@@ -21,6 +21,10 @@ export default interface IProps {
|
|
|
21
21
|
* @description 进度条的高度,单位px ( 默认 12 )
|
|
22
22
|
* */
|
|
23
23
|
height?: string | number;
|
|
24
|
+
/**
|
|
25
|
+
* @description 字体大小,单位px ( 默认 10 )
|
|
26
|
+
* */
|
|
27
|
+
fontSize?: string | number;
|
|
24
28
|
/**
|
|
25
29
|
* @description 自定义样式
|
|
26
30
|
* */
|