@element-plus/nightly 0.0.20231009 → 0.0.20231011

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 (376) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +1016 -538
  4. package/dist/index.full.min.js +25 -25
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +23 -23
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +1016 -538
  9. package/dist/locale/af.js +1 -1
  10. package/dist/locale/af.min.js +1 -1
  11. package/dist/locale/af.min.mjs +1 -1
  12. package/dist/locale/af.mjs +1 -1
  13. package/dist/locale/ar.js +1 -1
  14. package/dist/locale/ar.min.js +1 -1
  15. package/dist/locale/ar.min.mjs +1 -1
  16. package/dist/locale/ar.mjs +1 -1
  17. package/dist/locale/az.js +1 -1
  18. package/dist/locale/az.min.js +1 -1
  19. package/dist/locale/az.min.mjs +1 -1
  20. package/dist/locale/az.mjs +1 -1
  21. package/dist/locale/bg.js +1 -1
  22. package/dist/locale/bg.min.js +1 -1
  23. package/dist/locale/bg.min.mjs +1 -1
  24. package/dist/locale/bg.mjs +1 -1
  25. package/dist/locale/bn.js +1 -1
  26. package/dist/locale/bn.min.js +1 -1
  27. package/dist/locale/bn.min.mjs +1 -1
  28. package/dist/locale/bn.mjs +1 -1
  29. package/dist/locale/ca.js +1 -1
  30. package/dist/locale/ca.min.js +1 -1
  31. package/dist/locale/ca.min.mjs +1 -1
  32. package/dist/locale/ca.mjs +1 -1
  33. package/dist/locale/ckb.js +1 -1
  34. package/dist/locale/ckb.min.js +1 -1
  35. package/dist/locale/ckb.min.mjs +1 -1
  36. package/dist/locale/ckb.mjs +1 -1
  37. package/dist/locale/cs.js +1 -1
  38. package/dist/locale/cs.min.js +1 -1
  39. package/dist/locale/cs.min.mjs +1 -1
  40. package/dist/locale/cs.mjs +1 -1
  41. package/dist/locale/da.js +1 -1
  42. package/dist/locale/da.min.js +1 -1
  43. package/dist/locale/da.min.mjs +1 -1
  44. package/dist/locale/da.mjs +1 -1
  45. package/dist/locale/de.js +1 -1
  46. package/dist/locale/de.min.js +1 -1
  47. package/dist/locale/de.min.mjs +1 -1
  48. package/dist/locale/de.mjs +1 -1
  49. package/dist/locale/el.js +1 -1
  50. package/dist/locale/el.min.js +1 -1
  51. package/dist/locale/el.min.mjs +1 -1
  52. package/dist/locale/el.mjs +1 -1
  53. package/dist/locale/en.js +1 -1
  54. package/dist/locale/en.min.js +1 -1
  55. package/dist/locale/en.min.mjs +1 -1
  56. package/dist/locale/en.mjs +1 -1
  57. package/dist/locale/eo.js +1 -1
  58. package/dist/locale/eo.min.js +1 -1
  59. package/dist/locale/eo.min.mjs +1 -1
  60. package/dist/locale/eo.mjs +1 -1
  61. package/dist/locale/es.js +1 -1
  62. package/dist/locale/es.min.js +1 -1
  63. package/dist/locale/es.min.mjs +1 -1
  64. package/dist/locale/es.mjs +1 -1
  65. package/dist/locale/et.js +1 -1
  66. package/dist/locale/et.min.js +1 -1
  67. package/dist/locale/et.min.mjs +1 -1
  68. package/dist/locale/et.mjs +1 -1
  69. package/dist/locale/eu.js +1 -1
  70. package/dist/locale/eu.min.js +1 -1
  71. package/dist/locale/eu.min.mjs +1 -1
  72. package/dist/locale/eu.mjs +1 -1
  73. package/dist/locale/fa.js +1 -1
  74. package/dist/locale/fa.min.js +1 -1
  75. package/dist/locale/fa.min.mjs +1 -1
  76. package/dist/locale/fa.mjs +1 -1
  77. package/dist/locale/fi.js +1 -1
  78. package/dist/locale/fi.min.js +1 -1
  79. package/dist/locale/fi.min.mjs +1 -1
  80. package/dist/locale/fi.mjs +1 -1
  81. package/dist/locale/fr.js +1 -1
  82. package/dist/locale/fr.min.js +1 -1
  83. package/dist/locale/fr.min.mjs +1 -1
  84. package/dist/locale/fr.mjs +1 -1
  85. package/dist/locale/he.js +1 -1
  86. package/dist/locale/he.min.js +1 -1
  87. package/dist/locale/he.min.mjs +1 -1
  88. package/dist/locale/he.mjs +1 -1
  89. package/dist/locale/hr.js +1 -1
  90. package/dist/locale/hr.min.js +1 -1
  91. package/dist/locale/hr.min.mjs +1 -1
  92. package/dist/locale/hr.mjs +1 -1
  93. package/dist/locale/hu.js +1 -1
  94. package/dist/locale/hu.min.js +1 -1
  95. package/dist/locale/hu.min.mjs +1 -1
  96. package/dist/locale/hu.mjs +1 -1
  97. package/dist/locale/hy-am.js +1 -1
  98. package/dist/locale/hy-am.min.js +1 -1
  99. package/dist/locale/hy-am.min.mjs +1 -1
  100. package/dist/locale/hy-am.mjs +1 -1
  101. package/dist/locale/id.js +1 -1
  102. package/dist/locale/id.min.js +1 -1
  103. package/dist/locale/id.min.mjs +1 -1
  104. package/dist/locale/id.mjs +1 -1
  105. package/dist/locale/it.js +1 -1
  106. package/dist/locale/it.min.js +1 -1
  107. package/dist/locale/it.min.mjs +1 -1
  108. package/dist/locale/it.mjs +1 -1
  109. package/dist/locale/ja.js +1 -1
  110. package/dist/locale/ja.min.js +1 -1
  111. package/dist/locale/ja.min.mjs +1 -1
  112. package/dist/locale/ja.mjs +1 -1
  113. package/dist/locale/kk.js +1 -1
  114. package/dist/locale/kk.min.js +1 -1
  115. package/dist/locale/kk.min.mjs +1 -1
  116. package/dist/locale/kk.mjs +1 -1
  117. package/dist/locale/km.js +1 -1
  118. package/dist/locale/km.min.js +1 -1
  119. package/dist/locale/km.min.mjs +1 -1
  120. package/dist/locale/km.mjs +1 -1
  121. package/dist/locale/ko.js +1 -1
  122. package/dist/locale/ko.min.js +1 -1
  123. package/dist/locale/ko.min.mjs +1 -1
  124. package/dist/locale/ko.mjs +1 -1
  125. package/dist/locale/ku.js +1 -1
  126. package/dist/locale/ku.min.js +1 -1
  127. package/dist/locale/ku.min.mjs +1 -1
  128. package/dist/locale/ku.mjs +1 -1
  129. package/dist/locale/ky.js +1 -1
  130. package/dist/locale/ky.min.js +1 -1
  131. package/dist/locale/ky.min.mjs +1 -1
  132. package/dist/locale/ky.mjs +1 -1
  133. package/dist/locale/lt.js +1 -1
  134. package/dist/locale/lt.min.js +1 -1
  135. package/dist/locale/lt.min.mjs +1 -1
  136. package/dist/locale/lt.mjs +1 -1
  137. package/dist/locale/lv.js +1 -1
  138. package/dist/locale/lv.min.js +1 -1
  139. package/dist/locale/lv.min.mjs +1 -1
  140. package/dist/locale/lv.mjs +1 -1
  141. package/dist/locale/mg.js +1 -1
  142. package/dist/locale/mg.min.js +1 -1
  143. package/dist/locale/mg.min.mjs +1 -1
  144. package/dist/locale/mg.mjs +1 -1
  145. package/dist/locale/mn.js +1 -1
  146. package/dist/locale/mn.min.js +1 -1
  147. package/dist/locale/mn.min.mjs +1 -1
  148. package/dist/locale/mn.mjs +1 -1
  149. package/dist/locale/nb-no.js +1 -1
  150. package/dist/locale/nb-no.min.js +1 -1
  151. package/dist/locale/nb-no.min.mjs +1 -1
  152. package/dist/locale/nb-no.mjs +1 -1
  153. package/dist/locale/nl.js +1 -1
  154. package/dist/locale/nl.min.js +1 -1
  155. package/dist/locale/nl.min.mjs +1 -1
  156. package/dist/locale/nl.mjs +1 -1
  157. package/dist/locale/pa.js +1 -1
  158. package/dist/locale/pa.min.js +1 -1
  159. package/dist/locale/pa.min.mjs +1 -1
  160. package/dist/locale/pa.mjs +1 -1
  161. package/dist/locale/pl.js +1 -1
  162. package/dist/locale/pl.min.js +1 -1
  163. package/dist/locale/pl.min.mjs +1 -1
  164. package/dist/locale/pl.mjs +1 -1
  165. package/dist/locale/pt-br.js +1 -1
  166. package/dist/locale/pt-br.min.js +1 -1
  167. package/dist/locale/pt-br.min.mjs +1 -1
  168. package/dist/locale/pt-br.mjs +1 -1
  169. package/dist/locale/pt.js +1 -1
  170. package/dist/locale/pt.min.js +1 -1
  171. package/dist/locale/pt.min.mjs +1 -1
  172. package/dist/locale/pt.mjs +1 -1
  173. package/dist/locale/ro.js +1 -1
  174. package/dist/locale/ro.min.js +1 -1
  175. package/dist/locale/ro.min.mjs +1 -1
  176. package/dist/locale/ro.mjs +1 -1
  177. package/dist/locale/ru.js +1 -1
  178. package/dist/locale/ru.min.js +1 -1
  179. package/dist/locale/ru.min.mjs +1 -1
  180. package/dist/locale/ru.mjs +1 -1
  181. package/dist/locale/sk.js +1 -1
  182. package/dist/locale/sk.min.js +1 -1
  183. package/dist/locale/sk.min.mjs +1 -1
  184. package/dist/locale/sk.mjs +1 -1
  185. package/dist/locale/sl.js +1 -1
  186. package/dist/locale/sl.min.js +1 -1
  187. package/dist/locale/sl.min.mjs +1 -1
  188. package/dist/locale/sl.mjs +1 -1
  189. package/dist/locale/sr.js +1 -1
  190. package/dist/locale/sr.min.js +1 -1
  191. package/dist/locale/sr.min.mjs +1 -1
  192. package/dist/locale/sr.mjs +1 -1
  193. package/dist/locale/sv.js +1 -1
  194. package/dist/locale/sv.min.js +1 -1
  195. package/dist/locale/sv.min.mjs +1 -1
  196. package/dist/locale/sv.mjs +1 -1
  197. package/dist/locale/ta.js +1 -1
  198. package/dist/locale/ta.min.js +1 -1
  199. package/dist/locale/ta.min.mjs +1 -1
  200. package/dist/locale/ta.mjs +1 -1
  201. package/dist/locale/th.js +1 -1
  202. package/dist/locale/th.min.js +1 -1
  203. package/dist/locale/th.min.mjs +1 -1
  204. package/dist/locale/th.mjs +1 -1
  205. package/dist/locale/tk.js +1 -1
  206. package/dist/locale/tk.min.js +1 -1
  207. package/dist/locale/tk.min.mjs +1 -1
  208. package/dist/locale/tk.mjs +1 -1
  209. package/dist/locale/tr.js +1 -1
  210. package/dist/locale/tr.min.js +1 -1
  211. package/dist/locale/tr.min.mjs +1 -1
  212. package/dist/locale/tr.mjs +1 -1
  213. package/dist/locale/ug-cn.js +1 -1
  214. package/dist/locale/ug-cn.min.js +1 -1
  215. package/dist/locale/ug-cn.min.mjs +1 -1
  216. package/dist/locale/ug-cn.mjs +1 -1
  217. package/dist/locale/uk.js +1 -1
  218. package/dist/locale/uk.min.js +1 -1
  219. package/dist/locale/uk.min.mjs +1 -1
  220. package/dist/locale/uk.mjs +1 -1
  221. package/dist/locale/uz-uz.js +1 -1
  222. package/dist/locale/uz-uz.min.js +1 -1
  223. package/dist/locale/uz-uz.min.mjs +1 -1
  224. package/dist/locale/uz-uz.mjs +1 -1
  225. package/dist/locale/vi.js +1 -1
  226. package/dist/locale/vi.min.js +1 -1
  227. package/dist/locale/vi.min.mjs +1 -1
  228. package/dist/locale/vi.mjs +1 -1
  229. package/dist/locale/zh-cn.js +1 -1
  230. package/dist/locale/zh-cn.min.js +1 -1
  231. package/dist/locale/zh-cn.min.mjs +1 -1
  232. package/dist/locale/zh-cn.mjs +1 -1
  233. package/dist/locale/zh-tw.js +1 -1
  234. package/dist/locale/zh-tw.min.js +1 -1
  235. package/dist/locale/zh-tw.min.mjs +1 -1
  236. package/dist/locale/zh-tw.mjs +1 -1
  237. package/es/component.mjs +3 -1
  238. package/es/component.mjs.map +1 -1
  239. package/es/components/carousel/index.d.ts +5 -0
  240. package/es/components/carousel/src/carousel.vue.d.ts +5 -0
  241. package/es/components/carousel/src/carousel2.mjs +7 -2
  242. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  243. package/es/components/carousel/src/use-carousel.d.ts +6 -0
  244. package/es/components/carousel/src/use-carousel.mjs +33 -1
  245. package/es/components/carousel/src/use-carousel.mjs.map +1 -1
  246. package/es/components/checkbox/index.d.ts +12 -0
  247. package/es/components/checkbox/src/checkbox-button.vue.d.ts +4 -0
  248. package/es/components/checkbox/src/checkbox.d.ts +1 -0
  249. package/es/components/checkbox/src/checkbox.mjs +2 -1
  250. package/es/components/checkbox/src/checkbox.mjs.map +1 -1
  251. package/es/components/checkbox/src/checkbox.vue.d.ts +4 -0
  252. package/es/components/checkbox/src/composables/use-checkbox-status.mjs +2 -2
  253. package/es/components/checkbox/src/composables/use-checkbox-status.mjs.map +1 -1
  254. package/es/components/color-picker/index.d.ts +18 -1
  255. package/es/components/color-picker/src/color-picker.d.ts +2 -0
  256. package/es/components/color-picker/src/color-picker.mjs +3 -1
  257. package/es/components/color-picker/src/color-picker.mjs.map +1 -1
  258. package/es/components/color-picker/src/color-picker.vue.d.ts +18 -1
  259. package/es/components/color-picker/src/color-picker2.mjs +83 -11
  260. package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
  261. package/es/components/descriptions/src/description-item.mjs.map +1 -1
  262. package/es/components/descriptions/src/description.mjs.map +1 -1
  263. package/es/components/drawer/index.mjs +2 -2
  264. package/es/components/drawer/src/drawer.mjs +26 -176
  265. package/es/components/drawer/src/drawer.mjs.map +1 -1
  266. package/es/components/drawer/src/drawer2.mjs +176 -26
  267. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  268. package/es/components/index.mjs +1 -1
  269. package/es/components/table/src/table.mjs +2 -1
  270. package/es/components/table/src/table.mjs.map +1 -1
  271. package/es/components/transfer/index.d.ts +40 -0
  272. package/es/components/transfer/src/transfer-panel.vue.d.ts +8 -0
  273. package/es/components/transfer/src/transfer.vue.d.ts +40 -0
  274. package/es/components/tree-v2/index.d.ts +8 -0
  275. package/es/components/tree-v2/src/tree-node.vue.d.ts +8 -0
  276. package/es/components/tree-v2/src/tree.vue.d.ts +8 -0
  277. package/es/components/watermark/index.d.ts +94 -0
  278. package/es/components/watermark/index.mjs +9 -0
  279. package/es/components/watermark/index.mjs.map +1 -0
  280. package/es/components/watermark/src/useClips.d.ts +7 -0
  281. package/es/components/watermark/src/useClips.mjs +82 -0
  282. package/es/components/watermark/src/useClips.mjs.map +1 -0
  283. package/es/components/watermark/src/utils.d.ts +8 -0
  284. package/es/components/watermark/src/utils.mjs +22 -0
  285. package/es/components/watermark/src/utils.mjs.map +1 -0
  286. package/es/components/watermark/src/watermark.d.ts +32 -0
  287. package/es/components/watermark/src/watermark.mjs +33 -0
  288. package/es/components/watermark/src/watermark.mjs.map +1 -0
  289. package/es/components/watermark/src/watermark.vue.d.ts +94 -0
  290. package/es/components/watermark/src/watermark2.mjs +202 -0
  291. package/es/components/watermark/src/watermark2.mjs.map +1 -0
  292. package/es/components/watermark/style/index.d.ts +0 -0
  293. package/es/components/watermark/style/index.mjs +2 -0
  294. package/es/components/watermark/style/index.mjs.map +1 -0
  295. package/es/hooks/use-focus-controller/index.d.ts +6 -1
  296. package/es/hooks/use-focus-controller/index.mjs +5 -2
  297. package/es/hooks/use-focus-controller/index.mjs.map +1 -1
  298. package/es/index.mjs +1 -1
  299. package/es/version.d.ts +1 -1
  300. package/es/version.mjs +1 -1
  301. package/es/version.mjs.map +1 -1
  302. package/lib/component.js +3 -1
  303. package/lib/component.js.map +1 -1
  304. package/lib/components/carousel/index.d.ts +5 -0
  305. package/lib/components/carousel/src/carousel.vue.d.ts +5 -0
  306. package/lib/components/carousel/src/carousel2.js +7 -2
  307. package/lib/components/carousel/src/carousel2.js.map +1 -1
  308. package/lib/components/carousel/src/use-carousel.d.ts +6 -0
  309. package/lib/components/carousel/src/use-carousel.js +32 -0
  310. package/lib/components/carousel/src/use-carousel.js.map +1 -1
  311. package/lib/components/checkbox/index.d.ts +12 -0
  312. package/lib/components/checkbox/src/checkbox-button.vue.d.ts +4 -0
  313. package/lib/components/checkbox/src/checkbox.d.ts +1 -0
  314. package/lib/components/checkbox/src/checkbox.js +2 -1
  315. package/lib/components/checkbox/src/checkbox.js.map +1 -1
  316. package/lib/components/checkbox/src/checkbox.vue.d.ts +4 -0
  317. package/lib/components/checkbox/src/composables/use-checkbox-status.js +1 -1
  318. package/lib/components/checkbox/src/composables/use-checkbox-status.js.map +1 -1
  319. package/lib/components/color-picker/index.d.ts +18 -1
  320. package/lib/components/color-picker/src/color-picker.d.ts +2 -0
  321. package/lib/components/color-picker/src/color-picker.js +3 -1
  322. package/lib/components/color-picker/src/color-picker.js.map +1 -1
  323. package/lib/components/color-picker/src/color-picker.vue.d.ts +18 -1
  324. package/lib/components/color-picker/src/color-picker2.js +93 -21
  325. package/lib/components/color-picker/src/color-picker2.js.map +1 -1
  326. package/lib/components/descriptions/src/description-item.js.map +1 -1
  327. package/lib/components/descriptions/src/description.js.map +1 -1
  328. package/lib/components/drawer/index.js +2 -2
  329. package/lib/components/drawer/src/drawer.js +27 -176
  330. package/lib/components/drawer/src/drawer.js.map +1 -1
  331. package/lib/components/drawer/src/drawer2.js +176 -27
  332. package/lib/components/drawer/src/drawer2.js.map +1 -1
  333. package/lib/components/index.js +1 -1
  334. package/lib/components/table/src/table.js +2 -1
  335. package/lib/components/table/src/table.js.map +1 -1
  336. package/lib/components/transfer/index.d.ts +40 -0
  337. package/lib/components/transfer/src/transfer-panel.vue.d.ts +8 -0
  338. package/lib/components/transfer/src/transfer.vue.d.ts +40 -0
  339. package/lib/components/tree-v2/index.d.ts +8 -0
  340. package/lib/components/tree-v2/src/tree-node.vue.d.ts +8 -0
  341. package/lib/components/tree-v2/src/tree.vue.d.ts +8 -0
  342. package/lib/components/watermark/index.d.ts +94 -0
  343. package/lib/components/watermark/index.js +15 -0
  344. package/lib/components/watermark/index.js.map +1 -0
  345. package/lib/components/watermark/src/useClips.d.ts +7 -0
  346. package/lib/components/watermark/src/useClips.js +87 -0
  347. package/lib/components/watermark/src/useClips.js.map +1 -0
  348. package/lib/components/watermark/src/utils.d.ts +8 -0
  349. package/lib/components/watermark/src/utils.js +29 -0
  350. package/lib/components/watermark/src/utils.js.map +1 -0
  351. package/lib/components/watermark/src/watermark.d.ts +32 -0
  352. package/lib/components/watermark/src/watermark.js +37 -0
  353. package/lib/components/watermark/src/watermark.js.map +1 -0
  354. package/lib/components/watermark/src/watermark.vue.d.ts +94 -0
  355. package/lib/components/watermark/src/watermark2.js +206 -0
  356. package/lib/components/watermark/src/watermark2.js.map +1 -0
  357. package/lib/components/watermark/style/index.d.ts +0 -0
  358. package/lib/components/watermark/style/index.js +3 -0
  359. package/lib/components/watermark/style/index.js.map +1 -0
  360. package/lib/hooks/use-focus-controller/index.d.ts +6 -1
  361. package/lib/hooks/use-focus-controller/index.js +5 -2
  362. package/lib/hooks/use-focus-controller/index.js.map +1 -1
  363. package/lib/index.js +1 -1
  364. package/lib/version.d.ts +1 -1
  365. package/lib/version.js +1 -1
  366. package/lib/version.js.map +1 -1
  367. package/package.json +2 -2
  368. package/tags.json +1 -1
  369. package/theme-chalk/el-color-picker.css +1 -1
  370. package/theme-chalk/el-table-v2.css +1 -1
  371. package/theme-chalk/el-table.css +1 -1
  372. package/theme-chalk/index.css +1 -1
  373. package/theme-chalk/src/color-picker.scss +8 -2
  374. package/theme-chalk/src/common/var.scss +1 -0
  375. package/theme-chalk/src/table.scss +16 -9
  376. package/web-types.json +1 -1
