vxe-pc-ui 0.0.1 → 0.0.2

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 (498) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +48 -5
  3. package/es/anchor/index.js +8 -0
  4. package/es/anchor/src/anchor.js +202 -0
  5. package/es/anchor/style.css +40 -0
  6. package/es/anchor/style.min.css +1 -0
  7. package/es/anchor-link/index.js +8 -0
  8. package/es/anchor-link/src/anchor-link.js +94 -0
  9. package/es/anchor-link/src/util.js +19 -0
  10. package/es/anchor-link/style.css +0 -0
  11. package/es/anchor-link/style.min.css +0 -0
  12. package/es/breadcrumb/index.js +8 -0
  13. package/es/breadcrumb/src/breadcrumb.js +44 -0
  14. package/es/breadcrumb/style.css +19 -0
  15. package/es/breadcrumb/style.min.css +1 -0
  16. package/es/breadcrumb-item/index.js +8 -0
  17. package/es/breadcrumb-item/src/breadcrumb-item.js +54 -0
  18. package/es/breadcrumb-item/style.css +0 -0
  19. package/es/breadcrumb-item/style.min.css +0 -0
  20. package/es/button/index.js +8 -0
  21. package/es/button/src/button.js +487 -0
  22. package/es/button/style.css +513 -0
  23. package/es/button/style.min.css +1 -0
  24. package/es/button-group/index.js +8 -0
  25. package/es/button-group/src/button-group.js +66 -0
  26. package/es/button-group/style.css +0 -0
  27. package/es/button-group/style.min.css +0 -0
  28. package/es/col/index.js +8 -0
  29. package/es/col/src/col.js +80 -0
  30. package/es/col/style.css +95 -0
  31. package/es/col/style.min.css +1 -0
  32. package/es/components.js +57 -0
  33. package/es/design/index.js +8 -0
  34. package/es/design/src/design.js +41 -0
  35. package/es/design/style.css +0 -0
  36. package/es/design/style.min.css +0 -0
  37. package/es/hooks/size.js +10 -0
  38. package/es/icon/index.js +8 -0
  39. package/es/icon/src/icon.js +24 -0
  40. package/es/icon/style.css +766 -0
  41. package/es/icon/style.min.css +1 -0
  42. package/es/index.esm.js +3 -0
  43. package/es/layout-aside/index.js +8 -0
  44. package/es/layout-aside/src/layout-aside.js +68 -0
  45. package/es/layout-aside/style.css +12 -0
  46. package/es/layout-aside/style.min.css +1 -0
  47. package/es/layout-body/index.js +8 -0
  48. package/es/layout-body/src/layout-body.js +37 -0
  49. package/es/layout-body/style.css +3 -0
  50. package/es/layout-body/style.min.css +1 -0
  51. package/es/layout-container/index.js +8 -0
  52. package/es/layout-container/src/layout-container.js +41 -0
  53. package/es/layout-container/style.css +10 -0
  54. package/es/layout-container/style.min.css +1 -0
  55. package/es/layout-footer/index.js +8 -0
  56. package/es/layout-footer/src/layout-footer.js +41 -0
  57. package/es/layout-footer/style.css +10 -0
  58. package/es/layout-footer/style.min.css +1 -0
  59. package/es/layout-header/index.js +8 -0
  60. package/es/layout-header/src/layout-header.js +41 -0
  61. package/es/layout-header/style.css +10 -0
  62. package/es/layout-header/style.min.css +1 -0
  63. package/es/locale/lang/en-US.d.ts +2 -0
  64. package/es/locale/lang/en-US.js +463 -0
  65. package/es/locale/lang/es-ES.d.ts +2 -0
  66. package/es/locale/lang/es-ES.js +463 -0
  67. package/es/locale/lang/ja-JP.d.ts +2 -0
  68. package/es/locale/lang/ja-JP.js +463 -0
  69. package/es/locale/lang/pt-BR.d.ts +2 -0
  70. package/es/locale/lang/pt-BR.js +463 -0
  71. package/es/locale/lang/zh-CN.d.ts +2 -0
  72. package/es/locale/lang/zh-CN.js +463 -0
  73. package/es/locale/lang/zh-HK.d.ts +2 -0
  74. package/es/locale/lang/zh-HK.js +2 -0
  75. package/es/locale/lang/zh-MO.d.ts +2 -0
  76. package/es/locale/lang/zh-MO.js +2 -0
  77. package/es/locale/lang/zh-TC.d.ts +2 -0
  78. package/es/locale/lang/zh-TC.js +463 -0
  79. package/es/locale/lang/zh-TW.d.ts +2 -0
  80. package/es/locale/lang/zh-TW.js +2 -0
  81. package/es/row/index.js +8 -0
  82. package/es/row/src/row.js +69 -0
  83. package/es/row/style.css +10 -0
  84. package/es/row/style.min.css +1 -0
  85. package/es/style.css +1 -0
  86. package/es/style.min.css +1 -0
  87. package/es/ui/index.js +4 -0
  88. package/es/ui/src/core.js +41 -0
  89. package/es/ui/src/dom.js +90 -0
  90. package/es/ui/src/event.js +75 -0
  91. package/es/ui/src/globalStore.js +8 -0
  92. package/es/ui/src/iconStore.js +76 -0
  93. package/es/ui/src/log.js +13 -0
  94. package/es/ui/src/theme.js +10 -0
  95. package/es/ui/src/utils.js +17 -0
  96. package/es/ui/style.css +0 -0
  97. package/es/ui/style.min.css +0 -0
  98. package/es/vxe-anchor/index.js +3 -0
  99. package/es/vxe-anchor/style.css +40 -0
  100. package/es/vxe-anchor/style.min.css +1 -0
  101. package/es/vxe-anchor-link/index.js +3 -0
  102. package/es/vxe-anchor-link/style.css +0 -0
  103. package/es/vxe-anchor-link/style.min.css +0 -0
  104. package/es/vxe-breadcrumb/index.js +3 -0
  105. package/es/vxe-breadcrumb/style.css +19 -0
  106. package/es/vxe-breadcrumb/style.min.css +1 -0
  107. package/es/vxe-breadcrumb-item/index.js +3 -0
  108. package/es/vxe-breadcrumb-item/style.css +0 -0
  109. package/es/vxe-breadcrumb-item/style.min.css +0 -0
  110. package/es/vxe-button/index.js +3 -0
  111. package/es/vxe-button/style.css +513 -0
  112. package/es/vxe-button/style.min.css +1 -0
  113. package/es/vxe-button-group/index.js +3 -0
  114. package/es/vxe-button-group/style.css +0 -0
  115. package/es/vxe-button-group/style.min.css +0 -0
  116. package/es/vxe-col/index.js +3 -0
  117. package/es/vxe-col/style.css +95 -0
  118. package/es/vxe-col/style.min.css +1 -0
  119. package/es/vxe-design/index.js +3 -0
  120. package/es/vxe-design/style.css +0 -0
  121. package/es/vxe-design/style.min.css +0 -0
  122. package/es/vxe-icon/index.js +3 -0
  123. package/es/vxe-icon/style.css +766 -0
  124. package/es/vxe-icon/style.min.css +1 -0
  125. package/es/vxe-layout-aside/index.js +3 -0
  126. package/es/vxe-layout-aside/style.css +12 -0
  127. package/es/vxe-layout-aside/style.min.css +1 -0
  128. package/es/vxe-layout-body/index.js +3 -0
  129. package/es/vxe-layout-body/style.css +3 -0
  130. package/es/vxe-layout-body/style.min.css +1 -0
  131. package/es/vxe-layout-container/index.js +3 -0
  132. package/es/vxe-layout-container/style.css +10 -0
  133. package/es/vxe-layout-container/style.min.css +1 -0
  134. package/es/vxe-layout-footer/index.js +3 -0
  135. package/es/vxe-layout-footer/style.css +10 -0
  136. package/es/vxe-layout-footer/style.min.css +1 -0
  137. package/es/vxe-layout-header/index.js +3 -0
  138. package/es/vxe-layout-header/style.css +10 -0
  139. package/es/vxe-layout-header/style.min.css +1 -0
  140. package/es/vxe-row/index.js +3 -0
  141. package/es/vxe-row/style.css +10 -0
  142. package/es/vxe-row/style.min.css +1 -0
  143. package/es/vxe-ui/index.js +3 -0
  144. package/es/vxe-ui/style.css +0 -0
  145. package/es/vxe-ui/style.min.css +0 -0
  146. package/lib/anchor/index.js +15 -0
  147. package/lib/anchor/index.min.js +1 -0
  148. package/lib/anchor/src/anchor.js +220 -0
  149. package/lib/anchor/src/anchor.min.js +1 -0
  150. package/lib/anchor/style/index.js +1 -0
  151. package/lib/anchor/style/style.css +40 -0
  152. package/lib/anchor/style/style.min.css +1 -0
  153. package/lib/anchor-link/index.js +15 -0
  154. package/lib/anchor-link/index.min.js +1 -0
  155. package/lib/anchor-link/src/anchor-link.js +106 -0
  156. package/lib/anchor-link/src/anchor-link.min.js +1 -0
  157. package/lib/anchor-link/src/util.js +29 -0
  158. package/lib/anchor-link/src/util.min.js +1 -0
  159. package/lib/anchor-link/style/index.js +1 -0
  160. package/lib/anchor-link/style/style.css +0 -0
  161. package/lib/anchor-link/style/style.min.css +0 -0
  162. package/lib/breadcrumb/index.js +15 -0
  163. package/lib/breadcrumb/index.min.js +1 -0
  164. package/lib/breadcrumb/src/breadcrumb.js +53 -0
  165. package/lib/breadcrumb/src/breadcrumb.min.js +1 -0
  166. package/lib/breadcrumb/style/index.js +1 -0
  167. package/lib/breadcrumb/style/style.css +19 -0
  168. package/lib/breadcrumb/style/style.min.css +1 -0
  169. package/lib/breadcrumb-item/index.js +15 -0
  170. package/lib/breadcrumb-item/index.min.js +1 -0
  171. package/lib/breadcrumb-item/src/breadcrumb-item.js +58 -0
  172. package/lib/breadcrumb-item/src/breadcrumb-item.min.js +1 -0
  173. package/lib/breadcrumb-item/style/index.js +1 -0
  174. package/lib/breadcrumb-item/style/style.css +0 -0
  175. package/lib/breadcrumb-item/style/style.min.css +0 -0
  176. package/lib/button/index.js +15 -0
  177. package/lib/button/index.min.js +1 -0
  178. package/lib/button/src/button.js +540 -0
  179. package/lib/button/src/button.min.js +1 -0
  180. package/lib/button/style/index.js +1 -0
  181. package/lib/button/style/style.css +513 -0
  182. package/lib/button/style/style.min.css +1 -0
  183. package/lib/button-group/index.js +15 -0
  184. package/lib/button-group/index.min.js +1 -0
  185. package/lib/button-group/src/button-group.js +88 -0
  186. package/lib/button-group/src/button-group.min.js +1 -0
  187. package/lib/button-group/style/index.js +1 -0
  188. package/lib/button-group/style/style.css +0 -0
  189. package/lib/button-group/style/style.min.css +0 -0
  190. package/lib/col/index.js +15 -0
  191. package/lib/col/index.min.js +1 -0
  192. package/lib/col/src/col.js +96 -0
  193. package/lib/col/src/col.min.js +1 -0
  194. package/lib/col/style/index.js +1 -0
  195. package/lib/col/style/style.css +95 -0
  196. package/lib/col/style/style.min.css +1 -0
  197. package/lib/components.js +230 -0
  198. package/lib/components.min.js +1 -0
  199. package/lib/design/index.js +15 -0
  200. package/lib/design/index.min.js +1 -0
  201. package/lib/design/src/design.js +48 -0
  202. package/lib/design/src/design.min.js +1 -0
  203. package/lib/design/style/index.js +1 -0
  204. package/lib/design/style/style.css +0 -0
  205. package/lib/design/style/style.min.css +0 -0
  206. package/lib/hooks/size.js +16 -0
  207. package/lib/hooks/size.min.js +1 -0
  208. package/lib/icon/index.js +15 -0
  209. package/lib/icon/index.min.js +1 -0
  210. package/lib/icon/src/icon.js +36 -0
  211. package/lib/icon/src/icon.min.js +1 -0
  212. package/lib/icon/style/index.js +1 -0
  213. package/lib/icon/style/style.css +766 -0
  214. package/lib/icon/style/style.min.css +1 -0
  215. package/lib/index.common.js +22 -0
  216. package/lib/index.umd.js +4461 -0
  217. package/lib/index.umd.min.js +1 -0
  218. package/lib/layout-aside/index.js +15 -0
  219. package/lib/layout-aside/index.min.js +1 -0
  220. package/lib/layout-aside/src/layout-aside.js +80 -0
  221. package/lib/layout-aside/src/layout-aside.min.js +1 -0
  222. package/lib/layout-aside/style/index.js +1 -0
  223. package/lib/layout-aside/style/style.css +12 -0
  224. package/lib/layout-aside/style/style.min.css +1 -0
  225. package/lib/layout-body/index.js +15 -0
  226. package/lib/layout-body/index.min.js +1 -0
  227. package/lib/layout-body/src/layout-body.js +46 -0
  228. package/lib/layout-body/src/layout-body.min.js +1 -0
  229. package/lib/layout-body/style/index.js +1 -0
  230. package/lib/layout-body/style/style.css +3 -0
  231. package/lib/layout-body/style/style.min.css +1 -0
  232. package/lib/layout-container/index.js +15 -0
  233. package/lib/layout-container/index.min.js +1 -0
  234. package/lib/layout-container/src/layout-container.js +50 -0
  235. package/lib/layout-container/src/layout-container.min.js +1 -0
  236. package/lib/layout-container/style/index.js +1 -0
  237. package/lib/layout-container/style/style.css +10 -0
  238. package/lib/layout-container/style/style.min.css +1 -0
  239. package/lib/layout-footer/index.js +15 -0
  240. package/lib/layout-footer/index.min.js +1 -0
  241. package/lib/layout-footer/src/layout-footer.js +50 -0
  242. package/lib/layout-footer/src/layout-footer.min.js +1 -0
  243. package/lib/layout-footer/style/index.js +1 -0
  244. package/lib/layout-footer/style/style.css +10 -0
  245. package/lib/layout-footer/style/style.min.css +1 -0
  246. package/lib/layout-header/index.js +15 -0
  247. package/lib/layout-header/index.min.js +1 -0
  248. package/lib/layout-header/src/layout-header.js +50 -0
  249. package/lib/layout-header/src/layout-header.min.js +1 -0
  250. package/lib/layout-header/style/index.js +1 -0
  251. package/lib/layout-header/style/style.css +10 -0
  252. package/lib/layout-header/style/style.min.css +1 -0
  253. package/lib/locale/lang/en-US.d.ts +2 -0
  254. package/lib/locale/lang/en-US.js +469 -0
  255. package/lib/locale/lang/en-US.min.js +1 -0
  256. package/lib/locale/lang/en-US.umd.js +483 -0
  257. package/lib/locale/lang/es-ES.d.ts +2 -0
  258. package/lib/locale/lang/es-ES.js +469 -0
  259. package/lib/locale/lang/es-ES.min.js +1 -0
  260. package/lib/locale/lang/es-ES.umd.js +483 -0
  261. package/lib/locale/lang/ja-JP.d.ts +2 -0
  262. package/lib/locale/lang/ja-JP.js +469 -0
  263. package/lib/locale/lang/ja-JP.min.js +1 -0
  264. package/lib/locale/lang/ja-JP.umd.js +483 -0
  265. package/lib/locale/lang/pt-BR.d.ts +2 -0
  266. package/lib/locale/lang/pt-BR.js +469 -0
  267. package/lib/locale/lang/pt-BR.min.js +1 -0
  268. package/lib/locale/lang/pt-BR.umd.js +483 -0
  269. package/lib/locale/lang/zh-CN.d.ts +2 -0
  270. package/lib/locale/lang/zh-CN.js +469 -0
  271. package/lib/locale/lang/zh-CN.min.js +1 -0
  272. package/lib/locale/lang/zh-CN.umd.js +483 -0
  273. package/lib/locale/lang/zh-HK.d.ts +2 -0
  274. package/lib/locale/lang/zh-HK.js +9 -0
  275. package/lib/locale/lang/zh-HK.min.js +1 -0
  276. package/lib/locale/lang/zh-HK.umd.js +483 -0
  277. package/lib/locale/lang/zh-MO.d.ts +2 -0
  278. package/lib/locale/lang/zh-MO.js +9 -0
  279. package/lib/locale/lang/zh-MO.min.js +1 -0
  280. package/lib/locale/lang/zh-MO.umd.js +483 -0
  281. package/lib/locale/lang/zh-TC.d.ts +2 -0
  282. package/lib/locale/lang/zh-TC.js +469 -0
  283. package/lib/locale/lang/zh-TC.min.js +1 -0
  284. package/lib/locale/lang/zh-TC.umd.js +483 -0
  285. package/lib/locale/lang/zh-TW.d.ts +2 -0
  286. package/lib/locale/lang/zh-TW.js +9 -0
  287. package/lib/locale/lang/zh-TW.min.js +1 -0
  288. package/lib/locale/lang/zh-TW.umd.js +483 -0
  289. package/lib/row/index.js +15 -0
  290. package/lib/row/index.min.js +1 -0
  291. package/lib/row/src/row.js +82 -0
  292. package/lib/row/src/row.min.js +1 -0
  293. package/lib/row/style/index.js +1 -0
  294. package/lib/row/style/style.css +10 -0
  295. package/lib/row/style/style.min.css +1 -0
  296. package/lib/style.css +1 -0
  297. package/lib/style.min.css +1 -0
  298. package/lib/ui/index.js +25 -0
  299. package/lib/ui/index.min.js +1 -0
  300. package/lib/ui/src/core.js +53 -0
  301. package/lib/ui/src/core.min.js +1 -0
  302. package/lib/ui/src/dom.js +127 -0
  303. package/lib/ui/src/dom.min.js +1 -0
  304. package/lib/ui/src/event.js +100 -0
  305. package/lib/ui/src/event.min.js +1 -0
  306. package/lib/ui/src/globalStore.js +14 -0
  307. package/lib/ui/src/globalStore.min.js +1 -0
  308. package/lib/ui/src/iconStore.js +82 -0
  309. package/lib/ui/src/iconStore.min.js +1 -0
  310. package/lib/ui/src/log.js +22 -0
  311. package/lib/ui/src/log.min.js +1 -0
  312. package/lib/ui/src/theme.js +17 -0
  313. package/lib/ui/src/theme.min.js +1 -0
  314. package/lib/ui/src/utils.js +28 -0
  315. package/lib/ui/src/utils.min.js +1 -0
  316. package/lib/ui/style/index.js +1 -0
  317. package/lib/ui/style/style.css +0 -0
  318. package/lib/ui/style/style.min.css +0 -0
  319. package/lib/vxe-anchor/index.js +22 -0
  320. package/lib/vxe-anchor/index.min.js +1 -0
  321. package/lib/vxe-anchor/style/index.js +1 -0
  322. package/lib/vxe-anchor/style/style.css +40 -0
  323. package/lib/vxe-anchor/style/style.min.css +1 -0
  324. package/lib/vxe-anchor-link/index.js +22 -0
  325. package/lib/vxe-anchor-link/index.min.js +1 -0
  326. package/lib/vxe-anchor-link/style/index.js +1 -0
  327. package/lib/vxe-anchor-link/style/style.css +0 -0
  328. package/lib/vxe-anchor-link/style/style.min.css +0 -0
  329. package/lib/vxe-breadcrumb/index.js +22 -0
  330. package/lib/vxe-breadcrumb/index.min.js +1 -0
  331. package/lib/vxe-breadcrumb/style/index.js +1 -0
  332. package/lib/vxe-breadcrumb/style/style.css +19 -0
  333. package/lib/vxe-breadcrumb/style/style.min.css +1 -0
  334. package/lib/vxe-breadcrumb-item/index.js +22 -0
  335. package/lib/vxe-breadcrumb-item/index.min.js +1 -0
  336. package/lib/vxe-breadcrumb-item/style/index.js +1 -0
  337. package/lib/vxe-breadcrumb-item/style/style.css +0 -0
  338. package/lib/vxe-breadcrumb-item/style/style.min.css +0 -0
  339. package/lib/vxe-button/index.js +22 -0
  340. package/lib/vxe-button/index.min.js +1 -0
  341. package/lib/vxe-button/style/index.js +1 -0
  342. package/lib/vxe-button/style/style.css +513 -0
  343. package/lib/vxe-button/style/style.min.css +1 -0
  344. package/lib/vxe-button-group/index.js +22 -0
  345. package/lib/vxe-button-group/index.min.js +1 -0
  346. package/lib/vxe-button-group/style/index.js +1 -0
  347. package/lib/vxe-button-group/style/style.css +0 -0
  348. package/lib/vxe-button-group/style/style.min.css +0 -0
  349. package/lib/vxe-col/index.js +22 -0
  350. package/lib/vxe-col/index.min.js +1 -0
  351. package/lib/vxe-col/style/index.js +1 -0
  352. package/lib/vxe-col/style/style.css +95 -0
  353. package/lib/vxe-col/style/style.min.css +1 -0
  354. package/lib/vxe-design/index.js +22 -0
  355. package/lib/vxe-design/index.min.js +1 -0
  356. package/lib/vxe-design/style/index.js +1 -0
  357. package/lib/vxe-design/style/style.css +0 -0
  358. package/lib/vxe-design/style/style.min.css +0 -0
  359. package/lib/vxe-icon/index.js +22 -0
  360. package/lib/vxe-icon/index.min.js +1 -0
  361. package/lib/vxe-icon/style/index.js +1 -0
  362. package/lib/vxe-icon/style/style.css +766 -0
  363. package/lib/vxe-icon/style/style.min.css +1 -0
  364. package/lib/vxe-layout-aside/index.js +22 -0
  365. package/lib/vxe-layout-aside/index.min.js +1 -0
  366. package/lib/vxe-layout-aside/style/index.js +1 -0
  367. package/lib/vxe-layout-aside/style/style.css +12 -0
  368. package/lib/vxe-layout-aside/style/style.min.css +1 -0
  369. package/lib/vxe-layout-body/index.js +22 -0
  370. package/lib/vxe-layout-body/index.min.js +1 -0
  371. package/lib/vxe-layout-body/style/index.js +1 -0
  372. package/lib/vxe-layout-body/style/style.css +3 -0
  373. package/lib/vxe-layout-body/style/style.min.css +1 -0
  374. package/lib/vxe-layout-container/index.js +22 -0
  375. package/lib/vxe-layout-container/index.min.js +1 -0
  376. package/lib/vxe-layout-container/style/index.js +1 -0
  377. package/lib/vxe-layout-container/style/style.css +10 -0
  378. package/lib/vxe-layout-container/style/style.min.css +1 -0
  379. package/lib/vxe-layout-footer/index.js +22 -0
  380. package/lib/vxe-layout-footer/index.min.js +1 -0
  381. package/lib/vxe-layout-footer/style/index.js +1 -0
  382. package/lib/vxe-layout-footer/style/style.css +10 -0
  383. package/lib/vxe-layout-footer/style/style.min.css +1 -0
  384. package/lib/vxe-layout-header/index.js +22 -0
  385. package/lib/vxe-layout-header/index.min.js +1 -0
  386. package/lib/vxe-layout-header/style/index.js +1 -0
  387. package/lib/vxe-layout-header/style/style.css +10 -0
  388. package/lib/vxe-layout-header/style/style.min.css +1 -0
  389. package/lib/vxe-row/index.js +22 -0
  390. package/lib/vxe-row/index.min.js +1 -0
  391. package/lib/vxe-row/style/index.js +1 -0
  392. package/lib/vxe-row/style/style.css +10 -0
  393. package/lib/vxe-row/style/style.min.css +1 -0
  394. package/lib/vxe-ui/index.js +22 -0
  395. package/lib/vxe-ui/index.min.js +1 -0
  396. package/lib/vxe-ui/style/index.js +1 -0
  397. package/lib/vxe-ui/style/style.css +0 -0
  398. package/lib/vxe-ui/style/style.min.css +0 -0
  399. package/package.json +83 -55
  400. package/packages/anchor/index.ts +11 -0
  401. package/packages/anchor/src/anchor.ts +233 -0
  402. package/packages/anchor-link/index.ts +11 -0
  403. package/packages/anchor-link/src/anchor-link.ts +118 -0
  404. package/packages/anchor-link/src/util.ts +23 -0
  405. package/packages/breadcrumb/index.ts +11 -0
  406. package/packages/breadcrumb/src/breadcrumb.ts +60 -0
  407. package/packages/breadcrumb-item/index.ts +11 -0
  408. package/packages/breadcrumb-item/src/breadcrumb-item.ts +71 -0
  409. package/packages/button/index.ts +11 -0
  410. package/packages/button/src/button.ts +526 -0
  411. package/packages/button-group/index.ts +11 -0
  412. package/packages/button-group/src/button-group.ts +81 -0
  413. package/packages/col/index.ts +11 -0
  414. package/packages/col/src/col.ts +98 -0
  415. package/packages/components.ts +66 -0
  416. package/packages/design/index.ts +11 -0
  417. package/packages/design/src/design.ts +55 -0
  418. package/packages/hooks/size.ts +14 -0
  419. package/packages/icon/index.ts +11 -0
  420. package/packages/icon/src/icon.ts +27 -0
  421. package/packages/index.ts +4 -0
  422. package/packages/layout-aside/index.ts +11 -0
  423. package/packages/layout-aside/src/layout-aside.ts +85 -0
  424. package/packages/layout-body/index.ts +11 -0
  425. package/packages/layout-body/src/layout-body.ts +52 -0
  426. package/packages/layout-container/index.ts +11 -0
  427. package/packages/layout-container/src/layout-container.ts +56 -0
  428. package/packages/layout-footer/index.ts +11 -0
  429. package/packages/layout-footer/src/layout-footer.ts +56 -0
  430. package/packages/layout-header/index.ts +11 -0
  431. package/packages/layout-header/src/layout-header.ts +56 -0
  432. package/packages/locale/lang/en-US.ts +465 -0
  433. package/packages/locale/lang/es-ES.ts +465 -0
  434. package/packages/locale/lang/ja-JP.ts +465 -0
  435. package/packages/locale/lang/pt-BR.ts +465 -0
  436. package/packages/locale/lang/zh-CN.ts +465 -0
  437. package/packages/locale/lang/zh-HK.ts +3 -0
  438. package/packages/locale/lang/zh-MO.ts +3 -0
  439. package/packages/locale/lang/zh-TC.ts +465 -0
  440. package/packages/locale/lang/zh-TW.ts +3 -0
  441. package/packages/row/index.ts +11 -0
  442. package/packages/row/src/row.ts +86 -0
  443. package/packages/ui/index.ts +6 -0
  444. package/packages/ui/src/core.ts +51 -0
  445. package/packages/ui/src/dom.ts +103 -0
  446. package/packages/ui/src/event.ts +88 -0
  447. package/packages/ui/src/globalStore.ts +11 -0
  448. package/packages/ui/src/iconStore.ts +88 -0
  449. package/packages/ui/src/log.ts +16 -0
  450. package/packages/ui/src/theme.ts +13 -0
  451. package/packages/ui/src/utils.ts +22 -0
  452. package/styles/all.scss +17 -0
  453. package/styles/base.scss +16 -0
  454. package/styles/components/anchor-link.scss +0 -0
  455. package/styles/components/anchor.scss +42 -0
  456. package/styles/components/breadcrumb-item.scss +0 -0
  457. package/styles/components/breadcrumb.scss +20 -0
  458. package/styles/components/button-group.scss +0 -0
  459. package/styles/components/button.scss +357 -0
  460. package/styles/components/col.scss +32 -0
  461. package/styles/components/design.scss +1 -0
  462. package/styles/components/icon.scss +785 -0
  463. package/styles/components/layout-aside.scss +14 -0
  464. package/styles/components/layout-body.scss +5 -0
  465. package/styles/components/layout-container.scss +12 -0
  466. package/styles/components/layout-footer.scss +12 -0
  467. package/styles/components/layout-header.scss +12 -0
  468. package/styles/components/row.scss +10 -0
  469. package/styles/components/ui.scss +0 -0
  470. package/styles/helpers/mixin.scss +82 -0
  471. package/styles/icon/iconfont.ttf +0 -0
  472. package/styles/icon/iconfont.woff +0 -0
  473. package/styles/icon/iconfont.woff2 +0 -0
  474. package/styles/theme/base.scss +81 -0
  475. package/styles/theme/dark.scss +7 -0
  476. package/styles/theme/default.scss +5 -0
  477. package/types/all.d.ts +67 -0
  478. package/types/component/anchor-link.d.ts +74 -0
  479. package/types/component/anchor.d.ts +79 -0
  480. package/types/component/breadcrumb-item.d.ts +58 -0
  481. package/types/component/breadcrumb.d.ts +61 -0
  482. package/types/component/button-group.d.ts +86 -0
  483. package/types/component/button.d.ts +157 -0
  484. package/types/component/col.d.ts +58 -0
  485. package/types/component/design.d.ts +63 -0
  486. package/types/component/icon.d.ts +67 -0
  487. package/types/component/layout-aside.d.ts +57 -0
  488. package/types/component/layout-body.d.ts +58 -0
  489. package/types/component/layout-container.d.ts +58 -0
  490. package/types/component/layout-footer.d.ts +58 -0
  491. package/types/component/layout-header.d.ts +58 -0
  492. package/types/component/row.d.ts +65 -0
  493. package/types/index.d.ts +4 -0
  494. package/types/tool/common.d.ts +52 -0
  495. package/types/tool/index.d.ts +6 -0
  496. package/types/ui/global-config.d.ts +15 -0
  497. package/types/ui/global-icon.d.ts +15 -0
  498. package/types/ui/index.d.ts +42 -0
