vue-devui 1.0.0-rc.0 → 1.0.0-rc.11

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 (353) hide show
  1. package/README.md +78 -116
  2. package/alert/index.es.js +74 -45
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8190 -296
  6. package/auto-complete/index.umd.js +29 -1
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +153 -146
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +34 -5
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5741 -127
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +63 -35
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8068 -255
  21. package/checkbox/index.umd.js +27 -1
  22. package/checkbox/style.css +1 -1
  23. package/{accordion → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +379 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{anchor → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +5 -7
  29. package/countdown/index.umd.js +1 -1
  30. package/date-picker/index.es.js +8167 -288
  31. package/date-picker/index.umd.js +27 -1
  32. package/date-picker/style.css +1 -1
  33. package/drawer/index.es.js +31 -4
  34. package/drawer/index.umd.js +1 -1
  35. package/drawer/style.css +1 -1
  36. package/dropdown/index.es.js +297 -181
  37. package/dropdown/index.umd.js +1 -1
  38. package/dropdown/style.css +1 -1
  39. package/editable-select/index.es.js +525 -154
  40. package/editable-select/index.umd.js +1 -1
  41. package/editable-select/style.css +1 -1
  42. package/form/index.es.js +1048 -1176
  43. package/form/index.umd.js +16 -16
  44. package/form/style.css +1 -1
  45. package/fullscreen/index.es.js +42 -21
  46. package/fullscreen/index.umd.js +1 -1
  47. package/fullscreen/style.css +1 -1
  48. package/grid/index.es.js +101 -86
  49. package/grid/index.umd.js +1 -1
  50. package/grid/style.css +1 -1
  51. package/icon/index.es.js +197 -56
  52. package/icon/index.umd.js +1 -1
  53. package/icon/style.css +1 -0
  54. package/image-preview/index.es.js +55 -31
  55. package/image-preview/index.umd.js +1 -1
  56. package/image-preview/style.css +1 -1
  57. package/input/index.es.js +8074 -144
  58. package/input/index.umd.js +27 -1
  59. package/input/style.css +1 -1
  60. package/input-number/index.es.js +269 -183
  61. package/input-number/index.umd.js +1 -1
  62. package/input-number/style.css +1 -1
  63. package/layout/index.es.js +40 -25
  64. package/layout/index.umd.js +1 -1
  65. package/layout/style.css +1 -1
  66. package/loading/index.es.js +74 -35
  67. package/loading/index.umd.js +1 -1
  68. package/loading/style.css +1 -1
  69. package/modal/index.es.js +412 -204
  70. package/modal/index.umd.js +1 -1
  71. package/modal/style.css +1 -1
  72. package/notification/index.es.js +307 -57
  73. package/notification/index.umd.js +1 -1
  74. package/notification/style.css +1 -1
  75. package/nuxt/components/ButtonGroup.js +3 -0
  76. package/nuxt/components/CheckboxButton.js +3 -0
  77. package/nuxt/components/CheckboxGroup.js +3 -0
  78. package/nuxt/components/Collapse.js +3 -0
  79. package/nuxt/components/CollapseItem.js +3 -0
  80. package/nuxt/components/DropdownPropsKey.js +3 -0
  81. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  82. package/nuxt/components/FORM_TOKEN.js +3 -0
  83. package/nuxt/components/Icon.js +1 -0
  84. package/nuxt/components/IconGroup.js +3 -0
  85. package/nuxt/components/LABEL_DATA.js +3 -0
  86. package/nuxt/components/LoadingOptions.js +3 -0
  87. package/nuxt/components/Option.js +3 -0
  88. package/nuxt/components/PanelBody.js +3 -0
  89. package/nuxt/components/PanelFooter.js +3 -0
  90. package/nuxt/components/PanelHeader.js +3 -0
  91. package/nuxt/components/RadioButton.js +3 -0
  92. package/nuxt/components/TABLE_TOKEN.js +3 -0
  93. package/nuxt/components/Tab.js +3 -0
  94. package/nuxt/components/TimeSelect.js +3 -0
  95. package/nuxt/components/Timeline.js +3 -0
  96. package/nuxt/components/TimelineItem.js +3 -0
  97. package/nuxt/components/alertProps.js +3 -0
  98. package/nuxt/components/autoCompleteProps.js +3 -0
  99. package/nuxt/components/avatarProps.js +3 -0
  100. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  101. package/nuxt/components/buttonGroupProps.js +3 -0
  102. package/nuxt/components/cardProps.js +3 -0
  103. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  104. package/nuxt/components/checkboxGroupProps.js +3 -0
  105. package/nuxt/components/checkboxProps.js +3 -0
  106. package/nuxt/components/colProps.js +3 -0
  107. package/nuxt/components/colPropsBaseClass.js +3 -0
  108. package/nuxt/components/colPropsBaseStyle.js +3 -0
  109. package/nuxt/components/collapseItemProps.js +3 -0
  110. package/nuxt/components/collapseProps.js +3 -0
  111. package/nuxt/components/countdownProps.js +3 -0
  112. package/nuxt/components/editableSelectProps.js +3 -0
  113. package/nuxt/components/formItemProps.js +3 -0
  114. package/nuxt/components/formProps.js +3 -0
  115. package/nuxt/components/fullscreenProps.js +3 -0
  116. package/nuxt/components/iconProps.js +3 -0
  117. package/nuxt/components/imagePreviewProps.js +3 -0
  118. package/nuxt/components/inputProps.js +3 -0
  119. package/nuxt/components/loadingProps.js +3 -0
  120. package/nuxt/components/modalProps.js +3 -0
  121. package/nuxt/components/paginationProps.js +3 -0
  122. package/nuxt/components/panelProps.js +3 -0
  123. package/nuxt/components/progressProps.js +3 -0
  124. package/nuxt/components/rateProps.js +3 -0
  125. package/nuxt/components/resultProps.js +3 -0
  126. package/nuxt/components/rowProps.js +3 -0
  127. package/nuxt/components/screenSizes.js +3 -0
  128. package/nuxt/components/searchProps.js +3 -0
  129. package/nuxt/components/skeletonProps.js +3 -0
  130. package/nuxt/components/sliderProps.js +3 -0
  131. package/nuxt/components/splitterProps.js +3 -0
  132. package/nuxt/components/statisticProps.js +3 -0
  133. package/nuxt/components/svgIconProps.js +3 -0
  134. package/nuxt/components/switchProps.js +3 -0
  135. package/nuxt/components/tableProps.js +3 -0
  136. package/nuxt/components/tabsProps.js +3 -0
  137. package/nuxt/components/tagProps.js +3 -0
  138. package/nuxt/components/textareaProps.js +3 -0
  139. package/nuxt/components/timeAxisProps.js +3 -0
  140. package/nuxt/components/treeProps.js +3 -0
  141. package/overlay/index.es.js +127 -149
  142. package/overlay/index.umd.js +1 -1
  143. package/overlay/style.css +1 -1
  144. package/package.json +11 -44
  145. package/pagination/index.es.js +158 -148
  146. package/pagination/index.umd.js +1 -1
  147. package/pagination/style.css +1 -1
  148. package/panel/index.es.js +45 -32
  149. package/panel/index.umd.js +1 -1
  150. package/panel/style.css +1 -1
  151. package/popover/index.es.js +317 -246
  152. package/popover/index.umd.js +15 -15
  153. package/popover/style.css +1 -1
  154. package/progress/index.es.js +110 -56
  155. package/progress/index.umd.js +3 -3
  156. package/progress/style.css +1 -1
  157. package/radio/index.es.js +7972 -157
  158. package/radio/index.umd.js +27 -1
  159. package/radio/style.css +1 -1
  160. package/rate/index.es.js +77 -55
  161. package/rate/index.umd.js +1 -1
  162. package/rate/style.css +1 -1
  163. package/result/index.es.js +184 -57
  164. package/result/index.umd.js +1 -1
  165. package/result/style.css +1 -1
  166. package/ripple/index.es.js +47 -42
  167. package/ripple/index.umd.js +1 -1
  168. package/search/index.es.js +3653 -1122
  169. package/search/index.umd.js +18 -18
  170. package/search/style.css +1 -1
  171. package/select/index.es.js +9170 -596
  172. package/select/index.umd.js +27 -1
  173. package/select/style.css +1 -1
  174. package/skeleton/index.es.js +63 -41
  175. package/skeleton/index.umd.js +1 -1
  176. package/skeleton/style.css +1 -1
  177. package/slider/index.es.js +144 -137
  178. package/slider/index.umd.js +1 -1
  179. package/slider/style.css +1 -1
  180. package/splitter/index.es.js +469 -349
  181. package/splitter/index.umd.js +15 -15
  182. package/splitter/style.css +1 -1
  183. package/statistic/index.es.js +41 -34
  184. package/statistic/index.umd.js +1 -1
  185. package/statistic/style.css +1 -1
  186. package/status/index.es.js +27 -6
  187. package/status/index.umd.js +1 -1
  188. package/status/style.css +1 -1
  189. package/style.css +1 -1
  190. package/switch/index.es.js +7802 -64
  191. package/switch/index.umd.js +27 -1
  192. package/switch/style.css +1 -1
  193. package/table/index.es.js +10459 -1511
  194. package/table/index.umd.js +27 -1
  195. package/table/style.css +1 -1
  196. package/tabs/index.es.js +344 -141
  197. package/tabs/index.umd.js +1 -1
  198. package/tabs/style.css +1 -1
  199. package/tag/index.es.js +49 -24
  200. package/tag/index.umd.js +1 -1
  201. package/tag/style.css +1 -1
  202. package/textarea/index.es.js +7921 -83
  203. package/textarea/index.umd.js +35 -1
  204. package/textarea/style.css +1 -1
  205. package/{anchor → time-select}/index.d.ts +0 -0
  206. package/{color-picker → time-select}/index.es.js +4171 -2898
  207. package/time-select/index.umd.js +27 -0
  208. package/{breadcrumb → time-select}/package.json +1 -1
  209. package/time-select/style.css +1 -0
  210. package/{back-top → timeline}/index.d.ts +0 -0
  211. package/timeline/index.es.js +425 -0
  212. package/timeline/index.umd.js +1 -0
  213. package/{back-top → timeline}/package.json +1 -1
  214. package/timeline/style.css +1 -0
  215. package/tooltip/index.es.js +308 -236
  216. package/tooltip/index.umd.js +15 -15
  217. package/tooltip/style.css +1 -1
  218. package/tree/index.es.js +5198 -1850
  219. package/tree/index.umd.js +18 -18
  220. package/tree/style.css +1 -1
  221. package/upload/index.es.js +427 -132
  222. package/upload/index.umd.js +1 -1
  223. package/upload/style.css +1 -1
  224. package/vue-devui.es.js +12064 -15841
  225. package/vue-devui.umd.js +30 -20
  226. package/accordion/index.es.js +0 -720
  227. package/accordion/index.umd.js +0 -1
  228. package/accordion/package.json +0 -7
  229. package/accordion/style.css +0 -1
  230. package/anchor/index.es.js +0 -263
  231. package/anchor/index.umd.js +0 -1
  232. package/anchor/style.css +0 -1
  233. package/back-top/index.es.js +0 -128
  234. package/back-top/index.umd.js +0 -1
  235. package/back-top/style.css +0 -1
  236. package/breadcrumb/index.d.ts +0 -7
  237. package/breadcrumb/index.es.js +0 -127
  238. package/breadcrumb/index.umd.js +0 -1
  239. package/breadcrumb/style.css +0 -1
  240. package/carousel/index.d.ts +0 -7
  241. package/carousel/index.es.js +0 -329
  242. package/carousel/index.umd.js +0 -1
  243. package/carousel/package.json +0 -7
  244. package/carousel/style.css +0 -1
  245. package/cascader/index.d.ts +0 -7
  246. package/cascader/index.es.js +0 -5963
  247. package/cascader/index.umd.js +0 -27
  248. package/cascader/package.json +0 -7
  249. package/cascader/style.css +0 -1
  250. package/color-picker/index.d.ts +0 -7
  251. package/color-picker/index.umd.js +0 -27
  252. package/color-picker/package.json +0 -7
  253. package/color-picker/style.css +0 -1
  254. package/comment/index.d.ts +0 -7
  255. package/comment/index.es.js +0 -86
  256. package/comment/index.umd.js +0 -1
  257. package/comment/package.json +0 -7
  258. package/comment/style.css +0 -1
  259. package/dragdrop/index.d.ts +0 -7
  260. package/dragdrop/index.es.js +0 -157
  261. package/dragdrop/index.umd.js +0 -1
  262. package/dragdrop/package.json +0 -7
  263. package/gantt/index.d.ts +0 -7
  264. package/gantt/index.es.js +0 -523
  265. package/gantt/index.umd.js +0 -1
  266. package/gantt/package.json +0 -7
  267. package/gantt/style.css +0 -1
  268. package/input-icon/index.d.ts +0 -7
  269. package/input-icon/index.es.js +0 -331
  270. package/input-icon/index.umd.js +0 -1
  271. package/input-icon/package.json +0 -7
  272. package/input-icon/style.css +0 -1
  273. package/list/index.d.ts +0 -7
  274. package/list/index.es.js +0 -39
  275. package/list/index.umd.js +0 -1
  276. package/list/package.json +0 -7
  277. package/list/style.css +0 -1
  278. package/nav-sprite/index.d.ts +0 -7
  279. package/nav-sprite/index.es.js +0 -68
  280. package/nav-sprite/index.umd.js +0 -1
  281. package/nav-sprite/package.json +0 -7
  282. package/nuxt/components/Accordion.js +0 -3
  283. package/nuxt/components/Anchor.js +0 -3
  284. package/nuxt/components/BackTop.js +0 -3
  285. package/nuxt/components/Breadcrumb.js +0 -3
  286. package/nuxt/components/Carousel.js +0 -3
  287. package/nuxt/components/CarouselItem.js +0 -3
  288. package/nuxt/components/Cascader.js +0 -3
  289. package/nuxt/components/ColorPicker.js +0 -3
  290. package/nuxt/components/Comment.js +0 -3
  291. package/nuxt/components/FormControl.js +0 -3
  292. package/nuxt/components/FormLabel.js +0 -3
  293. package/nuxt/components/Gantt.js +0 -3
  294. package/nuxt/components/InputIcon.js +0 -3
  295. package/nuxt/components/List.js +0 -3
  296. package/nuxt/components/ListItem.js +0 -3
  297. package/nuxt/components/NavSprite.js +0 -2
  298. package/nuxt/components/QuadrantDiagram.js +0 -3
  299. package/nuxt/components/ReadTip.js +0 -3
  300. package/nuxt/components/StepsGuide.js +0 -3
  301. package/nuxt/components/Sticky.js +0 -2
  302. package/nuxt/components/TagInput.js +0 -3
  303. package/nuxt/components/TimeAxis.js +0 -3
  304. package/nuxt/components/TimeAxisItem.js +0 -3
  305. package/nuxt/components/TimePicker.js +0 -3
  306. package/nuxt/components/Transfer.js +0 -3
  307. package/nuxt/components/TreeSelect.js +0 -3
  308. package/nuxt/components/overlayEmits.js +0 -3
  309. package/nuxt/components/overlayProps.js +0 -3
  310. package/quadrant-diagram/index.d.ts +0 -7
  311. package/quadrant-diagram/index.es.js +0 -5728
  312. package/quadrant-diagram/index.umd.js +0 -27
  313. package/quadrant-diagram/package.json +0 -7
  314. package/quadrant-diagram/style.css +0 -1
  315. package/read-tip/index.d.ts +0 -7
  316. package/read-tip/index.es.js +0 -258
  317. package/read-tip/index.umd.js +0 -1
  318. package/read-tip/package.json +0 -7
  319. package/read-tip/style.css +0 -1
  320. package/steps-guide/index.d.ts +0 -7
  321. package/steps-guide/index.es.js +0 -239
  322. package/steps-guide/index.umd.js +0 -1
  323. package/steps-guide/package.json +0 -7
  324. package/steps-guide/style.css +0 -1
  325. package/sticky/index.d.ts +0 -7
  326. package/sticky/index.es.js +0 -197
  327. package/sticky/index.umd.js +0 -1
  328. package/sticky/package.json +0 -7
  329. package/tag-input/index.d.ts +0 -7
  330. package/tag-input/index.es.js +0 -329
  331. package/tag-input/index.umd.js +0 -1
  332. package/tag-input/package.json +0 -7
  333. package/tag-input/style.css +0 -1
  334. package/time-axis/index.d.ts +0 -7
  335. package/time-axis/index.es.js +0 -299
  336. package/time-axis/index.umd.js +0 -1
  337. package/time-axis/package.json +0 -7
  338. package/time-axis/style.css +0 -1
  339. package/time-picker/index.d.ts +0 -7
  340. package/time-picker/index.es.js +0 -1237
  341. package/time-picker/index.umd.js +0 -1
  342. package/time-picker/package.json +0 -7
  343. package/time-picker/style.css +0 -1
  344. package/transfer/index.d.ts +0 -7
  345. package/transfer/index.es.js +0 -7608
  346. package/transfer/index.umd.js +0 -27
  347. package/transfer/package.json +0 -7
  348. package/transfer/style.css +0 -1
  349. package/tree-select/index.d.ts +0 -7
  350. package/tree-select/index.es.js +0 -623
  351. package/tree-select/index.umd.js +0 -1
  352. package/tree-select/package.json +0 -7
  353. package/tree-select/style.css +0 -1
@@ -1,4 +1,4 @@
1
- import { createVNode, defineComponent, toRefs, ref, watch } from "vue";
1
+ import { createVNode, defineComponent, toRefs, ref, computed, watch } from "vue";
2
2
  const IconBody = (props) => {
3
3
  const {
4
4
  width,
@@ -26,7 +26,7 @@ const IconBody = (props) => {
26
26
  "cy": "15",
27
27
  "r": "15"
28
28
  }, null), createVNode("path", {
29
- "d": "M14.9997866,16 C12.5145053,16 10.4997866,13.9852814 10.4997866,11.5 C10.4997866,9.01471863 12.5145053,7 14.9997866,7 C17.485068,7 19.4997866,9.01471863 19.4997866,11.5 C19.4997866,13.9852814 17.485068,16 14.9997866,16 Z M23,23 L7,22.998553 C7,19.0122153 10.8892296,16.5 14.9997866,16.5 C19.1103437,16.5 23,20 23,23 Z",
29
+ "d": "M14.9997866,16 C12.5145053,16 10.4997866,13.9852814 10.4997866, 11.5 C10.4997866,9.01471863 12.5145053,7 14.9997866,7 C17.485068, 7 19.4997866,9.01471863 19.4997866,11.5 C19.4997866,13.9852814 17.485068, 16 14.9997866,16 Z M23,23 L7,22.998553 C7,19.0122153 10.8892296, 16.5 14.9997866,16.5 C19.1103437,16.5 23,20 23,23 Z",
30
30
  "id": "\u5F62\u72B6\u7ED3\u5408",
31
31
  "fill": "#FFFFFF"
32
32
  }, null)])]);
