@zh-keyboard/vue 1.1.1 → 2.0.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.
package/LICENSE CHANGED
@@ -1,190 +1,190 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- Copyright 2025 dusionlike
179
-
180
- Licensed under the Apache License, Version 2.0 (the "License");
181
- you may not use this file except in compliance with the License.
182
- You may obtain a copy of the License at
183
-
184
- http://www.apache.org/licenses/LICENSE-2.0
185
-
186
- Unless required by applicable law or agreed to in writing, software
187
- distributed under the License is distributed on an "AS IS" BASIS,
188
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
- See the License for the specific language governing permissions and
190
- limitations under the License.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2025 dusionlike
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md CHANGED
@@ -32,6 +32,9 @@ pnpm add @zh-keyboard/vue
32
32
  | defaultMode | 'en' \| 'zh' \| 'hand' \| 'num' | 'en' | 默认的键盘模式 |
33
33
  | enableHandwriting| boolean | false | 是否启用手写输入 |
34
34
  | position | 'static' \| 'float' \| 'bottom' | 'static' | 键盘定位模式 |
35
+ | floatMarginTop | number | 10 | 浮动模式下键盘与输入框的距离 |
36
+ | disableWhenNoFocus| boolean | true | 当没有input获得焦点时是否禁用键盘 |
37
+ | requireInputmode| boolean | false | 是否只对带有 data-inputmode 属性的 input 弹出键盘 |
35
38
  | numKeys | string[][] | - | 数字键盘的行配置 |
36
39
 
37
40
  ### 事件
