vxe-pc-ui 3.0.0 → 3.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 (331) hide show
  1. package/es/button/src/button.js +3 -0
  2. package/es/carousel/index.js +12 -0
  3. package/es/carousel/src/carousel-item.js +100 -0
  4. package/es/carousel/src/carousel.js +418 -0
  5. package/es/carousel/src/util.js +17 -0
  6. package/es/carousel/style.css +185 -0
  7. package/es/carousel/style.min.css +1 -0
  8. package/es/carousel-item/index.js +12 -0
  9. package/es/carousel-item/style.css +0 -0
  10. package/es/carousel-item/style.min.css +0 -0
  11. package/es/checkbox/index.js +12 -0
  12. package/es/checkbox/src/checkbox.js +159 -0
  13. package/es/checkbox/src/group.js +154 -0
  14. package/es/checkbox/style.css +117 -0
  15. package/es/checkbox/style.min.css +1 -0
  16. package/es/checkbox-group/index.js +12 -0
  17. package/es/checkbox-group/style.css +0 -0
  18. package/es/checkbox-group/style.min.css +0 -0
  19. package/es/components.js +39 -39
  20. package/es/date-picker/src/date-picker.js +3 -0
  21. package/es/icon/style.css +1 -1
  22. package/es/icon-picker/index.js +12 -0
  23. package/es/icon-picker/src/icon-picker.js +668 -0
  24. package/es/icon-picker/style.css +207 -0
  25. package/es/icon-picker/style.min.css +1 -0
  26. package/es/input/index.js +12 -0
  27. package/es/input/src/input.js +2892 -0
  28. package/es/input/style.css +941 -0
  29. package/es/input/style.min.css +1 -0
  30. package/es/layout-footer/src/layout-footer.js +2 -1
  31. package/es/layout-header/src/layout-header.js +2 -1
  32. package/es/optgroup/index.js +12 -0
  33. package/es/optgroup/style.css +0 -0
  34. package/es/optgroup/style.min.css +0 -0
  35. package/es/option/index.js +12 -0
  36. package/es/option/style.css +0 -0
  37. package/es/option/style.min.css +0 -0
  38. package/es/pager/index.js +12 -0
  39. package/es/pager/src/pager.js +687 -0
  40. package/es/password-input/index.js +12 -0
  41. package/es/password-input/src/password-input.js +388 -0
  42. package/es/password-input/style.css +604 -0
  43. package/es/password-input/style.min.css +1 -0
  44. package/es/pulldown/src/pulldown.js +5 -1
  45. package/es/select/index.js +12 -0
  46. package/es/select/src/optgroup.js +90 -0
  47. package/es/select/src/option-info.js +16 -0
  48. package/es/select/src/option.js +86 -0
  49. package/es/select/src/select.js +1269 -0
  50. package/es/select/src/util.js +35 -0
  51. package/es/select/style.css +207 -0
  52. package/es/select/style.min.css +1 -0
  53. package/es/style.css +1 -1
  54. package/es/style.min.css +1 -1
  55. package/es/tab-pane/index.js +12 -0
  56. package/es/tab-pane/style.css +0 -0
  57. package/es/tab-pane/style.min.css +0 -0
  58. package/es/tabs/index.js +12 -0
  59. package/es/tabs/src/tab-pane.js +119 -0
  60. package/es/tabs/src/tabs.js +593 -0
  61. package/es/tabs/src/util.js +17 -0
  62. package/es/tabs/style.css +342 -0
  63. package/es/tabs/style.min.css +1 -0
  64. package/es/ui/index.js +1 -1
  65. package/es/ui/src/log.js +1 -1
  66. package/es/vxe-carousel/index.js +3 -0
  67. package/es/vxe-carousel/style.css +185 -0
  68. package/es/vxe-carousel/style.min.css +1 -0
  69. package/es/vxe-carousel-item/index.js +3 -0
  70. package/es/vxe-carousel-item/style.css +0 -0
  71. package/es/vxe-carousel-item/style.min.css +0 -0
  72. package/es/vxe-checkbox/index.js +3 -0
  73. package/es/vxe-checkbox/style.css +117 -0
  74. package/es/vxe-checkbox/style.min.css +1 -0
  75. package/es/vxe-checkbox-group/index.js +3 -0
  76. package/es/vxe-checkbox-group/style.css +0 -0
  77. package/es/vxe-checkbox-group/style.min.css +0 -0
  78. package/es/vxe-icon-picker/index.js +3 -0
  79. package/es/vxe-icon-picker/style.css +207 -0
  80. package/es/vxe-icon-picker/style.min.css +1 -0
  81. package/es/vxe-input/index.js +3 -0
  82. package/es/vxe-input/style.css +941 -0
  83. package/es/vxe-input/style.min.css +1 -0
  84. package/es/vxe-optgroup/index.js +3 -0
  85. package/es/vxe-optgroup/style.css +0 -0
  86. package/es/vxe-optgroup/style.min.css +0 -0
  87. package/es/vxe-option/index.js +3 -0
  88. package/es/vxe-option/style.css +0 -0
  89. package/es/vxe-option/style.min.css +0 -0
  90. package/es/vxe-password-input/index.js +3 -0
  91. package/es/vxe-password-input/style.css +604 -0
  92. package/es/vxe-password-input/style.min.css +1 -0
  93. package/es/vxe-select/index.js +3 -0
  94. package/es/vxe-select/style.css +207 -0
  95. package/es/vxe-select/style.min.css +1 -0
  96. package/es/vxe-tab-pane/index.js +3 -0
  97. package/es/vxe-tab-pane/style.css +0 -0
  98. package/es/vxe-tab-pane/style.min.css +0 -0
  99. package/es/vxe-tabs/index.js +3 -0
  100. package/es/vxe-tabs/style.css +342 -0
  101. package/es/vxe-tabs/style.min.css +1 -0
  102. package/lib/button/src/button.js +3 -0
  103. package/lib/button/src/button.min.js +1 -1
  104. package/lib/carousel/index.js +19 -0
  105. package/lib/carousel/index.min.js +1 -0
  106. package/lib/carousel/src/carousel-item.js +107 -0
  107. package/lib/carousel/src/carousel-item.min.js +1 -0
  108. package/lib/carousel/src/carousel.js +437 -0
  109. package/lib/carousel/src/carousel.min.js +1 -0
  110. package/lib/carousel/src/util.js +27 -0
  111. package/lib/carousel/src/util.min.js +1 -0
  112. package/lib/carousel/style/index.js +1 -0
  113. package/lib/carousel/style/style.css +185 -0
  114. package/lib/carousel/style/style.min.css +1 -0
  115. package/lib/carousel-item/index.js +19 -0
  116. package/lib/carousel-item/index.min.js +1 -0
  117. package/lib/carousel-item/style/index.js +1 -0
  118. package/lib/carousel-item/style/style.css +0 -0
  119. package/lib/carousel-item/style/style.min.css +0 -0
  120. package/lib/checkbox/index.js +19 -0
  121. package/lib/checkbox/index.min.js +1 -0
  122. package/lib/checkbox/src/checkbox.js +169 -0
  123. package/lib/checkbox/src/checkbox.min.js +1 -0
  124. package/lib/checkbox/src/group.js +164 -0
  125. package/lib/checkbox/src/group.min.js +1 -0
  126. package/lib/checkbox/style/index.js +1 -0
  127. package/lib/checkbox/style/style.css +117 -0
  128. package/lib/checkbox/style/style.min.css +1 -0
  129. package/lib/checkbox-group/index.js +19 -0
  130. package/lib/checkbox-group/index.min.js +1 -0
  131. package/lib/checkbox-group/style/index.js +1 -0
  132. package/lib/checkbox-group/style/style.css +0 -0
  133. package/lib/checkbox-group/style/style.min.css +0 -0
  134. package/lib/components.js +159 -60
  135. package/lib/components.min.js +1 -1
  136. package/lib/date-picker/src/date-picker.js +3 -0
  137. package/lib/date-picker/src/date-picker.min.js +1 -1
  138. package/lib/icon/style/style.css +1 -1
  139. package/lib/icon/style/style.min.css +1 -1
  140. package/lib/icon-picker/index.js +19 -0
  141. package/lib/icon-picker/index.min.js +1 -0
  142. package/lib/icon-picker/src/icon-picker.js +646 -0
  143. package/lib/icon-picker/src/icon-picker.min.js +1 -0
  144. package/lib/icon-picker/style/index.js +1 -0
  145. package/lib/icon-picker/style/style.css +207 -0
  146. package/lib/icon-picker/style/style.min.css +1 -0
  147. package/lib/index.umd.js +15870 -7738
  148. package/lib/index.umd.min.js +1 -1
  149. package/lib/input/index.js +19 -0
  150. package/lib/input/index.min.js +1 -0
  151. package/lib/input/src/input.js +2897 -0
  152. package/lib/input/src/input.min.js +1 -0
  153. package/lib/input/style/index.js +1 -0
  154. package/lib/input/style/style.css +941 -0
  155. package/lib/input/style/style.min.css +1 -0
  156. package/lib/layout-footer/src/layout-footer.js +2 -1
  157. package/lib/layout-header/src/layout-header.js +2 -1
  158. package/lib/optgroup/index.js +19 -0
  159. package/lib/optgroup/index.min.js +1 -0
  160. package/lib/optgroup/style/index.js +1 -0
  161. package/lib/optgroup/style/style.css +0 -0
  162. package/lib/optgroup/style/style.min.css +0 -0
  163. package/lib/option/index.js +19 -0
  164. package/lib/option/index.min.js +1 -0
  165. package/lib/option/style/index.js +1 -0
  166. package/lib/option/style/style.css +0 -0
  167. package/lib/option/style/style.min.css +0 -0
  168. package/lib/pager/index.js +19 -0
  169. package/lib/pager/index.min.js +1 -0
  170. package/lib/pager/src/pager.js +714 -0
  171. package/lib/pager/src/pager.min.js +1 -0
  172. package/lib/password-input/index.js +19 -0
  173. package/lib/password-input/index.min.js +1 -0
  174. package/lib/password-input/src/password-input.js +398 -0
  175. package/lib/password-input/src/password-input.min.js +1 -0
  176. package/lib/password-input/style/index.js +1 -0
  177. package/lib/password-input/style/style.css +604 -0
  178. package/lib/password-input/style/style.min.css +1 -0
  179. package/lib/pulldown/src/pulldown.js +5 -1
  180. package/lib/pulldown/src/pulldown.min.js +1 -1
  181. package/lib/select/index.js +19 -0
  182. package/lib/select/index.min.js +1 -0
  183. package/lib/select/src/optgroup.js +97 -0
  184. package/lib/select/src/optgroup.min.js +1 -0
  185. package/lib/select/src/option-info.js +33 -0
  186. package/lib/select/src/option-info.min.js +1 -0
  187. package/lib/select/src/option.js +93 -0
  188. package/lib/select/src/option.min.js +1 -0
  189. package/lib/select/src/select.js +1315 -0
  190. package/lib/select/src/select.min.js +1 -0
  191. package/lib/select/src/util.js +50 -0
  192. package/lib/select/src/util.min.js +1 -0
  193. package/lib/select/style/index.js +1 -0
  194. package/lib/select/style/style.css +207 -0
  195. package/lib/select/style/style.min.css +1 -0
  196. package/lib/style.css +1 -1
  197. package/lib/style.min.css +1 -1
  198. package/lib/tab-pane/index.js +19 -0
  199. package/lib/tab-pane/index.min.js +1 -0
  200. package/lib/tab-pane/style/index.js +1 -0
  201. package/lib/tab-pane/style/style.css +0 -0
  202. package/lib/tab-pane/style/style.min.css +0 -0
  203. package/lib/tabs/index.js +19 -0
  204. package/lib/tabs/index.min.js +1 -0
  205. package/lib/tabs/src/tab-pane.js +128 -0
  206. package/lib/tabs/src/tab-pane.min.js +1 -0
  207. package/lib/tabs/src/tabs.js +630 -0
  208. package/lib/tabs/src/tabs.min.js +1 -0
  209. package/lib/tabs/src/util.js +29 -0
  210. package/lib/tabs/src/util.min.js +1 -0
  211. package/lib/tabs/style/index.js +1 -0
  212. package/lib/tabs/style/style.css +342 -0
  213. package/lib/tabs/style/style.min.css +1 -0
  214. package/lib/ui/index.js +1 -1
  215. package/lib/ui/index.min.js +1 -1
  216. package/lib/ui/src/log.js +1 -1
  217. package/lib/ui/src/log.min.js +1 -1
  218. package/lib/vxe-carousel/index.js +23 -0
  219. package/lib/vxe-carousel/index.min.js +1 -0
  220. package/lib/vxe-carousel/style/index.js +1 -0
  221. package/lib/vxe-carousel/style/style.css +185 -0
  222. package/lib/vxe-carousel/style/style.min.css +1 -0
  223. package/lib/vxe-carousel-item/index.js +23 -0
  224. package/lib/vxe-carousel-item/index.min.js +1 -0
  225. package/lib/vxe-carousel-item/style/index.js +1 -0
  226. package/lib/vxe-carousel-item/style/style.css +0 -0
  227. package/lib/vxe-carousel-item/style/style.min.css +0 -0
  228. package/lib/vxe-checkbox/index.js +23 -0
  229. package/lib/vxe-checkbox/index.min.js +1 -0
  230. package/lib/vxe-checkbox/style/index.js +1 -0
  231. package/lib/vxe-checkbox/style/style.css +117 -0
  232. package/lib/vxe-checkbox/style/style.min.css +1 -0
  233. package/lib/vxe-checkbox-group/index.js +23 -0
  234. package/lib/vxe-checkbox-group/index.min.js +1 -0
  235. package/lib/vxe-checkbox-group/style/index.js +1 -0
  236. package/lib/vxe-checkbox-group/style/style.css +0 -0
  237. package/lib/vxe-checkbox-group/style/style.min.css +0 -0
  238. package/lib/vxe-icon-picker/index.js +23 -0
  239. package/lib/vxe-icon-picker/index.min.js +1 -0
  240. package/lib/vxe-icon-picker/style/index.js +1 -0
  241. package/lib/vxe-icon-picker/style/style.css +207 -0
  242. package/lib/vxe-icon-picker/style/style.min.css +1 -0
  243. package/lib/vxe-input/index.js +23 -0
  244. package/lib/vxe-input/index.min.js +1 -0
  245. package/lib/vxe-input/style/index.js +1 -0
  246. package/lib/vxe-input/style/style.css +941 -0
  247. package/lib/vxe-input/style/style.min.css +1 -0
  248. package/lib/vxe-optgroup/index.js +23 -0
  249. package/lib/vxe-optgroup/index.min.js +1 -0
  250. package/lib/vxe-optgroup/style/index.js +1 -0
  251. package/lib/vxe-optgroup/style/style.css +0 -0
  252. package/lib/vxe-optgroup/style/style.min.css +0 -0
  253. package/lib/vxe-option/index.js +23 -0
  254. package/lib/vxe-option/index.min.js +1 -0
  255. package/lib/vxe-option/style/index.js +1 -0
  256. package/lib/vxe-option/style/style.css +0 -0
  257. package/lib/vxe-option/style/style.min.css +0 -0
  258. package/lib/vxe-password-input/index.js +23 -0
  259. package/lib/vxe-password-input/index.min.js +1 -0
  260. package/lib/vxe-password-input/style/index.js +1 -0
  261. package/lib/vxe-password-input/style/style.css +604 -0
  262. package/lib/vxe-password-input/style/style.min.css +1 -0
  263. package/lib/vxe-select/index.js +23 -0
  264. package/lib/vxe-select/index.min.js +1 -0
  265. package/lib/vxe-select/style/index.js +1 -0
  266. package/lib/vxe-select/style/style.css +207 -0
  267. package/lib/vxe-select/style/style.min.css +1 -0
  268. package/lib/vxe-tab-pane/index.js +23 -0
  269. package/lib/vxe-tab-pane/index.min.js +1 -0
  270. package/lib/vxe-tab-pane/style/index.js +1 -0
  271. package/lib/vxe-tab-pane/style/style.css +0 -0
  272. package/lib/vxe-tab-pane/style/style.min.css +0 -0
  273. package/lib/vxe-tabs/index.js +23 -0
  274. package/lib/vxe-tabs/index.min.js +1 -0
  275. package/lib/vxe-tabs/style/index.js +1 -0
  276. package/lib/vxe-tabs/style/style.css +342 -0
  277. package/lib/vxe-tabs/style/style.min.css +1 -0
  278. package/package.json +1 -1
  279. package/packages/button/src/button.ts +3 -0
  280. package/packages/carousel/index.ts +16 -0
  281. package/packages/carousel/src/carousel-item.ts +114 -0
  282. package/packages/carousel/src/carousel.ts +449 -0
  283. package/packages/carousel/src/util.ts +21 -0
  284. package/packages/carousel-item/index.ts +16 -0
  285. package/packages/checkbox/index.ts +16 -0
  286. package/packages/checkbox/src/checkbox.ts +176 -0
  287. package/packages/checkbox/src/group.ts +178 -0
  288. package/packages/checkbox-group/index.ts +16 -0
  289. package/packages/components.ts +39 -39
  290. package/packages/date-picker/src/date-picker.ts +3 -0
  291. package/packages/icon-picker/index.ts +16 -0
  292. package/packages/icon-picker/src/icon-picker.ts +711 -0
  293. package/packages/input/index.ts +16 -0
  294. package/packages/input/src/input.ts +2995 -0
  295. package/packages/layout-footer/src/layout-footer.ts +4 -3
  296. package/packages/layout-header/src/layout-header.ts +2 -1
  297. package/packages/optgroup/index.ts +16 -0
  298. package/packages/option/index.ts +16 -0
  299. package/packages/pager/index.ts +16 -0
  300. package/packages/pager/src/pager.ts +743 -0
  301. package/packages/password-input/index.ts +16 -0
  302. package/packages/password-input/src/password-input.ts +427 -0
  303. package/packages/pulldown/src/pulldown.ts +5 -1
  304. package/packages/select/index.ts +16 -0
  305. package/packages/select/src/optgroup.ts +107 -0
  306. package/packages/select/src/option-info.ts +20 -0
  307. package/packages/select/src/option.ts +103 -0
  308. package/packages/select/src/select.ts +1325 -0
  309. package/packages/select/src/util.ts +46 -0
  310. package/packages/tab-pane/index.ts +16 -0
  311. package/packages/tabs/index.ts +16 -0
  312. package/packages/tabs/src/tab-pane.ts +136 -0
  313. package/packages/tabs/src/tabs.ts +630 -0
  314. package/packages/tabs/src/util.ts +21 -0
  315. package/types/components/carousel.d.ts +5 -0
  316. package/types/components/icon-picker.d.ts +4 -0
  317. package/types/components/input.d.ts +9 -1
  318. package/types/components/optgroup.d.ts +10 -4
  319. package/types/components/tabs.d.ts +4 -0
  320. /package/es/icon/style/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
  321. /package/es/icon/style/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
  322. /package/es/icon/style/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
  323. /package/es/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
  324. /package/es/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
  325. /package/es/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
  326. /package/lib/icon/style/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
  327. /package/lib/icon/style/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
  328. /package/lib/icon/style/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
  329. /package/lib/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
  330. /package/lib/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
  331. /package/lib/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
