hy-app 0.6.8 → 0.7.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.
Files changed (109) hide show
  1. package/attributes.json +1 -1
  2. package/components/hy-action-sheet/index.scss +2 -2
  3. package/components/hy-avatar/hy-avatar.vue +12 -5
  4. package/components/hy-avatar/index.scss +2 -2
  5. package/components/hy-avatar/props.ts +4 -2
  6. package/components/hy-avatar/typing.d.ts +8 -1
  7. package/components/hy-calendar/hy-calendar.vue +1 -0
  8. package/components/hy-calendar/month.vue +25 -5
  9. package/components/hy-calendar/props.ts +1 -1
  10. package/components/hy-cascader/hy-cascader.vue +503 -0
  11. package/components/hy-cascader/index.scss +84 -0
  12. package/components/hy-cascader/props.ts +88 -0
  13. package/components/hy-cascader/typing.d.ts +34 -0
  14. package/components/hy-cell-item/index.scss +8 -9
  15. package/components/hy-check-button/typing.d.ts +12 -7
  16. package/components/hy-code-input/hy-code-input.vue +33 -11
  17. package/components/hy-code-input/index.scss +2 -2
  18. package/components/hy-code-input/typing.d.ts +4 -0
  19. package/components/hy-config-provider/hy-config-provider.vue +58 -53
  20. package/components/hy-config-provider/props.ts +1 -1
  21. package/components/hy-datetime-picker/props.ts +1 -1
  22. package/components/hy-datetime-picker/typing.d.ts +1 -1
  23. package/components/hy-dropdown/typing.d.ts +5 -0
  24. package/components/hy-float-button/index.scss +1 -1
  25. package/components/hy-form/typing.d.ts +6 -0
  26. package/components/hy-form-item/typing.d.ts +1 -1
  27. package/components/hy-grid/hy-grid.vue +12 -12
  28. package/components/hy-grid/index.scss +1 -2
  29. package/components/hy-grid/props.ts +7 -2
  30. package/components/hy-grid/typing.d.ts +1 -1
  31. package/components/hy-icon/typing.d.ts +52 -9
  32. package/components/hy-index-bar/index.scss +1 -1
  33. package/components/hy-keyboard/constants.ts +83 -0
  34. package/components/hy-keyboard/hy-keyboard.vue +375 -0
  35. package/components/hy-keyboard/index.scss +73 -0
  36. package/components/hy-keyboard/key/index.scss +79 -0
  37. package/components/hy-keyboard/key/index.vue +91 -0
  38. package/components/hy-keyboard/key/types.ts +1 -0
  39. package/components/hy-keyboard/props.ts +108 -0
  40. package/components/hy-keyboard/typing.d.ts +18 -0
  41. package/components/hy-line-progress/index.scss +3 -3
  42. package/components/hy-menu/index.scss +1 -1
  43. package/components/hy-modal/index.scss +2 -2
  44. package/components/hy-modal/typing.d.ts +2 -2
  45. package/components/hy-notice-bar/hy-column-notice.vue +54 -94
  46. package/components/hy-notice-bar/hy-notice-bar.vue +128 -96
  47. package/components/hy-notice-bar/hy-row-notice.vue +89 -121
  48. package/components/hy-notice-bar/index.scss +1 -1
  49. package/components/hy-notice-bar/props.ts +86 -85
  50. package/components/hy-notify/hy-notify.vue +9 -9
  51. package/components/hy-notify/typing.d.ts +22 -0
  52. package/components/hy-picker/hy-picker.vue +126 -149
  53. package/components/hy-picker/props.ts +4 -1
  54. package/components/hy-picker/typing.d.ts +22 -0
  55. package/components/hy-popover/index.scss +6 -6
  56. package/components/hy-popup/index.scss +6 -5
  57. package/components/hy-price/hy-price.vue +52 -23
  58. package/components/hy-price/props.ts +54 -54
  59. package/components/hy-radio/props.ts +1 -1
  60. package/components/hy-radio/typing.d.ts +5 -1
  61. package/components/hy-rolling-num/typing.d.ts +1 -0
  62. package/components/hy-scroll-list/index.scss +2 -2
  63. package/components/hy-search/index.scss +1 -1
  64. package/components/hy-signature/index.scss +1 -1
  65. package/components/hy-skeleton/index.scss +21 -4
  66. package/components/hy-slider/index.scss +3 -3
  67. package/components/hy-steps/hy-steps.vue +1 -1
  68. package/components/hy-steps/index.scss +3 -3
  69. package/components/hy-submit-bar/typing.d.ts +3 -3
  70. package/components/hy-subsection/index.scss +8 -8
  71. package/components/hy-swipe-action/hy-swipe-action.vue +34 -15
  72. package/components/hy-swipe-action/index.scss +0 -1
  73. package/components/hy-swiper/index.scss +2 -2
  74. package/components/hy-switch/index.scss +3 -3
  75. package/components/hy-switch/typing.d.ts +4 -0
  76. package/components/hy-tabbar/props.ts +2 -1
  77. package/components/hy-tabbar/typing.d.ts +5 -4
  78. package/components/hy-tabbar-group/index.scss +2 -2
  79. package/components/hy-tabs/hy-tabs.vue +338 -336
  80. package/components/hy-tabs/index.scss +7 -7
  81. package/components/hy-tabs/typing.d.ts +41 -33
  82. package/components/hy-tag/index.scss +1 -1
  83. package/components/hy-textarea/hy-textarea.vue +2 -2
  84. package/components/hy-textarea/index.scss +4 -4
  85. package/components/hy-textarea/typing.d.ts +4 -0
  86. package/components/hy-toast/hy-toast.vue +14 -6
  87. package/components/hy-toast/index.scss +1 -1
  88. package/components/hy-toast/typing.d.ts +42 -36
  89. package/components/hy-tooltip/hy-tooltip.vue +1 -1
  90. package/components/hy-tooltip/index.scss +7 -6
  91. package/components/hy-tooltip/props.ts +1 -1
  92. package/components/hy-upload/hy-upload.vue +16 -1
  93. package/components/hy-upload/index.scss +149 -144
  94. package/components/hy-warn/index.scss +1 -1
  95. package/components/index.ts +6 -0
  96. package/global.d.ts +2 -0
  97. package/libs/config/icon.ts +442 -430
  98. package/libs/css/_function.scss +7 -13
  99. package/libs/css/_mixin.scss +3 -3
  100. package/libs/css/common.scss +1 -1
  101. package/libs/css/iconfont.css +445 -441
  102. package/libs/css/theme.scss +54 -25
  103. package/libs/locale/lang/en-US.ts +4 -0
  104. package/libs/locale/lang/zh-CN.ts +4 -0
  105. package/libs/typing/index.ts +80 -0
  106. package/package.json +5 -2
  107. package/tags.json +1 -1
  108. package/web-types.json +1 -1
  109. package/components/hy-qrcode/qrcode.js.bak +0 -1434
