hy-app 0.5.2 → 0.5.4

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.
Files changed (74) hide show
  1. package/components/hy-action-sheet/index.scss +0 -5
  2. package/components/hy-avatar/hy-avatar.vue +4 -3
  3. package/components/hy-back-top/hy-back-top.vue +10 -9
  4. package/components/hy-back-top/props.ts +5 -3
  5. package/components/hy-badge/hy-badge.vue +5 -4
  6. package/components/hy-badge/index.scss +0 -1
  7. package/components/hy-badge/props.ts +11 -4
  8. package/components/hy-button/hy-button.vue +5 -5
  9. package/components/hy-button/index.scss +9 -0
  10. package/components/hy-button/props.ts +11 -6
  11. package/components/hy-coupon/hy-coupon.vue +159 -167
  12. package/components/hy-coupon/index.scss +135 -516
  13. package/components/hy-coupon/props.ts +101 -127
  14. package/components/hy-coupon/typing.d.ts +147 -146
  15. package/components/hy-datetime-picker/props.ts +1 -3
  16. package/components/hy-folding-panel/props.ts +1 -1
  17. package/components/hy-folding-panel/typing.d.ts +0 -38
  18. package/components/hy-folding-panel-item/hy-folding-panel-item.vue +2 -5
  19. package/components/hy-folding-panel-item/index.scss +0 -8
  20. package/components/hy-folding-panel-item/typing.d.ts +14 -0
  21. package/components/hy-form-group/hy-form-group.vue +308 -511
  22. package/components/hy-form-group/index.scss +0 -33
  23. package/components/hy-form-group/props.ts +103 -13
  24. package/components/hy-form-group/typing.d.ts +0 -77
  25. package/components/hy-form-item/hy-form-item.vue +3 -3
  26. package/components/hy-icon/hy-icon.vue +3 -8
  27. package/components/hy-input/hy-input.vue +16 -10
  28. package/components/hy-input/index.scss +4 -0
  29. package/components/hy-input/props.ts +2 -2
  30. package/components/hy-list/props.ts +1 -1
  31. package/components/hy-notice-bar/hy-column-notice.vue +63 -70
  32. package/components/hy-notice-bar/hy-row-notice.vue +92 -110
  33. package/components/hy-notice-bar/index.scss +2 -4
  34. package/components/hy-notice-bar/props.ts +4 -1
  35. package/components/hy-notice-bar/typing.d.ts +2 -0
  36. package/components/hy-popup/hy-popup.vue +0 -1
  37. package/components/hy-qrcode/hy-qrcode.vue +69 -3
  38. package/components/hy-qrcode/index.scss +3 -3
  39. package/components/hy-qrcode/qrcode.js +1344 -1400
  40. package/components/hy-rate/hy-rate.vue +0 -1
  41. package/components/hy-read-more/hy-read-more.vue +1 -1
  42. package/components/hy-signature/hy-signature.vue +25 -22
  43. package/components/hy-signature/index.scss +0 -4
  44. package/components/hy-tabbar/hy-tabbar.vue +137 -0
  45. package/components/{hy-tabBar → hy-tabbar}/index.scss +30 -30
  46. package/components/hy-tabbar/props.ts +59 -0
  47. package/components/hy-tabbar/typing.d.ts +61 -0
  48. package/components/hy-tabbar-group/README.md +326 -0
  49. package/components/hy-tabbar-group/hy-tabbar-group.vue +87 -0
  50. package/components/hy-tabbar-group/index.scss +57 -0
  51. package/components/hy-tabbar-group/props.ts +78 -0
  52. package/components/hy-tabbar-group/typing.ts +16 -0
  53. package/components/hy-tabbar-item/hy-tabbar-item.vue +103 -0
  54. package/components/hy-tabbar-item/index.scss +43 -0
  55. package/components/hy-tabbar-item/props.ts +24 -0
  56. package/components/hy-tabbar-item/typing.ts +22 -0
  57. package/components/hy-tag/props.ts +8 -2
  58. package/components/hy-text/props.ts +8 -2
  59. package/components/hy-textarea/hy-textarea.vue +1 -1
  60. package/components/hy-textarea/index.scss +8 -7
  61. package/components/hy-textarea/props.ts +4 -1
  62. package/components/hy-toast/index.scss +2 -7
  63. package/components/hy-tooltip/props.ts +1 -3
  64. package/components/hy-upload/props.ts +1 -1
  65. package/components/index.ts +177 -177
  66. package/global.d.ts +87 -85
  67. package/libs/css/common.scss +0 -5
  68. package/libs/typing/modules/form.ts +159 -163
  69. package/package.json +2 -2
  70. package/web-types.json +1 -1
  71. package/components/hy-coupon/README.md +0 -133
  72. package/components/hy-tabBar/hy-tabBar.vue +0 -109
  73. package/components/hy-tabBar/props.ts +0 -13
  74. package/components/hy-tabBar/typing.d.ts +0 -54
