hy-app 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/hy-action-sheet/index.scss +0 -5
- package/components/hy-back-top/hy-back-top.vue +10 -9
- package/components/hy-back-top/props.ts +5 -3
- package/components/hy-badge/hy-badge.vue +2 -1
- package/components/hy-badge/props.ts +5 -3
- package/components/hy-button/hy-button.vue +5 -5
- package/components/hy-button/index.scss +9 -0
- package/components/hy-button/props.ts +11 -6
- package/components/hy-coupon/hy-coupon.vue +159 -167
- package/components/hy-coupon/index.scss +130 -516
- package/components/hy-coupon/props.ts +98 -127
- package/components/hy-coupon/typing.d.ts +147 -146
- package/components/hy-folding-panel-item/hy-folding-panel-item.vue +1 -3
- package/components/hy-folding-panel-item/index.scss +0 -8
- package/components/hy-form-group/hy-form-group.vue +308 -511
- package/components/hy-form-group/index.scss +0 -33
- package/components/hy-form-group/props.ts +103 -13
- package/components/hy-form-group/typing.d.ts +0 -77
- package/components/hy-form-item/hy-form-item.vue +3 -3
- package/components/hy-input/hy-input.vue +16 -10
- package/components/hy-input/index.scss +4 -0
- package/components/hy-input/props.ts +2 -2
- package/components/hy-notice-bar/hy-column-notice.vue +63 -70
- package/components/hy-notice-bar/hy-row-notice.vue +92 -110
- package/components/hy-notice-bar/index.scss +2 -4
- package/components/hy-notice-bar/props.ts +4 -1
- package/components/hy-qrcode/hy-qrcode.vue +1 -1
- package/components/hy-qrcode/index.scss +1 -0
- package/components/hy-qrcode/qrcode.js +1208 -1402
- package/components/hy-rate/hy-rate.vue +0 -1
- package/components/hy-read-more/hy-read-more.vue +1 -1
- package/components/hy-textarea/hy-textarea.vue +1 -1
- package/components/hy-textarea/index.scss +8 -7
- package/components/hy-toast/index.scss +2 -7
- package/libs/css/common.scss +0 -5
- package/libs/typing/modules/form.ts +159 -163
- package/package.json +2 -2
- package/web-types.json +1 -1
- package/components/hy-coupon/README.md +0 -133
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
import { computed, ref, onMounted, getCurrentInstance } from 'vue'
|
|
63
63
|
import type { CSSProperties } from 'vue'
|
|
64
64
|
import type { IReadMoreEmits } from './typing'
|
|
65
|
-
import { getRect, guid, sleep, IconConfig } from '../../libs'
|
|
65
|
+
import { getRect, guid, sleep, addUnit, IconConfig } from '../../libs'
|
|
66
66
|
import readMoreProps from './props'
|
|
67
67
|
// 组件
|
|
68
68
|
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:style="[textareaStyle, borderStyle(isFocus)]"
|
|
5
5
|
>
|
|
6
6
|
<textarea
|
|
7
|
-
class="hy-textarea__field"
|
|
7
|
+
:class="['hy-textarea__field', disabled && 'hy-textarea__disabled-text']"
|
|
8
8
|
:value="innerValue"
|
|
9
9
|
:style="`height: ${autoHeight ? 'auto' : addUnit(height)}`"
|
|
10
10
|
:placeholder="placeholder || ''"
|
|
@@ -8,12 +8,6 @@
|
|
|
8
8
|
flex: 1;
|
|
9
9
|
padding: $hy-border-margin-padding-sm;
|
|
10
10
|
|
|
11
|
-
@include e(field) {
|
|
12
|
-
min-height: 50rpx;
|
|
13
|
-
max-height: 200rpx;
|
|
14
|
-
color: $hy-text-color;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
11
|
@include e(radius) {
|
|
18
12
|
border-radius: $hy-border-radius-sm;
|
|
19
13
|
}
|
|
@@ -24,10 +18,17 @@
|
|
|
24
18
|
|
|
25
19
|
@include e(disabled) {
|
|
26
20
|
background-color: $hy-background--disabled;
|
|
27
|
-
color: $hy-text-color--disabled;
|
|
21
|
+
color: $hy-text-color--disabled !important;
|
|
22
|
+
|
|
23
|
+
&-text {
|
|
24
|
+
color: $hy-text-color--disabled !important;
|
|
25
|
+
}
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
@include e(field) {
|
|
29
|
+
min-height: 50rpx;
|
|
30
|
+
max-height: 200rpx;
|
|
31
|
+
color: $hy-text-color;
|
|
31
32
|
flex: 1;
|
|
32
33
|
font-size: 15px;
|
|
33
34
|
width: 100%;
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
@include m(icon) {
|
|
23
|
-
width:
|
|
24
|
-
height:
|
|
23
|
+
width: 60rpx;
|
|
24
|
+
height: 60rpx;
|
|
25
25
|
border-radius: $hy-border-radius-semicircle;
|
|
26
26
|
box-sizing: border-box;
|
|
27
27
|
margin-right: $hy-border-margin-padding-base;
|
|
@@ -31,27 +31,22 @@
|
|
|
31
31
|
|
|
32
32
|
@include e(info) {
|
|
33
33
|
background: $hy-info;
|
|
34
|
-
border: 6rpx solid $hy-info-dark;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
@include e(primary) {
|
|
38
37
|
background: $hy-primary;
|
|
39
|
-
border: 6rpx solid $hy-primary-dark;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
@include e(success) {
|
|
43
41
|
background: $hy-success;
|
|
44
|
-
border: 6rpx solid $hy-success-dark;
|
|
45
42
|
}
|
|
46
43
|
|
|
47
44
|
@include e(error) {
|
|
48
45
|
background: $hy-error;
|
|
49
|
-
border: 6rpx solid $hy-error-dark;
|
|
50
46
|
}
|
|
51
47
|
|
|
52
48
|
@include e(warning) {
|
|
53
49
|
background: $hy-warning;
|
|
54
|
-
border: 6rpx solid $hy-warning-dark;
|
|
55
50
|
}
|
|
56
51
|
}
|
|
57
52
|
|
package/libs/css/common.scss
CHANGED
|
@@ -1,176 +1,172 @@
|
|
|
1
|
-
import type { DateModeEnum } from
|
|
2
|
-
import type { CheckboxColumnsVo } from
|
|
3
|
-
import type HyInputProps from
|
|
4
|
-
import type HyTextareaProps from
|
|
5
|
-
import type HySwitchProps from
|
|
6
|
-
import type HyPickerProps from
|
|
7
|
-
import type HyRadioProps from
|
|
8
|
-
import type HyCheckButtonProps from
|
|
1
|
+
import type { DateModeEnum } from './enum'
|
|
2
|
+
import type { CheckboxColumnsVo } from '../../../components/hy-check-button/typing'
|
|
3
|
+
import type HyInputProps from '../../../components/hy-input/typing'
|
|
4
|
+
import type HyTextareaProps from '../../../components/hy-textarea/typing'
|
|
5
|
+
import type HySwitchProps from '../../../components/hy-switch/typing'
|
|
6
|
+
import type HyPickerProps from '../../../components/hy-picker/typing'
|
|
7
|
+
import type HyRadioProps from '../../../components/hy-radio/typing'
|
|
8
|
+
import type HyCheckButtonProps from '../../../components/hy-check-button/typing'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* 类型
|
|
12
12
|
* */
|
|
13
13
|
export enum FormTypeEnum {
|
|
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
|
-
|
|
14
|
+
/**
|
|
15
|
+
* 上传文件
|
|
16
|
+
* */
|
|
17
|
+
UPLOAD = 'upload',
|
|
18
|
+
/**
|
|
19
|
+
* 普通输入框
|
|
20
|
+
* */
|
|
21
|
+
TEXT = 'text',
|
|
22
|
+
/**
|
|
23
|
+
* 数字输入框
|
|
24
|
+
* */
|
|
25
|
+
NUMBER = 'number',
|
|
26
|
+
/**
|
|
27
|
+
* 密码输入框
|
|
28
|
+
* */
|
|
29
|
+
PASSWORD = 'password',
|
|
30
|
+
/**
|
|
31
|
+
* 身份证id输入框
|
|
32
|
+
* */
|
|
33
|
+
ID_CARD = 'idcard',
|
|
34
|
+
/**
|
|
35
|
+
* 单选
|
|
36
|
+
* */
|
|
37
|
+
RADIO = 'radio',
|
|
38
|
+
/**
|
|
39
|
+
* 选择按钮(单选/多选)
|
|
40
|
+
* */
|
|
41
|
+
CHECK_BUTTON = 'checkButton',
|
|
42
|
+
/**
|
|
43
|
+
* 时间选择器
|
|
44
|
+
* */
|
|
45
|
+
DATE = 'date',
|
|
46
|
+
/**
|
|
47
|
+
* 选择器
|
|
48
|
+
* */
|
|
49
|
+
SELECT = 'select',
|
|
50
|
+
/**
|
|
51
|
+
* 地址选择器
|
|
52
|
+
* */
|
|
53
|
+
ADDRESS = 'address',
|
|
54
|
+
/**
|
|
55
|
+
* 开关
|
|
56
|
+
* */
|
|
57
|
+
SWITCH = 'switch',
|
|
58
|
+
/**
|
|
59
|
+
* 详情
|
|
60
|
+
* */
|
|
61
|
+
DETAIL = 'detail',
|
|
62
|
+
/**
|
|
63
|
+
* 文本域
|
|
64
|
+
* */
|
|
65
|
+
TEXTAREA = 'textarea',
|
|
66
|
+
/**
|
|
67
|
+
* 自定义
|
|
68
|
+
* */
|
|
69
|
+
CUSTOM = 'custom'
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export interface FormColumnsType {
|
|
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
|
-
* @description 是否禁用
|
|
99
|
-
* */
|
|
100
|
-
disabled?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* 标题
|
|
75
|
+
* */
|
|
76
|
+
label: string
|
|
77
|
+
/**
|
|
78
|
+
* 字段
|
|
79
|
+
* */
|
|
80
|
+
field: string
|
|
81
|
+
/**
|
|
82
|
+
* 右固定
|
|
83
|
+
* */
|
|
84
|
+
right?: boolean
|
|
85
|
+
/**
|
|
86
|
+
* @description 表单类型
|
|
87
|
+
* */
|
|
88
|
+
type: FormTypeEnum
|
|
89
|
+
/**
|
|
90
|
+
* @description 文件最大上传数据
|
|
91
|
+
* */
|
|
92
|
+
maxCount?: number
|
|
93
|
+
/**
|
|
94
|
+
* @description 是否禁用
|
|
95
|
+
* */
|
|
96
|
+
disabled?: boolean
|
|
101
97
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
98
|
+
/**
|
|
99
|
+
* @description type = select时候必填
|
|
100
|
+
* */
|
|
101
|
+
select?: string[][] | { text: string; id: string }[][]
|
|
102
|
+
/**
|
|
103
|
+
* @description type = radio时候必填
|
|
104
|
+
* */
|
|
105
|
+
actions?: CheckboxColumnsVo[]
|
|
106
|
+
/**
|
|
107
|
+
* @description 输入框属性api集合
|
|
108
|
+
* */
|
|
109
|
+
input?: Partial<HyInputProps>
|
|
110
|
+
/**
|
|
111
|
+
* @description 文本域属性api集合
|
|
112
|
+
* */
|
|
113
|
+
textarea?: Partial<HyTextareaProps>
|
|
114
|
+
/**
|
|
115
|
+
* @description 开关属性api集合
|
|
116
|
+
* */
|
|
117
|
+
switchItem?: Partial<HySwitchProps>
|
|
118
|
+
/**
|
|
119
|
+
* @description 选择器属性api集合
|
|
120
|
+
* */
|
|
121
|
+
picker?: Partial<HyPickerProps>
|
|
122
|
+
/**
|
|
123
|
+
* @description 单选属性api集合
|
|
124
|
+
* */
|
|
125
|
+
radio?: Partial<HyRadioProps>
|
|
126
|
+
/**
|
|
127
|
+
* @description 选择按钮属性api集合
|
|
128
|
+
* */
|
|
129
|
+
checkButton?: Partial<HyCheckButtonProps>
|
|
130
|
+
/**
|
|
131
|
+
* @description 日期展示的格式
|
|
132
|
+
* */
|
|
133
|
+
mode?: DateModeEnum
|
|
134
|
+
/**
|
|
135
|
+
* @description 规则校验
|
|
136
|
+
* */
|
|
137
|
+
rules?: RulesVo | RulesVo[]
|
|
142
138
|
}
|
|
143
139
|
|
|
144
140
|
export interface RulesVo {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
141
|
+
/**
|
|
142
|
+
* @description 是否必填
|
|
143
|
+
* */
|
|
144
|
+
required?: boolean
|
|
145
|
+
/**
|
|
146
|
+
* @description 校验不通过时的提示信息
|
|
147
|
+
* */
|
|
148
|
+
message?: string
|
|
149
|
+
/**
|
|
150
|
+
* @description 表单事件校验
|
|
151
|
+
* */
|
|
152
|
+
trigger?: ('blur' | 'change')[]
|
|
153
|
+
/**
|
|
154
|
+
* @description 最小值
|
|
155
|
+
* */
|
|
156
|
+
min?: number
|
|
157
|
+
/**
|
|
158
|
+
* @description 最大值
|
|
159
|
+
* */
|
|
160
|
+
max?: number
|
|
161
|
+
/**
|
|
162
|
+
* @description 基础正则校验
|
|
163
|
+
* phone - 手机号校验
|
|
164
|
+
* email - 邮箱校验
|
|
165
|
+
* password - 复杂密码校验
|
|
166
|
+
* */
|
|
167
|
+
type?: 'phone' | 'email' | 'password'
|
|
168
|
+
/**
|
|
169
|
+
* @description 自定义校验规则
|
|
170
|
+
* */
|
|
171
|
+
validator?: (rule: any, value: string, callback?: Function) => boolean
|
|
176
172
|
}
|