hy-app 0.2.1 → 0.2.2

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 (50) hide show
  1. package/components/hy-button/index.scss +4 -0
  2. package/components/hy-code-input/hy-code-input.vue +223 -0
  3. package/components/hy-code-input/index.scss +108 -0
  4. package/components/hy-code-input/props.ts +21 -0
  5. package/components/hy-code-input/typing.d.ts +65 -0
  6. package/components/hy-config-provider/hy-config-provider.vue +0 -1
  7. package/components/hy-dropdown/props.ts +1 -1
  8. package/components/hy-dropdown-item/hy-dropdown-item.vue +2 -5
  9. package/components/hy-dropdown-item/index.scss +11 -13
  10. package/components/hy-grid/hy-grid.vue +5 -5
  11. package/components/hy-icon/index.scss +1 -0
  12. package/components/hy-modal/hy-modal.vue +5 -5
  13. package/components/hy-modal/index.scss +0 -6
  14. package/components/hy-notify/hy-notify.vue +169 -0
  15. package/components/hy-notify/index.scss +25 -0
  16. package/components/hy-notify/props.ts +14 -0
  17. package/components/hy-notify/typing.d.ts +44 -0
  18. package/components/hy-pagination/hy-pagination.vue +125 -0
  19. package/components/hy-pagination/index.scss +46 -0
  20. package/components/hy-pagination/props.ts +15 -0
  21. package/components/hy-pagination/typing.d.ts +44 -0
  22. package/components/hy-picker/index.scss +4 -0
  23. package/components/hy-scroll-list/index.scss +1 -1
  24. package/components/hy-search/index.scss +1 -2
  25. package/components/hy-signature/canvasHelper.ts +51 -0
  26. package/components/hy-signature/hy-signature.vue +656 -0
  27. package/components/hy-signature/index.scss +31 -0
  28. package/components/hy-signature/props.ts +28 -0
  29. package/components/hy-signature/typing.d.ts +177 -0
  30. package/components/hy-slider/index.scss +5 -1
  31. package/components/hy-swipe-action/hy-swipe-action.vue +288 -248
  32. package/components/hy-swipe-action/index.scss +34 -0
  33. package/components/hy-swipe-action/index.ts +34 -0
  34. package/components/hy-swipe-action/props.ts +15 -9
  35. package/components/hy-swipe-action/typing.d.ts +20 -22
  36. package/components/hy-swiper/index.scss +5 -0
  37. package/components/hy-tabs/index.scss +2 -2
  38. package/components/hy-tag/index.scss +1 -1
  39. package/components/hy-textarea/hy-textarea.vue +5 -5
  40. package/components/hy-textarea/index.scss +5 -6
  41. package/components/hy-tooltip/index.scss +2 -2
  42. package/components/hy-upload/index.scss +1 -1
  43. package/composables/index.ts +1 -0
  44. package/composables/useTouch.ts +48 -0
  45. package/libs/css/mixin.scss +52 -13
  46. package/libs/css/vars.css +7 -1
  47. package/package.json +2 -2
  48. package/theme.scss +23 -46
  49. package/components/hy-swipe-action/index.wxs +0 -235
  50. package/components/hy-swipe-action/wxs.js +0 -15