@@ -1,129 +1,103 @@
1
- import type { HyCouponProps } from "./typing";
2
- import type { CSSProperties, PropType } from "vue";
3
- import type { CouponStatus, CouponType } from "./typing";
1
+ import type { CSSProperties, PropType } from 'vue'
2
+ import type { HyButtonProps } from '../hy-button/typing'
4
3
 
5
- export const defaultProps = {
6
- amount: "",
7
- title: "",
8
- subTitle: "",
9
- type: "primary",
10
- status: "normal",
11
- minSpend: 0,
12
- validity: "",
13
- customStyle: {} as CSSProperties,
14
- customClass: "",
15
- tooltip: "",
16
- showActionButton: false,
17
- customButtonText: "",
18
- isExclusive: false,
19
- limitPerUser: 0,
20
- usedDate: "",
21
- expireDate: "",
22
- disabledReason: "",
23
- triggerReceiveOnClick: true
24
- };
4
+ const couponProps = {
5
+ /** 优惠券标题 */
6
+ title: {
7
+ type: String,
8
+ default: ''
9
+ },
10
+ /**
11
+ * 优惠券类型:moneyOff:满减券,discount:折扣券,fixedAmount:无门槛券
12
+ * @values moneyOff,discount,fixedAmount
13
+ * */
14
+ type: {
15
+ type: String,
16
+ default: ''
17
+ },
18
+ /** 金额底部优惠券类型文字描述 */
19
+ typeText: {
20
+ type: String,
21
+ default: ''
22
+ },
23
+ /** 优惠券状态 */
24
+ status: {
25
+ type: String,
26
+ default: ''
27
+ },
28
+ /** 优惠券禁用状态 */
29
+ disabledStatus: {
30
+ type: Array,
31
+ default: () => ['']
32
+ },
33
+ /** 优惠券描述备注 */
34
+ description: {
35
+ type: String,
36
+ default: ''
37
+ },
38
+ /** 优惠券金额 */
39
+ amount: {
40
+ type: [String, Number],
41
+ default: ''
42
+ },
43
+ /** 优惠券单位,没有就用默认值 */
44
+ unit: {
45
+ type: String,
46
+ default: ''
47
+ },
48
+ /** 优惠券开始时间 */
49
+ startDate: {
50
+ type: String,
51
+ default: ''
52
+ },
53
+ /** 优惠券结束时间 */
54
+ endDate: {
55
+ type: String,
56
+ default: ''
57
+ },
58
+ /** 时间格式 */
59
+ format: {
60
+ type: String,
61
+ default: 'yyyy-MM-dd'
62
+ },
63
+ /** 日期描述,没有日期描述就用开始时间到结束时间 */
64
+ dateDesc: {
65
+ type: String,
66
+ default: ''
67
+ },
68
+ /** 背景色 */
69
+ bgColor: {
70
+ type: String,
71
+ default: ''
72
+ },
73
+ /** 是否显示阴影 */
74
+ boxShadow: {
75
+ type: Boolean,
76
+ default: false
77
+ },
78
+ /**
79
+ * 按钮类型
80
+ * @values text,button,none
81
+ * */
82
+ btnMode: {
83
+ type: String,
84
+ default: 'button'
85
+ },
86
+ /** 按钮文字 */
87
+ btnText: {
88
+ type: String,
89
+ default: '立即领取'
90
+ },
91
+ buttonProp: {
92
+ type: Object as PropType<HyButtonProps>,
93
+ default: () => ({})
94
+ },
95
+ /** 定义需要用到的外部样式 */
96
+ customStyle: {
97
+ type: Object as PropType<CSSProperties>
98
+ },
99
+ /** 自定义外部类名 */
100
+ customClass: String
101
+ }
25
102
 
