@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,292 @@
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
+ //#region src/utils/random.ts
11
+ function shuffleArray(array) {
12
+ const result = [...array];
13
+ for (let i = result.length - 1; i > 0; i--) {
14
+ const j = Math.floor(Math.random() * (i + 1));
15
+ [result[i], result[j]] = [result[j], result[i]];
16
+ }
17
+ return result;
18
+ }
19
+ function getRandomNumbers() {
20
+ return shuffleArray([
21
+ "0",
22
+ "1",
23
+ "2",
24
+ "3",
25
+ "4",
26
+ "5",
27
+ "6",
28
+ "7",
29
+ "8",
30
+ "9"
31
+ ]);
32
+ }
33
+ function getRandomLetters() {
34
+ return shuffleArray(Array.from({ length: 26 }, (_, i) => String.fromCharCode(65 + i)));
35
+ }
36
+ function getRandomAlphanumeric() {
37
+ const numbers = [
38
+ "0",
39
+ "1",
40
+ "2",
41
+ "3",
42
+ "4",
43
+ "5",
44
+ "6",
45
+ "7",
46
+ "8",
47
+ "9"
48
+ ];
49
+ const letters = Array.from({ length: 26 }, (_, i) => String.fromCharCode(65 + i));
50
+ return shuffleArray([...numbers, ...letters]);
51
+ }
52
+ function createCharKey(char, index) {
53
+ return {
54
+ id: `random-${char}-${index}`,
55
+ type: "char",
56
+ label: char,
57
+ value: char,
58
+ className: "key-random"
59
+ };
60
+ }
61
+ function chunkArray(array, chunkSize) {
62
+ const chunks = [];
63
+ for (let i = 0; i < array.length; i += chunkSize) chunks.push(array.slice(i, i + chunkSize));
64
+ return chunks;
65
+ }
66
+ function createRandomNumberLayout(options) {
67
+ const { keysPerRow = 3, includeBackspace = true, includeDone = true, includeClear = false } = options || {};
68
+ const rows = chunkArray(getRandomNumbers().map((n, i) => createCharKey(n, i)), keysPerRow).map((keys, index) => ({
69
+ className: "numpad-row",
70
+ keys
71
+ }));
72
+ const fnKeys = [];
73
+ if (includeClear) fnKeys.push({
74
+ id: "clear",
75
+ type: "clear",
76
+ label: "清空",
77
+ className: "key-clear key-fn"
78
+ });
79
+ if (includeBackspace) fnKeys.push({
80
+ id: "backspace",
81
+ type: "backspace",
82
+ label: "⌫",
83
+ className: "key-backspace key-fn"
84
+ });
85
+ if (includeDone) fnKeys.push({
86
+ id: "done",
87
+ type: "done",
88
+ label: "确定",
89
+ className: "key-done key-fn"
90
+ });
91
+ if (fnKeys.length > 0) rows.push({
92
+ className: "numpad-row",
93
+ keys: fnKeys
94
+ });
95
+ return {
96
+ type: "custom",
97
+ name: "随机数字键盘",
98
+ supportShift: false,
99
+ rows,
100
+ data: {
101
+ isRandom: true,
102
+ randomType: "number"
103
+ }
104
+ };
105
+ }
106
+ function createRandomPinLayout(options) {
107
+ const { includeBackspace = true, includeDone = true } = options || {};
108
+ const randomNumbers = getRandomNumbers();
109
+ const rows = [
110
+ {
111
+ className: "numpad-row",
112
+ keys: randomNumbers.slice(0, 3).map((n, i) => createCharKey(n, i))
113
+ },
114
+ {
115
+ className: "numpad-row",
116
+ keys: randomNumbers.slice(3, 6).map((n, i) => createCharKey(n, i + 3))
117
+ },
118
+ {
119
+ className: "numpad-row",
120
+ keys: randomNumbers.slice(6, 9).map((n, i) => createCharKey(n, i + 6))
121
+ }
122
+ ];
123
+ const lastRow = [];
124
+ if (includeBackspace) lastRow.push({
125
+ id: "backspace",
126
+ type: "backspace",
127
+ label: "⌫",
128
+ className: "key-backspace key-fn"
129
+ });
130
+ else lastRow.push({
131
+ id: "empty-1",
132
+ type: "char",
133
+ label: "",
134
+ value: "",
135
+ disabled: true,
136
+ className: "key-placeholder"
137
+ });
138
+ lastRow.push(createCharKey(randomNumbers[9], 9));
139
+ if (includeDone) lastRow.push({
140
+ id: "done",
141
+ type: "done",
142
+ label: "确定",
143
+ className: "key-done key-fn"
144
+ });
145
+ else lastRow.push({
146
+ id: "empty-2",
147
+ type: "char",
148
+ label: "",
149
+ value: "",
150
+ disabled: true,
151
+ className: "key-placeholder"
152
+ });
153
+ rows.push({
154
+ className: "numpad-row",
155
+ keys: lastRow
156
+ });
157
+ return {
158
+ type: "custom",
159
+ name: "随机PIN键盘",
160
+ supportShift: false,
161
+ rows,
162
+ data: {
163
+ isRandom: true,
164
+ randomType: "pin"
165
+ }
166
+ };
167
+ }
168
+ function createRandomLetterLayout(options) {
169
+ const { uppercase = true, rowDistribution = [
170
+ 10,
171
+ 9,
172
+ 7
173
+ ] } = options || {};
174
+ let randomLetters = getRandomLetters();
175
+ if (!uppercase) randomLetters = randomLetters.map((l) => l.toLowerCase());
176
+ const letterKeys = randomLetters.map((l, i) => createCharKey(l, i));
177
+ const rows = [];
178
+ let offset = 0;
179
+ for (const count of rowDistribution) {
180
+ rows.push({
181
+ className: "numpad-row",
182
+ keys: letterKeys.slice(offset, offset + count)
183
+ });
184
+ offset += count;
185
+ }
186
+ if (offset < letterKeys.length) rows.push({
187
+ className: "numpad-row",
188
+ keys: letterKeys.slice(offset)
189
+ });
190
+ rows.push({
191
+ className: "numpad-row",
192
+ keys: [
193
+ {
194
+ id: "clear",
195
+ type: "clear",
196
+ label: "清空",
197
+ className: "key-clear key-fn"
198
+ },
199
+ {
200
+ id: "backspace",
201
+ type: "backspace",
202
+ label: "⌫",
203
+ className: "key-backspace key-fn"
204
+ },
205
+ {
206
+ id: "done",
207
+ type: "done",
208
+ label: "确定",
209
+ className: "key-done key-fn"
210
+ }
211
+ ]
212
+ });
213
+ return {
214
+ type: "custom",
215
+ name: "随机字母键盘",
216
+ supportShift: false,
217
+ rows,
218
+ data: {
219
+ isRandom: true,
220
+ randomType: "letter"
221
+ }
222
+ };
223
+ }
224
+ function createRandomMixedLayout(options) {
225
+ const { rowDistribution = [
226
+ 10,
227
+ 10,
228
+ 9,
229
+ 7
230
+ ] } = options || {};
231
+ const charKeys = getRandomAlphanumeric().map((c, i) => createCharKey(c, i));
232
+ const rows = [];
233
+ let offset = 0;
234
+ for (const count of rowDistribution) {
235
+ if (offset >= charKeys.length) break;
236
+ rows.push({
237
+ className: "numpad-row",
238
+ keys: charKeys.slice(offset, offset + count)
239
+ });
240
+ offset += count;
241
+ }
242
+ if (offset < charKeys.length) rows.push({
243
+ className: "numpad-row",
244
+ keys: charKeys.slice(offset)
245
+ });
246
+ rows.push({
247
+ className: "numpad-row",
248
+ keys: [
249
+ {
250
+ id: "clear",
251
+ type: "clear",
252
+ label: "清空",
253
+ className: "key-clear key-fn"
254
+ },
255
+ {
256
+ id: "backspace",
257
+ type: "backspace",
258
+ label: "⌫",
259
+ className: "key-backspace key-fn"
260
+ },
261
+ {
262
+ id: "done",
263
+ type: "done",
264
+ label: "确定",
265
+ className: "key-done key-fn"
266
+ }
267
+ ]
268
+ });
269
+ return {
270
+ type: "custom",
271
+ name: "随机混合键盘",
272
+ supportShift: false,
273
+ rows,
274
+ data: {
275
+ isRandom: true,
276
+ randomType: "mixed"
277
+ }
278
+ };
279
+ }
280
+ function refreshRandomLayout(layout) {
281
+ switch (layout.data?.randomType) {
282
+ case "number": return createRandomNumberLayout();
283
+ case "pin": return createRandomPinLayout();
284
+ case "letter": return createRandomLetterLayout();
285
+ case "mixed": return createRandomMixedLayout();
286
+ default: return layout;
287
+ }
288
+ }
289
+ //#endregion
290
+ export { createRandomLetterLayout, createRandomMixedLayout, createRandomNumberLayout, createRandomPinLayout, getRandomAlphanumeric, getRandomLetters, getRandomNumbers, refreshRandomLayout, shuffleArray };
291
+ /*! End of @composy/keyboard-core | Powered by @composy/builder */
292
+ //# sourceMappingURL=random.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random.js","names":[],"sources":["../../src/utils/random.ts"],"sourcesContent":["/**\n * 随机工具函数\n * @module utils/random\n */\n\nimport type { KeyboardConfig, KeyboardRow, KeyDefinition } from '../types'\n\n/**\n * Fisher-Yates 洗牌算法\n * @param array - 要洗牌的数组\n * @returns 洗牌后的新数组\n */\nexport function shuffleArray<T>(array: T[]): T[] {\n const result = [...array]\n for (let i = result.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1))\n ;[result[i], result[j]] = [result[j], result[i]]\n }\n return result\n}\n\n/**\n * 生成随机数字数组 (0-9)\n */\nexport function getRandomNumbers(): string[] {\n return shuffleArray(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])\n}\n\n/**\n * 生成随机字母数组 (A-Z)\n */\nexport function getRandomLetters(): string[] {\n const letters = Array.from({ length: 26 }, (_, i) =>\n String.fromCharCode(65 + i),\n )\n return shuffleArray(letters)\n}\n\n/**\n * 生成随机数字+字母数组\n */\nexport function getRandomAlphanumeric(): string[] {\n const numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']\n const letters = Array.from({ length: 26 }, (_, i) =>\n String.fromCharCode(65 + i),\n )\n return shuffleArray([...numbers, ...letters])\n}\n\n/**\n * 创建字符按键\n */\nfunction createCharKey(char: string, index: number): KeyDefinition {\n return {\n id: `random-${char}-${index}`,\n type: 'char',\n label: char,\n value: char,\n className: 'key-random',\n }\n}\n\n/**\n * 将字符数组分成行\n */\nfunction chunkArray<T>(array: T[], chunkSize: number): T[][] {\n const chunks: T[][] = []\n for (let i = 0; i < array.length; i += chunkSize) {\n chunks.push(array.slice(i, i + chunkSize))\n }\n return chunks\n}\n\n/**\n * 生成随机数字键盘布局\n * @param options - 配置选项\n */\nexport function createRandomNumberLayout(options?: {\n /** 每行按键数 */\n keysPerRow?: number\n /** 是否包含退格键 */\n includeBackspace?: boolean\n /** 是否包含完成键 */\n includeDone?: boolean\n /** 是否包含清空键 */\n includeClear?: boolean\n}): KeyboardConfig {\n const {\n keysPerRow = 3,\n includeBackspace = true,\n includeDone = true,\n includeClear = false,\n } = options || {}\n\n const randomNumbers = getRandomNumbers()\n const numberKeys = randomNumbers.map((n, i) => createCharKey(n, i))\n const chunks = chunkArray(numberKeys, keysPerRow)\n\n const rows: KeyboardRow[] = chunks.map((keys, index) => ({\n className: 'numpad-row',\n keys,\n }))\n\n // 添加功能键行\n const fnKeys: KeyDefinition[] = []\n\n if (includeClear) {\n fnKeys.push({\n id: 'clear',\n type: 'clear',\n label: '清空',\n className: 'key-clear key-fn',\n })\n }\n\n if (includeBackspace) {\n fnKeys.push({\n id: 'backspace',\n type: 'backspace',\n label: '⌫',\n className: 'key-backspace key-fn',\n })\n }\n\n if (includeDone) {\n fnKeys.push({\n id: 'done',\n type: 'done',\n label: '确定',\n className: 'key-done key-fn',\n })\n }\n\n if (fnKeys.length > 0) {\n rows.push({\n className: 'numpad-row',\n keys: fnKeys,\n })\n }\n\n return {\n type: 'custom',\n name: '随机数字键盘',\n supportShift: false,\n rows,\n data: {\n isRandom: true,\n randomType: 'number',\n },\n }\n}\n\n/**\n * 生成4x3随机数字键盘(密码输入常用)\n */\nexport function createRandomPinLayout(options?: {\n /** 是否包含退格键 */\n includeBackspace?: boolean\n /** 是否包含完成键 */\n includeDone?: boolean\n}): KeyboardConfig {\n const { includeBackspace = true, includeDone = true } = options || {}\n\n const randomNumbers = getRandomNumbers()\n\n // 前9个数字 (3x3)\n const rows: KeyboardRow[] = [\n {\n className: 'numpad-row',\n keys: randomNumbers.slice(0, 3).map((n, i) => createCharKey(n, i)),\n },\n {\n className: 'numpad-row',\n keys: randomNumbers.slice(3, 6).map((n, i) => createCharKey(n, i + 3)),\n },\n {\n className: 'numpad-row',\n keys: randomNumbers.slice(6, 9).map((n, i) => createCharKey(n, i + 6)),\n },\n ]\n\n // 最后一行:功能键 + 0 + 功能键\n const lastRow: KeyDefinition[] = []\n\n if (includeBackspace) {\n lastRow.push({\n id: 'backspace',\n type: 'backspace',\n label: '⌫',\n className: 'key-backspace key-fn',\n })\n } else {\n lastRow.push({\n id: 'empty-1',\n type: 'char',\n label: '',\n value: '',\n disabled: true,\n className: 'key-placeholder',\n })\n }\n\n lastRow.push(createCharKey(randomNumbers[9], 9))\n\n if (includeDone) {\n lastRow.push({\n id: 'done',\n type: 'done',\n label: '确定',\n className: 'key-done key-fn',\n })\n } else {\n lastRow.push({\n id: 'empty-2',\n type: 'char',\n label: '',\n value: '',\n disabled: true,\n className: 'key-placeholder',\n })\n }\n\n rows.push({\n className: 'numpad-row',\n keys: lastRow,\n })\n\n return {\n type: 'custom',\n name: '随机PIN键盘',\n supportShift: false,\n rows,\n data: {\n isRandom: true,\n randomType: 'pin',\n },\n }\n}\n\n/**\n * 生成随机字母键盘布局\n * 默认使用 QWERTY 风格行分布 (10/9/7),看起来像真实键盘\n */\nexport function createRandomLetterLayout(options?: {\n /** 是否大写 */\n uppercase?: boolean\n /** 行分布,默认 [10, 9, 7] 模拟 QWERTY 布局 */\n rowDistribution?: number[]\n}): KeyboardConfig {\n const { uppercase = true, rowDistribution = [10, 9, 7] } = options || {}\n\n let randomLetters = getRandomLetters()\n if (!uppercase) {\n randomLetters = randomLetters.map((l) => l.toLowerCase())\n }\n\n const letterKeys = randomLetters.map((l, i) => createCharKey(l, i))\n\n // 按行分布切割\n const rows: KeyboardRow[] = []\n let offset = 0\n for (const count of rowDistribution) {\n rows.push({\n className: 'numpad-row',\n keys: letterKeys.slice(offset, offset + count),\n })\n offset += count\n }\n // 剩余字母放最后一行\n if (offset < letterKeys.length) {\n rows.push({\n className: 'numpad-row',\n keys: letterKeys.slice(offset),\n })\n }\n\n // 功能键行\n rows.push({\n className: 'numpad-row',\n keys: [\n {\n id: 'clear',\n type: 'clear',\n label: '清空',\n className: 'key-clear key-fn',\n },\n {\n id: 'backspace',\n type: 'backspace',\n label: '⌫',\n className: 'key-backspace key-fn',\n },\n {\n id: 'done',\n type: 'done',\n label: '确定',\n className: 'key-done key-fn',\n },\n ],\n })\n\n return {\n type: 'custom',\n name: '随机字母键盘',\n supportShift: false,\n rows,\n data: {\n isRandom: true,\n randomType: 'letter',\n },\n }\n}\n\n/**\n * 生成混合随机键盘(数字+字母)\n * 默认使用 QWERTY 风格行分布 (10/10/9/7),看起来像真实键盘\n */\nexport function createRandomMixedLayout(options?: {\n /** 行分布,默认 [10, 10, 9, 7] */\n rowDistribution?: number[]\n}): KeyboardConfig {\n const { rowDistribution = [10, 10, 9, 7] } = options || {}\n\n const randomChars = getRandomAlphanumeric()\n const charKeys = randomChars.map((c, i) => createCharKey(c, i))\n\n // 按行分布切割\n const rows: KeyboardRow[] = []\n let offset = 0\n for (const count of rowDistribution) {\n if (offset >= charKeys.length) break\n rows.push({\n className: 'numpad-row',\n keys: charKeys.slice(offset, offset + count),\n })\n offset += count\n }\n // 剩余字符放最后一行\n if (offset < charKeys.length) {\n rows.push({\n className: 'numpad-row',\n keys: charKeys.slice(offset),\n })\n }\n\n // 功能键行\n rows.push({\n className: 'numpad-row',\n keys: [\n {\n id: 'clear',\n type: 'clear',\n label: '清空',\n className: 'key-clear key-fn',\n },\n {\n id: 'backspace',\n type: 'backspace',\n label: '⌫',\n className: 'key-backspace key-fn',\n },\n {\n id: 'done',\n type: 'done',\n label: '确定',\n className: 'key-done key-fn',\n },\n ],\n })\n\n return {\n type: 'custom',\n name: '随机混合键盘',\n supportShift: false,\n rows,\n data: {\n isRandom: true,\n randomType: 'mixed',\n },\n }\n}\n\n/**\n * 刷新随机键盘布局\n * @param layout - 现有布局\n * @returns 新的随机布局\n */\nexport function refreshRandomLayout(layout: KeyboardConfig): KeyboardConfig {\n const randomType = layout.data?.randomType as string | undefined\n\n switch (randomType) {\n case 'number':\n return createRandomNumberLayout()\n case 'pin':\n return createRandomPinLayout()\n case 'letter':\n return createRandomLetterLayout()\n case 'mixed':\n return createRandomMixedLayout()\n default:\n return layout\n }\n}\n"],"mappings":"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"}
package/esm/icons.d.ts ADDED
@@ -0,0 +1,58 @@
1
+ /**
2
+ * 键盘图标 SVG
3
+ * 使用 Lucide 图标的 SVG 路径
4
+ * @module icons
5
+ */
6
+ /**
7
+ * 删除图标 (Delete/Backspace)
8
+ */
9
+ export declare const ICON_DELETE = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z\"/><path d=\"m12 9 6 6\"/><path d=\"m18 9-6 6\"/></svg>";
10
+ /**
11
+ * 清空图标 (X Circle)
12
+ */
13
+ export declare const ICON_CLEAR = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"m15 9-6 6\"/><path d=\"m9 9 6 6\"/></svg>";
14
+ /**
15
+ * 关闭图标 (X)
16
+ */
17
+ export declare const ICON_CLOSE = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>";
18
+ /**
19
+ * 确认图标 (Check)
20
+ */
21
+ export declare const ICON_CHECK = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 6 9 17l-5-5\"/></svg>";
22
+ /**
23
+ * 换行图标 (Corner Down Left)
24
+ */
25
+ export declare const ICON_ENTER = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"9 10 4 15 9 20\"/><path d=\"M20 4v7a4 4 0 0 1-4 4H4\"/></svg>";
26
+ /**
27
+ * Shift 图标 (Arrow Big Up)
28
+ */
29
+ export declare const ICON_SHIFT = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M9 18v-6H5l7-7 7 7h-4v6H9z\"/></svg>";
30
+ /**
31
+ * 空格图标 (Space)
32
+ */
33
+ export declare const ICON_SPACE = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1\"/></svg>";
34
+ /**
35
+ * 键盘图标 (Keyboard)
36
+ */
37
+ export declare const ICON_KEYBOARD = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\"/><path d=\"M6 8h.001\"/><path d=\"M10 8h.001\"/><path d=\"M14 8h.001\"/><path d=\"M18 8h.001\"/><path d=\"M8 12h.001\"/><path d=\"M12 12h.001\"/><path d=\"M16 12h.001\"/><path d=\"M7 16h10\"/></svg>";
38
+ /**
39
+ * 语音图标 (Mic)
40
+ */
41
+ export declare const ICON_VOICE = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\"/><path d=\"M19 10v2a7 7 0 0 1-14 0v-2\"/><line x1=\"12\" x2=\"12\" y1=\"19\" y2=\"22\"/></svg>";
42
+ /**
43
+ * 所有图标映射
44
+ */
45
+ export declare const ICONS: {
46
+ readonly delete: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z\"/><path d=\"m12 9 6 6\"/><path d=\"m18 9-6 6\"/></svg>";
47
+ readonly clear: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"m15 9-6 6\"/><path d=\"m9 9 6 6\"/></svg>";
48
+ readonly close: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>";
49
+ readonly check: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 6 9 17l-5-5\"/></svg>";
50
+ readonly enter: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"9 10 4 15 9 20\"/><path d=\"M20 4v7a4 4 0 0 1-4 4H4\"/></svg>";
51
+ readonly shift: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M9 18v-6H5l7-7 7 7h-4v6H9z\"/></svg>";
52
+ readonly space: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1\"/></svg>";
53
+ readonly keyboard: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\"/><path d=\"M6 8h.001\"/><path d=\"M10 8h.001\"/><path d=\"M14 8h.001\"/><path d=\"M18 8h.001\"/><path d=\"M8 12h.001\"/><path d=\"M12 12h.001\"/><path d=\"M16 12h.001\"/><path d=\"M7 16h10\"/></svg>";
54
+ readonly voice: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\"/><path d=\"M19 10v2a7 7 0 0 1-14 0v-2\"/><line x1=\"12\" x2=\"12\" y1=\"19\" y2=\"22\"/></svg>";
55
+ };
56
+ /** IconName - 图标名称类型 */
57
+ export type IconName = keyof typeof ICONS;
58
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW,mYAA2W,CAAA;AAEnY;;GAEG;AACH,eAAO,MAAM,UAAU,qSAAyQ,CAAA;AAEhS;;GAEG;AACH,eAAO,MAAM,UAAU,kQAA4O,CAAA;AAEnQ;;GAEG;AACH,eAAO,MAAM,UAAU,+OAA2N,CAAA;AAElP;;GAEG;AACH,eAAO,MAAM,UAAU,4RAAsQ,CAAA;AAE7R;;GAEG;AACH,eAAO,MAAM,UAAU,0PAAsO,CAAA;AAE7P;;GAEG;AACH,eAAO,MAAM,UAAU,0QAAsP,CAAA;AAE7Q;;GAEG;AACH,eAAO,MAAM,aAAa,4cAAga,CAAA;AAE1b;;GAEG;AACH,eAAO,MAAM,UAAU,2WAA6U,CAAA;AAEpW;;GAEG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;CAUR,CAAA;AAEV,wBAAwB;AACxB,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAA"}
package/esm/icons.js ADDED
@@ -0,0 +1,34 @@
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
+ //#region src/icons.ts
11
+ const ICON_DELETE = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z"/><path d="m12 9 6 6"/><path d="m18 9-6 6"/></svg>`;
12
+ const ICON_CLEAR = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>`;
13
+ const ICON_CLOSE = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`;
14
+ const ICON_CHECK = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>`;
15
+ const ICON_ENTER = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 10 4 15 9 20"/><path d="M20 4v7a4 4 0 0 1-4 4H4"/></svg>`;
16
+ const ICON_SHIFT = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18v-6H5l7-7 7 7h-4v6H9z"/></svg>`;
17
+ const ICON_SPACE = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1"/></svg>`;
18
+ const ICON_KEYBOARD = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="16" x="2" y="4" rx="2"/><path d="M6 8h.001"/><path d="M10 8h.001"/><path d="M14 8h.001"/><path d="M18 8h.001"/><path d="M8 12h.001"/><path d="M12 12h.001"/><path d="M16 12h.001"/><path d="M7 16h10"/></svg>`;
19
+ const ICON_VOICE = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" x2="12" y1="19" y2="22"/></svg>`;
20
+ const ICONS = {
21
+ delete: ICON_DELETE,
22
+ clear: ICON_CLEAR,
23
+ close: ICON_CLOSE,
24
+ check: ICON_CHECK,
25
+ enter: ICON_ENTER,
26
+ shift: ICON_SHIFT,
27
+ space: ICON_SPACE,
28
+ keyboard: ICON_KEYBOARD,
29
+ voice: ICON_VOICE
30
+ };
31
+ //#endregion
32
+ export { ICONS, ICON_CHECK, ICON_CLEAR, ICON_CLOSE, ICON_DELETE, ICON_ENTER, ICON_KEYBOARD, ICON_SHIFT, ICON_SPACE, ICON_VOICE };
33
+ /*! End of @composy/keyboard-core | Powered by @composy/builder */
34
+ //# sourceMappingURL=icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.js","names":[],"sources":["../src/icons.ts"],"sourcesContent":["/**\n * 键盘图标 SVG\n * 使用 Lucide 图标的 SVG 路径\n * @module icons\n */\n\n/**\n * 删除图标 (Delete/Backspace)\n */\nexport const ICON_DELETE = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z\"/><path d=\"m12 9 6 6\"/><path d=\"m18 9-6 6\"/></svg>`\n\n/**\n * 清空图标 (X Circle)\n */\nexport const ICON_CLEAR = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"m15 9-6 6\"/><path d=\"m9 9 6 6\"/></svg>`\n\n/**\n * 关闭图标 (X)\n */\nexport const ICON_CLOSE = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>`\n\n/**\n * 确认图标 (Check)\n */\nexport const ICON_CHECK = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 6 9 17l-5-5\"/></svg>`\n\n/**\n * 换行图标 (Corner Down Left)\n */\nexport const ICON_ENTER = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"9 10 4 15 9 20\"/><path d=\"M20 4v7a4 4 0 0 1-4 4H4\"/></svg>`\n\n/**\n * Shift 图标 (Arrow Big Up)\n */\nexport const ICON_SHIFT = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M9 18v-6H5l7-7 7 7h-4v6H9z\"/></svg>`\n\n/**\n * 空格图标 (Space)\n */\nexport const ICON_SPACE = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1\"/></svg>`\n\n/**\n * 键盘图标 (Keyboard)\n */\nexport const ICON_KEYBOARD = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\"/><path d=\"M6 8h.001\"/><path d=\"M10 8h.001\"/><path d=\"M14 8h.001\"/><path d=\"M18 8h.001\"/><path d=\"M8 12h.001\"/><path d=\"M12 12h.001\"/><path d=\"M16 12h.001\"/><path d=\"M7 16h10\"/></svg>`\n\n/**\n * 语音图标 (Mic)\n */\nexport const ICON_VOICE = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\"/><path d=\"M19 10v2a7 7 0 0 1-14 0v-2\"/><line x1=\"12\" x2=\"12\" y1=\"19\" y2=\"22\"/></svg>`\n\n/**\n * 所有图标映射\n */\nexport const ICONS = {\n delete: ICON_DELETE,\n clear: ICON_CLEAR,\n close: ICON_CLOSE,\n check: ICON_CHECK,\n enter: ICON_ENTER,\n shift: ICON_SHIFT,\n space: ICON_SPACE,\n keyboard: ICON_KEYBOARD,\n voice: ICON_VOICE,\n} as const\n\n/** IconName - 图标名称类型 */\nexport type IconName = keyof typeof ICONS\n"],"mappings":";;;;;;;;;;AASO,MAAM,cAAc;AAKpB,MAAM,aAAa;AAKnB,MAAM,aAAa;AAKnB,MAAM,aAAa;AAKnB,MAAM,aAAa;AAKnB,MAAM,aAAa;AAKnB,MAAM,aAAa;AAKnB,MAAM,gBAAgB;AAKtB,MAAM,aAAa;AAKnB,MAAM,QAAQ;CACnB,QAAQ;CACR,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,UAAU;CACV,OAAO;AACT"}
package/esm/index.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @composy/keyboard-core
3
+ * LDesign 虚拟键盘 - 框架无关的核心模块
4
+ * @packageDocumentation
5
+ */
6
+ export * from './managers';
7
+ export * from './layouts';
8
+ export * from './types';
9
+ export * from './utils';
10
+ export * from './themes';
11
+ export * from './icons';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,YAAY,CAAA;AAG1B,cAAc,WAAW,CAAA;AAGzB,cAAc,SAAS,CAAA;AAGvB,cAAc,SAAS,CAAA;AAGvB,cAAc,UAAU,CAAA;AAGxB,cAAc,SAAS,CAAA"}
package/esm/index.js ADDED
@@ -0,0 +1,37 @@
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
+ import { qwertyLayout } from "./layouts/qwerty.js";
11
+ import { ICONS, ICON_CHECK, ICON_CLEAR, ICON_CLOSE, ICON_DELETE, ICON_ENTER, ICON_KEYBOARD, ICON_SHIFT, ICON_SPACE, ICON_VOICE } from "./icons.js";
12
+ import { integerLayout, numberLayout } from "./layouts/number.js";
13
+ import { symbolLayout, symbolLayout2 } from "./layouts/symbol.js";
14
+ import { PLATE_LETTERS, PROVINCES, licensePlateAlphanumericLayout, licensePlateLayout, licensePlateLetterLayout, licensePlateProvinceLayout } from "./layouts/license-plate.js";
15
+ import { idcardLayout } from "./layouts/idcard.js";
16
+ import { phoneLayout, phoneSimpleLayout } from "./layouts/phone.js";
17
+ import { amountLayout, amountSimpleLayout } from "./layouts/amount.js";
18
+ import { bankcardLayout } from "./layouts/bankcard.js";
19
+ import { verifycodeLayout } from "./layouts/verifycode.js";
20
+ import { EMAIL_SUFFIXES, emailLayout } from "./layouts/email.js";
21
+ import { urlLayout } from "./layouts/url.js";
22
+ import { searchLayout } from "./layouts/search.js";
23
+ import { punctLayout } from "./layouts/punct.js";
24
+ import { getAvailableLayouts, getLayout, hasLayout, registerLayout, registerLayouts, unregisterLayout } from "./layouts/index.js";
25
+ import { EventEmitter } from "./utils/event-emitter.js";
26
+ import { getDeviceType, getSafeAreaInsets, getViewportInfo, isMobile, isMobileUA, isTouchDevice, onViewportChange, supportsVibrate, vibrate } from "./utils/device.js";
27
+ import { createElement, deleteCharBeforeCursor, getBoundingRect, getElementOffset, getInputCursorPosition, insertTextAtCursor, isClickOutside, isElementInViewport, onClickOutside, preventDefaultAndStopPropagation, scrollIntoViewIfNeeded, setInputCursorPosition, setStyles, toggleClass } from "./utils/dom.js";
28
+ import { KeyboardManager, createKeyboardManager } from "./managers/keyboard-manager.js";
29
+ import { PositionManager, createPositionManager } from "./managers/position-manager.js";
30
+ import { darkTheme, defaultTheme, iosTheme, materialTheme, minimalTheme, miuiTheme, presetThemes } from "./themes/presets.js";
31
+ import { applyTheme, createTheme, generateThemeStyle, getAllThemes, getAvailableThemes, getCurrentTheme, getTheme, mergeTheme, registerTheme, setCurrentTheme, themeToCSS } from "./themes/index.js";
32
+ import { KeyboardRenderer, createKeyboardRenderer } from "./managers/keyboard-renderer.js";
33
+ import "./managers/index.js";
34
+ import { createRandomLetterLayout, createRandomMixedLayout, createRandomNumberLayout, createRandomPinLayout, getRandomAlphanumeric, getRandomLetters, getRandomNumbers, refreshRandomLayout, shuffleArray } from "./utils/random.js";
35
+ import { applyFormatter, formatAmount, formatBankCard, formatIdCard, formatLicensePlate, formatPhone, formatVerifyCode, getFormatter, registerFormatter } from "./utils/formatters.js";
36
+ export { EMAIL_SUFFIXES, EventEmitter, ICONS, ICON_CHECK, ICON_CLEAR, ICON_CLOSE, ICON_DELETE, ICON_ENTER, ICON_KEYBOARD, ICON_SHIFT, ICON_SPACE, ICON_VOICE, KeyboardManager, KeyboardRenderer, PLATE_LETTERS, PROVINCES, PositionManager, amountLayout, amountSimpleLayout, applyFormatter, applyTheme, bankcardLayout, createElement, createKeyboardManager, createKeyboardRenderer, createPositionManager, createRandomLetterLayout, createRandomMixedLayout, createRandomNumberLayout, createRandomPinLayout, createTheme, darkTheme, defaultTheme, deleteCharBeforeCursor, emailLayout, formatAmount, formatBankCard, formatIdCard, formatLicensePlate, formatPhone, formatVerifyCode, generateThemeStyle, getAllThemes, getAvailableLayouts, getAvailableThemes, getBoundingRect, getCurrentTheme, getDeviceType, getElementOffset, getFormatter, getInputCursorPosition, getLayout, getRandomAlphanumeric, getRandomLetters, getRandomNumbers, getSafeAreaInsets, getTheme, getViewportInfo, hasLayout, idcardLayout, insertTextAtCursor, integerLayout, iosTheme, isClickOutside, isElementInViewport, isMobile, isMobileUA, isTouchDevice, licensePlateAlphanumericLayout, licensePlateLayout, licensePlateLetterLayout, licensePlateProvinceLayout, materialTheme, mergeTheme, minimalTheme, miuiTheme, numberLayout, onClickOutside, onViewportChange, phoneLayout, phoneSimpleLayout, presetThemes, preventDefaultAndStopPropagation, punctLayout, qwertyLayout, refreshRandomLayout, registerFormatter, registerLayout, registerLayouts, registerTheme, scrollIntoViewIfNeeded, searchLayout, setCurrentTheme, setInputCursorPosition, setStyles, shuffleArray, supportsVibrate, symbolLayout, symbolLayout2, themeToCSS, toggleClass, unregisterLayout, urlLayout, verifycodeLayout, vibrate };
37
+ /*! End of @composy/keyboard-core | Powered by @composy/builder */
@@ -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 @@
1
+ {"version":3,"file":"amount.d.ts","sourceRoot":"","sources":["../../src/layouts/amount.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,UAAU,CAAA;AAgB7D;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,cA2E1B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,cA0EhC,CAAA"}