@@ -5,6 +5,7 @@ export declare const ElCheckbox: import("@element-plus/nightly/es/utils").SFCWit
5
5
  };
6
6
  label: {
7
7
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
8
+ default: undefined;
8
9
  };
9
10
  indeterminate: BooleanConstructor;
10
11
  disabled: BooleanConstructor;
@@ -49,6 +50,7 @@ export declare const ElCheckbox: import("@element-plus/nightly/es/utils").SFCWit
49
50
  };
50
51
  label: {
51
52
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
53
+ default: undefined;
52
54
  };
53
55
  indeterminate: BooleanConstructor;
54
56
  disabled: BooleanConstructor;
@@ -132,6 +134,7 @@ export declare const ElCheckbox: import("@element-plus/nightly/es/utils").SFCWit
132
134
  };
133
135
  label: {
134
136
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
137
+ default: undefined;
135
138
  };
136
139
  indeterminate: BooleanConstructor;
137
140
  disabled: BooleanConstructor;
@@ -173,6 +176,7 @@ export declare const ElCheckbox: import("@element-plus/nightly/es/utils").SFCWit
173
176
  "onUpdate:modelValue"?: ((val: import("./src/checkbox").CheckboxValueType) => any) | undefined;
174
177
  }, {
175
178
  modelValue: string | number | boolean;
179
+ label: string | number | boolean | Record<string, any>;
176
180
  id: string;
177
181
  disabled: boolean;
178
182
  name: string;
@@ -191,6 +195,7 @@ export declare const ElCheckbox: import("@element-plus/nightly/es/utils").SFCWit
191
195
  };
