element-pe 2.0.6 → 2.0.7

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 (302) hide show
  1. package/dist/index.full.js +1 -1
  2. package/dist/index.full.min.js +1 -1
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +1 -1
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +1 -1
  7. package/es/components/affix/index.mjs +2 -2
  8. package/es/components/affix/src/affix.mjs +114 -23
  9. package/es/components/affix/src/affix.mjs.map +1 -1
  10. package/es/components/affix/src/affix2.mjs +23 -114
  11. package/es/components/affix/src/affix2.mjs.map +1 -1
  12. package/es/components/autocomplete/index.mjs +2 -2
  13. package/es/components/autocomplete/src/autocomplete.mjs +325 -67
  14. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  15. package/es/components/autocomplete/src/autocomplete2.mjs +67 -325
  16. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  17. package/es/components/backtop/index.mjs +2 -2
  18. package/es/components/backtop/src/backtop.mjs +100 -21
  19. package/es/components/backtop/src/backtop.mjs.map +1 -1
  20. package/es/components/backtop/src/backtop2.mjs +21 -100
  21. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  22. package/es/components/breadcrumb/index.mjs +2 -2
  23. package/es/components/breadcrumb/src/breadcrumb-item.mjs +11 -57
  24. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  25. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +57 -11
  26. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  27. package/es/components/button/index.mjs +3 -3
  28. package/es/components/button/src/button-group.mjs +5 -30
  29. package/es/components/button/src/button-group.mjs.map +1 -1
  30. package/es/components/button/src/button-group2.mjs +30 -5
  31. package/es/components/button/src/button-group2.mjs.map +1 -1
  32. package/es/components/button/src/button.mjs +106 -51
  33. package/es/components/button/src/button.mjs.map +1 -1
  34. package/es/components/button/src/button2.mjs +51 -106
  35. package/es/components/button/src/button2.mjs.map +1 -1
  36. package/es/components/carousel/index.mjs +2 -2
  37. package/es/components/carousel/src/carousel.mjs +48 -319
  38. package/es/components/carousel/src/carousel.mjs.map +1 -1
  39. package/es/components/carousel/src/carousel2.mjs +319 -48
  40. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  41. package/es/components/dialog/index.mjs +2 -2
  42. package/es/components/dialog/src/dialog.mjs +113 -70
  43. package/es/components/dialog/src/dialog.mjs.map +1 -1
  44. package/es/components/dialog/src/dialog2.mjs +70 -113
  45. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  46. package/es/components/drawer/index.mjs +2 -2
  47. package/es/components/drawer/src/drawer.mjs +21 -126
  48. package/es/components/drawer/src/drawer.mjs.map +1 -1
  49. package/es/components/drawer/src/drawer2.mjs +126 -21
  50. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  51. package/es/components/empty/index.mjs +2 -2
  52. package/es/components/empty/src/empty.mjs +11 -56
  53. package/es/components/empty/src/empty.mjs.map +1 -1
  54. package/es/components/empty/src/empty2.mjs +56 -11
  55. package/es/components/empty/src/empty2.mjs.map +1 -1
  56. package/es/components/form/index.mjs +2 -2
  57. package/es/components/form/src/form-item.mjs +43 -272
  58. package/es/components/form/src/form-item.mjs.map +1 -1
  59. package/es/components/form/src/form-item2.mjs +272 -43
  60. package/es/components/form/src/form-item2.mjs.map +1 -1
  61. package/es/components/icon/index.mjs +2 -2
  62. package/es/components/icon/src/icon.mjs +35 -8
  63. package/es/components/icon/src/icon.mjs.map +1 -1
  64. package/es/components/icon/src/icon2.mjs +8 -35
  65. package/es/components/icon/src/icon2.mjs.map +1 -1
  66. package/es/components/index.mjs +26 -26
  67. package/es/components/input/index.mjs +2 -2
  68. package/es/components/input/src/input.mjs +92 -433
  69. package/es/components/input/src/input.mjs.map +1 -1
  70. package/es/components/input/src/input2.mjs +433 -92
  71. package/es/components/input/src/input2.mjs.map +1 -1
  72. package/es/components/input-number/index.mjs +2 -2
  73. package/es/components/input-number/src/input-number.mjs +284 -53
  74. package/es/components/input-number/src/input-number.mjs.map +1 -1
  75. package/es/components/input-number/src/input-number2.mjs +53 -284
  76. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  77. package/es/components/link/index.mjs +2 -2
  78. package/es/components/link/src/link.mjs +49 -22
  79. package/es/components/link/src/link.mjs.map +1 -1
  80. package/es/components/link/src/link2.mjs +22 -49
  81. package/es/components/link/src/link2.mjs.map +1 -1
  82. package/es/components/menu/index.mjs +2 -2
  83. package/es/components/menu/src/menu-item-group.mjs +4 -51
  84. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  85. package/es/components/menu/src/menu-item-group2.mjs +51 -4
  86. package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
  87. package/es/components/page-header/index.mjs +2 -2
  88. package/es/components/page-header/src/page-header.mjs +60 -17
  89. package/es/components/page-header/src/page-header.mjs.map +1 -1
  90. package/es/components/page-header/src/page-header2.mjs +17 -60
  91. package/es/components/page-header/src/page-header2.mjs.map +1 -1
  92. package/es/components/popconfirm/index.mjs +2 -2
  93. package/es/components/popconfirm/src/popconfirm.mjs +52 -119
  94. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  95. package/es/components/popconfirm/src/popconfirm2.mjs +119 -52
  96. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  97. package/es/components/popper/index.mjs +2 -2
  98. package/es/components/popper/src/arrow.mjs +37 -7
  99. package/es/components/popper/src/arrow.mjs.map +1 -1
  100. package/es/components/popper/src/arrow2.mjs +7 -37
  101. package/es/components/popper/src/arrow2.mjs.map +1 -1
  102. package/es/components/progress/index.mjs +2 -2
  103. package/es/components/progress/src/progress.mjs +230 -57
  104. package/es/components/progress/src/progress.mjs.map +1 -1
  105. package/es/components/progress/src/progress2.mjs +57 -230
  106. package/es/components/progress/src/progress2.mjs.map +1 -1
  107. package/es/components/radio/index.mjs +2 -2
  108. package/es/components/radio/src/radio-group.mjs +20 -84
  109. package/es/components/radio/src/radio-group.mjs.map +1 -1
  110. package/es/components/radio/src/radio-group2.mjs +84 -20
  111. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  112. package/es/components/rate/index.mjs +2 -2
  113. package/es/components/rate/src/rate.mjs +239 -88
  114. package/es/components/rate/src/rate.mjs.map +1 -1
  115. package/es/components/rate/src/rate2.mjs +88 -239
  116. package/es/components/rate/src/rate2.mjs.map +1 -1
  117. package/es/components/skeleton/index.mjs +2 -2
  118. package/es/components/skeleton/src/skeleton-item.mjs +18 -23
  119. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  120. package/es/components/skeleton/src/skeleton-item2.mjs +23 -18
  121. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  122. package/es/components/skeleton/src/skeleton.mjs +1 -1
  123. package/es/components/switch/index.mjs +2 -2
  124. package/es/components/switch/src/switch.mjs +250 -87
  125. package/es/components/switch/src/switch.mjs.map +1 -1
  126. package/es/components/switch/src/switch2.mjs +87 -250
  127. package/es/components/switch/src/switch2.mjs.map +1 -1
  128. package/es/components/tabs/index.mjs +3 -3
  129. package/es/components/tabs/src/tab-bar.mjs +76 -7
  130. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  131. package/es/components/tabs/src/tab-bar2.mjs +7 -76
  132. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  133. package/es/components/tabs/src/tab-nav.mjs +1 -1
  134. package/es/components/tabs/src/tab-pane.mjs +60 -14
  135. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  136. package/es/components/tabs/src/tab-pane2.mjs +14 -60
  137. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  138. package/es/components/teleport/index.mjs +2 -2
  139. package/es/components/teleport/src/teleport.mjs +18 -43
  140. package/es/components/teleport/src/teleport.mjs.map +1 -1
  141. package/es/components/teleport/src/teleport2.mjs +43 -18
  142. package/es/components/teleport/src/teleport2.mjs.map +1 -1
  143. package/es/components/tooltip/src/tooltip2.mjs +2 -2
  144. package/es/components/tooltip-v2/index.mjs +3 -3
  145. package/es/components/tooltip-v2/src/arrow.mjs +22 -38
  146. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  147. package/es/components/tooltip-v2/src/arrow2.mjs +38 -22
  148. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  149. package/es/components/tooltip-v2/src/tooltip.mjs +20 -73
  150. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  151. package/es/components/tooltip-v2/src/tooltip2.mjs +73 -20
  152. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  153. package/es/index.mjs +26 -26
  154. package/lib/components/affix/index.js +2 -2
  155. package/lib/components/affix/src/affix.js +114 -24
  156. package/lib/components/affix/src/affix.js.map +1 -1
  157. package/lib/components/affix/src/affix2.js +24 -114
  158. package/lib/components/affix/src/affix2.js.map +1 -1
  159. package/lib/components/autocomplete/index.js +2 -2
  160. package/lib/components/autocomplete/src/autocomplete.js +324 -67
  161. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  162. package/lib/components/autocomplete/src/autocomplete2.js +67 -324
  163. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  164. package/lib/components/backtop/index.js +2 -2
  165. package/lib/components/backtop/src/backtop.js +100 -22
  166. package/lib/components/backtop/src/backtop.js.map +1 -1
  167. package/lib/components/backtop/src/backtop2.js +22 -100
  168. package/lib/components/backtop/src/backtop2.js.map +1 -1
  169. package/lib/components/breadcrumb/index.js +2 -2
  170. package/lib/components/breadcrumb/src/breadcrumb-item.js +11 -57
  171. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  172. package/lib/components/breadcrumb/src/breadcrumb-item2.js +57 -11
  173. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  174. package/lib/components/button/index.js +3 -3
  175. package/lib/components/button/src/button-group.js +5 -30
  176. package/lib/components/button/src/button-group.js.map +1 -1
  177. package/lib/components/button/src/button-group2.js +30 -5
  178. package/lib/components/button/src/button-group2.js.map +1 -1
  179. package/lib/components/button/src/button.js +106 -54
  180. package/lib/components/button/src/button.js.map +1 -1
  181. package/lib/components/button/src/button2.js +54 -106
  182. package/lib/components/button/src/button2.js.map +1 -1
  183. package/lib/components/carousel/index.js +2 -2
  184. package/lib/components/carousel/src/carousel.js +49 -319
  185. package/lib/components/carousel/src/carousel.js.map +1 -1
  186. package/lib/components/carousel/src/carousel2.js +319 -49
  187. package/lib/components/carousel/src/carousel2.js.map +1 -1
  188. package/lib/components/dialog/index.js +2 -2
  189. package/lib/components/dialog/src/dialog.js +113 -71
  190. package/lib/components/dialog/src/dialog.js.map +1 -1
  191. package/lib/components/dialog/src/dialog2.js +71 -113
  192. package/lib/components/dialog/src/dialog2.js.map +1 -1
  193. package/lib/components/drawer/index.js +2 -2
  194. package/lib/components/drawer/src/drawer.js +22 -126
  195. package/lib/components/drawer/src/drawer.js.map +1 -1
  196. package/lib/components/drawer/src/drawer2.js +126 -22
  197. package/lib/components/drawer/src/drawer2.js.map +1 -1
  198. package/lib/components/empty/index.js +2 -2
  199. package/lib/components/empty/src/empty.js +11 -56
  200. package/lib/components/empty/src/empty.js.map +1 -1
  201. package/lib/components/empty/src/empty2.js +56 -11
  202. package/lib/components/empty/src/empty2.js.map +1 -1
  203. package/lib/components/form/index.js +2 -2
  204. package/lib/components/form/src/form-item.js +44 -276
  205. package/lib/components/form/src/form-item.js.map +1 -1
  206. package/lib/components/form/src/form-item2.js +276 -44
  207. package/lib/components/form/src/form-item2.js.map +1 -1
  208. package/lib/components/icon/index.js +2 -2
  209. package/lib/components/icon/src/icon.js +35 -8
  210. package/lib/components/icon/src/icon.js.map +1 -1
  211. package/lib/components/icon/src/icon2.js +8 -35
  212. package/lib/components/icon/src/icon2.js.map +1 -1
  213. package/lib/components/index.js +26 -26
  214. package/lib/components/input/index.js +2 -2
  215. package/lib/components/input/src/input.js +92 -432
  216. package/lib/components/input/src/input.js.map +1 -1
  217. package/lib/components/input/src/input2.js +432 -92
  218. package/lib/components/input/src/input2.js.map +1 -1
  219. package/lib/components/input-number/index.js +2 -2
  220. package/lib/components/input-number/src/input-number.js +284 -54
  221. package/lib/components/input-number/src/input-number.js.map +1 -1
  222. package/lib/components/input-number/src/input-number2.js +54 -284
  223. package/lib/components/input-number/src/input-number2.js.map +1 -1
  224. package/lib/components/link/index.js +2 -2
  225. package/lib/components/link/src/link.js +49 -23
  226. package/lib/components/link/src/link.js.map +1 -1
  227. package/lib/components/link/src/link2.js +23 -49
  228. package/lib/components/link/src/link2.js.map +1 -1
  229. package/lib/components/menu/index.js +2 -2
  230. package/lib/components/menu/src/menu-item-group.js +4 -51
  231. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  232. package/lib/components/menu/src/menu-item-group2.js +51 -4
  233. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  234. package/lib/components/page-header/index.js +2 -2
  235. package/lib/components/page-header/src/page-header.js +60 -18
  236. package/lib/components/page-header/src/page-header.js.map +1 -1
  237. package/lib/components/page-header/src/page-header2.js +18 -60
  238. package/lib/components/page-header/src/page-header2.js.map +1 -1
  239. package/lib/components/popconfirm/index.js +2 -2
  240. package/lib/components/popconfirm/src/popconfirm.js +52 -119
  241. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  242. package/lib/components/popconfirm/src/popconfirm2.js +119 -52
  243. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  244. package/lib/components/popper/index.js +2 -2
  245. package/lib/components/popper/src/arrow.js +37 -7
  246. package/lib/components/popper/src/arrow.js.map +1 -1
  247. package/lib/components/popper/src/arrow2.js +7 -37
  248. package/lib/components/popper/src/arrow2.js.map +1 -1
  249. package/lib/components/progress/index.js +2 -2
  250. package/lib/components/progress/src/progress.js +230 -57
  251. package/lib/components/progress/src/progress.js.map +1 -1
  252. package/lib/components/progress/src/progress2.js +57 -230
  253. package/lib/components/progress/src/progress2.js.map +1 -1
  254. package/lib/components/radio/index.js +2 -2
  255. package/lib/components/radio/src/radio-group.js +21 -84
  256. package/lib/components/radio/src/radio-group.js.map +1 -1
  257. package/lib/components/radio/src/radio-group2.js +84 -21
  258. package/lib/components/radio/src/radio-group2.js.map +1 -1
  259. package/lib/components/rate/index.js +2 -2
  260. package/lib/components/rate/src/rate.js +239 -89
  261. package/lib/components/rate/src/rate.js.map +1 -1
  262. package/lib/components/rate/src/rate2.js +89 -239
  263. package/lib/components/rate/src/rate2.js.map +1 -1
  264. package/lib/components/skeleton/index.js +2 -2
  265. package/lib/components/skeleton/src/skeleton-item.js +18 -23
  266. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  267. package/lib/components/skeleton/src/skeleton-item2.js +23 -18
  268. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  269. package/lib/components/skeleton/src/skeleton.js +1 -1
  270. package/lib/components/switch/index.js +2 -2
  271. package/lib/components/switch/src/switch.js +249 -87
  272. package/lib/components/switch/src/switch.js.map +1 -1
  273. package/lib/components/switch/src/switch2.js +87 -249
  274. package/lib/components/switch/src/switch2.js.map +1 -1
  275. package/lib/components/tabs/index.js +3 -3
  276. package/lib/components/tabs/src/tab-bar.js +76 -7
  277. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  278. package/lib/components/tabs/src/tab-bar2.js +7 -76
  279. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  280. package/lib/components/tabs/src/tab-nav.js +1 -1
  281. package/lib/components/tabs/src/tab-pane.js +60 -14
  282. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  283. package/lib/components/tabs/src/tab-pane2.js +14 -60
  284. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  285. package/lib/components/teleport/index.js +2 -2
  286. package/lib/components/teleport/src/teleport.js +18 -43
  287. package/lib/components/teleport/src/teleport.js.map +1 -1
  288. package/lib/components/teleport/src/teleport2.js +43 -18
  289. package/lib/components/teleport/src/teleport2.js.map +1 -1
  290. package/lib/components/tooltip/src/tooltip2.js +2 -2
  291. package/lib/components/tooltip-v2/index.js +3 -3
  292. package/lib/components/tooltip-v2/src/arrow.js +23 -38
  293. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  294. package/lib/components/tooltip-v2/src/arrow2.js +38 -23
  295. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  296. package/lib/components/tooltip-v2/src/tooltip.js +20 -73
  297. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  298. package/lib/components/tooltip-v2/src/tooltip2.js +73 -20
  299. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  300. package/lib/index.js +26 -26
  301. package/package.json +1 -1
  302. package/web-types.json +1 -1