@@ -0,0 +1,176 @@
1
+ import { PropType, CreateElement, VNode } from 'vue'
2
+ import { defineVxeComponent } from '../../ui/src/comp'
3
+ import XEUtils from 'xe-utils'
4
+ import { getFuncText } from '../../ui/src/utils'
5
+ import { getConfig, createEvent, globalMixins, getIcon } from '../../ui'
6
+
7
+ import type { VxeCheckboxGroupConstructor, VxeCheckboxEmits, ValueOf, CheckboxReactData, VxeComponentSizeType, VxeCheckboxGroupPrivateMethods, VxeCheckboxPropTypes, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
8
+
9
+ export default defineVxeComponent({
10
+ name: 'VxeCheckbox',
11
+ mixins: [
12
+ globalMixins.sizeMixin
13
+ ],
14
+ props: {
15
+ value: [String, Number, Boolean] as PropType<VxeCheckboxPropTypes.ModelValue>,
16
+ label: {
17
+ type: [String, Number] as PropType<VxeCheckboxPropTypes.Label>,
18
+ default: null
19
+ },
20
+ indeterminate: Boolean as PropType<VxeCheckboxPropTypes.Indeterminate>,
21
+ title: [String, Number] as PropType<VxeCheckboxPropTypes.Title>,
22
+ checkedValue: {
23
+ type: [String, Number, Boolean] as PropType<VxeCheckboxPropTypes.CheckedValue>,
24
+ default: true
25
+ },
26
+ uncheckedValue: {
27
+ type: [String, Number, Boolean] as PropType<VxeCheckboxPropTypes.UncheckedValue>,
28
+ default: false
29
+ },
30
+ content: [String, Number] as PropType<VxeCheckboxPropTypes.Content>,
31
+ disabled: {
32
+ type: Boolean as PropType<VxeCheckboxPropTypes.Disabled>,
33
+ default: null
34
+ },
35
+ size: {
36
+ type: String as PropType<VxeCheckboxPropTypes.Size>,
37
+ default: () => getConfig().checkbox.size || getConfig().size
38
+ }
39
+ },
40
+ inject: {
41
+ $xeForm: {
42
+ default: null
43
+ },
44
+ formItemInfo: {
45
+ from: 'xeFormItemInfo',
46
+ default: null
47
+ },
48
+ $xeCheckboxGroup: {
49
+ default: null
50
+ }
51
+ },
52
+ data () {
53
+ const reactData: CheckboxReactData = {
54
+ }
55
+ return {
56
+ xID: XEUtils.uniqueId(),
57
+ reactData
58
+ }
59
+ },
60
+ computed: {
61
+ ...({} as {
62
+ computeSize(): VxeComponentSizeType
63
+ $xeForm(): (VxeFormConstructor & VxeFormPrivateMethods) | null
64
+ formItemInfo(): VxeFormDefines.ProvideItemInfo | null
65
+ $xeCheckboxGroup(): (VxeCheckboxGroupConstructor & VxeCheckboxGroupPrivateMethods) | null
66
+ }),
67
+ computeIsChecked () {
68
+ const $xeCheckbox = this
69
+ const props = $xeCheckbox
70
+ const $xeCheckboxGroup = $xeCheckbox.$xeCheckboxGroup
71
+
72
+ if ($xeCheckboxGroup) {
73
+ return XEUtils.includes($xeCheckboxGroup.value, props.label)
74
+ }
75
+ return props.value === props.checkedValue
76
+ },
77
+ computeIsDisabled () {
78
+ const $xeCheckbox = this
79
+ const props = $xeCheckbox
80
+ const $xeCheckboxGroup = $xeCheckbox.$xeCheckboxGroup
81
+
82
+ const { disabled } = props
83
+ const isChecked = $xeCheckbox.computeIsChecked
84
+ if (disabled === null) {
85
+ if ($xeCheckboxGroup) {
86
+ const isGroupDisabled = $xeCheckboxGroup.computeIsDisabled
87
+ const isGroupMaximize = $xeCheckboxGroup.computeIsMaximize
88
+ return isGroupDisabled || (isGroupMaximize && !isChecked)
89
+ }
90
+ }
91
+ return disabled
92
+ }
93
+ },
94
+ methods: {
95
+ //
96
+ // Method
97
+ //
98
+ dispatchEvent (type: ValueOf<VxeCheckboxEmits>, params: Record<string, any>, evnt: Event | null) {
99
+ const $xeCheckbox = this
100
+ $xeCheckbox.$emit(type, createEvent(evnt, { $checkbox: $xeCheckbox }, params))
101
+ },
102
+ changeEvent (evnt: Event & { target: { checked: boolean } }) {
103
+ const $xeCheckbox = this
104
+ const props = $xeCheckbox
105
+ const $xeCheckboxGroup = $xeCheckbox.$xeCheckboxGroup
106
+ const $xeForm = $xeCheckbox.$xeForm
107
+ const formItemInfo = $xeCheckbox.formItemInfo
108
+
109
+ const { checkedValue, uncheckedValue } = props
110
+ const isDisabled = $xeCheckbox.computeIsDisabled
111
+ if (!isDisabled) {
112
+ const checked = evnt.target.checked
113
+ const value = checked ? checkedValue : uncheckedValue
114
+ const params = { checked, value, label: props.label }
115
+ if ($xeCheckboxGroup) {
116
+ $xeCheckboxGroup.handleChecked(params, evnt)
117
+ } else {
118
+ $xeCheckbox.$emit('input', value)
119
+ $xeCheckbox.dispatchEvent('change', params, evnt)
120
+ // 自动更新校验状态
121
+ if ($xeForm && formItemInfo) {
122
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
123
+ }
124
+ }
125
+ }
126
+ },
127
+
128
+ //
129
+ // Render
130
+ //
131
+ renderVN (h: CreateElement): VNode {
132
+ const $xeCheckbox = this
133
+ const props = $xeCheckbox
134
+ const slots = $xeCheckbox.$scopedSlots
135
+
136
+ const vSize = $xeCheckbox.computeSize
137
+ const isDisabled = $xeCheckbox.computeIsDisabled
138
+ const isChecked = $xeCheckbox.computeIsChecked
139
+ const indeterminate = !isChecked && props.indeterminate
140
+ return h('label', {
141
+ class: ['vxe-checkbox', {
142
+ [`size--${vSize}`]: vSize,
143
+ 'is--indeterminate': indeterminate,
144
+ 'is--disabled': isDisabled,
145
+ 'is--checked': isChecked
146
+ }],
147
+ attrs: {
148
+ title: props.title
149
+ }
150
+ }, [
151
+ h('input', {
152
+ class: 'vxe-checkbox--input',
153
+ domProps: {
154
+ checked: isChecked
155
+ },
156
+ attrs: {
157
+ type: 'checkbox',
158
+ disabled: isDisabled
159
+ },
160
+ on: {
161
+ change: $xeCheckbox.changeEvent
162
+ }
163
+ }),
164
+ h('span', {
165
+ class: ['vxe-checkbox--icon', indeterminate ? getIcon().CHECKBOX_INDETERMINATE : (isChecked ? getIcon().CHECKBOX_CHECKED : getIcon().CHECKBOX_UNCHECKED)]
166
+ }),
167
+ h('span', {
168
+ class: 'vxe-checkbox--label'
169
+ }, slots.default ? slots.default({}) : getFuncText(props.content))
170
+ ])
171
+ }
172
+ },
173
+ render (this: any, h) {
174
+ return this.renderVN(h)
175
+ }
176
+ })
@@ -0,0 +1,178 @@
1
+ import { PropType, CreateElement, VNode } from 'vue'
2
+ import { defineVxeComponent } from '../../ui/src/comp'
3
+ import XEUtils from 'xe-utils'
4
+ import { getConfig, createEvent, globalMixins } from '../../ui'
5
+ import VxeCheckboxComponent from './checkbox'
6
+
7
+ import type { VxeCheckboxGroupEmits, VxeCheckboxPropTypes, ValueOf, CheckboxGroupReactData, VxeComponentSizeType, VxeCheckboxGroupPropTypes, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
8
+
9
+ export default defineVxeComponent({
10
+ name: 'VxeCheckboxGroup',
11
+ mixins: [
12
+ globalMixins.sizeMixin
13
+ ],
14
+ props: {
15
+ value: Array as PropType<VxeCheckboxGroupPropTypes.ModelValue>,
16
+ options: Array as PropType<VxeCheckboxGroupPropTypes.Options>,
17
+ optionProps: Object as PropType<VxeCheckboxGroupPropTypes.OptionProps>,
18
+ disabled: {
19
+ type: Boolean as PropType<VxeCheckboxGroupPropTypes.Disabled>,
20
+ default: null
21
+ },
22
+ max: {
23
+ type: [String, Number] as PropType<VxeCheckboxGroupPropTypes.Max>,
24
+ default: null
25
+ },
26
+ size: {
27
+ type: String as PropType<VxeCheckboxGroupPropTypes.Size>,
28
+ default: () => getConfig().checkboxGroup.size || getConfig().size
29
+ }
30
+ },
31
+ inject: {
32
+ $xeForm: {
33
+ default: null
34
+ },
35
+ formItemInfo: {
36
+ from: 'xeFormItemInfo',
37
+ default: null
38
+ }
39
+ },
40
+ provide () {
41
+ const $xeCheckboxGroup = this
42
+ return {
43
+ $xeCheckboxGroup
44
+ }
45
+ },
46
+ data () {
47
+ const reactData: CheckboxGroupReactData = {
48
+ }
49
+ return {
50
+ xID: XEUtils.uniqueId(),
51
+ reactData
52
+ }
53
+ },
54
+ computed: {
55
+ ...({} as {
56
+ computeSize(): VxeComponentSizeType
57
+ $xeForm(): (VxeFormConstructor & VxeFormPrivateMethods) | null
58
+ formItemInfo(): VxeFormDefines.ProvideItemInfo | null
59
+ }),
60
+ computeIsDisabled () {
61
+ const $xeCheckboxGroup = this
62
+ const props = $xeCheckboxGroup
63
+ const $xeForm = $xeCheckboxGroup.$xeForm
64
+
65
+ const { disabled } = props
66
+ if (disabled === null) {
67
+ if ($xeForm) {
68
+ return $xeForm.readonly || $xeForm.disabled
69
+ }
70
+ return false
71
+ }
72
+ return disabled
73
+ },
74
+ computeIsMaximize () {
75
+ const $xeCheckboxGroup = this
76
+ const props = $xeCheckboxGroup
77
+
78
+ const { value, max } = props
79
+ if (max) {
80
+ return (value ? value.length : 0) >= XEUtils.toNumber(max)
81
+ }
82
+ return false
83
+ },
84
+ computePropsOpts () {
85
+ const $xeCheckboxGroup = this
86
+ const props = $xeCheckboxGroup
87
+
88
+ return Object.assign({}, props.optionProps)
89
+ },
90
+ computeLabelField () {
91
+ const $xeCheckboxGroup = this
92
+
93
+ const propsOpts = $xeCheckboxGroup.computePropsOpts as VxeCheckboxGroupPropTypes.OptionProps
94
+ return propsOpts.label || 'label'
95
+ },
96
+ computeValueField () {
97
+ const $xeCheckboxGroup = this
98
+
99
+ const propsOpts = $xeCheckboxGroup.computePropsOpts as VxeCheckboxGroupPropTypes.OptionProps
100
+ return propsOpts.value || 'value'
101
+ },
102
+ computeDisabledField () {
103
+ const $xeCheckboxGroup = this
104
+
105
+ const propsOpts = $xeCheckboxGroup.computePropsOpts as VxeCheckboxGroupPropTypes.OptionProps
106
+ return propsOpts.disabled || 'disabled'
107
+ }
108
+ },
109
+ methods: {
110
+ //
111
+ // Method
112
+ //
113
+ dispatchEvent (type: ValueOf<VxeCheckboxGroupEmits>, params: Record<string, any>, evnt: Event | null) {
114
+ const $xeCheckboxGroup = this
115
+ $xeCheckboxGroup.$emit(type, createEvent(evnt, { $checkboxGroup: $xeCheckboxGroup }, params))
116
+ },
117
+ handleChecked (params: {
118
+ checked: boolean;
119
+ value: VxeCheckboxPropTypes.ModelValue;
120
+ label: VxeCheckboxPropTypes.Label;
121
+ }, evnt: Event) {
122
+ const $xeCheckboxGroup = this
123
+ const props = $xeCheckboxGroup
124
+ const $xeForm = $xeCheckboxGroup.$xeForm
125
+ const formItemInfo = $xeCheckboxGroup.formItemInfo
126
+
127
+ const { checked, label } = params
128
+ const checklist = props.value || []
129
+ const checkIndex = checklist.indexOf(label)
130
+ if (checked) {
131
+ if (checkIndex === -1) {
132
+ checklist.push(label)
133
+ }
134
+ } else {
135
+ checklist.splice(checkIndex, 1)
136
+ }
137
+ $xeCheckboxGroup.$emit('input', checklist)
138
+ $xeCheckboxGroup.dispatchEvent('change', Object.assign({ checklist }, params), evnt)
139
+ // 自动更新校验状态
140
+ if ($xeForm && formItemInfo) {
141
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, checklist)
142
+ }
143
+ },
144
+
145
+ //
146
+ // Render
147
+ //
148
+ renderVN (h: CreateElement): VNode {
149
+ const $xeCheckboxGroup = this
150
+ const props = $xeCheckboxGroup
151
+ const slots = $xeCheckboxGroup.$scopedSlots
152
+
153
+ const { options } = props
154
+ const defaultSlot = slots.default
155
+ const valueField = $xeCheckboxGroup.computeValueField as 'value'
156
+ const labelField = $xeCheckboxGroup.computeLabelField as 'label'
157
+ const disabledField = $xeCheckboxGroup.computeDisabledField as 'disabled'
158
+ return h('div', {
159
+ class: 'vxe-checkbox-group'
160
+ }, defaultSlot
161
+ ? defaultSlot({})
162
+ : (options
163
+ ? options.map(item => {
164
+ return h(VxeCheckboxComponent, {
165
+ props: {
166
+ label: item[valueField],
167
+ content: item[labelField],
168
+ disabled: item[disabledField]
169
+ }
170
+ })
171
+ })
172
+ : []))
173
+ }
174
+ },
175
+ render (this: any, h) {
176
+ return this.renderVN(h)
177
+ }
178
+ })
@@ -0,0 +1,16 @@
1
+ import { VueConstructor } from 'vue'
2
+ import { VxeUI } from '@vxe-ui/core'
3
+ import VxeCheckboxGroupComponent from '../checkbox/src/group'
4
+ import { dynamicApp } from '../dynamics'
5
+
6
+ export const VxeCheckboxGroup = Object.assign(VxeCheckboxGroupComponent, {
7
+ install (app: VueConstructor) {
8
+ app.component(VxeCheckboxGroupComponent.name as string, VxeCheckboxGroupComponent)
9
+ }
10
+ })
11
+
12
+ dynamicApp.use(VxeCheckboxGroup)
13
+ VxeUI.component(VxeCheckboxGroupComponent)
14
+
15
+ export const CheckboxGroup = VxeCheckboxGroup
16
+ export default VxeCheckboxGroup
@@ -12,10 +12,10 @@ import VxeButton from './button'
12
12
  import VxeButtonGroup from './button-group'
13
13
  // import VxeCalendar from './calendar'
14
14
  import VxeCard from './card'
15
- // import VxeCarousel from './carousel'
16
- // import VxeCarouselItem from './carousel-item'
17
- // import VxeCheckbox from './checkbox'
18
- // import VxeCheckboxGroup from './checkbox-group'
15
+ import VxeCarousel from './carousel'
16
+ import VxeCarouselItem from './carousel-item'
17
+ import VxeCheckbox from './checkbox'
18
+ import VxeCheckboxGroup from './checkbox-group'
19
19
  import VxeCol from './col'
20
20
  // import VxeCollapse from './collapse'
21
21
  // import VxeCollapsePane from './collapse-pane'
@@ -28,11 +28,11 @@ import VxeDrawer, { DrawerController } from './drawer'
28
28
  // import VxeFormItem from './form-item'
29
29
  // import VxeFormView from './form-view'
30
30
  import VxeIcon from './icon'
31
- // import VxeIconPicker from './icon-picker'
31
+ import VxeIconPicker from './icon-picker'
32
32
  import VxeImage from './image'
33
33
  import VxeImageGroup from './image-group'
34
34
  import VxeImagePreview from './image-preview'
35
- // import VxeInput from './input'
35
+ import VxeInput from './input'
36
36
  import VxeLayoutAside from './layout-aside'
37
37
  import VxeLayoutBody from './layout-body'
38
38
  import VxeLayoutContainer from './layout-container'
@@ -46,10 +46,10 @@ import VxeLoading, { LoadingController } from './loading'
46
46
  import VxeMenu from './menu'
47
47
  import VxeModal, { ModalController } from './modal'
48
48
  import VxeNumberInput from './number-input'
49
- // import VxeOptgroup from './optgroup'
50
- // import VxeOption from './option'
51
- // import VxePager from './pager'
52
- // import VxePasswordInput from './password-input'
49
+ import VxeOptgroup from './optgroup'
50
+ import VxeOption from './option'
51
+ import VxePager from './pager'
52
+ import VxePasswordInput from './password-input'
53
53
  import VxePrintPageBreak from './print-page-break'
54
54
  import VxePrint from './print'
55
55
  import VxePulldown from './pulldown'
@@ -57,10 +57,10 @@ import VxeRadio from './radio'
57
57
  import VxeRadioButton from './radio-button'
58
58
  import VxeRadioGroup from './radio-group'
59
59
  import VxeRow from './row'
60
- // import VxeSelect from './select'
60
+ import VxeSelect from './select'
61
61
  import VxeSwitch from './switch'
62
- // import VxeTabPane from './tab-pane'
63
- // import VxeTabs from './tabs'
62
+ import VxeTabPane from './tab-pane'
63
+ import VxeTabs from './tabs'
64
64
  import VxeTag from './tag'
65
65
  import VxeText from './text'
66
66
  import VxeTextarea from './textarea'
@@ -83,10 +83,10 @@ const components = [
83
83
  VxeButtonGroup,
84
84
  // VxeCalendar,
85
85
  VxeCard,
86
- // VxeCarousel,
87
- // VxeCarouselItem,
88
- // VxeCheckbox,
89
- // VxeCheckboxGroup,
86
+ VxeCarousel,
87
+ VxeCarouselItem,
88
+ VxeCheckbox,
89
+ VxeCheckboxGroup,
90
90
  VxeCol,
91
91
  // VxeCollapse,
92
92
  // VxeCollapsePane,
@@ -99,11 +99,11 @@ const components = [
99
99
  // VxeFormItem,
100
100
  // VxeFormView,
101
101
  VxeIcon,
102
- // VxeIconPicker,
102
+ VxeIconPicker,
103
103
  VxeImage,
104
104
  VxeImageGroup,
105
105
  VxeImagePreview,
106
- // VxeInput,
106
+ VxeInput,
107
107
  VxeLayoutAside,
108
108
  VxeLayoutBody,
109
109
  VxeLayoutContainer,
@@ -117,10 +117,10 @@ const components = [
117
117
  VxeMenu,
118
118
  VxeModal,
119
119
  VxeNumberInput,
120
- // VxeOptgroup,
121
- // VxeOption,
122
- // VxePager,
123
- // VxePasswordInput,
120
+ VxeOptgroup,
121
+ VxeOption,
122
+ VxePager,
123
+ VxePasswordInput,
124
124
  VxePrintPageBreak,
125
125
  VxePrint,
126
126
  VxePulldown,
@@ -128,10 +128,10 @@ const components = [
128
128
  VxeRadioButton,
129
129
  VxeRadioGroup,
130
130
  VxeRow,
131
- // VxeSelect,
131
+ VxeSelect,
132
132
  VxeSwitch,
133
- // VxeTabPane,
134
- // VxeTabs,
133
+ VxeTabPane,
134
+ VxeTabs,
135
135
  VxeTag,
136
136
  VxeText,
137
137
  VxeTextarea,
@@ -174,10 +174,10 @@ export * from './button'
174
174
  export * from './button-group'
175
175
  // export * from './calendar'
176
176
  export * from './card'
177
- // export * from './carousel'
178
- // export * from './carousel-item'
179
- // export * from './checkbox'
180
- // export * from './checkbox-group'
177
+ export * from './carousel'
178
+ export * from './carousel-item'
179
+ export * from './checkbox'
180
+ export * from './checkbox-group'
181
181
  export * from './col'
182
182
  // export * from './collapse'
183
183
  // export * from './collapse-pane'
@@ -190,11 +190,11 @@ export * from './drawer'
190
190
  // export * from './form-item'
191
191
  // export * from './form-view'
192
192
  export * from './icon'
193
- // export * from './icon-picker'
193
+ export * from './icon-picker'
194
194
  export * from './image'
195
195
  export * from './image-group'
196
196
  export * from './image-preview'
197
- // export * from './input'
197
+ export * from './input'
198
198
  export * from './layout-aside'
199
199
  export * from './layout-body'
200
200
  export * from './layout-container'
@@ -208,10 +208,10 @@ export * from './loading'
208
208
  export * from './menu'
209
209
  export * from './modal'
210
210
  export * from './number-input'
211
- // export * from './optgroup'
212
- // export * from './option'
213
- // export * from './pager'
214
- // export * from './password-input'
211
+ export * from './optgroup'
212
+ export * from './option'
213
+ export * from './pager'
214
+ export * from './password-input'
215
215
  export * from './print-page-break'
216
216
  export * from './print'
217
217
  export * from './pulldown'
@@ -219,10 +219,10 @@ export * from './radio'
219
219
  export * from './radio-button'
220
220
  export * from './radio-group'
221
221
  export * from './row'
222
- // export * from './select'
222
+ export * from './select'
223
223
  export * from './switch'
224
- // export * from './tab-pane'
225
- // export * from './tabs'
224
+ export * from './tab-pane'
225
+ export * from './tabs'
226
226
  export * from './tag'
227
227
  export * from './text'
228
228
  export * from './textarea'
@@ -111,6 +111,9 @@ export default defineVxeComponent({
111
111
  $xeModal: {
112
112
  default: null
113
113
  },
114
+ $xeDrawer: {
115
+ default: null
116
+ },
114
117
  $xeTable: {
115
118
  default: null
116
119
  },
@@ -0,0 +1,16 @@
1
+ import { VueConstructor } from 'vue'
2
+ import { VxeUI } from '@vxe-ui/core'
3
+ import VxeIconPickerComponent from './src/icon-picker'
4
+ import { dynamicApp } from '../dynamics'
5
+
6
+ export const VxeIconPicker = Object.assign(VxeIconPickerComponent, {
7
+ install: function (app: VueConstructor) {
8
+ app.component(VxeIconPickerComponent.name as string, VxeIconPickerComponent)
9
+ }
10
+ })
11
+
12
+ dynamicApp.use(VxeIconPicker)
13
+ VxeUI.component(VxeIconPickerComponent)
14
+
15
+ export const IconPicker = VxeIconPicker
16
+ export default VxeIconPicker