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,6 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties } from "vue";
|
|
2
|
+
import type HyButtonProps from "../hy-button/typing";
|
|
2
3
|
|
|
3
|
-
export default interface
|
|
4
|
+
export default interface HyEmptyProps {
|
|
4
5
|
/**
|
|
5
6
|
* @description 是否显示空状态
|
|
6
7
|
* */
|
|
@@ -38,25 +39,9 @@ export default interface IProps {
|
|
|
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,26 +15,53 @@
|
|
|
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"
|
|
29
|
-
:
|
|
30
|
-
:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
:
|
|
34
|
-
:
|
|
22
|
+
:disabled="item?.input?.disabled || input?.disabled"
|
|
23
|
+
:disabledColor="
|
|
24
|
+
item?.input?.disabledColor || input?.disabledColor
|
|
25
|
+
"
|
|
26
|
+
:maxlength="item?.input?.maxlength || input?.maxlength"
|
|
27
|
+
:password="item?.input?.password"
|
|
28
|
+
:clearable="item?.input?.clearable || input?.clearable"
|
|
29
|
+
:readonly="item?.input?.readonly || input?.readonly"
|
|
30
|
+
:placeholder="item?.input?.placeholder"
|
|
31
|
+
:placeholderClass="
|
|
32
|
+
item?.input?.placeholderClass || input?.placeholderClass
|
|
33
|
+
"
|
|
34
|
+
:placeholderStyle="
|
|
35
|
+
item?.input?.placeholderStyle || input?.placeholderStyle
|
|
36
|
+
"
|
|
37
|
+
:showWordLimit="
|
|
38
|
+
item?.input?.showWordLimit || input?.showWordLimit
|
|
39
|
+
"
|
|
40
|
+
:confirmType="item?.input?.confirmType || input?.confirmType"
|
|
41
|
+
:confirmHold="item?.input?.confirmHold || input?.confirmHold"
|
|
42
|
+
:holdKeyboard="item?.input?.holdKeyboard || input?.holdKeyboard"
|
|
43
|
+
:focus="item?.input?.focus || input?.focus"
|
|
44
|
+
:autoBlur="item?.input?.autoBlur || input?.autoBlur"
|
|
45
|
+
:selectionStart="
|
|
46
|
+
item?.input?.selectionStart || input?.selectionStart
|
|
47
|
+
"
|
|
48
|
+
:selectionEnd="item?.input?.selectionEnd || input?.selectionEnd"
|
|
49
|
+
:adjustPosition="
|
|
50
|
+
item?.input?.adjustPosition || input?.adjustPosition
|
|
51
|
+
"
|
|
52
|
+
:inputAlign="item?.input?.inputAlign || input?.inputAlign"
|
|
53
|
+
:fontSize="item?.input?.fontSize || input?.fontSize"
|
|
54
|
+
:color="item?.input?.color || input?.color"
|
|
55
|
+
:prefixIcon="item?.input?.prefixIcon || input?.prefixIcon"
|
|
56
|
+
:suffixIcon="item?.input?.suffixIcon || input?.suffixIcon"
|
|
57
|
+
:formatter="item?.input?.formatter || input?.formatter"
|
|
58
|
+
:shape="item?.input?.shape || input?.shape"
|
|
59
|
+
:border="item?.input?.border || input?.border"
|
|
35
60
|
:customStyle="errorStyle(!!errors[item.field])"
|
|
36
61
|
@change="handleChange($event, item)"
|
|
37
62
|
@blur="handleBlur($event, item)"
|
|
63
|
+
@onPrefix="item?.input?.onPrefix"
|
|
64
|
+
@onSuffix="item?.input?.onSuffix"
|
|
38
65
|
></HyInput>
|
|
39
66
|
</view>
|
|
40
67
|
<!-- 输入框 -->
|
|
@@ -61,25 +88,76 @@
|
|
|
61
88
|
<view class="flex" v-if="item.type === FormTypeEnum.TEXTAREA">
|
|
62
89
|
<HyTextarea
|
|
63
90
|
v-model="formData[item.field]"
|
|
64
|
-
:disabled="disabled ||
|
|
65
|
-
:
|
|
66
|
-
:
|
|
67
|
-
:
|
|
68
|
-
|
|
69
|
-
|
|
91
|
+
:disabled="item?.textarea?.disabled || textarea?.disabled"
|
|
92
|
+
:maxlength="item?.textarea?.maxlength || textarea?.maxlength"
|
|
93
|
+
:placeholder="item?.textarea?.placeholder"
|
|
94
|
+
:placeholderClass="
|
|
95
|
+
item?.textarea?.placeholderClass || textarea?.placeholderClass
|
|
96
|
+
"
|
|
97
|
+
:placeholderStyle="
|
|
98
|
+
item?.textarea?.placeholderStyle || textarea?.placeholderStyle
|
|
99
|
+
"
|
|
100
|
+
:holdKeyboard="
|
|
101
|
+
item?.textarea?.holdKeyboard || textarea?.holdKeyboard
|
|
102
|
+
"
|
|
103
|
+
:focus="item?.textarea?.focus || textarea?.focus"
|
|
104
|
+
:selectionStart="
|
|
105
|
+
item?.textarea?.selectionStart || textarea?.selectionStart
|
|
106
|
+
"
|
|
107
|
+
:selectionEnd="
|
|
108
|
+
item?.textarea?.selectionEnd || textarea?.selectionEnd
|
|
109
|
+
"
|
|
110
|
+
:adjustPosition="
|
|
111
|
+
item?.textarea?.adjustPosition || textarea?.adjustPosition
|
|
112
|
+
"
|
|
113
|
+
:formatter="item?.textarea?.formatter || textarea?.formatter"
|
|
114
|
+
:border="item?.textarea?.border || textarea?.border"
|
|
70
115
|
:customStyle="errorStyle(!!errors[item.field])"
|
|
116
|
+
:height="textarea?.height || item?.textarea?.height"
|
|
71
117
|
@change="handleChange($event, item)"
|
|
72
118
|
@blur="handleBlur($event, item)"
|
|
73
119
|
></HyTextarea>
|
|
74
120
|
</view>
|
|
75
121
|
<!-- 文本域 -->
|
|
76
122
|
|
|
123
|
+
<!-- 复选框/单选框 -->
|
|
124
|
+
<template v-if="item.type === FormTypeEnum.CHECK_BUTTON">
|
|
125
|
+
<hy-check-button
|
|
126
|
+
v-model="formData[item.field]"
|
|
127
|
+
:columns="item.actions"
|
|
128
|
+
:type="item?.checkButton?.type || checkButton?.type"
|
|
129
|
+
:shape="item?.checkButton?.shape || checkButton?.shape"
|
|
130
|
+
:size="item?.checkButton?.size || checkButton?.size"
|
|
131
|
+
:col="item?.checkButton?.col || checkButton?.col"
|
|
132
|
+
:gap="item?.checkButton?.gap || checkButton?.gap"
|
|
133
|
+
:fieldNames="
|
|
134
|
+
item?.checkButton?.fieldNames || checkButton?.fieldNames
|
|
135
|
+
"
|
|
136
|
+
:disabled="item?.checkButton?.size || checkButton?.disabled"
|
|
137
|
+
:selectType="
|
|
138
|
+
item?.checkButton?.selectType || checkButton?.selectType
|
|
139
|
+
"
|
|
140
|
+
></hy-check-button>
|
|
141
|
+
</template>
|
|
142
|
+
<!-- 复选框/单选框 -->
|
|
143
|
+
|
|
77
144
|
<!-- 单选框 -->
|
|
78
|
-
<template v-if="item.type ===
|
|
145
|
+
<template v-if="item.type === FormTypeEnum.RADIO">
|
|
79
146
|
<HyRadio
|
|
80
147
|
v-model="formData[item.field]"
|
|
81
|
-
:disabled="disabled || item.disabled"
|
|
82
148
|
:columns="item.actions"
|
|
149
|
+
:fieldNames="item?.radio?.fieldNames || radio?.fieldNames"
|
|
150
|
+
:shape="item?.radio?.shape || radio?.shape"
|
|
151
|
+
:disabled="item?.radio?.disabled || radio?.disabled"
|
|
152
|
+
:size="item?.radio?.size || radio?.size"
|
|
153
|
+
:activeColor="item?.radio?.activeColor || radio?.activeColor"
|
|
154
|
+
:inactiveColor="
|
|
155
|
+
item?.radio?.inactiveColor || radio?.inactiveColor
|
|
156
|
+
"
|
|
157
|
+
:iconSize="item?.radio?.iconSize || radio?.iconSize"
|
|
158
|
+
:iconColor="item?.radio?.iconColor || radio?.iconColor"
|
|
159
|
+
:labelDisabled="item?.radio?.disabled || radio?.labelDisabled"
|
|
160
|
+
:placement="item?.radio?.placement || radio?.placement"
|
|
83
161
|
></HyRadio>
|
|
84
162
|
</template>
|
|
85
163
|
<!-- 单选框 -->
|
|
@@ -88,7 +166,28 @@
|
|
|
88
166
|
<template v-if="item.type === FormTypeEnum.SWITCH">
|
|
89
167
|
<HySwitch
|
|
90
168
|
v-model="formData[item.field]"
|
|
91
|
-
:
|
|
169
|
+
:loading="item?.switchItem?.loading || switchItem?.loading"
|
|
170
|
+
:disabled="item?.switchItem?.disabled || switchItem?.disabled"
|
|
171
|
+
:size="item?.switchItem?.size || switchItem?.size"
|
|
172
|
+
:activeColor="
|
|
173
|
+
item?.switchItem?.activeColor || switchItem?.activeColor
|
|
174
|
+
"
|
|
175
|
+
:inactiveColor="
|
|
176
|
+
item?.switchItem?.inactiveColor || switchItem?.inactiveColor
|
|
177
|
+
"
|
|
178
|
+
:activeValue="
|
|
179
|
+
item?.switchItem?.activeValue || switchItem?.activeValue
|
|
180
|
+
"
|
|
181
|
+
:inactiveValue="
|
|
182
|
+
item?.switchItem?.inactiveValue || switchItem?.inactiveValue
|
|
183
|
+
"
|
|
184
|
+
:activeIcon="
|
|
185
|
+
item?.switchItem?.activeIcon || switchItem?.activeIcon
|
|
186
|
+
"
|
|
187
|
+
:inactiveIcon="
|
|
188
|
+
item?.switchItem?.inactiveIcon || switchItem?.inactiveIcon
|
|
189
|
+
"
|
|
190
|
+
:space="item?.switchItem?.space || switchItem?.space"
|
|
92
191
|
></HySwitch>
|
|
93
192
|
</template>
|
|
94
193
|
<!-- 开关 -->
|
|
@@ -99,11 +198,29 @@
|
|
|
99
198
|
v-model="formData[item.field]"
|
|
100
199
|
:columns="item.select"
|
|
101
200
|
has-input
|
|
102
|
-
:
|
|
103
|
-
:
|
|
104
|
-
:
|
|
105
|
-
:
|
|
201
|
+
:separator="item?.picker?.separator || picker?.separator"
|
|
202
|
+
:itemHeight="item?.picker?.itemHeight || picker?.itemHeight"
|
|
203
|
+
:cancelText="item?.picker?.cancelText || picker?.cancelText"
|
|
204
|
+
:confirmText="item?.picker?.confirmText || picker?.confirmText"
|
|
205
|
+
:cancelColor="item?.picker?.cancelColor || picker?.cancelColor"
|
|
206
|
+
:confirmColor="item?.picker?.confirmColor || picker?.confirmColor"
|
|
207
|
+
:visibleItemCount="
|
|
208
|
+
item?.picker?.visibleItemCount || picker?.visibleItemCount
|
|
209
|
+
"
|
|
210
|
+
:closeOnClickOverlay="
|
|
211
|
+
item?.picker?.closeOnClickOverlay || picker?.closeOnClickOverlay
|
|
212
|
+
"
|
|
213
|
+
:title="item?.picker?.title || picker?.title"
|
|
214
|
+
:showToolbar="item?.picker?.showToolbar || picker?.showToolbar"
|
|
106
215
|
:customStyle="errorStyle(!!errors[item.field])"
|
|
216
|
+
:input="{
|
|
217
|
+
disabled:
|
|
218
|
+
item?.picker?.input?.disabled || picker?.input?.disabled,
|
|
219
|
+
placeholder: item.picker?.input?.placeholder,
|
|
220
|
+
shape: item?.picker?.input?.shape || picker?.input?.shape,
|
|
221
|
+
border: item?.picker?.input?.border || picker?.input?.border,
|
|
222
|
+
customStyle: errorStyle(!!errors[item.field]),
|
|
223
|
+
}"
|
|
107
224
|
></HyPicker>
|
|
108
225
|
</template>
|
|
109
226
|
<!-- 自定义选择器 -->
|
|
@@ -114,11 +231,29 @@
|
|
|
114
231
|
v-model="formData[item.field]"
|
|
115
232
|
has-input
|
|
116
233
|
:mode="item.mode"
|
|
117
|
-
:
|
|
118
|
-
:
|
|
119
|
-
:
|
|
120
|
-
:
|
|
234
|
+
:separator="item?.picker?.separator || picker?.separator"
|
|
235
|
+
:itemHeight="item?.picker?.itemHeight || picker?.itemHeight"
|
|
236
|
+
:cancelText="item?.picker?.cancelText || picker?.cancelText"
|
|
237
|
+
:confirmText="item?.picker?.confirmText || picker?.confirmText"
|
|
238
|
+
:cancelColor="item?.picker?.cancelColor || picker?.cancelColor"
|
|
239
|
+
:confirmColor="item?.picker?.confirmColor || picker?.confirmColor"
|
|
240
|
+
:visibleItemCount="
|
|
241
|
+
item?.picker?.visibleItemCount || picker?.visibleItemCount
|
|
242
|
+
"
|
|
243
|
+
:closeOnClickOverlay="
|
|
244
|
+
item?.picker?.closeOnClickOverlay || picker?.closeOnClickOverlay
|
|
245
|
+
"
|
|
246
|
+
:title="item?.picker?.title || picker?.title"
|
|
247
|
+
:showToolbar="item?.picker?.showToolbar || picker?.showToolbar"
|
|
121
248
|
:customStyle="errorStyle(!!errors[item.field])"
|
|
249
|
+
:input="{
|
|
250
|
+
disabled:
|
|
251
|
+
item?.picker?.input?.disabled || picker?.input?.disabled,
|
|
252
|
+
placeholder: item.picker?.input?.placeholder,
|
|
253
|
+
shape: item?.picker?.input?.shape || picker?.input?.shape,
|
|
254
|
+
border: item?.picker?.input?.border || picker?.input?.border,
|
|
255
|
+
customStyle: errorStyle(!!errors[item.field]),
|
|
256
|
+
}"
|
|
122
257
|
></HyDatetimePicker>
|
|
123
258
|
</template>
|
|
124
259
|
<!-- 时间选择器 -->
|
|
@@ -128,11 +263,29 @@
|
|
|
128
263
|
<HyAddressPicker
|
|
129
264
|
v-model="formData[item.field]"
|
|
130
265
|
has-input
|
|
131
|
-
:
|
|
132
|
-
:
|
|
133
|
-
:
|
|
134
|
-
:
|
|
266
|
+
:separator="item?.picker?.separator || picker?.separator"
|
|
267
|
+
:itemHeight="item?.picker?.itemHeight || picker?.itemHeight"
|
|
268
|
+
:cancelText="item?.picker?.cancelText || picker?.cancelText"
|
|
269
|
+
:confirmText="item?.picker?.confirmText || picker?.confirmText"
|
|
270
|
+
:cancelColor="item?.picker?.cancelColor || picker?.cancelColor"
|
|
271
|
+
:confirmColor="item?.picker?.confirmColor || picker?.confirmColor"
|
|
272
|
+
:visibleItemCount="
|
|
273
|
+
item?.picker?.visibleItemCount || picker?.visibleItemCount
|
|
274
|
+
"
|
|
275
|
+
:closeOnClickOverlay="
|
|
276
|
+
item?.picker?.closeOnClickOverlay || picker?.closeOnClickOverlay
|
|
277
|
+
"
|
|
278
|
+
:title="item?.picker?.title || picker?.title"
|
|
279
|
+
:showToolbar="item?.picker?.showToolbar || picker?.showToolbar"
|
|
135
280
|
:customStyle="errorStyle(!!errors[item.field])"
|
|
281
|
+
:input="{
|
|
282
|
+
disabled:
|
|
283
|
+
item?.picker?.input?.disabled || picker?.input?.disabled,
|
|
284
|
+
placeholder: item.picker?.input?.placeholder,
|
|
285
|
+
shape: item?.picker?.input?.shape || picker?.input?.shape,
|
|
286
|
+
border: item?.picker?.input?.border || picker?.input?.border,
|
|
287
|
+
customStyle: errorStyle(!!errors[item.field]),
|
|
288
|
+
}"
|
|
136
289
|
></HyAddressPicker>
|
|
137
290
|
</template>
|
|
138
291
|
<!-- 地址选择器 -->
|
|
@@ -160,6 +313,17 @@
|
|
|
160
313
|
</view>
|
|
161
314
|
</template>
|
|
162
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
|
+
|
|
163
327
|
<script setup lang="ts">
|
|
164
328
|
import { computed, type CSSProperties, reactive, toRefs } from "vue";
|
|
165
329
|
import type IProps from "./typing";
|
|
@@ -178,6 +342,7 @@ import HyRadio from "../hy-radio/hy-radio.vue";
|
|
|
178
342
|
import HyDatetimePicker from "../hy-datetime-picker/hy-datetime-picker.vue";
|
|
179
343
|
import HyAddressPicker from "../hy-address-picker/hy-address-picker.vue";
|
|
180
344
|
import HyTransition from "../hy-transition/hy-transition.vue";
|
|
345
|
+
import HyCheckButton from "../hy-check-button/hy-check-button.vue";
|
|
181
346
|
|
|
182
347
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
183
348
|
const {
|
|
@@ -191,6 +356,10 @@ const {
|
|
|
191
356
|
const emit = defineEmits(["click"]);
|
|
192
357
|
|
|
193
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;
|
|
194
363
|
|
|
195
364
|
/**
|
|
196
365
|
* @description 错误输入框样式
|
|
@@ -199,7 +368,7 @@ const errorStyle = computed(() => {
|
|
|
199
368
|
return (err: boolean) => {
|
|
200
369
|
const style: CSSProperties = {};
|
|
201
370
|
if (err) {
|
|
202
|
-
style.background = "#
|
|
371
|
+
style.background = "#dd6161";
|
|
203
372
|
}
|
|
204
373
|
|
|
205
374
|
return style;
|
|
@@ -335,12 +504,18 @@ const handleSubmit = () => {
|
|
|
335
504
|
* @description 输入值触发
|
|
336
505
|
* */
|
|
337
506
|
const handleChange = (event: string, temp: FormColumnsType) => {
|
|
507
|
+
if (isInput(temp.type) && temp?.input?.onChange) {
|
|
508
|
+
temp.input.onChange(event, temp);
|
|
509
|
+
}
|
|
338
510
|
validateField(temp.rules, event, temp.field, "change");
|
|
339
511
|
};
|
|
340
512
|
/**
|
|
341
513
|
* @description 输入值触发
|
|
342
514
|
* */
|
|
343
515
|
const handleBlur = (event: string, temp: FormColumnsType) => {
|
|
516
|
+
if (isInput(temp.type) && temp?.input?.onBlur) {
|
|
517
|
+
temp.input.onBlur(event, temp);
|
|
518
|
+
}
|
|
344
519
|
validateField(temp.rules, event, temp.field, "blur");
|
|
345
520
|
};
|
|
346
521
|
|
|
@@ -352,4 +527,7 @@ defineExpose({
|
|
|
352
527
|
|
|
353
528
|
<style lang="scss" scoped>
|
|
354
529
|
@import "./index.scss";
|
|
530
|
+
.hy-form--item {
|
|
531
|
+
flex-direction: v-bind(labelPos);
|
|
532
|
+
}
|
|
355
533
|
</style>
|
|
@@ -1,11 +1,21 @@
|
|
|
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
|
-
flex-direction: v-bind(labelPos);
|
|
7
16
|
//align-items: center;
|
|
8
17
|
margin-bottom: $hy-border-margin-padding-lg;
|
|
18
|
+
padding-bottom: $hy-border-margin-padding-sm;
|
|
9
19
|
&__label {
|
|
10
20
|
padding: $hy-border-margin-padding-base 0;
|
|
11
21
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { FormColumnsType } from "../../typing";
|
|
2
|
+
import type HyInputProps from "../hy-input/typing";
|
|
3
|
+
import type HyTextareaProps from "../hy-textarea/typing";
|
|
4
|
+
import type HySwitchProps from "../hy-switch/typing";
|
|
5
|
+
import type HyPickerProps from "../hy-picker/typing";
|
|
6
|
+
import type HyRadioProps from "../hy-radio/typing";
|
|
7
|
+
import type HyCheckButtonProps from "../hy-check-button/typing";
|
|
2
8
|
|
|
3
|
-
export default interface
|
|
9
|
+
export default interface HyFormProps {
|
|
4
10
|
/**
|
|
5
11
|
* @description 表单域提示文字的位置
|
|
6
12
|
* left - 左侧
|
|
@@ -37,17 +43,29 @@ export default interface IProps {
|
|
|
37
43
|
* */
|
|
38
44
|
itemHeight?: number | string;
|
|
39
45
|
/**
|
|
40
|
-
* @description
|
|
46
|
+
* @description 输入框属性api集合
|
|
41
47
|
* */
|
|
42
|
-
|
|
48
|
+
input?: Partial<HyInputProps>;
|
|
43
49
|
/**
|
|
44
|
-
* @description
|
|
50
|
+
* @description 文本域属性api集合
|
|
45
51
|
* */
|
|
46
|
-
|
|
52
|
+
textarea?: Partial<HyTextareaProps>;
|
|
47
53
|
/**
|
|
48
|
-
* @description
|
|
54
|
+
* @description 选择器属性api集合
|
|
49
55
|
* */
|
|
50
|
-
|
|
56
|
+
picker?: Partial<HyPickerProps>;
|
|
57
|
+
/**
|
|
58
|
+
* @description 开关属性api集合
|
|
59
|
+
* */
|
|
60
|
+
switchItem?: Partial<HySwitchProps>;
|
|
61
|
+
/**
|
|
62
|
+
* @description 单选属性api集合
|
|
63
|
+
* */
|
|
64
|
+
radio?: Partial<HyRadioProps>;
|
|
65
|
+
/**
|
|
66
|
+
* @description 选择按钮属性api集合
|
|
67
|
+
* */
|
|
68
|
+
checkButton?: Partial<HyCheckButtonProps>;
|
|
51
69
|
/**
|
|
52
70
|
* @description 表单配置
|
|
53
71
|
* */
|
|
@@ -10,12 +10,23 @@
|
|
|
10
10
|
>
|
|
11
11
|
<slot :record="item">
|
|
12
12
|
<HyIcon
|
|
13
|
-
:name="item
|
|
14
|
-
:size="iconSize"
|
|
15
|
-
:round="round"
|
|
13
|
+
:name="item?.icon"
|
|
16
14
|
label-pos="bottom"
|
|
17
|
-
:
|
|
18
|
-
:
|
|
15
|
+
:label="item?.name"
|
|
16
|
+
:space="item?.iconConfig?.space || iconConfig?.space || 12"
|
|
17
|
+
:color="item?.iconConfig?.color || iconConfig?.color"
|
|
18
|
+
:size="item?.iconConfig?.size || iconConfig?.size || 30"
|
|
19
|
+
:bold="item?.iconConfig?.bold || iconConfig?.bold"
|
|
20
|
+
:customPrefix="item?.iconConfig?.customPrefix"
|
|
21
|
+
:imgMode="item?.iconConfig?.imgMode || iconConfig?.imgMode"
|
|
22
|
+
:width="item?.iconConfig?.width || iconConfig?.width"
|
|
23
|
+
:height="item?.iconConfig?.height || iconConfig?.height"
|
|
24
|
+
:top="item?.iconConfig?.top || iconConfig?.top"
|
|
25
|
+
:stop="item?.iconConfig?.stop || iconConfig?.stop"
|
|
26
|
+
:round="item?.iconConfig?.round || iconConfig?.round || 6"
|
|
27
|
+
:customStyle="
|
|
28
|
+
item?.iconConfig?.customStyle || iconConfig?.customStyle
|
|
29
|
+
"
|
|
19
30
|
></HyIcon>
|
|
20
31
|
<!-- <view class="hy-grid-item__title">{{ item.name }}</view>-->
|
|
21
32
|
</slot>
|
|
@@ -24,6 +35,17 @@
|
|
|
24
35
|
</view>
|
|
25
36
|
</template>
|
|
26
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
|
+
|
|
27
49
|
<script setup lang="ts">
|
|
28
50
|
import { computed, type CSSProperties, toRefs } from "vue";
|
|
29
51
|
import defaultProps from "./props";
|