@@ -1,293 +1,62 @@
1
- import { defineComponent, ref, reactive, computed, watch, onMounted, onUpdated, resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, withModifiers, withDirectives, withKeys, createVNode, withCtx, createBlock, createCommentVNode } from 'vue';
2
- import { ElIcon } from '../../icon/index.mjs';
3
- import '../../../directives/index.mjs';
4
- import '../../../hooks/index.mjs';
5
- import { ElInput } from '../../input/index.mjs';
6
1
  import '../../../utils/index.mjs';
7
- import { ArrowUp, ArrowDown, Plus, Minus } from '@element-plus/icons-vue';
8
- import { inputNumberProps, inputNumberEmits } from './input-number.mjs';
9
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
- import RepeatClick from '../../../directives/repeat-click/index.mjs';
11
- import { useFormItem } from '../../../hooks/use-form-item/index.mjs';
12
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
13
- import { isUndefined } from '../../../utils/types.mjs';
14
- import { debugWarn } from '../../../utils/error.mjs';
15
- import { useSize, useDisabled } from '../../../hooks/use-common-props/index.mjs';
2
+ import '../../../constants/index.mjs';
3
+ import { buildProps } from '../../../utils/vue/props.mjs';
4
+ import { componentSizes } from '../../../constants/size.mjs';
16
5
  import { isNumber } from '@vueuse/core';
