@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.
Files changed (337) hide show
  1. package/README.md +37 -0
  2. package/dist/index.js +3605 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/index.min.js +1 -0
  5. package/es/icons.d.ts +58 -0
  6. package/es/icons.d.ts.map +1 -0
  7. package/es/icons.js +34 -0
  8. package/es/icons.js.map +1 -0
  9. package/es/index.d.ts +12 -0
  10. package/es/index.d.ts.map +1 -0
  11. package/es/index.js +36 -0
  12. package/es/layouts/amount.d.ts +14 -0
  13. package/es/layouts/amount.d.ts.map +1 -0
  14. package/es/layouts/amount.js +175 -0
  15. package/es/layouts/amount.js.map +1 -0
  16. package/es/layouts/bankcard.d.ts +15 -0
  17. package/es/layouts/bankcard.d.ts.map +1 -0
  18. package/es/layouts/bankcard.js +99 -0
  19. package/es/layouts/bankcard.js.map +1 -0
  20. package/es/layouts/email.d.ts +11 -0
  21. package/es/layouts/email.d.ts.map +1 -0
  22. package/es/layouts/email.js +126 -0
  23. package/es/layouts/email.js.map +1 -0
  24. package/es/layouts/idcard.d.ts +16 -0
  25. package/es/layouts/idcard.d.ts.map +1 -0
  26. package/es/layouts/idcard.js +99 -0
  27. package/es/layouts/idcard.js.map +1 -0
  28. package/es/layouts/index.d.ts +54 -0
  29. package/es/layouts/index.d.ts.map +1 -0
  30. package/es/layouts/index.js +78 -0
  31. package/es/layouts/index.js.map +1 -0
  32. package/es/layouts/license-plate.d.ts +35 -0
  33. package/es/layouts/license-plate.d.ts.map +1 -0
  34. package/es/layouts/license-plate.js +290 -0
  35. package/es/layouts/license-plate.js.map +1 -0
  36. package/es/layouts/number.d.ts +14 -0
  37. package/es/layouts/number.d.ts.map +1 -0
  38. package/es/layouts/number.js +168 -0
  39. package/es/layouts/number.js.map +1 -0
  40. package/es/layouts/phone.d.ts +15 -0
  41. package/es/layouts/phone.d.ts.map +1 -0
  42. package/es/layouts/phone.js +175 -0
  43. package/es/layouts/phone.js.map +1 -0
  44. package/es/layouts/punct.d.ts +7 -0
  45. package/es/layouts/punct.d.ts.map +1 -0
  46. package/es/layouts/punct.js +112 -0
  47. package/es/layouts/punct.js.map +1 -0
  48. package/es/layouts/qwerty.d.ts +10 -0
  49. package/es/layouts/qwerty.d.ts.map +1 -0
  50. package/es/layouts/qwerty.js +116 -0
  51. package/es/layouts/qwerty.js.map +1 -0
  52. package/es/layouts/search.d.ts +7 -0
  53. package/es/layouts/search.d.ts.map +1 -0
  54. package/es/layouts/search.js +101 -0
  55. package/es/layouts/search.js.map +1 -0
  56. package/es/layouts/symbol.d.ts +14 -0
  57. package/es/layouts/symbol.d.ts.map +1 -0
  58. package/es/layouts/symbol.js +194 -0
  59. package/es/layouts/symbol.js.map +1 -0
  60. package/es/layouts/url.d.ts +7 -0
  61. package/es/layouts/url.d.ts.map +1 -0
  62. package/es/layouts/url.js +99 -0
  63. package/es/layouts/url.js.map +1 -0
  64. package/es/layouts/verifycode.d.ts +15 -0
  65. package/es/layouts/verifycode.d.ts.map +1 -0
  66. package/es/layouts/verifycode.js +100 -0
  67. package/es/layouts/verifycode.js.map +1 -0
  68. package/es/managers/index.d.ts +8 -0
  69. package/es/managers/index.d.ts.map +1 -0
  70. package/es/managers/index.js +14 -0
  71. package/es/managers/keyboard-manager.d.ts +130 -0
  72. package/es/managers/keyboard-manager.d.ts.map +1 -0
  73. package/es/managers/keyboard-manager.js +374 -0
  74. package/es/managers/keyboard-manager.js.map +1 -0
  75. package/es/managers/keyboard-renderer.d.ts +115 -0
  76. package/es/managers/keyboard-renderer.d.ts.map +1 -0
  77. package/es/managers/keyboard-renderer.js +283 -0
  78. package/es/managers/keyboard-renderer.js.map +1 -0
  79. package/es/managers/position-manager.d.ts +72 -0
  80. package/es/managers/position-manager.d.ts.map +1 -0
  81. package/es/managers/position-manager.js +199 -0
  82. package/es/managers/position-manager.js.map +1 -0
  83. package/es/themes/index.d.ts +70 -0
  84. package/es/themes/index.d.ts.map +1 -0
  85. package/es/themes/index.js +99 -0
  86. package/es/themes/index.js.map +1 -0
  87. package/es/themes/presets.d.ts +39 -0
  88. package/es/themes/presets.d.ts.map +1 -0
  89. package/es/themes/presets.js +207 -0
  90. package/es/themes/presets.js.map +1 -0
  91. package/es/themes/types.d.ts +118 -0
  92. package/es/themes/types.d.ts.map +1 -0
  93. package/es/themes/types.js +10 -0
  94. package/es/types/index.d.ts +7 -0
  95. package/es/types/index.d.ts.map +1 -0
  96. package/es/types/index.js +10 -0
  97. package/es/types/keyboard.d.ts +253 -0
  98. package/es/types/keyboard.d.ts.map +1 -0
  99. package/es/types/keyboard.js +10 -0
  100. package/es/types/position.d.ts +139 -0
  101. package/es/types/position.d.ts.map +1 -0
  102. package/es/types/position.js +10 -0
  103. package/es/utils/device.d.ts +45 -0
  104. package/es/utils/device.d.ts.map +1 -0
  105. package/es/utils/device.js +111 -0
  106. package/es/utils/device.js.map +1 -0
  107. package/es/utils/dom.d.ts +69 -0
  108. package/es/utils/dom.d.ts.map +1 -0
  109. package/es/utils/dom.js +134 -0
  110. package/es/utils/dom.js.map +1 -0
  111. package/es/utils/event-emitter.d.ts +52 -0
  112. package/es/utils/event-emitter.d.ts.map +1 -0
  113. package/es/utils/event-emitter.js +99 -0
  114. package/es/utils/event-emitter.js.map +1 -0
  115. package/es/utils/formatters.d.ts +51 -0
  116. package/es/utils/formatters.d.ts.map +1 -0
  117. package/es/utils/formatters.js +57 -0
  118. package/es/utils/formatters.js.map +1 -0
  119. package/es/utils/index.d.ts +10 -0
  120. package/es/utils/index.d.ts.map +1 -0
  121. package/es/utils/index.js +16 -0
  122. package/es/utils/random.d.ts +71 -0
  123. package/es/utils/random.d.ts.map +1 -0
  124. package/es/utils/random.js +292 -0
  125. package/es/utils/random.js.map +1 -0
  126. package/esm/icons.d.ts +58 -0
  127. package/esm/icons.d.ts.map +1 -0
  128. package/esm/icons.js +34 -0
  129. package/esm/icons.js.map +1 -0
  130. package/esm/index.d.ts +12 -0
  131. package/esm/index.d.ts.map +1 -0
  132. package/esm/index.js +37 -0
  133. package/esm/layouts/amount.d.ts +14 -0
  134. package/esm/layouts/amount.d.ts.map +1 -0
  135. package/esm/layouts/amount.js +175 -0
  136. package/esm/layouts/amount.js.map +1 -0
  137. package/esm/layouts/bankcard.d.ts +15 -0
  138. package/esm/layouts/bankcard.d.ts.map +1 -0
  139. package/esm/layouts/bankcard.js +99 -0
  140. package/esm/layouts/bankcard.js.map +1 -0
  141. package/esm/layouts/email.d.ts +11 -0
  142. package/esm/layouts/email.d.ts.map +1 -0
  143. package/esm/layouts/email.js +126 -0
  144. package/esm/layouts/email.js.map +1 -0
  145. package/esm/layouts/idcard.d.ts +16 -0
  146. package/esm/layouts/idcard.d.ts.map +1 -0
  147. package/esm/layouts/idcard.js +99 -0
  148. package/esm/layouts/idcard.js.map +1 -0
  149. package/esm/layouts/index.d.ts +54 -0
  150. package/esm/layouts/index.d.ts.map +1 -0
  151. package/esm/layouts/index.js +78 -0
  152. package/esm/layouts/index.js.map +1 -0
  153. package/esm/layouts/license-plate.d.ts +35 -0
  154. package/esm/layouts/license-plate.d.ts.map +1 -0
  155. package/esm/layouts/license-plate.js +290 -0
  156. package/esm/layouts/license-plate.js.map +1 -0
  157. package/esm/layouts/number.d.ts +14 -0
  158. package/esm/layouts/number.d.ts.map +1 -0
  159. package/esm/layouts/number.js +168 -0
  160. package/esm/layouts/number.js.map +1 -0
  161. package/esm/layouts/phone.d.ts +15 -0
  162. package/esm/layouts/phone.d.ts.map +1 -0
  163. package/esm/layouts/phone.js +175 -0
  164. package/esm/layouts/phone.js.map +1 -0
  165. package/esm/layouts/punct.d.ts +7 -0
  166. package/esm/layouts/punct.d.ts.map +1 -0
  167. package/esm/layouts/punct.js +112 -0
  168. package/esm/layouts/punct.js.map +1 -0
  169. package/esm/layouts/qwerty.d.ts +10 -0
  170. package/esm/layouts/qwerty.d.ts.map +1 -0
  171. package/esm/layouts/qwerty.js +116 -0
  172. package/esm/layouts/qwerty.js.map +1 -0
  173. package/esm/layouts/search.d.ts +7 -0
  174. package/esm/layouts/search.d.ts.map +1 -0
  175. package/esm/layouts/search.js +101 -0
  176. package/esm/layouts/search.js.map +1 -0
  177. package/esm/layouts/symbol.d.ts +14 -0
  178. package/esm/layouts/symbol.d.ts.map +1 -0
  179. package/esm/layouts/symbol.js +194 -0
  180. package/esm/layouts/symbol.js.map +1 -0
  181. package/esm/layouts/url.d.ts +7 -0
  182. package/esm/layouts/url.d.ts.map +1 -0
  183. package/esm/layouts/url.js +99 -0
  184. package/esm/layouts/url.js.map +1 -0
  185. package/esm/layouts/verifycode.d.ts +15 -0
  186. package/esm/layouts/verifycode.d.ts.map +1 -0
  187. package/esm/layouts/verifycode.js +100 -0
  188. package/esm/layouts/verifycode.js.map +1 -0
  189. package/esm/managers/index.d.ts +8 -0
  190. package/esm/managers/index.d.ts.map +1 -0
  191. package/esm/managers/index.js +14 -0
  192. package/esm/managers/keyboard-manager.d.ts +130 -0
  193. package/esm/managers/keyboard-manager.d.ts.map +1 -0
  194. package/esm/managers/keyboard-manager.js +374 -0
  195. package/esm/managers/keyboard-manager.js.map +1 -0
  196. package/esm/managers/keyboard-renderer.d.ts +115 -0
  197. package/esm/managers/keyboard-renderer.d.ts.map +1 -0
  198. package/esm/managers/keyboard-renderer.js +283 -0
  199. package/esm/managers/keyboard-renderer.js.map +1 -0
  200. package/esm/managers/position-manager.d.ts +72 -0
  201. package/esm/managers/position-manager.d.ts.map +1 -0
  202. package/esm/managers/position-manager.js +199 -0
  203. package/esm/managers/position-manager.js.map +1 -0
  204. package/esm/themes/index.d.ts +70 -0
  205. package/esm/themes/index.d.ts.map +1 -0
  206. package/esm/themes/index.js +99 -0
  207. package/esm/themes/index.js.map +1 -0
  208. package/esm/themes/presets.d.ts +39 -0
  209. package/esm/themes/presets.d.ts.map +1 -0
  210. package/esm/themes/presets.js +207 -0
  211. package/esm/themes/presets.js.map +1 -0
  212. package/esm/themes/types.d.ts +118 -0
  213. package/esm/themes/types.d.ts.map +1 -0
  214. package/esm/themes/types.js +10 -0
  215. package/esm/types/index.d.ts +7 -0
  216. package/esm/types/index.d.ts.map +1 -0
  217. package/esm/types/index.js +10 -0
  218. package/esm/types/keyboard.d.ts +253 -0
  219. package/esm/types/keyboard.d.ts.map +1 -0
  220. package/esm/types/keyboard.js +10 -0
  221. package/esm/types/position.d.ts +139 -0
  222. package/esm/types/position.d.ts.map +1 -0
  223. package/esm/types/position.js +10 -0
  224. package/esm/utils/device.d.ts +45 -0
  225. package/esm/utils/device.d.ts.map +1 -0
  226. package/esm/utils/device.js +111 -0
  227. package/esm/utils/device.js.map +1 -0
  228. package/esm/utils/dom.d.ts +69 -0
  229. package/esm/utils/dom.d.ts.map +1 -0
  230. package/esm/utils/dom.js +134 -0
  231. package/esm/utils/dom.js.map +1 -0
  232. package/esm/utils/event-emitter.d.ts +52 -0
  233. package/esm/utils/event-emitter.d.ts.map +1 -0
  234. package/esm/utils/event-emitter.js +99 -0
  235. package/esm/utils/event-emitter.js.map +1 -0
  236. package/esm/utils/formatters.d.ts +51 -0
  237. package/esm/utils/formatters.d.ts.map +1 -0
  238. package/esm/utils/formatters.js +57 -0
  239. package/esm/utils/formatters.js.map +1 -0
  240. package/esm/utils/index.d.ts +10 -0
  241. package/esm/utils/index.d.ts.map +1 -0
  242. package/esm/utils/index.js +16 -0
  243. package/esm/utils/random.d.ts +71 -0
  244. package/esm/utils/random.d.ts.map +1 -0
  245. package/esm/utils/random.js +292 -0
  246. package/esm/utils/random.js.map +1 -0
  247. package/lib/icons.cjs +44 -0
  248. package/lib/icons.cjs.map +1 -0
  249. package/lib/icons.d.ts +58 -0
  250. package/lib/index.cjs +141 -0
  251. package/lib/index.d.ts +12 -0
  252. package/lib/layouts/amount.cjs +177 -0
  253. package/lib/layouts/amount.cjs.map +1 -0
  254. package/lib/layouts/amount.d.ts +14 -0
  255. package/lib/layouts/bankcard.cjs +100 -0
  256. package/lib/layouts/bankcard.cjs.map +1 -0
  257. package/lib/layouts/bankcard.d.ts +15 -0
  258. package/lib/layouts/email.cjs +128 -0
  259. package/lib/layouts/email.cjs.map +1 -0
  260. package/lib/layouts/email.d.ts +11 -0
  261. package/lib/layouts/idcard.cjs +100 -0
  262. package/lib/layouts/idcard.cjs.map +1 -0
  263. package/lib/layouts/idcard.d.ts +16 -0
  264. package/lib/layouts/index.cjs +107 -0
  265. package/lib/layouts/index.cjs.map +1 -0
  266. package/lib/layouts/index.d.ts +54 -0
  267. package/lib/layouts/license-plate.cjs +296 -0
  268. package/lib/layouts/license-plate.cjs.map +1 -0
  269. package/lib/layouts/license-plate.d.ts +35 -0
  270. package/lib/layouts/number.cjs +170 -0
  271. package/lib/layouts/number.cjs.map +1 -0
  272. package/lib/layouts/number.d.ts +14 -0
  273. package/lib/layouts/phone.cjs +177 -0
  274. package/lib/layouts/phone.cjs.map +1 -0
  275. package/lib/layouts/phone.d.ts +15 -0
  276. package/lib/layouts/punct.cjs +113 -0
  277. package/lib/layouts/punct.cjs.map +1 -0
  278. package/lib/layouts/punct.d.ts +7 -0
  279. package/lib/layouts/qwerty.cjs +117 -0
  280. package/lib/layouts/qwerty.cjs.map +1 -0
  281. package/lib/layouts/qwerty.d.ts +10 -0
  282. package/lib/layouts/search.cjs +102 -0
  283. package/lib/layouts/search.cjs.map +1 -0
  284. package/lib/layouts/search.d.ts +7 -0
  285. package/lib/layouts/symbol.cjs +196 -0
  286. package/lib/layouts/symbol.cjs.map +1 -0
  287. package/lib/layouts/symbol.d.ts +14 -0
  288. package/lib/layouts/url.cjs +100 -0
  289. package/lib/layouts/url.cjs.map +1 -0
  290. package/lib/layouts/url.d.ts +7 -0
  291. package/lib/layouts/verifycode.cjs +101 -0
  292. package/lib/layouts/verifycode.cjs.map +1 -0
  293. package/lib/layouts/verifycode.d.ts +15 -0
  294. package/lib/managers/index.cjs +20 -0
  295. package/lib/managers/index.d.ts +8 -0
  296. package/lib/managers/keyboard-manager.cjs +376 -0
  297. package/lib/managers/keyboard-manager.cjs.map +1 -0
  298. package/lib/managers/keyboard-manager.d.ts +130 -0
  299. package/lib/managers/keyboard-renderer.cjs +285 -0
  300. package/lib/managers/keyboard-renderer.cjs.map +1 -0
  301. package/lib/managers/keyboard-renderer.d.ts +115 -0
  302. package/lib/managers/position-manager.cjs +201 -0
  303. package/lib/managers/position-manager.cjs.map +1 -0
  304. package/lib/managers/position-manager.d.ts +72 -0
  305. package/lib/package.json +3 -0
  306. package/lib/themes/index.cjs +117 -0
  307. package/lib/themes/index.cjs.map +1 -0
  308. package/lib/themes/index.d.ts +70 -0
  309. package/lib/themes/presets.cjs +214 -0
  310. package/lib/themes/presets.cjs.map +1 -0
  311. package/lib/themes/presets.d.ts +39 -0
  312. package/lib/themes/types.cjs +11 -0
  313. package/lib/themes/types.d.ts +118 -0
  314. package/lib/types/index.cjs +11 -0
  315. package/lib/types/index.d.ts +7 -0
  316. package/lib/types/keyboard.cjs +11 -0
  317. package/lib/types/keyboard.d.ts +253 -0
  318. package/lib/types/position.cjs +11 -0
  319. package/lib/types/position.d.ts +139 -0
  320. package/lib/utils/device.cjs +120 -0
  321. package/lib/utils/device.cjs.map +1 -0
  322. package/lib/utils/device.d.ts +45 -0
  323. package/lib/utils/dom.cjs +148 -0
  324. package/lib/utils/dom.cjs.map +1 -0
  325. package/lib/utils/dom.d.ts +69 -0
  326. package/lib/utils/event-emitter.cjs +100 -0
  327. package/lib/utils/event-emitter.cjs.map +1 -0
  328. package/lib/utils/event-emitter.d.ts +52 -0
  329. package/lib/utils/formatters.cjs +66 -0
  330. package/lib/utils/formatters.cjs.map +1 -0
  331. package/lib/utils/formatters.d.ts +51 -0
  332. package/lib/utils/index.cjs +58 -0
  333. package/lib/utils/index.d.ts +10 -0
  334. package/lib/utils/random.cjs +301 -0
  335. package/lib/utils/random.cjs.map +1 -0
  336. package/lib/utils/random.d.ts +71 -0
  337. 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