@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.
- package/README.md +46 -0
- package/dist/index.css +797 -0
- package/dist/index.js +1250 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.css +1 -0
- package/dist/index.min.js +1 -0
- package/es/components/KeyboardKey.js +17 -0
- package/es/components/KeyboardKey.js.map +1 -0
- package/es/components/KeyboardKey.vue_vue_type_script_setup_true_lang.js +131 -0
- package/es/components/KeyboardKey.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/es/components/KeyboardPopup.js +17 -0
- package/es/components/KeyboardPopup.js.map +1 -0
- package/es/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.js +164 -0
- package/es/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/es/components/LicensePlateKeyboard.js +17 -0
- package/es/components/LicensePlateKeyboard.js.map +1 -0
- package/es/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.js +97 -0
- package/es/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/es/components/VirtualKeyboard.js +17 -0
- package/es/components/VirtualKeyboard.js.map +1 -0
- package/es/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.js +127 -0
- package/es/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/es/components/index.d.ts +9 -0
- package/es/components/index.d.ts.map +1 -0
- package/es/components/index.js +15 -0
- package/es/composables/index.d.ts +7 -0
- package/es/composables/index.d.ts.map +1 -0
- package/es/composables/index.js +13 -0
- package/es/composables/useKeyboard.d.ts +113 -0
- package/es/composables/useKeyboard.d.ts.map +1 -0
- package/es/composables/useKeyboard.js +75 -0
- package/es/composables/useKeyboard.js.map +1 -0
- package/es/composables/useKeyboardPopup.d.ts +73 -0
- package/es/composables/useKeyboardPopup.d.ts.map +1 -0
- package/es/composables/useKeyboardPopup.js +119 -0
- package/es/composables/useKeyboardPopup.js.map +1 -0
- package/es/directives/index.d.ts +6 -0
- package/es/directives/index.d.ts.map +1 -0
- package/es/directives/index.js +12 -0
- package/es/directives/v-keyboard.d.ts +36 -0
- package/es/directives/v-keyboard.d.ts.map +1 -0
- package/es/directives/v-keyboard.js +65 -0
- package/es/directives/v-keyboard.js.map +1 -0
- package/es/index.d.ts +42 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +34 -0
- package/es/index.js.map +1 -0
- package/es/plugins/engine-plugin.d.ts +37 -0
- package/es/plugins/engine-plugin.d.ts.map +1 -0
- package/es/plugins/engine-plugin.js +37 -0
- package/es/plugins/engine-plugin.js.map +1 -0
- package/es/plugins/index.d.ts +6 -0
- package/es/plugins/index.d.ts.map +1 -0
- package/es/plugins/index.js +12 -0
- package/es/style/css.js +1 -0
- package/es/style/index.js +1 -0
- package/es/style/index.less +1 -0
- package/es/styles/index.less +267 -0
- package/es/styles/keyboard.less +399 -0
- package/es/styles/themes.less +233 -0
- package/lib/components/KeyboardKey.cjs +21 -0
- package/lib/components/KeyboardKey.cjs.map +1 -0
- package/lib/components/KeyboardKey.vue_vue_type_script_setup_true_lang.cjs +131 -0
- package/lib/components/KeyboardKey.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/lib/components/KeyboardPopup.cjs +21 -0
- package/lib/components/KeyboardPopup.cjs.map +1 -0
- package/lib/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.cjs +164 -0
- package/lib/components/KeyboardPopup.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/lib/components/LicensePlateKeyboard.cjs +21 -0
- package/lib/components/LicensePlateKeyboard.cjs.map +1 -0
- package/lib/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.cjs +97 -0
- package/lib/components/LicensePlateKeyboard.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/lib/components/VirtualKeyboard.cjs +21 -0
- package/lib/components/VirtualKeyboard.cjs.map +1 -0
- package/lib/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.cjs +127 -0
- package/lib/components/VirtualKeyboard.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/lib/components/index.cjs +19 -0
- package/lib/components/index.d.ts +9 -0
- package/lib/composables/index.cjs +15 -0
- package/lib/composables/index.d.ts +7 -0
- package/lib/composables/useKeyboard.cjs +76 -0
- package/lib/composables/useKeyboard.cjs.map +1 -0
- package/lib/composables/useKeyboard.d.ts +113 -0
- package/lib/composables/useKeyboardPopup.cjs +120 -0
- package/lib/composables/useKeyboardPopup.cjs.map +1 -0
- package/lib/composables/useKeyboardPopup.d.ts +73 -0
- package/lib/directives/index.cjs +13 -0
- package/lib/directives/index.d.ts +6 -0
- package/lib/directives/v-keyboard.cjs +66 -0
- package/lib/directives/v-keyboard.cjs.map +1 -0
- package/lib/directives/v-keyboard.d.ts +36 -0
- package/lib/index.cjs +537 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.ts +42 -0
- package/lib/package.json +3 -0
- package/lib/plugins/engine-plugin.cjs +37 -0
- package/lib/plugins/engine-plugin.cjs.map +1 -0
- package/lib/plugins/engine-plugin.d.ts +37 -0
- package/lib/plugins/index.cjs +13 -0
- package/lib/plugins/index.d.ts +6 -0
- package/lib/style/css.js +1 -0
- package/lib/style/index.css +2 -0
- package/lib/style/index.js +1 -0
- package/lib/styles/index.css +229 -0
- package/lib/styles/keyboard.css +346 -0
- package/lib/styles/themes.css +213 -0
- package/package.json +141 -0
package/es/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @composy/keyboard-vue\n * LDesign 虚拟键盘 - Vue 3 适配器\n * @packageDocumentation\n */\n\nimport type { App, Plugin } from 'vue'\nimport { KeyboardPopup, VirtualKeyboard, LicensePlateKeyboard } from './components'\nimport { vKeyboard } from './directives/v-keyboard'\n\n// 导出组件\nexport * from './components'\n\n// 导出 Composables\nexport * from './composables'\n\n// 导出插件\nexport * from './plugins'\n\n// 导出指令\nexport * from './directives'\n\n// 从核心包重新导出\nexport {\n // 管理器\n createKeyboardManager,\n createPositionManager,\n createKeyboardRenderer,\n KeyboardManager,\n PositionManager,\n KeyboardRenderer,\n\n // 布局\n getLayout,\n registerLayout,\n registerLayouts,\n hasLayout,\n getAvailableLayouts,\n unregisterLayout,\n qwertyLayout,\n numberLayout,\n integerLayout,\n symbolLayout,\n symbolLayout2,\n licensePlateLayout,\n licensePlateProvinceLayout,\n licensePlateLetterLayout,\n licensePlateAlphanumericLayout,\n PROVINCES,\n PLATE_LETTERS,\n // 场景化键盘\n idcardLayout,\n phoneLayout,\n phoneSimpleLayout,\n amountLayout,\n amountSimpleLayout,\n bankcardLayout,\n verifycodeLayout,\n emailLayout,\n urlLayout,\n searchLayout,\n punctLayout,\n EMAIL_SUFFIXES,\n\n // 工具函数\n EventEmitter,\n isMobile,\n isTouchDevice,\n getDeviceType,\n getViewportInfo,\n vibrate,\n onViewportChange,\n getBoundingRect,\n onClickOutside,\n insertTextAtCursor,\n deleteCharBeforeCursor,\n // 随机键盘\n shuffleArray,\n getRandomNumbers,\n getRandomLetters,\n getRandomAlphanumeric,\n createRandomNumberLayout,\n createRandomPinLayout,\n createRandomLetterLayout,\n createRandomMixedLayout,\n refreshRandomLayout,\n\n // 格式化工具\n formatPhone,\n formatBankCard,\n formatAmount,\n formatIdCard,\n formatLicensePlate,\n formatVerifyCode,\n registerFormatter,\n getFormatter,\n applyFormatter,\n\n // 主题系统\n getTheme,\n registerTheme,\n getAvailableThemes,\n getAllThemes,\n setCurrentTheme,\n getCurrentTheme,\n themeToCSS,\n applyTheme,\n generateThemeStyle,\n mergeTheme,\n createTheme,\n miuiTheme,\n iosTheme,\n materialTheme,\n minimalTheme,\n darkTheme,\n presetThemes,\n defaultTheme,\n} from '@composy/keyboard-core'\n\n// 导出类型\nexport type {\n KeyboardType,\n KeyType,\n KeyDefinition,\n KeyboardRow,\n KeyboardConfig,\n KeyboardState,\n KeyboardEventMap,\n KeyboardOptions,\n DeviceType,\n PopupPlacement,\n Position,\n Size,\n BoundingRect,\n PopupPositionConfig,\n PopupPositionResult,\n ViewportInfo,\n // 主题类型\n ThemeName,\n ThemeColors,\n ThemeSizes,\n ThemeEffects,\n ThemeConfig,\n ThemeCSSVariables,\n // 渲染器类型\n KeyboardRendererOptions,\n // 格式化类型\n FormatterFunction,\n} from '@composy/keyboard-core'\n\n/**\n * 键盘插件配置\n */\nexport interface KeyboardPluginOptions {\n /**\n * 组件前缀\n * @default 'L'\n */\n prefix?: string\n}\n\n/**\n * 原生 Vue 项目键盘插件\n * 用于全局注册键盘组件和指令\n *\n * @example\n * ```typescript\n * import { createApp } from 'vue'\n * import { KeyboardVuePlugin } from '@composy/keyboard-vue'\n *\n * const app = createApp(App)\n * app.use(KeyboardVuePlugin, { prefix: 'L' })\n * ```\n */\nexport const KeyboardVuePlugin: Plugin = {\n install(app: App, options: KeyboardPluginOptions = {}) {\n const prefix = options.prefix ?? 'L'\n\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/**\n * @deprecated 使用 KeyboardVuePlugin 代替\n */\nexport const KeyboardPlugin = KeyboardVuePlugin\n\n// 默认导出插件\nexport default KeyboardVuePlugin\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8KO,MAAM,oBAA4B,EACvC,QAAQ,KAAU,UAAiC,CAAC,GAAG;CACrD,MAAM,SAAS,QAAQ,UAAU;CAGjC,IAAI,UAAU,GAAG,OAAM,WAAY,uBAAe;CAClD,IAAI,UAAU,GAAG,OAAM,gBAAiB,qBAAa;CACrD,IAAI,UAAU,GAAG,OAAM,uBAAwB,4BAAoB;CAGnE,IAAI,UAAU,YAAY,SAAS;AACrC,EACF;AAKO,MAAM,iBAAiB"}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"engine-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/engine-plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB;;;qBAIR,OAAO,YAAY,2BAA2B;CAwBtE,CAAA"}
|
|
@@ -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
|
+
import VirtualKeyboard_default from "../components/VirtualKeyboard.js";
|
|
11
|
+
import KeyboardPopup_default from "../components/KeyboardPopup.js";
|
|
12
|
+
import LicensePlateKeyboard_default from "../components/LicensePlateKeyboard.js";
|
|
13
|
+
import "../components/index.js";
|
|
14
|
+
import { vKeyboard } from "../directives/v-keyboard.js";
|
|
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`, VirtualKeyboard_default);
|
|
24
|
+
app.component(`${prefix}KeyboardPopup`, KeyboardPopup_default);
|
|
25
|
+
app.component(`${prefix}LicensePlateKeyboard`, LicensePlateKeyboard_default);
|
|
26
|
+
app.directive("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
|
+
export { KeyboardEnginePlugin };
|
|
36
|
+
/*! End of @composy/keyboard-vue | Powered by @composy/builder */
|
|
37
|
+
//# sourceMappingURL=engine-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-plugin.js","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,uBAAe;GAClD,IAAI,UAAU,GAAG,OAAM,gBAAiB,qBAAa;GACrD,IAAI,UAAU,GAAG,OAAM,uBAAwB,4BAAoB;GAGnE,IAAI,UAAU,YAAY,SAAS;EACrC;EAGA,IAAI,SAAS,WAAW,WACtB,QAAQ,UAAU,UAAU,YAAY;GACtC,MAAM;GACN,SAAS;EACX,CAAC;CAEL;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
import { KeyboardEnginePlugin } from "./engine-plugin.js";
|
|
11
|
+
export { KeyboardEnginePlugin };
|
|
12
|
+
/*! End of @composy/keyboard-vue | Powered by @composy/builder */
|
package/es/style/css.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @ldesign styles
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LDesign Keyboard 样式
|
|
3
|
+
* @module styles
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* 核心样式 */
|
|
7
|
+
@import './keyboard.css';
|
|
8
|
+
|
|
9
|
+
/* 主题样式 */
|
|
10
|
+
@import './themes.css';
|
|
11
|
+
|
|
12
|
+
/* 深色主题 */
|
|
13
|
+
.dark,
|
|
14
|
+
[data-theme="dark"] {
|
|
15
|
+
--keyboard-bg: #374151;
|
|
16
|
+
--keyboard-key-bg: #4b5563;
|
|
17
|
+
--keyboard-key-color: #f9fafb;
|
|
18
|
+
--keyboard-key-active-bg: #6b7280;
|
|
19
|
+
--keyboard-fn-key-bg: #1f2937;
|
|
20
|
+
--keyboard-fn-key-color: #f9fafb;
|
|
21
|
+
--keyboard-fn-key-active-bg: #111827;
|
|
22
|
+
--keyboard-primary-bg: #2563eb;
|
|
23
|
+
--keyboard-primary-active-bg: #1d4ed8;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* iOS 风格主题 */
|
|
27
|
+
.keyboard-theme-ios {
|
|
28
|
+
--keyboard-bg: #d1d5db;
|
|
29
|
+
--keyboard-key-bg: #ffffff;
|
|
30
|
+
--keyboard-key-color: #000000;
|
|
31
|
+
--keyboard-key-active-bg: #c4c7cc;
|
|
32
|
+
--keyboard-fn-key-bg: #adb3bc;
|
|
33
|
+
--keyboard-fn-key-color: #000000;
|
|
34
|
+
--keyboard-fn-key-active-bg: #8e9399;
|
|
35
|
+
--keyboard-primary-bg: #007aff;
|
|
36
|
+
--keyboard-primary-active-bg: #0062cc;
|
|
37
|
+
--keyboard-key-radius: 5px;
|
|
38
|
+
}
|
|
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
|
+
/* 基础重置 */
|
|
55
|
+
.virtual-keyboard,
|
|
56
|
+
.virtual-keyboard * {
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.virtual-keyboard {
|
|
61
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
62
|
+
-webkit-font-smoothing: antialiased;
|
|
63
|
+
-moz-osx-font-smoothing: grayscale;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* 禁止选中 */
|
|
67
|
+
.virtual-keyboard,
|
|
68
|
+
.keyboard-popup {
|
|
69
|
+
-webkit-touch-callout: none;
|
|
70
|
+
-webkit-user-select: none;
|
|
71
|
+
user-select: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* 禁止 iOS 点击高亮 */
|
|
75
|
+
.keyboard-key {
|
|
76
|
+
-webkit-tap-highlight-color: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* 移动端优化 */
|
|
80
|
+
@media (max-width: 768px) {
|
|
81
|
+
:root {
|
|
82
|
+
--keyboard-key-height: 46px;
|
|
83
|
+
--keyboard-font-size: 18px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.virtual-keyboard {
|
|
87
|
+
padding: 6px 2px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.keyboard-key {
|
|
91
|
+
margin: 3px;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* 横屏优化 */
|
|
96
|
+
@media (orientation: landscape) and (max-height: 500px) {
|
|
97
|
+
:root {
|
|
98
|
+
--keyboard-key-height: 36px;
|
|
99
|
+
--keyboard-font-size: 14px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.virtual-keyboard {
|
|
103
|
+
padding: 4px 2px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* 安全区域适配 */
|
|
108
|
+
@supports (padding-bottom: env(safe-area-inset-bottom)) {
|
|
109
|
+
.keyboard-popup--mobile {
|
|
110
|
+
padding-bottom: calc(8px + env(safe-area-inset-bottom));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* =========================
|
|
115
|
+
数字键盘专用样式
|
|
116
|
+
========================= */
|
|
117
|
+
.number-keyboard-row {
|
|
118
|
+
display: flex;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
width: 100%;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.number-keyboard-row .keyboard-key {
|
|
124
|
+
flex: 1;
|
|
125
|
+
max-width: 25%;
|
|
126
|
+
height: 52px;
|
|
127
|
+
font-size: 22px;
|
|
128
|
+
font-weight: 500;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.number-keyboard-row .key-number {
|
|
132
|
+
background-color: var(--keyboard-key-bg, #fff);
|
|
133
|
+
color: var(--keyboard-key-color, #333);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.number-keyboard-row .key-side {
|
|
137
|
+
background-color: var(--keyboard-fn-key-bg, #d4d6dc);
|
|
138
|
+
color: var(--keyboard-fn-key-color, #333);
|
|
139
|
+
font-size: 14px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.number-keyboard-row .key-side:active {
|
|
143
|
+
background-color: var(--keyboard-fn-key-active-bg, #b8bac0);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.number-keyboard-row .key-done {
|
|
147
|
+
background-color: var(--keyboard-primary-bg, #007aff);
|
|
148
|
+
color: #fff;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.number-keyboard-row .key-done:active {
|
|
152
|
+
background-color: var(--keyboard-primary-active-bg, #0062cc);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.number-keyboard-row .key-decimal,
|
|
156
|
+
.number-keyboard-row .key-double-zero {
|
|
157
|
+
background-color: var(--keyboard-key-bg, #fff);
|
|
158
|
+
font-size: 18px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.number-keyboard-row .key-placeholder {
|
|
162
|
+
background-color: transparent;
|
|
163
|
+
box-shadow: none;
|
|
164
|
+
cursor: default;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.number-keyboard-row .key-placeholder:active {
|
|
168
|
+
transform: none;
|
|
169
|
+
background-color: transparent;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* =========================
|
|
173
|
+
PC端专用样式
|
|
174
|
+
========================= */
|
|
175
|
+
.keyboard-popup--desktop {
|
|
176
|
+
min-width: 320px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.keyboard-popup--desktop .keyboard-key {
|
|
180
|
+
height: 40px;
|
|
181
|
+
font-size: 15px;
|
|
182
|
+
border-radius: 5px;
|
|
183
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.keyboard-popup--desktop .keyboard-key:hover {
|
|
187
|
+
background-color: var(--keyboard-key-active-bg, #e5e7eb);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.keyboard-popup--desktop .keyboard-key--backspace:hover,
|
|
191
|
+
.keyboard-popup--desktop .keyboard-key--shift:hover,
|
|
192
|
+
.keyboard-popup--desktop .keyboard-key--tab:hover,
|
|
193
|
+
.keyboard-popup--desktop .keyboard-key--clear:hover,
|
|
194
|
+
.keyboard-popup--desktop .keyboard-key--close:hover {
|
|
195
|
+
background-color: var(--keyboard-fn-key-active-bg, #b8bac0);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.keyboard-popup--desktop .keyboard-key--done:hover,
|
|
199
|
+
.keyboard-popup--desktop .keyboard-key--enter:hover {
|
|
200
|
+
background-color: var(--keyboard-primary-active-bg, #0062cc);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* PC端数字键盘 */
|
|
204
|
+
.keyboard-popup--desktop .number-keyboard-row .keyboard-key {
|
|
205
|
+
height: 44px;
|
|
206
|
+
font-size: 18px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.keyboard-popup--desktop .number-keyboard-row .key-side {
|
|
210
|
+
font-size: 13px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* =========================
|
|
214
|
+
移动端专用样式
|
|
215
|
+
========================= */
|
|
216
|
+
.keyboard-popup--mobile {
|
|
217
|
+
width: 100%;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.keyboard-popup--mobile .keyboard-key {
|
|
221
|
+
height: 46px;
|
|
222
|
+
font-size: 18px;
|
|
223
|
+
border-radius: 6px;
|
|
224
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* 移动端数字键盘 */
|
|
228
|
+
.keyboard-popup--mobile .number-keyboard-row .keyboard-key {
|
|
229
|
+
height: 54px;
|
|
230
|
+
font-size: 24px;
|
|
231
|
+
border-radius: 8px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.keyboard-popup--mobile .number-keyboard-row .key-side {
|
|
235
|
+
font-size: 15px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* =========================
|
|
239
|
+
键盘顶部栅栏(移动端)
|
|
240
|
+
========================= */
|
|
241
|
+
.keyboard-toolbar {
|
|
242
|
+
display: flex;
|
|
243
|
+
justify-content: space-between;
|
|
244
|
+
align-items: center;
|
|
245
|
+
padding: 8px 16px;
|
|
246
|
+
background-color: var(--keyboard-bg, #d1d5db);
|
|
247
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.keyboard-toolbar__title {
|
|
251
|
+
font-size: 14px;
|
|
252
|
+
color: var(--keyboard-fn-key-color, #666);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.keyboard-toolbar__done {
|
|
256
|
+
padding: 6px 16px;
|
|
257
|
+
background: none;
|
|
258
|
+
border: none;
|
|
259
|
+
color: var(--keyboard-primary-bg, #007aff);
|
|
260
|
+
font-size: 15px;
|
|
261
|
+
font-weight: 500;
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.keyboard-toolbar__done:active {
|
|
266
|
+
opacity: 0.7;
|
|
267
|
+
}
|