@@ -74,11 +74,11 @@ const IconNobody = (props) => {
74
74
  "fill": "none",
75
75
  "fill-rule": "evenodd"
76
76
  }, [createVNode("path", {
77
- "d": "M22.31,19.2474562 L22.31,21.9974562 L20.81,21.9974562 L20.81,19.2474562 L18.06,19.2474562 L18.06,17.7474562 L20.81,17.7474562 L20.81,14.9974562 L22.31,14.9974562 L22.31,17.7474562 L25.06,17.7474562 L25.06,19.2474562 L22.31,19.2474562 Z M14.9297866,14.9974562 C12.4445053,14.9974562 10.4297866,12.9827376 10.4297866,10.4974562 C10.4297866,8.01217483 12.4445053,5.9974562 14.9297866,5.9974562 C17.415068,5.9974562 19.4297866,8.01217483 19.4297866,10.4974562 C19.4297866,12.9827376 17.415068,14.9974562 14.9297866,14.9974562 Z M19.6797866,20.2474562 L19.6797866,21.9971623 L6.93,21.9960092 C6.93,18.0096715 10.8192296,15.4974562 14.9297866,15.4974562 C16.4608397,15.4974562 17.9612467,15.983021 19.2414296,16.7474562 L17.06,16.7474562 L17.06,20.2474562 L19.6797866,20.2474562 Z",
77
+ "d": "M22.31,19.2474562 L22.31,21.9974562 L20.81,21.9974562 L20.81, 19.2474562 L18.06,19.2474562 L18.06,17.7474562 L20.81,17.7474562 L20.81, 14.9974562 L22.31,14.9974562 L22.31,17.7474562 L25.06,17.7474562 L25.06, 19.2474562 L22.31,19.2474562 Z M14.9297866,14.9974562 C12.4445053, 14.9974562 10.4297866,12.9827376 10.4297866,10.4974562 C10.4297866, 8.01217483 12.4445053,5.9974562 14.9297866,5.9974562 C17.415068, 5.9974562 19.4297866,8.01217483 19.4297866,10.4974562 C19.4297866, 12.9827376 17.415068,14.9974562 14.9297866,14.9974562 Z M19.6797866, 20.2474562 L19.6797866,21.9971623 L6.93,21.9960092 C6.93,18.0096715 10.8192296, 15.4974562 14.9297866,15.4974562 C16.4608397,15.4974562 17.9612467,15.983021 19.2414296, 16.7474562 L17.06,16.7474562 L17.06,20.2474562 L19.6797866,20.2474562 Z",
78
78
  "id": "\u5F62\u72B6\u7ED3\u5408",
79
79
  "fill": "#959EB2"
80
80
  }, null), createVNode("path", {
81
- "d": "M0,15 L1,15 C1,15.6118966 1.03919561,16.2186526 1.11683409,16.8178549 L0.125124012,16.9463505 C0.0425740367,16.309242 0,15.6595925 0,15 Z M0.503241262,18.867175 L1.46961749,18.6100428 C1.62594651,19.1975718 1.8203704,19.7729973 2.05141295,20.3332823 L1.12693074,20.7145074 C0.880599065,20.1171459 0.67172715,19.500393 0.503241262,18.867175 Z M1.99122134,22.4730778 L2.85786221,21.9741453 C3.16078316,22.5003161 3.49772502,23.0063252 3.86631639,23.4889602 L3.0715754,24.0959089 C2.6777461,23.5802273 2.31659753,23.0382531 1.99122134,22.4730778 Z M4.38894559,25.6021078 L5.09634867,24.8952974 C5.52582519,25.3251341 5.98272136,25.7268214 6.46397085,26.0975793 L5.85367498,26.8897529 C5.33779918,26.4923186 4.84851395,26.0620615 4.38894559,25.6021078 Z M7.4424647,27.9597887 L7.94703323,27.096417 C8.47111119,27.4026968 9.0146817,27.6746032 9.57453904,27.9101878 L9.18668461,28.8319084 C8.58423501,28.5784013 8.00181692,28.2866833 7.4424647,27.9597887 Z M11.0671021,29.4791103 L11.3286494,28.5139196 C11.9126912,28.6721832 12.5080563,28.7925378 13.1119738,28.8738935 L12.9784667,29.8649413 C12.3271613,29.7772019 11.6891102,29.647662 11.0671021,29.4791103 Z M15,30 C14.9951965,30 14.9903936,29.9999977 14.9855912,30 L14.9865313,28.9999937 C14.9929361,28.9999987 14.9929361,28.9999987 14.999296,29 C15.6071552,29 16.2093364,28.9614092 16.8041774,28.8849313 L16.9316965,29.8767674 C16.2992813,29.9580762 15.6545362,30 15,30 Z M18.8545762,29.5001051 L18.5982903,28.5335041 C19.1860387,28.3776677 19.7617059,28.1837179 20.3222555,27.9531286 L20.7026875,28.8779375 C20.1050484,29.123784 19.4880358,29.3321488 18.8545762,29.5001051 Z M22.4608087,28.0158343 L21.9626951,27.1487226 C22.4893928,26.8461604 22.9959399,26.5095265 23.479119,26.1411926 L24.0853678,26.9364676 C23.5691101,27.3300178 23.0265585,27.6908386 22.4608087,28.0158343 Z M25.5921583,25.6209863 L24.8860071,24.9129252 C25.3161421,24.4839504 25.7181674,24.0275419 26.0893023,23.5467621 L26.8808873,24.1578212 C26.4830546,24.6731862 26.0524368,25.1619493 25.5921583,25.6209863 Z M27.9526445,22.5697466 L27.0897495,22.0643633 C27.3964738,21.5406601 27.6688549,20.9974409 27.904942,20.4379104 L28.8262855,20.8266601 C28.5722411,21.4287497 28.2800163,22.0107897 27.9526445,22.5697466 Z M29.4756977,18.9454696 L28.5107363,18.6830777 C28.6695136,18.099165 28.7903877,17.5039035 28.8722662,16.9000659 L29.8631978,17.0344333 C29.7748946,17.6856516 29.6447979,18.3235936 29.4756977,18.9454696 Z M30,15 C30,15.0093541 29.9999914,15.0187063 29.9999743,15.0280564 L28.999976,15.0262257 C28.9999956,15.0134169 28.9999956,15.0134169 29,15.0006466 C29,14.3970304 28.9619395,13.7989704 28.8865088,13.208136 L29.8784576,13.0814959 C29.9586571,13.7096843 30,14.3500145 30,15 Z M29.5038108,11.1594275 L28.5369608,11.4147728 C28.3816616,10.8267413 28.1882232,10.2507676 27.9581175,9.68988857 L28.8832852,9.31033004 C29.1286141,9.90831524 29.3364318,10.5256569 29.5038108,11.1594275 Z M28.0228788,7.55146763 L27.1552968,8.0487618 C26.853241,7.52179373 26.5170958,7.0149453 26.1492295,6.53143425 L26.9450761,5.92593594 C27.3381231,6.44254364 27.6984223,6.98541919 28.0228788,7.55146763 Z M25.6309089,4.41780044 L24.9221905,5.12329189 C24.4935639,4.69270467 24.0374698,4.2902078 23.5569705,3.9185855 L24.1687554,3.12756133 C24.6838129,3.52591118 25.1722392,3.95703271 25.6309089,4.41780044 Z M22.5819506,2.05451093 L22.0757531,2.91692851 C21.5523008,2.60968727 21.0092999,2.33677531 20.4499564,2.10014728 L20.8395722,1.17916981 C21.4414531,1.43379309 22.0232574,1.72658499 22.5819506,2.05451093 Z M18.9594329,0.528106464 L18.696103,1.4928123 C18.1122842,1.33345081 17.517086,1.21199245 16.9132846,1.12953261 L17.0485964,0.138729543 C17.6997753,0.227659622 18.3376514,0.358382523 18.9594329,0.528106464 Z M15,-1.11022302e-16 C15.0139048,-1.11022302e-16 15.0278052,1.892004e-05 15.0417011,5.673578e-05 L15.0389797,1.00005303 C15.0197685,1.00000934 15.0197685,1.00000934 15.0005868,1.00000001 C14.4012162,1 13.8072783,1.03753392 13.2204527,1.11192427 L13.0946918,0.119863691 C13.7186509,0.0407660189 14.3545651,-1.11022302e-16 15,-1.11022302e-16 Z M11.1720354,0.492865376 L11.4265338,1.45993857 C10.8386468,1.61464899 10.2627801,1.80746996 9.70196444,2.03693489 L9.32327455,1.11141127 C9.92118954,0.86676666 10.5384173,0.659610554 11.1720354,0.492865376 Z M7.56375123,1.97008801 L8.06022548,2.83813946 C7.53298826,3.13968806 7.02583975,3.47534367 6.54199783,3.84274131 L5.93725081,3.04632368 C6.4542073,2.65378102 6.99740556,2.29400434 7.56375123,1.97008801 Z M4.42776842,4.35917772 L5.13259949,5.06855291 C4.70156141,5.49682984 4.29859416,5.95260763 3.92648544,6.43282469 L3.13602297,5.82031423 C3.53488885,5.30556625 3.96651291,4.81747851 4.42776842,4.35917772 Z M2.0616775,7.40585279 L2.92361696,7.91286401 C2.61586086,8.43606175 2.34241977,8.97884042 2.10525197,9.53799293 L1.18464153,9.14751063 C1.43984243,8.54584288 1.73319965,7.96427837 2.0616775,7.40585279 Z M0.531541456,11.0280046 L1.49601653,11.2921785 C1.33614878,11.8758413 1.21417484,12.4709081 1.13119244,13.074601 L0.140507978,12.9384235 C0.230001486,12.2873626 0.361276825,11.6496255 0.531541456,11.0280046 Z",
81
+ "d": "M0,15 L1,15 C1,15.6118966 1.03919561,16.2186526 1.11683409, 16.8178549 L0.125124012,16.9463505 C0.0425740367,16.309242 0, 15.6595925 0,15 Z M0.503241262,18.867175 L1.46961749,18.6100428 C1.62594651, 19.1975718 1.8203704,19.7729973 2.05141295,20.3332823 L1.12693074, 20.7145074 C0.880599065,20.1171459 0.67172715,19.500393 0.503241262, 18.867175 Z M1.99122134,22.4730778 L2.85786221,21.9741453 C3.16078316, 22.5003161 3.49772502,23.0063252 3.86631639,23.4889602 L3.0715754, 24.0959089 C2.6777461,23.5802273 2.31659753,23.0382531 1.99122134, 22.4730778 Z M4.38894559,25.6021078 L5.09634867,24.8952974 C5.52582519, 25.3251341 5.98272136,25.7268214 6.46397085,26.0975793 L5.85367498, 26.8897529 C5.33779918,26.4923186 4.84851395,26.0620615 4.38894559, 25.6021078 Z M7.4424647,27.9597887 L7.94703323,27.096417 C8.47111119, 27.4026968 9.0146817,27.6746032 9.57453904,27.9101878 L9.18668461, 28.8319084 C8.58423501,28.5784013 8.00181692,28.2866833 7.4424647, 27.9597887 Z M11.0671021,29.4791103 L11.3286494,28.5139196 C11.9126912, 28.6721832 12.5080563,28.7925378 13.1119738,28.8738935 L12.9784667, 29.8649413 C12.3271613,29.7772019 11.6891102,29.647662 11.0671021, 29.4791103 Z M15,30 C14.9951965,30 14.9903936,29.9999977 14.9855912, 30 L14.9865313,28.9999937 C14.9929361,28.9999987 14.9929361, 28.9999987 14.999296,29 C15.6071552,29 16.2093364,28.9614092 16.8041774, 28.8849313 L16.9316965,29.8767674 C16.2992813,29.9580762 15.6545362, 30 15,30 Z M18.8545762,29.5001051 L18.5982903,28.5335041 C19.1860387, 28.3776677 19.7617059,28.1837179 20.3222555,27.9531286 L20.7026875, 28.8779375 C20.1050484,29.123784 19.4880358,29.3321488 18.8545762, 29.5001051 Z M22.4608087,28.0158343 L21.9626951,27.1487226 C22.4893928, 26.8461604 22.9959399,26.5095265 23.479119,26.1411926 L24.0853678, 26.9364676 C23.5691101,27.3300178 23.0265585,27.6908386 22.4608087, 28.0158343 Z M25.5921583,25.6209863 L24.8860071,24.9129252 C25.3161421, 24.4839504 25.7181674,24.0275419 26.0893023,23.5467621 L26.8808873, 24.1578212 C26.4830546,24.6731862 26.0524368,25.1619493 25.5921583, 25.6209863 Z M27.9526445,22.5697466 L27.0897495,22.0643633 C27.3964738, 21.5406601 27.6688549,20.9974409 27.904942,20.4379104 L28.8262855, 20.8266601 C28.5722411,21.4287497 28.2800163,22.0107897 27.9526445, 22.5697466 Z M29.4756977,18.9454696 L28.5107363,18.6830777 C28.6695136, 18.099165 28.7903877,17.5039035 28.8722662,16.9000659 L29.8631978, 17.0344333 C29.7748946,17.6856516 29.6447979,18.3235936 29.4756977, 18.9454696 Z M30,15 C30,15.0093541 29.9999914,15.0187063 29.9999743, 15.0280564 L28.999976,15.0262257 C28.9999956,15.0134169 28.9999956, 15.0134169 29,15.0006466 C29,14.3970304 28.9619395,13.7989704 28.8865088, 13.208136 L29.8784576,13.0814959 C29.9586571,13.7096843 30,14.3500145 30, 15 Z M29.5038108,11.1594275 L28.5369608,11.4147728 C28.3816616, 10.8267413 28.1882232,10.2507676 27.9581175,9.68988857 L28.8832852, 9.31033004 C29.1286141,9.90831524 29.3364318,10.5256569 29.5038108, 11.1594275 Z M28.0228788,7.55146763 L27.1552968,8.0487618 C26.853241, 7.52179373 26.5170958,7.0149453 26.1492295,6.53143425 L26.9450761, 5.92593594 C27.3381231,6.44254364 27.6984223,6.98541919 28.0228788, 7.55146763 Z M25.6309089,4.41780044 L24.9221905,5.12329189 C24.4935639, 4.69270467 24.0374698,4.2902078 23.5569705,3.9185855 L24.1687554, 3.12756133 C24.6838129,3.52591118 25.1722392,3.95703271 25.6309089, 4.41780044 Z M22.5819506,2.05451093 L22.0757531,2.91692851 C21.5523008, 2.60968727 21.0092999,2.33677531 20.4499564,2.10014728 L20.8395722, 1.17916981 C21.4414531,1.43379309 22.0232574,1.72658499 22.5819506, 2.05451093 Z M18.9594329,0.528106464 L18.696103,1.4928123 C18.1122842, 1.33345081 17.517086,1.21199245 16.9132846,1.12953261 L17.0485964, 0.138729543 C17.6997753,0.227659622 18.3376514,0.358382523 18.9594329, 0.528106464 Z M15,-1.11022302e-16 C15.0139048,-1.11022302e-16 15.0278052, 1.892004e-05 15.0417011,5.673578e-05 L15.0389797,1.00005303 C15.0197685, 1.00000934 15.0197685,1.00000934 15.0005868,1.00000001 C14.4012162, 1 13.8072783,1.03753392 13.2204527,1.11192427 L13.0946918,0.119863691 C13.7186509, 0.0407660189 14.3545651,-1.11022302e-16 15,-1.11022302e-16 Z M11.1720354, 0.492865376 L11.4265338,1.45993857 C10.8386468,1.61464899 10.2627801, 1.80746996 9.70196444,2.03693489 L9.32327455,1.11141127 C9.92118954, 0.86676666 10.5384173,0.659610554 11.1720354,0.492865376 Z M7.56375123, 1.97008801 L8.06022548,2.83813946 C7.53298826,3.13968806 7.02583975, 3.47534367 6.54199783,3.84274131 L5.93725081,3.04632368 C6.4542073, 2.65378102 6.99740556,2.29400434 7.56375123,1.97008801 Z M4.42776842, 4.35917772 L5.13259949,5.06855291 C4.70156141,5.49682984 4.29859416, 5.95260763 3.92648544,6.43282469 L3.13602297,5.82031423 C3.53488885, 5.30556625 3.96651291,4.81747851 4.42776842,4.35917772 Z M2.0616775, 7.40585279 L2.92361696,7.91286401 C2.61586086,8.43606175 2.34241977, 8.97884042 2.10525197,9.53799293 L1.18464153,9.14751063 C1.43984243, 8.54584288 1.73319965,7.96427837 2.0616775,7.40585279 Z M0.531541456, 11.0280046 L1.49601653,11.2921785 C1.33614878,11.8758413 1.21417484, 12.4709081 1.13119244,13.074601 L0.140507978,12.9384235 C0.230001486, 12.2873626 0.361276825,11.6496255 0.531541456,11.0280046 Z",
82
82
  "id": "\u8499\u7248",
83
83
  "fill": "#CACFD8",
84
84
  "fill-rule": "nonzero"
@@ -107,39 +107,63 @@ var AvatarNoBodyIcon = defineComponent({
107
107
  }, null);
108
108
  }
109
109
  });