17
6
 
18
- const _sfc_main = defineComponent({
19
- name: "ElInputNumber",
20
- components: {
21
- ElInput,
22
- ElIcon,
23
- ArrowUp,
24
- ArrowDown,
25
- Plus,
26
- Minus
7
+ const inputNumberProps = buildProps({
8
+ step: {
9
+ type: Number,
10
+ default: 1
27
11
  },
28
- directives: {
29
- RepeatClick
12
+ stepStrictly: {
13
+ type: Boolean,
14
+ default: false
30
15
  },
31
- props: inputNumberProps,
32
- emits: inputNumberEmits,
33
- setup(props, { emit }) {
34
- const input = ref();
35
- const data = reactive({
36
- currentValue: props.modelValue,
37
- userInput: null
38
- });
39
- const { formItem } = useFormItem();
40
- const ns = useNamespace("input-number");
41
- const minDisabled = computed(() => ensurePrecision(props.modelValue, -1) < props.min);
42
- const maxDisabled = computed(() => ensurePrecision(props.modelValue) > props.max);
43
- const numPrecision = computed(() => {
44
- const stepPrecision = getPrecision(props.step);
45
- if (!isUndefined(props.precision)) {
46
- if (stepPrecision > props.precision) {
47
- debugWarn("InputNumber", "precision should not be less than the decimal places of step");
48
- }
49
- return props.precision;
50
- } else {
51
- return Math.max(getPrecision(props.modelValue), stepPrecision);
52
- }
53
- });
54
- const controlsAtRight = computed(() => {
55
- return props.controls && props.controlsPosition === "right";
56
- });
57
- const inputNumberSize = useSize();
58
- const inputNumberDisabled = useDisabled();
59
- const displayValue = computed(() => {
60
- if (data.userInput !== null) {
61
- return data.userInput;
62
- }
63
- let currentValue = data.currentValue;
64
- if (isNumber(currentValue)) {
65
- if (Number.isNaN(currentValue))
66
- return "";
67
- if (!isUndefined(props.precision)) {
68
- currentValue = currentValue.toFixed(props.precision);
69
- }
70
- }
71
- return currentValue;
72
- });
73
- const toPrecision = (num, pre) => {
74
- if (isUndefined(pre))
75
- pre = numPrecision.value;
76
- return Number.parseFloat(`${Math.round(num * 10 ** pre) / 10 ** pre}`);
77
- };
78
- const getPrecision = (value) => {
79
- if (isUndefined(value))
80
- return 0;
81
- const valueString = value.toString();
82
- const dotPosition = valueString.indexOf(".");
83
- let precision = 0;
84
- if (dotPosition !== -1) {
85
- precision = valueString.length - dotPosition - 1;
86
- }
87
- return precision;
88
- };
89
- const ensurePrecision = (val, coefficient = 1) => {
90
- if (!isNumber(val))
91
- return data.currentValue;
92
- val = isNumber(val) ? val : Number.NaN;
93
- return toPrecision(val + props.step * coefficient);
94
- };
95
- const increase = () => {
96
- if (inputNumberDisabled.value || maxDisabled.value)
97
- return;
98
- const value = props.modelValue || 0;
99
- const newVal = ensurePrecision(value);
100
- setCurrentValue(newVal);
101
- };
102
- const decrease = () => {
103
- if (inputNumberDisabled.value || minDisabled.value)
104
- return;
105
- const value = props.modelValue || 0;
106
- const newVal = ensurePrecision(value, -1);
107
- setCurrentValue(newVal);
108
- };
109
- const verifyValue = (value, update) => {
110
- const { max, min, step, precision, stepStrictly } = props;
111
- let newVal = Number(value);
112
- if (value === null || value === "") {
113
- newVal = Number.NaN;
114
- }
115
- if (!Number.isNaN(newVal)) {
116
- if (stepStrictly) {
117
- newVal = Math.round(newVal / step) * step;
118
- }
119
- if (!isUndefined(precision)) {
120
- newVal = toPrecision(newVal, precision);
121
- }
122
- if (newVal > max || newVal < min) {
123
- newVal = newVal > max ? max : min;
124
- update && emit("update:modelValue", newVal);
125
- }
126
- }
127
- return newVal;
128
- };
129
- const setCurrentValue = (value) => {
130
- var _a;
131
- const oldVal = data.currentValue;
132
- let newVal = verifyValue(value);
133
- if (oldVal === newVal)
134
- return;
135
- if (Number.isNaN(newVal)) {
136
- newVal = void 0;
137
- }
138
- data.userInput = null;
139
- emit("update:modelValue", newVal);
140
- emit("input", newVal);
141
- emit("change", newVal, oldVal);
142
- (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
143
- data.currentValue = newVal;
144
- };
145
- const handleInput = (value) => {
146
- return data.userInput = value;
147
- };
148
- const handleInputChange = (value) => {
149
- const newVal = value !== "" ? Number(value) : "";
150
- if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
151
- setCurrentValue(newVal);
152
- }
153
- data.userInput = null;
154
- };
155
- const focus = () => {
156
- var _a, _b;
157
- (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
158
- };
159
- const blur = () => {
160
- var _a, _b;
161
- (_b = (_a = input.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
162
- };
163
- const handleFocus = (event) => {
164
- emit("focus", event);
165
- };
166
- const handleBlur = (event) => {
167
- var _a;
168
- emit("blur", event);
169
- (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err));
170
- };
171
- watch(() => props.modelValue, (value) => {
172
- const newVal = verifyValue(value, true);
173
- data.currentValue = newVal;
174
- data.userInput = null;
175
- }, { immediate: true });
176
- onMounted(() => {
177
- var _a;
178
- const innerInput = (_a = input.value) == null ? void 0 : _a.input;
179
- innerInput.setAttribute("role", "spinbutton");
180
- innerInput.setAttribute("aria-valuemax", String(props.max));
181
- innerInput.setAttribute("aria-valuemin", String(props.min));
182
- innerInput.setAttribute("aria-valuenow", String(data.currentValue));
183
- innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
184
- if (!isNumber(props.modelValue)) {
185
- let val = Number(props.modelValue);
186
- if (Number.isNaN(val)) {
187
- val = void 0;
188
- }
189
- emit("update:modelValue", val);
190
- }
191
- });
192
- onUpdated(() => {
193
- var _a;
194
- const innerInput = (_a = input.value) == null ? void 0 : _a.input;
195
- innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", data.currentValue);
196
- });
197
- return {
198
- input,
199
- displayValue,
200
- handleInput,
201
- handleInputChange,
202
- controlsAtRight,
203
- decrease,
204
- increase,
205
- inputNumberSize,
206
- inputNumberDisabled,
207
- maxDisabled,
208
- minDisabled,
209
- focus,
210
- blur,
211
- handleFocus,
212
- handleBlur,
213
- ns
214
- };
16
+ max: {
17
+ type: Number,
18
+ default: Number.POSITIVE_INFINITY
19
+ },
20
+ min: {
21
+ type: Number,
22
+ default: Number.NEGATIVE_INFINITY
23
+ },
24
+ modelValue: {
25
+ type: Number,
26
+ required: true
27
+ },
28
+ disabled: {
29
+ type: Boolean,
30
+ default: false
31
+ },
32
+ size: {
33
+ type: String,
34
+ values: componentSizes
35
+ },
36
+ controls: {
37
+ type: Boolean,
38
+ default: true
39
+ },
40
+ controlsPosition: {
41
+ type: String,
42
+ default: "",
43
+ values: ["", "right"]
44
+ },
45
+ name: String,
46
+ label: String,
47
+ placeholder: String,
48
+ precision: {
49
+ type: Number,
50
+ validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
215
51
  }
216
52
  });
217
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
218
- const _component_arrow_down = resolveComponent("arrow-down");
219
- const _component_minus = resolveComponent("minus");
220
- const _component_el_icon = resolveComponent("el-icon");
221
- const _component_arrow_up = resolveComponent("arrow-up");
222
- const _component_plus = resolveComponent("plus");
223
- const _component_el_input = resolveComponent("el-input");
224
- const _directive_repeat_click = resolveDirective("repeat-click");
225
- return openBlock(), createElementBlock("div", {
226
- class: normalizeClass([
227
- _ctx.ns.b(),
228
- _ctx.ns.m(_ctx.inputNumberSize),
229
- _ctx.ns.is("disabled", _ctx.inputNumberDisabled),
230
- _ctx.ns.is("without-controls", !_ctx.controls),
231
- _ctx.ns.is("controls-right", _ctx.controlsAtRight)
232
- ]),
233
- onDragstart: _cache[2] || (_cache[2] = withModifiers(() => {
234
- }, ["prevent"]))
235
- }, [
236
- _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
237
- key: 0,
238
- role: "button",
239
- class: normalizeClass([_ctx.ns.e("decrease"), _ctx.ns.is("disabled", _ctx.minDisabled)]),
240
- onKeydown: _cache[0] || (_cache[0] = withKeys((...args) => _ctx.decrease && _ctx.decrease(...args), ["enter"]))
241
- }, [
242
- createVNode(_component_el_icon, null, {
243
- default: withCtx(() => [
244
- _ctx.controlsAtRight ? (openBlock(), createBlock(_component_arrow_down, { key: 0 })) : (openBlock(), createBlock(_component_minus, { key: 1 }))
245
- ]),
246
- _: 1
247
- })
248
- ], 34)), [
249
- [_directive_repeat_click, _ctx.decrease]
250
- ]) : createCommentVNode("v-if", true),
251
- _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
252
- key: 1,
253
- role: "button",
254
- class: normalizeClass([_ctx.ns.e("increase"), _ctx.ns.is("disabled", _ctx.maxDisabled)]),
255
- onKeydown: _cache[1] || (_cache[1] = withKeys((...args) => _ctx.increase && _ctx.increase(...args), ["enter"]))
256
- }, [
257
- createVNode(_component_el_icon, null, {
258
- default: withCtx(() => [
259
- _ctx.controlsAtRight ? (openBlock(), createBlock(_component_arrow_up, { key: 0 })) : (openBlock(), createBlock(_component_plus, { key: 1 }))
260
- ]),
261
- _: 1
262
- })
263
- ], 34)), [
264
- [_directive_repeat_click, _ctx.increase]
265
- ]) : createCommentVNode("v-if", true),
266
- createVNode(_component_el_input, {
267
- ref: "input",
268
- type: "number",
269
- step: _ctx.step,
270
- "model-value": _ctx.displayValue,
271
- placeholder: _ctx.placeholder,
272
- disabled: _ctx.inputNumberDisabled,
273
- size: _ctx.inputNumberSize,
274
- max: _ctx.max,
275
- min: _ctx.min,
276
- name: _ctx.name,
277
- label: _ctx.label,
278
- "validate-event": false,
279
- onKeydown: [
280
- withKeys(withModifiers(_ctx.increase, ["prevent"]), ["up"]),
281
- withKeys(withModifiers(_ctx.decrease, ["prevent"]), ["down"])
282
- ],
283
- onBlur: _ctx.handleBlur,
284
- onFocus: _ctx.handleFocus,
285
- onInput: _ctx.handleInput,
286
- onChange: _ctx.handleInputChange
287
- }, null, 8, ["step", "model-value", "placeholder", "disabled", "size", "max", "min", "name", "label", "onKeydown", "onBlur", "onFocus", "onInput", "onChange"])
288
- ], 34);
289
- }
290
- var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-pe/packages/components/input-number/src/input-number.vue"]]);
53
+ const inputNumberEmits = {
54
+ change: (prev, cur) => prev !== cur,
55
+ blur: (e) => e instanceof FocusEvent,
56
+ focus: (e) => e instanceof FocusEvent,
57
+ input: (val) => isNumber(val),
58
+ "update:modelValue": (val) => isNumber(val) || val === void 0
59
+ };
291
60
 
