@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
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,37 @@
1
+ /*!
2
+ * ***********************************
3
+ * @composy/keyboard-vue v0.0.1 *
4
+ * Built with rollup *
5
+ * Build time: 2024-08-17 11:42:14 *
6
+ * Build mode: production *
7
+ * Minified: No *
8
+ * ***********************************
9
+ */
10
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
11
+ const require_VirtualKeyboard = require("../components/VirtualKeyboard.cjs");
12
+ const require_KeyboardPopup = require("../components/KeyboardPopup.cjs");
13
+ const require_LicensePlateKeyboard = require("../components/LicensePlateKeyboard.cjs");
14
+ const require_v_keyboard = require("../directives/v-keyboard.cjs");
15
+ //#region src/plugins/engine-plugin.ts
16
+ const KeyboardEnginePlugin = {
17
+ name: "keyboard",
18
+ version: "0.1.0",
19
+ async install(context, options) {
20
+ const prefix = options?.prefix ?? "L";
21
+ const app = context?.framework?.app;
22
+ if (app) {
23
+ app.component(`${prefix}Keyboard`, require_VirtualKeyboard.default);
24
+ app.component(`${prefix}KeyboardPopup`, require_KeyboardPopup.default);
25
+ app.component(`${prefix}LicensePlateKeyboard`, require_LicensePlateKeyboard.default);
26
+ app.directive("keyboard", require_v_keyboard.vKeyboard);
27
+ }
28
+ if (context?.container?.singleton) context.container.singleton("keyboard", {
29
+ name: "keyboard",
30
+ version: "0.1.0"
31
+ });
32
+ }
33
+ };
34
+ //#endregion
35
+ exports.KeyboardEnginePlugin = KeyboardEnginePlugin;
36
+ /*! End of @composy/keyboard-vue | Powered by @composy/builder */
37
+ //# sourceMappingURL=engine-plugin.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-plugin.cjs","names":[],"sources":["../../src/plugins/engine-plugin.ts"],"sourcesContent":["/**\n * 键盘 Engine 插件\n * 适配 @composy/engine-vue 的插件\n * @module plugins/engine-plugin\n */\n\nimport type { App } from 'vue'\nimport { VirtualKeyboard, KeyboardPopup, LicensePlateKeyboard } from '../components'\nimport { vKeyboard } from '../directives/v-keyboard'\n\n/**\n * Engine 插件接口(兼容 @composy/engine-core Plugin)\n */\nexport interface KeyboardEnginePluginOptions {\n /**\n * 组件前缀\n * @default 'L'\n */\n prefix?: string\n}\n\n/**\n * 键盘 Engine 插件\n *\n * 符合 @composy/engine-core Plugin 接口规范\n * 通过 engine.use(KeyboardEnginePlugin) 安装\n *\n * @example\n * ```typescript\n * import { createVueEngine } from '@composy/engine-vue'\n * import { KeyboardEnginePlugin } from '@composy/keyboard-vue'\n *\n * const engine = createVueEngine({\n * plugins: [KeyboardEnginePlugin],\n * })\n * ```\n */\nexport const KeyboardEnginePlugin = {\n name: 'keyboard',\n version: '0.1.0',\n\n async install(context: unknown, options?: KeyboardEnginePluginOptions) {\n const prefix = options?.prefix ?? 'L'\n\n // 获取 Vue 应用实例(从 engine 上下文)\n const app: App | undefined = context?.framework?.app\n\n if (app) {\n // 注册全局组件\n app.component(`${prefix}Keyboard`, VirtualKeyboard)\n app.component(`${prefix}KeyboardPopup`, KeyboardPopup)\n app.component(`${prefix}LicensePlateKeyboard`, LicensePlateKeyboard)\n\n // 注册指令\n app.directive('keyboard', vKeyboard)\n }\n\n // 注册到服务容器(如果有)\n if (context?.container?.singleton) {\n context.container.singleton('keyboard', {\n name: 'keyboard',\n version: '0.1.0',\n })\n }\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqCO,MAAM,uBAAuB;CAClC,MAAM;CACN,SAAS;CAET,MAAM,QAAQ,SAAkB,SAAuC;EACrE,MAAM,SAAS,SAAS,UAAU;EAGlC,MAAM,MAAuB,SAAS,WAAW;EAEjD,IAAI,KAAK;GAEP,IAAI,UAAU,GAAG,OAAM,WAAY,wBAAA,OAAe;GAClD,IAAI,UAAU,GAAG,OAAM,gBAAiB,sBAAA,OAAa;GACrD,IAAI,UAAU,GAAG,OAAM,uBAAwB,6BAAA,OAAoB;GAGnE,IAAI,UAAU,YAAY,mBAAA,SAAS;EACrC;EAGA,IAAI,SAAS,WAAW,WACtB,QAAQ,UAAU,UAAU,YAAY;GACtC,MAAM;GACN,SAAS;EACX,CAAC;CAEL;AACF"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * 键盘 Engine 插件
3
+ * 适配 @composy/engine-vue 的插件
4
+ * @module plugins/engine-plugin
5
+ */
6
+ /**
7
+ * Engine 插件接口(兼容 @composy/engine-core Plugin)
8
+ */
9
+ export interface KeyboardEnginePluginOptions {
10
+ /**
11
+ * 组件前缀
12
+ * @default 'L'
13
+ */
14
+ prefix?: string;
15
+ }
16
+ /**
17
+ * 键盘 Engine 插件
18
+ *
19
+ * 符合 @composy/engine-core Plugin 接口规范
20
+ * 通过 engine.use(KeyboardEnginePlugin) 安装
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * import { createVueEngine } from '@composy/engine-vue'
25
+ * import { KeyboardEnginePlugin } from '@composy/keyboard-vue'
26
+ *
27
+ * const engine = createVueEngine({
28
+ * plugins: [KeyboardEnginePlugin],
29
+ * })
30
+ * ```
31
+ */
32
+ export declare const KeyboardEnginePlugin: {
33
+ name: string;
34
+ version: string;
35
+ install(context: unknown, options?: KeyboardEnginePluginOptions): Promise<void>;
36
+ };
37
+ //# sourceMappingURL=engine-plugin.d.ts.map
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * ***********************************
3
+ * @composy/keyboard-vue v0.0.1 *
4
+ * Built with rollup *
5
+ * Build time: 2024-08-17 11:42:14 *
6
+ * Build mode: production *
7
+ * Minified: No *
8
+ * ***********************************
9
+ */
10
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
11
+ const require_engine_plugin = require("./engine-plugin.cjs");
12
+ exports.KeyboardEnginePlugin = require_engine_plugin.KeyboardEnginePlugin;
13
+ /*! End of @composy/keyboard-vue | Powered by @composy/builder */
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 插件导出
3
+ * @module plugins
4
+ */
5
+ export * from './engine-plugin';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=src/style/index.less.map */
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -0,0 +1,229 @@
1
+ /**
2
+ * LDesign Keyboard 样式
3
+ * @module styles
4
+ */
5
+ /* 核心样式 */
6
+ @import 'keyboard.css';
7
+ /* 主题样式 */
8
+ @import 'themes.css';
9
+ /* 深色主题 */
10
+ .dark,
11
+ [data-theme="dark"] {
12
+ --keyboard-bg: #374151;
13
+ --keyboard-key-bg: #4b5563;
14
+ --keyboard-key-color: #f9fafb;
15
+ --keyboard-key-active-bg: #6b7280;
16
+ --keyboard-fn-key-bg: #1f2937;
17
+ --keyboard-fn-key-color: #f9fafb;
18
+ --keyboard-fn-key-active-bg: #111827;
19
+ --keyboard-primary-bg: #2563eb;
20
+ --keyboard-primary-active-bg: #1d4ed8;
21
+ }
22
+ /* iOS 风格主题 */
23
+ .keyboard-theme-ios {
24
+ --keyboard-bg: #d1d5db;
25
+ --keyboard-key-bg: #ffffff;
26
+ --keyboard-key-color: #000000;
27
+ --keyboard-key-active-bg: #c4c7cc;
28
+ --keyboard-fn-key-bg: #adb3bc;
29
+ --keyboard-fn-key-color: #000000;
30
+ --keyboard-fn-key-active-bg: #8e9399;
31
+ --keyboard-primary-bg: #007aff;
32
+ --keyboard-primary-active-bg: #0062cc;
33
+ --keyboard-key-radius: 5px;
34
+ }
35
+ /* Android 风格主题 */
36
+ .keyboard-theme-android {
37
+ --keyboard-bg: #263238;
38
+ --keyboard-key-bg: #37474f;
39
+ --keyboard-key-color: #ffffff;
40
+ --keyboard-key-active-bg: #455a64;
41
+ --keyboard-fn-key-bg: #455a64;
42
+ --keyboard-fn-key-color: #90a4ae;
43
+ --keyboard-fn-key-active-bg: #546e7a;
44
+ --keyboard-primary-bg: #4285f4;
45
+ --keyboard-primary-active-bg: #3367d6;
46
+ --keyboard-key-radius: 4px;
47
+ }
48
+ /* 基础重置 */
49
+ .virtual-keyboard,
50
+ .virtual-keyboard * {
51
+ box-sizing: border-box;
52
+ }
53
+ .virtual-keyboard {
54
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
55
+ -webkit-font-smoothing: antialiased;
56
+ -moz-osx-font-smoothing: grayscale;
57
+ }
58
+ /* 禁止选中 */
59
+ .virtual-keyboard,
60
+ .keyboard-popup {
61
+ -webkit-touch-callout: none;
62
+ -webkit-user-select: none;
63
+ -moz-user-select: none;
64
+ user-select: none;
65
+ }
66
+ /* 禁止 iOS 点击高亮 */
67
+ .keyboard-key {
68
+ -webkit-tap-highlight-color: transparent;
69
+ }
70
+ /* 移动端优化 */
71
+ @media (max-width: 768px) {
72
+ :root {
73
+ --keyboard-key-height: 46px;
74
+ --keyboard-font-size: 18px;
75
+ }
76
+ .virtual-keyboard {
77
+ padding: 6px 2px;
78
+ }
79
+ .keyboard-key {
80
+ margin: 3px;
81
+ }
82
+ }
83
+ /* 横屏优化 */
84
+ @media (orientation: landscape) and (max-height: 500px) {
85
+ :root {
86
+ --keyboard-key-height: 36px;
87
+ --keyboard-font-size: 14px;
88
+ }
89
+ .virtual-keyboard {
90
+ padding: 4px 2px;
91
+ }
92
+ }
93
+ /* 安全区域适配 */
94
+ @supports (padding-bottom: env(safe-area-inset-bottom)) {
95
+ .keyboard-popup--mobile {
96
+ padding-bottom: calc(8px + env(safe-area-inset-bottom));
97
+ }
98
+ }
99
+ /* =========================
100
+ 数字键盘专用样式
101
+ ========================= */
102
+ .number-keyboard-row {
103
+ display: flex;
104
+ justify-content: center;
105
+ width: 100%;
106
+ }
107
+ .number-keyboard-row .keyboard-key {
108
+ flex: 1;
109
+ max-width: 25%;
110
+ height: 52px;
111
+ font-size: 22px;
112
+ font-weight: 500;
113
+ }
114
+ .number-keyboard-row .key-number {
115
+ background-color: var(--keyboard-key-bg, #fff);
116
+ color: var(--keyboard-key-color, #333);
117
+ }
118
+ .number-keyboard-row .key-side {
119
+ background-color: var(--keyboard-fn-key-bg, #d4d6dc);
120
+ color: var(--keyboard-fn-key-color, #333);
121
+ font-size: 14px;
122
+ }
123
+ .number-keyboard-row .key-side:active {
124
+ background-color: var(--keyboard-fn-key-active-bg, #b8bac0);
125
+ }
126
+ .number-keyboard-row .key-done {
127
+ background-color: var(--keyboard-primary-bg, #007aff);
128
+ color: #fff;
129
+ }
130
+ .number-keyboard-row .key-done:active {
131
+ background-color: var(--keyboard-primary-active-bg, #0062cc);
132
+ }
133
+ .number-keyboard-row .key-decimal,
134
+ .number-keyboard-row .key-double-zero {
135
+ background-color: var(--keyboard-key-bg, #fff);
136
+ font-size: 18px;
137
+ }
138
+ .number-keyboard-row .key-placeholder {
139
+ background-color: transparent;
140
+ box-shadow: none;
141
+ cursor: default;
142
+ }
143
+ .number-keyboard-row .key-placeholder:active {
144
+ transform: none;
145
+ background-color: transparent;
146
+ }
147
+ /* =========================
148
+ PC端专用样式
149
+ ========================= */
150
+ .keyboard-popup--desktop {
151
+ min-width: 320px;
152
+ }
153
+ .keyboard-popup--desktop .keyboard-key {
154
+ height: 40px;
155
+ font-size: 15px;
156
+ border-radius: 5px;
157
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
158
+ }
159
+ .keyboard-popup--desktop .keyboard-key:hover {
160
+ background-color: var(--keyboard-key-active-bg, #e5e7eb);
161
+ }
162
+ .keyboard-popup--desktop .keyboard-key--backspace:hover,
163
+ .keyboard-popup--desktop .keyboard-key--shift:hover,
164
+ .keyboard-popup--desktop .keyboard-key--tab:hover,
165
+ .keyboard-popup--desktop .keyboard-key--clear:hover,
166
+ .keyboard-popup--desktop .keyboard-key--close:hover {
167
+ background-color: var(--keyboard-fn-key-active-bg, #b8bac0);
168
+ }
169
+ .keyboard-popup--desktop .keyboard-key--done:hover,
170
+ .keyboard-popup--desktop .keyboard-key--enter:hover {
171
+ background-color: var(--keyboard-primary-active-bg, #0062cc);
172
+ }
173
+ /* PC端数字键盘 */
174
+ .keyboard-popup--desktop .number-keyboard-row .keyboard-key {
175
+ height: 44px;
176
+ font-size: 18px;
177
+ }
178
+ .keyboard-popup--desktop .number-keyboard-row .key-side {
179
+ font-size: 13px;
180
+ }
181
+ /* =========================
182
+ 移动端专用样式
183
+ ========================= */
184
+ .keyboard-popup--mobile {
185
+ width: 100%;
186
+ }
187
+ .keyboard-popup--mobile .keyboard-key {
188
+ height: 46px;
189
+ font-size: 18px;
190
+ border-radius: 6px;
191
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
192
+ }
193
+ /* 移动端数字键盘 */
194
+ .keyboard-popup--mobile .number-keyboard-row .keyboard-key {
195
+ height: 54px;
196
+ font-size: 24px;
197
+ border-radius: 8px;
198
+ }
199
+ .keyboard-popup--mobile .number-keyboard-row .key-side {
200
+ font-size: 15px;
201
+ }
202
+ /* =========================
203
+ 键盘顶部栅栏(移动端)
204
+ ========================= */
205
+ .keyboard-toolbar {
206
+ display: flex;
207
+ justify-content: space-between;
208
+ align-items: center;
209
+ padding: 8px 16px;
210
+ background-color: var(--keyboard-bg, #d1d5db);
211
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
212
+ }
213
+ .keyboard-toolbar__title {
214
+ font-size: 14px;
215
+ color: var(--keyboard-fn-key-color, #666);
216
+ }
217
+ .keyboard-toolbar__done {
218
+ padding: 6px 16px;
219
+ background: none;
220
+ border: none;
221
+ color: var(--keyboard-primary-bg, #007aff);
222
+ font-size: 15px;
223
+ font-weight: 500;
224
+ cursor: pointer;
225
+ }
226
+ .keyboard-toolbar__done:active {
227
+ opacity: 0.7;
228
+ }
229
+ /*# sourceMappingURL=src/styles/index.less.map */
@@ -0,0 +1,346 @@
1
+ /**
2
+ * LDesign Keyboard - 核心样式
3
+ * 简洁现代的默认主题
4
+ */
5
+ /* ====================
6
+ CSS 变量 - 简洁主题
7
+ ==================== */
8
+ :root {
9
+ /* 键盘背景 */
10
+ --keyboard-bg: #f7f7f7;
11
+ /* 普通按键 */
12
+ --keyboard-key-bg: #ffffff;
13
+ --keyboard-key-color: #333333;
14
+ --keyboard-key-active-bg: #e5e5e5;
15
+ --keyboard-key-border: #e0e0e0;
16
+ /* 功能键 */
17
+ --keyboard-fn-bg: #e8e8e8;
18
+ --keyboard-fn-color: #666666;
19
+ --keyboard-fn-active-bg: #d8d8d8;
20
+ /* 主色调按键 */
21
+ --keyboard-primary-bg: #2563eb;
22
+ --keyboard-primary-active-bg: #1d4ed8;
23
+ --keyboard-primary-color: #ffffff;
24
+ /* 按键尺寸 */
25
+ --keyboard-key-height: 48px;
26
+ --keyboard-key-radius: 8px;
27
+ --keyboard-key-gap: 6px;
28
+ /* 字体 */
29
+ --keyboard-font-size: 20px;
30
+ --keyboard-fn-font-size: 14px;
31
+ /* 动画 */
32
+ --keyboard-transition: 80ms ease-out;
33
+ }
34
+ /* ====================
35
+ 基础重置
36
+ ==================== */
37
+ .virtual-keyboard,
38
+ .virtual-keyboard *,
39
+ .keyboard-popup,
40
+ .keyboard-popup * {
41
+ box-sizing: border-box;
42
+ margin: 0;
43
+ padding: 0;
44
+ }
45
+ .virtual-keyboard {
46
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
47
+ -webkit-font-smoothing: antialiased;
48
+ -moz-osx-font-smoothing: grayscale;
49
+ -webkit-touch-callout: none;
50
+ -webkit-user-select: none;
51
+ -moz-user-select: none;
52
+ user-select: none;
53
+ }
54
+ /* ====================
55
+ 键盘容器
56
+ ==================== */
57
+ .virtual-keyboard {
58
+ display: flex;
59
+ flex-direction: column;
60
+ padding: 8px;
61
+ background-color: var(--keyboard-bg);
62
+ width: 100%;
63
+ }
64
+ .virtual-keyboard__row {
65
+ display: flex;
66
+ justify-content: center;
67
+ width: 100%;
68
+ gap: var(--keyboard-key-gap);
69
+ margin-bottom: var(--keyboard-key-gap);
70
+ }
71
+ .virtual-keyboard__row:last-child {
72
+ margin-bottom: 0;
73
+ }
74
+ /* ====================
75
+ 按键基础样式
76
+ ==================== */
77
+ .keyboard-key {
78
+ display: inline-flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ flex: 1;
82
+ height: var(--keyboard-key-height);
83
+ min-width: 0;
84
+ padding: 0 4px;
85
+ border: none;
86
+ border-radius: var(--keyboard-key-radius);
87
+ background-color: var(--keyboard-key-bg);
88
+ color: var(--keyboard-key-color);
89
+ font-size: var(--keyboard-font-size);
90
+ font-weight: 500;
91
+ cursor: pointer;
92
+ touch-action: manipulation;
93
+ transition: background-color var(--keyboard-transition), transform var(--keyboard-transition);
94
+ -webkit-tap-highlight-color: transparent;
95
+ box-shadow: 0 1px 0 var(--keyboard-key-border);
96
+ }
97
+ .keyboard-key:active {
98
+ background-color: var(--keyboard-key-active-bg);
99
+ transform: scale(0.98);
100
+ }
101
+ .keyboard-key--disabled {
102
+ opacity: 0;
103
+ cursor: default;
104
+ pointer-events: none;
105
+ }
106
+ /* ====================
107
+ 功能键样式
108
+ ==================== */
109
+ .keyboard-key--backspace,
110
+ .keyboard-key--shift,
111
+ .keyboard-key--tab,
112
+ .keyboard-key--clear,
113
+ .keyboard-key--close {
114
+ background-color: var(--keyboard-fn-bg);
115
+ color: var(--keyboard-fn-color);
116
+ font-size: var(--keyboard-fn-font-size);
117
+ font-weight: 400;
118
+ box-shadow: 0 1px 0 var(--keyboard-key-border);
119
+ }
120
+ .keyboard-key--backspace:active,
121
+ .keyboard-key--shift:active,
122
+ .keyboard-key--tab:active,
123
+ .keyboard-key--clear:active,
124
+ .keyboard-key--close:active {
125
+ background-color: var(--keyboard-fn-active-bg);
126
+ }
127
+ /* Shift 激活状态 */
128
+ .keyboard-key--shift.keyboard-key--active {
129
+ background-color: var(--keyboard-primary-bg);
130
+ color: var(--keyboard-primary-color);
131
+ }
132
+ /* ====================
133
+ 主色按键(完成/确认)
134
+ ==================== */
135
+ .keyboard-key--done,
136
+ .keyboard-key--enter {
137
+ background-color: var(--keyboard-primary-bg);
138
+ color: var(--keyboard-primary-color);
139
+ font-size: var(--keyboard-fn-font-size);
140
+ font-weight: 500;
141
+ box-shadow: none;
142
+ }
143
+ .keyboard-key--done:active,
144
+ .keyboard-key--enter:active {
145
+ background-color: var(--keyboard-primary-active-bg);
146
+ }
147
+ /* ====================
148
+ 空格键
149
+ ==================== */
150
+ .keyboard-key--space {
151
+ flex: 4;
152
+ }
153
+ /* ====================
154
+ 占位键(透明)
155
+ ==================== */
156
+ .key-placeholder {
157
+ background-color: transparent !important;
158
+ box-shadow: none !important;
159
+ cursor: default;
160
+ pointer-events: none;
161
+ }
162
+ /* ====================
163
+ 数字键盘通用样式
164
+ ==================== */
165
+ .numpad-row {
166
+ display: flex;
167
+ gap: var(--keyboard-key-gap);
168
+ width: 100%;
169
+ }
170
+ .numpad-row .keyboard-key {
171
+ flex: 1;
172
+ height: 54px;
173
+ font-size: 24px;
174
+ font-weight: 500;
175
+ }
176
+ /* 数字键 */
177
+ .key-num {
178
+ background-color: var(--keyboard-key-bg);
179
+ color: var(--keyboard-key-color);
180
+ }
181
+ /* 功能键 */
182
+ .key-numpad-fn {
183
+ background-color: var(--keyboard-fn-bg);
184
+ color: var(--keyboard-fn-color);
185
+ font-size: 14px;
186
+ font-weight: 400;
187
+ }
188
+ /* 完成键 */
189
+ .key-numpad-done {
190
+ background-color: var(--keyboard-primary-bg);
191
+ color: var(--keyboard-primary-color);
192
+ font-size: 16px;
193
+ font-weight: 500;
194
+ box-shadow: none;
195
+ }
196
+ .key-numpad-done:active {
197
+ background-color: var(--keyboard-primary-active-bg);
198
+ }
199
+ /* ====================
200
+ 车牌键盘样式
201
+ ==================== */
202
+ .virtual-keyboard:has(.plate-keyboard-row) {
203
+ min-width: 340px;
204
+ }
205
+ .plate-keyboard-row {
206
+ display: flex;
207
+ gap: 3px;
208
+ width: 100%;
209
+ flex-wrap: nowrap;
210
+ }
211
+ .plate-keyboard-row .keyboard-key {
212
+ flex: 1 1 0;
213
+ height: 42px;
214
+ min-width: 28px;
215
+ max-width: none;
216
+ padding: 0 2px;
217
+ font-size: 15px;
218
+ font-weight: 500;
219
+ border-radius: 5px;
220
+ }
221
+ .key-plate-province,
222
+ .key-plate-letter,
223
+ .key-plate-number {
224
+ background-color: var(--keyboard-key-bg);
225
+ }
226
+ .key-plate-fn {
227
+ background-color: var(--keyboard-fn-bg);
228
+ font-size: 12px;
229
+ flex: 1.2 1 0 !important;
230
+ }
231
+ .key-plate-done {
232
+ background-color: var(--keyboard-primary-bg);
233
+ color: var(--keyboard-primary-color);
234
+ font-size: 13px;
235
+ box-shadow: none;
236
+ flex: 1.5 1 0 !important;
237
+ }
238
+ .key-plate-switch {
239
+ background-color: var(--keyboard-fn-bg);
240
+ font-size: 12px;
241
+ flex: 1.3 1 0 !important;
242
+ }
243
+ .key-plate-special {
244
+ background-color: #fef3c7;
245
+ color: #92400e;
246
+ }
247
+ /* ====================
248
+ 弹出层样式
249
+ ==================== */
250
+ .keyboard-popup {
251
+ position: fixed;
252
+ z-index: 1000;
253
+ background-color: var(--keyboard-bg);
254
+ overflow: hidden;
255
+ }
256
+ .keyboard-popup--desktop {
257
+ border-radius: 12px;
258
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
259
+ min-width: 300px;
260
+ }
261
+ .keyboard-popup--mobile {
262
+ position: fixed;
263
+ left: 0;
264
+ right: 0;
265
+ bottom: 0;
266
+ border-radius: 0;
267
+ border-top-left-radius: 12px;
268
+ border-top-right-radius: 12px;
269
+ box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
270
+ }
271
+ /* 安全区域 */
272
+ @supports (padding-bottom: env(safe-area-inset-bottom)) {
273
+ .keyboard-popup--mobile {
274
+ padding-bottom: env(safe-area-inset-bottom);
275
+ }
276
+ }
277
+ /* ====================
278
+ 遮罩层
279
+ ==================== */
280
+ .keyboard-mask {
281
+ position: fixed;
282
+ inset: 0;
283
+ background-color: rgba(0, 0, 0, 0.3);
284
+ z-index: 999;
285
+ }
286
+ /* ====================
287
+ 动画
288
+ ==================== */
289
+ .keyboard-mask-enter-active,
290
+ .keyboard-mask-leave-active {
291
+ transition: opacity 0.2s ease;
292
+ }
293
+ .keyboard-mask-enter-from,
294
+ .keyboard-mask-leave-to {
295
+ opacity: 0;
296
+ }
297
+ .keyboard-fade-enter-active,
298
+ .keyboard-fade-leave-active {
299
+ transition: opacity 0.15s ease, transform 0.15s ease;
300
+ }
301
+ .keyboard-fade-enter-from,
302
+ .keyboard-fade-leave-to {
303
+ opacity: 0;
304
+ transform: translateY(-4px) scale(0.98);
305
+ }
306
+ .keyboard-slide-enter-active,
307
+ .keyboard-slide-leave-active {
308
+ transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
309
+ }
310
+ .keyboard-slide-enter-from,
311
+ .keyboard-slide-leave-to {
312
+ transform: translateY(100%);
313
+ }
314
+ /* ====================
315
+ 移动端适配
316
+ ==================== */
317
+ @media (max-width: 768px) {
318
+ .virtual-keyboard {
319
+ padding: 6px;
320
+ }
321
+ .keyboard-key {
322
+ height: 44px;
323
+ }
324
+ .numpad-row .keyboard-key {
325
+ height: 52px;
326
+ font-size: 22px;
327
+ }
328
+ .plate-keyboard-row .keyboard-key {
329
+ height: 40px;
330
+ font-size: 15px;
331
+ }
332
+ }
333
+ /* ====================
334
+ 横屏适配
335
+ ==================== */
336
+ @media (orientation: landscape) and (max-height: 500px) {
337
+ .keyboard-key {
338
+ height: 36px;
339
+ font-size: 16px;
340
+ }
341
+ .numpad-row .keyboard-key {
342
+ height: 42px;
343
+ font-size: 18px;
344
+ }
345
+ }
346
+ /*# sourceMappingURL=src/styles/keyboard.less.map */