110
+ const avatarProps = {
111
+ name: {
112
+ type: String,
113
+ default: null
114
+ },
115
+ gender: {
116
+ type: String,
117
+ default: null
118
+ },
119
+ width: {
120
+ type: Number,
121
+ default: 36
122
+ },
123
+ height: {
124
+ type: Number,
125
+ default: 36
126
+ },
127
+ isRound: {
128
+ type: Boolean,
129
+ default: true
130
+ },
131
+ imgSrc: {
132
+ type: String,
133
+ default: ""
134
+ },
135
+ customText: {
136
+ type: String,
137
+ default: null
138
+ }
139
+ };
140
+ function createBem(namespace, element, modifier) {
141
+ let cls = namespace;
142
+ if (element) {
143
+ cls += `__${element}`;
144
+ }
145
+ if (modifier) {
146
+ cls += `--${modifier}`;
147
+ }
148
+ return cls;
149
+ }
150
+ function useNamespace(block, needDot = false) {
151
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
152
+ const b = () => createBem(namespace);
153
+ const e = (element) => element ? createBem(namespace, element) : "";
154
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
155
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
156
+ return {
157
+ b,
158
+ e,
159
+ m,
160
+ em
161
+ };
162
+ }
110
163
  var avatar = "";
111
164
  var Avatar = defineComponent({
112
165
  name: "DAvatar",
113
- props: {
114
- name: {
115
- type: String,
116
- default: null
117
- },
118
- gender: {
119
- type: String,
120
- default: null
121
- },
122
- width: {
123
- type: Number,
124
- default: 36
125
- },
126
- height: {
127
- type: Number,
128
- default: 36
129
- },
130
- isRound: {
131
- type: Boolean,
132
- default: true
133
- },
134
- imgSrc: {
135
- type: String,
136
- default: ""
137
- },
138
- customText: {
139
- type: String,
140
- default: null
141
- }
142
- },
166
+ props: avatarProps,
143
167
  setup(props) {
144
168
  const {
145
169
  name,
@@ -153,149 +177,132 @@ var Avatar = defineComponent({
153
177
  const isNobody = ref(true);
154
178
  const isErrorImg = ref(false);
155
179
  const fontSize = ref(12);
156
- const code = ref();
180
+ const code = ref(1);
157
181
  const nameDisplay = ref();
158
- const calcValues = (nameInput) => {
159
- const userName = nameInput;
160
- const minNum = Math.min(width.value, height.value);
161
- if (userName) {
162
- isNobody.value = false;
163
- setDisplayName(userName, minNum);
164
- } else if (userName === "") {
165
- isNobody.value = false;
166
- nameDisplay.value = "";
167
- } else {
168
- isNobody.value = true;
182
+ const ns = useNamespace("avatar");
183
+ const styleNS = ns.e("style");
184
+ const bgNS = computed(() => {
185
+ return ns.m(`${"background-" + code.value}`);
186
+ });
187
+ const getBackgroundColor = (char) => {
188
+ if (gender.value) {
189
+ if (gender.value.toLowerCase() === "male") {
190
+ code.value = 1;
191
+ } else if (gender.value.toLowerCase() === "female") {
192
+ code.value = 0;
193
+ } else {
194
+ console.warn('gender must be "Male" or "Female"');
195
+ }
196
+ return;
169
197
  }
170
- fontSize.value = minNum / 4 + 3;
198
+ const unicode = char.charCodeAt(0);
199
+ code.value = unicode % 2;
171
200
  };
172
- const setDisplayName = (name2, width2) => {
201
+ const setDisplayName = (nameValue, widthValue) => {
173
202
  if (customText.value) {
174
203
  nameDisplay.value = customText.value;
175
204
  getBackgroundColor(customText.value.substr(0, 1));
176
205
  return;
177
206
  }
178
- if (name2.length < 2) {
179
- nameDisplay.value = name2;
207
+ if (nameValue.length < 2) {
208
+ nameDisplay.value = nameValue;
180
209
  } else {
181
- if (/^[\u4e00-\u9fa5]/.test(name2)) {
182
- nameDisplay.value = name2.substr(name2.length - 2, 2);
183
- } else if (/^[A-Za-z]/.test(name2)) {
184
- if (/[_ -]/.test(name2)) {
185
- const str_before = name2.split(/_|-|\s+/)[0];
186
- const str_after = name2.split(/_|-|\s+/)[1];
210
+ if (/^[\u4e00-\u9fa5]/.test(nameValue)) {
211
+ nameDisplay.value = nameValue.substr(nameValue.length - 2, 2);
212
+ } else if (/^[A-Za-z]/.test(nameValue)) {
213
+ if (/[_ -]/.test(nameValue)) {
214
+ const str_before = nameValue.split(/_|-|\s+/)[0];
215
+ const str_after = nameValue.split(/_|-|\s+/)[1];
187
216
  nameDisplay.value = str_before.substr(0, 1).toUpperCase() + str_after.substr(0, 1).toUpperCase();
188
217
  } else {
189
- nameDisplay.value = name2.substr(0, 2).toUpperCase();
218
+ nameDisplay.value = nameValue.substr(0, 2).toUpperCase();
190
219
  }
191
220
  } else {
192
- nameDisplay.value = name2.substr(0, 2);
221
+ nameDisplay.value = nameValue.substr(0, 2);
193
222
  }
194
223
  }
195
- if (width2 < 30) {
196
- nameDisplay.value = name2.substr(0, 1).toUpperCase();
224
+ if (widthValue < 30) {
225
+ nameDisplay.value = nameValue.substr(0, 1).toUpperCase();
197
226
  }
198
- getBackgroundColor(name2.substr(0, 1));
199
- };
200
- const getBackgroundColor = (char) => {
201
- if (gender.value) {
202
- if (gender.value.toLowerCase() === "male") {
203
- code.value = 1;
204
- } else if (gender.value.toLowerCase() === "female") {
205
- code.value = 0;
206
- } else {
207
- throw new Error('gender must be "Male" or "Female"');
208
- }
209
- return;
210
- }
211
- const unicode = char.charCodeAt(0);
212
- code.value = unicode % 2;
227
+ getBackgroundColor(nameValue.substr(0, 1));
213
228
  };
214
229
  const showErrorAvatar = () => {
215
230
  isErrorImg.value = true;
216
231
  };
232
+ const calcValues = (nameInput) => {
233
+ const userName = nameInput;
234
+ const minNum = Math.min(width.value, height.value);
235
+ if (userName) {
236
+ isNobody.value = false;
237
+ setDisplayName(userName, minNum);
238
+ } else if (userName === "") {
239
+ isNobody.value = false;
240
+ nameDisplay.value = "";
241
+ } else {
242
+ isNobody.value = true;
243
+ }
244
+ fontSize.value = minNum / 4 + 3;
245
+ };
217
246
  calcValues(customText.value ? customText.value : name.value);
218
247
  watch([name, width, height, customText, gender], () => {
219
248
  calcValues(customText.value ? customText.value : name.value);
220
249
  });
221
- return {
222
- showErrorAvatar,
223
- isErrorImg,
224
- code,
225
- fontSize,
226
- nameDisplay,
227
- isNobody
250
+ return () => {
251
+ var _a, _b;
252
+ const imgElement = createVNode("img", {
253
+ "src": imgSrc.value,
254
+ "alt": "",
255
+ "onError": showErrorAvatar,
256
+ "style": {
257
+ height: `${height.value}px`,
258
+ width: `${width.value}px`,
259
+ borderRadius: isRound.value ? "100%" : "0"
260
+ }
261
+ }, null);
262
+ const hasImgSrc = imgSrc.value && !isErrorImg.value ? imgElement : null;
263
+ const nameElement = createVNode("span", {
264
+ "class": [styleNS, bgNS.value],
265
+ "style": {
266
+ height: `${height.value}px`,
267
+ width: `${width.value}px`,
268
+ lineHeight: `${height.value}px`,
269
+ fontSize: `${fontSize.value}px`,
270
+ borderRadius: isRound.value ? "100%" : "0"
271
+ }
272
+ }, [nameDisplay.value]);
273
+ const hasNameDisplay = !imgSrc.value && !isNobody.value && ((_a = nameDisplay.value) == null ? void 0 : _a.length) !== 0 ? nameElement : null;
274
+ const noNameElement = createVNode("span", {
275
+ "class": styleNS,
276
+ "style": {
277
+ borderRadius: isRound.value ? "100%" : "0"
278
+ }
279
+ }, [createVNode(AvatarBodyIcon, {
280
+ "width": width.value,
281
+ "height": height.value
282
+ }, null)]);
283
+ const hasNoDisplayName = !imgSrc.value && !isNobody.value && ((_b = nameDisplay.value) == null ? void 0 : _b.length) === 0 ? noNameElement : null;
284
+ const noBodyElement = createVNode("span", {
285
+ "class": styleNS,
286
+ "style": {
287
+ borderRadius: isRound.value ? "100%" : "0"
288
+ }
289
+ }, [createVNode(AvatarNoBodyIcon, {
290
+ "width": width.value,
291
+ "height": height.value
292
+ }, null)]);
293
+ const noBody = !imgSrc.value && isNobody.value || isErrorImg.value ? noBodyElement : null;
294
+ return createVNode("span", {
295
+ "class": ns.b()
296
+ }, [hasImgSrc, hasNameDisplay, hasNoDisplayName, noBody]);
228
297
  };
229
- },
230
- render() {
231
- const {
232
- imgSrc,
233
- showErrorAvatar,
234
- height,
235
- width,
236
- isRound,
237
- isErrorImg,
238
- code,
239
- fontSize,
240
- nameDisplay,
241
- isNobody
242
- } = this;
243
- const imgElement = createVNode("img", {
244
- "src": imgSrc,
245
- "alt": "",
246
- "onError": showErrorAvatar,
247
- "style": {
248
- height: `${height}px`,
249
- width: `${width}px`,
250
- borderRadius: isRound ? "100%" : "0"
251
- }
252
- }, null);
253
- const hasImgSrc = imgSrc && !isErrorImg ? imgElement : null;
254
- const nameElement = createVNode("span", {
255
- "class": `devui-avatar-style devui-avatar-background-${code}`,
256
- "style": {
257
- height: `${height}px`,
258
- width: `${width}px`,
259
- lineHeight: `${height}px`,
260
- fontSize: `${fontSize}px`,
261
- borderRadius: isRound ? "100%" : "0"
262
- }
263
- }, [nameDisplay]);
264
- const hasNameDisplay = !imgSrc && !isNobody && (nameDisplay == null ? void 0 : nameDisplay.length) !== 0 ? nameElement : null;
265
- const noNameElement = createVNode("span", {
266
- "class": `devui-avatar-style`,
267
- "style": {
268
- borderRadius: isRound ? "100%" : "0"
269
- }
270
- }, [createVNode(AvatarBodyIcon, {
271
- "width": width,
272
- "height": height
273
- }, null)]);
274
- const hasNoDisplayName = !imgSrc && !isNobody && (nameDisplay == null ? void 0 : nameDisplay.length) === 0 ? noNameElement : null;
275
- const noBodyElement = createVNode("span", {
276
- "class": `devui-avatar-style`,
277
- "style": {
278
- borderRadius: isRound ? "100%" : "0"
279
- }
280
- }, [createVNode(AvatarNoBodyIcon, {
281
- "width": width,
282
- "height": height
283
- }, null)]);
284
- const noBody = !imgSrc && isNobody || isErrorImg ? noBodyElement : null;
285
- return createVNode("span", {
286
- "class": "devui-avatar"
287
- }, [hasImgSrc, hasNameDisplay, hasNoDisplayName, noBody]);
288
298
  }
289
299
  });
290
- Avatar.install = function(app) {
291
- app.component(Avatar.name, Avatar);
292
- };
293
300
  var index = {
294
301
  title: "Avatar \u5934\u50CF",
295
302
  category: "\u6570\u636E\u5C55\u793A",
296
303
  status: "100%",
297
304
  install(app) {
298
- app.use(Avatar);
305
+ app.component(Avatar.name, Avatar);
299
306
  }
300
307
  };
301
- export { Avatar, index as default };
308
+ export { Avatar, avatarProps, index as default };
@@ -1 +1 @@
1
- (function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";const M=t=>{const{width:l,height:a}=t;return e.createVNode("svg",{style:{width:`${l}px`,height:`${a}px`,verticalAlign:"middle"},viewBox:"0 0 30 30",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{id:"\u672A\u547D\u540D",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("circle",{id:"Oval",fill:"#CACFD8",cx:"15",cy:"15",r:"15"},null),e.createVNode("path",{d:"M14.9997866,16 C12.5145053,16 10.4997866,13.9852814 10.4997866,11.5 C10.4997866,9.01471863 12.5145053,7 14.9997866,7 C17.485068,7 19.4997866,9.01471863 19.4997866,11.5 C19.4997866,13.9852814 17.485068,16 14.9997866,16 Z M23,23 L7,22.998553 C7,19.0122153 10.8892296,16.5 14.9997866,16.5 C19.1103437,16.5 23,20 23,23 Z",id:"\u5F62\u72B6\u7ED3\u5408",fill:"#FFFFFF"},null)])])};var Z=e.defineComponent({name:"AvatarBodyIcon",props:{width:{type:Number,default:16},height:{type:Number,default:16}},render(){const{width:t,height:l}=this;return e.createVNode(M,{width:t,height:l},null)}});const b=t=>{const{width:l,height:a}=t;return e.createVNode("svg",{style:{width:`${l}px`,height:`${a}px`,verticalAlign:"middle"},viewBox:"0 0 30 30",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M22.31,19.2474562 L22.31,21.9974562 L20.81,21.9974562 L20.81,19.2474562 L18.06,19.2474562 L18.06,17.7474562 L20.81,17.7474562 L20.81,14.9974562 L22.31,14.9974562 L22.31,17.7474562 L25.06,17.7474562 L25.06,19.2474562 L22.31,19.2474562 Z M14.9297866,14.9974562 C12.4445053,14.9974562 10.4297866,12.9827376 10.4297866,10.4974562 C10.4297866,8.01217483 12.4445053,5.9974562 14.9297866,5.9974562 C17.415068,5.9974562 19.4297866,8.01217483 19.4297866,10.4974562 C19.4297866,12.9827376 17.415068,14.9974562 14.9297866,14.9974562 Z M19.6797866,20.2474562 L19.6797866,21.9971623 L6.93,21.9960092 C6.93,18.0096715 10.8192296,15.4974562 14.9297866,15.4974562 C16.4608397,15.4974562 17.9612467,15.983021 19.2414296,16.7474562 L17.06,16.7474562 L17.06,20.2474562 L19.6797866,20.2474562 Z",id:"\u5F62\u72B6\u7ED3\u5408",fill:"#959EB2"},null),e.createVNode("path",{d:"M0,15 L1,15 C1,15.6118966 1.03919561,16.2186526 1.11683409,16.8178549 L0.125124012,16.9463505 C0.0425740367,16.309242 0,15.6595925 0,15 Z M0.503241262,18.867175 L1.46961749,18.6100428 C1.62594651,19.1975718 1.8203704,19.7729973 2.05141295,20.3332823 L1.12693074,20.7145074 C0.880599065,20.1171459 0.67172715,19.500393 0.503241262,18.867175 Z M1.99122134,22.4730778 L2.85786221,21.9741453 C3.16078316,22.5003161 3.49772502,23.0063252 3.86631639,23.4889602 L3.0715754,24.0959089 C2.6777461,23.5802273 2.31659753,23.0382531 1.99122134,22.4730778 Z M4.38894559,25.6021078 L5.09634867,24.8952974 C5.52582519,25.3251341 5.98272136,25.7268214 6.46397085,26.0975793 L5.85367498,26.8897529 C5.33779918,26.4923186 4.84851395,26.0620615 4.38894559,25.6021078 Z M7.4424647,27.9597887 L7.94703323,27.096417 C8.47111119,27.4026968 9.0146817,27.6746032 9.57453904,27.9101878 L9.18668461,28.8319084 C8.58423501,28.5784013 8.00181692,28.2866833 7.4424647,27.9597887 Z M11.0671021,29.4791103 L11.3286494,28.5139196 C11.9126912,28.6721832 12.5080563,28.7925378 13.1119738,28.8738935 L12.9784667,29.8649413 C12.3271613,29.7772019 11.6891102,29.647662 11.0671021,29.4791103 Z M15,30 C14.9951965,30 14.9903936,29.9999977 14.9855912,30 L14.9865313,28.9999937 C14.9929361,28.9999987 14.9929361,28.9999987 14.999296,29 C15.6071552,29 16.2093364,28.9614092 16.8041774,28.8849313 L16.9316965,29.8767674 C16.2992813,29.9580762 15.6545362,30 15,30 Z M18.8545762,29.5001051 L18.5982903,28.5335041 C19.1860387,28.3776677 19.7617059,28.1837179 20.3222555,27.9531286 L20.7026875,28.8779375 C20.1050484,29.123784 19.4880358,29.3321488 18.8545762,29.5001051 Z M22.4608087,28.0158343 L21.9626951,27.1487226 C22.4893928,26.8461604 22.9959399,26.5095265 23.479119,26.1411926 L24.0853678,26.9364676 C23.5691101,27.3300178 23.0265585,27.6908386 22.4608087,28.0158343 Z M25.5921583,25.6209863 L24.8860071,24.9129252 C25.3161421,24.4839504 25.7181674,24.0275419 26.0893023,23.5467621 L26.8808873,24.1578212 C26.4830546,24.6731862 26.0524368,25.1619493 25.5921583,25.6209863 Z M27.9526445,22.5697466 L27.0897495,22.0643633 C27.3964738,21.5406601 27.6688549,20.9974409 27.904942,20.4379104 L28.8262855,20.8266601 C28.5722411,21.4287497 28.2800163,22.0107897 27.9526445,22.5697466 Z M29.4756977,18.9454696 L28.5107363,18.6830777 C28.6695136,18.099165 28.7903877,17.5039035 28.8722662,16.9000659 L29.8631978,17.0344333 C29.7748946,17.6856516 29.6447979,18.3235936 29.4756977,18.9454696 Z M30,15 C30,15.0093541 29.9999914,15.0187063 29.9999743,15.0280564 L28.999976,15.0262257 C28.9999956,15.0134169 28.9999956,15.0134169 29,15.0006466 C29,14.3970304 28.9619395,13.7989704 28.8865088,13.208136 L29.8784576,13.0814959 C29.9586571,13.7096843 30,14.3500145 30,15 Z M29.5038108,11.1594275 L28.5369608,11.4147728 C28.3816616,10.8267413 28.1882232,10.2507676 27.9581175,9.68988857 L28.8832852,9.31033004 C29.1286141,9.90831524 29.3364318,10.5256569 29.5038108,11.1594275 Z M28.0228788,7.55146763 L27.1552968,8.0487618 C26.853241,7.52179373 26.5170958,7.0149453 26.1492295,6.53143425 L26.9450761,5.92593594 C27.3381231,6.44254364 27.6984223,6.98541919 28.0228788,7.55146763 Z M25.6309089,4.41780044 L24.9221905,5.12329189 C24.4935639,4.69270467 24.0374698,4.2902078 23.5569705,3.9185855 L24.1687554,3.12756133 C24.6838129,3.52591118 25.1722392,3.95703271 25.6309089,4.41780044 Z M22.5819506,2.05451093 L22.0757531,2.91692851 C21.5523008,2.60968727 21.0092999,2.33677531 20.4499564,2.10014728 L20.8395722,1.17916981 C21.4414531,1.43379309 22.0232574,1.72658499 22.5819506,2.05451093 Z M18.9594329,0.528106464 L18.696103,1.4928123 C18.1122842,1.33345081 17.517086,1.21199245 16.9132846,1.12953261 L17.0485964,0.138729543 C17.6997753,0.227659622 18.3376514,0.358382523 18.9594329,0.528106464 Z M15,-1.11022302e-16 C15.0139048,-1.11022302e-16 15.0278052,1.892004e-05 15.0417011,5.673578e-05 L15.0389797,1.00005303 C15.0197685,1.00000934 15.0197685,1.00000934 15.0005868,1.00000001 C14.4012162,1 13.8072783,1.03753392 13.2204527,1.11192427 L13.0946918,0.119863691 C13.7186509,0.0407660189 14.3545651,-1.11022302e-16 15,-1.11022302e-16 Z M11.1720354,0.492865376 L11.4265338,1.45993857 C10.8386468,1.61464899 10.2627801,1.80746996 9.70196444,2.03693489 L9.32327455,1.11141127 C9.92118954,0.86676666 10.5384173,0.659610554 11.1720354,0.492865376 Z M7.56375123,1.97008801 L8.06022548,2.83813946 C7.53298826,3.13968806 7.02583975,3.47534367 6.54199783,3.84274131 L5.93725081,3.04632368 C6.4542073,2.65378102 6.99740556,2.29400434 7.56375123,1.97008801 Z M4.42776842,4.35917772 L5.13259949,5.06855291 C4.70156141,5.49682984 4.29859416,5.95260763 3.92648544,6.43282469 L3.13602297,5.82031423 C3.53488885,5.30556625 3.96651291,4.81747851 4.42776842,4.35917772 Z M2.0616775,7.40585279 L2.92361696,7.91286401 C2.61586086,8.43606175 2.34241977,8.97884042 2.10525197,9.53799293 L1.18464153,9.14751063 C1.43984243,8.54584288 1.73319965,7.96427837 2.0616775,7.40585279 Z M0.531541456,11.0280046 L1.49601653,11.2921785 C1.33614878,11.8758413 1.21417484,12.4709081 1.13119244,13.074601 L0.140507978,12.9384235 C0.230001486,12.2873626 0.361276825,11.6496255 0.531541456,11.0280046 Z",id:"\u8499\u7248",fill:"#CACFD8","fill-rule":"nonzero"},null)])])};var x=e.defineComponent({name:"AvatarNobodyIcon",props:{width:{type:Number,default:16},height:{type:Number,default:16}},render(){const{width:t,height:l}=this;return e.createVNode(b,{width:t,height:l},null)}}),S="",L=e.defineComponent({name:"DAvatar",props:{name:{type:String,default:null},gender:{type:String,default:null},width:{type:Number,default:36},height:{type:Number,default:36},isRound:{type:Boolean,default:!0},imgSrc:{type:String,default:""},customText:{type:String,default:null}},setup(t){const{name:l,width:a,height:d,customText:o,gender:u,imgSrc:w,isRound:N}=e.toRefs(t),s=e.ref(!0),C=e.ref(!1),f=e.ref(12),h=e.ref(),n=e.ref(),p=r=>{const c=r,v=Math.min(a.value,d.value);c?(s.value=!1,y(c,v)):c===""?(s.value=!1,n.value=""):s.value=!0,f.value=v/4+3},y=(r,c)=>{if(o.value){n.value=o.value,g(o.value.substr(0,1));return}if(r.length<2)n.value=r;else if(/^[\u4e00-\u9fa5]/.test(r))n.value=r.substr(r.length-2,2);else if(/^[A-Za-z]/.test(r))if(/[_ -]/.test(r)){const v=r.split(/_|-|\s+/)[0],A=r.split(/_|-|\s+/)[1];n.value=v.substr(0,1).toUpperCase()+A.substr(0,1).toUpperCase()}else n.value=r.substr(0,2).toUpperCase();else n.value=r.substr(0,2);c<30&&(n.value=r.substr(0,1).toUpperCase()),g(r.substr(0,1))},g=r=>{if(u.value){if(u.value.toLowerCase()==="male")h.value=1;else if(u.value.toLowerCase()==="female")h.value=0;else throw new Error('gender must be "Male" or "Female"');return}const c=r.charCodeAt(0);h.value=c%2},m=()=>{C.value=!0};return p(o.value?o.value:l.value),e.watch([l,a,d,o,u],()=>{p(o.value?o.value:l.value)}),{showErrorAvatar:m,isErrorImg:C,code:h,fontSize:f,nameDisplay:n,isNobody:s}},render(){const{imgSrc:t,showErrorAvatar:l,height:a,width:d,isRound:o,isErrorImg:u,code:w,fontSize:N,nameDisplay:s,isNobody:C}=this,f=e.createVNode("img",{src:t,alt:"",onError:l,style:{height:`${a}px`,width:`${d}px`,borderRadius:o?"100%":"0"}},null),h=t&&!u?f:null,n=e.createVNode("span",{class:`devui-avatar-style devui-avatar-background-${w}`,style:{height:`${a}px`,width:`${d}px`,lineHeight:`${a}px`,fontSize:`${N}px`,borderRadius:o?"100%":"0"}},[s]),p=!t&&!C&&(s==null?void 0:s.length)!==0?n:null,y=e.createVNode("span",{class:"devui-avatar-style",style:{borderRadius:o?"100%":"0"}},[e.createVNode(Z,{width:d,height:a},null)]),g=!t&&!C&&(s==null?void 0:s.length)===0?y:null,m=e.createVNode("span",{class:"devui-avatar-style",style:{borderRadius:o?"100%":"0"}},[e.createVNode(x,{width:d,height:a},null)]),r=!t&&C||u?m:null;return e.createVNode("span",{class:"devui-avatar"},[h,p,g,r])}});L.install=function(t){t.component(L.name,L)};var V={title:"Avatar \u5934\u50CF",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.use(L)}};i.Avatar=L,i.default=V,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
1
+ (function(u,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis!="undefined"?globalThis:u||self,e(u.index={},u.Vue))})(this,function(u,e){"use strict";const $=a=>{const{width:s,height:l}=a;return e.createVNode("svg",{style:{width:`${s}px`,height:`${l}px`,verticalAlign:"middle"},viewBox:"0 0 30 30",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{id:"\u672A\u547D\u540D",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("circle",{id:"Oval",fill:"#CACFD8",cx:"15",cy:"15",r:"15"},null),e.createVNode("path",{d:"M14.9997866,16 C12.5145053,16 10.4997866,13.9852814 10.4997866, 11.5 C10.4997866,9.01471863 12.5145053,7 14.9997866,7 C17.485068, 7 19.4997866,9.01471863 19.4997866,11.5 C19.4997866,13.9852814 17.485068, 16 14.9997866,16 Z M23,23 L7,22.998553 C7,19.0122153 10.8892296, 16.5 14.9997866,16.5 C19.1103437,16.5 23,20 23,23 Z",id:"\u5F62\u72B6\u7ED3\u5408",fill:"#FFFFFF"},null)])])};var S=e.defineComponent({name:"AvatarBodyIcon",props:{width:{type:Number,default:16},height:{type:Number,default:16}},render(){const{width:a,height:s}=this;return e.createVNode($,{width:a,height:s},null)}});const B=a=>{const{width:s,height:l}=a;return e.createVNode("svg",{style:{width:`${s}px`,height:`${l}px`,verticalAlign:"middle"},viewBox:"0 0 30 30",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M22.31,19.2474562 L22.31,21.9974562 L20.81,21.9974562 L20.81, 19.2474562 L18.06,19.2474562 L18.06,17.7474562 L20.81,17.7474562 L20.81, 14.9974562 L22.31,14.9974562 L22.31,17.7474562 L25.06,17.7474562 L25.06, 19.2474562 L22.31,19.2474562 Z M14.9297866,14.9974562 C12.4445053, 14.9974562 10.4297866,12.9827376 10.4297866,10.4974562 C10.4297866, 8.01217483 12.4445053,5.9974562 14.9297866,5.9974562 C17.415068, 5.9974562 19.4297866,8.01217483 19.4297866,10.4974562 C19.4297866, 12.9827376 17.415068,14.9974562 14.9297866,14.9974562 Z M19.6797866, 20.2474562 L19.6797866,21.9971623 L6.93,21.9960092 C6.93,18.0096715 10.8192296, 15.4974562 14.9297866,15.4974562 C16.4608397,15.4974562 17.9612467,15.983021 19.2414296, 16.7474562 L17.06,16.7474562 L17.06,20.2474562 L19.6797866,20.2474562 Z",id:"\u5F62\u72B6\u7ED3\u5408",fill:"#959EB2"},null),e.createVNode("path",{d:"M0,15 L1,15 C1,15.6118966 1.03919561,16.2186526 1.11683409, 16.8178549 L0.125124012,16.9463505 C0.0425740367,16.309242 0, 15.6595925 0,15 Z M0.503241262,18.867175 L1.46961749,18.6100428 C1.62594651, 19.1975718 1.8203704,19.7729973 2.05141295,20.3332823 L1.12693074, 20.7145074 C0.880599065,20.1171459 0.67172715,19.500393 0.503241262, 18.867175 Z M1.99122134,22.4730778 L2.85786221,21.9741453 C3.16078316, 22.5003161 3.49772502,23.0063252 3.86631639,23.4889602 L3.0715754, 24.0959089 C2.6777461,23.5802273 2.31659753,23.0382531 1.99122134, 22.4730778 Z M4.38894559,25.6021078 L5.09634867,24.8952974 C5.52582519, 25.3251341 5.98272136,25.7268214 6.46397085,26.0975793 L5.85367498, 26.8897529 C5.33779918,26.4923186 4.84851395,26.0620615 4.38894559, 25.6021078 Z M7.4424647,27.9597887 L7.94703323,27.096417 C8.47111119, 27.4026968 9.0146817,27.6746032 9.57453904,27.9101878 L9.18668461, 28.8319084 C8.58423501,28.5784013 8.00181692,28.2866833 7.4424647, 27.9597887 Z M11.0671021,29.4791103 L11.3286494,28.5139196 C11.9126912, 28.6721832 12.5080563,28.7925378 13.1119738,28.8738935 L12.9784667, 29.8649413 C12.3271613,29.7772019 11.6891102,29.647662 11.0671021, 29.4791103 Z M15,30 C14.9951965,30 14.9903936,29.9999977 14.9855912, 30 L14.9865313,28.9999937 C14.9929361,28.9999987 14.9929361, 28.9999987 14.999296,29 C15.6071552,29 16.2093364,28.9614092 16.8041774, 28.8849313 L16.9316965,29.8767674 C16.2992813,29.9580762 15.6545362, 30 15,30 Z M18.8545762,29.5001051 L18.5982903,28.5335041 C19.1860387, 28.3776677 19.7617059,28.1837179 20.3222555,27.9531286 L20.7026875, 28.8779375 C20.1050484,29.123784 19.4880358,29.3321488 18.8545762, 29.5001051 Z M22.4608087,28.0158343 L21.9626951,27.1487226 C22.4893928, 26.8461604 22.9959399,26.5095265 23.479119,26.1411926 L24.0853678, 26.9364676 C23.5691101,27.3300178 23.0265585,27.6908386 22.4608087, 28.0158343 Z M25.5921583,25.6209863 L24.8860071,24.9129252 C25.3161421, 24.4839504 25.7181674,24.0275419 26.0893023,23.5467621 L26.8808873, 24.1578212 C26.4830546,24.6731862 26.0524368,25.1619493 25.5921583, 25.6209863 Z M27.9526445,22.5697466 L27.0897495,22.0643633 C27.3964738, 21.5406601 27.6688549,20.9974409 27.904942,20.4379104 L28.8262855, 20.8266601 C28.5722411,21.4287497 28.2800163,22.0107897 27.9526445, 22.5697466 Z M29.4756977,18.9454696 L28.5107363,18.6830777 C28.6695136, 18.099165 28.7903877,17.5039035 28.8722662,16.9000659 L29.8631978, 17.0344333 C29.7748946,17.6856516 29.6447979,18.3235936 29.4756977, 18.9454696 Z M30,15 C30,15.0093541 29.9999914,15.0187063 29.9999743, 15.0280564 L28.999976,15.0262257 C28.9999956,15.0134169 28.9999956, 15.0134169 29,15.0006466 C29,14.3970304 28.9619395,13.7989704 28.8865088, 13.208136 L29.8784576,13.0814959 C29.9586571,13.7096843 30,14.3500145 30, 15 Z M29.5038108,11.1594275 L28.5369608,11.4147728 C28.3816616, 10.8267413 28.1882232,10.2507676 27.9581175,9.68988857 L28.8832852, 9.31033004 C29.1286141,9.90831524 29.3364318,10.5256569 29.5038108, 11.1594275 Z M28.0228788,7.55146763 L27.1552968,8.0487618 C26.853241, 7.52179373 26.5170958,7.0149453 26.1492295,6.53143425 L26.9450761, 5.92593594 C27.3381231,6.44254364 27.6984223,6.98541919 28.0228788, 7.55146763 Z M25.6309089,4.41780044 L24.9221905,5.12329189 C24.4935639, 4.69270467 24.0374698,4.2902078 23.5569705,3.9185855 L24.1687554, 3.12756133 C24.6838129,3.52591118 25.1722392,3.95703271 25.6309089, 4.41780044 Z M22.5819506,2.05451093 L22.0757531,2.91692851 C21.5523008, 2.60968727 21.0092999,2.33677531 20.4499564,2.10014728 L20.8395722, 1.17916981 C21.4414531,1.43379309 22.0232574,1.72658499 22.5819506, 2.05451093 Z M18.9594329,0.528106464 L18.696103,1.4928123 C18.1122842, 1.33345081 17.517086,1.21199245 16.9132846,1.12953261 L17.0485964, 0.138729543 C17.6997753,0.227659622 18.3376514,0.358382523 18.9594329, 0.528106464 Z M15,-1.11022302e-16 C15.0139048,-1.11022302e-16 15.0278052, 1.892004e-05 15.0417011,5.673578e-05 L15.0389797,1.00005303 C15.0197685, 1.00000934 15.0197685,1.00000934 15.0005868,1.00000001 C14.4012162, 1 13.8072783,1.03753392 13.2204527,1.11192427 L13.0946918,0.119863691 C13.7186509, 0.0407660189 14.3545651,-1.11022302e-16 15,-1.11022302e-16 Z M11.1720354, 0.492865376 L11.4265338,1.45993857 C10.8386468,1.61464899 10.2627801, 1.80746996 9.70196444,2.03693489 L9.32327455,1.11141127 C9.92118954, 0.86676666 10.5384173,0.659610554 11.1720354,0.492865376 Z M7.56375123, 1.97008801 L8.06022548,2.83813946 C7.53298826,3.13968806 7.02583975, 3.47534367 6.54199783,3.84274131 L5.93725081,3.04632368 C6.4542073, 2.65378102 6.99740556,2.29400434 7.56375123,1.97008801 Z M4.42776842, 4.35917772 L5.13259949,5.06855291 C4.70156141,5.49682984 4.29859416, 5.95260763 3.92648544,6.43282469 L3.13602297,5.82031423 C3.53488885, 5.30556625 3.96651291,4.81747851 4.42776842,4.35917772 Z M2.0616775, 7.40585279 L2.92361696,7.91286401 C2.61586086,8.43606175 2.34241977, 8.97884042 2.10525197,9.53799293 L1.18464153,9.14751063 C1.43984243, 8.54584288 1.73319965,7.96427837 2.0616775,7.40585279 Z M0.531541456, 11.0280046 L1.49601653,11.2921785 C1.33614878,11.8758413 1.21417484, 12.4709081 1.13119244,13.074601 L0.140507978,12.9384235 C0.230001486, 12.2873626 0.361276825,11.6496255 0.531541456,11.0280046 Z",id:"\u8499\u7248",fill:"#CACFD8","fill-rule":"nonzero"},null)])])};var F=e.defineComponent({name:"AvatarNobodyIcon",props:{width:{type:Number,default:16},height:{type:Number,default:16}},render(){const{width:a,height:s}=this;return e.createVNode(B,{width:a,height:s},null)}});const w={name:{type:String,default:null},gender:{type:String,default:null},width:{type:Number,default:36},height:{type:Number,default:36},isRound:{type:Boolean,default:!0},imgSrc:{type:String,default:""},customText:{type:String,default:null}};function L(a,s,l){let n=a;return s&&(n+=`__${s}`),l&&(n+=`--${l}`),n}function E(a,s=!1){const l=s?`.devui-${a}`:`devui-${a}`;return{b:()=>L(l),e:o=>o?L(l,o):"",m:o=>o?L(l,"",o):"",em:(o,d)=>o&&d?L(l,o,d):""}}var U="",p=e.defineComponent({name:"DAvatar",props:w,setup(a){const{name:s,width:l,height:n,customText:i,gender:v,imgSrc:C,isRound:o}=e.toRefs(a),d=e.ref(!0),g=e.ref(!1),M=e.ref(12),f=e.ref(1),r=e.ref(),m=E("avatar"),y=m.e("style"),I=e.computed(()=>m.m(`${"background-"+f.value}`)),Z=t=>{if(v.value){v.value.toLowerCase()==="male"?f.value=1:v.value.toLowerCase()==="female"?f.value=0:console.warn('gender must be "Male" or "Female"');return}const c=t.charCodeAt(0);f.value=c%2},D=(t,c)=>{if(i.value){r.value=i.value,Z(i.value.substr(0,1));return}if(t.length<2)r.value=t;else if(/^[\u4e00-\u9fa5]/.test(t))r.value=t.substr(t.length-2,2);else if(/^[A-Za-z]/.test(t))if(/[_ -]/.test(t)){const h=t.split(/_|-|\s+/)[0],N=t.split(/_|-|\s+/)[1];r.value=h.substr(0,1).toUpperCase()+N.substr(0,1).toUpperCase()}else r.value=t.substr(0,2).toUpperCase();else r.value=t.substr(0,2);c<30&&(r.value=t.substr(0,1).toUpperCase()),Z(t.substr(0,1))},R=()=>{g.value=!0},b=t=>{const c=t,h=Math.min(l.value,n.value);c?(d.value=!1,D(c,h)):c===""?(d.value=!1,r.value=""):d.value=!0,M.value=h/4+3};return b(i.value?i.value:s.value),e.watch([s,l,n,i,v],()=>{b(i.value?i.value:s.value)}),()=>{var x,A;const t=e.createVNode("img",{src:C.value,alt:"",onError:R,style:{height:`${n.value}px`,width:`${l.value}px`,borderRadius:o.value?"100%":"0"}},null),c=C.value&&!g.value?t:null,h=e.createVNode("span",{class:[y,I.value],style:{height:`${n.value}px`,width:`${l.value}px`,lineHeight:`${n.value}px`,fontSize:`${M.value}px`,borderRadius:o.value?"100%":"0"}},[r.value]),N=!C.value&&!d.value&&((x=r.value)==null?void 0:x.length)!==0?h:null,V=e.createVNode("span",{class:y,style:{borderRadius:o.value?"100%":"0"}},[e.createVNode(S,{width:l.value,height:n.value},null)]),k=!C.value&&!d.value&&((A=r.value)==null?void 0:A.length)===0?V:null,T=e.createVNode("span",{class:y,style:{borderRadius:o.value?"100%":"0"}},[e.createVNode(F,{width:l.value,height:n.value},null)]),z=!C.value&&d.value||g.value?T:null;return e.createVNode("span",{class:m.b()},[c,N,k,z])}}}),_={title:"Avatar \u5934\u50CF",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(a){a.component(p.name,p)}};u.Avatar=p,u.avatarProps=w,u.default=_,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
package/avatar/style.css CHANGED
@@ -1 +1 @@
1
- .devui-avatar{display:inline-block}.devui-avatar-style{display:inline-block;text-align:center;color:var(--devui-light-text, #ffffff)}.devui-avatar-background-0{background-color:#ff8b87}.devui-avatar-background-1{background-color:#7693f5}
1
+ .devui-avatar{display:inline-block}.devui-avatar__style{display:inline-block;text-align:center;color:var(--devui-light-text, #ffffff)}.devui-avatar--background-0{background-color:#ff8b87}.devui-avatar--background-1{background-color:#7693f5}
package/badge/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, createVNode } from "vue";
2
- const badgeStatusType = ["danger", "warning", "waiting", "success", "info"];
2
+ const badgeStatusType = ["danger", "warning", "waiting", "success", "info", "common"];
3
3
  const badgePositionType = ["top-left", "top-right", "bottom-left", "bottom-right"];
4
4
  const badgeProps = {
5
5
  count: {
@@ -15,7 +15,8 @@ const badgeProps = {
15
15
  },
16
16
  status: {
17
17
  type: String,
18
- validator: (val) => badgeStatusType.includes(val)
18
+ validator: (val) => badgeStatusType.includes(val),
19
+ default: "info"
19
20
  },
20
21
  position: {
21
22
  type: String,
@@ -30,16 +31,44 @@ const badgeProps = {
30
31
  },
31
32
  textColor: {
32
33
  type: String
34
+ },
35
+ hidden: {
36
+ type: Boolean,
37
+ default: false
33
38
  }
34
39
  };
40
+ function createBem(namespace, element, modifier) {
41
+ let cls = namespace;
42
+ if (element) {
43
+ cls += `__${element}`;
44
+ }
45
+ if (modifier) {
46
+ cls += `--${modifier}`;
47
+ }
48
+ return cls;
49
+ }
50
+ function useNamespace(block, needDot = false) {
51
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
52
+ const b = () => createBem(namespace);
53
+ const e = (element) => element ? createBem(namespace, element) : "";
54
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
55
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
56
+ return {
57
+ b,
58
+ e,
59
+ m,
60
+ em
61
+ };
62
+ }
35
63
  var badge = "";
36
64
  var Badge = defineComponent({
37
65
  name: "DBadge",
38
66
  props: badgeProps,
39
67
  setup(props, ctx) {
68
+ const ns = useNamespace("badge");
40
69
  const className = computed(() => {
41
- const base = "devui-badge-content";
42
- return [base, props.showDot ? `${base}-dot` : `${base}-count`, props.status && `${base}-${props.status}`, ctx.slots.default && props.position && `${base}-${props.position}`, ctx.slots.default && `${base}-fixed`].join(" ");
70
+ const base = ns.e("content");
71
+ return [base, props.showDot ? ns.m("dot") : ns.m("count"), props.status && ns.m(props.status), ctx.slots.default && props.position && ns.m(props.position), ctx.slots.default && ns.m("fixed"), props.hidden ? ns.m("hidden") : ns.m("show")].join(" ");
43
72
  });
44
73
  const style = computed(() => {
45
74
  const styleMap = {
@@ -70,7 +99,7 @@ var Badge = defineComponent({
70
99
  return () => {
71
100
  var _a, _b;
72
101
  return createVNode("div", {
73
- "class": "devui-badge"
102
+ "class": ns.b()
74
103
  }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a), createVNode("div", {
75
104
  "class": className.value,
76
105
  "style": style.value
@@ -1 +1 @@
1
- (function(n,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(n=typeof globalThis!="undefined"?globalThis:n||self,o(n.index={},n.Vue))})(this,function(n,o){"use strict";const c=["danger","warning","waiting","success","info"],f=["top-left","top-right","bottom-left","bottom-right"],l={count:{type:[Number,String]},maxCount:{type:Number,default:99},showDot:{type:Boolean,default:!1},status:{type:String,validator:t=>c.includes(t)},position:{type:String,default:"top-right",validator:t=>f.includes(t)},offset:{type:Array},bgColor:{type:String},textColor:{type:String}};var x="",s=o.defineComponent({name:"DBadge",props:l,setup(t,i){const g=o.computed(()=>{const e="devui-badge-content";return[e,t.showDot?`${e}-dot`:`${e}-count`,t.status&&`${e}-${t.status}`,i.slots.default&&t.position&&`${e}-${t.position}`,i.slots.default&&`${e}-fixed`].join(" ")}),m=o.computed(()=>{const e={bgColor:"background",textColor:"color"},u=Object.keys(e).reduce((d,a)=>(t[a]&&(d[e[a]]=t[a]),d),{});if(i.slots.default&&t.offset){const[d,a]=t.offset,[b,v]=t.position.split("-");u[b]=a+"px",u[v]=d+"px"}return u}),y=o.computed(()=>{if(!t.showDot)return typeof t.count=="number"&&typeof t.maxCount=="number"&&t.count>t.maxCount?`${t.maxCount}+`:t.count});return()=>{var e,u;return o.createVNode("div",{class:"devui-badge"},[(u=(e=i.slots).default)==null?void 0:u.call(e),o.createVNode("div",{class:g.value,style:m.value},[y.value])])}}}),r={title:"Badge \u5FBD\u6807",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.component(s.name,s)}};n.Badge=s,n.badgeProps=l,n.default=r,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
1
+ (function(o,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(o=typeof globalThis!="undefined"?globalThis:o||self,u(o.index={},o.Vue))})(this,function(o,u){"use strict";const y=["danger","warning","waiting","success","info","common"],b=["top-left","top-right","bottom-left","bottom-right"],r={count:{type:[Number,String]},maxCount:{type:Number,default:99},showDot:{type:Boolean,default:!1},status:{type:String,validator:t=>y.includes(t),default:"info"},position:{type:String,default:"top-right",validator:t=>b.includes(t)},offset:{type:Array},bgColor:{type:String},textColor:{type:String},hidden:{type:Boolean,default:!1}};function l(t,a,e){let d=t;return a&&(d+=`__${a}`),e&&(d+=`--${e}`),d}function h(t,a=!1){const e=a?`.devui-${t}`:`devui-${t}`;return{b:()=>l(e),e:n=>n?l(e,n):"",m:n=>n?l(e,"",n):"",em:(n,i)=>n&&i?l(e,n,i):""}}var B="",f=u.defineComponent({name:"DBadge",props:r,setup(t,a){const e=h("badge"),d=u.computed(()=>[e.e("content"),t.showDot?e.m("dot"):e.m("count"),t.status&&e.m(t.status),a.slots.default&&t.position&&e.m(t.position),a.slots.default&&e.m("fixed"),t.hidden?e.m("hidden"):e.m("show")].join(" ")),m=u.computed(()=>{const s={bgColor:"background",textColor:"color"},n=Object.keys(s).reduce((i,c)=>(t[c]&&(i[s[c]]=t[c]),i),{});if(a.slots.default&&t.offset){const[i,c]=t.offset,[x,C]=t.position.split("-");n[x]=c+"px",n[C]=i+"px"}return n}),g=u.computed(()=>{if(!t.showDot)return typeof t.count=="number"&&typeof t.maxCount=="number"&&t.count>t.maxCount?`${t.maxCount}+`:t.count});return()=>{var s,n;return u.createVNode("div",{class:e.b()},[(n=(s=a.slots).default)==null?void 0:n.call(s),u.createVNode("div",{class:d.value,style:m.value},[g.value])])}}}),v={title:"Badge \u5FBD\u6807",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.component(f.name,f)}};o.Badge=f,o.badgeProps=r,o.default=v,Object.defineProperty(o,"__esModule",{value:!0}),o[Symbol.toStringTag]="Module"});
package/badge/style.css CHANGED
@@ -1 +1 @@
1
- .devui-badge{position:relative;display:inline-block}.devui-badge .devui-badge-content{font-size:var(--devui-font-size, 12px);color:var(--devui-light-text, #ffffff)}.devui-badge .devui-badge-content-count{padding:0 4px;min-width:16px;height:16px;line-height:16px;border-radius:8px;background:var(--devui-brand, #5e7ce0);text-align:center}.devui-badge .devui-badge-content-danger{background:var(--devui-danger, #f66f6a)}.devui-badge .devui-badge-content-warning{background:var(--devui-warning, #fac20a)}.devui-badge .devui-badge-content-waiting{background:var(--devui-waiting, #9faad7)}.devui-badge .devui-badge-content-success{background:var(--devui-success, #50d4ab)}.devui-badge .devui-badge-content-info{background:var(--devui-info, #5e7ce0)}.devui-badge .devui-badge-content-top-left{left:0;top:0;transform:translate(-50%,-50%)}.devui-badge .devui-badge-content-top-right{right:0;top:0;transform:translate(50%,-50%)}.devui-badge .devui-badge-content-bottom-left{left:0;bottom:0;transform:translate(-50%,50%)}.devui-badge .devui-badge-content-bottom-right{right:0;bottom:0;transform:translate(50%,50%)}.devui-badge .devui-badge-content-fixed{position:absolute}.devui-badge .devui-badge-content-dot{width:6px;height:6px;border-radius:50%}
1
+ .devui-badge{position:relative;display:inline-block}.devui-badge__content{font-size:var(--devui-font-size-sm, 12px);color:var(--devui-light-text, #ffffff)}.devui-badge--count{padding:0 4px;min-width:16px;height:16px;line-height:16px;border-radius:var(--devui-border-radius-full, 100px);background:var(--devui-brand, #5e7ce0);text-align:center}.devui-badge--danger{background:var(--devui-danger, #f66f6a)}.devui-badge--warning{background:var(--devui-warning, #fac20a)}.devui-badge--waiting{background:var(--devui-waiting, #9faad7)}.devui-badge--success{background:var(--devui-success, #50d4ab)}.devui-badge--info{background:var(--devui-brand, #5e7ce0)}.devui-badge--common{background:var(--devui-unavailable, #f5f5f5);color:var(--devui-aide-text, #71757f)}.devui-badge--top-left{left:0;top:0;transform:translate(-50%,-50%)}.devui-badge--top-right{right:0;top:0;transform:translate(50%,-50%)}.devui-badge--bottom-left{left:0;bottom:0;transform:translate(-50%,50%)}.devui-badge--bottom-right{right:0;bottom:0;transform:translate(50%,50%)}.devui-badge--fixed{position:absolute}.devui-badge--dot{width:6px;height:6px;border-radius:50%}.devui-badge--show{visibility:visible;opacity:1;transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-out, cubic-bezier(.16, .75, .5, 1))}.devui-badge--hidden{visibility:hidden;opacity:0;transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in, cubic-bezier(.5, 0, .84, .25))}