192
196
  label: {
193
197
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
198
+ default: undefined;
194
199
  };
195
200
  indeterminate: BooleanConstructor;
196
201
  disabled: BooleanConstructor;
@@ -235,6 +240,7 @@ export declare const ElCheckbox: import("@element-plus/nightly/es/utils").SFCWit
235
240
  };
236
241
  label: {
237
242
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
243
+ default: undefined;
238
244
  };
239
245
  indeterminate: BooleanConstructor;
240
246
  disabled: BooleanConstructor;
@@ -318,6 +324,7 @@ export declare const ElCheckbox: import("@element-plus/nightly/es/utils").SFCWit
318
324
  };
319
325
  label: {
320
326
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
327
+ default: undefined;
321
328
  };
322
329
  indeterminate: BooleanConstructor;
323
330
  disabled: BooleanConstructor;
@@ -359,6 +366,7 @@ export declare const ElCheckbox: import("@element-plus/nightly/es/utils").SFCWit
359
366
  "onUpdate:modelValue"?: ((val: import("./src/checkbox").CheckboxValueType) => any) | undefined;
360
367
  }, {
361
368
  modelValue: string | number | boolean;
369
+ label: string | number | boolean | Record<string, any>;
362
370
  id: string;
363
371
  disabled: boolean;
364
372
  name: string;
@@ -468,6 +476,7 @@ export declare const ElCheckboxButton: import("@element-plus/nightly/es/utils").
468
476
  };