@@ -1,9 +1,52 @@
1
- import type { ExtractPropTypes } from 'vue'
2
- import iconProps from './props'
3
-
4
- export interface HyIconProps extends ExtractPropTypes<typeof iconProps> {}
5
-
6
- export interface IIconEmits {
7
- /** 点击图标触发 */
8
- (e: 'click', index: string, e: Event): void
9
- }
1
+ import type { CSSProperties } from 'vue'
2
+
3
+ export interface HyIconProps {
4
+ /** 图标名称 */
5
+ name?: string
6
+ /** 图标颜色 */
7
+ color?: string
8
+ /** 图标字体大小,单位px */
9
+ size?: number | string
10
+ /** 是否显示粗体 */
11
+ bold?: boolean
12
+ /** 点击图标的时候传递事件出去的index(用于区分点击了哪一个) */
13
+ index?: string
14
+ /** 自定义扩展前缀,方便用户扩展自己的图标库 */
15
+ customPrefix?: string
16
+ /** 图标右侧的label文字 */
17
+ label?: string
18
+ /**
19
+ * label相对于图标的位置,只能right或bottom
20
+ * @values right,bottom
21
+ * */
22
+ labelPos?: string
23
+ /** label字体大小,单位px */
24
+ labelSize?: string
25
+ /** 图标右侧的label文字颜色 */
26
+ labelColor?: string
27
+ /** label与图标的距离,单位px */
28
+ space?: number | string
29
+ /** 图片的mode */
30
+ imgMode?: string
31
+ /** 显示图片小图标时的宽度 */
32
+ width?: string | number
33
+ /** 显示图片小图标时的高度 */
34
+ height?: string | number
35
+ /** 图标在垂直方向上的定位 用于解决某些情况下,让图标垂直居中的用途 */
36
+ top?: string | number
37
+ /** 是否阻止事件传播 */
38
+ stop?: boolean
39
+ /** 是否旋转 */
40
+ isRotate?: boolean
41
+ /** 图标圆角 */
42
+ round?: string | number
43
+ /** 定义需要用到的外部样式 */
44
+ customStyle?: CSSProperties
45
+ /** 自定义外部类名 */
46
+ customClass?: string
47
+ }
48
+
49
+ export interface IIconEmits {
50
+ /** 点击图标触发 */
51
+ (e: 'click', index: string, e: Event): void
52
+ }
@@ -34,7 +34,7 @@
34
34
  justify-content: center;