292
- export { InputNumber as default };
61
+ export { inputNumberEmits, inputNumberProps };
293
62
  //# sourceMappingURL=input-number2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-number2.mjs","sources":["../../../../../../packages/components/input-number/src/input-number.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.m(inputNumberSize),\n ns.is('disabled', inputNumberDisabled),\n ns.is('without-controls', !controls),\n ns.is('controls-right', controlsAtRight),\n ]\"\n @dragstart.prevent\n >\n <span\n v-if=\"controls\"\n v-repeat-click=\"decrease\"\n role=\"button\"\n :class=\"[ns.e('decrease'), ns.is('disabled', minDisabled)]\"\n @keydown.enter=\"decrease\"\n >\n <el-icon>\n <arrow-down v-if=\"controlsAtRight\" />\n <minus v-else />\n </el-icon>\n </span>\n <span\n v-if=\"controls\"\n v-repeat-click=\"increase\"\n role=\"button\"\n :class=\"[ns.e('increase'), ns.is('disabled', maxDisabled)]\"\n @keydown.enter=\"increase\"\n >\n <el-icon>\n <arrow-up v-if=\"controlsAtRight\" />\n <plus v-else />\n </el-icon>\n </span>\n <el-input\n ref=\"input\"\n type=\"number\"\n :step=\"step\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :disabled=\"inputNumberDisabled\"\n :size=\"inputNumberSize\"\n :max=\"max\"\n :min=\"min\"\n :name=\"name\"\n :label=\"label\"\n :validate-event=\"false\"\n @keydown.up.prevent=\"increase\"\n @keydown.down.prevent=\"decrease\"\n @blur=\"handleBlur\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @change=\"handleInputChange\"\n />\n </div>\n</template>\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n onMounted,\n onUpdated,\n reactive,\n ref,\n watch,\n} from 'vue'\n\nimport { ElIcon } from '@element-plus/components/icon'\nimport { RepeatClick } from '@element-plus/directives'\nimport {\n useDisabled,\n useFormItem,\n useNamespace,\n useSize,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { debugWarn, isNumber, isUndefined } from '@element-plus/utils'\nimport { ArrowDown, ArrowUp, Minus, Plus } from '@element-plus/icons-vue'\nimport { inputNumberEmits, inputNumberProps } from './input-number'\n\nimport type { ComponentPublicInstance } from 'vue'\n\ninterface IData {\n currentValue: number | undefined\n userInput: null | number | string\n}\n\nexport default defineComponent({\n name: 'ElInputNumber',\n components: {\n ElInput,\n ElIcon,\n ArrowUp,\n ArrowDown,\n Plus,\n Minus,\n },\n directives: {\n RepeatClick,\n },\n props: inputNumberProps,\n emits: inputNumberEmits,\n setup(props, { emit }) {\n const input = ref<ComponentPublicInstance<typeof ElInput>>()\n const data = reactive<IData>({\n currentValue: props.modelValue,\n userInput: null,\n })\n const { formItem } = useFormItem()\n const ns = useNamespace('input-number')\n\n const minDisabled = computed(\n () => ensurePrecision(props.modelValue, -1) < props.min\n )\n const maxDisabled = computed(\n () => ensurePrecision(props.modelValue) > props.max\n )\n\n const numPrecision = computed(() => {\n const stepPrecision = getPrecision(props.step)\n if (!isUndefined(props.precision)) {\n if (stepPrecision > props.precision) {\n debugWarn(\n 'InputNumber',\n 'precision should not be less than the decimal places of step'\n )\n }\n return props.precision\n } else {\n return Math.max(getPrecision(props.modelValue), stepPrecision)\n }\n })\n const controlsAtRight = computed(() => {\n return props.controls && props.controlsPosition === 'right'\n })\n\n const inputNumberSize = useSize()\n const inputNumberDisabled = useDisabled()\n\n const displayValue = computed(() => {\n if (data.userInput !== null) {\n return data.userInput\n }\n let currentValue: number | string | undefined = data.currentValue\n if (isNumber(currentValue)) {\n if (Number.isNaN(currentValue)) return ''\n if (!isUndefined(props.precision)) {\n currentValue = currentValue.toFixed(props.precision)\n }\n }\n return currentValue\n })\n const toPrecision = (num: number, pre?: number) => {\n if (isUndefined(pre)) pre = numPrecision.value\n return Number.parseFloat(`${Math.round(num * 10 ** pre) / 10 ** pre}`)\n }\n const getPrecision = (value: number | undefined) => {\n if (isUndefined(value)) return 0\n const valueString = value.toString()\n const dotPosition = valueString.indexOf('.')\n let precision = 0\n if (dotPosition !== -1) {\n precision = valueString.length - dotPosition - 1\n }\n return precision\n }\n const ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {\n if (!isNumber(val)) return data.currentValue\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n val = isNumber(val) ? val : Number.NaN\n return toPrecision(val + props.step * coefficient)\n }\n const increase = () => {\n if (inputNumberDisabled.value || maxDisabled.value) return\n const value = props.modelValue || 0\n const newVal = ensurePrecision(value)\n setCurrentValue(newVal)\n }\n const decrease = () => {\n if (inputNumberDisabled.value || minDisabled.value) return\n const value = props.modelValue || 0\n const newVal = ensurePrecision(value, -1)\n setCurrentValue(newVal)\n }\n const verifyValue = (\n value: number | string | undefined,\n update?: boolean\n ): number | undefined => {\n const { max, min, step, precision, stepStrictly } = props\n let newVal = Number(value)\n if (value === null || value === '') {\n newVal = Number.NaN\n }\n if (!Number.isNaN(newVal)) {\n if (stepStrictly) {\n newVal = Math.round(newVal / step) * step\n }\n if (!isUndefined(precision)) {\n newVal = toPrecision(newVal, precision)\n }\n if (newVal > max || newVal < min) {\n newVal = newVal > max ? max : min\n update && emit('update:modelValue', newVal)\n }\n }\n return newVal\n }\n const setCurrentValue = (value: number | string | undefined) => {\n const oldVal = data.currentValue\n let newVal = verifyValue(value)\n if (oldVal === newVal) return\n if (Number.isNaN(newVal)) {\n newVal = undefined\n }\n data.userInput = null\n emit('update:modelValue', newVal)\n emit('input', newVal)\n emit('change', newVal, oldVal)\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n data.currentValue = newVal\n }\n const handleInput = (value: string) => {\n return (data.userInput = value)\n }\n const handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number(value) : ''\n if ((isNumber(newVal) && !Number.isNaN(newVal)) || value === '') {\n setCurrentValue(newVal)\n }\n data.userInput = null\n }\n\n const focus = () => {\n input.value?.focus?.()\n }\n\n const blur = () => {\n input.value?.blur?.()\n }\n\n const handleFocus = (event: MouseEvent | FocusEvent) => {\n emit('focus', event)\n }\n\n const handleBlur = (event: MouseEvent | FocusEvent) => {\n emit('blur', event)\n formItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n\n watch(\n () => props.modelValue,\n (value) => {\n const newVal = verifyValue(value, true)\n data.currentValue = newVal\n data.userInput = null\n },\n { immediate: true }\n )\n onMounted(() => {\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n innerInput.setAttribute('aria-valuemax', String(props.max))\n innerInput.setAttribute('aria-valuemin', String(props.min))\n innerInput.setAttribute('aria-valuenow', String(data.currentValue))\n innerInput.setAttribute(\n 'aria-disabled',\n String(inputNumberDisabled.value)\n )\n if (!isNumber(props.modelValue)) {\n let val: number | undefined = Number(props.modelValue)\n if (Number.isNaN(val)) {\n val = undefined\n }\n emit('update:modelValue', val)\n }\n })\n onUpdated(() => {\n const innerInput = input.value?.input\n innerInput?.setAttribute('aria-valuenow', data.currentValue)\n })\n return {\n input,\n displayValue,\n handleInput,\n handleInputChange,\n controlsAtRight,\n decrease,\n increase,\n inputNumberSize,\n inputNumberDisabled,\n maxDisabled,\n minDisabled,\n focus,\n blur,\n handleFocus,\n handleBlur,\n ns,\n }\n },\n})\n</script>\n"],"names":["_resolveComponent","_resolveDirective","_openBlock","_createElementBlock","_normalizeClass","_withDirectives","_createBlock","_createCommentVNode","_createVNode","_withKeys","_withModifiers"],"mappings":";;;;;;;;;;;;;;;;;AAwFA,MAAK,YAAa,eAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,eAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,GACF;AAAA,EACA,UAAY,EAAA;AAAA,IACV,WAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAA,gBAAA;AAAA,EACP,KAAO,EAAA,gBAAA;AA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A,MAAA,EAAA,IAAA,CAAA;AAAA,IAAAC,WACH,CAAA,mBAAA,EAAA;AAAA,MACV,GAAM,EAAA,OAAA;AAAA,MACN,IAAK,EAAA,QAAA;AAAA,MACL,IAAK,EAAA,IAAA,CAAA,IAAA;AAAA,MACL,aAAM,EAAA,IAAA,CAAA,YAAA;AAAA,MACN,WAAO,EAAA,IAAA,CAAA,WAAA;AAAA,MACP,QAAgB,EAAA,IAAA,CAAA,mBAAA;AAAA,MAChB,IAAO,EAAA,IAAA,CAAA,eAAA;AAAA,MAAA,GAAA,EAAA,IAAA,CAAA,GAAA;AAAqB,MAAA,GAAA,EAAA,IAAA,CAAA,GAAA;AACE,MAAA,IAAA,EAAA,IAAA,CAAA,IAAA;MAC9B,KAAM,EAAA,IAAA,CAAA,KAAA;AAAA,MACN,gBAAO,EAAA,KAAA;AAAA,MACP,SAAO,EAAA;AAAA,QACCC,QAAA,CAAAC,aAAA,CAAA,IAAA,CAAA,QAAA,EAAA,CAAA,SAAA,CAAA,CAAA,EAAA,CAAA,IAAA,CAAA,CAAA;AAAA,QAAAD,QAAA,CAAAC,aAAA,CAAA,IAAA,CAAA,QAAA,EAAA,CAAA,SAAA,CAAA,CAAA,EAAA,CAAA,MAAA,CAAA,CAAA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"input-number2.mjs","sources":["../../../../../../packages/components/input-number/src/input-number.ts"],"sourcesContent":["import { buildProps, isNumber } from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\n\nexport const inputNumberProps = buildProps({\n step: {\n type: Number,\n default: 1,\n },\n stepStrictly: {\n type: Boolean,\n default: false,\n },\n max: {\n type: Number,\n default: Number.POSITIVE_INFINITY,\n },\n min: {\n type: Number,\n default: Number.NEGATIVE_INFINITY,\n },\n modelValue: {\n type: Number,\n required: true,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n size: {\n type: String,\n values: componentSizes,\n },\n controls: {\n type: Boolean,\n default: true,\n },\n controlsPosition: {\n type: String,\n default: '',\n values: ['', 'right'],\n },\n name: String,\n label: String,\n placeholder: String,\n precision: {\n type: Number,\n validator: (val: number) =>\n val >= 0 && val === Number.parseInt(`${val}`, 10),\n },\n} as const)\n\nexport const inputNumberEmits = {\n change: (prev: number | undefined, cur: number | undefined) => prev !== cur,\n blur: (e: FocusEvent) => e instanceof FocusEvent,\n focus: (e: FocusEvent) => e instanceof FocusEvent,\n input: (val: number | undefined) => isNumber(val),\n 'update:modelValue': (val: number | undefined) =>\n isNumber(val) || val === undefined,\n}\n"],"names":[],"mappings":";;;;;;AAEY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM,CAAC,iBAAiB;AACrC,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM,CAAC,iBAAiB;AACrC,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,cAAc;AAC1B,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC;AACzB,GAAG;AACH,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,SAAS,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,IAAI,GAAG,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;AACzE,GAAG;AACH,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,KAAK,GAAG;AACrC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,UAAU;AACtC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,UAAU;AACvC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC;AAC/B,EAAE,mBAAmB,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,KAAK,CAAC;AAC/D;;;;"}
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
- import Link from './src/link2.mjs';
3
- export { linkEmits, linkProps } from './src/link.mjs';
2
+ import Link from './src/link.mjs';
3
+ export { linkEmits, linkProps } from './src/link2.mjs';
4
4
  import { withInstall } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const ElLink = withInstall(Link);