@@ -0,0 +1,177 @@
1
+ import type { CSSProperties } from "vue";
2
+
3
+ export default interface HySignatureProps {
4
+ /**
5
+ * @description 签名笔颜色
6
+ * */
7
+ penColor?: string;
8
+ /**
9
+ * @description 签名笔宽度(默认 1 )
10
+ * */
11
+ lineWidth?: number;
12
+ /**
13
+ * @description 清空按钮的文本
14
+ * */
15
+ clearText?: string;
16
+ /**
17
+ * @description 撤回按钮的文本
18
+ * */
19
+ revokeText?: string;
20
+ /**
21
+ * @description 恢复按钮的文本
22
+ * */
23
+ restoreText?: string;
24
+ /**
25
+ * @description 确认按钮的文本
26
+ * */
27
+ confirmText?: string;
28
+ /**
29
+ * @description 目标文件的类型(默认 png )
30
+ * */
31
+ fileType?: string;
32
+ /**
33
+ * @description 签名笔颜色
34
+ * */
35
+ quality?: number;
36
+ /**
37
+ * @description 目标文件的质量(默认 1 )
38
+ * */
39
+ exportScale?: number;
40
+ /**
41
+ * @description 是否禁用签名板(默认 false )
42
+ * */
43
+ disabled?: boolean;
44
+ /**
45
+ * @description 画布的高度
46
+ * */
47
+ height?: number;
48
+ /**
49
+ * @description 画布的宽度
50
+ * */
51
+ width?: number;
52
+ /**
53
+ * @description 画板的背景色
54
+ * */
55
+ backgroundColor?: string;
56
+ /**
57
+ * @description 是否禁用画布滚动(默认 true )
58
+ * */
59
+ disableScroll?: boolean;
60
+ /**
61
+ * @description 是否开启历史记录(默认 false )
62
+ * */
63
+ enableHistory?: boolean;
64
+ /**
65
+ * @description 撤回和恢复的步长(默认 1 )
66
+ * */
67
+ step?: number;
68
+ /**
69
+ * @description 撤回按钮的文本(默认 撤销 )
70
+ * */
71
+ undoText?: string;
72
+ /**
73
+ * @description 恢复按钮的文本(默认 恢复 )
74
+ * */
75
+ redoText?: string;
76
+ /**
77
+ * @description 是否启用压感模式(默认 false )
78
+ * */
79
+ pressure?: boolean;
80
+ /**
81
+ * @description 压感模式下笔画最小宽度(默认 2 )
82
+ * */
83
+ minWidth?: number;
84
+ /**
85
+ * @description 压感模式下笔画最大宽度(默认 6 )
86
+ * */
87
+ maxWidth?: number;
88
+ /**
89
+ * @description 最小速度阈值,影响压感模式下的笔画宽度变化(默认 1.5 )
90
+ * */
91
+ minSpeed?: number;
92
+ /**
93
+ * @description 定义需要用到的外部样式
94
+ * */
95
+ customStyle?: CSSProperties;
96
+ }
97
+
98
+ /**
99
+ * 签名结果类型
100
+ * @property tempFilePath - 生成图片的临时路径
101
+ * @property success - 是否成功生成图片
102
+ * @property width - 生成图片的宽度
103
+ * @property height - 生成图片的高度
104
+ */
105
+ export type SignatureResult = {
106
+ tempFilePath: string;
107
+ success: boolean;
108
+ width: number;
109
+ height: number;
110
+ };
111
+
112
+ /**
113
+ * 签名线条类型
114
+ * @property points - 线条所包含的所有点的数组
115
+ * @property color - 线条颜色
116
+ * @property width - 线条宽度
117
+ * @property backgroundColor - 线条背景色 (可选)
118
+ * @property isPressure - 是否为笔锋模式的线条 (可选)
119
+ */
120
+ export interface Line {
121
+ points: Point[];
122
+ color: string;
123
+ width: number;
124
+ backgroundColor?: string;
125
+ isPressure?: boolean;
126
+ }
127
+
128
+ /**
129
+ * 签名点位类型
130
+ * @property x - 点的横坐标
131
+ * @property y - 点的纵坐标
132
+ * @property t - 点的时间戳
133
+ * @property speed - 当前点的绘制速度 (可选)
134
+ * @property distance - 与上一个点的距离 (可选)
135
+ * @property lineWidth - 当前点的线宽 (可选,用于笔锋模式)
136
+ * @property lastX1 - 贝塞尔曲线第一个控制点的x坐标 (可选)
137
+ * @property lastY1 - 贝塞尔曲线第一个控制点的y坐标 (可选)
138
+ * @property lastX2 - 贝塞尔曲线第二个控制点的x坐标 (可选)
139
+ * @property lastY2 - 贝塞尔曲线第二个控制点的y坐标 (可选)
140
+ * @property isFirstPoint - 是否为线条的第一个点 (可选)
141
+ */
142
+ export interface Point {
143
+ x: number;
144
+ y: number;
145
+ t: number;
146
+ speed?: number;
147
+ distance?: number;
148
+ lineWidth?: number;
149
+ lastX1?: number;
150
+ lastY1?: number;
151
+ lastX2?: number;
152
+ lastY2?: number;
153
+ isFirstPoint?: boolean;
154
+ }
155
+
156
+ /**
157
+ * 签名组件暴露的方法类型
158
+ * @property init - 初始化签名板
159
+ * @property clear - 清除签名
160
+ * @property confirm - 确认签名并生成图片
161
+ * @property restore - 恢复上一步操作
162
+ * @property revoke - 撤销上一步操作
163
+ */
164
+ export type SignatureExpose = {
165
+ /** 初始化签名板
166
+ * @param forceUpdate - 是否强制更新
167
+ */
168
+ init: (forceUpdate?: boolean) => void;
169
+ /** 点击清除按钮清除签名 */
170
+ clear: () => void;
171
+ /** 点击确定按钮 */
172
+ confirm: () => void;
173
+ /* 点击恢复 */
174
+ restore: () => void;
175
+ /* 点击撤回 */
176
+ revoke: () => void;
177
+ };
@@ -33,7 +33,8 @@
33
33
  }
34
34
 
35
35
  &__base {
36
- background-color: #ebedf0;
36
+ background-color: $hy-background--empty;
37
+ border-radius: $hy-border-radius-semicircle;
37
38
  }
38
39
 
39
40
  /* #ifndef APP-NVUE */
@@ -53,6 +54,9 @@
53
54
  border-radius: $hy-border-radius-semicircle;
54
55
  transition: width 0.2s;
55
56
  background-color: $hy-primary;
57
+ &-0 {
58
+ background-color: $hy-background--empty;
59
+ }
56
60
  }
57
61
 
58
62
  &__button {