26
- export const props = {
27
- /** 优惠券金额 */
28
- amount: {
29
- type: [String, Number],
30
- required: true
31
- },
32
- /** 优惠券标题 */
33
- title: {
34
- type: String,
35
- required: true
36
- },
37
- /** 优惠券副标题 */
38
- subTitle: {
39
- type: String,
40
- default: defaultProps.subTitle
41
- },
42
- /**
43
- * 优惠券主题类型
44
- * @values primary,secondary,tertiary
45
- */
46
- type: {
47
- type: String as PropType<CouponType>,
48
- default: defaultProps.type,
49
- validator: (value: CouponType) => {
50
- return ["primary", "secondary", "tertiary"].includes(value);
51
- }
52
- },
53
- /**
54
- * 优惠券状态
55
- * @values normal,disabled,used,expired
56
- */
57
- status: {
58
- type: String as PropType<CouponStatus>,
59
- default: defaultProps.status,
60
- validator: (value: CouponStatus) => {
61
- return ["normal", "disabled", "used", "expired"].includes(value);
62
- }
63
- },
64
- /** 最小消费金额限制 */
65
- minSpend: {
66
- type: [String, Number],
67
- default: defaultProps.minSpend
68
- },
69
- /** 有效期文本 */
70
- validity: {
71
- type: String,
72
- default: defaultProps.validity
73
- },
74
- /** 自定义样式 */
75
- customStyle: {
76
- type: Object as PropType<CSSProperties>,
77
- default: () => defaultProps.customStyle
78
- },
79
- /** 自定义类名 */
80
- customClass: {
81
- type: String,
82
- default: defaultProps.customClass
83
- },
84
- /** 提示文本 */
85
- tooltip: {
86
- type: String,
87
- default: defaultProps.tooltip
88
- },
89
- /** 是否显示操作按钮 */
90
- showActionButton: {
91
- type: Boolean,
92
- default: defaultProps.showActionButton
93
- },
94
- /** 自定义按钮文本 */
95
- customButtonText: {
96
- type: String,
97
- default: defaultProps.customButtonText
98
- },
99
- /** 是否为专属优惠券 */
100
- isExclusive: {
101
- type: Boolean,
102
- default: defaultProps.isExclusive
103
- },
104
- /** 每用户限领数量 */
105
- limitPerUser: {
106
- type: Number,
107
- default: defaultProps.limitPerUser
108
- },
109
- /** 使用日期(已使用状态时显示) */
110
- usedDate: {
111
- type: String,
112
- default: defaultProps.usedDate
113
- },
114
- /** 过期日期(已过期状态时显示) */
115
- expireDate: {
116
- type: String,
117
- default: defaultProps.expireDate
118
- },
119
- /** 禁用原因(已禁用状态时显示) */
120
- disabledReason: {
121
- type: String,
122
- default: defaultProps.disabledReason
123
- },
124
- /** 点击时是否触发receive事件 */
125
- triggerReceiveOnClick: {
126
- type: Boolean,
127
- default: defaultProps.triggerReceiveOnClick
128
- }
129
- };
103
+ export default couponProps
@@ -1,146 +1,147 @@
1
- import type { CSSProperties } from "vue";
2
-
3
- export type CouponStatus = 'normal' | 'disabled' | 'used' | 'expired';
4
- export type CouponType = 'primary' | 'secondary' | 'tertiary';
5
-
6
- export interface HyCouponProps {
7
- /**
8
- * 优惠券金额
9
- * @type {string}
10
- */
11
- amount: string;
12
-
13
- /**
14
- * 优惠券主题类型
15
- * @type {'primary' | 'secondary' | 'tertiary'}
16
- * @default 'primary'
17
- * @values primary, secondary, tertiary
18
- */
19
- type?: CouponType;
20
-
21
- /**
22
- * 优惠券标题
23
- * @type {string}
24
- */
25
- title: string;
26
-
27
- /**
28
- * 优惠券副标题
29
- * @type {string}
30
- * @default ''
31
- */
32
- subTitle?: string;
33
-
34
- /**
35
- * 优惠券状态
36
- * @type {'normal' | 'disabled' | 'used' | 'expired'}
37
- * @default 'normal'
38
- * @values normal, disabled, used, expired
39
- */
40
- status?: CouponStatus;
41
-
42
- /**
43
- * 最小消费金额限制
44
- * @type {number}
45
- * @default 0
46
- */
47
- minSpend?: number;
48
-
49
- /**
50
- * 有效期
51
- * @type {string}
52
- * @default ''
53
- */
54
- validity?: string;
55
-
56
- /**
57
- * 是否显示左边界装饰
58
- * @type {boolean}
59
- * @default true
60
- */
61
- showLeftBorder?: boolean;
62
-
63
- /**
64
- * 是否显示右边界装饰
65
- * @type {boolean}
66
- * @default true
67
- */
68
- showRightBorder?: boolean;
69
-
70
- /**
71
- * 自定义样式
72
- * @type {CSSProperties}
73
- * @default {}
74
- */
75
- customStyle?: CSSProperties;
76
-
77
- /**
78
- * 自定义类名
79
- * @type {string}
80
- * @default ''
81
- */
82
- customClass?: string;
83
-
84
- /**
85
- * 提示文本
86
- * @type {string}
87
- * @default ''
88
- */
89
- tooltip?: string;
90
-
91
- /**
92
- * 是否显示操作按钮
93
- * @type {boolean}
94
- * @default false
95
- */
96
- showActionButton?: boolean;
97
-
98
- /**
99
- * 自定义按钮文本
100
- * @type {string}
101
- * @default ''
102
- */
103
- customButtonText?: string;
104
-
105
- /**
106
- * 是否为专属优惠券
107
- * @type {boolean}
108
- * @default false
109
- */
110
- isExclusive?: boolean;
111
-
112
- /**
113
- * 每用户限领数量
114
- * @type {number}
115
- * @default 0
116
- */
117
- limitPerUser?: number;
118
-
119
- /**
120
- * 使用日期(已使用状态时显示)
121
- * @type {string}
122
- * @default ''
123
- */
124
- usedDate?: string;
125
-
126
- /**
127
- * 过期日期(已过期状态时显示)
128
- * @type {string}
129
- * @default ''
130
- */
131
- expireDate?: string;
132
-
133
- /**
134
- * 禁用原因(已禁用状态时显示)
135
- * @type {string}
136
- * @default ''
137
- */
138
- disabledReason?: string;
139
-
140
- /**
141
- * 点击时是否触发receive事件
142
- * @type {boolean}
143
- * @default true
144
- */
145
- triggerReceiveOnClick?: boolean;
146
- }
1
+ import type { CSSProperties } from 'vue'
2
+
3
+ export type CouponStatus = 'unused' | 'used' | 'expired' | 'redeemed'
4
+ /**
5
+ * moneyOff:满减券,discount:折扣券,fixedAmount:无门槛券
6
+ * */
7
+ export type CouponType = 'moneyOff' | 'discount' | 'fixedAmount'
8
+
9
+ export interface HyCouponProps {
10
+ /**
11
+ * 优惠券金额
12
+ * @type {string}
13
+ */
14
+ amount: string
15
+
16
+ /**
17
+ * 优惠券标题
18
+ * @type {string}
19
+ */
20
+ title: string
21
+
22
+ /**
23
+ * 优惠券副标题
24
+ * @type {string}
25
+ * @default ''
26
+ */
27
+ subTitle?: string
28
+
29
+ /**
30
+ * 优惠券状态
31
+ * @type {'normal' | 'disabled' | 'used' | 'expired'}
32
+ * @default 'normal'
33
+ */
34
+ status?: CouponStatus
35
+
36
+ /**
37
+ * 最小消费金额限制
38
+ * @type {number}
39
+ * @default 0
40
+ */
41
+ minSpend?: number
42
+
43
+ /**
44
+ * 有效期
45
+ * @type {string}
46
+ * @default ''
47
+ */
48
+ validity?: string
49
+
50
+ /**
51
+ * 是否显示左边界装饰
52
+ * @type {boolean}
53
+ * @default true
54
+ */
55
+ showLeftBorder?: boolean
56
+
57
+ /**
58
+ * 是否显示右边界装饰
59
+ * @type {boolean}
60
+ * @default true
61
+ */
62
+ showRightBorder?: boolean
63
+
64
+ /**
65
+ * 自定义样式
66
+ * @type {CSSProperties}
67
+ * @default {}
68
+ */
69
+ customStyle?: CSSProperties
70
+
71
+ /**
72
+ * 自定义类名
73
+ * @type {string}
74
+ * @default ''
75
+ */
76
+ customClass?: string
77
+
78
+ /**
79
+ * 提示文本
80
+ * @type {string}
81
+ * @default ''
82
+ */
83
+ tooltip?: string
84
+
85
+ /**
86
+ * 是否显示操作按钮
87
+ * @type {boolean}
88
+ * @default false
89
+ */
90
+ showActionButton?: boolean
91
+
92
+ /**
93
+ * 自定义按钮文本
94
+ * @type {string}
95
+ * @default ''
96
+ */
97
+ customButtonText?: string
98
+
99
+ /**
100
+ * 是否为专属优惠券
101
+ * @type {boolean}
102
+ * @default false
103
+ */
104
+ isExclusive?: boolean
105
+
106
+ /**
107
+ * 每用户限领数量
108
+ * @type {number}
109
+ * @default 0
110
+ */
111
+ limitPerUser?: number
112
+
113
+ /**
114
+ * 使用日期(已使用状态时显示)
115
+ * @type {string}
116
+ * @default ''
117
+ */
118
+ usedDate?: string
119
+
120
+ /**
121
+ * 过期日期(已过期状态时显示)
122
+ * @type {string}
123
+ * @default ''
124
+ */
125
+ expireDate?: string
126
+
127
+ /**
128
+ * 禁用原因(已禁用状态时显示)
129
+ * @type {string}
130
+ * @default ''
131
+ */
132
+ disabledReason?: string
133
+
134
+ /**
135
+ * 点击时是否触发receive事件
136
+ * @type {boolean}
137
+ * @default true
138
+ */
139
+ triggerReceiveOnClick?: boolean
140
+ }
141
+
142
+ export interface ICouponEmits {
143
+ /** 点击优惠券 */
144
+ (e: 'click'): void
145
+ /** 点击使用优惠券 */
146
+ (e: 'used'): void
147
+ }
@@ -113,9 +113,7 @@ const datetimePickerProps = {
113
113
  /** 各列的默认索引 */
114
114
  defaultIndex: {
115
115
  type: Array,
116
- default() {
117
- return []
118
- }
116
+ default: () => []
119
117
  },
120
118
  /** 输入框是否显示边框 */
121
119
  hasInput: {
@@ -37,6 +37,6 @@ const foldingPanelProps = {
37
37
  type: String as PropType<HyApp.SizeType>,
38
38
  default: 'medium'
39
39
  }
40
- }
40
+ } as const
41
41
 