@@ -1,27 +1,54 @@
1
- import '../../../utils/index.mjs';
2
- import { buildProps } from '../../../utils/vue/props.mjs';
3
- import { iconPropType } from '../../../utils/vue/icon.mjs';
1
+ import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, renderSlot } from 'vue';
2
+ import { ElIcon } from '../../icon/index.mjs';
3
+ import '../../../hooks/index.mjs';
4
+ import { linkProps, linkEmits } from './link2.mjs';
5
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
4
7
 
5
- const linkProps = buildProps({
6
- type: {
7
- type: String,
8
- values: ["primary", "success", "warning", "info", "danger", "default"],
9
- default: "default"
10
- },
11
- underline: {
12
- type: Boolean,
13
- default: true
14
- },
15
- disabled: { type: Boolean, default: false },
16
- href: { type: String, default: "" },
17
- icon: {
18
- type: iconPropType,
19
- default: ""
8
+ const _hoisted_1 = ["href"];
9
+ const __default__ = {
10
+ name: "ElLink"
11
+ };
12
+ const _sfc_main = /* @__PURE__ */ defineComponent({
13
+ ...__default__,
14
+ props: linkProps,
15
+ emits: linkEmits,
16
+ setup(__props, { emit }) {
17
+ const props = __props;
18
+ const ns = useNamespace("link");
19
+ function handleClick(event) {
20
+ if (!props.disabled)
21
+ emit("click", event);
22
+ }
23
+ return (_ctx, _cache) => {
24
+ return openBlock(), createElementBlock("a", {
25
+ class: normalizeClass([
26
+ unref(ns).b(),
27
+ unref(ns).m(_ctx.type),
28
+ unref(ns).is("disabled", _ctx.disabled),
29
+ unref(ns).is("underline", _ctx.underline && !_ctx.disabled)
30
+ ]),
31
+ href: _ctx.disabled || !_ctx.href ? void 0 : _ctx.href,
32
+ onClick: handleClick
33
+ }, [
34
+ _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
35
+ default: withCtx(() => [
36
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
37
+ ]),
38
+ _: 1
39
+ })) : createCommentVNode("v-if", true),
40
+ _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
41
+ key: 1,
42
+ class: normalizeClass(unref(ns).e("inner"))
43
+ }, [
44
+ renderSlot(_ctx.$slots, "default")
45
+ ], 2)) : createCommentVNode("v-if", true),
46
+ _ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 2 }) : createCommentVNode("v-if", true)
47
+ ], 10, _hoisted_1);
48
+ };
20
49
  }