@@ -57,7 +60,8 @@ setKeyboardConfig({
57
60
  ### 基础用法
58
61
 
59
62
  - 为了防止移动端设备弹出系统默认的键盘,建议在输入框上设置 `inputmode="none"` 属性。
60
- - 此外,可以通过在输入框上设置 `data-inputmode` 属性来指定组件默认打开的键盘类型 (可选值为 `'en'`, `'zh'`, `'hand'`, `'num'`),具体键盘模式的说明请参考 `defaultMode` 属性。
63
+ - 可以通过在输入框上设置 `data-inputmode` 属性来指定组件默认打开的键盘类型 (可选值为 `'en'`, `'zh'`, `'hand'`, `'num'`),具体键盘模式的说明请参考 `defaultMode` 属性。
64
+ - 设置 `:require-inputmode="true"` 可以让键盘**只**在带有 `data-inputmode` 属性的 input 上弹出,适用于需要精确控制哪些输入框使用虚拟键盘的场景。
61
65
 
62
66
  ```vue
63
67
  <script setup>
@@ -96,28 +100,45 @@ const inputText = ref('')
96
100
  拼音输入功能需要初始化拼音引擎。推荐使用基于 RIME WASM 的拼音引擎:
97
101
 
98
102
  ```typescript
99
- import { createRimePinyinEngine } from '@zh-keyboard/pinyin'
103
+ import { RimePinyinEngine } from '@zh-keyboard/pinyin'
100
104
  import { registerPinyinEngine } from '@zh-keyboard/vue'
101
105
 
102
106
  // 注册 RIME 拼音引擎
103
107
  registerPinyinEngine(new RimePinyinEngine({
104
- wasmDir: '/data',
108
+ wasmDir: '/data', // rime-api.js/wasm 所在路径
109
+ dictVersion: '1.0.0', // 词库版本号(可选),版本一致时跳过下载直接使用
110
+ simplified: true, // 默认使用简体中文(可选,默认 true)
105
111
  }))
106
112
  ```
107
113
 
108
- worker写法参考 `examples`。
114
+ ### 引擎加载与就绪
109
115
 
110
- ### WASM 文件部署
116
+ `RimePinyinEngine` 在构造时自动开始加载,无需手动调用 `initialize()`。UI 层可通过 `whenReady()` 方法等待引擎就绪:
111
117
 
112
- 需要将以下文件发布到 `public/data/` 目录:
118
+ ```typescript
119
+ const engine = new RimePinyinEngine({ wasmDir: '/data' })
120
+ await engine.whenReady() // 等待加载完成
121
+ ```
113
122
 
114
- - `rime-api.wasm` - RIME 引擎本体
115
- - `default.yaml` - 默认配置
116
- - `luna_pinyin.schema.yaml` - 拼音方案
117
- - `luna_pinyin.table.bin` 、`luna_pinyin.prism.bin` 、`luna_pinyin.reverse.bin` - 词典文件
123
+ `CandidateBar` 组件内部已集成 loading 状态,引擎加载期间会显示 **"加载拼音引擎中…"** 提示。
118
124
 
119
- 这些文件来自 `@zh-keyboard/pinyin` 包的 `data/` 目录。
120
- ```
125
+ ### WASM 及词库文件部署
126
+
127
+ 需要将以下文件发布到 `public/data/` 目录(`wasmDir` 对应 `/data`):
128
+
129
+ - `rime-api.js` / `rime-api.wasm` / `rime-api.data` — RIME WASM 引擎
130
+ - `source/default.yaml` — 默认配置
131
+ - `source/luna_pinyin.schema.yaml` — 拼音方案
132
+ - `source/luna_pinyin.dict.yaml` — 词典
133
+ - `source/symbols.yaml` — 符号表
134
+ - `source/essay.txt` — 语料
135
+
136
+ 这些文件来自 `@zh-keyboard/pinyin` 包的 `data/` 目录。引擎首次加载时会自动从 `source/` 编译词库并缓存到 IndexedDB,后续启动直接使用缓存,无需重新编译。
137
+
138
+ > 若 `dictVersion` 有变更,引擎会自动检测版本不一致并重新下载编译;
139
+ > 若版本一致则直接加载 IndexedDB 缓存,实现秒级启动。
140
+
141
+ worker 写法参考 `examples`。
121
142
 
122
143
  ## 输入模式
123
144
 
@@ -44,6 +44,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
44
44
  numKeys: {
45
45
  type: () => string[][];
46
46
  };
47
+ /**
48
+ * 是否要求 input 元素必须带有 data-inputmode 属性才弹出键盘
49
+ * @default false
50
+ */
51
+ requireInputmode: {
52
+ type: BooleanConstructor;
53
+ default: () => boolean;
54
+ };
47
55
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
48
56
  key: (payload: KeyEvent) => any;
49
57
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
@@ -91,6 +99,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
91
99
  numKeys: {
92
100
  type: () => string[][];
93
101
  };
102
+ /**
103
+ * 是否要求 input 元素必须带有 data-inputmode 属性才弹出键盘
104
+ * @default false
105
+ */
106
+ requireInputmode: {
107
+ type: BooleanConstructor;
108
+ default: () => boolean;
109
+ };
94
110
  }>> & Readonly<{
95
111
  onKey?: ((payload: KeyEvent) => any) | undefined;
96
112
  }>, {
@@ -99,6 +115,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
99
115
  position: "static" | "float" | "bottom";
100
116
  floatMarginTop: number;
101
117
  disableWhenNoFocus: boolean;
118
+ requireInputmode: boolean;
102
119
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
103
120
  keyboardRef: HTMLDivElement;
104
121
  }, HTMLDivElement>;
package/dist/style.css CHANGED
@@ -1 +1,2 @@
1
- @charset "UTF-8";.zhk-candidate-list{flex:1;min-width:0;display:flex;overflow-x:auto;gap:var(--gap);scroll-behavior:smooth;scrollbar-width:none;-ms-overflow-style:none}.zhk-candidate-list::-webkit-scrollbar{display:none}.zhk-candidate-list__item{font-size:var(--candidate-font-size);min-width:var(--candidate-font-size);padding:0 calc(var(--candidate-font-size) * .35);display:flex;align-items:center;justify-content:center;background-color:transparent;border:none;color:var(--key-text-color, #333333);cursor:pointer;white-space:nowrap;flex-shrink:0;transition:all .1s ease;border-radius:4px}.zhk-candidate-list__item:first-child{color:var(--primary-color, #0076f5);font-weight:500}.zhk-candidate-list__item:hover{background-color:#0000000d}.handwriting-input{display:flex;flex-direction:column;height:100%;background:var(--background-color, #f5f5f5);padding:var(--gap);gap:var(--gap);box-sizing:border-box}.handwriting-input .handwriting-content{flex:7;display:flex;flex-direction:row;align-items:flex-start;justify-content:center;flex-wrap:nowrap;overflow:hidden;gap:var(--gap)}.handwriting-input .handwriting-canvas-container{flex:4;height:100%;display:flex;align-items:center;justify-content:center;background:#fff;font-size:0}.handwriting-input .handwriting-canvas-container .handwriting-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;padding:calc(var(--gap) * 2);box-sizing:border-box}.handwriting-input .handwriting-canvas-container .handwriting-loading .loading-text{font-size:16px;color:var(--text-color, #333);margin-bottom:calc(var(--gap) * 2);text-align:center}.handwriting-input .handwriting-canvas-container .handwriting-loading .progress-bar{width:80%;height:8px;background-color:var(--border-color, #dcdcdc);border-radius:4px;overflow:hidden;margin-bottom:var(--gap)}.handwriting-input .handwriting-canvas-container .handwriting-loading .progress-bar .progress-fill{height:100%;background-color:var(--primary-color, #007bff);border-radius:4px;transition:width .3s ease}.handwriting-input .handwriting-canvas-container .handwriting-loading .progress-text{font-size:14px;color:var(--text-color, #666);font-weight:500}.handwriting-input .handwriting-canvas{touch-action:none;width:100%;height:100%;display:block}.handwriting-input .handwriting-buttons{flex:1;display:flex;flex-direction:column;justify-content:space-between;gap:var(--gap);max-width:calc(var(--keyboard-height) / 4);height:100%}.handwriting-input .handwriting-btn{flex:1;padding:var(--gap);border:1px solid var(--border-color, #d1d5da);border-radius:var(--key-border-radius, 6px);background-color:var(--function-key-color, #e4e7ea);box-shadow:var(--key-shadow, 0 1px 2px rgba(0, 0, 0, .1));cursor:pointer;width:100%;display:flex;align-items:center;justify-content:center;white-space:nowrap;font-size:var(--key-font-size);font-weight:500;color:#555;transition:all .12s ease;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:manipulation}.handwriting-input .handwriting-btn:hover{filter:brightness(98%)}.handwriting-input .handwriting-btn:active{background-color:#cdd3d8;transform:translateY(1px);box-shadow:var(--key-active-shadow, 0 0px 1px rgba(0, 0, 0, .05))}.handwriting-input .handwriting-btn--function img{width:var(--key-icon-size);height:var(--key-icon-size)}.zhk-selection{position:absolute;top:0;left:0;width:100%;height:100%;background:#f5f5f5;z-index:2;display:flex;flex-wrap:nowrap;align-items:flex-start;justify-content:center;padding:var(--gap);gap:var(--gap);box-sizing:border-box}.zhk-selection__list{flex:5;min-width:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(calc(var(--keyboard-height) / 7),1fr));background-color:var(--key-background-color, #ffffff);border-radius:8px;box-shadow:0 1px 4px #0000000d;max-height:100%;overflow-y:auto;overflow-x:hidden}.zhk-selection__list::-webkit-scrollbar{width:4px}.zhk-selection__list::-webkit-scrollbar-thumb{background-color:var(--border-color, #d1d5da);border-radius:2px}.zhk-selection__list::-webkit-scrollbar-track{background-color:transparent}.zhk-selection__text{font-size:var(--candidate-font-size);padding:12px 8px;display:inline-flex;justify-content:center;align-items:center;border-bottom:1px solid var(--border-color, #f0f0f0);border-right:1px solid var(--border-color, #f0f0f0);color:var(--key-text-color, #333333);cursor:pointer;transition:background-color .12s ease}.zhk-selection__text:hover{background-color:#f5f8ff;color:var(--primary-color, #0076f5);z-index:1}.zhk-selection__text--span-2{grid-column:span 2}.zhk-selection__text--span-3{grid-column:span 3}.zhk-selection__func{flex:1;display:flex;justify-content:flex-end}.zhk-selection__func-btn{width:100%;font-size:var(--key-font-size);font-weight:500;border:1px solid var(--border-color, #d1d5da);border-radius:var(--key-border-radius, 6px);background-color:var(--function-key-color, #e4e7ea);padding:12px 0;cursor:pointer;color:#555;transition:all .12s ease;white-space:nowrap;box-shadow:0 1px 2px #0000000d}.zhk-selection__func-btn:hover{background-color:#dbdfe3}.zhk-selection__func-btn:active{transform:translateY(1px);box-shadow:none}.zhk-candidate{width:100%;height:100%;display:flex;align-items:center;box-sizing:border-box}.zhk-candidate__container{display:flex;flex-direction:column;flex:1;min-width:0;width:100%;height:100%;background-color:var(--background-color, #f7f8f9);padding:0 8px}.zhk-candidate__pinyin{flex:1;font-size:calc(var(--key-font-size) * .9);color:var(--primary-color, #0076f5);display:flex;align-items:center;padding-left:4px;letter-spacing:.5px;box-sizing:border-box}.zhk-candidate__bottom-container{flex:3;display:flex;align-items:center;gap:var(--gap);width:100%}.zhk-candidate__more{cursor:pointer;display:flex;align-items:center;width:max(36px,var(--keyboard-height) / 8);background:none;border:none}.zhk-base{height:100%;display:flex;flex-direction:column;padding:var(--gap);box-sizing:border-box}.zhk-base__row{flex:1;min-height:0;display:flex;justify-content:center;gap:var(--gap);margin-bottom:4px}.zhk-base__row:last-child{margin-bottom:0}.zhk-base__key{width:var(--key-width);flex:none;min-height:42px;border:1px solid var(--border-color, #d1d5da);border-radius:var(--key-border-radius, 6px);background-color:var(--key-background-color, #fff);box-shadow:var(--key-shadow, 0 1px 2px rgba(0, 0, 0, .1));color:var(--key-text-color, #333);font-size:var(--key-font-size);cursor:pointer;transition:all .12s ease;padding:0 5px;display:flex;align-items:center;justify-content:center;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:manipulation}.zhk-base__key:hover{filter:brightness(98%);border-color:#c3c8cf}.zhk-base__key:active{background-color:#ebebeb;box-shadow:var(--key-active-shadow, 0 0px 1px rgba(0, 0, 0, .05));transform:translateY(1px)}.zhk-base__key--function{flex:none;width:var(--key-width);min-width:var(--key-min-width-function);background-color:var(--function-key-color, #e4e7ea);font-weight:500;color:#555}.zhk-base__key--function:active{background-color:#cdd3d8}.zhk-base__key--shift,.zhk-base__key--delete{flex:1;width:auto}.zhk-base__key--space{flex:1;width:auto;min-width:20px}.zhk-base__key--active{background-color:var(--primary-color, #0076f5);border-color:var(--primary-color, #0076f5);color:#fff}.zhk-base__key--active:hover{filter:brightness(110%)}.zhk-base__key--active:active{background-color:#005dc2}.zhk-base__key--active .zhk-base__key-icon{filter:brightness(0) invert(1)}.zhk-base__key--disabled{background-color:var(--disabled-key-color, #f5f5f5);border-color:var(--disabled-key-border-color, #e0e0e0);color:var(--disabled-key-text-color, #bdbdbd);cursor:not-allowed}.zhk-base__key--disabled .zhk-base__key-icon{filter:brightness(.7)}.zhk-base__key-icon{width:var(--key-icon-size);height:var(--key-icon-size);vertical-align:middle;display:inline-block}.zhk-base__toggle-main{font-size:max(14px,var(--keyboard-height) / 30)}.zhk-base__toggle-sub{font-size:max(12px,var(--keyboard-height) / 40);color:var(--toggle-sub-color, #888);margin-left:2px}.num-keyboard{height:100%;display:flex;flex-direction:column;padding:8px;box-sizing:border-box}.num-keyboard__container{display:flex;height:100%;gap:8px}.num-keyboard__left{flex:3;display:flex;flex-direction:column}.num-keyboard__right{flex:1;display:flex;flex-direction:column;justify-content:space-between;gap:6px}.num-keyboard__rows{display:flex;flex-direction:column;flex:1;gap:var(--gap)}.num-keyboard__row{display:flex;flex:1;gap:var(--gap)}.num-keyboard__key{flex:1;display:flex;align-items:center;justify-content:center;background-color:var(--key-background-color, #fff);border:1px solid var(--border-color, #d1d5da);border-radius:var(--key-border-radius, 6px);box-shadow:var(--key-shadow, 0 1px 2px rgba(0, 0, 0, .1));font-size:var(--key-font-size);font-weight:500;color:var(--key-text-color, #333);cursor:pointer;transition:all .12s ease}.num-keyboard__key:hover{filter:brightness(98%)}.num-keyboard__key:active{background-color:#ebebeb;box-shadow:var(--key-active-shadow, 0 0px 1px rgba(0, 0, 0, .05));transform:translateY(1px)}.num-keyboard__key--function{height:calc(25% - 6px);background-color:var(--function-key-color, #e4e7ea);font-size:var(--key-font-size);font-weight:500;color:#555}.num-keyboard__key--function:active{background-color:#cdd3d8}.num-keyboard__key--back{font-size:var(--key-font-size);background-color:var(--function-key-color, #e4e7ea)}.num-keyboard__key--back:active{background-color:#cdd3d8}.num-keyboard__key--space{font-size:var(--key-font-size)}.num-keyboard__key-icon{width:var(--key-icon-size);height:var(--key-icon-size)}.symbol-keyboard{--key-size: max(45px, calc(var(--keyboard-height, 300px) / 5));--lang-btn-size: var(--key-size);--gap: max(4px, calc(var(--keyboard-height, 300px) / 75));--function-width: var(--key-size);--symbol-min-size: calc(var(--key-size) * .85);height:100%;display:flex;flex-direction:column;padding:10px;box-sizing:border-box}.symbol-keyboard__content{display:flex;flex:1;gap:var(--gap);height:100%}.symbol-keyboard__functions{display:flex;flex-direction:column;justify-content:space-between;gap:var(--gap);width:var(--function-width)}.symbol-keyboard__lang-selector{display:flex;flex-direction:column;height:calc(var(--lang-btn-size) * 2 + var(--gap))}.symbol-keyboard__lang-btn{padding:10px 0;display:flex;align-items:center;justify-content:center;background-color:var(--key-background-color, #fff);border:1px solid var(--border-color, #d1d5da);font-size:max(12px,var(--key-font-size, 1rem) * .8);cursor:pointer;transition:all .12s ease;margin:0;box-sizing:border-box;width:var(--lang-btn-size);flex:1;flex-shrink:0}.symbol-keyboard__lang-btn:first-child{border-radius:var(--key-border-radius, 6px) var(--key-border-radius, 6px) 0 0}.symbol-keyboard__lang-btn:last-child{margin-top:-1px;border-radius:0 0 var(--key-border-radius, 6px) var(--key-border-radius, 6px)}.symbol-keyboard__lang-btn:hover{filter:brightness(98%)}.symbol-keyboard__lang-btn--active{background-color:var(--primary-color, #0076f5);color:#fff;border-color:var(--primary-color, #0076f5);position:relative;z-index:1}.symbol-keyboard__lang-btn--active:hover{filter:brightness(110%)}.symbol-keyboard__control-group{display:flex;flex-direction:column;gap:calc(var(--gap) + 2px)}.symbol-keyboard__symbols-container{flex:1;width:100%;height:100%;overflow-y:auto;padding-right:5px}.symbol-keyboard__symbols-container::-webkit-scrollbar{width:4px}.symbol-keyboard__symbols-container::-webkit-scrollbar-track{background:#0000000d;border-radius:2px}.symbol-keyboard__symbols-container::-webkit-scrollbar-thumb{background:#00000026;border-radius:2px}.symbol-keyboard__symbols-container::-webkit-scrollbar-thumb:hover{background:#00000040}.symbol-keyboard__symbols-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--symbol-min-size),1fr));gap:var(--gap);width:100%;max-height:100%;padding-bottom:10px}.symbol-keyboard__key{display:flex;align-items:center;justify-content:center;background-color:var(--key-background-color, #fff);border:1px solid var(--border-color, #d1d5da);border-radius:var(--key-border-radius, 6px);box-shadow:var(--key-shadow, 0 1px 2px rgba(0, 0, 0, .1));font-size:max(18px,var(--key-font-size, 1rem));font-weight:400;color:var(--key-text-color, #333);cursor:pointer;transition:all .12s ease;margin:0;box-sizing:border-box;min-width:var(--symbol-min-size);max-width:var(--key-size);width:100%;height:var(--key-size);aspect-ratio:1;flex-shrink:0}.symbol-keyboard__key:hover{filter:brightness(98%)}.symbol-keyboard__key:active{background-color:#ebebeb;box-shadow:var(--key-active-shadow, 0 0px 1px rgba(0, 0, 0, .05));transform:translateY(1px)}.symbol-keyboard__key--function{background-color:var(--function-key-color, #e4e7ea);width:var(--function-width);height:var(--key-size);aspect-ratio:auto;font-weight:500;color:#555}.symbol-keyboard__key--function:active{background-color:#cdd3d8}.symbol-keyboard__key--lock{padding:10px 0;font-size:18px;font-weight:700;display:flex;align-items:center;justify-content:center}.symbol-keyboard__key--lock img{width:24px;height:24px}.symbol-keyboard__key--locked{background-color:var(--primary-color, #0076f5);color:#fff;border-color:var(--primary-color, #0076f5)}.symbol-keyboard__key--locked:hover{filter:brightness(110%)}.symbol-keyboard__key--locked:active{background-color:#005dc2}.symbol-keyboard__key--back{padding:10px 0;font-size:18px;font-weight:700;display:flex}.zhk{--key-font-size: max(1rem, calc(var(--keyboard-height) / 20));--candidate-font-size: max(24px, calc(var(--keyboard-height) / 12));--gap: max(4px, calc(var(--keyboard-height) / 75));--gap: clamp(4px, calc(var(--keyboard-height) / 75), 6px);--key-width: calc((100% - 9 * var(--gap)) / 10);--key-min-width-function: 45px;--key-icon-size: calc(var(--key-font-size) * 1.2);--key-shadow: 0 1px 2px rgba(0, 0, 0, .1);--key-active-shadow: 0 0px 1px rgba(0, 0, 0, .05);position:relative;width:400px;max-width:1080px;height:300px;min-height:300px;overflow:hidden;background-color:#f7f8f9;border-radius:12px;box-shadow:0 8px 30px #0000001a;font-family:PingFang SC,Microsoft YaHei,-apple-system,sans-serif;-webkit-user-select:none;user-select:none}.zhk--disabled{opacity:.7}.zhk--floating{position:fixed;z-index:9999;box-shadow:0 4px 20px #0003}.zhk--bottom{position:fixed;bottom:0;left:0;width:100%;min-width:min(var(--keyboard-height) + 100px,100%);max-width:100%;z-index:9999;border-radius:12px 12px 0 0;box-shadow:0 -2px 10px #0000001a}.zhk__disabled-overlay{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:#f5f5f5cc;z-index:10;border-radius:12px}.zhk__disabled-overlay span{font-size:16px;color:#666;padding:15px 30px;background-color:#e0e0e0;border-radius:5px}
1
+ .zhk-candidate-list{gap:var(--gap);scroll-behavior:smooth;scrollbar-width:none;-ms-overflow-style:none;flex:1;min-width:0;display:flex;overflow-x:auto}.zhk-candidate-list::-webkit-scrollbar{display:none}.zhk-candidate-list__item{font-size:var(--candidate-font-size);min-width:var(--candidate-font-size);padding:0 calc(var(--candidate-font-size) * .35);color:var(--key-text-color,#333);cursor:pointer;white-space:nowrap;background-color:#0000;border:none;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;transition:all .1s;display:flex}.zhk-candidate-list__item:first-child{color:var(--primary-color,#0076f5);font-weight:500}.zhk-candidate-list__item:hover{background-color:#0000000d}.handwriting-input{background:var(--background-color,#f5f5f5);height:100%;padding:var(--gap);gap:var(--gap);box-sizing:border-box;flex-direction:column;display:flex}.handwriting-input .handwriting-content{justify-content:center;align-items:flex-start;gap:var(--gap);flex-flow:row;flex:7;display:flex;overflow:hidden}.handwriting-input .handwriting-canvas-container{background:#fff;flex:4;justify-content:center;align-items:center;height:100%;font-size:0;display:flex}.handwriting-input .handwriting-canvas-container .handwriting-loading{width:100%;height:100%;padding:calc(var(--gap) * 2);box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;display:flex}.handwriting-input .handwriting-canvas-container .handwriting-loading .loading-text{color:var(--text-color,#333);margin-bottom:calc(var(--gap) * 2);text-align:center;font-size:16px}.handwriting-input .handwriting-canvas-container .handwriting-loading .progress-bar{background-color:var(--border-color,#dcdcdc);width:80%;height:8px;margin-bottom:var(--gap);border-radius:4px;overflow:hidden}.handwriting-input .handwriting-canvas-container .handwriting-loading .progress-bar .progress-fill{background-color:var(--primary-color,#007bff);border-radius:4px;height:100%;transition:width .3s}.handwriting-input .handwriting-canvas-container .handwriting-loading .progress-text{color:var(--text-color,#666);font-size:14px;font-weight:500}.handwriting-input .handwriting-canvas{touch-action:none;width:100%;height:100%;display:block}.handwriting-input .handwriting-buttons{justify-content:space-between;gap:var(--gap);max-width:calc(var(--keyboard-height) / 4);flex-direction:column;flex:1;height:100%;display:flex}.handwriting-input .handwriting-btn{padding:var(--gap);border:1px solid var(--border-color,#d1d5da);border-radius:var(--key-border-radius,6px);background-color:var(--function-key-color,#e4e7ea);box-shadow:var(--key-shadow,0 1px 2px #0000001a);cursor:pointer;white-space:nowrap;width:100%;font-size:var(--key-font-size);color:#555;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation;flex:1;justify-content:center;align-items:center;font-weight:500;transition:all .12s;display:flex}.handwriting-input .handwriting-btn:hover{filter:brightness(98%)}.handwriting-input .handwriting-btn:active{box-shadow:var(--key-active-shadow,0 0px 1px #0000000d);background-color:#cdd3d8;transform:translateY(1px)}.handwriting-input .handwriting-btn--function img{width:calc(1em * var(--key-icon-scale,1.15));height:calc(1em * var(--key-icon-scale,1.15));object-fit:contain;flex-shrink:0}.zhk-selection{z-index:2;width:100%;height:100%;padding:var(--gap);justify-content:center;align-items:flex-start;gap:var(--gap);box-sizing:border-box;background:#f5f5f5;flex-wrap:nowrap;display:flex;position:absolute;top:0;left:0}.zhk-selection__list{grid-template-columns:repeat(auto-fit, minmax(calc(var(--keyboard-height) / 7), 1fr));background-color:var(--key-background-color,#fff);border-radius:8px;flex:5;min-width:0;max-height:100%;display:grid;overflow:hidden auto;box-shadow:0 1px 4px #0000000d}.zhk-selection__list::-webkit-scrollbar{width:4px}.zhk-selection__list::-webkit-scrollbar-thumb{background-color:var(--border-color,#d1d5da);border-radius:2px}.zhk-selection__list::-webkit-scrollbar-track{background-color:#0000}.zhk-selection__text{font-size:var(--candidate-font-size);border-bottom:1px solid var(--border-color,#f0f0f0);border-right:1px solid var(--border-color,#f0f0f0);color:var(--key-text-color,#333);cursor:pointer;justify-content:center;align-items:center;padding:12px 8px;transition:background-color .12s;display:inline-flex}.zhk-selection__text:hover{color:var(--primary-color,#0076f5);z-index:1;background-color:#f5f8ff}.zhk-selection__text--span-2{grid-column:span 2}.zhk-selection__text--span-3{grid-column:span 3}.zhk-selection__func{flex:1;justify-content:flex-end;display:flex}.zhk-selection__func-btn{width:100%;font-size:var(--key-font-size);border:1px solid var(--border-color,#d1d5da);border-radius:var(--key-border-radius,6px);background-color:var(--function-key-color,#e4e7ea);cursor:pointer;color:#555;white-space:nowrap;padding:12px 0;font-weight:500;transition:all .12s;box-shadow:0 1px 2px #0000000d}.zhk-selection__func-btn:hover{background-color:#dbdfe3}.zhk-selection__func-btn:active{box-shadow:none;transform:translateY(1px)}.zhk-candidate{box-sizing:border-box;align-items:center;width:100%;height:100%;display:flex}.zhk-candidate__container{background-color:var(--background-color,#f7f8f9);flex-direction:column;flex:1;width:100%;min-width:0;height:100%;padding:0 8px;display:flex}.zhk-candidate__container--loading{justify-content:center;align-items:center}.zhk-candidate__loading-text{font-size:calc(var(--key-font-size) * .8);color:var(--text-color-secondary,#999)}.zhk-candidate__pinyin{font-size:calc(var(--key-font-size) * .9);color:var(--primary-color,#0076f5);letter-spacing:.5px;box-sizing:border-box;flex:1;align-items:center;padding-left:4px;display:flex}.zhk-candidate__bottom-container{align-items:center;gap:var(--gap);flex:3;width:100%;display:flex}.zhk-candidate__more{cursor:pointer;width:max(36px, var(--keyboard-height) / 8);background:0 0;border:none;align-items:center;display:flex}.zhk-base{height:100%;padding:var(--gap);box-sizing:border-box;flex-direction:column;display:flex}.zhk-base__row{justify-content:center;gap:var(--gap);flex:1;min-height:0;margin-bottom:4px;display:flex}.zhk-base__row:last-child{margin-bottom:0}.zhk-base__key{width:var(--key-width);border:1px solid var(--border-color,#d1d5da);border-radius:var(--key-border-radius,6px);background-color:var(--key-background-color,#fff);min-height:42px;box-shadow:var(--key-shadow,0 1px 2px #0000001a);color:var(--key-text-color,#333);font-size:var(--key-font-size);cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation;flex:none;justify-content:center;align-items:center;padding:0 5px;transition:all .12s;display:flex}.zhk-base__key:hover{filter:brightness(98%);border-color:#c3c8cf}.zhk-base__key:active{box-shadow:var(--key-active-shadow,0 0px 1px #0000000d);background-color:#ebebeb;transform:translateY(1px)}.zhk-base__key--function{width:var(--key-width);min-width:var(--key-min-width-function);background-color:var(--function-key-color,#e4e7ea);color:#555;flex:none;font-weight:500}.zhk-base__key--function:active{background-color:#cdd3d8}.zhk-base__key--shift,.zhk-base__key--delete{flex:1;width:auto}.zhk-base__key--space{flex:1;width:auto;min-width:20px}.zhk-base__key--active{background-color:var(--primary-color,#0076f5);border-color:var(--primary-color,#0076f5);color:#fff}.zhk-base__key--active:hover{filter:brightness(110%)}.zhk-base__key--active:active{background-color:#005dc2}.zhk-base__key--active .zhk-base__key-icon{filter:brightness(0)invert()}.zhk-base__key--disabled{background-color:var(--disabled-key-color,#f5f5f5);border-color:var(--disabled-key-border-color,#e0e0e0);color:var(--disabled-key-text-color,#bdbdbd);cursor:not-allowed}.zhk-base__key--disabled .zhk-base__key-icon{filter:brightness(.7)}.zhk-base__key-icon{width:calc(1em * var(--key-icon-scale,1.15));height:calc(1em * var(--key-icon-scale,1.15));vertical-align:middle;object-fit:contain;flex-shrink:0;display:inline-block}.zhk-base__toggle-main{font-size:max(14px, var(--keyboard-height) / 30)}.zhk-base__toggle-sub{font-size:max(12px, var(--keyboard-height) / 40);color:var(--toggle-sub-color,#888);margin-left:2px}.num-keyboard{box-sizing:border-box;flex-direction:column;height:100%;padding:8px;display:flex}.num-keyboard__container{gap:8px;height:100%;display:flex}.num-keyboard__left{flex-direction:column;flex:3;display:flex}.num-keyboard__right{flex-direction:column;flex:1;justify-content:space-between;gap:6px;display:flex}.num-keyboard__rows{gap:var(--gap);flex-direction:column;flex:1;display:flex}.num-keyboard__row{gap:var(--gap);flex:1;display:flex}.num-keyboard__key{background-color:var(--key-background-color,#fff);border:1px solid var(--border-color,#d1d5da);border-radius:var(--key-border-radius,6px);box-shadow:var(--key-shadow,0 1px 2px #0000001a);font-size:calc(var(--key-font-size) * 2);color:var(--key-text-color,#333);cursor:pointer;flex:1;justify-content:center;align-items:center;font-weight:500;transition:all .12s;display:flex}.num-keyboard__key:hover{filter:brightness(98%)}.num-keyboard__key:active{box-shadow:var(--key-active-shadow,0 0px 1px #0000000d);background-color:#ebebeb;transform:translateY(1px)}.num-keyboard__key--function{background-color:var(--function-key-color,#e4e7ea);color:#555;height:calc(25% - 6px);font-weight:500}.num-keyboard__key--function:active{background-color:#cdd3d8}.num-keyboard__key--back{font-size:var(--key-font-size);background-color:var(--function-key-color,#e4e7ea)}.num-keyboard__key--back:active{background-color:#cdd3d8}.num-keyboard__key--space{font-size:var(--key-font-size)}.num-keyboard__key-icon{width:calc(1em * var(--key-icon-scale,1.15));height:calc(1em * var(--key-icon-scale,1.15));object-fit:contain;flex-shrink:0;display:inline-block}.symbol-keyboard{--key-size:max(45px, calc(var(--keyboard-height,300px) / 5));--lang-btn-size:var(--key-size);--gap:max(4px, calc(var(--keyboard-height,300px) / 75));--function-width:var(--key-size);--symbol-min-size:calc(var(--key-size) * .85);box-sizing:border-box;flex-direction:column;height:100%;padding:10px;display:flex}.symbol-keyboard__content{gap:var(--gap);flex:1;height:100%;display:flex}.symbol-keyboard__functions{justify-content:space-between;gap:var(--gap);width:var(--function-width);flex-direction:column;display:flex}.symbol-keyboard__lang-selector{height:calc(var(--lang-btn-size) * 2 + var(--gap));flex-direction:column;display:flex}.symbol-keyboard__lang-btn{background-color:var(--key-background-color,#fff);border:1px solid var(--border-color,#d1d5da);font-size:max(12px, var(--key-font-size,1rem) * .8);cursor:pointer;box-sizing:border-box;width:var(--lang-btn-size);flex:1 0;justify-content:center;align-items:center;margin:0;padding:10px 0;transition:all .12s;display:flex}.symbol-keyboard__lang-btn:first-child{border-radius:var(--key-border-radius,6px) var(--key-border-radius,6px) 0 0}.symbol-keyboard__lang-btn:last-child{border-radius:0 0 var(--key-border-radius,6px) var(--key-border-radius,6px);margin-top:-1px}.symbol-keyboard__lang-btn:hover{filter:brightness(98%)}.symbol-keyboard__lang-btn--active{background-color:var(--primary-color,#0076f5);color:#fff;border-color:var(--primary-color,#0076f5);z-index:1;position:relative}.symbol-keyboard__lang-btn--active:hover{filter:brightness(110%)}.symbol-keyboard__control-group{gap:calc(var(--gap) + 2px);flex-direction:column;display:flex}.symbol-keyboard__symbols-container{flex:1;width:100%;height:100%;padding-right:5px;overflow-y:auto}.symbol-keyboard__symbols-container::-webkit-scrollbar{width:4px}.symbol-keyboard__symbols-container::-webkit-scrollbar-track{background:#0000000d;border-radius:2px}.symbol-keyboard__symbols-container::-webkit-scrollbar-thumb{background:#00000026;border-radius:2px}.symbol-keyboard__symbols-container::-webkit-scrollbar-thumb:hover{background:#00000040}.symbol-keyboard__symbols-grid{grid-template-columns:repeat(auto-fit, minmax(var(--symbol-min-size), 1fr));gap:var(--gap);width:100%;max-height:100%;padding-bottom:10px;display:grid}.symbol-keyboard__key{background-color:var(--key-background-color,#fff);border:1px solid var(--border-color,#d1d5da);border-radius:var(--key-border-radius,6px);box-shadow:var(--key-shadow,0 1px 2px #0000001a);font-size:max(18px, var(--key-font-size,1rem));color:var(--key-text-color,#333);cursor:pointer;box-sizing:border-box;min-width:var(--symbol-min-size);max-width:var(--key-size);width:100%;height:var(--key-size);aspect-ratio:1;flex-shrink:0;justify-content:center;align-items:center;margin:0;font-weight:400;transition:all .12s;display:flex}.symbol-keyboard__key:hover{filter:brightness(98%)}.symbol-keyboard__key:active{box-shadow:var(--key-active-shadow,0 0px 1px #0000000d);background-color:#ebebeb;transform:translateY(1px)}.symbol-keyboard__key--function{background-color:var(--function-key-color,#e4e7ea);width:var(--function-width);height:var(--key-size);aspect-ratio:auto;color:#555;font-weight:500}.symbol-keyboard__key--function:active{background-color:#cdd3d8}.symbol-keyboard__key--lock{justify-content:center;align-items:center;padding:10px 0;font-size:18px;font-weight:700;display:flex}.symbol-keyboard__key--lock img{width:24px;height:24px}.symbol-keyboard__key--locked{background-color:var(--primary-color,#0076f5);color:#fff;border-color:var(--primary-color,#0076f5)}.symbol-keyboard__key--locked:hover{filter:brightness(110%)}.symbol-keyboard__key--locked:active{background-color:#005dc2}.symbol-keyboard__key--back{padding:10px 0;font-size:18px;font-weight:700;display:flex}.zhk{--key-font-size:max(1rem, calc(var(--keyboard-height) / 20));--candidate-font-size:max(24px, calc(var(--keyboard-height) / 12));--gap:clamp(4px, calc(var(--keyboard-height) / 75), 6px);--key-width:calc((100% - 9 * var(--gap)) / 10);--key-min-width-function:45px;--key-icon-size:calc(var(--key-font-size) * 1.2);--key-shadow:0 1px 2px #0000001a;--key-active-shadow:0 0px 1px #0000000d;-webkit-user-select:none;user-select:none;background-color:#f7f8f9;border-radius:12px;width:400px;max-width:1080px;height:300px;min-height:300px;font-family:PingFang SC,Microsoft YaHei,-apple-system,sans-serif;position:relative;overflow:hidden;box-shadow:0 8px 30px #0000001a}.zhk--disabled{opacity:.7}.zhk--floating{z-index:9999;position:fixed;box-shadow:0 4px 20px #0003}.zhk--bottom{width:100%;min-width:min(var(--keyboard-height) + 100px, 100%);z-index:9999;border-radius:12px 12px 0 0;max-width:100%;position:fixed;bottom:0;left:0;box-shadow:0 -2px 10px #0000001a}.zhk__disabled-overlay{z-index:10;background-color:#f5f5f5cc;border-radius:12px;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;top:0;left:0}.zhk__disabled-overlay span{color:#666;background-color:#e0e0e0;border-radius:5px;padding:15px 30px;font-size:16px}
2
+ /*$vite$:1*/