@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,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/amount.ts
|
|
13
|
+
function createNumberKey(num) {
|
|
14
|
+
return {
|
|
15
|
+
id: `amount-${num}`,
|
|
16
|
+
type: "char",
|
|
17
|
+
label: num,
|
|
18
|
+
value: num,
|
|
19
|
+
className: "key-num"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const amountLayout = {
|
|
23
|
+
type: "amount",
|
|
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: "double-zero",
|
|
65
|
+
type: "char",
|
|
66
|
+
label: "00",
|
|
67
|
+
value: "00",
|
|
68
|
+
className: "key-num"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
className: "numpad-row",
|
|
74
|
+
keys: [
|
|
75
|
+
{
|
|
76
|
+
id: "decimal",
|
|
77
|
+
type: "char",
|
|
78
|
+
label: ".",
|
|
79
|
+
value: ".",
|
|
80
|
+
className: "key-num"
|
|
81
|
+
},
|
|
82
|
+
createNumberKey("0"),
|
|
83
|
+
{
|
|
84
|
+
id: "done",
|
|
85
|
+
type: "done",
|
|
86
|
+
label: "确定",
|
|
87
|
+
width: 2,
|
|
88
|
+
className: "key-numpad-done"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
data: {
|
|
94
|
+
inputType: "amount",
|
|
95
|
+
decimalPlaces: 2
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const amountSimpleLayout = {
|
|
99
|
+
type: "amount-simple",
|
|
100
|
+
name: "金额键盘",
|
|
101
|
+
supportShift: false,
|
|
102
|
+
rows: [
|
|
103
|
+
{
|
|
104
|
+
className: "numpad-row",
|
|
105
|
+
keys: [
|
|
106
|
+
createNumberKey("1"),
|
|
107
|
+
createNumberKey("2"),
|
|
108
|
+
createNumberKey("3"),
|
|
109
|
+
{
|
|
110
|
+
id: "backspace",
|
|
111
|
+
type: "backspace",
|
|
112
|
+
icon: require_icons.ICON_DELETE,
|
|
113
|
+
label: "",
|
|
114
|
+
className: "key-numpad-fn"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
className: "numpad-row",
|
|
120
|
+
keys: [
|
|
121
|
+
createNumberKey("4"),
|
|
122
|
+
createNumberKey("5"),
|
|
123
|
+
createNumberKey("6"),
|
|
124
|
+
{
|
|
125
|
+
id: "clear",
|
|
126
|
+
type: "clear",
|
|
127
|
+
icon: require_icons.ICON_CLEAR,
|
|
128
|
+
label: "",
|
|
129
|
+
className: "key-numpad-fn"
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
className: "numpad-row",
|
|
135
|
+
keys: [
|
|
136
|
+
createNumberKey("7"),
|
|
137
|
+
createNumberKey("8"),
|
|
138
|
+
createNumberKey("9"),
|
|
139
|
+
{
|
|
140
|
+
id: "close",
|
|
141
|
+
type: "close",
|
|
142
|
+
label: "关闭",
|
|
143
|
+
className: "key-numpad-fn"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
className: "numpad-row",
|
|
149
|
+
keys: [
|
|
150
|
+
{
|
|
151
|
+
id: "decimal",
|
|
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
|
+
inputType: "amount",
|
|
170
|
+
decimalPlaces: 2
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
exports.amountLayout = amountLayout;
|
|
175
|
+
exports.amountSimpleLayout = amountSimpleLayout;
|
|
176
|
+
/*! End of @composy/keyboard-core | Powered by @composy/builder */
|
|
177
|
+
//# sourceMappingURL=amount.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amount.cjs","names":[],"sources":["../../src/layouts/amount.ts"],"sourcesContent":["/**\n * 金额键盘布局\n * @module layouts/amount\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: `amount-${num}`,\n type: 'char',\n label: num,\n value: num,\n className: 'key-num',\n }\n}\n\n/**\n * 金额键盘配置 - 紧凑4x4布局\n */\nexport const amountLayout: KeyboardConfig = {\n type: 'amount',\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: 'double-zero',\n type: 'char',\n label: '00',\n value: '00',\n className: 'key-num',\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 data: {\n inputType: 'amount',\n decimalPlaces: 2,\n },\n}\n\n/**\n * 简洁金额键盘 - 紧凑4x4布局\n */\nexport const amountSimpleLayout: KeyboardConfig = {\n type: 'amount-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: '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 data: {\n inputType: 'amount',\n decimalPlaces: 2,\n },\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAS,gBAAgB,KAA4B;CACnD,OAAO;EACL,IAAI,UAAU;EACd,MAAM;EACN,OAAO;EACP,OAAO;EACP,WAAW;CACb;AACF;AAKO,MAAM,eAA+B;CAC1C,MAAM;CACN,MAAM;CACN,cAAc;CACd,MAAM;EACJ;GACE,WAAW;GACX,MAAM;IACJ,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB;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,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,eAAe;CACjB;AACF;AAKO,MAAM,qBAAqC;CAChD,MAAM;CACN,MAAM;CACN,cAAc;CACd,MAAM;EACJ;GACE,WAAW;GACX,MAAM;IACJ,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB;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,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,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,eAAe;CACjB;AACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 金额键盘布局
|
|
3
|
+
* @module layouts/amount
|
|
4
|
+
*/
|
|
5
|
+
import type { KeyboardConfig } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* 金额键盘配置 - 紧凑4x4布局
|
|
8
|
+
*/
|
|
9
|
+
export declare const amountLayout: KeyboardConfig;
|
|
10
|
+
/**
|
|
11
|
+
* 简洁金额键盘 - 紧凑4x4布局
|
|
12
|
+
*/
|
|
13
|
+
export declare const amountSimpleLayout: KeyboardConfig;
|
|
14
|
+
//# sourceMappingURL=amount.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
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/bankcard.ts
|
|
13
|
+
function createNumberKey(num) {
|
|
14
|
+
return {
|
|
15
|
+
id: `bankcard-${num}`,
|
|
16
|
+
type: "char",
|
|
17
|
+
label: num,
|
|
18
|
+
value: num,
|
|
19
|
+
className: "key-num"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const bankcardLayout = {
|
|
23
|
+
type: "bankcard",
|
|
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: "switch-qwerty",
|
|
76
|
+
type: "tab",
|
|
77
|
+
label: "ABC",
|
|
78
|
+
className: "key-numpad-fn",
|
|
79
|
+
data: { targetType: "qwerty" }
|
|
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: 19,
|
|
94
|
+
inputType: "bankcard"
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
//#endregion
|
|
98
|
+
exports.bankcardLayout = bankcardLayout;
|
|
99
|
+
/*! End of @composy/keyboard-core | Powered by @composy/builder */
|
|
100
|
+
//# sourceMappingURL=bankcard.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bankcard.cjs","names":[],"sources":["../../src/layouts/bankcard.ts"],"sourcesContent":["/**\n * 银行卡键盘布局\n * @module layouts/bankcard\n */\n\n// 从类型定义文件中导入 KeyboardConfig(键盘配置)和 KeyDefinition(按键定义)类型\nimport type { KeyboardConfig, KeyDefinition } from '../types'\n// 从图标模块中导入删除键图标和清除键图标\nimport { ICON_DELETE, ICON_CLEAR } from '../icons'\n\n/**\n * 创建数字按键\n * @param num - 数字字符串(如 '0'-'9')\n * @returns 返回一个按键定义对象\n */\nfunction createNumberKey(num: string): KeyDefinition {\n return {\n id: `bankcard-${num}`, // 按键唯一标识符,格式为 bankcard-数字\n type: 'char', // 按键类型为字符键\n label: num, // 按键上显示的文本\n value: num, // 按键按下后输出的值\n className: 'key-num', // 按键的 CSS 类名,用于样式定制\n }\n}\n\n/**\n * 银行卡键盘配置 - 紧凑4x4布局\n * 布局结构:\n * 第1行: 1 2 3 [退格]\n * 第2行: 4 5 6 [清除]\n * 第3行: 7 8 9 [关闭]\n * 第4行: [ABC] 0 [确定(占2格)]\n */\nexport const bankcardLayout: KeyboardConfig = {\n type: 'bankcard', // 键盘类型标识\n name: '银行卡键盘', // 键盘的显示名称\n supportShift: false, // 不支持 Shift 切换(纯数字键盘无需切换)\n rows: [ // 键盘的行数组\n // ---- 第1行 ----\n {\n className: 'numpad-row', // 行的 CSS 类名\n keys: [ // 该行包含的按键数组\n createNumberKey('1'), // 数字键 1\n createNumberKey('2'), // 数字键 2\n createNumberKey('3'), // 数字键 3\n {\n id: 'backspace', // 退格键的唯一标识\n type: 'backspace', // 按键类型为退格,删除最后一个字符\n icon: ICON_DELETE, // 使用删除图标作为显示内容\n label: '', // 无文本标签(由图标替代)\n className: 'key-numpad-fn', // 功能键的 CSS 类名\n },\n ],\n },\n // ---- 第2行 ----\n {\n className: 'numpad-row', // 行的 CSS 类名\n keys: [\n createNumberKey('4'), // 数字键 4\n createNumberKey('5'), // 数字键 5\n createNumberKey('6'), // 数字键 6\n {\n id: 'clear', // 清除键的唯一标识\n type: 'clear', // 按键类型为清除,清空所有输入\n icon: ICON_CLEAR, // 使用清除图标作为显示内容\n label: '', // 无文本标签\n className: 'key-numpad-fn', // 功能键的 CSS 类名\n },\n ],\n },\n // ---- 第3行 ----\n {\n className: 'numpad-row', // 行的 CSS 类名\n keys: [\n createNumberKey('7'), // 数字键 7\n createNumberKey('8'), // 数字键 8\n createNumberKey('9'), // 数字键 9\n {\n id: 'close', // 关闭键的唯一标识\n type: 'close', // 按键类型为关闭,收起键盘\n label: '关闭', // 按钮上显示的文本\n className: 'key-numpad-fn', // 功能键的 CSS 类名\n },\n ],\n },\n // ---- 第4行 ----\n {\n className: 'numpad-row', // 行的 CSS 类名\n keys: [\n {\n id: 'switch-qwerty', // 切换到全键盘的按键唯一标识\n type: 'tab', // 按键类型为标签页切换\n label: 'ABC', // 按钮上显示的文本,提示可切换到字母键盘\n className: 'key-numpad-fn', // 功能键的 CSS 类名\n data: { targetType: 'qwerty' }, // 附加数据,指定切换目标为 QWERTY 全键盘\n },\n createNumberKey('0'), // 数字键 0\n {\n id: 'done', // 确定键的唯一标识\n type: 'done', // 按键类型为确定,完成输入\n label: '确定', // 按钮上显示的文本\n width: 2, // 占据 2 个键的宽度\n className: 'key-numpad-done', // 确定键的 CSS 类名\n },\n ],\n },\n ],\n data: { // 键盘的附加数据\n maxLength: 19, // 银行卡号最大输入长度为 19 位\n inputType: 'bankcard', // 输入类型标识,用于外部判断\n },\n}\n"],"mappings":";;;;;;;;;;;;AAeA,SAAS,gBAAgB,KAA4B;CACnD,OAAO;EACL,IAAI,YAAY;EAChB,MAAM;EACN,OAAO;EACP,OAAO;EACP,WAAW;CACb;AACF;AAUO,MAAM,iBAAiC;CAC5C,MAAM;CACN,MAAM;CACN,cAAc;CACd,MAAM;EAEJ;GACE,WAAW;GACX,MAAM;IACJ,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB;KACE,IAAI;KACJ,MAAM;KACN,MAAM,cAAA;KACN,OAAO;KACP,WAAW;IACb;GACF;EACF;EAEA;GACE,WAAW;GACX,MAAM;IACJ,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB;KACE,IAAI;KACJ,MAAM;KACN,MAAM,cAAA;KACN,OAAO;KACP,WAAW;IACb;GACF;EACF;EAEA;GACE,WAAW;GACX,MAAM;IACJ,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB;KACE,IAAI;KACJ,MAAM;KACN,OAAO;KACP,WAAW;IACb;GACF;EACF;EAEA;GACE,WAAW;GACX,MAAM;IACJ;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;CACA,MAAM;EACJ,WAAW;EACX,WAAW;CACb;AACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 银行卡键盘布局
|
|
3
|
+
* @module layouts/bankcard
|
|
4
|
+
*/
|
|
5
|
+
import type { KeyboardConfig } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* 银行卡键盘配置 - 紧凑4x4布局
|
|
8
|
+
* 布局结构:
|
|
9
|
+
* 第1行: 1 2 3 [退格]
|
|
10
|
+
* 第2行: 4 5 6 [清除]
|
|
11
|
+
* 第3行: 7 8 9 [关闭]
|
|
12
|
+
* 第4行: [ABC] 0 [确定(占2格)]
|
|
13
|
+
*/
|
|
14
|
+
export declare const bankcardLayout: KeyboardConfig;
|
|
15
|
+
//# sourceMappingURL=bankcard.d.ts.map
|
|
@@ -0,0 +1,128 @@
|
|
|
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/email.ts
|
|
13
|
+
function createCharKey(char) {
|
|
14
|
+
return {
|
|
15
|
+
id: `email-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
|
+
function snippet(label, id) {
|
|
28
|
+
return {
|
|
29
|
+
id: id || `email-snippet-${label.replace(/[^a-z0-9]/gi, "")}`,
|
|
30
|
+
type: "char",
|
|
31
|
+
label,
|
|
32
|
+
value: label,
|
|
33
|
+
className: "key-snippet"
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const EMAIL_SUFFIXES = [
|
|
37
|
+
"@qq.com",
|
|
38
|
+
"@163.com",
|
|
39
|
+
"@126.com",
|
|
40
|
+
"@gmail.com",
|
|
41
|
+
"@outlook.com",
|
|
42
|
+
"@hotmail.com",
|
|
43
|
+
"@sina.com",
|
|
44
|
+
"@sohu.com",
|
|
45
|
+
"@icloud.com",
|
|
46
|
+
"@foxmail.com",
|
|
47
|
+
"@yeah.net",
|
|
48
|
+
"@139.com"
|
|
49
|
+
];
|
|
50
|
+
const emailLayout = {
|
|
51
|
+
type: "email",
|
|
52
|
+
name: "邮箱键盘",
|
|
53
|
+
supportShift: true,
|
|
54
|
+
defaultUpperCase: false,
|
|
55
|
+
switchable: ["symbol", "number"],
|
|
56
|
+
rows: [
|
|
57
|
+
{ keys: "qwertyuiop".split("").map(createCharKey) },
|
|
58
|
+
{ keys: "asdfghjkl".split("").map(createCharKey) },
|
|
59
|
+
{ keys: [
|
|
60
|
+
{
|
|
61
|
+
id: "shift",
|
|
62
|
+
type: "shift",
|
|
63
|
+
icon: require_icons.ICON_SHIFT,
|
|
64
|
+
label: "",
|
|
65
|
+
width: 1.5,
|
|
66
|
+
className: "key-shift"
|
|
67
|
+
},
|
|
68
|
+
..."zxcvbnm".split("").map(createCharKey),
|
|
69
|
+
{
|
|
70
|
+
id: "backspace",
|
|
71
|
+
type: "backspace",
|
|
72
|
+
icon: require_icons.ICON_DELETE,
|
|
73
|
+
label: "",
|
|
74
|
+
width: 1.5,
|
|
75
|
+
className: "key-backspace"
|
|
76
|
+
}
|
|
77
|
+
] },
|
|
78
|
+
{ keys: [
|
|
79
|
+
{
|
|
80
|
+
id: "switch-number",
|
|
81
|
+
type: "tab",
|
|
82
|
+
label: "123",
|
|
83
|
+
width: 1.25,
|
|
84
|
+
className: "key-switch",
|
|
85
|
+
data: { targetType: "number" }
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "email-at",
|
|
89
|
+
type: "char",
|
|
90
|
+
label: "@",
|
|
91
|
+
value: "@",
|
|
92
|
+
className: "key-at"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "email-suffix",
|
|
96
|
+
type: "char",
|
|
97
|
+
label: ".com",
|
|
98
|
+
value: "",
|
|
99
|
+
width: 1.5,
|
|
100
|
+
className: "key-suffix",
|
|
101
|
+
options: EMAIL_SUFFIXES
|
|
102
|
+
},
|
|
103
|
+
snippet(".", "email-dot"),
|
|
104
|
+
snippet("-", "email-dash"),
|
|
105
|
+
snippet("_", "email-underscore"),
|
|
106
|
+
{
|
|
107
|
+
id: "space",
|
|
108
|
+
type: "space",
|
|
109
|
+
label: "",
|
|
110
|
+
value: " ",
|
|
111
|
+
width: 2,
|
|
112
|
+
className: "key-space"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "email-done",
|
|
116
|
+
type: "done",
|
|
117
|
+
label: "确定",
|
|
118
|
+
width: 1.5,
|
|
119
|
+
className: "key-done"
|
|
120
|
+
}
|
|
121
|
+
] }
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
//#endregion
|
|
125
|
+
exports.EMAIL_SUFFIXES = EMAIL_SUFFIXES;
|
|
126
|
+
exports.emailLayout = emailLayout;
|
|
127
|
+
/*! End of @composy/keyboard-core | Powered by @composy/builder */
|
|
128
|
+
//# sourceMappingURL=email.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.cjs","names":[],"sources":["../../src/layouts/email.ts"],"sourcesContent":["/**\n * 邮箱键盘布局\n * @module layouts/email\n */\n\nimport type { KeyboardConfig, KeyDefinition } from '../types'\nimport { ICON_DELETE, ICON_SHIFT } from '../icons'\n\n/**\n * 创建字符按键(支持大小写)\n */\nfunction createCharKey(char: string): KeyDefinition {\n return {\n id: `email-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 * 创建快捷片段按键\n */\nfunction snippet(label: string, id?: string): KeyDefinition {\n return {\n id: id || `email-snippet-${label.replace(/[^a-z0-9]/gi, '')}`,\n type: 'char',\n label,\n value: label,\n className: 'key-snippet',\n }\n}\n\n/**\n * 常见邮箱后缀列表\n */\nexport const EMAIL_SUFFIXES = [\n '@qq.com',\n '@163.com',\n '@126.com',\n '@gmail.com',\n '@outlook.com',\n '@hotmail.com',\n '@sina.com',\n '@sohu.com',\n '@icloud.com',\n '@foxmail.com',\n '@yeah.net',\n '@139.com',\n]\n\nexport const emailLayout: KeyboardConfig = {\n type: 'email',\n name: '邮箱键盘',\n supportShift: true,\n defaultUpperCase: false,\n switchable: ['symbol', 'number'],\n rows: [\n // QWERTY 第一行\n {\n keys: 'qwertyuiop'.split('').map(createCharKey),\n },\n // QWERTY 第二行\n {\n keys: 'asdfghjkl'.split('').map(createCharKey),\n },\n // QWERTY 第三行 + Shift + 退格\n {\n keys: [\n {\n id: 'shift',\n type: 'shift',\n icon: ICON_SHIFT,\n label: '',\n width: 1.5,\n className: 'key-shift',\n },\n ...'zxcvbnm'.split('').map(createCharKey),\n {\n id: 'backspace',\n type: 'backspace',\n icon: ICON_DELETE,\n label: '',\n width: 1.5,\n className: 'key-backspace',\n },\n ],\n },\n // 底部行:切换 + @ + 常用邮箱 + 符号 + 空格 + 完成\n {\n keys: [\n { id: 'switch-number', type: 'tab', label: '123', width: 1.25, className: 'key-switch', data: { targetType: 'number' } },\n {\n id: 'email-at',\n type: 'char',\n label: '@',\n value: '@',\n className: 'key-at',\n },\n {\n id: 'email-suffix',\n type: 'char',\n label: '.com',\n value: '',\n width: 1.5,\n className: 'key-suffix',\n options: EMAIL_SUFFIXES,\n },\n snippet('.', 'email-dot'),\n snippet('-', 'email-dash'),\n snippet('_', 'email-underscore'),\n { id: 'space', type: 'space', label: '', value: ' ', width: 2, className: 'key-space' },\n { id: 'email-done', type: 'done', label: '确定', width: 1.5, className: 'key-done' },\n ],\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAS,cAAc,MAA6B;CAClD,OAAO;EACL,IAAI,cAAc,KAAK,YAAY;EACnC,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;AAKA,SAAS,QAAQ,OAAe,IAA4B;CAC1D,OAAO;EACL,IAAI,MAAM,iBAAiB,MAAM,QAAQ,eAAe,EAAE;EAC1D,MAAM;EACN;EACA,OAAO;EACP,WAAW;CACb;AACF;AAKO,MAAM,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEO,MAAM,cAA8B;CACzC,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,MAAM,cAAA;IACN,OAAO;IACP,OAAO;IACP,WAAW;GACb;GACA,GAAG,UAAU,MAAM,EAAE,CAAA,CAAE,IAAI,aAAa;GACxC;IACE,IAAI;IACJ,MAAM;IACN,MAAM,cAAA;IACN,OAAO;IACP,OAAO;IACP,WAAW;GACb;EACF,EACF;EAEA,EACE,MAAM;GACJ;IAAE,IAAI;IAAiB,MAAM;IAAO,OAAO;IAAO,OAAO;IAAM,WAAW;IAAc,MAAM,EAAE,YAAY,SAAS;GAAE;GACvH;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,OAAO;IACP,WAAW;GACb;GACA;IACE,IAAI;IACJ,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,WAAW;IACX,SAAS;GACX;GACA,QAAQ,KAAK,WAAW;GACxB,QAAQ,KAAK,YAAY;GACzB,QAAQ,KAAK,kBAAkB;GAC/B;IAAE,IAAI;IAAS,MAAM;IAAS,OAAO;IAAI,OAAO;IAAK,OAAO;IAAG,WAAW;GAAY;GACtF;IAAE,IAAI;IAAc,MAAM;IAAQ,OAAO;IAAM,OAAO;IAAK,WAAW;GAAW;EACnF,EACF;CACF;AACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 邮箱键盘布局
|
|
3
|
+
* @module layouts/email
|
|
4
|
+
*/
|
|
5
|
+
import type { KeyboardConfig } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* 常见邮箱后缀列表
|
|
8
|
+
*/
|
|
9
|
+
export declare const EMAIL_SUFFIXES: string[];
|
|
10
|
+
export declare const emailLayout: KeyboardConfig;
|
|
11
|
+
//# sourceMappingURL=email.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
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/idcard.ts
|
|
13
|
+
function createNumberKey(num) {
|
|
14
|
+
return {
|
|
15
|
+
id: `idcard-${num}`,
|
|
16
|
+
type: "char",
|
|
17
|
+
label: num,
|
|
18
|
+
value: num,
|
|
19
|
+
className: "key-num"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const idcardLayout = {
|
|
23
|
+
type: "idcard",
|
|
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: "idcard-x",
|
|
65
|
+
type: "char",
|
|
66
|
+
label: "X",
|
|
67
|
+
value: "X",
|
|
68
|
+
className: "key-num"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
className: "numpad-row",
|
|
74
|
+
keys: [
|
|
75
|
+
{
|
|
76
|
+
id: "close",
|
|
77
|
+
type: "close",
|
|
78
|
+
label: "关闭",
|
|
79
|
+
className: "key-numpad-fn"
|
|
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: 18,
|
|
94
|
+
inputType: "idcard"
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
//#endregion
|
|
98
|
+
exports.idcardLayout = idcardLayout;
|
|
99
|
+
/*! End of @composy/keyboard-core | Powered by @composy/builder */
|
|
100
|
+
//# sourceMappingURL=idcard.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idcard.cjs","names":[],"sources":["../../src/layouts/idcard.ts"],"sourcesContent":["/**\n * 身份证号键盘布局\n * @module layouts/idcard\n */\n\n// 从类型定义文件中导入 KeyboardConfig(键盘配置)和 KeyDefinition(按键定义)类型\nimport type { KeyboardConfig, KeyDefinition } from '../types'\n// 从图标模块中导入删除键图标和清除键图标\nimport { ICON_DELETE, ICON_CLEAR } from '../icons'\n\n/**\n * 创建数字按键\n * @param num - 数字字符串(如 '0'-'9')\n * @returns 返回一个按键定义对象\n */\nfunction createNumberKey(num: string): KeyDefinition {\n return {\n id: `idcard-${num}`, // 按键唯一标识符,格式为 idcard-数字\n type: 'char', // 按键类型为字符键\n label: num, // 按键上显示的文本\n value: num, // 按键按下后输出的值\n className: 'key-num', // 按键的 CSS 类名,用于样式定制\n }\n}\n\n/**\n * 身份证号键盘配置\n * 紧凑3x4布局,无空白位置\n * 布局结构:\n * 第1行: 1 2 3 [退格]\n * 第2行: 4 5 6 [清除]\n * 第3行: 7 8 9 X\n * 第4行: [关闭] 0 [确定(占2格)]\n */\nexport const idcardLayout: KeyboardConfig = {\n type: 'idcard', // 键盘类型标识\n name: '身份证键盘', // 键盘的显示名称\n supportShift: false, // 不支持 Shift 切换(纯数字+X键盘无需切换)\n rows: [ // 键盘的行数组\n // ---- 第1行 ----\n {\n className: 'numpad-row', // 行的 CSS 类名\n keys: [ // 该行包含的按键数组\n createNumberKey('1'), // 数字键 1\n createNumberKey('2'), // 数字键 2\n createNumberKey('3'), // 数字键 3\n {\n id: 'backspace', // 退格键的唯一标识\n type: 'backspace', // 按键类型为退格,删除最后一个字符\n icon: ICON_DELETE, // 使用删除图标作为显示内容\n label: '', // 无文本标签(由图标替代)\n className: 'key-numpad-fn', // 功能键的 CSS 类名\n },\n ],\n },\n // ---- 第2行 ----\n {\n className: 'numpad-row', // 行的 CSS 类名\n keys: [\n createNumberKey('4'), // 数字键 4\n createNumberKey('5'), // 数字键 5\n createNumberKey('6'), // 数字键 6\n {\n id: 'clear', // 清除键的唯一标识\n type: 'clear', // 按键类型为清除,清空所有输入\n icon: ICON_CLEAR, // 使用清除图标作为显示内容\n label: '', // 无文本标签\n className: 'key-numpad-fn', // 功能键的 CSS 类名\n },\n ],\n },\n // ---- 第3行 ----\n {\n className: 'numpad-row', // 行的 CSS 类名\n keys: [\n createNumberKey('7'), // 数字键 7\n createNumberKey('8'), // 数字键 8\n createNumberKey('9'), // 数字键 9\n {\n id: 'idcard-x', // X 键的唯一标识\n type: 'char', // 按键类型为字符\n label: 'X', // 按钮上显示的文本(身份证尾号可能是X)\n value: 'X', // 按下后输出的值\n className: 'key-num', // 使用数字键的 CSS 类名,保持外观一致\n },\n ],\n },\n // ---- 第4行 ----\n {\n className: 'numpad-row', // 行的 CSS 类名\n keys: [\n {\n id: 'close', // 关闭键的唯一标识\n type: 'close', // 按键类型为关闭,收起键盘\n label: '关闭', // 按钮上显示的文本\n className: 'key-numpad-fn', // 功能键的 CSS 类名\n },\n createNumberKey('0'), // 数字键 0\n {\n id: 'done', // 确定键的唯一标识\n type: 'done', // 按键类型为确定,完成输入\n label: '确定', // 按钮上显示的文本\n width: 2, // 占据 2 个键的宽度\n className: 'key-numpad-done', // 确定键的 CSS 类名\n },\n ],\n },\n ],\n data: { // 键盘的附加数据\n maxLength: 18, // 身份证号最大输入长度为 18 位\n inputType: 'idcard', // 输入类型标识,用于外部判断\n },\n}\n"],"mappings":";;;;;;;;;;;;AAeA,SAAS,gBAAgB,KAA4B;CACnD,OAAO;EACL,IAAI,UAAU;EACd,MAAM;EACN,OAAO;EACP,OAAO;EACP,WAAW;CACb;AACF;AAWO,MAAM,eAA+B;CAC1C,MAAM;CACN,MAAM;CACN,cAAc;CACd,MAAM;EAEJ;GACE,WAAW;GACX,MAAM;IACJ,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB;KACE,IAAI;KACJ,MAAM;KACN,MAAM,cAAA;KACN,OAAO;KACP,WAAW;IACb;GACF;EACF;EAEA;GACE,WAAW;GACX,MAAM;IACJ,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB,gBAAgB,GAAG;IACnB;KACE,IAAI;KACJ,MAAM;KACN,MAAM,cAAA;KACN,OAAO;KACP,WAAW;IACb;GACF;EACF;EAEA;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;EAEA;GACE,WAAW;GACX,MAAM;IACJ;KACE,IAAI;KACJ,MAAM;KACN,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,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 身份证号键盘布局
|
|
3
|
+
* @module layouts/idcard
|
|
4
|
+
*/
|
|
5
|
+
import type { KeyboardConfig } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* 身份证号键盘配置
|
|
8
|
+
* 紧凑3x4布局,无空白位置
|
|
9
|
+
* 布局结构:
|
|
10
|
+
* 第1行: 1 2 3 [退格]
|
|
11
|
+
* 第2行: 4 5 6 [清除]
|
|
12
|
+
* 第3行: 7 8 9 X
|
|
13
|
+
* 第4行: [关闭] 0 [确定(占2格)]
|
|
14
|
+
*/
|
|
15
|
+
export declare const idcardLayout: KeyboardConfig;
|
|
16
|
+
//# sourceMappingURL=idcard.d.ts.map
|