469
477
  label: {
470
478
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
479
+ default: undefined;
471
480
  };
472
481
  indeterminate: BooleanConstructor;
473
482
  disabled: BooleanConstructor;
@@ -512,6 +521,7 @@ export declare const ElCheckboxButton: import("@element-plus/nightly/es/utils").
512
521
  };
513
522
  label: {
514
523
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
524
+ default: undefined;
515
525
  };
516
526
  indeterminate: BooleanConstructor;
517
527
  disabled: BooleanConstructor;
@@ -595,6 +605,7 @@ export declare const ElCheckboxButton: import("@element-plus/nightly/es/utils").
595
605
  };
596
606
  label: {
597
607
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
608
+ default: undefined;
598
609
  };
599
610
  indeterminate: BooleanConstructor;
600
611
  disabled: BooleanConstructor;
@@ -636,6 +647,7 @@ export declare const ElCheckboxButton: import("@element-plus/nightly/es/utils").
636
647
  "onUpdate:modelValue"?: ((val: import("./src/checkbox").CheckboxValueType) => any) | undefined;
637
648
  }, {
638
649
  modelValue: string | number | boolean;
650
+ label: string | number | boolean | Record<string, any>;
639
651
  id: string;
640
652
  disabled: boolean;
641
653
  name: string;
@@ -6,6 +6,7 @@ declare const _default: import("vue").DefineComponent<{
6
6
  };
7
7
  label: {
8
8
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
9
+ default: undefined;
9
10
  };
10
11
  indeterminate: BooleanConstructor;
11
12
  disabled: BooleanConstructor;
@@ -50,6 +51,7 @@ declare const _default: import("vue").DefineComponent<{
50
51
  };
51
52
  label: {
52
53
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
54
+ default: undefined;
53
55
  };
54
56
  indeterminate: BooleanConstructor;
55
57
  disabled: BooleanConstructor;
@@ -133,6 +135,7 @@ declare const _default: import("vue").DefineComponent<{
133
135
  };
134
136
  label: {
135
137
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
138
+ default: undefined;
136
139
  };
137
140
  indeterminate: BooleanConstructor;
138
141
  disabled: BooleanConstructor;
@@ -174,6 +177,7 @@ declare const _default: import("vue").DefineComponent<{
174
177
  "onUpdate:modelValue"?: ((val: import("./checkbox").CheckboxValueType) => any) | undefined;
175
178
  }, {
176
179
  modelValue: string | number | boolean;
180
+ label: string | number | boolean | Record<string, any>;
177
181
  id: string;
178
182
  disabled: boolean;
179
183
  name: string;
@@ -14,6 +14,7 @@ export declare const checkboxProps: {
14
14
  */
15
15
  label: {
16
16
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
17
+ default: undefined;
17
18
  };
18
19
  /**
19
20
  * @description Set indeterminate state, only responsible for style control
@@ -12,7 +12,8 @@ const checkboxProps = {
12
12
  default: void 0
13
13
  },
14
14
  label: {
15
- type: [String, Boolean, Number, Object]
15
+ type: [String, Boolean, Number, Object],
16
+ default: void 0
16
17
  },
17
18
  indeterminate: Boolean,
18
19
  disabled: Boolean,
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.mjs","sources":["../../../../../../packages/components/checkbox/src/checkbox.ts"],"sourcesContent":["import { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useSizeProp } from '@element-plus/hooks'\nimport { isBoolean, isNumber, isString } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type Checkbox from './checkbox.vue'\n\nexport type CheckboxValueType = string | number | boolean\n\nexport const checkboxProps = {\n /**\n * @description binding value\n */\n modelValue: {\n type: [Number, String, Boolean],\n default: undefined,\n },\n /**\n * @description value of the Checkbox when used inside a `checkbox-group`\n */\n label: {\n type: [String, Boolean, Number, Object],\n },\n /**\n * @description Set indeterminate state, only responsible for style control\n */\n indeterminate: Boolean,\n /**\n * @description whether the Checkbox is disabled\n */\n disabled: Boolean,\n /**\n * @description if the Checkbox is checked\n */\n checked: Boolean,\n /**\n * @description native 'name' attribute\n */\n name: {\n type: String,\n default: undefined,\n },\n /**\n * @description value of the Checkbox if it's checked\n */\n trueLabel: {\n type: [String, Number],\n default: undefined,\n },\n /**\n * @description value of the Checkbox if it's not checked\n */\n falseLabel: {\n type: [String, Number],\n default: undefined,\n },\n /**\n * @description input id\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description same as [aria-controls](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls), takes effect when `indeterminate` is `true`\n */\n controls: {\n type: String,\n default: undefined,\n },\n /**\n * @description whether to add a border around Checkbox\n */\n border: Boolean,\n /**\n * @description size of the Checkbox\n */\n size: useSizeProp,\n /**\n * @description input tabindex\n */\n tabindex: [String, Number],\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n}\n\nexport const checkboxEmits = {\n [UPDATE_MODEL_EVENT]: (val: CheckboxValueType) =>\n isString(val) || isNumber(val) || isBoolean(val),\n change: (val: CheckboxValueType) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\n\nexport type CheckboxProps = ExtractPropTypes<typeof checkboxProps>\nexport type CheckboxEmits = typeof checkboxEmits\nexport type CheckboxInstance = InstanceType<typeof Checkbox>\n"],"names":[],"mappings":";;;;;;;;AAGY,MAAC,aAAa,GAAG;AAC7B,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACnC,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;AAC3C,GAAG;AACH,EAAE,aAAa,EAAE,OAAO;AACxB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC5B,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE;AACU,MAAC,aAAa,GAAG;AAC7B,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACjF,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACnE;;;;"}
1
+ {"version":3,"file":"checkbox.mjs","sources":["../../../../../../packages/components/checkbox/src/checkbox.ts"],"sourcesContent":["import { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useSizeProp } from '@element-plus/hooks'\nimport { isBoolean, isNumber, isString } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type Checkbox from './checkbox.vue'\n\nexport type CheckboxValueType = string | number | boolean\n\nexport const checkboxProps = {\n /**\n * @description binding value\n */\n modelValue: {\n type: [Number, String, Boolean],\n default: undefined,\n },\n /**\n * @description value of the Checkbox when used inside a `checkbox-group`\n */\n label: {\n type: [String, Boolean, Number, Object],\n default: undefined,\n },\n /**\n * @description Set indeterminate state, only responsible for style control\n */\n indeterminate: Boolean,\n /**\n * @description whether the Checkbox is disabled\n */\n disabled: Boolean,\n /**\n * @description if the Checkbox is checked\n */\n checked: Boolean,\n /**\n * @description native 'name' attribute\n */\n name: {\n type: String,\n default: undefined,\n },\n /**\n * @description value of the Checkbox if it's checked\n */\n trueLabel: {\n type: [String, Number],\n default: undefined,\n },\n /**\n * @description value of the Checkbox if it's not checked\n */\n falseLabel: {\n type: [String, Number],\n default: undefined,\n },\n /**\n * @description input id\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description same as [aria-controls](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls), takes effect when `indeterminate` is `true`\n */\n controls: {\n type: String,\n default: undefined,\n },\n /**\n * @description whether to add a border around Checkbox\n */\n border: Boolean,\n /**\n * @description size of the Checkbox\n */\n size: useSizeProp,\n /**\n * @description input tabindex\n */\n tabindex: [String, Number],\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n}\n\nexport const checkboxEmits = {\n [UPDATE_MODEL_EVENT]: (val: CheckboxValueType) =>\n isString(val) || isNumber(val) || isBoolean(val),\n change: (val: CheckboxValueType) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\n\nexport type CheckboxProps = ExtractPropTypes<typeof checkboxProps>\nexport type CheckboxEmits = typeof checkboxEmits\nexport type CheckboxInstance = InstanceType<typeof Checkbox>\n"],"names":[],"mappings":";;;;;;;;AAGY,MAAC,aAAa,GAAG;AAC7B,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACnC,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;AAC3C,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,aAAa,EAAE,OAAO;AACxB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC5B,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE;AACU,MAAC,aAAa,GAAG;AAC7B,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACjF,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACnE;;;;"}
@@ -5,6 +5,7 @@ declare const _default: import("vue").DefineComponent<{
5
5
  };
6
6
  label: {
7
7
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
8
+ default: undefined;
8
9
  };
9
10
  indeterminate: BooleanConstructor;
10
11
  disabled: BooleanConstructor;
@@ -49,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{
49
50
  };
50
51
  label: {
51
52
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
53
+ default: undefined;
52
54
  };
53
55
  indeterminate: BooleanConstructor;
54
56
  disabled: BooleanConstructor;
@@ -132,6 +134,7 @@ declare const _default: import("vue").DefineComponent<{
132
134
  };
133
135
  label: {
134
136
  type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
137
+ default: undefined;
135
138
  };
136
139
  indeterminate: BooleanConstructor;
137
140
  disabled: BooleanConstructor;
@@ -173,6 +176,7 @@ declare const _default: import("vue").DefineComponent<{
173
176
  "onUpdate:modelValue"?: ((val: import("./checkbox").CheckboxValueType) => any) | undefined;
174
177
  }, {
175
178
  modelValue: string | number | boolean;
179
+ label: string | number | boolean | Record<string, any>;
176
180
  id: string;
177
181
  disabled: boolean;
178
182
  name: string;
@@ -1,5 +1,5 @@
1
1
  import { inject, ref, computed, toRaw } from 'vue';
2
- import { isEqual } from 'lodash-unified';
2
+ import { isEqual, isNil } from 'lodash-unified';
3
3
  import '../../../form/index.mjs';
4
4
  import '../../../../utils/index.mjs';
5
5
  import { checkboxGroupContextKey } from '../constants.mjs';
@@ -37,7 +37,7 @@ const useCheckboxStatus = (props, slots, { model }) => {
37
37
  return (_a = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a.value;
38
38
  }));
39
39
  const hasOwnLabel = computed(() => {
40
- return !!(slots.default || props.label);
40
+ return !!slots.default || !isNil(props.label);
41
41
  });
42
42
  return {
43
43
  checkboxButtonSize,
@@ -1 +1 @@
1
- {"version":3,"file":"use-checkbox-status.mjs","sources":["../../../../../../../packages/components/checkbox/src/composables/use-checkbox-status.ts"],"sourcesContent":["import { computed, inject, ref, toRaw } from 'vue'\nimport { isEqual } from 'lodash-unified'\nimport { useFormSize } from '@element-plus/components/form'\nimport { isArray, isBoolean, isObject } from '@element-plus/utils'\nimport { checkboxGroupContextKey } from '../constants'\n\nimport type { ComponentInternalInstance } from 'vue'\nimport type { CheckboxProps } from '../checkbox'\nimport type { CheckboxModel } from '../composables'\n\nexport const useCheckboxStatus = (\n props: CheckboxProps,\n slots: ComponentInternalInstance['slots'],\n { model }: Pick<CheckboxModel, 'model'>\n) => {\n const checkboxGroup = inject(checkboxGroupContextKey, undefined)\n const isFocused = ref(false)\n const isChecked = computed<boolean>(() => {\n const value = model.value\n if (isBoolean(value)) {\n return value\n } else if (isArray(value)) {\n if (isObject(props.label)) {\n return value.map(toRaw).some((o) => isEqual(o, props.label))\n } else {\n return value.map(toRaw).includes(props.label)\n }\n } else if (value !== null && value !== undefined) {\n return value === props.trueLabel\n } else {\n return !!value\n }\n })\n\n const checkboxButtonSize = useFormSize(\n computed(() => checkboxGroup?.size?.value),\n {\n prop: true,\n }\n )\n const checkboxSize = useFormSize(computed(() => checkboxGroup?.size?.value))\n\n const hasOwnLabel = computed<boolean>(() => {\n return !!(slots.default || props.label)\n })\n\n return {\n checkboxButtonSize,\n isChecked,\n isFocused,\n checkboxSize,\n hasOwnLabel,\n }\n}\n\nexport type CheckboxStatus = ReturnType<typeof useCheckboxStatus>\n"],"names":[],"mappings":";;;;;;;;;AAKY,MAAC,iBAAiB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK;AAC9D,EAAE,MAAM,aAAa,GAAG,MAAM,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC,CAAC;AAChE,EAAE,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/B,EAAE,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM;AACnC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;AAC9B,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE;AAC1B,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;AAC/B,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;AACjC,QAAQ,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE,OAAO,MAAM;AACb,QAAQ,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACtD,OAAO;AACP,KAAK,MAAM,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC,EAAE;AACnD,MAAM,OAAO,KAAK,KAAK,KAAK,CAAC,SAAS,CAAC;AACvC,KAAK,MAAM;AACX,MAAM,OAAO,CAAC,CAAC,KAAK,CAAC;AACrB,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,kBAAkB,GAAG,WAAW,CAAC,QAAQ,CAAC,MAAM;AACxD,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAO,CAAC,EAAE,GAAG,aAAa,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,IAAI,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;AAClG,GAAG,CAAC,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC,MAAM;AAClD,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAO,CAAC,EAAE,GAAG,aAAa,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,IAAI,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;AAClG,GAAG,CAAC,CAAC,CAAC;AACN,EAAE,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM;AACrC,IAAI,OAAO,CAAC,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AAC5C,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,kBAAkB;AACtB,IAAI,SAAS;AACb,IAAI,SAAS;AACb,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"use-checkbox-status.mjs","sources":["../../../../../../../packages/components/checkbox/src/composables/use-checkbox-status.ts"],"sourcesContent":["import { computed, inject, ref, toRaw } from 'vue'\nimport { isEqual, isNil } from 'lodash-unified'\nimport { useFormSize } from '@element-plus/components/form'\nimport { isArray, isBoolean, isObject } from '@element-plus/utils'\nimport { checkboxGroupContextKey } from '../constants'\n\nimport type { ComponentInternalInstance } from 'vue'\nimport type { CheckboxProps } from '../checkbox'\nimport type { CheckboxModel } from '../composables'\n\nexport const useCheckboxStatus = (\n props: CheckboxProps,\n slots: ComponentInternalInstance['slots'],\n { model }: Pick<CheckboxModel, 'model'>\n) => {\n const checkboxGroup = inject(checkboxGroupContextKey, undefined)\n const isFocused = ref(false)\n const isChecked = computed<boolean>(() => {\n const value = model.value\n if (isBoolean(value)) {\n return value\n } else if (isArray(value)) {\n if (isObject(props.label)) {\n return value.map(toRaw).some((o) => isEqual(o, props.label))\n } else {\n return value.map(toRaw).includes(props.label)\n }\n } else if (value !== null && value !== undefined) {\n return value === props.trueLabel\n } else {\n return !!value\n }\n })\n\n const checkboxButtonSize = useFormSize(\n computed(() => checkboxGroup?.size?.value),\n {\n prop: true,\n }\n )\n const checkboxSize = useFormSize(computed(() => checkboxGroup?.size?.value))\n\n const hasOwnLabel = computed<boolean>(() => {\n return !!slots.default || !isNil(props.label)\n })\n\n return {\n checkboxButtonSize,\n isChecked,\n isFocused,\n checkboxSize,\n hasOwnLabel,\n }\n}\n\nexport type CheckboxStatus = ReturnType<typeof useCheckboxStatus>\n"],"names":[],"mappings":";;;;;;;;;AAKY,MAAC,iBAAiB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK;AAC9D,EAAE,MAAM,aAAa,GAAG,MAAM,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC,CAAC;AAChE,EAAE,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/B,EAAE,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM;AACnC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;AAC9B,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE;AAC1B,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;AAC/B,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;AACjC,QAAQ,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE,OAAO,MAAM;AACb,QAAQ,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACtD,OAAO;AACP,KAAK,MAAM,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC,EAAE;AACnD,MAAM,OAAO,KAAK,KAAK,KAAK,CAAC,SAAS,CAAC;AACvC,KAAK,MAAM;AACX,MAAM,OAAO,CAAC,CAAC,KAAK,CAAC;AACrB,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,kBAAkB,GAAG,WAAW,CAAC,QAAQ,CAAC,MAAM;AACxD,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAO,CAAC,EAAE,GAAG,aAAa,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,IAAI,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;AAClG,GAAG,CAAC,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC,MAAM;AAClD,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAO,CAAC,EAAE,GAAG,aAAa,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,IAAI,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;AAClG,GAAG,CAAC,CAAC,CAAC;AACN,EAAE,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM;AACrC,IAAI,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAClD,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,kBAAkB;AACtB,IAAI,SAAS;AACb,IAAI,SAAS;AACb,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,GAAG,CAAC;AACJ;;;;"}
@@ -46,9 +46,11 @@ export declare const ElColorPicker: import("@element-plus/nightly/es/utils").SFC
46
46
  }>> & {
47
47
  onChange?: ((val: string | null) => any) | undefined;
48
48
  "onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
49
+ onFocus?: ((event: FocusEvent) => any) | undefined;
50
+ onBlur?: ((event: FocusEvent) => any) | undefined;
49
51
  onActiveChange?: ((val: string | null) => any) | undefined;
50
52
  }>>;
51
- emit: ((event: "update:modelValue", val: string | null) => void) & ((event: "change", val: string | null) => void) & ((event: "activeChange", val: string | null) => void);
53
+ emit: ((event: "update:modelValue", val: string | null) => void) & ((event: "change", val: string | null) => void) & ((event: "focus", event: FocusEvent) => void) & ((event: "blur", event: FocusEvent) => void) & ((event: "activeChange", val: string | null) => void);
52
54
  t: import("../..").Translator;
53
55
  ns: {
54
56
  namespace: import("vue").ComputedRef<string>;
@@ -6644,6 +6646,12 @@ export declare const ElColorPicker: import("@element-plus/nightly/es/utils").SFC
6644
6646
  readonly disabled: boolean;
6645
6647
  }>;
6646
6648
  }> & {} & import("vue").ComponentCustomProperties) | undefined>;
6649
+ triggerRef: import("vue").Ref<any>;
6650
+ inputRef: import("vue").Ref<any>;
6651
+ isFocused: import("vue").Ref<boolean>;
6652
+ _handleFocus: (event: FocusEvent) => void;
6653
+ handleBlur: (event: FocusEvent) => void;
6654
+ handleFocus: (event: FocusEvent) => void;
6647
6655
  shouldActiveChange: boolean;
6648
6656
  color: import("./src/utils/color").default;
6649
6657
  showPicker: import("vue").Ref<boolean>;
@@ -6664,6 +6672,11 @@ export declare const ElColorPicker: import("@element-plus/nightly/es/utils").SFC
6664
6672
  handleConfirm: () => void;
6665
6673
  confirmValue: () => void;
6666
6674
  clear: () => void;
6675
+ handleClickOutside: (event: Event) => void;
6676
+ handleEsc: (event: KeyboardEvent) => void;
6677
+ handleKeyDown: (event: KeyboardEvent) => void;
6678
+ focus: () => void;
6679
+ blur: () => void;
6667
6680
  ElButton: import("@element-plus/nightly/es/utils").SFCWithInstall<import("vue").DefineComponent<{
6668
6681
  readonly size: {
6669
6682
  readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
@@ -10834,6 +10847,8 @@ export declare const ElColorPicker: import("@element-plus/nightly/es/utils").SFC
10834
10847
  "update:modelValue": (val: string | null) => boolean;
10835
10848
  change: (val: string | null) => boolean;
10836
10849
  activeChange: (val: string | null) => boolean;
10850
+ focus: (event: FocusEvent) => boolean;
10851
+ blur: (event: FocusEvent) => boolean;
10837
10852
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
10838
10853
  readonly modelValue: StringConstructor;
10839
10854
  readonly id: StringConstructor;
@@ -10859,6 +10874,8 @@ export declare const ElColorPicker: import("@element-plus/nightly/es/utils").SFC
10859
10874
  }>> & {
10860
10875
  onChange?: ((val: string | null) => any) | undefined;
10861
10876
  "onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
10877
+ onFocus?: ((event: FocusEvent) => any) | undefined;
10878
+ onBlur?: ((event: FocusEvent) => any) | undefined;
10862
10879
  onActiveChange?: ((val: string | null) => any) | undefined;
10863
10880
  }, {
10864
10881
  readonly popperClass: string;
@@ -27,6 +27,8 @@ export declare const colorPickerEmits: {
27
27
  "update:modelValue": (val: string | null) => boolean;
28
28
  change: (val: string | null) => boolean;
29
29
  activeChange: (val: string | null) => boolean;
30
+ focus: (event: FocusEvent) => boolean;
31
+ blur: (event: FocusEvent) => boolean;
30
32
  };
31
33
  export declare type ColorPickerProps = ExtractPropTypes<typeof colorPickerProps>;
32
34
  export declare type ColorPickerEmits = typeof colorPickerEmits;
@@ -37,7 +37,9 @@ const colorPickerProps = buildProps({
37
37
  const colorPickerEmits = {
38
38
  [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val),
39
39
  [CHANGE_EVENT]: (val) => isString(val) || isNil(val),
40
- activeChange: (val) => isString(val) || isNil(val)
40
+ activeChange: (val) => isString(val) || isNil(val),
41
+ focus: (event) => event instanceof FocusEvent,
42
+ blur: (event) => event instanceof FocusEvent
41
43
  };
42
44
  const colorPickerContextKey = Symbol("colorPickerContextKey");
43
45
 
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker.mjs","sources":["../../../../../../packages/components/color-picker/src/color-picker.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport { buildProps, definePropType, isString } from '@element-plus/utils'\nimport { useSizeProp } from '@element-plus/hooks'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { ComputedRef, ExtractPropTypes, InjectionKey } from 'vue'\nimport type ColorPicker from './color-picker.vue'\n\nexport const colorPickerProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: String,\n /**\n * @description ColorPicker id\n */\n id: String,\n /**\n * @description whether to display the alpha slider\n */\n showAlpha: Boolean,\n /**\n * @description color format of v-model\n */\n colorFormat: String,\n /**\n * @description whether to disable the ColorPicker\n */\n disabled: Boolean,\n /**\n * @description size of ColorPicker\n */\n size: useSizeProp,\n /**\n * @description custom class name for ColorPicker's dropdown\n */\n popperClass: {\n type: String,\n default: '',\n },\n /**\n * @description ColorPicker aria-label\n */\n label: {\n type: String,\n default: undefined,\n },\n /**\n * @description ColorPicker tabindex\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description predefined color options\n */\n predefine: {\n type: definePropType<string[]>(Array),\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport const colorPickerEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | null) => isString(val) || isNil(val),\n [CHANGE_EVENT]: (val: string | null) => isString(val) || isNil(val),\n activeChange: (val: string | null) => isString(val) || isNil(val),\n}\n\nexport type ColorPickerProps = ExtractPropTypes<typeof colorPickerProps>\nexport type ColorPickerEmits = typeof colorPickerEmits\nexport type ColorPickerInstance = InstanceType<typeof ColorPicker>\n\nexport interface ColorPickerContext {\n currentColor: ComputedRef<string>\n}\n\nexport const colorPickerContextKey: InjectionKey<ColorPickerContext> = Symbol(\n 'colorPickerContextKey'\n)\n"],"names":[],"mappings":";;;;;;;;;AAIY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,EAAE,EAAE,MAAM;AACZ,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;AAC5D,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;AACtD,EAAE,YAAY,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;AACpD,EAAE;AACU,MAAC,qBAAqB,GAAG,MAAM,CAAC,uBAAuB;;;;"}
1
+ {"version":3,"file":"color-picker.mjs","sources":["../../../../../../packages/components/color-picker/src/color-picker.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport { buildProps, definePropType, isString } from '@element-plus/utils'\nimport { useSizeProp } from '@element-plus/hooks'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { ComputedRef, ExtractPropTypes, InjectionKey } from 'vue'\nimport type ColorPicker from './color-picker.vue'\n\nexport const colorPickerProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: String,\n /**\n * @description ColorPicker id\n */\n id: String,\n /**\n * @description whether to display the alpha slider\n */\n showAlpha: Boolean,\n /**\n * @description color format of v-model\n */\n colorFormat: String,\n /**\n * @description whether to disable the ColorPicker\n */\n disabled: Boolean,\n /**\n * @description size of ColorPicker\n */\n size: useSizeProp,\n /**\n * @description custom class name for ColorPicker's dropdown\n */\n popperClass: {\n type: String,\n default: '',\n },\n /**\n * @description ColorPicker aria-label\n */\n label: {\n type: String,\n default: undefined,\n },\n /**\n * @description ColorPicker tabindex\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description predefined color options\n */\n predefine: {\n type: definePropType<string[]>(Array),\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport const colorPickerEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | null) => isString(val) || isNil(val),\n [CHANGE_EVENT]: (val: string | null) => isString(val) || isNil(val),\n activeChange: (val: string | null) => isString(val) || isNil(val),\n focus: (event: FocusEvent) => event instanceof FocusEvent,\n blur: (event: FocusEvent) => event instanceof FocusEvent,\n}\n\nexport type ColorPickerProps = ExtractPropTypes<typeof colorPickerProps>\nexport type ColorPickerEmits = typeof colorPickerEmits\nexport type ColorPickerInstance = InstanceType<typeof ColorPicker>\n\nexport interface ColorPickerContext {\n currentColor: ComputedRef<string>\n}\n\nexport const colorPickerContextKey: InjectionKey<ColorPickerContext> = Symbol(\n 'colorPickerContextKey'\n)\n"],"names":[],"mappings":";;;;;;;;;AAIY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,EAAE,EAAE,MAAM;AACZ,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;AAC5D,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;AACtD,EAAE,YAAY,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;AACpD,EAAE,KAAK,EAAE,CAAC,KAAK,KAAK,KAAK,YAAY,UAAU;AAC/C,EAAE,IAAI,EAAE,CAAC,KAAK,KAAK,KAAK,YAAY,UAAU;AAC9C,EAAE;AACU,MAAC,qBAAqB,GAAG,MAAM,CAAC,uBAAuB;;;;"}
@@ -48,9 +48,11 @@ declare const _default: import("vue").DefineComponent<{
48
48
  }>> & {
49
49
  onChange?: ((val: string | null) => any) | undefined;
50
50
  "onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
51
+ onFocus?: ((event: FocusEvent) => any) | undefined;
52
+ onBlur?: ((event: FocusEvent) => any) | undefined;
51
53
  onActiveChange?: ((val: string | null) => any) | undefined;
52
54
  }>>;
53
- emit: ((event: "update:modelValue", val: string | null) => void) & ((event: "change", val: string | null) => void) & ((event: "activeChange", val: string | null) => void);
55
+ emit: ((event: "update:modelValue", val: string | null) => void) & ((event: "change", val: string | null) => void) & ((event: "focus", event: FocusEvent) => void) & ((event: "blur", event: FocusEvent) => void) & ((event: "activeChange", val: string | null) => void);
54
56
  t: import("@element-plus/nightly/es/hooks").Translator;
55
57
  ns: {
56
58
  namespace: import("vue").ComputedRef<string>;
@@ -6646,6 +6648,12 @@ declare const _default: import("vue").DefineComponent<{
6646
6648
  readonly disabled: boolean;
6647
6649
  }>;
6648
6650
  }> & {} & import("vue").ComponentCustomProperties) | undefined>;
6651
+ triggerRef: import("vue").Ref<any>;
6652
+ inputRef: import("vue").Ref<any>;
6653
+ isFocused: import("vue").Ref<boolean>;
6654
+ _handleFocus: (event: FocusEvent) => void;
6655
+ handleBlur: (event: FocusEvent) => void;
6656
+ handleFocus: (event: FocusEvent) => void;
6649
6657
  shouldActiveChange: boolean;
6650
6658
  color: Color;
6651
6659
  showPicker: import("vue").Ref<boolean>;
@@ -6666,6 +6674,11 @@ declare const _default: import("vue").DefineComponent<{
6666
6674
  handleConfirm: () => void;
6667
6675
  confirmValue: () => void;
6668
6676
  clear: () => void;
6677
+ handleClickOutside: (event: Event) => void;
6678
+ handleEsc: (event: KeyboardEvent) => void;
6679
+ handleKeyDown: (event: KeyboardEvent) => void;
6680
+ focus: () => void;
6681
+ blur: () => void;
6669
6682
  ElButton: import("@element-plus/nightly/es/utils").SFCWithInstall<import("vue").DefineComponent<{
6670
6683
  readonly size: {
6671
6684
  readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
@@ -10836,6 +10849,8 @@ declare const _default: import("vue").DefineComponent<{
10836
10849
  "update:modelValue": (val: string | null) => boolean;
10837
10850
  change: (val: string | null) => boolean;
10838
10851
  activeChange: (val: string | null) => boolean;
10852
+ focus: (event: FocusEvent) => boolean;
10853
+ blur: (event: FocusEvent) => boolean;
10839
10854
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
10840
10855
  readonly modelValue: StringConstructor;
10841
10856
  readonly id: StringConstructor;
@@ -10861,6 +10876,8 @@ declare const _default: import("vue").DefineComponent<{
10861
10876
  }>> & {
10862
10877
  onChange?: ((val: string | null) => any) | undefined;
10863
10878
  "onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
10879
+ onFocus?: ((event: FocusEvent) => any) | undefined;
10880
+ onBlur?: ((event: FocusEvent) => any) | undefined;
10864
10881
  onActiveChange?: ((val: string | null) => any) | undefined;
10865
10882
  }, {
10866
10883
  readonly popperClass: string;
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, reactive, computed, nextTick, onMounted, watch, provide, openBlock, createBlock, unref, withCtx, withDirectives, createElementBlock, createElementVNode, normalizeClass, createVNode, createCommentVNode, withKeys, createTextVNode, toDisplayString, normalizeStyle, vShow } from 'vue';
1
+ import { defineComponent, ref, reactive, computed, nextTick, onMounted, watch, provide, openBlock, createBlock, unref, withCtx, withDirectives, createElementBlock, withKeys, createElementVNode, normalizeClass, createVNode, createCommentVNode, createTextVNode, toDisplayString, normalizeStyle, vShow } from 'vue';
2
2
  import { debounce } from 'lodash-unified';
3
3
  import { ElButton } from '../../button/index.mjs';
4
4
  import { ElIcon } from '../../icon/index.mjs';
@@ -21,11 +21,14 @@ import { useLocale } from '../../../hooks/use-locale/index.mjs';
21
21
  import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
22
22
  import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
23
23
  import { useFormSize, useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
24
+ import { useFocusController } from '../../../hooks/use-focus-controller/index.mjs';
24
25
  import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
25
26
  import { debugWarn } from '../../../utils/error.mjs';
27
+ import { EVENT_CODE } from '../../../constants/aria.mjs';
26
28
  import ClickOutside from '../../../directives/click-outside/index.mjs';
27
29
 
28
- const _hoisted_1 = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex", "onKeydown"];
30
+ const _hoisted_1 = ["onKeydown"];
31
+ const _hoisted_2 = ["id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex"];
29
32
  const __default__ = defineComponent({
30
33
  name: "ElColorPicker"
31
34
  });
@@ -47,6 +50,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
47
50
  const sv = ref();
48
51
  const alpha = ref();
49
52
  const popper = ref();
53
+ const triggerRef = ref();
54
+ const inputRef = ref();
55
+ const {
56
+ isFocused,
57
+ handleFocus: _handleFocus,
58
+ handleBlur
59
+ } = useFocusController(triggerRef, {
60
+ beforeBlur(event) {
61
+ var _a;
62
+ return (_a = popper.value) == null ? void 0 : _a.isFocusInsideContent(event);
63
+ },
64
+ afterBlur() {
65
+ setShowPicker(false);
66
+ resetColor();
67
+ }
68
+ });
69
+ const handleFocus = (event) => {
70
+ if (colorDisabled.value)
71
+ return blur();
72
+ _handleFocus(event);
73
+ };
50
74
  let shouldActiveChange = true;
51
75
  const color = reactive(new Color({
52
76
  enableAlpha: props.showAlpha,
@@ -75,7 +99,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
75
99
  return [
76
100
  ns.b("picker"),
77
101
  ns.is("disabled", colorDisabled.value),
78
- ns.bm("picker", colorSize.value)
102
+ ns.bm("picker", colorSize.value),
103
+ ns.is("focused", isFocused.value)
79
104
  ];
80
105
  });
81
106
  function displayedRgb(color2, showAlpha) {
@@ -146,6 +171,41 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
146
171
  }
147
172
  resetColor();
148
173
  }
174
+ function handleClickOutside(event) {
175
+ if (!showPicker.value)
176
+ return;
177
+ hide();
178
+ if (isFocused.value) {
179
+ const _event = new FocusEvent("focus", event);
180
+ handleBlur(_event);
181
+ }
182
+ }
183
+ function handleEsc(event) {
184
+ event.preventDefault();
185
+ event.stopPropagation();
186
+ setShowPicker(false);
187
+ resetColor();
188
+ }
189
+ function handleKeyDown(event) {
190
+ switch (event.code) {
191
+ case EVENT_CODE.enter:
192
+ case EVENT_CODE.space:
193
+ event.preventDefault();
194
+ event.stopPropagation();
195
+ show();
196
+ inputRef.value.focus();
197
+ break;
198
+ case EVENT_CODE.esc:
199
+ handleEsc(event);
200
+ break;
201
+ }
202
+ }
203
+ function focus() {
204
+ triggerRef.value.focus();
205
+ }
206
+ function blur() {
207
+ triggerRef.value.blur();
208
+ }
149
209
  onMounted(() => {
150
210
  if (props.modelValue) {
151
211
  customInput.value = currentColor.value;
@@ -183,7 +243,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
183
243
  expose({
184
244
  color,
185
245
  show,
186
- hide
246
+ hide,
247
+ focus,
248
+ blur
187
249
  });
188
250
  return (_ctx, _cache) => {
189
251
  return openBlock(), createBlock(unref(ElTooltip), {
@@ -199,10 +261,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
199
261
  effect: "light",
200
262
  trigger: "click",
201
263
  transition: `${unref(ns).namespace.value}-zoom-in-top`,
202
- persistent: ""
264
+ persistent: "",
265
+ onHide: _cache[2] || (_cache[2] = ($event) => setShowPicker(false))
203
266
  }, {
204
267
  content: withCtx(() => [
205
- withDirectives((openBlock(), createElementBlock("div", null, [
268
+ withDirectives((openBlock(), createElementBlock("div", {
269
+ onKeydown: withKeys(handleEsc, ["esc"])
270
+ }, [
206
271
  createElementVNode("div", {
207
272
  class: normalizeClass(unref(ns).be("dropdown", "main-wrapper"))
208
273
  }, [
@@ -238,6 +303,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
238
303
  class: normalizeClass(unref(ns).be("dropdown", "value"))
239
304
  }, [
240
305
  createVNode(unref(ElInput), {
306
+ ref_key: "inputRef",
307
+ ref: inputRef,
241
308
  modelValue: customInput.value,
242
309
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
243
310
  "validate-event": false,
@@ -269,20 +336,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
269
336
  _: 1
270
337
  }, 8, ["class"])
271
338
  ], 2)
272
- ])), [
273
- [unref(ClickOutside), hide]
339
+ ], 40, _hoisted_1)), [
340
+ [unref(ClickOutside), handleClickOutside]
274
341
  ])
275
342
  ]),
276
343
  default: withCtx(() => [
277
344
  createElementVNode("div", {
278
345
  id: unref(buttonId),
346
+ ref_key: "triggerRef",
347
+ ref: triggerRef,
279
348
  class: normalizeClass(unref(btnKls)),
280
349
  role: "button",
281
350
  "aria-label": unref(buttonAriaLabel),
282
351
  "aria-labelledby": unref(buttonAriaLabelledby),
283
352
  "aria-description": unref(t)("el.colorpicker.description", { color: _ctx.modelValue || "" }),
284
- tabindex: _ctx.tabindex,
285
- onKeydown: withKeys(handleTrigger, ["enter"])
353
+ "aria-disabled": unref(colorDisabled),
354
+ tabindex: unref(colorDisabled) ? -1 : _ctx.tabindex,
355
+ onKeydown: handleKeyDown,
356
+ onFocus: handleFocus,
357
+ onBlur: _cache[1] || (_cache[1] = (...args) => unref(handleBlur) && unref(handleBlur)(...args))
286
358
  }, [
287
359
  unref(colorDisabled) ? (openBlock(), createElementBlock("div", {
288
360
  key: 0,
@@ -324,7 +396,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
324
396
  ], 6)
325
397
  ], 2)
326
398
  ], 2)
327
- ], 42, _hoisted_1)
399
+ ], 42, _hoisted_2)
328
400
  ]),
329
401
  _: 1
330
402
  }, 8, ["visible", "popper-class", "transition"]);