@@ -0,0 +1,526 @@
1
+ import { defineComponent, h, ref, Ref, computed, Teleport, VNode, onUnmounted, reactive, nextTick, PropType, onMounted, inject } from 'vue'
2
+ import XEUtils from 'xe-utils'
3
+ import globalConfigStore from '../../ui/src/globalStore'
4
+ import iconConfigStore from '../../ui/src/iconStore'
5
+ import { useSize } from '../../hooks/size'
6
+ import { getAbsolutePos, getEventTargetNode } from '../../ui/src/dom'
7
+ import { getFuncText, getLastZIndex, nextZIndex } from '../../ui/src/utils'
8
+ import { GlobalEvent } from '../../ui/src/event'
9
+ import { warnLog } from '../../ui/src/log'
10
+
11
+ import { VxeButtonConstructor, VxeButtonPropTypes, VxeButtonEmits, ButtonReactData, ButtonMethods, ButtonPrivateRef, ButtonInternalData, VxeButtonGroupConstructor, VxeButtonGroupPrivateMethods } from '../../../types'
12
+
13
+ export default defineComponent({
14
+ name: 'VxeButton',
15
+ props: {
16
+ /**
17
+ * 按钮类型
18
+ */
19
+ type: String as PropType<VxeButtonPropTypes.Type>,
20
+ mode: String as PropType<VxeButtonPropTypes.Mode>,
21
+ className: [String, Function] as PropType<VxeButtonPropTypes.ClassName>,
22
+ popupClassName: [String, Function] as PropType<VxeButtonPropTypes.PopupClassName>,
23
+ /**
24
+ * 按钮尺寸
25
+ */
26
+ size: { type: String as PropType<VxeButtonPropTypes.Size>, default: () => globalConfigStore.button.size || globalConfigStore.size },
27
+ /**
28
+ * 用来标识这一项
29
+ */
30
+ name: [String, Number] as PropType<VxeButtonPropTypes.Name>,
31
+ /**
32
+ * 按钮内容
33
+ */
34
+ content: String as PropType<VxeButtonPropTypes.Content>,
35
+ /**
36
+ * 固定显示下拉面板的方向
37
+ */
38
+ placement: String as PropType<VxeButtonPropTypes.Placement>,
39
+ /**
40
+ * 按钮状态
41
+ */
42
+ status: String as PropType<VxeButtonPropTypes.Status>,
43
+ /**
44
+ * 标题
45
+ */
46
+ title: String as PropType<VxeButtonPropTypes.Title>,
47
+ /**
48
+ * 按钮的图标
49
+ */
50
+ icon: String as PropType<VxeButtonPropTypes.Icon>,
51
+ /**
52
+ * 圆角边框
53
+ */
54
+ round: Boolean as PropType<VxeButtonPropTypes.Round>,
55
+ /**
56
+ * 圆角按钮
57
+ */
58
+ circle: Boolean as PropType<VxeButtonPropTypes.Circle>,
59
+ /**
60
+ * 是否禁用
61
+ */
62
+ disabled: Boolean as PropType<VxeButtonPropTypes.Disabled>,
63
+ /**
64
+ * 是否加载中
65
+ */
66
+ loading: Boolean as PropType<VxeButtonPropTypes.Loading>,
67
+ /**
68
+ * 在下拉面板关闭时销毁内容
69
+ */
70
+ destroyOnClose: Boolean as PropType<VxeButtonPropTypes.DestroyOnClose>,
71
+ /**
72
+ * 是否将弹框容器插入于 body 内
73
+ */
74
+ transfer: { type: Boolean as PropType<VxeButtonPropTypes.Transfer>, default: () => globalConfigStore.button.transfer }
75
+ },
76
+ emits: [
77
+ 'click',
78
+ 'mouseenter',
79
+ 'mouseleave',
80
+ 'dropdown-click'
81
+ ] as VxeButtonEmits,
82
+ setup (props, context) {
83
+ const { slots, emit } = context
84
+
85
+ const xID = XEUtils.uniqueId()
86
+
87
+ const computeSize = useSize(props)
88
+
89
+ const reactData = reactive<ButtonReactData>({
90
+ inited: false,
91
+ showPanel: false,
92
+ animatVisible: false,
93
+ panelIndex: 0,
94
+ panelStyle: {},
95
+ panelPlacement: ''
96
+ })
97
+
98
+ const internalData: ButtonInternalData = {
99
+ showTime: null
100
+ }
101
+
102
+ const refElem = ref() as Ref<HTMLDivElement>
103
+ const refButton = ref() as Ref<HTMLButtonElement>
104
+ const refBtnPanel = ref() as Ref<HTMLDivElement>
105
+
106
+ const refMaps: ButtonPrivateRef = {
107
+ refElem
108
+ }
109
+
110
+ const $xeButton = {
111
+ xID,
112
+ props,
113
+ context,
114
+ reactData,
115
+ internalData,
116
+ getRefMaps: () => refMaps
117
+ } as unknown as VxeButtonConstructor
118
+
119
+ const $xeButtonGroup = inject<(VxeButtonGroupConstructor & VxeButtonGroupPrivateMethods) | null>('$xeButtonGroup', null)
120
+
121
+ let buttonMethods = {} as ButtonMethods
122
+
123
+ const computeIsFormBtn = computed(() => {
124
+ const { type } = props
125
+ if (type) {
126
+ return ['submit', 'reset', 'button'].indexOf(type) > -1
127
+ }
128
+ return false
129
+ })
130
+
131
+ const computeBtnMode = computed(() => {
132
+ const { type, mode } = props
133
+ if (mode === 'text' || type === 'text' || ($xeButtonGroup && $xeButtonGroup.props.mode === 'text')) {
134
+ return 'text'
135
+ }
136
+ return 'button'
137
+ })
138
+
139
+ const computeBtnStatus = computed(() => {
140
+ const { status } = props
141
+ if (status) {
142
+ return status
143
+ }
144
+ if ($xeButtonGroup) {
145
+ return $xeButtonGroup.props.status
146
+ }
147
+ return ''
148
+ })
149
+
150
+ const computeBtnRound = computed(() => {
151
+ const { round } = props
152
+ if (round) {
153
+ return round
154
+ }
155
+ if ($xeButtonGroup) {
156
+ return $xeButtonGroup.props.round
157
+ }
158
+ return false
159
+ })
160
+
161
+ const computeBtnCircle = computed(() => {
162
+ const { circle } = props
163
+ if (circle) {
164
+ return circle
165
+ }
166
+ if ($xeButtonGroup) {
167
+ return $xeButtonGroup.props.circle
168
+ }
169
+ return false
170
+ })
171
+
172
+ const updateZindex = () => {
173
+ if (reactData.panelIndex < getLastZIndex()) {
174
+ reactData.panelIndex = nextZIndex()
175
+ }
176
+ }
177
+
178
+ const updatePlacement = () => {
179
+ return nextTick().then(() => {
180
+ const { transfer, placement } = props
181
+ const { panelIndex } = reactData
182
+ const targetElem = refButton.value
183
+ const panelElem = refBtnPanel.value
184
+ if (panelElem && targetElem) {
185
+ const targetHeight = targetElem.offsetHeight
186
+ const targetWidth = targetElem.offsetWidth
187
+ const panelHeight = panelElem.offsetHeight
188
+ const panelWidth = panelElem.offsetWidth
189
+ const marginSize = 5
190
+ const panelStyle: { [key: string]: string | number } = {
191
+ zIndex: panelIndex
192
+ }
193
+ const { top, left, boundingTop, visibleHeight, visibleWidth } = getAbsolutePos(targetElem)
194
+ let panelPlacement = 'bottom'
195
+ if (transfer) {
196
+ let btnLeft = left + targetWidth - panelWidth
197
+ let btnTop = top + targetHeight
198
+ if (placement === 'top') {
199
+ panelPlacement = 'top'
200
+ btnTop = top - panelHeight
201
+ } else if (!placement) {
202
+ // 如果下面不够放,则向上
203
+ if (boundingTop + targetHeight + panelHeight + marginSize > visibleHeight) {
204
+ panelPlacement = 'top'
205
+ btnTop = top - panelHeight
206
+ }
207
+ // 如果上面不够放,则向下(优先)
208
+ if (btnTop < marginSize) {
209
+ panelPlacement = 'bottom'
210
+ btnTop = top + targetHeight
211
+ }
212
+ }
213
+ // 如果溢出右边
214
+ if (btnLeft + panelWidth + marginSize > visibleWidth) {
215
+ btnLeft -= btnLeft + panelWidth + marginSize - visibleWidth
216
+ }
217
+ // 如果溢出左边
218
+ if (btnLeft < marginSize) {
219
+ btnLeft = marginSize
220
+ }
221
+ Object.assign(panelStyle, {
222
+ left: `${btnLeft}px`,
223
+ right: 'auto',
224
+ top: `${btnTop}px`,
225
+ minWidth: `${targetWidth}px`
226
+ })
227
+ } else {
228
+ if (placement === 'top') {
229
+ panelPlacement = 'top'
230
+ panelStyle.bottom = `${targetHeight}px`
231
+ } else if (!placement) {
232
+ // 如果下面不够放,则向上
233
+ if (boundingTop + targetHeight + panelHeight > visibleHeight) {
234
+ // 如果上面不够放,则向下(优先)
235
+ if (boundingTop - targetHeight - panelHeight > marginSize) {
236
+ panelPlacement = 'top'
237
+ panelStyle.bottom = `${targetHeight}px`
238
+ }
239
+ }
240
+ }
241
+ }
242
+ reactData.panelStyle = panelStyle
243
+ reactData.panelPlacement = panelPlacement
244
+ return nextTick()
245
+ }
246
+ })
247
+ }
248
+
249
+ const clickEvent = (evnt: Event) => {
250
+ if ($xeButtonGroup) {
251
+ $xeButtonGroup.handleClick({ name: props.name as string }, evnt)
252
+ } else {
253
+ buttonMethods.dispatchEvent('click', { $event: evnt }, evnt)
254
+ }
255
+ }
256
+
257
+ const mousedownDropdownEvent = (evnt: MouseEvent) => {
258
+ const isLeftBtn = evnt.button === 0
259
+ if (isLeftBtn) {
260
+ evnt.stopPropagation()
261
+ }
262
+ }
263
+
264
+ const clickDropdownEvent = (evnt: Event) => {
265
+ const dropdownElem = evnt.currentTarget
266
+ const panelElem = refBtnPanel.value
267
+ const { flag, targetElem } = getEventTargetNode(evnt, dropdownElem, 'vxe-button')
268
+ if (flag) {
269
+ if (panelElem) {
270
+ panelElem.dataset.active = 'N'
271
+ }
272
+ reactData.showPanel = false
273
+ setTimeout(() => {
274
+ if (!panelElem || panelElem.dataset.active !== 'Y') {
275
+ reactData.animatVisible = false
276
+ }
277
+ }, 350)
278
+ buttonMethods.dispatchEvent('dropdown-click', { name: targetElem.getAttribute('name'), $event: evnt }, evnt)
279
+ }
280
+ }
281
+
282
+ const mouseenterDropdownEvent = () => {
283
+ const panelElem = refBtnPanel.value
284
+ if (panelElem) {
285
+ panelElem.dataset.active = 'Y'
286
+ reactData.animatVisible = true
287
+ setTimeout(() => {
288
+ if (panelElem.dataset.active === 'Y') {
289
+ reactData.showPanel = true
290
+ updateZindex()
291
+ updatePlacement()
292
+ setTimeout(() => {
293
+ if (reactData.showPanel) {
294
+ updatePlacement()
295
+ }
296
+ }, 50)
297
+ }
298
+ }, 20)
299
+ }
300
+ }
301
+
302
+ const mouseenterTargetEvent = (evnt: MouseEvent) => {
303
+ const panelElem = refBtnPanel.value
304
+ if (panelElem) {
305
+ panelElem.dataset.active = 'Y'
306
+ if (!reactData.inited) {
307
+ reactData.inited = true
308
+ }
309
+ internalData.showTime = setTimeout(() => {
310
+ if (panelElem.dataset.active === 'Y') {
311
+ mouseenterDropdownEvent()
312
+ } else {
313
+ reactData.animatVisible = false
314
+ }
315
+ }, 250)
316
+ }
317
+ mouseenterEvent(evnt)
318
+ }
319
+
320
+ const mouseleaveTargetEvent = (evnt: MouseEvent) => {
321
+ closePanel()
322
+ mouseleaveEvent(evnt)
323
+ }
324
+
325
+ const mouseenterEvent = (evnt: MouseEvent) => {
326
+ emit('mouseenter', { $event: evnt })
327
+ }
328
+
329
+ const mouseleaveEvent = (evnt: MouseEvent) => {
330
+ emit('mouseleave', { $event: evnt })
331
+ }
332
+
333
+ const closePanel = () => {
334
+ const panelElem = refBtnPanel.value
335
+ clearTimeout(internalData.showTime)
336
+ if (panelElem) {
337
+ panelElem.dataset.active = 'N'
338
+ setTimeout(() => {
339
+ if (panelElem.dataset.active !== 'Y') {
340
+ reactData.showPanel = false
341
+ setTimeout(() => {
342
+ if (panelElem.dataset.active !== 'Y') {
343
+ reactData.animatVisible = false
344
+ }
345
+ }, 350)
346
+ }
347
+ }, 100)
348
+ } else {
349
+ reactData.animatVisible = false
350
+ reactData.showPanel = false
351
+ }
352
+ }
353
+
354
+ const mouseleaveDropdownEvent = () => {
355
+ closePanel()
356
+ }
357
+
358
+ const renderContent = () => {
359
+ const { content, icon, loading } = props
360
+ const contVNs: VNode[] = []
361
+ if (loading) {
362
+ contVNs.push(
363
+ h('i', {
364
+ class: ['vxe-button--loading-icon', iconConfigStore.BUTTON_LOADING]
365
+ })
366
+ )
367
+ } else if (slots.icon) {
368
+ contVNs.push(
369
+ h('span', {
370
+ class: 'vxe-button--custom-icon'
371
+ }, slots.icon({}))
372
+ )
373
+ } else if (icon) {
374
+ contVNs.push(
375
+ h('i', {
376
+ class: ['vxe-button--icon', icon]
377
+ })
378
+ )
379
+ }
380
+ if (slots.default) {
381
+ contVNs.push(
382
+ h('span', {
383
+ class: 'vxe-button--content'
384
+ }, slots.default({}))
385
+ )
386
+ } else if (content) {
387
+ contVNs.push(
388
+ h('span', {
389
+ class: 'vxe-button--content'
390
+ }, getFuncText(content))
391
+ )
392
+ }
393
+ return contVNs
394
+ }
395
+
396
+ buttonMethods = {
397
+ dispatchEvent (type, params, evnt) {
398
+ emit(type, Object.assign({ $button: $xeButton, $event: evnt }, params))
399
+ },
400
+ focus () {
401
+ const btnElem = refButton.value
402
+ btnElem.focus()
403
+ return nextTick()
404
+ },
405
+ blur () {
406
+ const btnElem = refButton.value
407
+ btnElem.blur()
408
+ return nextTick()
409
+ }
410
+ }
411
+
412
+ Object.assign($xeButton, buttonMethods)
413
+
414
+ onMounted(() => {
415
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
416
+ if (props.type === 'text') {
417
+ warnLog('vxe.error.delProp', ['type=text', 'mode=text'])
418
+ }
419
+ }
420
+
421
+ GlobalEvent.on($xeButton, 'mousewheel', (evnt: Event) => {
422
+ const panelElem = refBtnPanel.value
423
+ if (reactData.showPanel && !getEventTargetNode(evnt, panelElem).flag) {
424
+ closePanel()
425
+ }
426
+ })
427
+ })
428
+
429
+ onUnmounted(() => {
430
+ GlobalEvent.off($xeButton, 'mousewheel')
431
+ })
432
+
433
+ const renderVN = () => {
434
+ const { className, popupClassName, transfer, title, type, destroyOnClose, name, disabled, loading } = props
435
+ const { inited, showPanel } = reactData
436
+ const isFormBtn = computeIsFormBtn.value
437
+ const btnMode = computeBtnMode.value
438
+ const btnStatus = computeBtnStatus.value
439
+ const btnRound = computeBtnRound.value
440
+ const btnCircle = computeBtnCircle.value
441
+ const vSize = computeSize.value
442
+ if (slots.dropdowns) {
443
+ return h('div', {
444
+ ref: refElem,
445
+ class: ['vxe-button--dropdown', className ? (XEUtils.isFunction(className) ? className({ $button: $xeButton }) : className) : '', {
446
+ [`size--${vSize}`]: vSize,
447
+ 'is--active': showPanel
448
+ }]
449
+ }, [
450
+ h('button', {
451
+ ref: refButton,
452
+ class: ['vxe-button', `type--${btnMode}`, {
453
+ [`size--${vSize}`]: vSize,
454
+ [`theme--${btnStatus}`]: btnStatus,
455
+ 'is--round': btnRound,
456
+ 'is--circle': btnCircle,
457
+ 'is--disabled': disabled || loading,
458
+ 'is--loading': loading
459
+ }],
460
+ title,
461
+ name,
462
+ type: isFormBtn ? type : 'button',
463
+ disabled: disabled || loading,
464
+ onMouseenter: mouseenterTargetEvent,
465
+ onMouseleave: mouseleaveTargetEvent,
466
+ onClick: clickEvent
467
+ }, renderContent().concat([
468
+ h('i', {
469
+ class: `vxe-button--dropdown-arrow ${iconConfigStore.BUTTON_DROPDOWN}`
470
+ })
471
+ ])),
472
+ h(Teleport, {
473
+ to: 'body',
474
+ disabled: transfer ? !inited : true
475
+ }, [
476
+ h('div', {
477
+ ref: refBtnPanel,
478
+ class: ['vxe-button--dropdown-panel', popupClassName ? (XEUtils.isFunction(popupClassName) ? popupClassName({ $button: $xeButton }) : popupClassName) : '', {
479
+ [`size--${vSize}`]: vSize,
480
+ 'animat--leave': reactData.animatVisible,
481
+ 'animat--enter': showPanel
482
+ }],
483
+ placement: reactData.panelPlacement,
484
+ style: reactData.panelStyle
485
+ }, inited
486
+ ? [
487
+ h('div', {
488
+ class: 'vxe-button--dropdown-wrapper',
489
+ onMousedown: mousedownDropdownEvent,
490
+ onClick: clickDropdownEvent,
491
+ onMouseenter: mouseenterDropdownEvent,
492
+ onMouseleave: mouseleaveDropdownEvent
493
+ }, destroyOnClose && !showPanel ? [] : slots.dropdowns({}))
494
+ ]
495
+ : [])
496
+ ])
497
+ ])
498
+ }
499
+ return h('button', {
500
+ ref: refButton,
501
+ class: ['vxe-button', `type--${btnMode}`, className ? (XEUtils.isFunction(className) ? className({ $button: $xeButton }) : className) : '', {
502
+ [`size--${vSize}`]: vSize,
503
+ [`theme--${btnStatus}`]: btnStatus,
504
+ 'is--round': btnRound,
505
+ 'is--circle': btnCircle,
506
+ 'is--disabled': disabled || loading,
507
+ 'is--loading': loading
508
+ }],
509
+ title,
510
+ name,
511
+ type: isFormBtn ? type : 'button',
512
+ disabled: disabled || loading,
513
+ onClick: clickEvent,
514
+ onMouseenter: mouseenterEvent,
515
+ onMouseleave: mouseleaveEvent
516
+ }, renderContent())
517
+ }
518
+
519
+ $xeButton.renderVN = renderVN
520
+
521
+ return $xeButton
522
+ },
523
+ render () {
524
+ return this.renderVN()
525
+ }
526
+ })
@@ -0,0 +1,11 @@
1
+ import { App } from 'vue'
2
+ import VxeButtonGroupComponent from './src/button-group'
3
+
4
+ const VxeButtonGroup = Object.assign({}, VxeButtonGroupComponent, {
5
+ install (app: App) {
6
+ app.component(VxeButtonGroupComponent.name as string, VxeButtonGroupComponent)
7
+ }
8
+ })
9
+
10
+ export const ButtonGroup = VxeButtonGroup
11
+ export default VxeButtonGroup
@@ -0,0 +1,81 @@
1
+ import { defineComponent, h, provide, PropType } from 'vue'
2
+ import globalConfigStore from '../../ui/src/globalStore'
3
+ import XEUtils from 'xe-utils'
4
+ import VxeButtonComponent from '../../button/src/button'
5
+ import { useSize } from '../../hooks/size'
6
+
7
+ import { VxeButtonGroupPropTypes, VxeButtonGroupEmits, VxeButtonGroupConstructor, VxeButtonGroupPrivateMethods, ButtonGroupMethods, ButtonPrivateComputed, ButtonGroupPrivateMethods } from '../../../types'
8
+
9
+ export default defineComponent({
10
+ name: 'VxeButtonGroup',
11
+ props: {
12
+ options: Array as PropType<VxeButtonGroupPropTypes.Options>,
13
+ mode: String as PropType<VxeButtonGroupPropTypes.Mode>,
14
+ status: String as PropType<VxeButtonGroupPropTypes.Status>,
15
+ round: Boolean as PropType<VxeButtonGroupPropTypes.Round>,
16
+ circle: Boolean as PropType<VxeButtonGroupPropTypes.Circle>,
17
+ className: [String, Function] as PropType<VxeButtonGroupPropTypes.ClassName>,
18
+ disabled: Boolean as PropType<VxeButtonGroupPropTypes.Disabled>,
19
+ size: { type: String as PropType<VxeButtonGroupPropTypes.Size>, default: () => globalConfigStore.buttonGroup.size || globalConfigStore.size }
20
+ },
21
+ emits: [
22
+ 'click'
23
+ ] as VxeButtonGroupEmits,
24
+ setup (props, context) {
25
+ const { slots, emit } = context
26
+
27
+ const xID = XEUtils.uniqueId()
28
+
29
+ const computeMaps: ButtonPrivateComputed = {}
30
+
31
+ const $xeButtonGroup = {
32
+ xID,
33
+ props,
34
+ context,
35
+
36
+ getComputeMaps: () => computeMaps
37
+ } as unknown as VxeButtonGroupConstructor & VxeButtonGroupPrivateMethods
38
+
39
+ useSize(props)
40
+
41
+ const buttonGroupMethods: ButtonGroupMethods = {
42
+ dispatchEvent (type, params, evnt) {
43
+ emit(type, Object.assign({ $buttonGroup: $xeButtonGroup, $event: evnt }, params))
44
+ }
45
+ }
46
+
47
+ const buttonGroupPrivateMethods: ButtonGroupPrivateMethods = {
48
+ handleClick (params, evnt) {
49
+ const { options } = props
50
+ const { name } = params
51
+ const option = options ? options.find(item => item.name === name) : null
52
+ buttonGroupMethods.dispatchEvent('click', { ...params, option }, evnt)
53
+ }
54
+ }
55
+
56
+ Object.assign($xeButtonGroup, buttonGroupMethods, buttonGroupPrivateMethods)
57
+
58
+ const renderVN = () => {
59
+ const { className, options } = props
60
+ const defaultSlot = slots.default
61
+ return h('div', {
62
+ class: ['vxe-button-group', className ? (XEUtils.isFunction(className) ? className({ $buttonGroup: $xeButtonGroup }) : className) : '']
63
+ }, defaultSlot
64
+ ? defaultSlot({})
65
+ : (options
66
+ ? options.map((item, index) => {
67
+ return h(VxeButtonComponent, {
68
+ key: index,
69
+ ...item
70
+ })
71
+ })
72
+ : []))
73
+ }
74
+
75
+ $xeButtonGroup.renderVN = renderVN
76
+
77
+ provide('$xeButtonGroup', $xeButtonGroup)
78
+
79
+ return renderVN
80
+ }
81
+ })
@@ -0,0 +1,11 @@
1
+ import { App } from 'vue'
2
+ import VxeColComponent from './src/col'
3
+
4
+ const VxeCol = Object.assign({}, VxeColComponent, {
5
+ install (app: App) {
6
+ app.component(VxeColComponent.name as string, VxeColComponent)
7
+ }
8
+ })
9
+
10
+ export const Col = VxeCol
11
+ export default VxeCol