35
35
  color: $hy-text-color--3;
36
36
  margin: 2rpx 0;
37
- border-radius: $hy-border-radius-sm;
37
+ border-radius: $hy-radius-sm;
38
38
 
39
39
  @include is(active) {
40
40
  position: relative;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * 车牌号键盘-省份简称
3
+ */
4
+ export const CAR_KEYBOARD_AREAS = [
5
+ '京',
6
+ '沪',
7
+ '粤',
8
+ '津',
9
+ '冀',
10
+ '豫',
11
+ '云',
12
+ '辽',
13
+ '黑',
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
+ * 车牌号键盘-数字和字母(不包含I和O,因为车牌号规则中不使用这两个字母)
45
+ */
46
+ export const CAR_KEYBOARD_KEYS = [
47
+ 1,
48
+ 2,
49
+ 3,
50
+ 4,
51
+ 5,
52
+ 6,
53
+ 7,
54
+ 8,
55
+ 9,
56
+ 0,
57
+ 'Q',
58
+ 'W',
59
+ 'E',
60
+ 'R',
61
+ 'T',
62
+ 'Y',
63
+ 'U',
64
+ 'I',
65
+ 'O',
66
+ 'P',
67
+ 'A',
68
+ 'S',
69
+ 'D',
70
+ 'F',
71
+ 'G',
72
+ 'H',
73
+ 'J',
74
+ 'K',
75
+ 'L',
76
+ 'Z',
77
+ 'X',
78
+ 'C',
79
+ 'V',
80
+ 'B',
81
+ 'N',
82
+ 'M'
83
+ ]
@@ -0,0 +1,375 @@
1
+ <template>
2
+ <!-- 虚拟键盘主组件 -->
3
+ <hy-popup
4
+ v-model:show="show"
5
+ position="bottom"
6
+ :z-index="zIndex"
7
+ :safe-area-inset-bottom="safeAreaInsetBottom"
8
+ :overlay="overlay"
9
+ :overlayOpacity="overlayOpacity"
10
+ :close-on-click-modal="hideOnClickOutside"
11
+ :lock-scroll="lockScroll"
12
+ @close="handleClose"
13
+ >
14
+ <view :class="`hy-keyboard ${customClass}`" :style="customStyle">
15
+ <!-- 头部区域(标题 + 关闭按钮) -->
16
+ <view class="hy-keyboard__header" v-if="showHeader">
17
+ <!-- 标题插槽 -->
18
+ <slot name="title" v-if="showTitle">
19
+ <text class="hy-keyboard__title">{{ title }}</text>
20
+ </slot>
21
+ <!-- 关闭按钮 -->
22
+ <view
23
+ class="hy-keyboard__close"
24
+ hover-class="hy-keyboard__close--hover"
25
+ v-if="showClose"
26
+ @click="handleClose"
27
+ >
28
+ <text>{{ closeText }}</text>
29
+ </view>
30
+ </view>
31
+
32
+ <!-- 非车牌号键盘布局 -->
33
+ <template v-if="mode !== 'car'">
34
+ <view class="hy-keyboard__body">
35
+ <!-- 主按键区域 -->
36
+ <view class="hy-keyboard__keys">
37
+ <hy-keyboard-key
38
+ v-for="(key, index) in keys"
39
+ :key="index"
40
+ :text="key.text"
41
+ :type="key.type"
42
+ :wider="key.wider"
43
+ @press="handlePress"
44
+ ></hy-keyboard-key>
45
+ </view>
46
+ <!-- 侧边栏(仅custom模式显示) -->
47
+ <view class="hy-keyboard__sidebar" v-if="mode === 'custom'">
48
+ <hy-keyboard-key
49
+ v-if="showDeleteKey"
50
+ large
51
+ :text="deleteText"
52
+ type="delete"
53
+ @press="handlePress"
54
+ ></hy-keyboard-key>
55
+ <hy-keyboard-key
56
+ large
57
+ :text="closeText"
58
+ type="close"
59
+ :loading="closeButtonLoading"
60
+ @press="handlePress"
61
+ ></hy-keyboard-key>
62
+ </view>
63
+ </view>
64
+ </template>
65
+
66
+ <!-- 车牌号键盘布局 -->
67
+ <template v-if="mode === 'car'">
68
+ <view class="hy-keyboard__body">
69
+ <view class="hy-keyboard__car-keys">
70
+ <hy-keyboard-key
71
+ v-for="(key, index) in keys"
72
+ :key="index"
73
+ :text="key.text"
74
+ :type="key.type"
75
+ :wider="key.wider"
76
+ is-car
77
+ @press="handlePress"
78
+ ></hy-keyboard-key>
79
+ </view>
80
+ </view>
81
+ </template>
82
+ </view>
83
+ </hy-popup>
84
+ </template>
85
+
86
+ <script lang="ts">
87
+ /**
88
+ * 虚拟键盘组件
89
+ * 支持多种键盘模式:数字键盘、自定义键盘、车牌号键盘、身份证键盘
90
+ */
91
+ export default {
92
+ name: 'hy-keyboard',
93
+ options: {
94
+ virtualHost: true,
95
+ addGlobalClass: true,
96
+ styleIsolation: 'shared'
97
+ }
98
+ }
99
+ </script>
100
+
101
+ <script lang="ts" setup>
102
+ import { computed, ref, watch, useSlots } from 'vue'
103
+ import type { KeyboardMode, CarKeyboardLang, Key, IKeyboardEmits } from './typing'
104
+ import type { NumberKeyType } from './key/types'
105
+ import { CAR_KEYBOARD_AREAS, CAR_KEYBOARD_KEYS } from './constants'
106
+ import { keyboardProps } from './props'
107
+ import HyKeyboardKey from './key/index.vue'
108
+
109
+ const props = defineProps(keyboardProps)
110
+ const emit = defineEmits<IKeyboardEmits>()
111
+ const slots = useSlots()
112
+
113
+ const show = ref(props.show)
114
+
115
+ watch(
116
+ () => props.show,
117
+ (newValue) => {
118
+ show.value = newValue
119
+ }
120
+ )
121
+
122
+ const carLang = ref<CarKeyboardLang>('zh')
123
+
124
+ /**
125
+ * 车牌号键盘语言(支持受控/非受控两种模式)
126
+ */
127
+ const carKeyboardLang = computed({
128
+ get: () => (props.carLang ? props.carLang : carLang.value),
129
+ set: (value: CarKeyboardLang) => {
130
+ carLang.value = value
131
+ }
132
+ })
133
+
134
+ /**
135
+ * 当前键盘按键列表(根据模式动态生成)
136
+ */
137
+ const keys = computed(() => {
138
+ switch (props.mode) {
139
+ case 'car':
140
+ return genCarKeys()
141
+ case 'idcard':
142
+ return genIdCardKeys()
143
+ case 'custom':
144
+ return genCustomKeys()
145
+ default:
146
+ return genDefaultKeys()
147
+ }
148
+ })
149
+
150
+ /**
151
+ * 是否显示关闭按钮
152
+ */
153
+ const showClose = computed(() => {
154
+ return props.closeText && (props.mode === 'default' || props.mode === 'car')
155
+ })
156
+
157
+ /**
158
+ * 是否显示标题
159
+ */
160
+ const showTitle = computed(() => {
161
+ return !!props.title || !!slots.title
162
+ })
163
+
164
+ /**
165
+ * 是否显示头部区域
166
+ */
167
+ const showHeader = computed(() => {
168
+ return showTitle.value || showClose.value
169
+ })
170
+
171
+ /**
172
+ * 数组随机排序(Fisher-Yates 算法)
173
+ * @param arr 待排序数组
174
+ * @returns 排序后的新数组
175
+ */
176
+ function shuffleArray<T>(arr: T[]): T[] {
177
+ const newArr = [...arr]
178
+ for (let i = newArr.length - 1; i > 0; i--) {
179
+ const j = Math.floor(Math.random() * (i + 1))
180
+ ;[newArr[i], newArr[j]] = [newArr[j], newArr[i]]
181
+ }
182
+ return newArr
183
+ }
184
+
185
+ /**
186
+ * 生成基础数字按键(0-9)
187
+ * @returns 数字按键数组
188
+ */
189
+ function genBasicKeys(): Key[] {
190
+ const keys = Array.from({ length: 10 }, (_, i) => ({ text: i }))
191
+ return props.randomKeyOrder ? shuffleArray(keys) : keys
192
+ }
193
+
194
+ /**
195
+ * 生成默认数字键盘按键
196
+ * 布局:1 2 3 / 4 5 6 / 7 8 9 / . 0 删除
197
+ * @returns 默认键盘按键数组
198
+ */
199
+ function genDefaultKeys(): Key[] {
200
+ const result: Key[] = []
201
+ const basicKeys = genBasicKeys()
202
+
203
+ // 第一行: 1, 2, 3
204
+ result.push(basicKeys[1], basicKeys[2], basicKeys[3])
205
+ // 第二行: 4, 5, 6
206
+ result.push(basicKeys[4], basicKeys[5], basicKeys[6])
207
+ // 第三行: 7, 8, 9
208
+ result.push(basicKeys[7], basicKeys[8], basicKeys[9])
209
+ // 第四行: 小数点, 0, 删除
210
+ const dotKey = props.showDotKey
211
+ ? [{ text: (props.extraKey as string) || '.', type: 'extra' as NumberKeyType }]
212
+ : []
213
+
214
+ result.push(
215
+ ...dotKey,
216
+ { ...basicKeys[0], wider: true },
217
+ {
218
+ text: props.showDeleteKey ? props.deleteText : '',
219
+ type: props.showDeleteKey ? 'delete' : ''
220
+ }
221
+ )
222
+
223
+ return result
224
+ }
225
+
226
+ /**
227
+ * 生成自定义模式键盘按键(带侧边栏)
228
+ * @returns 自定义键盘按键数组
229
+ */
230
+ function genCustomKeys(): Key[] {
231
+ const result: Key[] = []
232
+ const basicKeys = genBasicKeys()
233
+ const extraKeys = Array.isArray(props.extraKey) ? props.extraKey : [props.extraKey]
234
+
235
+ // 第一行: 1, 2, 3
236
+ result.push(basicKeys[1], basicKeys[2], basicKeys[3])
237
+ // 第二行: 4, 5, 6
238
+ result.push(basicKeys[4], basicKeys[5], basicKeys[6])
239
+ // 第三行: 7, 8, 9
240
+ result.push(basicKeys[7], basicKeys[8], basicKeys[9])
241
+
242
+ // 第四行根据extraKey数量调整
243
+ if (extraKeys.length === 1) {
244
+ console.log(extraKeys)
245
+
246
+ result.push({ ...basicKeys[0], wider: true }, { text: extraKeys[0] || '.', type: 'extra' })
247
+ } else if (extraKeys.length >= 2) {
248
+ result.push({ text: extraKeys[0], type: 'extra' }, basicKeys[0], {
249
+ text: extraKeys[1],
250
+ type: 'extra'
251
+ })
252
+ }
253
+
254
+ return result
255
+ }
256
+
257
+ /**
258
+ * 生成车牌号键盘按键
259
+ * 支持省份简称和字母数字切换
260
+ * @returns 车牌号键盘按键数组
261
+ */
262
+ function genCarKeys(): Key[] {
263
+ const [keys, remainKeys] = splitCarKeys()
264
+ return [
265
+ ...keys,
266
+ { text: carKeyboardLang.value === 'zh' ? 'ABC' : '省份', type: 'extra', wider: true },
267
+ ...remainKeys,
268
+ { text: props.deleteText, type: 'delete', wider: true }
269
+ ]
270
+ }
271
+
272
+ /**
273
+ * 分割车牌号按键数组
274
+ * 用于在第30个按键后插入切换语言的按钮
275
+ * @returns 分割后的按键数组
276
+ */
277
+ function splitCarKeys(): Key[][] {
278
+ const keys =
279
+ carKeyboardLang.value === 'zh'
280
+ ? CAR_KEYBOARD_AREAS.map((key) => ({ text: key }))
281
+ : CAR_KEYBOARD_KEYS.map((key) => ({ text: key }))
282
+ return [keys.slice(0, 30), keys.slice(30)]
283
+ }
284
+
285
+ /**
286
+ * 生成身份证键盘按键
287
+ * 布局:1 2 3 / 4 5 6 / 7 8 9 / X 0 删除
288
+ * @returns 身份证键盘按键数组
289
+ */
290
+ function genIdCardKeys(): Key[] {
291
+ const result: Key[] = []
292
+ const basicKeys = genBasicKeys()
293
+
294
+ // 第一行: 1, 2, 3
295
+ result.push(basicKeys[0], basicKeys[1], basicKeys[2])
296
+ // 第二行: 4, 5, 6
297
+ result.push(basicKeys[3], basicKeys[4], basicKeys[5])
298
+ // 第三行: 7, 8, 9
299
+ result.push(basicKeys[6], basicKeys[7], basicKeys[8])
300
+ // 第四行: X, 0, 删除
301
+ result.push(
302
+ { text: 'X', type: 'extra' },
303
+ { text: 0 },
304
+ {
305
+ text: props.showDeleteKey ? props.deleteText : '',
306
+ type: props.showDeleteKey ? 'delete' : ''
307
+ }
308
+ )
309
+
310
+ return result
311
+ }
312
+
313
+ /**
314
+ * 处理关闭事件
315
+ */
316
+ const handleClose = () => {
317
+ emit('close')
318
+ emit('update:show', false)
319
+ }
320
+
321
+ /**
322
+ * 处理按键点击
323
+ * @param text 按键文本
324
+ * @param type 按键类型
325
+ */
326
+ const handlePress = (text: string, type: NumberKeyType) => {
327
+ // 额外按键处理
328
+ if (type === 'extra') {
329
+ // 空文本不处理
330
+ if (text === '') {
331
+ return handleClose()
332
+ }
333
+ // 车牌号键盘语言切换
334
+ else if (text === 'ABC' || text === '省份') {
335
+ const newLang = carKeyboardLang.value === 'zh' ? 'en' : 'zh'
336
+ if (props.carLang) {
337
+ emit('update:carLang', newLang)
338
+ } else {
339
+ carKeyboardLang.value = newLang
340
+ }
341
+ return
342
+ }
343
+ }
344
+
345
+ const value = props.modelValue
346
+ // 删除键处理
347
+ if (type === 'delete') {
348
+ emit('delete')
349
+ const newValue = value.slice(0, value.length - 1)
350
+ emit('update:modelValue', newValue)
351
+ // 车牌号键盘自动切换回省份模式
352
+ if (props.mode === 'car' && newValue.length === 0 && props.autoSwitchLang) {
353
+ carLang.value = 'zh'
354
+ }
355
+ }
356
+ // 关闭键处理
357
+ else if (type === 'close') {
358
+ handleClose()
359
+ }
360
+ // 普通按键输入处理
361
+ else if (value.length < +props.maxlength) {
362
+ emit('input', text)
363
+ const newValue = value + text
364
+ emit('update:modelValue', newValue)
365
+ // 车牌号键盘自动切换到字母模式
366
+ if (props.mode === 'car' && newValue.length === 1 && props.autoSwitchLang) {
367
+ carLang.value = 'en'
368
+ }
369
+ }
370
+ }
371
+ </script>
372
+
373
+ <style lang="scss">
374
+ @import './index.scss';
375
+ </style>
@@ -0,0 +1,73 @@
1
+ @use "../../libs/css/theme" as *;
2
+ @use "../../libs/css/mixin" as *;
3
+
4
+ $keyboard-header-height: 80rpx;
5
+ $keyboard-title-font-size: 32rpx;
6
+ $keyboard-close-font-size: 28rpx;
7
+ $keyboard-key-gap: $hy-border-margin-padding-sm;
8
+
9
+ @include b(keyboard) {
10
+ background: $hy-background--track;
11
+ overflow: hidden;
12
+ box-sizing: border-box;
13
+
14
+ @include e(header) {
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: space-between;
18
+ height: $keyboard-header-height;
19
+ padding: 0 32rpx;
20
+ background: $hy-background--track;
21
+ border-bottom: $hy-border-line;
22
+ width: 100%;
23
+ box-sizing: border-box;
24
+ }
25
+
26
+ @include e(title) {
27
+ font-size: $keyboard-title-font-size;
28
+ font-weight: 500;
29
+ color: $hy-primary;
30
+ }
31
+
32
+ @include e(close) {
33
+ font-size: $keyboard-close-font-size;
34
+ padding: 10rpx 20rpx;
35
+
36
+ &--hover:active {
37
+ opacity: 0.7;
38
+ }
39
+ }
40
+
41
+ @include e(body) {
42
+ display: flex;
43
+ gap: $keyboard-key-gap;
44
+ width: 100%;
45
+ padding: $hy-border-margin-padding-sm;
46
+ box-sizing: border-box;
47
+ }
48
+
49
+ @include e(keys) {
50
+ display: flex;
51
+ flex-wrap: wrap;
52
+ flex: 3;
53
+ gap: $keyboard-key-gap;
54
+ width: 100%;
55
+ box-sizing: border-box;
56
+ justify-content: space-between;
57
+ }
58
+
59
+ @include e(sidebar) {
60
+ width: 160rpx;
61
+ display: flex;
62
+ flex-direction: column;
63
+ gap: $keyboard-key-gap;
64
+ }
65
+
66
+ @include e(car-keys) {
67
+ display: flex;
68
+ flex-wrap: wrap;
69
+ gap: $keyboard-key-gap;
70
+ width: 100%;
71
+ box-sizing: border-box;
72
+ }
73
+ }
@@ -0,0 +1,79 @@
1
+ @use "../../../libs/css/theme" as *;
2
+ @use "../../../libs/css/mixin" as *;
3
+
4
+ $keyboard-key-height: 100rpx;
5
+ $keyboard-key-border-radius: 12rpx;
6
+ $keyboard-key-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
7
+
8
+ @include b(keyboard) {
9
+ @include e(key) {
10
+ flex-basis: 32%;
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ height: $keyboard-key-height;
15
+ background: $hy-background--container;
16
+ border-radius: $keyboard-key-border-radius;
17
+ box-shadow: $keyboard-key-shadow;
18
+ box-sizing: border-box;
19
+ transition: all 0.15s;
20
+
21
+ @include m(large) {
22
+ flex: 1;
23
+ align-self: stretch;
24
+ }
25
+
26
+ @include m(car) {
27
+ flex-basis: 8.7%;
28
+ height: 88rpx;
29
+ font-size: 28rpx;
30
+ }
31
+
32
+ @include m(wider) {
33
+ flex: 1;
34
+ }
35
+
36
+ @include m(delete) {
37
+ color: #FFFFFF;
38
+ background: $hy-error;
39
+ display: flex;
40
+ flex-direction: column-reverse;
41
+ align-items: center;
42
+ justify-content: center;
43
+ }
44
+
45
+ @include m(extra) {
46
+ background: $hy-background--3;
47
+ }
48
+
49
+ @include m(close) {
50
+ color: #ffffff;
51
+ background: $hy-primary;
52
+ }
53
+
54
+ &:active {
55
+ background: $hy-background--hover;
56
+ }
57
+
58
+ &-text {
59
+ font-size: $hy-font-size-lg;
60
+ }
61
+
62
+ @include e(delete-line) {
63
+ position: absolute;
64
+ width: 18rpx;
65
+ height: 2rpx;
66
+ background: #999999;
67
+ top: 50%;
68
+ left: 50%;
69
+
70
+ @include m(left) {
71
+ transform: translate(-50%, -50%) rotate(45deg);
72
+ }
73
+
74
+ @include m(right) {
75
+ transform: translate(-50%, -50%) rotate(-45deg);
76
+ }
77
+ }
78
+ }
79
+ }