@composy/keyboard-vue 0.0.1

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 (107) hide show
  1. package/README.md +46 -0
  2. package/dist/index.css +797 -0
  3. package/dist/index.js +1250 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.min.css +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/es/components/KeyboardKey.js +17 -0
  8. package/es/components/KeyboardKey.js.map +1 -0
  9. package/es/components/KeyboardKey.vue_vue_type_script_setup_true_lang.js +131 -0
  10. package/es/components/KeyboardKey.vue_vue_type_script_setup_true_lang.js.map +1 -0
  11. package/es/components/KeyboardPopup.js +17 -0
  12. package/es/components/KeyboardPopup.js.map +1 -0
  13. package/es/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.js +164 -0
  14. package/es/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  15. package/es/components/LicensePlateKeyboard.js +17 -0
  16. package/es/components/LicensePlateKeyboard.js.map +1 -0
  17. package/es/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.js +97 -0
  18. package/es/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  19. package/es/components/VirtualKeyboard.js +17 -0
  20. package/es/components/VirtualKeyboard.js.map +1 -0
  21. package/es/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.js +127 -0
  22. package/es/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  23. package/es/components/index.d.ts +9 -0
  24. package/es/components/index.d.ts.map +1 -0
  25. package/es/components/index.js +15 -0
  26. package/es/composables/index.d.ts +7 -0
  27. package/es/composables/index.d.ts.map +1 -0
  28. package/es/composables/index.js +13 -0
  29. package/es/composables/useKeyboard.d.ts +113 -0
  30. package/es/composables/useKeyboard.d.ts.map +1 -0
  31. package/es/composables/useKeyboard.js +75 -0
  32. package/es/composables/useKeyboard.js.map +1 -0
  33. package/es/composables/useKeyboardPopup.d.ts +73 -0
  34. package/es/composables/useKeyboardPopup.d.ts.map +1 -0
  35. package/es/composables/useKeyboardPopup.js +119 -0
  36. package/es/composables/useKeyboardPopup.js.map +1 -0
  37. package/es/directives/index.d.ts +6 -0
  38. package/es/directives/index.d.ts.map +1 -0
  39. package/es/directives/index.js +12 -0
  40. package/es/directives/v-keyboard.d.ts +36 -0
  41. package/es/directives/v-keyboard.d.ts.map +1 -0
  42. package/es/directives/v-keyboard.js +65 -0
  43. package/es/directives/v-keyboard.js.map +1 -0
  44. package/es/index.d.ts +42 -0
  45. package/es/index.d.ts.map +1 -0
  46. package/es/index.js +34 -0
  47. package/es/index.js.map +1 -0
  48. package/es/plugins/engine-plugin.d.ts +37 -0
  49. package/es/plugins/engine-plugin.d.ts.map +1 -0
  50. package/es/plugins/engine-plugin.js +37 -0
  51. package/es/plugins/engine-plugin.js.map +1 -0
  52. package/es/plugins/index.d.ts +6 -0
  53. package/es/plugins/index.d.ts.map +1 -0
  54. package/es/plugins/index.js +12 -0
  55. package/es/style/css.js +1 -0
  56. package/es/style/index.js +1 -0
  57. package/es/style/index.less +1 -0
  58. package/es/styles/index.less +267 -0
  59. package/es/styles/keyboard.less +399 -0
  60. package/es/styles/themes.less +233 -0
  61. package/lib/components/KeyboardKey.cjs +21 -0
  62. package/lib/components/KeyboardKey.cjs.map +1 -0
  63. package/lib/components/KeyboardKey.vue_vue_type_script_setup_true_lang.cjs +131 -0
  64. package/lib/components/KeyboardKey.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  65. package/lib/components/KeyboardPopup.cjs +21 -0
  66. package/lib/components/KeyboardPopup.cjs.map +1 -0
  67. package/lib/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.cjs +164 -0
  68. package/lib/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  69. package/lib/components/LicensePlateKeyboard.cjs +21 -0
  70. package/lib/components/LicensePlateKeyboard.cjs.map +1 -0
  71. package/lib/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.cjs +97 -0
  72. package/lib/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  73. package/lib/components/VirtualKeyboard.cjs +21 -0
  74. package/lib/components/VirtualKeyboard.cjs.map +1 -0
  75. package/lib/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.cjs +127 -0
  76. package/lib/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  77. package/lib/components/index.cjs +19 -0
  78. package/lib/components/index.d.ts +9 -0
  79. package/lib/composables/index.cjs +15 -0
  80. package/lib/composables/index.d.ts +7 -0
  81. package/lib/composables/useKeyboard.cjs +76 -0
  82. package/lib/composables/useKeyboard.cjs.map +1 -0
  83. package/lib/composables/useKeyboard.d.ts +113 -0
  84. package/lib/composables/useKeyboardPopup.cjs +120 -0
  85. package/lib/composables/useKeyboardPopup.cjs.map +1 -0
  86. package/lib/composables/useKeyboardPopup.d.ts +73 -0
  87. package/lib/directives/index.cjs +13 -0
  88. package/lib/directives/index.d.ts +6 -0
  89. package/lib/directives/v-keyboard.cjs +66 -0
  90. package/lib/directives/v-keyboard.cjs.map +1 -0
  91. package/lib/directives/v-keyboard.d.ts +36 -0
  92. package/lib/index.cjs +537 -0
  93. package/lib/index.cjs.map +1 -0
  94. package/lib/index.d.ts +42 -0
  95. package/lib/package.json +3 -0
  96. package/lib/plugins/engine-plugin.cjs +37 -0
  97. package/lib/plugins/engine-plugin.cjs.map +1 -0
  98. package/lib/plugins/engine-plugin.d.ts +37 -0
  99. package/lib/plugins/index.cjs +13 -0
  100. package/lib/plugins/index.d.ts +6 -0
  101. package/lib/style/css.js +1 -0
  102. package/lib/style/index.css +2 -0
  103. package/lib/style/index.js +1 -0
  104. package/lib/styles/index.css +229 -0
  105. package/lib/styles/keyboard.css +346 -0
  106. package/lib/styles/themes.css +213 -0
  107. package/package.json +141 -0
