@composy/keyboard-core 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 +37 -0
- package/dist/index.js +3605 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/es/icons.d.ts +58 -0
- package/es/icons.d.ts.map +1 -0
- package/es/icons.js +34 -0
- package/es/icons.js.map +1 -0
- package/es/index.d.ts +12 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +36 -0
- package/es/layouts/amount.d.ts +14 -0
- package/es/layouts/amount.d.ts.map +1 -0
- package/es/layouts/amount.js +175 -0
- package/es/layouts/amount.js.map +1 -0
- package/es/layouts/bankcard.d.ts +15 -0
- package/es/layouts/bankcard.d.ts.map +1 -0
- package/es/layouts/bankcard.js +99 -0
- package/es/layouts/bankcard.js.map +1 -0
- package/es/layouts/email.d.ts +11 -0
- package/es/layouts/email.d.ts.map +1 -0
- package/es/layouts/email.js +126 -0
- package/es/layouts/email.js.map +1 -0
- package/es/layouts/idcard.d.ts +16 -0
- package/es/layouts/idcard.d.ts.map +1 -0
- package/es/layouts/idcard.js +99 -0
- package/es/layouts/idcard.js.map +1 -0
- package/es/layouts/index.d.ts +54 -0
- package/es/layouts/index.d.ts.map +1 -0
- package/es/layouts/index.js +78 -0
- package/es/layouts/index.js.map +1 -0
- package/es/layouts/license-plate.d.ts +35 -0
- package/es/layouts/license-plate.d.ts.map +1 -0
- package/es/layouts/license-plate.js +290 -0
- package/es/layouts/license-plate.js.map +1 -0
- package/es/layouts/number.d.ts +14 -0
- package/es/layouts/number.d.ts.map +1 -0
- package/es/layouts/number.js +168 -0
- package/es/layouts/number.js.map +1 -0
- package/es/layouts/phone.d.ts +15 -0
- package/es/layouts/phone.d.ts.map +1 -0
- package/es/layouts/phone.js +175 -0
- package/es/layouts/phone.js.map +1 -0
- package/es/layouts/punct.d.ts +7 -0
- package/es/layouts/punct.d.ts.map +1 -0
- package/es/layouts/punct.js +112 -0
- package/es/layouts/punct.js.map +1 -0
- package/es/layouts/qwerty.d.ts +10 -0
- package/es/layouts/qwerty.d.ts.map +1 -0
- package/es/layouts/qwerty.js +116 -0
- package/es/layouts/qwerty.js.map +1 -0
- package/es/layouts/search.d.ts +7 -0
- package/es/layouts/search.d.ts.map +1 -0
- package/es/layouts/search.js +101 -0
- package/es/layouts/search.js.map +1 -0
- package/es/layouts/symbol.d.ts +14 -0
- package/es/layouts/symbol.d.ts.map +1 -0
- package/es/layouts/symbol.js +194 -0
- package/es/layouts/symbol.js.map +1 -0
- package/es/layouts/url.d.ts +7 -0
- package/es/layouts/url.d.ts.map +1 -0
- package/es/layouts/url.js +99 -0
- package/es/layouts/url.js.map +1 -0
- package/es/layouts/verifycode.d.ts +15 -0
- package/es/layouts/verifycode.d.ts.map +1 -0
- package/es/layouts/verifycode.js +100 -0
- package/es/layouts/verifycode.js.map +1 -0
- package/es/managers/index.d.ts +8 -0
- package/es/managers/index.d.ts.map +1 -0
- package/es/managers/index.js +14 -0
- package/es/managers/keyboard-manager.d.ts +130 -0
- package/es/managers/keyboard-manager.d.ts.map +1 -0
- package/es/managers/keyboard-manager.js +374 -0
- package/es/managers/keyboard-manager.js.map +1 -0
- package/es/managers/keyboard-renderer.d.ts +115 -0
- package/es/managers/keyboard-renderer.d.ts.map +1 -0
- package/es/managers/keyboard-renderer.js +283 -0
- package/es/managers/keyboard-renderer.js.map +1 -0
- package/es/managers/position-manager.d.ts +72 -0
- package/es/managers/position-manager.d.ts.map +1 -0
- package/es/managers/position-manager.js +199 -0
- package/es/managers/position-manager.js.map +1 -0
- package/es/themes/index.d.ts +70 -0
- package/es/themes/index.d.ts.map +1 -0
- package/es/themes/index.js +99 -0
- package/es/themes/index.js.map +1 -0
- package/es/themes/presets.d.ts +39 -0
- package/es/themes/presets.d.ts.map +1 -0
- package/es/themes/presets.js +207 -0
- package/es/themes/presets.js.map +1 -0
- package/es/themes/types.d.ts +118 -0
- package/es/themes/types.d.ts.map +1 -0
- package/es/themes/types.js +10 -0
- package/es/types/index.d.ts +7 -0
- package/es/types/index.d.ts.map +1 -0
- package/es/types/index.js +10 -0
- package/es/types/keyboard.d.ts +253 -0
- package/es/types/keyboard.d.ts.map +1 -0
- package/es/types/keyboard.js +10 -0
- package/es/types/position.d.ts +139 -0
- package/es/types/position.d.ts.map +1 -0
- package/es/types/position.js +10 -0
- package/es/utils/device.d.ts +45 -0
- package/es/utils/device.d.ts.map +1 -0
- package/es/utils/device.js +111 -0
- package/es/utils/device.js.map +1 -0
- package/es/utils/dom.d.ts +69 -0
- package/es/utils/dom.d.ts.map +1 -0
- package/es/utils/dom.js +134 -0
- package/es/utils/dom.js.map +1 -0
- package/es/utils/event-emitter.d.ts +52 -0
- package/es/utils/event-emitter.d.ts.map +1 -0
- package/es/utils/event-emitter.js +99 -0
- package/es/utils/event-emitter.js.map +1 -0
- package/es/utils/formatters.d.ts +51 -0
- package/es/utils/formatters.d.ts.map +1 -0
- package/es/utils/formatters.js +57 -0
- package/es/utils/formatters.js.map +1 -0
- package/es/utils/index.d.ts +10 -0
- package/es/utils/index.d.ts.map +1 -0
- package/es/utils/index.js +16 -0
- package/es/utils/random.d.ts +71 -0
- package/es/utils/random.d.ts.map +1 -0
- package/es/utils/random.js +292 -0
- package/es/utils/random.js.map +1 -0
- package/esm/icons.d.ts +58 -0
- package/esm/icons.d.ts.map +1 -0
- package/esm/icons.js +34 -0
- package/esm/icons.js.map +1 -0
- package/esm/index.d.ts +12 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +37 -0
- package/esm/layouts/amount.d.ts +14 -0
- package/esm/layouts/amount.d.ts.map +1 -0
- package/esm/layouts/amount.js +175 -0
- package/esm/layouts/amount.js.map +1 -0
- package/esm/layouts/bankcard.d.ts +15 -0
- package/esm/layouts/bankcard.d.ts.map +1 -0
- package/esm/layouts/bankcard.js +99 -0
- package/esm/layouts/bankcard.js.map +1 -0
- package/esm/layouts/email.d.ts +11 -0
- package/esm/layouts/email.d.ts.map +1 -0
- package/esm/layouts/email.js +126 -0
- package/esm/layouts/email.js.map +1 -0
- package/esm/layouts/idcard.d.ts +16 -0
- package/esm/layouts/idcard.d.ts.map +1 -0
- package/esm/layouts/idcard.js +99 -0
- package/esm/layouts/idcard.js.map +1 -0
- package/esm/layouts/index.d.ts +54 -0
- package/esm/layouts/index.d.ts.map +1 -0
- package/esm/layouts/index.js +78 -0
- package/esm/layouts/index.js.map +1 -0
- package/esm/layouts/license-plate.d.ts +35 -0
- package/esm/layouts/license-plate.d.ts.map +1 -0
- package/esm/layouts/license-plate.js +290 -0
- package/esm/layouts/license-plate.js.map +1 -0
- package/esm/layouts/number.d.ts +14 -0
- package/esm/layouts/number.d.ts.map +1 -0
- package/esm/layouts/number.js +168 -0
- package/esm/layouts/number.js.map +1 -0
- package/esm/layouts/phone.d.ts +15 -0
- package/esm/layouts/phone.d.ts.map +1 -0
- package/esm/layouts/phone.js +175 -0
- package/esm/layouts/phone.js.map +1 -0
- package/esm/layouts/punct.d.ts +7 -0
- package/esm/layouts/punct.d.ts.map +1 -0
- package/esm/layouts/punct.js +112 -0
- package/esm/layouts/punct.js.map +1 -0
- package/esm/layouts/qwerty.d.ts +10 -0
- package/esm/layouts/qwerty.d.ts.map +1 -0
- package/esm/layouts/qwerty.js +116 -0
- package/esm/layouts/qwerty.js.map +1 -0
- package/esm/layouts/search.d.ts +7 -0
- package/esm/layouts/search.d.ts.map +1 -0
- package/esm/layouts/search.js +101 -0
- package/esm/layouts/search.js.map +1 -0
- package/esm/layouts/symbol.d.ts +14 -0
- package/esm/layouts/symbol.d.ts.map +1 -0
- package/esm/layouts/symbol.js +194 -0
- package/esm/layouts/symbol.js.map +1 -0
- package/esm/layouts/url.d.ts +7 -0
- package/esm/layouts/url.d.ts.map +1 -0
- package/esm/layouts/url.js +99 -0
- package/esm/layouts/url.js.map +1 -0
- package/esm/layouts/verifycode.d.ts +15 -0
- package/esm/layouts/verifycode.d.ts.map +1 -0
- package/esm/layouts/verifycode.js +100 -0
- package/esm/layouts/verifycode.js.map +1 -0
- package/esm/managers/index.d.ts +8 -0
- package/esm/managers/index.d.ts.map +1 -0
- package/esm/managers/index.js +14 -0
- package/esm/managers/keyboard-manager.d.ts +130 -0
- package/esm/managers/keyboard-manager.d.ts.map +1 -0
- package/esm/managers/keyboard-manager.js +374 -0
- package/esm/managers/keyboard-manager.js.map +1 -0
- package/esm/managers/keyboard-renderer.d.ts +115 -0
- package/esm/managers/keyboard-renderer.d.ts.map +1 -0
- package/esm/managers/keyboard-renderer.js +283 -0
- package/esm/managers/keyboard-renderer.js.map +1 -0
- package/esm/managers/position-manager.d.ts +72 -0
- package/esm/managers/position-manager.d.ts.map +1 -0
- package/esm/managers/position-manager.js +199 -0
- package/esm/managers/position-manager.js.map +1 -0
- package/esm/themes/index.d.ts +70 -0
- package/esm/themes/index.d.ts.map +1 -0
- package/esm/themes/index.js +99 -0
- package/esm/themes/index.js.map +1 -0
- package/esm/themes/presets.d.ts +39 -0
- package/esm/themes/presets.d.ts.map +1 -0
- package/esm/themes/presets.js +207 -0
- package/esm/themes/presets.js.map +1 -0
- package/esm/themes/types.d.ts +118 -0
- package/esm/themes/types.d.ts.map +1 -0
- package/esm/themes/types.js +10 -0
- package/esm/types/index.d.ts +7 -0
- package/esm/types/index.d.ts.map +1 -0
- package/esm/types/index.js +10 -0
- package/esm/types/keyboard.d.ts +253 -0
- package/esm/types/keyboard.d.ts.map +1 -0
- package/esm/types/keyboard.js +10 -0
- package/esm/types/position.d.ts +139 -0
- package/esm/types/position.d.ts.map +1 -0
- package/esm/types/position.js +10 -0
- package/esm/utils/device.d.ts +45 -0
- package/esm/utils/device.d.ts.map +1 -0
- package/esm/utils/device.js +111 -0
- package/esm/utils/device.js.map +1 -0
- package/esm/utils/dom.d.ts +69 -0
- package/esm/utils/dom.d.ts.map +1 -0
- package/esm/utils/dom.js +134 -0
- package/esm/utils/dom.js.map +1 -0
- package/esm/utils/event-emitter.d.ts +52 -0
- package/esm/utils/event-emitter.d.ts.map +1 -0
- package/esm/utils/event-emitter.js +99 -0
- package/esm/utils/event-emitter.js.map +1 -0
- package/esm/utils/formatters.d.ts +51 -0
- package/esm/utils/formatters.d.ts.map +1 -0
- package/esm/utils/formatters.js +57 -0
- package/esm/utils/formatters.js.map +1 -0
- package/esm/utils/index.d.ts +10 -0
- package/esm/utils/index.d.ts.map +1 -0
- package/esm/utils/index.js +16 -0
- package/esm/utils/random.d.ts +71 -0
- package/esm/utils/random.d.ts.map +1 -0
- package/esm/utils/random.js +292 -0
- package/esm/utils/random.js.map +1 -0
- package/lib/icons.cjs +44 -0
- package/lib/icons.cjs.map +1 -0
- package/lib/icons.d.ts +58 -0
- package/lib/index.cjs +141 -0
- package/lib/index.d.ts +12 -0
- package/lib/layouts/amount.cjs +177 -0
- package/lib/layouts/amount.cjs.map +1 -0
- package/lib/layouts/amount.d.ts +14 -0
- package/lib/layouts/bankcard.cjs +100 -0
- package/lib/layouts/bankcard.cjs.map +1 -0
- package/lib/layouts/bankcard.d.ts +15 -0
- package/lib/layouts/email.cjs +128 -0
- package/lib/layouts/email.cjs.map +1 -0
- package/lib/layouts/email.d.ts +11 -0
- package/lib/layouts/idcard.cjs +100 -0
- package/lib/layouts/idcard.cjs.map +1 -0
- package/lib/layouts/idcard.d.ts +16 -0
- package/lib/layouts/index.cjs +107 -0
- package/lib/layouts/index.cjs.map +1 -0
- package/lib/layouts/index.d.ts +54 -0
- package/lib/layouts/license-plate.cjs +296 -0
- package/lib/layouts/license-plate.cjs.map +1 -0
- package/lib/layouts/license-plate.d.ts +35 -0
- package/lib/layouts/number.cjs +170 -0
- package/lib/layouts/number.cjs.map +1 -0
- package/lib/layouts/number.d.ts +14 -0
- package/lib/layouts/phone.cjs +177 -0
- package/lib/layouts/phone.cjs.map +1 -0
- package/lib/layouts/phone.d.ts +15 -0
- package/lib/layouts/punct.cjs +113 -0
- package/lib/layouts/punct.cjs.map +1 -0
- package/lib/layouts/punct.d.ts +7 -0
- package/lib/layouts/qwerty.cjs +117 -0
- package/lib/layouts/qwerty.cjs.map +1 -0
- package/lib/layouts/qwerty.d.ts +10 -0
- package/lib/layouts/search.cjs +102 -0
- package/lib/layouts/search.cjs.map +1 -0
- package/lib/layouts/search.d.ts +7 -0
- package/lib/layouts/symbol.cjs +196 -0
- package/lib/layouts/symbol.cjs.map +1 -0
- package/lib/layouts/symbol.d.ts +14 -0
- package/lib/layouts/url.cjs +100 -0
- package/lib/layouts/url.cjs.map +1 -0
- package/lib/layouts/url.d.ts +7 -0
- package/lib/layouts/verifycode.cjs +101 -0
- package/lib/layouts/verifycode.cjs.map +1 -0
- package/lib/layouts/verifycode.d.ts +15 -0
- package/lib/managers/index.cjs +20 -0
- package/lib/managers/index.d.ts +8 -0
- package/lib/managers/keyboard-manager.cjs +376 -0
- package/lib/managers/keyboard-manager.cjs.map +1 -0
- package/lib/managers/keyboard-manager.d.ts +130 -0
- package/lib/managers/keyboard-renderer.cjs +285 -0
- package/lib/managers/keyboard-renderer.cjs.map +1 -0
- package/lib/managers/keyboard-renderer.d.ts +115 -0
- package/lib/managers/position-manager.cjs +201 -0
- package/lib/managers/position-manager.cjs.map +1 -0
- package/lib/managers/position-manager.d.ts +72 -0
- package/lib/package.json +3 -0
- package/lib/themes/index.cjs +117 -0
- package/lib/themes/index.cjs.map +1 -0
- package/lib/themes/index.d.ts +70 -0
- package/lib/themes/presets.cjs +214 -0
- package/lib/themes/presets.cjs.map +1 -0
- package/lib/themes/presets.d.ts +39 -0
- package/lib/themes/types.cjs +11 -0
- package/lib/themes/types.d.ts +118 -0
- package/lib/types/index.cjs +11 -0
- package/lib/types/index.d.ts +7 -0
- package/lib/types/keyboard.cjs +11 -0
- package/lib/types/keyboard.d.ts +253 -0
- package/lib/types/position.cjs +11 -0
- package/lib/types/position.d.ts +139 -0
- package/lib/utils/device.cjs +120 -0
- package/lib/utils/device.cjs.map +1 -0
- package/lib/utils/device.d.ts +45 -0
- package/lib/utils/dom.cjs +148 -0
- package/lib/utils/dom.cjs.map +1 -0
- package/lib/utils/dom.d.ts +69 -0
- package/lib/utils/event-emitter.cjs +100 -0
- package/lib/utils/event-emitter.cjs.map +1 -0
- package/lib/utils/event-emitter.d.ts +52 -0
- package/lib/utils/formatters.cjs +66 -0
- package/lib/utils/formatters.cjs.map +1 -0
- package/lib/utils/formatters.d.ts +51 -0
- package/lib/utils/index.cjs +58 -0
- package/lib/utils/index.d.ts +10 -0
- package/lib/utils/random.cjs +301 -0
- package/lib/utils/random.cjs.map +1 -0
- package/lib/utils/random.d.ts +71 -0
- package/package.json +121 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.cjs","names":[],"sources":["../../src/layouts/number.ts"],"sourcesContent":["/**\n * 数字键盘布局\n * @module layouts/number\n */\n\nimport type { KeyboardConfig, KeyDefinition } from '../types'\nimport { ICON_DELETE, ICON_CLEAR } from '../icons'\n\n/**\n * 创建数字按键\n */\nfunction createNumberKey(num: string): KeyDefinition {\n return {\n id: `num-${num}`,\n type: 'char',\n label: num,\n value: num,\n className: 'key-num',\n }\n}\n\n/**\n * 数字键盘配置 - 紧凑4x4布局\n */\nexport const numberLayout: KeyboardConfig = {\n type: 'number',\n name: '数字键盘',\n supportShift: false,\n switchable: ['qwerty', 'symbol'],\n rows: [\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('1'),\n createNumberKey('2'),\n createNumberKey('3'),\n {\n id: 'backspace',\n type: 'backspace',\n icon: ICON_DELETE,\n label: '',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('4'),\n createNumberKey('5'),\n createNumberKey('6'),\n {\n id: 'clear',\n type: 'clear',\n icon: ICON_CLEAR,\n label: '',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('7'),\n createNumberKey('8'),\n createNumberKey('9'),\n {\n id: 'close',\n type: 'close',\n label: '关闭',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n {\n id: 'decimal',\n type: 'char',\n label: '.',\n value: '.',\n className: 'key-num',\n },\n createNumberKey('0'),\n {\n id: 'done',\n type: 'done',\n label: '确定',\n width: 2,\n className: 'key-numpad-done',\n },\n ],\n },\n ],\n}\n\n/**\n * 纯整数键盘 - 紧凑4x4布局\n */\nexport const integerLayout: KeyboardConfig = {\n type: 'integer',\n name: '整数键盘',\n supportShift: false,\n switchable: ['qwerty'],\n rows: [\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('1'),\n createNumberKey('2'),\n createNumberKey('3'),\n {\n id: 'backspace',\n type: 'backspace',\n icon: ICON_DELETE,\n label: '',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('4'),\n createNumberKey('5'),\n createNumberKey('6'),\n {\n id: 'clear',\n type: 'clear',\n icon: ICON_CLEAR,\n label: '',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('7'),\n createNumberKey('8'),\n createNumberKey('9'),\n {\n id: 'close',\n type: 'close',\n label: '关闭',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n {\n id: 'switch-qwerty',\n type: 'tab',\n label: 'ABC',\n className: 'key-numpad-fn',\n data: { targetType: 'qwerty' },\n },\n createNumberKey('0'),\n {\n id: 'done',\n type: 'done',\n label: '确定',\n width: 2,\n className: 'key-numpad-done',\n },\n ],\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAS,gBAAgB,KAA4B;CACnD,OAAO;EACL,IAAI,OAAO;EACX,MAAM;EACN,OAAO;EACP,OAAO;EACP,WAAW;CACb;AACF;AAKO,MAAM,eAA+B;CAC1C,MAAM;CACN,MAAM;CACN,cAAc;CACd,YAAY,CAAC,UAAU,QAAQ;CAC/B,MAAM;EACJ;GACE,WAAW;GACX,MAAM;IACJ,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IAC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ACJ;KACE,IAAI;KACJ,MAAM;KACN,OAAO;KACP,WAAW;KACX,MAAM,EAAE,YAAY,SAAS;IAC/B;IACA,gBAAgB,GAAG;IACnB;KACE,IAAI;KACJ,MAAM;KACN,OAAO;KACP,OAAO;KACP,WAAW;IACb;GACF;EACF;CACF;AACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 数字键盘布局
|
|
3
|
+
* @module layouts/number
|
|
4
|
+
*/
|
|
5
|
+
import type { KeyboardConfig } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* 数字键盘配置 - 紧凑4x4布局
|
|
8
|
+
*/
|
|
9
|
+
export declare const numberLayout: KeyboardConfig;
|
|
10
|
+
/**
|
|
11
|
+
* 纯整数键盘 - 紧凑4x4布局
|
|
12
|
+
*/
|
|
13
|
+
export declare const integerLayout: KeyboardConfig;
|
|
14
|
+
//# sourceMappingURL=number.d.ts.map
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ***********************************
|
|
3
|
+
* @composy/keyboard-core v0.0.1 *
|
|
4
|
+
* Built with rollup *
|
|
5
|
+
* Build time: 2024-08-17 11:33:29 *
|
|
6
|
+
* Build mode: production *
|
|
7
|
+
* Minified: No *
|
|
8
|
+
* ***********************************
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
const require_icons = require("../icons.cjs");
|
|
12
|
+
//#region src/layouts/phone.ts
|
|
13
|
+
function createNumberKey(num) {
|
|
14
|
+
return {
|
|
15
|
+
id: `phone-${num}`,
|
|
16
|
+
type: "char",
|
|
17
|
+
label: num,
|
|
18
|
+
value: num,
|
|
19
|
+
className: "key-num"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const phoneLayout = {
|
|
23
|
+
type: "phone",
|
|
24
|
+
name: "手机号键盘",
|
|
25
|
+
supportShift: false,
|
|
26
|
+
rows: [
|
|
27
|
+
{
|
|
28
|
+
className: "numpad-row",
|
|
29
|
+
keys: [
|
|
30
|
+
createNumberKey("1"),
|
|
31
|
+
createNumberKey("2"),
|
|
32
|
+
createNumberKey("3"),
|
|
33
|
+
{
|
|
34
|
+
id: "backspace",
|
|
35
|
+
type: "backspace",
|
|
36
|
+
icon: require_icons.ICON_DELETE,
|
|
37
|
+
label: "",
|
|
38
|
+
className: "key-numpad-fn"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
className: "numpad-row",
|
|
44
|
+
keys: [
|
|
45
|
+
createNumberKey("4"),
|
|
46
|
+
createNumberKey("5"),
|
|
47
|
+
createNumberKey("6"),
|
|
48
|
+
{
|
|
49
|
+
id: "clear",
|
|
50
|
+
type: "clear",
|
|
51
|
+
icon: require_icons.ICON_CLEAR,
|
|
52
|
+
label: "",
|
|
53
|
+
className: "key-numpad-fn"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
className: "numpad-row",
|
|
59
|
+
keys: [
|
|
60
|
+
createNumberKey("7"),
|
|
61
|
+
createNumberKey("8"),
|
|
62
|
+
createNumberKey("9"),
|
|
63
|
+
{
|
|
64
|
+
id: "close",
|
|
65
|
+
type: "close",
|
|
66
|
+
label: "关闭",
|
|
67
|
+
className: "key-numpad-fn"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
className: "numpad-row",
|
|
73
|
+
keys: [
|
|
74
|
+
{
|
|
75
|
+
id: "phone-plus",
|
|
76
|
+
type: "char",
|
|
77
|
+
label: "+",
|
|
78
|
+
value: "+",
|
|
79
|
+
className: "key-num"
|
|
80
|
+
},
|
|
81
|
+
createNumberKey("0"),
|
|
82
|
+
{
|
|
83
|
+
id: "done",
|
|
84
|
+
type: "done",
|
|
85
|
+
label: "确定",
|
|
86
|
+
width: 2,
|
|
87
|
+
className: "key-numpad-done"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
data: {
|
|
93
|
+
maxLength: 11,
|
|
94
|
+
inputType: "phone"
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const phoneSimpleLayout = {
|
|
98
|
+
type: "phone-simple",
|
|
99
|
+
name: "拨号键盘",
|
|
100
|
+
supportShift: false,
|
|
101
|
+
rows: [
|
|
102
|
+
{
|
|
103
|
+
className: "numpad-row",
|
|
104
|
+
keys: [
|
|
105
|
+
createNumberKey("1"),
|
|
106
|
+
createNumberKey("2"),
|
|
107
|
+
createNumberKey("3"),
|
|
108
|
+
{
|
|
109
|
+
id: "backspace",
|
|
110
|
+
type: "backspace",
|
|
111
|
+
icon: require_icons.ICON_DELETE,
|
|
112
|
+
label: "",
|
|
113
|
+
className: "key-numpad-fn"
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
className: "numpad-row",
|
|
119
|
+
keys: [
|
|
120
|
+
createNumberKey("4"),
|
|
121
|
+
createNumberKey("5"),
|
|
122
|
+
createNumberKey("6"),
|
|
123
|
+
{
|
|
124
|
+
id: "clear",
|
|
125
|
+
type: "clear",
|
|
126
|
+
icon: require_icons.ICON_CLEAR,
|
|
127
|
+
label: "",
|
|
128
|
+
className: "key-numpad-fn"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
className: "numpad-row",
|
|
134
|
+
keys: [
|
|
135
|
+
createNumberKey("7"),
|
|
136
|
+
createNumberKey("8"),
|
|
137
|
+
createNumberKey("9"),
|
|
138
|
+
{
|
|
139
|
+
id: "phone-hash",
|
|
140
|
+
type: "char",
|
|
141
|
+
label: "#",
|
|
142
|
+
value: "#",
|
|
143
|
+
className: "key-num"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
className: "numpad-row",
|
|
149
|
+
keys: [
|
|
150
|
+
{
|
|
151
|
+
id: "phone-star",
|
|
152
|
+
type: "char",
|
|
153
|
+
label: "*",
|
|
154
|
+
value: "*",
|
|
155
|
+
className: "key-num"
|
|
156
|
+
},
|
|
157
|
+
createNumberKey("0"),
|
|
158
|
+
{
|
|
159
|
+
id: "done",
|
|
160
|
+
type: "done",
|
|
161
|
+
label: "拨打",
|
|
162
|
+
width: 2,
|
|
163
|
+
className: "key-numpad-done"
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
data: {
|
|
169
|
+
maxLength: 13,
|
|
170
|
+
inputType: "phone"
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
exports.phoneLayout = phoneLayout;
|
|
175
|
+
exports.phoneSimpleLayout = phoneSimpleLayout;
|
|
176
|
+
/*! End of @composy/keyboard-core | Powered by @composy/builder */
|
|
177
|
+
//# sourceMappingURL=phone.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone.cjs","names":[],"sources":["../../src/layouts/phone.ts"],"sourcesContent":["/**\n * 手机号键盘布局\n * @module layouts/phone\n */\n\nimport type { KeyboardConfig, KeyDefinition } from '../types'\nimport { ICON_DELETE, ICON_CLEAR } from '../icons'\n\n/**\n * 创建数字按键\n */\nfunction createNumberKey(num: string): KeyDefinition {\n return {\n id: `phone-${num}`,\n type: 'char',\n label: num,\n value: num,\n className: 'key-num',\n }\n}\n\n/**\n * 手机号键盘配置\n * 紧凑4x4布局\n */\nexport const phoneLayout: KeyboardConfig = {\n type: 'phone',\n name: '手机号键盘',\n supportShift: false,\n rows: [\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('1'),\n createNumberKey('2'),\n createNumberKey('3'),\n {\n id: 'backspace',\n type: 'backspace',\n icon: ICON_DELETE,\n label: '',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('4'),\n createNumberKey('5'),\n createNumberKey('6'),\n {\n id: 'clear',\n type: 'clear',\n icon: ICON_CLEAR,\n label: '',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('7'),\n createNumberKey('8'),\n createNumberKey('9'),\n {\n id: 'close',\n type: 'close',\n label: '关闭',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n {\n id: 'phone-plus',\n type: 'char',\n label: '+',\n value: '+',\n className: 'key-num',\n },\n createNumberKey('0'),\n {\n id: 'done',\n type: 'done',\n label: '确定',\n width: 2,\n className: 'key-numpad-done',\n },\n ],\n },\n ],\n data: {\n maxLength: 11,\n inputType: 'phone',\n },\n}\n\n/**\n * 简洁版拨号键盘(带 * #)\n */\nexport const phoneSimpleLayout: KeyboardConfig = {\n type: 'phone-simple',\n name: '拨号键盘',\n supportShift: false,\n rows: [\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('1'),\n createNumberKey('2'),\n createNumberKey('3'),\n {\n id: 'backspace',\n type: 'backspace',\n icon: ICON_DELETE,\n label: '',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('4'),\n createNumberKey('5'),\n createNumberKey('6'),\n {\n id: 'clear',\n type: 'clear',\n icon: ICON_CLEAR,\n label: '',\n className: 'key-numpad-fn',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n createNumberKey('7'),\n createNumberKey('8'),\n createNumberKey('9'),\n {\n id: 'phone-hash',\n type: 'char',\n label: '#',\n value: '#',\n className: 'key-num',\n },\n ],\n },\n {\n className: 'numpad-row',\n keys: [\n {\n id: 'phone-star',\n type: 'char',\n label: '*',\n value: '*',\n className: 'key-num',\n },\n createNumberKey('0'),\n {\n id: 'done',\n type: 'done',\n label: '拨打',\n width: 2,\n className: 'key-numpad-done',\n },\n ],\n },\n ],\n data: {\n maxLength: 13,\n inputType: 'phone',\n },\n}\n"],"mappings":";;;;;;;;;;;;A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KACE,IAAI;KACJ,MAAM;KACN,MAAM,cAAA;KACN,OAAO;KACP,WAAW;IACb;GACF;EACF;EACA;GACE,WAAW;GACX,MAAM;IACJ,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB;KACE,IAAI;KACJ,MAAM;KACN,OAAO;KACP,OAAO;KACP,WAAW;IACb;GACF;EACF;EACA;GACE,WAAW;GACX,MAAM;IACJ;KACE,IAAI;KACJ,MAAM;KACN,OAAO;KACP,OAAO;KACP,WAAW;IACb;IACA,gBAAgB,GAAG;IACnB;KACE,IAAI;KACJ,MAAM;KACN,OAAO;KACP,OAAO;KACP,WAAW;IACb;GACF;EACF;CACF;CACA,MAAM;EACJ,WAAW;EACX,WAAW;CACb;AACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 手机号键盘布局
|
|
3
|
+
* @module layouts/phone
|
|
4
|
+
*/
|
|
5
|
+
import type { KeyboardConfig } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* 手机号键盘配置
|
|
8
|
+
* 紧凑4x4布局
|
|
9
|
+
*/
|
|
10
|
+
export declare const phoneLayout: KeyboardConfig;
|
|
11
|
+
/**
|
|
12
|
+
* 简洁版拨号键盘(带 * #)
|
|
13
|
+
*/
|
|
14
|
+
export declare const phoneSimpleLayout: KeyboardConfig;
|
|
15
|
+
//# sourceMappingURL=phone.d.ts.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ***********************************
|
|
3
|
+
* @composy/keyboard-core v0.0.1 *
|
|
4
|
+
* Built with rollup *
|
|
5
|
+
* Build time: 2024-08-17 11:33:29 *
|
|
6
|
+
* Build mode: production *
|
|
7
|
+
* Minified: No *
|
|
8
|
+
* ***********************************
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
const require_icons = require("../icons.cjs");
|
|
12
|
+
//#region src/layouts/punct.ts
|
|
13
|
+
function p(label, value) {
|
|
14
|
+
return {
|
|
15
|
+
id: `punct-${label}`,
|
|
16
|
+
type: "char",
|
|
17
|
+
label,
|
|
18
|
+
value: value ?? label,
|
|
19
|
+
className: "key-num"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const punctLayout = {
|
|
23
|
+
type: "punct",
|
|
24
|
+
name: "中文标点",
|
|
25
|
+
supportShift: false,
|
|
26
|
+
switchable: ["qwerty", "punct-en"],
|
|
27
|
+
rows: [
|
|
28
|
+
{
|
|
29
|
+
className: "virtual-keyboard__row",
|
|
30
|
+
keys: [
|
|
31
|
+
",",
|
|
32
|
+
"。",
|
|
33
|
+
"?",
|
|
34
|
+
"!",
|
|
35
|
+
":",
|
|
36
|
+
";",
|
|
37
|
+
"\"",
|
|
38
|
+
"\""
|
|
39
|
+
].map((s) => p(s))
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
className: "virtual-keyboard__row",
|
|
43
|
+
keys: [
|
|
44
|
+
"(",
|
|
45
|
+
")",
|
|
46
|
+
"【",
|
|
47
|
+
"】",
|
|
48
|
+
"《",
|
|
49
|
+
"》",
|
|
50
|
+
"……",
|
|
51
|
+
"——"
|
|
52
|
+
].map((s) => p(s))
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
className: "virtual-keyboard__row",
|
|
56
|
+
keys: [
|
|
57
|
+
p("·"),
|
|
58
|
+
p("、"),
|
|
59
|
+
p("「"),
|
|
60
|
+
p("」"),
|
|
61
|
+
p("『"),
|
|
62
|
+
p("』"),
|
|
63
|
+
p("~"),
|
|
64
|
+
{
|
|
65
|
+
id: "backspace",
|
|
66
|
+
type: "backspace",
|
|
67
|
+
icon: require_icons.ICON_DELETE,
|
|
68
|
+
label: "",
|
|
69
|
+
className: "key-numpad-fn"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
className: "virtual-keyboard__row",
|
|
75
|
+
keys: [
|
|
76
|
+
{
|
|
77
|
+
id: "switch-punct-en",
|
|
78
|
+
type: "tab",
|
|
79
|
+
label: "英",
|
|
80
|
+
data: { targetType: "punct-en" },
|
|
81
|
+
className: "key-numpad-fn"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "switch-qwerty",
|
|
85
|
+
type: "tab",
|
|
86
|
+
label: "ABC",
|
|
87
|
+
data: { targetType: "qwerty" },
|
|
88
|
+
className: "key-numpad-fn"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "space",
|
|
92
|
+
type: "space",
|
|
93
|
+
label: "空格",
|
|
94
|
+
value: " ",
|
|
95
|
+
width: 4,
|
|
96
|
+
className: "key-num"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: "done",
|
|
100
|
+
type: "done",
|
|
101
|
+
icon: require_icons.ICON_CHECK,
|
|
102
|
+
label: "",
|
|
103
|
+
width: 2,
|
|
104
|
+
className: "key-numpad-done"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
//#endregion
|
|
111
|
+
exports.punctLayout = punctLayout;
|
|
112
|
+
/*! End of @composy/keyboard-core | Powered by @composy/builder */
|
|
113
|
+
//# sourceMappingURL=punct.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"punct.cjs","names":[],"sources":["../../src/layouts/punct.ts"],"sourcesContent":["/**\n * 标点符号键盘布局 (中文)\n * @module layouts/punct\n */\n\n// 导入键盘配置和按键定义的类型\nimport type { KeyboardConfig, KeyDefinition } from '../types'\n// 导入删除和确认图标资源\nimport { ICON_DELETE, ICON_CHECK } from '../icons'\n\n/**\n * 创建标点符号按键的快捷函数\n * @param label - 按键显示文本(同时也是默认输出值)\n * @param value - 可选,按键输出值,不传则与label相同\n * @returns 返回一个标点按键定义对象\n */\nfunction p(label: string, value?: string): KeyDefinition {\n return { id: `punct-${label}`, type: 'char', label, value: value ?? label, className: 'key-num' }\n}\n\n// 导出中文标点键盘布局配置\nexport const punctLayout: KeyboardConfig = {\n type: 'punct', // 布局类型标识为 punct\n name: '中文标点', // 布局显示名称\n supportShift: false, // 不支持Shift切换(标点键盘无需大小写)\n switchable: ['qwerty', 'punct-en'], // 可切换到QWERTY键盘和英文标点键盘\n rows: [\n // 第一行:常用中文标点符号\n {\n className: 'virtual-keyboard__row', // 行的CSS类名\n keys: [',', '。', '?', '!', ':', ';', '\"', '\"'].map(s => p(s)), // 逗号、句号、问号、感叹号、冒号、分号、左右双引号\n },\n // 第二行:括号类标点符号\n {\n className: 'virtual-keyboard__row', // 行的CSS类名\n keys: ['(', ')', '【', '】', '《', '》', '……', '——'].map(s => p(s)), // 小括号、中括号、书名号、省略号、破折号\n },\n // 第三行:其他标点 + 退格键\n {\n className: 'virtual-keyboard__row', // 行的CSS类名\n keys: [\n p('·'), // 间隔号(中间点)\n p('、'), // 顿号\n p('「'), // 左单书名号\n p('」'), // 右单书名号\n p('『'), // 左双书名号\n p('』'), // 右双书名号\n p('~'), // 波浪号\n { id: 'backspace', type: 'backspace', icon: ICON_DELETE, label: '', className: 'key-numpad-fn' }, // 退格键\n ],\n },\n // 底部行:切换键盘 + 空格 + 确认\n {\n className: 'virtual-keyboard__row', // 行的CSS类名\n keys: [\n { id: 'switch-punct-en', type: 'tab', label: '英', data: { targetType: 'punct-en' }, className: 'key-numpad-fn' }, // 切换到英文标点键盘\n { id: 'switch-qwerty', type: 'tab', label: 'ABC', data: { targetType: 'qwerty' }, className: 'key-numpad-fn' }, // 切换到QWERTY字母键盘\n { id: 'space', type: 'space', label: '空格', value: ' ', width: 4, className: 'key-num' }, // 空格键,宽度4倍\n { id: 'done', type: 'done', icon: ICON_CHECK, label: '', width: 2, className: 'key-numpad-done' }, // 确认/完成按钮,宽度2倍\n ],\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;AAgBA,SAAS,EAAE,OAAe,OAA+B;CACvD,OAAO;EAAE,IAAI,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 *
|
|
6
|
+
* Build mode: production *
|
|
7
|
+
* Minified: No *
|
|
8
|
+
* ***********************************
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
//#region src/layouts/qwerty.ts
|
|
12
|
+
function createCharKey(char) {
|
|
13
|
+
return {
|
|
14
|
+
id: `char-${char.toLowerCase()}`,
|
|
15
|
+
type: "char",
|
|
16
|
+
label: {
|
|
17
|
+
lower: char.toLowerCase(),
|
|
18
|
+
upper: char.toUpperCase()
|
|
19
|
+
},
|
|
20
|
+
value: {
|
|
21
|
+
lower: char.toLowerCase(),
|
|
22
|
+
upper: char.toUpperCase()
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const qwertyLayout = {
|
|
27
|
+
type: "qwerty",
|
|
28
|
+
name: "字母键盘",
|
|
29
|
+
supportShift: true,
|
|
30
|
+
defaultUpperCase: false,
|
|
31
|
+
switchable: ["number", "symbol"],
|
|
32
|
+
rows: [
|
|
33
|
+
{ keys: [
|
|
34
|
+
createCharKey("Q"),
|
|
35
|
+
createCharKey("W"),
|
|
36
|
+
createCharKey("E"),
|
|
37
|
+
createCharKey("R"),
|
|
38
|
+
createCharKey("T"),
|
|
39
|
+
createCharKey("Y"),
|
|
40
|
+
createCharKey("U"),
|
|
41
|
+
createCharKey("I"),
|
|
42
|
+
createCharKey("O"),
|
|
43
|
+
createCharKey("P")
|
|
44
|
+
] },
|
|
45
|
+
{ keys: [
|
|
46
|
+
createCharKey("A"),
|
|
47
|
+
createCharKey("S"),
|
|
48
|
+
createCharKey("D"),
|
|
49
|
+
createCharKey("F"),
|
|
50
|
+
createCharKey("G"),
|
|
51
|
+
createCharKey("H"),
|
|
52
|
+
createCharKey("J"),
|
|
53
|
+
createCharKey("K"),
|
|
54
|
+
createCharKey("L")
|
|
55
|
+
] },
|
|
56
|
+
{ keys: [
|
|
57
|
+
{
|
|
58
|
+
id: "shift",
|
|
59
|
+
type: "shift",
|
|
60
|
+
label: "⇧",
|
|
61
|
+
width: 1.5,
|
|
62
|
+
className: "key-shift"
|
|
63
|
+
},
|
|
64
|
+
createCharKey("Z"),
|
|
65
|
+
createCharKey("X"),
|
|
66
|
+
createCharKey("C"),
|
|
67
|
+
createCharKey("V"),
|
|
68
|
+
createCharKey("B"),
|
|
69
|
+
createCharKey("N"),
|
|
70
|
+
createCharKey("M"),
|
|
71
|
+
{
|
|
72
|
+
id: "backspace",
|
|
73
|
+
type: "backspace",
|
|
74
|
+
label: "⌫",
|
|
75
|
+
width: 1.5,
|
|
76
|
+
className: "key-backspace"
|
|
77
|
+
}
|
|
78
|
+
] },
|
|
79
|
+
{ keys: [
|
|
80
|
+
{
|
|
81
|
+
id: "switch-number",
|
|
82
|
+
type: "tab",
|
|
83
|
+
label: "123",
|
|
84
|
+
width: 1.5,
|
|
85
|
+
className: "key-switch",
|
|
86
|
+
data: { targetType: "number" }
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "switch-symbol",
|
|
90
|
+
type: "tab",
|
|
91
|
+
label: "#+=",
|
|
92
|
+
width: 1.25,
|
|
93
|
+
className: "key-switch",
|
|
94
|
+
data: { targetType: "symbol" }
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "space",
|
|
98
|
+
type: "space",
|
|
99
|
+
label: "空格",
|
|
100
|
+
value: " ",
|
|
101
|
+
width: 4,
|
|
102
|
+
className: "key-space"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: "done",
|
|
106
|
+
type: "done",
|
|
107
|
+
label: "完成",
|
|
108
|
+
width: 2,
|
|
109
|
+
className: "key-done"
|
|
110
|
+
}
|
|
111
|
+
] }
|
|
112
|
+
]
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
exports.qwertyLayout = qwertyLayout;
|
|
116
|
+
/*! End of @composy/keyboard-core | Powered by @composy/builder */
|
|
117
|
+
//# sourceMappingURL=qwerty.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwerty.cjs","names":[],"sources":["../../src/layouts/qwerty.ts"],"sourcesContent":["/**\n * QWERTY 标准字母键盘布局\n * @module layouts/qwerty\n */\n\nimport type { KeyboardConfig, KeyDefinition } from '../types'\n\n/**\n * 创建字符按键\n */\nfunction createCharKey(char: string): KeyDefinition {\n return {\n id: `char-${char.toLowerCase()}`,\n type: 'char',\n label: { lower: char.toLowerCase(), upper: char.toUpperCase() },\n value: { lower: char.toLowerCase(), upper: char.toUpperCase() },\n }\n}\n\n/**\n * QWERTY 键盘配置\n */\nexport const qwertyLayout: KeyboardConfig = {\n type: 'qwerty',\n name: '字母键盘',\n supportShift: true,\n defaultUpperCase: false,\n switchable: ['number', 'symbol'],\n rows: [\n {\n keys: [\n createCharKey('Q'),\n createCharKey('W'),\n createCharKey('E'),\n createCharKey('R'),\n createCharKey('T'),\n createCharKey('Y'),\n createCharKey('U'),\n createCharKey('I'),\n createCharKey('O'),\n createCharKey('P'),\n ],\n },\n {\n keys: [\n createCharKey('A'),\n createCharKey('S'),\n createCharKey('D'),\n createCharKey('F'),\n createCharKey('G'),\n createCharKey('H'),\n createCharKey('J'),\n createCharKey('K'),\n createCharKey('L'),\n ],\n },\n {\n keys: [\n {\n id: 'shift',\n type: 'shift',\n label: '⇧',\n width: 1.5,\n className: 'key-shift',\n },\n createCharKey('Z'),\n createCharKey('X'),\n createCharKey('C'),\n createCharKey('V'),\n createCharKey('B'),\n createCharKey('N'),\n createCharKey('M'),\n {\n id: 'backspace',\n type: 'backspace',\n label: '⌫',\n width: 1.5,\n className: 'key-backspace',\n },\n ],\n },\n {\n keys: [\n {\n id: 'switch-number',\n type: 'tab',\n label: '123',\n width: 1.5,\n className: 'key-switch',\n data: { targetType: 'number' },\n },\n {\n id: 'switch-symbol',\n type: 'tab',\n label: '#+=',\n width: 1.25,\n className: 'key-switch',\n data: { targetType: 'symbol' },\n },\n {\n id: 'space',\n type: 'space',\n label: '空格',\n value: ' ',\n width: 4,\n className: 'key-space',\n },\n {\n id: 'done',\n type: 'done',\n label: '完成',\n width: 2,\n className: 'key-done',\n },\n ],\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAS,cAAc,MAA6B;CAClD,OAAO;EACL,IAAI,QAAQ,KAAK,YAAY;EAC7B,MAAM;EACN,OAAO;GAAE,OAAO,KAAK,YAAY;GAAG,OAAO,KAAK,YAAY;EAAE;EAC9D,OAAO;GAAE,OAAO,KAAK,YAAY;GAAG,OAAO,KAAK,YAAY;EAAE;CAChE;AACF;AAKO,MAAM,eAA+B;CAC1C,MAAM;CACN,MAAM;CACN,cAAc;CACd,kBAAkB;CAClB,YAAY,CAAC,UAAU,QAAQ;CAC/B,MAAM;EACJ,EACE,MAAM;GACJ,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;EACnB,EACF;EACA,EACE,MAAM;GACJ,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;EACnB,EACF;EACA,EACE,MAAM;GACJ;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,OAAO;IACP,WAAW;GACb;GACA,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB,cAAc,GAAG;GACjB;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,OAAO;IACP,WAAW;GACb;EACF,EACF;EACA,EACE,MAAM;GACJ;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,OAAO;IACP,WAAW;IACX,MAAM,EAAE,YAAY,SAAS;GAC/B;GACA;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,OAAO;IACP,WAAW;IACX,MAAM,EAAE,YAAY,SAAS;GAC/B;GACA;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,WAAW;GACb;GACA;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,OAAO;IACP,WAAW;GACb;EACF,EACF;CACF;AACF"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ***********************************
|
|
3
|
+
* @composy/keyboard-core v0.0.1 *
|
|
4
|
+
* Built with rollup *
|
|
5
|
+
* Build time: 2024-08-17 11:33:29 *
|
|
6
|
+
* Build mode: production *
|
|
7
|
+
* Minified: No *
|
|
8
|
+
* ***********************************
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
const require_icons = require("../icons.cjs");
|
|
12
|
+
//#region src/layouts/search.ts
|
|
13
|
+
function createCharKey(char) {
|
|
14
|
+
return {
|
|
15
|
+
id: `search-char-${char.toLowerCase()}`,
|
|
16
|
+
type: "char",
|
|
17
|
+
label: {
|
|
18
|
+
lower: char.toLowerCase(),
|
|
19
|
+
upper: char.toUpperCase()
|
|
20
|
+
},
|
|
21
|
+
value: {
|
|
22
|
+
lower: char.toLowerCase(),
|
|
23
|
+
upper: char.toUpperCase()
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const searchLayout = {
|
|
28
|
+
type: "search",
|
|
29
|
+
name: "搜索键盘",
|
|
30
|
+
supportShift: true,
|
|
31
|
+
defaultUpperCase: false,
|
|
32
|
+
switchable: ["symbol", "number"],
|
|
33
|
+
rows: [
|
|
34
|
+
{ keys: "qwertyuiop".split("").map(createCharKey) },
|
|
35
|
+
{ keys: "asdfghjkl".split("").map(createCharKey) },
|
|
36
|
+
{ keys: [
|
|
37
|
+
{
|
|
38
|
+
id: "shift",
|
|
39
|
+
type: "shift",
|
|
40
|
+
icon: require_icons.ICON_SHIFT,
|
|
41
|
+
label: "",
|
|
42
|
+
width: 1.5,
|
|
43
|
+
className: "key-shift"
|
|
44
|
+
},
|
|
45
|
+
..."zxcvbnm".split("").map(createCharKey),
|
|
46
|
+
{
|
|
47
|
+
id: "backspace",
|
|
48
|
+
type: "backspace",
|
|
49
|
+
icon: require_icons.ICON_DELETE,
|
|
50
|
+
label: "",
|
|
51
|
+
width: 1.5,
|
|
52
|
+
className: "key-backspace"
|
|
53
|
+
}
|
|
54
|
+
] },
|
|
55
|
+
{ keys: [
|
|
56
|
+
{
|
|
57
|
+
id: "switch-number",
|
|
58
|
+
type: "tab",
|
|
59
|
+
label: "123",
|
|
60
|
+
width: 1.25,
|
|
61
|
+
className: "key-switch",
|
|
62
|
+
data: { targetType: "number" }
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "switch-symbol",
|
|
66
|
+
type: "tab",
|
|
67
|
+
label: "#+=",
|
|
68
|
+
width: 1.25,
|
|
69
|
+
className: "key-switch",
|
|
70
|
+
data: { targetType: "symbol" }
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "space",
|
|
74
|
+
type: "space",
|
|
75
|
+
label: "",
|
|
76
|
+
value: " ",
|
|
77
|
+
width: 4,
|
|
78
|
+
className: "key-space"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "voice",
|
|
82
|
+
type: "custom",
|
|
83
|
+
icon: require_icons.ICON_VOICE,
|
|
84
|
+
label: "",
|
|
85
|
+
width: 1,
|
|
86
|
+
className: "key-voice",
|
|
87
|
+
data: { action: "voice" }
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "search-done",
|
|
91
|
+
type: "done",
|
|
92
|
+
label: "搜索",
|
|
93
|
+
width: 2,
|
|
94
|
+
className: "key-done"
|
|
95
|
+
}
|
|
96
|
+
] }
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
exports.searchLayout = searchLayout;
|
|
101
|
+
/*! End of @composy/keyboard-core | Powered by @composy/builder */
|
|
102
|
+
//# sourceMappingURL=search.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.cjs","names":[],"sources":["../../src/layouts/search.ts"],"sourcesContent":["/**\n * 搜索键盘布局\n * @module layouts/search\n */\n\n// 导入键盘配置和按键定义的类型\nimport type { KeyboardConfig, KeyDefinition } from '../types'\n// 导入删除、Shift和语音图标资源\nimport { ICON_DELETE, ICON_SHIFT, ICON_VOICE } from '../icons'\n\n/**\n * 创建字符按键(支持大小写)\n * @param char - 字符,用于生成大小写标签和值\n * @returns 返回一个按键定义对象\n */\nfunction createCharKey(char: string): KeyDefinition {\n return {\n id: `search-char-${char.toLowerCase()}`, // 按键唯一标识,格式为 search-char-x\n type: 'char', // 按键类型为字符键\n label: { lower: char.toLowerCase(), upper: char.toUpperCase() }, // 显示标签:小写/大写\n value: { lower: char.toLowerCase(), upper: char.toUpperCase() }, // 输出值:小写/大写\n }\n}\n\n// 导出搜索键盘布局配置\nexport const searchLayout: KeyboardConfig = {\n type: 'search', // 布局类型标识为 search\n name: '搜索键盘', // 布局显示名称\n supportShift: true, // 支持Shift切换大小写\n defaultUpperCase: false, // 默认为小写状态\n switchable: ['symbol', 'number'], // 可切换到符号键盘和数字键盘\n rows: [\n // QWERTY 第一行:q w e r t y u i o p\n {\n keys: 'qwertyuiop'.split('').map(createCharKey), // 将字符串拆分为字符数组,逐个创建按键\n },\n // QWERTY 第二行:a s d f g h j k l\n {\n keys: 'asdfghjkl'.split('').map(createCharKey), // 将字符串拆分为字符数组,逐个创建按键\n },\n // QWERTY 第三行 + Shift + 退格\n {\n keys: [\n {\n id: 'shift', // Shift键标识\n type: 'shift', // 按键类型为Shift\n icon: ICON_SHIFT, // 使用Shift图标\n label: '', // 无文字标签,仅显示图标\n width: 1.5, // 宽度为1.5倍\n className: 'key-shift', // CSS类名\n },\n ...'zxcvbnm'.split('').map(createCharKey), // 展开第三行字母 z x c v b n m 的按键定义\n {\n id: 'backspace', // 退格键标识\n type: 'backspace', // 按键类型为退格\n icon: ICON_DELETE, // 使用删除图标\n label: '', // 无文字标签,仅显示图标\n width: 1.5, // 宽度为1.5倍\n className: 'key-backspace', // CSS类名\n },\n ],\n },\n // 底部行:切换 + 空格 + 语音 + 搜索\n {\n keys: [\n { id: 'switch-number', type: 'tab', label: '123', width: 1.25, className: 'key-switch', data: { targetType: 'number' } }, // 切换到数字键盘,宽度1.25倍\n { id: 'switch-symbol', type: 'tab', label: '#+=', width: 1.25, className: 'key-switch', data: { targetType: 'symbol' } }, // 切换到符号键盘,宽度1.25倍\n { id: 'space', type: 'space', label: '', value: ' ', width: 4, className: 'key-space' }, // 空格键,宽度4倍\n { id: 'voice', type: 'custom', icon: ICON_VOICE, label: '', width: 1, className: 'key-voice', data: { action: 'voice' } }, // 语音输入按钮,宽度1倍\n { id: 'search-done', type: 'done', label: '搜索', width: 2, className: 'key-done' }, // 搜索/完成按钮,宽度2倍\n ],\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;AAeA,SAAS,cAAc,MAA6B;CAClD,OAAO;EACL,IAAI,eAAe,KAAK,YAAY;EACpC,MAAM;EACN,OAAO;GAAE,OAAO,KAAK,YAAY;GAAG,OAAO,KAAK,YAAY;EAAE;EAC9D,OAAO;GAAE,OAAO,KAAK,YAAY;GAAG,OAAO,KAAK,YAAY;EAAE;CAChE;AACF;AAGO,MAAM,eAA+B;CAC1C,MAAM;CACN,MAAM;CACN,cAAc;CACd,kBAAkB;CAClB,YAAY,CAAC,UAAU,QAAQ;CAC/B,MAAM;EAEJ,EACE,MAAM,aAAa,MAAM,EAAE,CAAA,CAAE,IAAI,aAAa,EAChD;EAEA,EACE,MAAM,YAAY,MAAM,EAAE,CAAA,CAAE,IAAI,aAAa,EAC/C;EAEA,EACE,MAAM;GACJ;IACE,IAAI;IACJ,MAAM;IACN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