42
42
  export default foldingPanelProps
@@ -1,41 +1,3 @@
1
- import type { Ref, ToRefs } from 'vue'
2
-
3
- // 折叠面板组组件的Props接口
4
- export interface HyFoldingPanelGroupProps {
5
- /**
6
- * 当前激活的面板索引,支持v-model
7
- */
8
- modelValue?: number
9
- /**
10
- * 是否手风琴模式,默认false
11
- */
12
- accordion?: boolean
13
- /**
14
- * 是否禁用整个折叠面板组
15
- */
16
- disabled?: boolean
17
- /**
18
- * 是否显示边框,默认true
19
- */
20
- border?: boolean
21
- /**
22
- * 面板大小 large, medium, small
23
- */
24
- size?: HyApp.SizeType
25
- }
26
-
27
- // 父组件提供给子组件的配置接口
28
- export interface HyFoldingPanelGroupConfig extends ToRefs<HyFoldingPanelGroupProps> {
29
- /**
30
- * 当前激活的索引
31
- */
32
- activeIndex: Ref<number | string>
33
- /**
34
- * 更新激活索引的方法
35
- */
36
- updateActiveIndex: (index: number | string) => void
37
- }
38
-
39
1
  // 折叠面板组组件的事件接口
40
2
  export interface IFoldingPanelGroupEmits {
41
3
  /**
@@ -67,8 +67,7 @@ export default {
67
67
 
68
68
  <script setup lang="ts">
69
69
  import { ref, computed, inject, onMounted } from 'vue'
70
- import type { HyFoldingPanelItemEmits } from './typing'
71
- import type { HyFoldingPanelGroupConfig } from '../hy-folding-panel/typing'
70
+ import type { IFoldingPanelConfig, IFoldingPanelItemEmits } from './typing'
72
71
  import { addUnit, IconConfig } from '../../libs'
73
72
  import foldingPanelItemProps from './props'
74
73
  // 组件
@@ -86,7 +85,7 @@ const props = defineProps(foldingPanelItemProps)
86
85
  const emit = defineEmits<IFoldingPanelItemEmits>()
87
86
 
88
87
  // 尝试从父组件注入配置
89
- const groupConfig = inject<HyFoldingPanelGroupConfig>('hy-folding-panel')
88
+ const groupConfig = inject<IFoldingPanelConfig>('hy-folding-panel')
90
89
 
91
90
  // 内部展开状态
92
91
  const expanded = ref(props.defaultOpen)
@@ -94,7 +93,6 @@ const expanded = ref(props.defaultOpen)
94
93
  // 计算当前是否展开
95
94
  const isExpanded = computed(() => {
96
95
  if (groupConfig?.accordion?.value) {
97
- console.log(groupConfig.activeIndex.value, props.index)
98
96
  // 如果在group中,根据group的activeIndex判断
99
97
  return groupConfig.activeIndex.value === props.index
100
98
  }
@@ -105,7 +103,6 @@ const isExpanded = computed(() => {
105
103
  // 处理点击事件
106
104
  const handleClick = () => {
107
105
  if (props.disabled) return
108
- console.log(groupConfig?.accordion?.value)
109
106
 
110
107
  if (groupConfig?.accordion?.value) {
111
108
  // 在group中时,通知group更新激活索引
@@ -10,16 +10,8 @@
10
10
  pointer-events: none;
11
11
  }
12
12
 
13
- @include is(active) {
14
- background-color: $hy-background--active;
15
- }
16
-
17
13
  @include m(border) {
18
14
  border-bottom: $hy-border-line;
19
-
20
- &:last-child {
21
- border-bottom: none;
22
- }
23
15
  }
24
16
 
25
17
  @include m(large) {
@@ -1,3 +1,17 @@
1
+ import foldingPanelProps from '../hy-folding-panel/props'
2
+ import type { ExtractPropTypes, ToRefs } from 'vue'
3
+
4
+ export interface IFoldingPanelConfig extends ToRefs<ExtractPropTypes<typeof foldingPanelProps>> {
5
+ /**
6
+ * 当前激活的索引
7
+ */
8
+ activeIndex: Ref<number | string>
9
+ /**
10
+ * 更新激活索引的方法
11
+ */
12
+ updateActiveIndex: (index: number | string) => void
13
+ }
14
+
1
15
  // 折叠面板项组件的事件接口
2
16
  export interface IFoldingPanelItemEmits {
3
17
  /**