package/dist/index.css ADDED
@@ -0,0 +1,797 @@
1
+ /* style/index.less */
2
+
3
+ /*# sourceMappingURL=src/style/index.less.map */
4
+
5
+ /* styles/index.less */
6
+ /**
7
+ * LDesign Keyboard 样式
8
+ * @module styles
9
+ */
10
+ /* 核心样式 */
11
+ @import 'keyboard.css';
12
+ /* 主题样式 */
13
+ @import 'themes.css';
14
+ /* 深色主题 */
15
+ .dark,
16
+ [data-theme="dark"] {
17
+ --keyboard-bg: #374151;
18
+ --keyboard-key-bg: #4b5563;
19
+ --keyboard-key-color: #f9fafb;
20
+ --keyboard-key-active-bg: #6b7280;
21
+ --keyboard-fn-key-bg: #1f2937;
22
+ --keyboard-fn-key-color: #f9fafb;
23
+ --keyboard-fn-key-active-bg: #111827;
24
+ --keyboard-primary-bg: #2563eb;
25
+ --keyboard-primary-active-bg: #1d4ed8;
26
+ }
27
+ /* iOS 风格主题 */
28
+ .keyboard-theme-ios {
29
+ --keyboard-bg: #d1d5db;
30
+ --keyboard-key-bg: #ffffff;
31
+ --keyboard-key-color: #000000;
32
+ --keyboard-key-active-bg: #c4c7cc;
33
+ --keyboard-fn-key-bg: #adb3bc;
34
+ --keyboard-fn-key-color: #000000;
35
+ --keyboard-fn-key-active-bg: #8e9399;
36
+ --keyboard-primary-bg: #007aff;
37
+ --keyboard-primary-active-bg: #0062cc;
38
+ --keyboard-key-radius: 5px;
39
+ }
40
+ /* Android 风格主题 */
41
+ .keyboard-theme-android {
42
+ --keyboard-bg: #263238;
43
+ --keyboard-key-bg: #37474f;
44
+ --keyboard-key-color: #ffffff;
45
+ --keyboard-key-active-bg: #455a64;
46
+ --keyboard-fn-key-bg: #455a64;
47
+ --keyboard-fn-key-color: #90a4ae;
48
+ --keyboard-fn-key-active-bg: #546e7a;
49
+ --keyboard-primary-bg: #4285f4;
50
+ --keyboard-primary-active-bg: #3367d6;
51
+ --keyboard-key-radius: 4px;
52
+ }
53
+ /* 基础重置 */
54
+ .virtual-keyboard,
55
+ .virtual-keyboard * {
56
+ box-sizing: border-box;
57
+ }
58
+ .virtual-keyboard {
59
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
60
+ -webkit-font-smoothing: antialiased;
61
+ -moz-osx-font-smoothing: grayscale;
62
+ }
63
+ /* 禁止选中 */
64
+ .virtual-keyboard,
65
+ .keyboard-popup {
66
+ -webkit-touch-callout: none;
67
+ -webkit-user-select: none;
68
+ -moz-user-select: none;
69
+ user-select: none;
70
+ }
71
+ /* 禁止 iOS 点击高亮 */
72
+ .keyboard-key {
73
+ -webkit-tap-highlight-color: transparent;
74
+ }
75
+ /* 移动端优化 */
76
+ @media (max-width: 768px) {
77
+ :root {
78
+ --keyboard-key-height: 46px;
79
+ --keyboard-font-size: 18px;
80
+ }
81
+ .virtual-keyboard {
82
+ padding: 6px 2px;
83
+ }
84
+ .keyboard-key {
85
+ margin: 3px;
86
+ }
87
+ }
88
+ /* 横屏优化 */
89
+ @media (orientation: landscape) and (max-height: 500px) {
90
+ :root {
91
+ --keyboard-key-height: 36px;
92
+ --keyboard-font-size: 14px;
93
+ }
94
+ .virtual-keyboard {
95
+ padding: 4px 2px;
96
+ }
97
+ }
98
+ /* 安全区域适配 */
99
+ @supports (padding-bottom: env(safe-area-inset-bottom)) {
100
+ .keyboard-popup--mobile {
101
+ padding-bottom: calc(8px + env(safe-area-inset-bottom));
102
+ }
103
+ }
104
+ /* =========================
105
+ 数字键盘专用样式
106
+ ========================= */
107
+ .number-keyboard-row {
108
+ display: flex;
109
+ justify-content: center;
110
+ width: 100%;
111
+ }
112
+ .number-keyboard-row .keyboard-key {
113
+ flex: 1;
114
+ max-width: 25%;
115
+ height: 52px;
116
+ font-size: 22px;
117
+ font-weight: 500;
118
+ }
119
+ .number-keyboard-row .key-number {
120
+ background-color: var(--keyboard-key-bg, #fff);
121
+ color: var(--keyboard-key-color, #333);
122
+ }
123
+ .number-keyboard-row .key-side {
124
+ background-color: var(--keyboard-fn-key-bg, #d4d6dc);
125
+ color: var(--keyboard-fn-key-color, #333);
126
+ font-size: 14px;
127
+ }
128
+ .number-keyboard-row .key-side:active {
129
+ background-color: var(--keyboard-fn-key-active-bg, #b8bac0);
130
+ }
131
+ .number-keyboard-row .key-done {
132
+ background-color: var(--keyboard-primary-bg, #007aff);
133
+ color: #fff;
134
+ }
135
+ .number-keyboard-row .key-done:active {
136
+ background-color: var(--keyboard-primary-active-bg, #0062cc);
137
+ }
138
+ .number-keyboard-row .key-decimal,
139
+ .number-keyboard-row .key-double-zero {
140
+ background-color: var(--keyboard-key-bg, #fff);
141
+ font-size: 18px;
142
+ }
143
+ .number-keyboard-row .key-placeholder {
144
+ background-color: transparent;
145
+ box-shadow: none;
146
+ cursor: default;
147
+ }
148
+ .number-keyboard-row .key-placeholder:active {
149
+ transform: none;
150
+ background-color: transparent;
151
+ }
152
+ /* =========================
153
+ PC端专用样式
154
+ ========================= */
155
+ .keyboard-popup--desktop {
156
+ min-width: 320px;
157
+ }
158
+ .keyboard-popup--desktop .keyboard-key {
159
+ height: 40px;
160
+ font-size: 15px;
161
+ border-radius: 5px;
162
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
163
+ }
164
+ .keyboard-popup--desktop .keyboard-key:hover {
165
+ background-color: var(--keyboard-key-active-bg, #e5e7eb);
166
+ }
167
+ .keyboard-popup--desktop .keyboard-key--backspace:hover,
168
+ .keyboard-popup--desktop .keyboard-key--shift:hover,
169
+ .keyboard-popup--desktop .keyboard-key--tab:hover,
170
+ .keyboard-popup--desktop .keyboard-key--clear:hover,
171
+ .keyboard-popup--desktop .keyboard-key--close:hover {
172
+ background-color: var(--keyboard-fn-key-active-bg, #b8bac0);
173
+ }
174
+ .keyboard-popup--desktop .keyboard-key--done:hover,
175
+ .keyboard-popup--desktop .keyboard-key--enter:hover {
176
+ background-color: var(--keyboard-primary-active-bg, #0062cc);
177
+ }
178
+ /* PC端数字键盘 */
179
+ .keyboard-popup--desktop .number-keyboard-row .keyboard-key {
180
+ height: 44px;
181
+ font-size: 18px;
182
+ }
183
+ .keyboard-popup--desktop .number-keyboard-row .key-side {
184
+ font-size: 13px;
185
+ }
186
+ /* =========================
187
+ 移动端专用样式
188
+ ========================= */
189
+ .keyboard-popup--mobile {
190
+ width: 100%;
191
+ }
192
+ .keyboard-popup--mobile .keyboard-key {
193
+ height: 46px;
194
+ font-size: 18px;
195
+ border-radius: 6px;
196
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
197
+ }
198
+ /* 移动端数字键盘 */
199
+ .keyboard-popup--mobile .number-keyboard-row .keyboard-key {
200
+ height: 54px;
201
+ font-size: 24px;
202
+ border-radius: 8px;
203
+ }
204
+ .keyboard-popup--mobile .number-keyboard-row .key-side {
205
+ font-size: 15px;
206
+ }
207
+ /* =========================
208
+ 键盘顶部栅栏(移动端)
209
+ ========================= */
210
+ .keyboard-toolbar {
211
+ display: flex;
212
+ justify-content: space-between;
213
+ align-items: center;
214
+ padding: 8px 16px;
215
+ background-color: var(--keyboard-bg, #d1d5db);
216
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
217
+ }
218
+ .keyboard-toolbar__title {
219
+ font-size: 14px;
220
+ color: var(--keyboard-fn-key-color, #666);
221
+ }
222
+ .keyboard-toolbar__done {
223
+ padding: 6px 16px;
224
+ background: none;
225
+ border: none;
226
+ color: var(--keyboard-primary-bg, #007aff);
227
+ font-size: 15px;
228
+ font-weight: 500;
229
+ cursor: pointer;
230
+ }
231
+ .keyboard-toolbar__done:active {
232
+ opacity: 0.7;
233
+ }
234
+ /*# sourceMappingURL=src/styles/index.less.map */
235
+
236
+ /* styles/keyboard.less */
237
+ /**
238
+ * LDesign Keyboard - 核心样式
239
+ * 简洁现代的默认主题
240
+ */
241
+ /* ====================
242
+ CSS 变量 - 简洁主题
243
+ ==================== */
244
+ :root {
245
+ /* 键盘背景 */
246
+ --keyboard-bg: #f7f7f7;
247
+ /* 普通按键 */
248
+ --keyboard-key-bg: #ffffff;
249
+ --keyboard-key-color: #333333;
250
+ --keyboard-key-active-bg: #e5e5e5;
251
+ --keyboard-key-border: #e0e0e0;
252
+ /* 功能键 */
253
+ --keyboard-fn-bg: #e8e8e8;
254
+ --keyboard-fn-color: #666666;
255
+ --keyboard-fn-active-bg: #d8d8d8;
256
+ /* 主色调按键 */
257
+ --keyboard-primary-bg: #2563eb;
258
+ --keyboard-primary-active-bg: #1d4ed8;
259
+ --keyboard-primary-color: #ffffff;
260
+ /* 按键尺寸 */
261
+ --keyboard-key-height: 48px;
262
+ --keyboard-key-radius: 8px;
263
+ --keyboard-key-gap: 6px;
264
+ /* 字体 */
265
+ --keyboard-font-size: 20px;
266
+ --keyboard-fn-font-size: 14px;
267
+ /* 动画 */
268
+ --keyboard-transition: 80ms ease-out;
269
+ }
270
+ /* ====================
271
+ 基础重置
272
+ ==================== */
273
+ .virtual-keyboard,
274
+ .virtual-keyboard *,
275
+ .keyboard-popup,
276
+ .keyboard-popup * {
277
+ box-sizing: border-box;
278
+ margin: 0;
279
+ padding: 0;
280
+ }
281
+ .virtual-keyboard {
282
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
283
+ -webkit-font-smoothing: antialiased;
284
+ -moz-osx-font-smoothing: grayscale;
285
+ -webkit-touch-callout: none;
286
+ -webkit-user-select: none;
287
+ -moz-user-select: none;
288
+ user-select: none;
289
+ }
290
+ /* ====================
291
+ 键盘容器
292
+ ==================== */
293
+ .virtual-keyboard {
294
+ display: flex;
295
+ flex-direction: column;
296
+ padding: 8px;
297
+ background-color: var(--keyboard-bg);
298
+ width: 100%;
299
+ }
300
+ .virtual-keyboard__row {
301
+ display: flex;
302
+ justify-content: center;
303
+ width: 100%;
304
+ gap: var(--keyboard-key-gap);
305
+ margin-bottom: var(--keyboard-key-gap);
306
+ }
307
+ .virtual-keyboard__row:last-child {
308
+ margin-bottom: 0;
309
+ }
310
+ /* ====================
311
+ 按键基础样式
312
+ ==================== */
313
+ .keyboard-key {
314
+ display: inline-flex;
315
+ align-items: center;
316
+ justify-content: center;
317
+ flex: 1;
318
+ height: var(--keyboard-key-height);
319
+ min-width: 0;
320
+ padding: 0 4px;
321
+ border: none;
322
+ border-radius: var(--keyboard-key-radius);
323
+ background-color: var(--keyboard-key-bg);
324
+ color: var(--keyboard-key-color);
325
+ font-size: var(--keyboard-font-size);
326
+ font-weight: 500;
327
+ cursor: pointer;
328
+ touch-action: manipulation;
329
+ transition: background-color var(--keyboard-transition), transform var(--keyboard-transition);
330
+ -webkit-tap-highlight-color: transparent;
331
+ box-shadow: 0 1px 0 var(--keyboard-key-border);
332
+ }
333
+ .keyboard-key:active {
334
+ background-color: var(--keyboard-key-active-bg);
335
+ transform: scale(0.98);
336
+ }
337
+ .keyboard-key--disabled {
338
+ opacity: 0;
339
+ cursor: default;
340
+ pointer-events: none;
341
+ }
342
+ /* ====================
343
+ 功能键样式
344
+ ==================== */
345
+ .keyboard-key--backspace,
346
+ .keyboard-key--shift,
347
+ .keyboard-key--tab,
348
+ .keyboard-key--clear,
349
+ .keyboard-key--close {
350
+ background-color: var(--keyboard-fn-bg);
351
+ color: var(--keyboard-fn-color);
352
+ font-size: var(--keyboard-fn-font-size);
353
+ font-weight: 400;
354
+ box-shadow: 0 1px 0 var(--keyboard-key-border);
355
+ }
356
+ .keyboard-key--backspace:active,
357
+ .keyboard-key--shift:active,
358
+ .keyboard-key--tab:active,
359
+ .keyboard-key--clear:active,
360
+ .keyboard-key--close:active {
361
+ background-color: var(--keyboard-fn-active-bg);
362
+ }
363
+ /* Shift 激活状态 */
364
+ .keyboard-key--shift.keyboard-key--active {
365
+ background-color: var(--keyboard-primary-bg);
366
+ color: var(--keyboard-primary-color);
367
+ }
368
+ /* ====================
369
+ 主色按键(完成/确认)
370
+ ==================== */
371
+ .keyboard-key--done,
372
+ .keyboard-key--enter {
373
+ background-color: var(--keyboard-primary-bg);
374
+ color: var(--keyboard-primary-color);
375
+ font-size: var(--keyboard-fn-font-size);
376
+ font-weight: 500;
377
+ box-shadow: none;
378
+ }
379
+ .keyboard-key--done:active,
380
+ .keyboard-key--enter:active {
381
+ background-color: var(--keyboard-primary-active-bg);
382
+ }
383
+ /* ====================
384
+ 空格键
385
+ ==================== */
386
+ .keyboard-key--space {
387
+ flex: 4;
388
+ }
389
+ /* ====================
390
+ 占位键(透明)
391
+ ==================== */
392
+ .key-placeholder {
393
+ background-color: transparent !important;
394
+ box-shadow: none !important;
395
+ cursor: default;
396
+ pointer-events: none;
397
+ }
398
+ /* ====================
399
+ 数字键盘通用样式
400
+ ==================== */
401
+ .numpad-row {
402
+ display: flex;
403
+ gap: var(--keyboard-key-gap);
404
+ width: 100%;
405
+ }
406
+ .numpad-row .keyboard-key {
407
+ flex: 1;
408
+ height: 54px;
409
+ font-size: 24px;
410
+ font-weight: 500;
411
+ }
412
+ /* 数字键 */
413
+ .key-num {
414
+ background-color: var(--keyboard-key-bg);
415
+ color: var(--keyboard-key-color);
416
+ }
417
+ /* 功能键 */
418
+ .key-numpad-fn {
419
+ background-color: var(--keyboard-fn-bg);
420
+ color: var(--keyboard-fn-color);
421
+ font-size: 14px;
422
+ font-weight: 400;
423
+ }
424
+ /* 完成键 */
425
+ .key-numpad-done {
426
+ background-color: var(--keyboard-primary-bg);
427
+ color: var(--keyboard-primary-color);
428
+ font-size: 16px;
429
+ font-weight: 500;
430
+ box-shadow: none;
431
+ }
432
+ .key-numpad-done:active {
433
+ background-color: var(--keyboard-primary-active-bg);
434
+ }
435
+ /* ====================
436
+ 车牌键盘样式
437
+ ==================== */
438
+ .virtual-keyboard:has(.plate-keyboard-row) {
439
+ min-width: 340px;
440
+ }
441
+ .plate-keyboard-row {
442
+ display: flex;
443
+ gap: 3px;
444
+ width: 100%;
445
+ flex-wrap: nowrap;
446
+ }
447
+ .plate-keyboard-row .keyboard-key {
448
+ flex: 1 1 0;
449
+ height: 42px;
450
+ min-width: 28px;
451
+ max-width: none;
452
+ padding: 0 2px;
453
+ font-size: 15px;
454
+ font-weight: 500;
455
+ border-radius: 5px;
456
+ }
457
+ .key-plate-province,
458
+ .key-plate-letter,
459
+ .key-plate-number {
460
+ background-color: var(--keyboard-key-bg);
461
+ }
462
+ .key-plate-fn {
463
+ background-color: var(--keyboard-fn-bg);
464
+ font-size: 12px;
465
+ flex: 1.2 1 0 !important;
466
+ }
467
+ .key-plate-done {
468
+ background-color: var(--keyboard-primary-bg);
469
+ color: var(--keyboard-primary-color);
470
+ font-size: 13px;
471
+ box-shadow: none;
472
+ flex: 1.5 1 0 !important;
473
+ }
474
+ .key-plate-switch {
475
+ background-color: var(--keyboard-fn-bg);
476
+ font-size: 12px;
477
+ flex: 1.3 1 0 !important;
478
+ }
479
+ .key-plate-special {
480
+ background-color: #fef3c7;
481
+ color: #92400e;
482
+ }
483
+ /* ====================
484
+ 弹出层样式
485
+ ==================== */
486
+ .keyboard-popup {
487
+ position: fixed;
488
+ z-index: 1000;
489
+ background-color: var(--keyboard-bg);
490
+ overflow: hidden;
491
+ }
492
+ .keyboard-popup--desktop {
493
+ border-radius: 12px;
494
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
495
+ min-width: 300px;
496
+ }
497
+ .keyboard-popup--mobile {
498
+ position: fixed;
499
+ left: 0;
500
+ right: 0;
501
+ bottom: 0;
502
+ border-radius: 0;
503
+ border-top-left-radius: 12px;
504
+ border-top-right-radius: 12px;
505
+ box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
506
+ }
507
+ /* 安全区域 */
508
+ @supports (padding-bottom: env(safe-area-inset-bottom)) {
509
+ .keyboard-popup--mobile {
510
+ padding-bottom: env(safe-area-inset-bottom);
511
+ }
512
+ }
513
+ /* ====================
514
+ 遮罩层
515
+ ==================== */
516
+ .keyboard-mask {
517
+ position: fixed;
518
+ inset: 0;
519
+ background-color: rgba(0, 0, 0, 0.3);
520
+ z-index: 999;
521
+ }
522
+ /* ====================
523
+ 动画
524
+ ==================== */
525
+ .keyboard-mask-enter-active,
526
+ .keyboard-mask-leave-active {
527
+ transition: opacity 0.2s ease;
528
+ }
529
+ .keyboard-mask-enter-from,
530
+ .keyboard-mask-leave-to {
531
+ opacity: 0;
532
+ }
533
+ .keyboard-fade-enter-active,
534
+ .keyboard-fade-leave-active {
535
+ transition: opacity 0.15s ease, transform 0.15s ease;
536
+ }
537
+ .keyboard-fade-enter-from,
538
+ .keyboard-fade-leave-to {
539
+ opacity: 0;
540
+ transform: translateY(-4px) scale(0.98);
541
+ }
542
+ .keyboard-slide-enter-active,
543
+ .keyboard-slide-leave-active {
544
+ transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
545
+ }
546
+ .keyboard-slide-enter-from,
547
+ .keyboard-slide-leave-to {
548
+ transform: translateY(100%);
549
+ }
550
+ /* ====================
551
+ 移动端适配
552
+ ==================== */
553
+ @media (max-width: 768px) {
554
+ .virtual-keyboard {
555
+ padding: 6px;
556
+ }
557
+ .keyboard-key {
558
+ height: 44px;
559
+ }
560
+ .numpad-row .keyboard-key {
561
+ height: 52px;
562
+ font-size: 22px;
563
+ }
564
+ .plate-keyboard-row .keyboard-key {
565
+ height: 40px;
566
+ font-size: 15px;
567
+ }
568
+ }
569
+ /* ====================
570
+ 横屏适配
571
+ ==================== */
572
+ @media (orientation: landscape) and (max-height: 500px) {
573
+ .keyboard-key {
574
+ height: 36px;
575
+ font-size: 16px;
576
+ }
577
+ .numpad-row .keyboard-key {
578
+ height: 42px;
579
+ font-size: 18px;
580
+ }
581
+ }
582
+ /*# sourceMappingURL=src/styles/keyboard.less.map */
583
+
584
+ /* styles/themes.less */
585
+ /**
586
+ * LDesign Keyboard - 主题预设
587
+ * 简洁 · 现代 · 优雅
588
+ */
589
+ /* ====================
590
+ MIUI 主题 - 小米风格(默认)
591
+ ==================== */
592
+ [data-theme="miui"],
593
+ .keyboard-theme-miui {
594
+ --keyboard-bg: #f5f5f5;
595
+ --keyboard-key-bg: #ffffff;
596
+ --keyboard-key-color: #1a1a1a;
597
+ --keyboard-key-active-bg: #e8e8e8;
598
+ --keyboard-fn-key-bg: #e0e0e0;
599
+ --keyboard-fn-key-color: #666666;
600
+ --keyboard-fn-key-active-bg: #d0d0d0;
601
+ --keyboard-primary-bg: #ff6700;
602
+ --keyboard-primary-active-bg: #e55d00;
603
+ --keyboard-primary-color: #ffffff;
604
+ --keyboard-key-radius: 8px;
605
+ --keyboard-key-gap: 6px;
606
+ --keyboard-key-height: 46px;
607
+ --keyboard-font-size: 18px;
608
+ --keyboard-fn-font-size: 14px;
609
+ --keyboard-padding: 8px;
610
+ --keyboard-key-shadow: none;
611
+ }
612
+ [data-theme="miui"] .keyboard-key,
613
+ .keyboard-theme-miui .keyboard-key {
614
+ font-weight: 500;
615
+ }
616
+ /* ====================
617
+ iOS 主题 - 苹果风格
618
+ ==================== */
619
+ [data-theme="ios"],
620
+ .keyboard-theme-ios {
621
+ --keyboard-bg: #d1d3d9;
622
+ --keyboard-key-bg: #ffffff;
623
+ --keyboard-key-color: #000000;
624
+ --keyboard-key-active-bg: #c8cad0;
625
+ --keyboard-key-border: #a8aab4;
626
+ --keyboard-fn-key-bg: #adb0b8;
627
+ --keyboard-fn-key-color: #000000;
628
+ --keyboard-fn-key-active-bg: #9ea1a9;
629
+ --keyboard-primary-bg: #007aff;
630
+ --keyboard-primary-active-bg: #0066d6;
631
+ --keyboard-primary-color: #ffffff;
632
+ --keyboard-key-radius: 5px;
633
+ --keyboard-key-gap: 6px;
634
+ --keyboard-key-height: 43px;
635
+ --keyboard-font-size: 23px;
636
+ --keyboard-fn-font-size: 15px;
637
+ --keyboard-padding: 4px;
638
+ --keyboard-key-shadow: 0 1px 0 #a8aab4;
639
+ }
640
+ [data-theme="ios"] .keyboard-key,
641
+ .keyboard-theme-ios .keyboard-key {
642
+ font-weight: 400;
643
+ }
644
+ [data-theme="ios"] .keyboard-key:active,
645
+ .keyboard-theme-ios .keyboard-key:active {
646
+ transform: none;
647
+ }
648
+ /* ====================
649
+ Material 主题 - 质感设计
650
+ ==================== */
651
+ [data-theme="material"],
652
+ .keyboard-theme-material {
653
+ --keyboard-bg: #263238;
654
+ --keyboard-key-bg: #37474f;
655
+ --keyboard-key-color: #ffffff;
656
+ --keyboard-key-active-bg: #455a64;
657
+ --keyboard-fn-key-bg: #455a64;
658
+ --keyboard-fn-key-color: #b0bec5;
659
+ --keyboard-fn-key-active-bg: #546e7a;
660
+ --keyboard-primary-bg: #4caf50;
661
+ --keyboard-primary-active-bg: #43a047;
662
+ --keyboard-primary-color: #ffffff;
663
+ --keyboard-key-radius: 4px;
664
+ --keyboard-key-gap: 4px;
665
+ --keyboard-key-height: 48px;
666
+ --keyboard-font-size: 20px;
667
+ --keyboard-fn-font-size: 14px;
668
+ --keyboard-padding: 6px;
669
+ --keyboard-key-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
670
+ }
671
+ [data-theme="material"] .keyboard-key,
672
+ .keyboard-theme-material .keyboard-key {
673
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
674
+ }
675
+ [data-theme="material"] .keyboard-key:active,
676
+ .keyboard-theme-material .keyboard-key:active {
677
+ transform: none;
678
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
679
+ }
680
+ /* ====================
681
+ Minimal 极简主题 - 无边框
682
+ ==================== */
683
+ [data-theme="minimal"],
684
+ .keyboard-theme-minimal {
685
+ --keyboard-bg: rgba(250, 250, 250, 0.95);
686
+ --keyboard-key-bg: transparent;
687
+ --keyboard-key-color: #333333;
688
+ --keyboard-key-active-bg: rgba(0, 0, 0, 0.08);
689
+ --keyboard-fn-key-bg: transparent;
690
+ --keyboard-fn-key-color: #888888;
691
+ --keyboard-fn-key-active-bg: rgba(0, 0, 0, 0.08);
692
+ --keyboard-primary-bg: #333333;
693
+ --keyboard-primary-active-bg: #1a1a1a;
694
+ --keyboard-primary-color: #ffffff;
695
+ --keyboard-key-radius: 12px;
696
+ --keyboard-key-gap: 8px;
697
+ --keyboard-key-height: 44px;
698
+ --keyboard-font-size: 17px;
699
+ --keyboard-fn-font-size: 13px;
700
+ --keyboard-padding: 12px;
701
+ --keyboard-key-shadow: none;
702
+ }
703
+ [data-theme="minimal"] .keyboard-key,
704
+ .keyboard-theme-minimal .keyboard-key {
705
+ box-shadow: none;
706
+ }
707
+ [data-theme="minimal"] .keyboard-key:active,
708
+ .keyboard-theme-minimal .keyboard-key:active {
709
+ transform: scale(0.95);
710
+ }
711
+ /* ====================
712
+ Dark 深色主题
713
+ ==================== */
714
+ [data-theme="dark"],
715
+ .keyboard-theme-dark {
716
+ --keyboard-bg: #1c1c1e;
717
+ --keyboard-key-bg: #3a3a3c;
718
+ --keyboard-key-color: #ffffff;
719
+ --keyboard-key-active-bg: #4a4a4c;
720
+ --keyboard-fn-key-bg: #2c2c2e;
721
+ --keyboard-fn-key-color: #ebebf5;
722
+ --keyboard-fn-key-active-bg: #3c3c3e;
723
+ --keyboard-primary-bg: #0a84ff;
724
+ --keyboard-primary-active-bg: #0070e0;
725
+ --keyboard-primary-color: #ffffff;
726
+ --keyboard-key-radius: 8px;
727
+ --keyboard-key-gap: 6px;
728
+ --keyboard-key-height: 45px;
729
+ --keyboard-font-size: 18px;
730
+ --keyboard-fn-font-size: 14px;
731
+ --keyboard-padding: 8px;
732
+ --keyboard-key-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
733
+ }
734
+ [data-theme="dark"] .keyboard-key,
735
+ .keyboard-theme-dark .keyboard-key {
736
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
737
+ }
738
+ /* 深色车牌键盘特殊样式 */
739
+ [data-theme="dark"] .key-plate-special,
740
+ .keyboard-theme-dark .key-plate-special {
741
+ background-color: #4a3728;
742
+ color: #fcd34d;
743
+ }
744
+ /* ====================
745
+ Green 护眼主题
746
+ ==================== */
747
+ [data-theme="green"],
748
+ .keyboard-theme-green {
749
+ --keyboard-bg: #e8f5e9;
750
+ --keyboard-key-bg: #ffffff;
751
+ --keyboard-key-color: #2e7d32;
752
+ --keyboard-key-active-bg: #c8e6c9;
753
+ --keyboard-key-border: #a5d6a7;
754
+ --keyboard-fn-bg: #c8e6c9;
755
+ --keyboard-fn-color: #388e3c;
756
+ --keyboard-fn-active-bg: #a5d6a7;
757
+ --keyboard-primary-bg: #43a047;
758
+ --keyboard-primary-active-bg: #388e3c;
759
+ --keyboard-primary-color: #ffffff;
760
+ --keyboard-key-radius: 8px;
761
+ }
762
+ /* ====================
763
+ Blue 蓝色主题
764
+ ==================== */
765
+ [data-theme="blue"],
766
+ .keyboard-theme-blue {
767
+ --keyboard-bg: #e3f2fd;
768
+ --keyboard-key-bg: #ffffff;
769
+ --keyboard-key-color: #1565c0;
770
+ --keyboard-key-active-bg: #bbdefb;
771
+ --keyboard-key-border: #90caf9;
772
+ --keyboard-fn-bg: #bbdefb;
773
+ --keyboard-fn-color: #1976d2;
774
+ --keyboard-fn-active-bg: #90caf9;
775
+ --keyboard-primary-bg: #1976d2;
776
+ --keyboard-primary-active-bg: #1565c0;
777
+ --keyboard-primary-color: #ffffff;
778
+ --keyboard-key-radius: 8px;
779
+ }
780
+ /* ====================
781
+ 主题工具类
782
+ ==================== */
783
+ .keyboard-theme-light {
784
+ color-scheme: light;
785
+ }
786
+ .keyboard-theme-dark {
787
+ color-scheme: dark;
788
+ }
789
+ /* 平滑主题切换 */
790
+ .keyboard-popup,
791
+ .virtual-keyboard {
792
+ transition: background-color 0.2s ease;
793
+ }
794
+ .keyboard-key {
795
+ transition: background-color var(--keyboard-transition) ease, transform var(--keyboard-transition) ease;
796
+ }
797
+ /*# sourceMappingURL=src/styles/themes.less.map */