21
50
  });
22
- const linkEmits = {
23
- click: (evt) => evt instanceof MouseEvent
24
- };
51
+ var Link = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/link/src/link.vue"]]);
25
52
 
26
- export { linkEmits, linkProps };
53
+ export { Link as default };
27
54
  //# sourceMappingURL=link.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"link.mjs","sources":["../../../../../../packages/components/link/src/link.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Link from './link.vue'\n\nexport const linkProps = buildProps({\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'info', 'danger', 'default'],\n default: 'default',\n },\n underline: {\n type: Boolean,\n default: true,\n },\n disabled: { type: Boolean, default: false },\n href: { type: String, default: '' },\n icon: {\n type: iconPropType,\n default: '',\n },\n} as const)\nexport type LinkProps = ExtractPropTypes<typeof linkProps>\n\nexport const linkEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type LinkEmits = typeof linkEmits\n\nexport type LinkInstance = InstanceType<typeof Link>\n"],"names":[],"mappings":";;;;AACY,MAAC,SAAS,GAAG,UAAU,CAAC;AACpC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC;AAC1E,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AAC7C,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC,EAAE;AACS,MAAC,SAAS,GAAG;AACzB,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;"}
1
+ {"version":3,"file":"link.mjs","sources":["../../../../../../packages/components/link/src/link.vue"],"sourcesContent":["<template>\n <a\n :class=\"[\n ns.b(),\n ns.m(type),\n ns.is('disabled', disabled),\n ns.is('underline', underline && !disabled),\n ]\"\n :href=\"disabled || !href ? undefined : href\"\n @click=\"handleClick\"\n >\n <el-icon v-if=\"icon\"><component :is=\"icon\" /></el-icon>\n <span v-if=\"$slots.default\" :class=\"ns.e('inner')\">\n <slot />\n </span>\n\n <slot v-if=\"$slots.icon\" name=\"icon\" />\n </a>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { linkEmits, linkProps } from './link'\n\ndefineOptions({\n name: 'ElLink',\n})\nconst props = defineProps(linkProps)\nconst emit = defineEmits(linkEmits)\n\nconst ns = useNamespace('link')\n\nfunction handleClick(event: MouseEvent) {\n if (!props.disabled) emit('click', event)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA+BA,IAAA,MAAA,EAAA,GAAA,aAAA,MAAA,CAAA,CAAA;AAEA,IAAA,SAAA,WAAA,CAAA,KAAA,EAAA;AACA,MAAA,IAAA,CAAA,KAAA,CAAA,QAAA;AAAA,QAAA,IAAA,CAAA,SAAA,KAAA,CAAA,CAAA;AAAA,KACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,54 +1,27 @@
1
- import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, renderSlot } from 'vue';
2
- import { ElIcon } from '../../icon/index.mjs';
3
- import '../../../hooks/index.mjs';
4
- import { linkProps, linkEmits } from './link.mjs';
5
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
1
+ import '../../../utils/index.mjs';
2
+ import { buildProps } from '../../../utils/vue/props.mjs';
3
+ import { iconPropType } from '../../../utils/vue/icon.mjs';
7
4
 
8
- const _hoisted_1 = ["href"];
9
- const __default__ = {
10
- name: "ElLink"
11
- };
12
- const _sfc_main = /* @__PURE__ */ defineComponent({
13
- ...__default__,
14
- props: linkProps,
15
- emits: linkEmits,
16
- setup(__props, { emit }) {
17
- const props = __props;
18
- const ns = useNamespace("link");
19
- function handleClick(event) {
20
- if (!props.disabled)
21
- emit("click", event);
22
- }
23
- return (_ctx, _cache) => {
24
- return openBlock(), createElementBlock("a", {
25
- class: normalizeClass([
26
- unref(ns).b(),
27
- unref(ns).m(_ctx.type),
28
- unref(ns).is("disabled", _ctx.disabled),
29
- unref(ns).is("underline", _ctx.underline && !_ctx.disabled)
30
- ]),
31
- href: _ctx.disabled || !_ctx.href ? void 0 : _ctx.href,
32
- onClick: handleClick
33
- }, [
34
- _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
35
- default: withCtx(() => [
36
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
37
- ]),
38
- _: 1
39
- })) : createCommentVNode("v-if", true),
40
- _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
41
- key: 1,
42
- class: normalizeClass(unref(ns).e("inner"))
43
- }, [
44
- renderSlot(_ctx.$slots, "default")
45
- ], 2)) : createCommentVNode("v-if", true),
46
- _ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 2 }) : createCommentVNode("v-if", true)
47
- ], 10, _hoisted_1);
48
- };
5
+ const linkProps = buildProps({
6
+ type: {
7
+ type: String,
8
+ values: ["primary", "success", "warning", "info", "danger", "default"],
9
+ default: "default"
10
+ },
11
+ underline: {
12
+ type: Boolean,
13
+ default: true
14
+ },
15
+ disabled: { type: Boolean, default: false },
16
+ href: { type: String, default: "" },
17
+ icon: {
18
+ type: iconPropType,
19
+ default: ""
49
20
  }
50
21
  });
