hy-app 0.1.5 → 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 +11 -0
- package/components/hy-address-picker/index.scss +1 -1
- package/components/hy-avatar/hy-avatar.vue +11 -0
- package/components/hy-avatar/index.scss +8 -8
- package/components/hy-back-top/hy-back-top.vue +13 -2
- package/components/hy-back-top/index.scss +11 -1
- package/components/hy-badge/hy-badge.vue +11 -0
- package/components/hy-badge/index.scss +18 -40
- package/components/hy-button/hy-button.vue +15 -5
- package/components/hy-button/index.scss +25 -45
- 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-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-cell/hy-cell.vue +22 -13
- package/components/hy-cell/index.scss +55 -28
- package/components/hy-cell/props.ts +2 -3
- package/components/hy-cell/typing.d.ts +3 -10
- package/components/hy-check-button/hy-check-button.vue +13 -2
- package/components/hy-check-button/index.scss +0 -5
- package/components/hy-checkbox/hy-checkbox.vue +31 -8
- package/components/hy-checkbox/index.scss +15 -5
- package/components/hy-checkbox/props.ts +1 -2
- package/components/hy-checkbox/typing.d.ts +1 -1
- 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-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-datetime-picker/hy-datetime-picker.vue +11 -0
- package/components/hy-datetime-picker/index.scss +1 -1
- package/components/hy-divider/hy-divider.vue +11 -0
- package/components/hy-divider/index.scss +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-item/hy-dropdown-item.vue +21 -3
- package/components/hy-dropdown-item/index.scss +35 -2
- 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 +3 -18
- 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-folding-panel/hy-folding-panel.vue +11 -0
- package/components/hy-folding-panel/index.scss +4 -1
- package/components/hy-form/hy-form.vue +25 -9
- package/components/hy-form/index.scss +12 -2
- package/components/hy-grid/hy-grid.vue +11 -0
- package/components/hy-grid/index.scss +1 -1
- package/components/hy-icon/hy-icon.vue +12 -1
- package/components/hy-icon/index.scss +16 -7
- package/components/hy-icon/props.ts +2 -2
- package/components/hy-image/hy-image.vue +11 -0
- package/components/hy-image/index.scss +4 -3
- package/components/hy-input/hy-input.vue +31 -3
- package/components/hy-input/index.scss +12 -2
- package/components/hy-input/props.ts +1 -1
- package/components/hy-input/typing.d.ts +8 -0
- package/components/hy-line/hy-line.vue +11 -0
- package/components/hy-line/index.scss +4 -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 +4 -0
- package/components/hy-list/hy-list.vue +23 -8
- package/components/hy-list/index.scss +1 -4
- package/components/hy-loading/hy-loading.vue +11 -0
- package/components/hy-loading/index.scss +2 -2
- package/components/hy-login/TheUserLogin.vue +63 -106
- package/components/hy-login/hy-login.vue +269 -266
- package/components/hy-login/props.ts +1 -1
- package/components/hy-login/typing.d.ts +5 -0
- package/components/hy-modal/hy-modal.vue +15 -7
- package/components/hy-modal/index.scss +19 -3
- 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-notice-bar/hy-notice-bar.vue +11 -0
- package/components/hy-notice-bar/index.scss +35 -35
- package/components/hy-number-step/hy-number-step.vue +15 -8
- package/components/hy-number-step/index.scss +34 -25
- package/components/hy-number-step/props.ts +4 -4
- package/components/hy-overlay/index.scss +3 -1
- package/components/hy-picker/hy-picker.vue +12 -0
- package/components/hy-picker/index.scss +7 -3
- package/components/hy-picker/props.ts +1 -1
- package/components/hy-popup/hy-popup.vue +11 -0
- package/components/hy-popup/index.scss +10 -1
- package/components/hy-price/hy-price.vue +11 -0
- package/components/hy-price/index.scss +4 -1
- package/components/hy-qrcode/hy-qrcode.vue +11 -0
- package/components/hy-qrcode/index.scss +4 -1
- package/components/hy-radio/hy-radio.vue +19 -3
- package/components/hy-radio/index.scss +17 -5
- package/components/hy-radio/props.ts +1 -2
- package/components/hy-rate/hy-rate.vue +11 -0
- package/components/hy-rate/index.scss +6 -6
- 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-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-search/hy-search.vue +11 -0
- package/components/hy-search/index.scss +25 -4
- package/components/hy-search/props.ts +2 -2
- 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-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-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-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-swiper/hy-swiper.vue +11 -0
- package/components/hy-swiper/index.scss +13 -2
- package/components/hy-switch/hy-switch.vue +17 -3
- package/components/hy-switch/index.scss +25 -7
- package/components/hy-switch/props.ts +1 -2
- package/components/hy-switch/typing.d.ts +3 -3
- 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-tag/hy-tag.vue +13 -7
- package/components/hy-tag/index.scss +27 -115
- package/components/hy-text/hy-text.vue +12 -1
- package/components/hy-text/index.scss +20 -37
- package/components/hy-textarea/hy-textarea.vue +16 -5
- package/components/hy-textarea/index.scss +16 -5
- package/components/hy-toast/hy-toast.vue +12 -1
- package/components/hy-toast/index.scss +26 -26
- 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-upload/hy-upload.vue +11 -0
- package/components/hy-upload/index.scss +12 -1
- package/components/hy-warn/hy-warn.vue +22 -11
- package/components/hy-warn/index.scss +46 -1
- package/components/hy-waterfall/hy-waterfall.vue +11 -0
- package/components/hy-waterfall/index.scss +1 -1
- package/config/icon.ts +4 -0
- package/libs/css/common.scss +9 -0
- package/libs/css/mixin.scss +78 -0
- package/package.json +2 -2
- package/public/font/iconfont.css +3 -3
- package/store/userInfo.ts +26 -25
- package/theme.scss +76 -60
- package/typing/modules/common.d.ts +4 -0
- 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
- /package/components/{hy-submitBar → hy-submit-bar}/typing.d.ts +0 -0
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- 标题栏 -->
|
|
3
|
-
<view
|
|
3
|
+
<view
|
|
4
|
+
:class="[
|
|
5
|
+
'hy-dropdown-item__header',
|
|
6
|
+
isOpen && 'hy-dropdown-item__header--active',
|
|
7
|
+
]"
|
|
8
|
+
@click="handleClick"
|
|
9
|
+
>
|
|
4
10
|
<text
|
|
5
11
|
class="hy-dropdown-item__header--title"
|
|
6
12
|
:style="{ color: currentColor, fontSize: addUnit(titleSize) }"
|
|
@@ -31,7 +37,10 @@
|
|
|
31
37
|
<!-- 选项 -->
|
|
32
38
|
<view class="hy-dropdown-item__main--container__list" v-else>
|
|
33
39
|
<view
|
|
34
|
-
class="
|
|
40
|
+
:class="[
|
|
41
|
+
'hy-dropdown-item__main--container__list-item',
|
|
42
|
+
isOpen && 'hy-dropdown-item__main--container__list--active',
|
|
43
|
+
]"
|
|
35
44
|
v-for="(item, index) in menus"
|
|
36
45
|
:key="item.value || index"
|
|
37
46
|
@click="onSelect(item, index)"
|
|
@@ -57,7 +66,16 @@
|
|
|
57
66
|
</template>
|
|
58
67
|
|
|
59
68
|
<script setup lang="ts">
|
|
60
|
-
import {
|
|
69
|
+
import {
|
|
70
|
+
computed,
|
|
71
|
+
inject,
|
|
72
|
+
ref,
|
|
73
|
+
onMounted,
|
|
74
|
+
watch,
|
|
75
|
+
useSlots,
|
|
76
|
+
toRefs,
|
|
77
|
+
getCurrentInstance,
|
|
78
|
+
} from "vue";
|
|
61
79
|
import defaultProps from "./props";
|
|
62
80
|
import type IProps from "./typing";
|
|
63
81
|
import type FatherIProps from "../hy-dropdown/typing";
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
@use "../../theme.scss" as *;
|
|
2
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
/* 暗色主题 */
|
|
5
|
+
@include b(theme){
|
|
6
|
+
@include m(dark) {
|
|
7
|
+
@include b(dropdown-item) {
|
|
8
|
+
color: $hy-dark-color;
|
|
9
|
+
&__header {
|
|
10
|
+
background-color: $hy-dark-background--container;
|
|
11
|
+
}
|
|
12
|
+
&__main--container {
|
|
13
|
+
background-color: $hy-dark-background--container;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@include b(dropdown-item) {
|
|
4
20
|
&__header {
|
|
5
21
|
width: 100%;
|
|
6
22
|
height: 100%;
|
|
@@ -15,6 +31,15 @@
|
|
|
15
31
|
position: relative;
|
|
16
32
|
z-index: 999;
|
|
17
33
|
background-color: #ffffff;
|
|
34
|
+
|
|
35
|
+
&--active {
|
|
36
|
+
color: $hy-primary;
|
|
37
|
+
:deep() {
|
|
38
|
+
@include b(icon) {
|
|
39
|
+
color: $hy-primary;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
18
43
|
}
|
|
19
44
|
|
|
20
45
|
&__main {
|
|
@@ -47,6 +72,14 @@
|
|
|
47
72
|
width: 100%;
|
|
48
73
|
padding: 0 35rpx;
|
|
49
74
|
box-sizing: border-box;
|
|
75
|
+
&--active {
|
|
76
|
+
color: $hy-primary;
|
|
77
|
+
:deep() {
|
|
78
|
+
@include b(icon) {
|
|
79
|
+
color: $hy-primary;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
50
83
|
&-item {
|
|
51
84
|
width: 100%;
|
|
52
85
|
padding: 30rpx 0;
|
|
@@ -55,7 +88,7 @@
|
|
|
55
88
|
align-items: center;
|
|
56
89
|
|
|
57
90
|
&:not(:last-of-type) {
|
|
58
|
-
border-bottom:
|
|
91
|
+
border-bottom: $hy-border-line;
|
|
59
92
|
}
|
|
60
93
|
|
|
61
94
|
&--label {
|
|
@@ -14,20 +14,32 @@
|
|
|
14
14
|
<view class="hy-empty__description" v-else>
|
|
15
15
|
<slot v-if="$slots.description" name="description"></slot>
|
|
16
16
|
<text v-else :style="descriptionStyle">{{ emptyDescription }}</text>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
<view class="hy-empty__button" v-if="button?.text">
|
|
18
|
+
<HyButton
|
|
19
|
+
:text="button?.text"
|
|
20
|
+
:size="button?.size"
|
|
21
|
+
:type="button?.type"
|
|
22
|
+
:shape="button?.shape"
|
|
23
|
+
:plain="button?.plain"
|
|
24
|
+
:custom-style="button?.customStyle"
|
|
25
|
+
@click="handleClick"
|
|
26
|
+
></HyButton>
|
|
27
|
+
</view>
|
|
27
28
|
</view>
|
|
28
29
|
</view>
|
|
29
30
|
</template>
|
|
30
31
|
|
|
32
|
+
<script lang="ts">
|
|
33
|
+
export default {
|
|
34
|
+
name: "hy-empty",
|
|
35
|
+
options: {
|
|
36
|
+
addGlobalClass: true,
|
|
37
|
+
virtualHost: true,
|
|
38
|
+
styleIsolation: "shared",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
42
|
+
|
|
31
43
|
<script setup lang="ts">
|
|
32
44
|
import { computed, type CSSProperties, toRefs } from "vue";
|
|
33
45
|
import defaultProps from "./props";
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
.
|
|
1
|
+
@use "../../theme.scss" as *;
|
|
2
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
3
|
+
|
|
4
|
+
/* 暗色主题 */
|
|
5
|
+
@include b(theme){
|
|
6
|
+
@include m(dark) {
|
|
7
|
+
@include b(empty) {
|
|
8
|
+
background-color: $hy-dark-background;
|
|
9
|
+
color: $hy-dark-color;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@include b(empty) {
|
|
2
15
|
top: 0;
|
|
3
16
|
left: 0;
|
|
4
17
|
width: 100%;
|
|
@@ -7,13 +20,14 @@
|
|
|
7
20
|
justify-content: center;
|
|
8
21
|
align-items: center;
|
|
9
22
|
flex-direction: column;
|
|
10
|
-
background:
|
|
23
|
+
background: $hy-light-background;
|
|
11
24
|
&__description {
|
|
12
25
|
width: 70%;
|
|
13
26
|
text-align: center;
|
|
27
|
+
margin-top: $hy-border-margin-padding-base;
|
|
14
28
|
}
|
|
15
29
|
|
|
16
30
|
&__button {
|
|
17
|
-
margin-top:
|
|
31
|
+
margin-top: 100rpx;
|
|
18
32
|
}
|
|
19
33
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from "vue";
|
|
2
|
+
import type HyButtonProps from "../hy-button/typing";
|
|
2
3
|
|
|
3
4
|
export default interface HyEmptyProps {
|
|
4
5
|
/**
|
|
@@ -38,25 +39,9 @@ export default interface HyEmptyProps {
|
|
|
38
39
|
* */
|
|
39
40
|
imgMargin?: string;
|
|
40
41
|
/**
|
|
41
|
-
* @description
|
|
42
|
+
* @description 按钮属性只
|
|
42
43
|
* */
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @description 按钮尺寸,large,normal,mini (默认 normal)
|
|
46
|
-
* */
|
|
47
|
-
btnSize?: "normal" | "large" | "small" | "mini";
|
|
48
|
-
/**
|
|
49
|
-
* @description 按钮的预置样式,info,primary,error,warning,success (默认 'info' )
|
|
50
|
-
* */
|
|
51
|
-
btnType?: HyApp.ThemeType;
|
|
52
|
-
/**
|
|
53
|
-
* @description 按钮形状,circle(两边为半圆),square(带圆角) (默认 'square' )
|
|
54
|
-
* */
|
|
55
|
-
btnShape?: HyApp.ShapeType;
|
|
56
|
-
/**
|
|
57
|
-
* @description 按钮是否镂空,背景色透明 (默认 false)
|
|
58
|
-
* */
|
|
59
|
-
btnPlain?: boolean;
|
|
44
|
+
button?: HyButtonProps;
|
|
60
45
|
/**
|
|
61
46
|
* @description 跳转地址
|
|
62
47
|
* */
|
|
@@ -57,6 +57,17 @@
|
|
|
57
57
|
</view>
|
|
58
58
|
</template>
|
|
59
59
|
|
|
60
|
+
<script lang="ts">
|
|
61
|
+
export default {
|
|
62
|
+
name: 'hy-float-button',
|
|
63
|
+
options: {
|
|
64
|
+
addGlobalClass: true,
|
|
65
|
+
virtualHost: true,
|
|
66
|
+
styleIsolation: 'shared'
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
60
71
|
<script lang="ts" setup>
|
|
61
72
|
import {
|
|
62
73
|
computed,
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
@use "../../theme.scss" as *;
|
|
2
2
|
@use "../../libs/css/mixin.scss" as *;
|
|
3
3
|
|
|
4
|
+
/* 暗色主题 */
|
|
5
|
+
@include b(theme){
|
|
6
|
+
@include m(dark) {
|
|
7
|
+
@include b(float-button) {
|
|
8
|
+
//color: $hy-dark-color;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
@include b(float-button) {
|
|
6
14
|
position: relative;
|
|
7
|
-
|
|
15
|
+
background-color: $hy-primary;
|
|
16
|
+
color: $hy-dark-color;
|
|
8
17
|
&__circle {
|
|
9
18
|
border-radius: $hy-border-radius-semicircle;
|
|
10
19
|
}
|
|
@@ -38,6 +47,7 @@
|
|
|
38
47
|
justify-content: center;
|
|
39
48
|
align-items: center;
|
|
40
49
|
transition: 0.4s ease;
|
|
50
|
+
background-color: $hy-primary;
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
&__menus {
|
|
@@ -46,6 +56,7 @@
|
|
|
46
56
|
overflow: hidden;
|
|
47
57
|
max-height: 250px;
|
|
48
58
|
box-sizing: border-box;
|
|
59
|
+
background-color: $hy-primary;
|
|
49
60
|
&--item {
|
|
50
61
|
font-size: 28rpx;
|
|
51
62
|
box-sizing: border-box;
|
|
@@ -6,14 +6,14 @@ const defaultProps: IProps = {
|
|
|
6
6
|
direction: "column",
|
|
7
7
|
icon: IconConfig.PLUS,
|
|
8
8
|
iconSize: "",
|
|
9
|
-
iconColor: "
|
|
9
|
+
iconColor: "",
|
|
10
10
|
bottom: 80,
|
|
11
11
|
left: 20,
|
|
12
12
|
zIndex: 10086,
|
|
13
|
-
bgColor: "
|
|
13
|
+
bgColor: "",
|
|
14
14
|
text: "",
|
|
15
15
|
fontSize: "12px",
|
|
16
|
-
textColor: "
|
|
16
|
+
textColor: "",
|
|
17
17
|
size: "medium",
|
|
18
18
|
shape: "circle",
|
|
19
19
|
opacity: 1,
|
|
@@ -38,6 +38,17 @@
|
|
|
38
38
|
</view>
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
|
+
<script lang="ts">
|
|
42
|
+
export default {
|
|
43
|
+
name: 'hy-folding-panel',
|
|
44
|
+
options: {
|
|
45
|
+
addGlobalClass: true,
|
|
46
|
+
virtualHost: true,
|
|
47
|
+
styleIsolation: 'shared'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
41
52
|
<script setup lang="ts">
|
|
42
53
|
import { toRefs, ref, watch } from "vue";
|
|
43
54
|
import defaultProps from "./props";
|
|
@@ -15,14 +15,7 @@
|
|
|
15
15
|
<view class="hy-form--item__container">
|
|
16
16
|
<view class="hy-form--item__container-content">
|
|
17
17
|
<!-- 输入框 -->
|
|
18
|
-
<view
|
|
19
|
-
class="flex"
|
|
20
|
-
v-if="
|
|
21
|
-
item.type === FormTypeEnum.TEXT ||
|
|
22
|
-
item.type === FormTypeEnum.NUMBER ||
|
|
23
|
-
item.type === FormTypeEnum.PASSWORD
|
|
24
|
-
"
|
|
25
|
-
>
|
|
18
|
+
<view class="flex" v-if="isInput(item.type)">
|
|
26
19
|
<HyInput
|
|
27
20
|
v-model="formData[item.field]"
|
|
28
21
|
:type="item.type"
|
|
@@ -67,6 +60,8 @@
|
|
|
67
60
|
:customStyle="errorStyle(!!errors[item.field])"
|
|
68
61
|
@change="handleChange($event, item)"
|
|
69
62
|
@blur="handleBlur($event, item)"
|
|
63
|
+
@onPrefix="item?.input?.onPrefix"
|
|
64
|
+
@onSuffix="item?.input?.onSuffix"
|
|
70
65
|
></HyInput>
|
|
71
66
|
</view>
|
|
72
67
|
<!-- 输入框 -->
|
|
@@ -318,6 +313,17 @@
|
|
|
318
313
|
</view>
|
|
319
314
|
</template>
|
|
320
315
|
|
|
316
|
+
<script lang="ts">
|
|
317
|
+
export default {
|
|
318
|
+
name: 'hy-form',
|
|
319
|
+
options: {
|
|
320
|
+
addGlobalClass: true,
|
|
321
|
+
virtualHost: true,
|
|
322
|
+
styleIsolation: 'shared'
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
</script>
|
|
326
|
+
|
|
321
327
|
<script setup lang="ts">
|
|
322
328
|
import { computed, type CSSProperties, reactive, toRefs } from "vue";
|
|
323
329
|
import type IProps from "./typing";
|
|
@@ -350,6 +356,10 @@ const {
|
|
|
350
356
|
const emit = defineEmits(["click"]);
|
|
351
357
|
|
|
352
358
|
const labelPos = labelPosition.value === "top" ? "column" : "row";
|
|
359
|
+
const isInput = (type: FormTypeEnum) =>
|
|
360
|
+
type === FormTypeEnum.TEXT ||
|
|
361
|
+
type === FormTypeEnum.NUMBER ||
|
|
362
|
+
type === FormTypeEnum.PASSWORD;
|
|
353
363
|
|
|
354
364
|
/**
|
|
355
365
|
* @description 错误输入框样式
|
|
@@ -358,7 +368,7 @@ const errorStyle = computed(() => {
|
|
|
358
368
|
return (err: boolean) => {
|
|
359
369
|
const style: CSSProperties = {};
|
|
360
370
|
if (err) {
|
|
361
|
-
style.background = "#
|
|
371
|
+
style.background = "#dd6161";
|
|
362
372
|
}
|
|
363
373
|
|
|
364
374
|
return style;
|
|
@@ -494,12 +504,18 @@ const handleSubmit = () => {
|
|
|
494
504
|
* @description 输入值触发
|
|
495
505
|
* */
|
|
496
506
|
const handleChange = (event: string, temp: FormColumnsType) => {
|
|
507
|
+
if (isInput(temp.type) && temp?.input?.onChange) {
|
|
508
|
+
temp.input.onChange(event, temp);
|
|
509
|
+
}
|
|
497
510
|
validateField(temp.rules, event, temp.field, "change");
|
|
498
511
|
};
|
|
499
512
|
/**
|
|
500
513
|
* @description 输入值触发
|
|
501
514
|
* */
|
|
502
515
|
const handleBlur = (event: string, temp: FormColumnsType) => {
|
|
516
|
+
if (isInput(temp.type) && temp?.input?.onBlur) {
|
|
517
|
+
temp.input.onBlur(event, temp);
|
|
518
|
+
}
|
|
503
519
|
validateField(temp.rules, event, temp.field, "blur");
|
|
504
520
|
};
|
|
505
521
|
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
@use "../../theme.scss" as *;
|
|
2
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
/* 暗色主题 */
|
|
5
|
+
@include b(theme){
|
|
6
|
+
@include m(dark) {
|
|
7
|
+
@include b(form) {
|
|
8
|
+
color: $hy-dark-color;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@include b(form) {
|
|
14
|
+
@include m(item) {
|
|
5
15
|
display: flex;
|
|
6
16
|
//align-items: center;
|
|
7
17
|
margin-bottom: $hy-border-margin-padding-lg;
|
|
@@ -35,6 +35,17 @@
|
|
|
35
35
|
</view>
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
|
+
<script lang="ts">
|
|
39
|
+
export default {
|
|
40
|
+
name: 'hy-grid',
|
|
41
|
+
options: {
|
|
42
|
+
addGlobalClass: true,
|
|
43
|
+
virtualHost: true,
|
|
44
|
+
styleIsolation: 'shared'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
48
|
+
|
|
38
49
|
<script setup lang="ts">
|
|
39
50
|
import { computed, type CSSProperties, toRefs } from "vue";
|
|
40
51
|
import defaultProps from "./props";
|
|
@@ -28,6 +28,17 @@
|
|
|
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
44
|
import { addUnit } from "../../utils";
|
|
@@ -77,7 +88,7 @@ const iconStyle = computed<CSSProperties>(() => {
|
|
|
77
88
|
// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
|
|
78
89
|
top: addUnit(top.value),
|
|
79
90
|
borderRadius: addUnit(round.value),
|
|
80
|
-
color: color.value
|
|
91
|
+
color: color.value,
|
|
81
92
|
};
|
|
82
93
|
|
|
83
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
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<view
|
|
8
8
|
class="hy-input__content__prefix-icon"
|
|
9
9
|
v-if="prefixIcon?.name || $slots.prefix"
|
|
10
|
+
@tap="onPrefix"
|
|
10
11
|
>
|
|
11
12
|
<slot name="prefix">
|
|
12
13
|
<HyIcon
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
<view
|
|
76
77
|
class="hy-input__content__subfix-icon"
|
|
77
78
|
v-if="suffixIcon?.name || $slots.suffix"
|
|
79
|
+
@tap="onSuffix"
|
|
78
80
|
>
|
|
79
81
|
<slot name="suffix">
|
|
80
82
|
<HyIcon
|
|
@@ -97,6 +99,17 @@
|
|
|
97
99
|
</view>
|
|
98
100
|
</template>
|
|
99
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
|
+
|
|
100
113
|
<script setup lang="ts">
|
|
101
114
|
import {
|
|
102
115
|
computed,
|
|
@@ -110,7 +123,7 @@ import type { CSSProperties } from "vue";
|
|
|
110
123
|
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
111
124
|
import { addUnit, formatObject } from "../../utils";
|
|
112
125
|
import defaultProps from "./props";
|
|
113
|
-
import {
|
|
126
|
+
import { IconConfig } from "../../config";
|
|
114
127
|
import type IProps from "./typing";
|
|
115
128
|
|
|
116
129
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
@@ -134,6 +147,8 @@ const emit = defineEmits([
|
|
|
134
147
|
"change",
|
|
135
148
|
"update:modelValue",
|
|
136
149
|
"clear",
|
|
150
|
+
"onPrefix",
|
|
151
|
+
"onSuffix",
|
|
137
152
|
]);
|
|
138
153
|
|
|
139
154
|
const instance = getCurrentInstance();
|
|
@@ -233,10 +248,10 @@ const borderStyle = computed(() => {
|
|
|
233
248
|
if (isFocus) {
|
|
234
249
|
switch (border.value) {
|
|
235
250
|
case "surround":
|
|
236
|
-
style = { border: `1px solid
|
|
251
|
+
style = { border: `1px solid var(--hy-theme-color, #3c9cff)` };
|
|
237
252
|
break;
|
|
238
253
|
case "bottom":
|
|
239
|
-
style = { borderBottom: `1px solid
|
|
254
|
+
style = { borderBottom: `1px solid var(--hy-theme-color, #3c9cff)` };
|
|
240
255
|
break;
|
|
241
256
|
default:
|
|
242
257
|
break;
|
|
@@ -335,6 +350,19 @@ const clickHandler = () => {
|
|
|
335
350
|
uni.hideKeyboard();
|
|
336
351
|
}
|
|
337
352
|
};
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* @description 点击前缀
|
|
356
|
+
* */
|
|
357
|
+
const onPrefix = () => {
|
|
358
|
+
emit("onPrefix");
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* @description 点击后缀
|
|
362
|
+
* */
|
|
363
|
+
const onSuffix = () => {
|
|
364
|
+
emit("onSuffix");
|
|
365
|
+
};
|
|
338
366
|
</script>
|
|
339
367
|
|
|
340
368
|
<style lang="scss" scoped>
|