51
- var Link = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/link/src/link.vue"]]);
22
+ const linkEmits = {
23
+ click: (evt) => evt instanceof MouseEvent
24
+ };
52
25
 
53
- export { Link as default };
26
+ export { linkEmits, linkProps };
54
27
  //# sourceMappingURL=link2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"link2.mjs","sources":["../../../../../../packages/components/link/src/link.vue"],"sourcesContent":["<template>\n <a\n :class=\"[\n ns.b(),\n ns.m(type),\n ns.is('disabled', disabled),\n ns.is('underline', underline && !disabled),\n ]\"\n :href=\"disabled || !href ? undefined : href\"\n @click=\"handleClick\"\n >\n <el-icon v-if=\"icon\"><component :is=\"icon\" /></el-icon>\n <span v-if=\"$slots.default\" :class=\"ns.e('inner')\">\n <slot />\n </span>\n\n <slot v-if=\"$slots.icon\" name=\"icon\" />\n </a>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { linkEmits, linkProps } from './link'\n\ndefineOptions({\n name: 'ElLink',\n})\nconst props = defineProps(linkProps)\nconst emit = defineEmits(linkEmits)\n\nconst ns = useNamespace('link')\n\nfunction handleClick(event: MouseEvent) {\n if (!props.disabled) emit('click', event)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA+BA,IAAA,MAAA,EAAA,GAAA,aAAA,MAAA,CAAA,CAAA;AAEA,IAAA,SAAA,WAAA,CAAA,KAAA,EAAA;AACA,MAAA,IAAA,CAAA,KAAA,CAAA,QAAA;AAAA,QAAA,IAAA,CAAA,SAAA,KAAA,CAAA,CAAA;AAAA,KACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"link2.mjs","sources":["../../../../../../packages/components/link/src/link.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Link from './link.vue'\n\nexport const linkProps = buildProps({\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'info', 'danger', 'default'],\n default: 'default',\n },\n underline: {\n type: Boolean,\n default: true,\n },\n disabled: { type: Boolean, default: false },\n href: { type: String, default: '' },\n icon: {\n type: iconPropType,\n default: '',\n },\n} as const)\nexport type LinkProps = ExtractPropTypes<typeof linkProps>\n\nexport const linkEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type LinkEmits = typeof linkEmits\n\nexport type LinkInstance = InstanceType<typeof Link>\n"],"names":[],"mappings":";;;;AACY,MAAC,SAAS,GAAG,UAAU,CAAC;AACpC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC;AAC1E,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AAC7C,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC,EAAE;AACS,MAAC,SAAS,GAAG;AACzB,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;"}
@@ -2,11 +2,11 @@ import '../../utils/index.mjs';
2
2
  import Menu from './src/menu.mjs';
3
3
  export { menuEmits, menuProps } from './src/menu.mjs';
4
4
  import MenuItem from './src/menu-item.mjs';
5
- import MenuItemGroup from './src/menu-item-group.mjs';
5
+ import MenuItemGroup from './src/menu-item-group2.mjs';
6
6
  import SubMenu from './src/sub-menu.mjs';
7
7
  export { subMenuProps } from './src/sub-menu.mjs';
8
8
  export { menuItemEmits, menuItemProps } from './src/menu-item2.mjs';
9
- export { menuItemGroupProps } from './src/menu-item-group2.mjs';
9
+ export { menuItemGroupProps } from './src/menu-item-group.mjs';
10
10
  import './src/types.mjs';
11
11
  import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
12
12