stellar-ui-plus 1.16.18

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 (382) hide show
  1. package/README.md +176 -0
  2. package/common/css/common.scss +19 -0
  3. package/common/useProps.js +9 -0
  4. package/components/ste-animate/ATTRIBUTES.md +10 -0
  5. package/components/ste-animate/README.md +115 -0
  6. package/components/ste-animate/animate.scss +247 -0
  7. package/components/ste-animate/config.json +5 -0
  8. package/components/ste-animate/props.ts +9 -0
  9. package/components/ste-animate/ste-animate.easycom.json +39 -0
  10. package/components/ste-animate/ste-animate.scss +113 -0
  11. package/components/ste-animate/ste-animate.vue +67 -0
  12. package/components/ste-badge/ATTRIBUTES.md +17 -0
  13. package/components/ste-badge/README.md +162 -0
  14. package/components/ste-badge/config.json +5 -0
  15. package/components/ste-badge/props.ts +17 -0
  16. package/components/ste-badge/ste-badge.easycom.json +96 -0
  17. package/components/ste-badge/ste-badge.vue +157 -0
  18. package/components/ste-barcode/ATTRIBUTES.md +14 -0
  19. package/components/ste-barcode/README.md +28 -0
  20. package/components/ste-barcode/config.json +5 -0
  21. package/components/ste-barcode/encode.ts +317 -0
  22. package/components/ste-barcode/props.ts +7 -0
  23. package/components/ste-barcode/ste-barcode.easycom.json +44 -0
  24. package/components/ste-barcode/ste-barcode.vue +152 -0
  25. package/components/ste-button/ATTRIBUTES.md +32 -0
  26. package/components/ste-button/README.md +119 -0
  27. package/components/ste-button/config.json +5 -0
  28. package/components/ste-button/props.ts +21 -0
  29. package/components/ste-button/ste-button.easycom.json +168 -0
  30. package/components/ste-button/ste-button.vue +275 -0
  31. package/components/ste-calendar/ATTRIBUTES.md +31 -0
  32. package/components/ste-calendar/README.md +241 -0
  33. package/components/ste-calendar/config.json +5 -0
  34. package/components/ste-calendar/date.ts +110 -0
  35. package/components/ste-calendar/props.ts +26 -0
  36. package/components/ste-calendar/ste-calendar.easycom.json +172 -0
  37. package/components/ste-calendar/ste-calendar.vue +376 -0
  38. package/components/ste-calendar/useData.ts +30 -0
  39. package/components/ste-checkbox/ATTRIBUTES.md +25 -0
  40. package/components/ste-checkbox/README.md +302 -0
  41. package/components/ste-checkbox/config.json +5 -0
  42. package/components/ste-checkbox/props.ts +33 -0
  43. package/components/ste-checkbox/ste-checkbox.easycom.json +151 -0
  44. package/components/ste-checkbox/ste-checkbox.vue +206 -0
  45. package/components/ste-checkbox/type.d.ts +2 -0
  46. package/components/ste-checkbox-group/props.ts +34 -0
  47. package/components/ste-checkbox-group/ste-checkbox-group.vue +34 -0
  48. package/components/ste-code-input/ATTRIBUTES.md +22 -0
  49. package/components/ste-code-input/README.md +56 -0
  50. package/components/ste-code-input/config.json +5 -0
  51. package/components/ste-code-input/props.ts +19 -0
  52. package/components/ste-code-input/ste-code-input.easycom.json +99 -0
  53. package/components/ste-code-input/ste-code-input.vue +222 -0
  54. package/components/ste-date-picker/ATTRIBUTES.md +25 -0
  55. package/components/ste-date-picker/README.md +119 -0
  56. package/components/ste-date-picker/config.json +5 -0
  57. package/components/ste-date-picker/props.ts +62 -0
  58. package/components/ste-date-picker/ste-date-picker.easycom.json +137 -0
  59. package/components/ste-date-picker/ste-date-picker.vue +290 -0
  60. package/components/ste-date-picker/types.d.ts +3 -0
  61. package/components/ste-drag/ATTRIBUTES.md +13 -0
  62. package/components/ste-drag/README.md +88 -0
  63. package/components/ste-drag/config.json +5 -0
  64. package/components/ste-drag/props.ts +10 -0
  65. package/components/ste-drag/ste-drag.easycom.json +50 -0
  66. package/components/ste-drag/ste-drag.vue +172 -0
  67. package/components/ste-dropdown-menu/ATTRIBUTES.md +22 -0
  68. package/components/ste-dropdown-menu/README.md +325 -0
  69. package/components/ste-dropdown-menu/config.json +5 -0
  70. package/components/ste-dropdown-menu/constans.ts +4 -0
  71. package/components/ste-dropdown-menu/props.ts +30 -0
  72. package/components/ste-dropdown-menu/ste-dropdown-menu.easycom.json +111 -0
  73. package/components/ste-dropdown-menu/ste-dropdown-menu.scss +99 -0
  74. package/components/ste-dropdown-menu/ste-dropdown-menu.vue +223 -0
  75. package/components/ste-dropdown-menu-item/props.ts +17 -0
  76. package/components/ste-dropdown-menu-item/ste-dropdown-menu-item.scss +61 -0
  77. package/components/ste-dropdown-menu-item/ste-dropdown-menu-item.vue +84 -0
  78. package/components/ste-dropdown-menu-item/type.d.ts +4 -0
  79. package/components/ste-icon/ATTRIBUTES.md +19 -0
  80. package/components/ste-icon/README.md +72 -0
  81. package/components/ste-icon/config.json +5 -0
  82. package/components/ste-icon/iconfont.css +22 -0
  83. package/components/ste-icon/props.ts +14 -0
  84. package/components/ste-icon/ste-icon.easycom.json +71 -0
  85. package/components/ste-icon/ste-icon.vue +80 -0
  86. package/components/ste-image/ATTRIBUTES.md +21 -0
  87. package/components/ste-image/README.md +118 -0
  88. package/components/ste-image/config.json +5 -0
  89. package/components/ste-image/props.ts +15 -0
  90. package/components/ste-image/ste-image.easycom.json +189 -0
  91. package/components/ste-image/ste-image.vue +146 -0
  92. package/components/ste-index-item/props.ts +4 -0
  93. package/components/ste-index-item/ste-index-item.vue +83 -0
  94. package/components/ste-index-list/ATTRIBUTES.md +15 -0
  95. package/components/ste-index-list/README.md +138 -0
  96. package/components/ste-index-list/config.json +5 -0
  97. package/components/ste-index-list/props.ts +17 -0
  98. package/components/ste-index-list/ste-index-list.easycom.json +48 -0
  99. package/components/ste-index-list/ste-index-list.vue +109 -0
  100. package/components/ste-input/ATTRIBUTES.md +37 -0
  101. package/components/ste-input/README.md +130 -0
  102. package/components/ste-input/config.json +5 -0
  103. package/components/ste-input/props.ts +46 -0
  104. package/components/ste-input/ste-input.easycom.json +282 -0
  105. package/components/ste-input/ste-input.scss +124 -0
  106. package/components/ste-input/ste-input.vue +221 -0
  107. package/components/ste-loading/ATTRIBUTES.md +11 -0
  108. package/components/ste-loading/README.md +74 -0
  109. package/components/ste-loading/config.json +5 -0
  110. package/components/ste-loading/props.ts +8 -0
  111. package/components/ste-loading/ste-loading.easycom.json +54 -0
  112. package/components/ste-loading/ste-loading.vue +127 -0
  113. package/components/ste-media-preview/ATTRIBUTES.md +20 -0
  114. package/components/ste-media-preview/README.md +252 -0
  115. package/components/ste-media-preview/TouchScaleing.ts +117 -0
  116. package/components/ste-media-preview/config.json +5 -0
  117. package/components/ste-media-preview/props.ts +12 -0
  118. package/components/ste-media-preview/ste-media-preview.easycom.json +88 -0
  119. package/components/ste-media-preview/ste-media-preview.vue +201 -0
  120. package/components/ste-media-preview/useData.ts +63 -0
  121. package/components/ste-message-box/ATTRIBUTES.md +6 -0
  122. package/components/ste-message-box/README.md +222 -0
  123. package/components/ste-message-box/config.json +5 -0
  124. package/components/ste-message-box/constants.ts +25 -0
  125. package/components/ste-message-box/ste-message-box.easycom.json +14 -0
  126. package/components/ste-message-box/ste-message-box.ts +1 -0
  127. package/components/ste-message-box/ste-message-box.vue +355 -0
  128. package/components/ste-message-box/use-message-box.ts +26 -0
  129. package/components/ste-message-box/useData.ts +56 -0
  130. package/components/ste-notice-bar/ATTRIBUTES.md +22 -0
  131. package/components/ste-notice-bar/README.md +124 -0
  132. package/components/ste-notice-bar/config.json +5 -0
  133. package/components/ste-notice-bar/props.ts +15 -0
  134. package/components/ste-notice-bar/ste-notice-bar.easycom.json +109 -0
  135. package/components/ste-notice-bar/ste-notice-bar.vue +262 -0
  136. package/components/ste-number-keyboard/ATTRIBUTES.md +31 -0
  137. package/components/ste-number-keyboard/KeyboardVue.vue +142 -0
  138. package/components/ste-number-keyboard/README.md +192 -0
  139. package/components/ste-number-keyboard/config.json +5 -0
  140. package/components/ste-number-keyboard/props.ts +35 -0
  141. package/components/ste-number-keyboard/ste-number-keyboard.easycom.json +177 -0
  142. package/components/ste-number-keyboard/ste-number-keyboard.vue +81 -0
  143. package/components/ste-number-keyboard/useData.ts +144 -0
  144. package/components/ste-picker/props.ts +16 -0
  145. package/components/ste-picker/ste-picker.vue +194 -0
  146. package/components/ste-popup/ATTRIBUTES.md +24 -0
  147. package/components/ste-popup/README.md +135 -0
  148. package/components/ste-popup/config.json +6 -0
  149. package/components/ste-popup/event.ts +0 -0
  150. package/components/ste-popup/props.ts +19 -0
  151. package/components/ste-popup/ste-popup.easycom.json +122 -0
  152. package/components/ste-popup/ste-popup.vue +253 -0
  153. package/components/ste-price/ATTRIBUTES.md +26 -0
  154. package/components/ste-price/README.md +110 -0
  155. package/components/ste-price/config.json +5 -0
  156. package/components/ste-price/props.ts +23 -0
  157. package/components/ste-price/ste-price.easycom.json +154 -0
  158. package/components/ste-price/ste-price.vue +148 -0
  159. package/components/ste-progress/ATTRIBUTES.md +17 -0
  160. package/components/ste-progress/README.md +88 -0
  161. package/components/ste-progress/config.json +5 -0
  162. package/components/ste-progress/props.ts +16 -0
  163. package/components/ste-progress/ste-progress.easycom.json +80 -0
  164. package/components/ste-progress/ste-progress.vue +135 -0
  165. package/components/ste-qrcode/ATTRIBUTES.md +16 -0
  166. package/components/ste-qrcode/README.md +34 -0
  167. package/components/ste-qrcode/config.json +5 -0
  168. package/components/ste-qrcode/props.ts +16 -0
  169. package/components/ste-qrcode/ste-qrcode.easycom.json +56 -0
  170. package/components/ste-qrcode/ste-qrcode.vue +134 -0
  171. package/components/ste-qrcode/uqrcode.d.ts +57 -0
  172. package/components/ste-qrcode/uqrcode.js +34 -0
  173. package/components/ste-radio/ATTRIBUTES.md +25 -0
  174. package/components/ste-radio/README.md +260 -0
  175. package/components/ste-radio/config.json +5 -0
  176. package/components/ste-radio/props.ts +33 -0
  177. package/components/ste-radio/ste-radio.easycom.json +150 -0
  178. package/components/ste-radio/ste-radio.vue +188 -0
  179. package/components/ste-radio/type.d.ts +2 -0
  180. package/components/ste-radio-group/props.ts +33 -0
  181. package/components/ste-radio-group/ste-radio-group.vue +34 -0
  182. package/components/ste-rate/ATTRIBUTES.md +21 -0
  183. package/components/ste-rate/README.md +97 -0
  184. package/components/ste-rate/config.json +5 -0
  185. package/components/ste-rate/props.ts +16 -0
  186. package/components/ste-rate/ste-rate.easycom.json +85 -0
  187. package/components/ste-rate/ste-rate.vue +143 -0
  188. package/components/ste-read-more/ATTRIBUTES.md +16 -0
  189. package/components/ste-read-more/README.md +93 -0
  190. package/components/ste-read-more/config.json +5 -0
  191. package/components/ste-read-more/props.ts +9 -0
  192. package/components/ste-read-more/ste-read-more.easycom.json +54 -0
  193. package/components/ste-read-more/ste-read-more.vue +106 -0
  194. package/components/ste-rich-text/ATTRIBUTES.md +8 -0
  195. package/components/ste-rich-text/README.md +26 -0
  196. package/components/ste-rich-text/config.json +5 -0
  197. package/components/ste-rich-text/props.ts +8 -0
  198. package/components/ste-rich-text/ste-rich-text.easycom.json +40 -0
  199. package/components/ste-rich-text/ste-rich-text.vue +33 -0
  200. package/components/ste-scroll-to/ATTRIBUTES.md +11 -0
  201. package/components/ste-scroll-to/README.md +47 -0
  202. package/components/ste-scroll-to/config.json +5 -0
  203. package/components/ste-scroll-to/props.ts +17 -0
  204. package/components/ste-scroll-to/ste-scroll-to.easycom.json +25 -0
  205. package/components/ste-scroll-to/ste-scroll-to.vue +42 -0
  206. package/components/ste-scroll-to/useData.ts +214 -0
  207. package/components/ste-scroll-to-item/ste-scroll-to-item.vue +24 -0
  208. package/components/ste-search/ATTRIBUTES.md +39 -0
  209. package/components/ste-search/README.md +232 -0
  210. package/components/ste-search/config.json +5 -0
  211. package/components/ste-search/props.ts +124 -0
  212. package/components/ste-search/ste-search.easycom.json +232 -0
  213. package/components/ste-search/ste-search.vue +379 -0
  214. package/components/ste-search/useData.ts +34 -0
  215. package/components/ste-select/ATTRIBUTES.md +39 -0
  216. package/components/ste-select/README.md +324 -0
  217. package/components/ste-select/config.json +5 -0
  218. package/components/ste-select/datapager.vue +54 -0
  219. package/components/ste-select/datetime.vue +109 -0
  220. package/components/ste-select/defaultDate.ts +138 -0
  221. package/components/ste-select/props.ts +67 -0
  222. package/components/ste-select/ste-select.easycom.json +287 -0
  223. package/components/ste-select/ste-select.vue +437 -0
  224. package/components/ste-select/useData.ts +471 -0
  225. package/components/ste-signature/ATTRIBUTES.md +18 -0
  226. package/components/ste-signature/README.md +97 -0
  227. package/components/ste-signature/config.json +5 -0
  228. package/components/ste-signature/props.ts +12 -0
  229. package/components/ste-signature/ste-signature.easycom.json +74 -0
  230. package/components/ste-signature/ste-signature.vue +183 -0
  231. package/components/ste-signature/types.d.ts +4 -0
  232. package/components/ste-slider/ATTRIBUTES.md +25 -0
  233. package/components/ste-slider/README.md +149 -0
  234. package/components/ste-slider/config.json +5 -0
  235. package/components/ste-slider/props.ts +32 -0
  236. package/components/ste-slider/ste-slider.easycom.json +128 -0
  237. package/components/ste-slider/ste-slider.scss +150 -0
  238. package/components/ste-slider/ste-slider.vue +293 -0
  239. package/components/ste-slider/type.d.ts +4 -0
  240. package/components/ste-slider/useData.ts +79 -0
  241. package/components/ste-step/props.ts +10 -0
  242. package/components/ste-step/ste-step.scss +104 -0
  243. package/components/ste-step/ste-step.vue +122 -0
  244. package/components/ste-stepper/ATTRIBUTES.md +33 -0
  245. package/components/ste-stepper/README.md +172 -0
  246. package/components/ste-stepper/config.json +5 -0
  247. package/components/ste-stepper/props.ts +41 -0
  248. package/components/ste-stepper/ste-stepper.easycom.json +220 -0
  249. package/components/ste-stepper/ste-stepper.vue +249 -0
  250. package/components/ste-steps/ATTRIBUTES.md +12 -0
  251. package/components/ste-steps/README.md +139 -0
  252. package/components/ste-steps/config.json +5 -0
  253. package/components/ste-steps/props.ts +18 -0
  254. package/components/ste-steps/ste-steps.easycom.json +46 -0
  255. package/components/ste-steps/ste-steps.vue +44 -0
  256. package/components/ste-sticky/ATTRIBUTES.md +15 -0
  257. package/components/ste-sticky/README.md +56 -0
  258. package/components/ste-sticky/config.json +5 -0
  259. package/components/ste-sticky/props.ts +7 -0
  260. package/components/ste-sticky/ste-sticky.easycom.json +48 -0
  261. package/components/ste-sticky/ste-sticky.vue +88 -0
  262. package/components/ste-swipe-action/ATTRIBUTES.md +16 -0
  263. package/components/ste-swipe-action/README.md +195 -0
  264. package/components/ste-swipe-action/config.json +5 -0
  265. package/components/ste-swipe-action/props.ts +23 -0
  266. package/components/ste-swipe-action/ste-swipe-action.easycom.json +74 -0
  267. package/components/ste-swipe-action/ste-swipe-action.vue +138 -0
  268. package/components/ste-swipe-action/useData.ts +204 -0
  269. package/components/ste-swipe-action-group/ATTRIBUTES.md +17 -0
  270. package/components/ste-swipe-action-group/props.ts +22 -0
  271. package/components/ste-swipe-action-group/ste-swipe-action-group.easycom.json +90 -0
  272. package/components/ste-swipe-action-group/ste-swipe-action-group.vue +57 -0
  273. package/components/ste-swiper/ATTRIBUTES.md +24 -0
  274. package/components/ste-swiper/README.md +156 -0
  275. package/components/ste-swiper/config.json +5 -0
  276. package/components/ste-swiper/props.ts +41 -0
  277. package/components/ste-swiper/ste-swiper.easycom.json +123 -0
  278. package/components/ste-swiper/ste-swiper.vue +98 -0
  279. package/components/ste-swiper/useData.ts +365 -0
  280. package/components/ste-swiper-item/ste-swiper-item.vue +41 -0
  281. package/components/ste-switch/ATTRIBUTES.md +17 -0
  282. package/components/ste-switch/README.md +105 -0
  283. package/components/ste-switch/config.json +5 -0
  284. package/components/ste-switch/props.ts +9 -0
  285. package/components/ste-switch/ste-switch.easycom.json +60 -0
  286. package/components/ste-switch/ste-switch.vue +96 -0
  287. package/components/ste-tab/ATTRIBUTES.md +14 -0
  288. package/components/ste-tab/props.ts +25 -0
  289. package/components/ste-tab/ste-tab.easycom.json +56 -0
  290. package/components/ste-tab/ste-tab.vue +26 -0
  291. package/components/ste-table/ATTRIBUTES.md +41 -0
  292. package/components/ste-table/README.md +638 -0
  293. package/components/ste-table/config.json +5 -0
  294. package/components/ste-table/props.ts +72 -0
  295. package/components/ste-table/ste-table.easycom.json +188 -0
  296. package/components/ste-table/ste-table.vue +427 -0
  297. package/components/ste-table/types.d.ts +3 -0
  298. package/components/ste-table/useData.ts +233 -0
  299. package/components/ste-table/utils.ts +11 -0
  300. package/components/ste-table-column/checkbox-icon.vue +35 -0
  301. package/components/ste-table-column/common.scss +52 -0
  302. package/components/ste-table-column/props.ts +18 -0
  303. package/components/ste-table-column/radio-icon.vue +99 -0
  304. package/components/ste-table-column/ste-table-column.vue +169 -0
  305. package/components/ste-table-column/var.scss +1 -0
  306. package/components/ste-tabs/ATTRIBUTES.md +52 -0
  307. package/components/ste-tabs/README.md +165 -0
  308. package/components/ste-tabs/config.json +5 -0
  309. package/components/ste-tabs/props.ts +133 -0
  310. package/components/ste-tabs/ste-tabs.easycom.json +278 -0
  311. package/components/ste-tabs/ste-tabs.vue +447 -0
  312. package/components/ste-tabs/useData.ts +364 -0
  313. package/components/ste-text/ATTRIBUTES.md +9 -0
  314. package/components/ste-text/README.md +58 -0
  315. package/components/ste-text/config.json +6 -0
  316. package/components/ste-text/props.ts +10 -0
  317. package/components/ste-text/ste-text.easycom.json +30 -0
  318. package/components/ste-text/ste-text.vue +46 -0
  319. package/components/ste-toast/ATTRIBUTES.md +15 -0
  320. package/components/ste-toast/README.md +222 -0
  321. package/components/ste-toast/config.json +5 -0
  322. package/components/ste-toast/props.ts +7 -0
  323. package/components/ste-toast/ste-toast.easycom.json +73 -0
  324. package/components/ste-toast/ste-toast.vue +209 -0
  325. package/components/ste-toast/use-toast.ts +26 -0
  326. package/components/ste-touch-swipe/ATTRIBUTES.md +18 -0
  327. package/components/ste-touch-swipe/README.md +89 -0
  328. package/components/ste-touch-swipe/TouchEvent.ts +79 -0
  329. package/components/ste-touch-swipe/config.json +5 -0
  330. package/components/ste-touch-swipe/props.ts +23 -0
  331. package/components/ste-touch-swipe/ste-touch-swipe.easycom.json +83 -0
  332. package/components/ste-touch-swipe/ste-touch-swipe.vue +283 -0
  333. package/components/ste-touch-swipe/useData.ts +51 -0
  334. package/components/ste-touch-swipe-item/ste-touch-swipe-item.vue +32 -0
  335. package/components/ste-tour/ATTRIBUTES.md +26 -0
  336. package/components/ste-tour/README.md +134 -0
  337. package/components/ste-tour/config.json +5 -0
  338. package/components/ste-tour/props.ts +45 -0
  339. package/components/ste-tour/ste-tour.easycom.json +120 -0
  340. package/components/ste-tour/ste-tour.vue +152 -0
  341. package/components/ste-tour/useData.ts +220 -0
  342. package/components/ste-tree/ATTRIBUTES.md +19 -0
  343. package/components/ste-tree/README.md +217 -0
  344. package/components/ste-tree/config.json +5 -0
  345. package/components/ste-tree/props.ts +24 -0
  346. package/components/ste-tree/ste-tree.easycom.json +106 -0
  347. package/components/ste-tree/ste-tree.vue +140 -0
  348. package/components/ste-tree/useData.ts +219 -0
  349. package/components/ste-upload/ATTRIBUTES.md +35 -0
  350. package/components/ste-upload/README.md +208 -0
  351. package/components/ste-upload/ReadFile.ts +305 -0
  352. package/components/ste-upload/config.json +5 -0
  353. package/components/ste-upload/props.ts +25 -0
  354. package/components/ste-upload/ste-upload.easycom.json +267 -0
  355. package/components/ste-upload/ste-upload.vue +386 -0
  356. package/components/ste-upload/useData.ts +46 -0
  357. package/components/ste-video/ATTRIBUTES.md +34 -0
  358. package/components/ste-video/README.md +48 -0
  359. package/components/ste-video/config.json +5 -0
  360. package/components/ste-video/props.ts +86 -0
  361. package/components/ste-video/ste-video.easycom.json +226 -0
  362. package/components/ste-video/ste-video.scss +201 -0
  363. package/components/ste-video/ste-video.vue +390 -0
  364. package/components/ste-video/types.d.ts +4 -0
  365. package/components/ste-video/useData.ts +140 -0
  366. package/composables.ts +2 -0
  367. package/config/color.ts +16 -0
  368. package/config/index.ts +48 -0
  369. package/index.ts +118 -0
  370. package/package.json +22 -0
  371. package/store/color.ts +24 -0
  372. package/store/index.ts +12 -0
  373. package/store/message-box.ts +54 -0
  374. package/store/toast.ts +50 -0
  375. package/types/components.d.ts +124 -0
  376. package/types/event.d.ts +51 -0
  377. package/types/index.d.ts +112 -0
  378. package/types/refComponents.d.ts +118 -0
  379. package/utils/Color.ts +66 -0
  380. package/utils/System.ts +114 -0
  381. package/utils/mixin.ts +122 -0
  382. package/utils/utils.ts +520 -0
@@ -0,0 +1,223 @@
1
+ <script lang="ts" setup>
2
+ import { watch, computed, ref, type CSSProperties, getCurrentInstance, defineOptions } from 'vue';
3
+ import { useProvide } from '../../utils/mixin';
4
+ import { DEFAULT_DURATION, MAX_DURATION, MIN_DURATION, DEFAULT_ROOT_QUERY } from './constans';
5
+ import propsData, { DEOP_DOWN_MENU_KEY, dropDownMenuEmits } from './props';
6
+ import type { DropdownItem } from '../ste-dropdown-menu-item/type';
7
+ import { type DropdownMenuItemProps } from '../ste-dropdown-menu-item/props';
8
+ import utils from '../../utils/utils';
9
+ import System from '../../utils/System.js';
10
+ import useColor from '../../config/color';
11
+ let color = useColor();
12
+
13
+ const props = defineProps(propsData);
14
+ const emits = defineEmits(dropDownMenuEmits);
15
+ const componentName = `ste-dropdown-menu`;
16
+ defineOptions({
17
+ name: componentName,
18
+ options: {
19
+ virtualHost: true,
20
+ },
21
+ });
22
+
23
+ const addPx = (val: string | number) => {
24
+ if (utils.isNumber(String(val))) {
25
+ return `${val}px`;
26
+ } else {
27
+ return 0;
28
+ }
29
+ };
30
+
31
+ const showMenu = ref(false);
32
+ const menuRootQuery = ref<typeof DEFAULT_ROOT_QUERY>(DEFAULT_ROOT_QUERY);
33
+ const contentHeight = ref(0);
34
+ const menuTitle = ref<string | undefined>('');
35
+ const hiddenContent = ref(false);
36
+
37
+ let chooseItems: any[] = [];
38
+ const instance = getCurrentInstance() as unknown as ComponentPublicInstance;
39
+
40
+ const cmpRootClass = computed(() => {
41
+ let classArr = [props.direction, showMenu.value ? 'open' : 'close', props.type];
42
+ return classArr.join(' ');
43
+ });
44
+
45
+ const cmpRootStyle = computed(() => ({
46
+ '--duration': cmpDuration.value + 's',
47
+ '--active-color': props.activeColor ? props.activeColor : color.getColor().steThemeColor,
48
+ '--inactive-color': props.inactiveColor,
49
+ '--menu-z-index': props.zIndex,
50
+ }));
51
+ 6;
52
+ const cmpMenuPlaceholderStyle = computed(() => {
53
+ let style: CSSProperties = { height: 0 };
54
+
55
+ if (showMenu.value) {
56
+ if (props.direction == 'down') {
57
+ style.height = addPx(menuRootQuery.value.top + menuRootQuery.value.height);
58
+ } else {
59
+ let windowHeight = System.getWindowInfo().windowHeight;
60
+ style.height = addPx(windowHeight - menuRootQuery.value.bottom + menuRootQuery.value.height);
61
+ }
62
+ }
63
+
64
+ return style;
65
+ });
66
+
67
+ const cmpMenuContentStyle = computed(() => {
68
+ let style = {
69
+ height: addPx(contentHeight.value),
70
+ background: props.showMask ? 'rgba(0, 0, 0, 0.6)' : 'rgba(0, 0, 0, 0)',
71
+ } as CSSProperties;
72
+ if (props.direction == 'down') {
73
+ style.top = addPx(menuRootQuery.value.top + menuRootQuery.value.height);
74
+ } else {
75
+ style.top = 0;
76
+ }
77
+ return style;
78
+ });
79
+
80
+ const cmpDuration = computed(() => {
81
+ if (!utils.isNumber(String(props.duration))) {
82
+ return DEFAULT_DURATION;
83
+ }
84
+ if (Number(props.duration) > MAX_DURATION) {
85
+ return MAX_DURATION;
86
+ }
87
+ if (Number(props.duration) < MIN_DURATION) {
88
+ return MIN_DURATION;
89
+ }
90
+ return props.duration;
91
+ });
92
+
93
+ watch(
94
+ () => [props.modelValue, props.value],
95
+ ([modalVal, val]) => {
96
+ let v = val ? val : modalVal;
97
+ if (Array.isArray(v)) {
98
+ chooseItems = v;
99
+ } else {
100
+ v ? (chooseItems = [v]) : '';
101
+ }
102
+ },
103
+ { immediate: true }
104
+ );
105
+
106
+ let menuItems = ref<DropdownItem[]>([]);
107
+ function updateItems() {
108
+ let childrens = internalChildren;
109
+ if (childrens.length !== menuItems.value.length) {
110
+ menuItems.value = childrens.map(e => e.props as DropdownMenuItemProps);
111
+ loadMenuTitle();
112
+ }
113
+ }
114
+
115
+ function loadMenuTitle() {
116
+ if (!props.title) {
117
+ let item = internalChildren.find(e => {
118
+ return chooseItems.find(v => v == e.props.value);
119
+ });
120
+ menuTitle.value = (item?.props as DropdownMenuItemProps).title;
121
+ } else {
122
+ menuTitle.value = props.title;
123
+ }
124
+ }
125
+ function touchmove(e: TouchEvent) {
126
+ // TODO nvue 取消冒泡
127
+ e.stopPropagation();
128
+ }
129
+ async function getContentHeight() {
130
+ let windowHeight = System.getWindowInfo().windowHeight;
131
+
132
+ const res = await utils.querySelector<false>('.ste-dropdown-menu-root', instance);
133
+ menuRootQuery.value = { height: res.height || 0, top: res.top || 0, bottom: res.bottom || 0, left: res.left || 0 };
134
+ contentHeight.value = props.direction == 'down' ? windowHeight - menuRootQuery.value.bottom : menuRootQuery.value.top;
135
+ }
136
+ async function handleMenuClick() {
137
+ if (!showMenu.value) {
138
+ await getContentHeight();
139
+ open();
140
+ } else {
141
+ close();
142
+ }
143
+ }
144
+ function open() {
145
+ showMenu.value = true;
146
+ hiddenContent.value = false;
147
+ emits('open');
148
+ }
149
+ function close() {
150
+ showMenu.value = false;
151
+ setTimeout(
152
+ () => {
153
+ hiddenContent.value = true;
154
+ contentHeight.value = 0;
155
+ menuRootQuery.value = DEFAULT_ROOT_QUERY;
156
+ emits('close');
157
+ },
158
+ Number(cmpDuration.value) * 1000
159
+ );
160
+ }
161
+ function choose(item: DropdownItem) {
162
+ let temp = chooseItems;
163
+ let index = temp.findIndex(e => e == item.value);
164
+ let max = props.max < 1 ? 1 : props.max;
165
+ if (index > -1) {
166
+ // 当选中项再次被选中时,做取消选中操作
167
+ temp.splice(index, 1);
168
+ } else {
169
+ if (chooseItems.length < max) {
170
+ temp.push(item.value);
171
+ } else {
172
+ temp.shift();
173
+ temp.push(item.value);
174
+ }
175
+ }
176
+
177
+ chooseItems = temp;
178
+ loadMenuTitle();
179
+ if (chooseItems.length == max) {
180
+ close();
181
+ }
182
+ emits('update:modelValue', chooseItems);
183
+ emits('change', chooseItems);
184
+ emits('item-choose', item);
185
+ triggerChildLoadStatus();
186
+ }
187
+ function handleMaskClick() {
188
+ if (props.isMaskClick) {
189
+ close();
190
+ }
191
+ }
192
+ function handleMenuConentClick() {}
193
+
194
+ function triggerChildLoadStatus() {
195
+ internalChildren.forEach(e => {
196
+ (e.exposed as any).loadStatus();
197
+ });
198
+ }
199
+
200
+ const { internalChildren } = useProvide(DEOP_DOWN_MENU_KEY, 'ste-checkbox')({ props, chooseItems, cmpDuration, choose, updateItems });
201
+ defineExpose({ close });
202
+ </script>
203
+
204
+ <template>
205
+ <view class="ste-dropdown-menu-root" :class="[cmpRootClass]" :style="[cmpRootStyle]" @touchmove.stop.prevent="touchmove" @wheel.stop.prevent>
206
+ <view class="dropdown-placeholder" :style="[cmpMenuPlaceholderStyle]" @click="close" @touchmove.stop.prevent="touchmove" @wheel.stop.prevent />
207
+ <view class="menu-box" @click="handleMenuClick" @touchmove.stop.prevent="touchmove" @wheel.stop.prevent>
208
+ <text class="title">{{ menuTitle || title }}</text>
209
+ <view class="menu-title-icon">
210
+ <ste-icon code="&#xe699;" size="16" color="#bbbbbb"></ste-icon>
211
+ </view>
212
+ </view>
213
+ <view :class="hiddenContent ? 'dropdown-content hidden' : 'dropdown-content'" :style="[cmpMenuContentStyle]" @click="handleMaskClick" @touchmove.stop.prevent="touchmove" @wheel.stop.prevent>
214
+ <view class="menu-item-content" @click.stop="handleMenuConentClick">
215
+ <slot></slot>
216
+ </view>
217
+ </view>
218
+ </view>
219
+ </template>
220
+
221
+ <style lang="scss" scoped>
222
+ @import './ste-dropdown-menu.scss';
223
+ </style>
@@ -0,0 +1,17 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+
3
+ const dropdownMenuItemProps = {
4
+ value: { type: String, default: '' },
5
+ title: { type: String, default: '' },
6
+ disabled: { type: Boolean, default: false },
7
+ readonly: { type: Boolean, default: false },
8
+ max: { type: Number, default: 1 },
9
+ }
10
+
11
+ export type DropdownMenuItemProps = ExtractPropTypes<typeof dropdownMenuItemProps>
12
+
13
+ export default dropdownMenuItemProps
14
+
15
+ export const dropdownMenuItemEmits = {
16
+ click: (suspend: () => void, next: () => void, stop: () => void) => suspend instanceof Function && next instanceof Function && stop instanceof Function,
17
+ }
@@ -0,0 +1,61 @@
1
+ .ste-dropdown-menu-item-root {
2
+ &.down {
3
+ border-top: solid 2rpx #f9f9f9;
4
+ }
5
+ &.up {
6
+ border-bottom: solid 2rpx #f9f9f9;
7
+ }
8
+ background-color: #ffffff;
9
+ padding: 24rpx;
10
+
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: space-between;
14
+ color: var(--inactive-color);
15
+ .menu-item-icon {
16
+ display: none;
17
+ }
18
+
19
+ .text {
20
+ font-size: var(--font-size-28, 28rpx);
21
+ }
22
+
23
+ &.disabled {
24
+ color: #cccccc !important;
25
+ }
26
+
27
+ &.active {
28
+ color: var(--active-color);
29
+ .menu-item-icon {
30
+ display: inline-flex;
31
+ align-items: center;
32
+ }
33
+ }
34
+
35
+ &.round {
36
+ display: inline-flex;
37
+ border: none;
38
+ padding: 14rpx 10rpx;
39
+ border-radius: 48rpx;
40
+ border: 2rpx solid var(--active-color);
41
+ width: 194rpx;
42
+ white-space: nowrap;
43
+ margin-bottom: 20rpx;
44
+
45
+ .text {
46
+ width: 100%;
47
+ text-align: center;
48
+ color: var(--active-color);
49
+ white-space: nowrap;
50
+ text-overflow: ellipsis;
51
+ overflow: hidden;
52
+ }
53
+
54
+ &.active {
55
+ background-color: var(--active-color);
56
+ .text {
57
+ color: #fff;
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,84 @@
1
+ <script lang="ts" setup>
2
+ import { ref, computed, type ComputedRef, onMounted } from 'vue';
3
+ import propsData, { dropdownMenuItemEmits } from './props';
4
+ import { type DropDownMenuProps, DEOP_DOWN_MENU_KEY } from '../ste-dropdown-menu/props';
5
+ import type { DropdownItem } from './type';
6
+ import { useInject } from '../../utils/mixin';
7
+
8
+ const props = defineProps(propsData);
9
+ const emits = defineEmits(dropdownMenuItemEmits);
10
+ const Parent = useInject<{ props: Required<DropDownMenuProps>; chooseItems: any[]; cmpDuration: ComputedRef; choose: (item: DropdownItem) => void; updateItems: () => void }>(DEOP_DOWN_MENU_KEY);
11
+ const parent = Parent.parent;
12
+ const parentProps = Parent.parent?.props as DropDownMenuProps;
13
+
14
+ const status = ref(false); // 是否选中状态 true: 选中,false: 未选中
15
+
16
+ const cmpRootClass = computed(() => {
17
+ let classArr = [parentProps.direction];
18
+ if (status.value) {
19
+ classArr.push('active');
20
+ }
21
+ if (props.readonly) {
22
+ classArr.push('readonly');
23
+ }
24
+ if (props.disabled) {
25
+ classArr.push('disabled');
26
+ }
27
+ classArr.push(parentProps.type);
28
+ return classArr.join(' ');
29
+ });
30
+
31
+ onMounted(() => {
32
+ parent?.updateItems();
33
+ loadStatus();
34
+ // this.parent.$on('item-choose', value => {
35
+ // this.loadStatus();
36
+ // });
37
+ });
38
+
39
+ function loadStatus() {
40
+ if (parent?.chooseItems) {
41
+ status.value = !!parent.chooseItems.find(e => e == props.value);
42
+ }
43
+ }
44
+
45
+ let clickTask: Promise<any> | null = null;
46
+ async function handleClick() {
47
+ if (!props.disabled && !props.readonly) {
48
+ if (clickTask) {
49
+ return;
50
+ }
51
+ let next = true;
52
+ clickTask = new Promise((resolve, reject) => {
53
+ emits(
54
+ 'click',
55
+ () => (next = false),
56
+ () => resolve(null),
57
+ () => reject()
58
+ );
59
+ });
60
+ if (!next) {
61
+ await clickTask;
62
+ }
63
+ parent?.choose({ title: props.title, value: props.value });
64
+ setTimeout(() => {
65
+ clickTask = null;
66
+ loadStatus();
67
+ }, parent?.cmpDuration.value * 1000);
68
+ }
69
+ }
70
+
71
+ defineExpose({ loadStatus });
72
+ </script>
73
+
74
+ <template>
75
+ <view class="ste-dropdown-menu-item-root" :class="[cmpRootClass]" @click="handleClick">
76
+ <text class="text">{{ title }}</text>
77
+ <view class="menu-item-icon" v-if="parentProps.type == 'block'">
78
+ <ste-icon code="&#xe67a;" size="32"></ste-icon>
79
+ </view>
80
+ </view>
81
+ </template>
82
+ <style lang="scss" scoped>
83
+ @import './ste-dropdown-menu-item.scss';
84
+ </style>
@@ -0,0 +1,4 @@
1
+ export interface DropdownItem {
2
+ title: string
3
+ value: string
4
+ }
@@ -0,0 +1,19 @@
1
+ #### Props
2
+ | 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
3
+ | ----- | ----- | --- | ------- | ------ | -------- |
4
+ | `code` | 图标名称 | `string` | - | - | - |
5
+ | `color` | 图标颜色 | `string` | - | - | - |
6
+ | `size` | 图标大小,单位rpx | `string / number` | `28` | - | - |
7
+ | `bold` | 图标是否粗体 | `boolean` | `false` | - | - |
8
+ | `marginLeft` | 左外边距,单位rpx | `string / number` | `0` | - | - |
9
+ | `marginRight` | 右外边距,单位rpx | `string / number` | `0` | - | - |
10
+ | `marginTop` | 上外边距,单位rpx | `string / number` | `0` | - | - |
11
+ | `marginBottom` | 下外边距,单位rpx | `string / number` | `0` | - | - |
12
+ | `fontFamily` | 字体名 | `string` | `` | - | - |
13
+ | `inlineBlock` | 容器对齐方式 | `boolean` | `true` | - | - |
14
+
15
+
16
+ #### Events
17
+ | 事件名 | 说明 | 事件参数 | 支持版本 |
18
+ | ----- | ----- | ------- | -------- |
19
+ | `click` | 图标点击回调事件 | - | - |
@@ -0,0 +1,72 @@
1
+ # Icon 图标
2
+
3
+ 基于字体的图标集,包含了大多数常见场景的图标
4
+
5
+ ---$
6
+
7
+ ## 代码演示
8
+
9
+ ### 基础用法
10
+
11
+ 通过 `code` 属性来指定需要使用的图标,Stellar 组件使用[iconfont 做图标库](https://at.alicdn.com/t/c/font_4041637_pivqtx3f1mq.json?spm=a313x.manage_type_myprojects.i1.49.f7ba3a81fFvJ6W&file=font_4041637_pivqtx3f1mq.json),
12
+ 可以直接传入对应的编码来使用
13
+
14
+ ```html
15
+ <ste-icon code="&#xe653;"></ste-icon>
16
+ ```
17
+
18
+ ### 图标颜色
19
+
20
+ 通过 `color` 属性来设置图标的颜色
21
+
22
+ ```html
23
+ <ste-icon code="&#xe684;" color="#1989fa" :size="60" marginRight="30"></ste-icon>
24
+ <ste-icon code="&#xe684;" color="#ee0a24" :size="60"></ste-icon>
25
+ ```
26
+
27
+ ### 图标大小
28
+
29
+ 通过 `size` 属性来设置图标的尺寸大小,单位为 rpx,默认`28`
30
+
31
+ ```html
32
+ <ste-icon code="&#xe671;" marginRight="30"></ste-icon>
33
+ <ste-icon code="&#xe671;" marginRight="30" :size="50"></ste-icon>
34
+ <ste-icon code="&#xe671;" marginRight="30" :size="70"></ste-icon>
35
+ ```
36
+
37
+ ### 图标是否粗体
38
+
39
+ 通过 `bold` 属性来设置图标是否粗体,默认`false`
40
+
41
+ ```html
42
+ <ste-icon code="&#xe673;" marginRight="30"></ste-icon>
43
+ <ste-icon code="&#xe673;" bold></ste-icon>
44
+ ```
45
+
46
+ ### 自定义图标
47
+
48
+ 如果需要在现有 `Icon` 的基础上使用更多图标,可以引入第三方 `iconfont` 对应的字体文件和 `CSS` 文件,之后就可以在 `Icon` 组件中直接使用。
49
+
50
+ ```css
51
+ /* 引入第三方或自定义的字体图标样式 */
52
+ @font-face {
53
+ font-family: 'iconfont'; /* Project id 2344394 */
54
+ src: url('//at.alicdn.com/t/c/font_2344394_nltp3ggc4q.woff2?t=1709779088427') format('woff2');
55
+ }
56
+ ```
57
+
58
+ ```html
59
+ <!-- 通过 class-prefix 指定类名为 font-family属性的值:如iconfont -->
60
+ <ste-icon fontFamily="iconfont" code="&#xe6cc;" />
61
+ ```
62
+
63
+ ---$
64
+
65
+ ### API
66
+
67
+ <!-- props -->
68
+
69
+ ---$
70
+ {{zyy}}
71
+
72
+ {{qinpengfei}}
@@ -0,0 +1,5 @@
1
+ {
2
+ "group": "基础组件",
3
+ "title": "Icon 图标",
4
+ "icon": "https://image.whzb.com/chain/StellarUI/组件图标/icon.png"
5
+ }
@@ -0,0 +1,22 @@
1
+ /* #ifdef APP */
2
+ /* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
3
+ @font-face {
4
+ font-family: 'ste-iconfont-1709689042473';
5
+ /* Project id 4457057 */
6
+ src: url('https://at.alicdn.com/t/c/font_4457057_378iyzac6bn.woff2?t=1727661432800') format('woff2'),
7
+ url('https://at.alicdn.com/t/c/font_4457057_378iyzac6bn.woff?t=1727661432800') format('woff'),
8
+ url('https://at.alicdn.com/t/c/font_4457057_378iyzac6bn.ttf?t=1727661432800') format('truetype');
9
+ }
10
+
11
+ /* #endif */
12
+ /* #ifndef APP */
13
+ /* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
14
+ @font-face {
15
+ font-family: 'ste-iconfont-1709689042473';
16
+ /* Project id 4457057 */
17
+ src: url('//at.alicdn.com/t/c/font_4457057_378iyzac6bn.woff2?t=1727661432800') format('woff2'),
18
+ url('//at.alicdn.com/t/c/font_4457057_378iyzac6bn.woff?t=1727661432800') format('woff'),
19
+ url('//at.alicdn.com/t/c/font_4457057_378iyzac6bn.ttf?t=1727661432800') format('truetype');
20
+ }
21
+
22
+ /* #endif */
@@ -0,0 +1,14 @@
1
+ export default {
2
+ code: { type: String, default: '' },
3
+ size: { type: [String, Number], default: 28 },
4
+ scale: { type: Number, default: 1 },
5
+ color: { type: String, default: '' },
6
+ bold: { type: Boolean, default: false },
7
+ marginLeft: { type: [String, Number], default: 0 },
8
+ marginRight: { type: [String, Number], default: 0 },
9
+ marginTop: { type: [String, Number], default: 0 },
10
+ marginBottom: { type: [String, Number], default: 0 },
11
+ fontFamily: { type: String, default: '' },
12
+ showBorder: { type: Boolean, default: false },
13
+ inlineBlock: { type: Boolean, default: true },
14
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "ste-icon",
3
+ "description": "图标组件 基于字体的图标集,包含了大多数常见场景的图标",
4
+ "example": "<ste-icon></ste-icon>",
5
+ "tutorial": "https://stellar-ui.intecloud.com.cn/plus/#/?active=icon",
6
+ "attributes": [
7
+ {
8
+ "name": "code",
9
+ "description": "图标名称",
10
+ "type": "string"
11
+ },
12
+ {
13
+ "name": "color",
14
+ "description": "图标颜色",
15
+ "type": "string"
16
+ },
17
+ {
18
+ "name": "size",
19
+ "description": "图标大小,单位rpx",
20
+ "type": "string | number",
21
+ "default": 28
22
+ },
23
+ {
24
+ "name": "bold",
25
+ "description": "图标是否粗体",
26
+ "type": "boolean",
27
+ "default": false
28
+ },
29
+ {
30
+ "name": "marginLeft",
31
+ "description": "左外边距,单位rpx",
32
+ "type": "string | number",
33
+ "default": 0
34
+ },
35
+ {
36
+ "name": "marginRight",
37
+ "description": "右外边距,单位rpx",
38
+ "type": "string | number",
39
+ "default": 0
40
+ },
41
+ {
42
+ "name": "marginTop",
43
+ "description": "上外边距,单位rpx",
44
+ "type": "string | number",
45
+ "default": 0
46
+ },
47
+ {
48
+ "name": "marginBottom",
49
+ "description": "下外边距,单位rpx",
50
+ "type": "string | number",
51
+ "default": 0
52
+ },
53
+ {
54
+ "name": "fontFamily",
55
+ "description": "字体名",
56
+ "type": "string",
57
+ "default": ""
58
+ },
59
+ {
60
+ "name": "inlineBlock",
61
+ "description": "容器对齐方式",
62
+ "type": "boolean",
63
+ "default": true
64
+ },
65
+ {
66
+ "name": "[event]click",
67
+ "description": "图标点击回调事件",
68
+ "type": "() => void"
69
+ }
70
+ ]
71
+ }
@@ -0,0 +1,80 @@
1
+ <script setup lang="ts">
2
+ import { computed, defineOptions } from 'vue';
3
+ import propsData from './props';
4
+ import utils from '../../utils/utils';
5
+
6
+ const componentName = `ste-icon`;
7
+
8
+ defineOptions({
9
+ name: componentName,
10
+ options: {
11
+ virtualHost: true,
12
+ },
13
+ });
14
+
15
+ const props = defineProps(propsData);
16
+ const emits = defineEmits<{
17
+ (e: 'click', event?: Event): void;
18
+ }>();
19
+
20
+ let defaultFontFamily = 'ste-iconfont-1709689042473';
21
+
22
+ const cmpCode = computed(() => {
23
+ // unicode编码转字符
24
+ if (!props.code) return;
25
+ if (/[a-zA-Z]/.test(props.code)) {
26
+ return String.fromCharCode(props.code.replace('&#', '0').replace(';', '') as any);
27
+ } else {
28
+ return props.code;
29
+ }
30
+ });
31
+
32
+ const cmpCssVar = computed(() => {
33
+ return {
34
+ '--border': props.showBorder ? '1px' : '0px',
35
+ '--color': props.color,
36
+ '--size': `var(--font-size-${props.size},${utils.formatPx(props.size)})`,
37
+ '--weight': props.bold ? 'bold' : 'normal',
38
+ '--margin-left': utils.formatPx(props.marginLeft),
39
+ '--margin-right': utils.formatPx(props.marginRight),
40
+ '--margin-top': utils.formatPx(props.marginTop),
41
+ '--margin-bottom': utils.formatPx(props.marginBottom),
42
+ '--font-family': props.fontFamily ? props.fontFamily : defaultFontFamily,
43
+ '--display': props.inlineBlock ? 'inline-block' : 'inline-flex',
44
+ };
45
+ });
46
+
47
+ function handleClick(event: any) {
48
+ emits('click', event);
49
+ }
50
+ </script>
51
+
52
+ <template>
53
+ <view class="ste-icon-root" :style="[cmpCssVar]" @click="handleClick">{{ cmpCode }}</view>
54
+ </template>
55
+
56
+ <style lang="scss" scoped>
57
+ @import './iconfont.css';
58
+
59
+ .ste-icon-root {
60
+ display: var(--display);
61
+ justify-content: center;
62
+ align-items: center;
63
+ vertical-align: baseline;
64
+ border-width: var(--border);
65
+ border-color: #bbb;
66
+ border-style: solid;
67
+
68
+ margin-left: var(--margin-left) !important;
69
+ margin-right: var(--margin-right) !important;
70
+ transform: translateY(calc(var(--margin-bottom) - var(--margin-top))) !important;
71
+
72
+ // height: calc(var(--size)) !important;
73
+ width: calc(var(--size)) !important;
74
+ line-height: calc(var(--size) - var(--border) * 2) !important;
75
+ font-family: var(--font-family) !important;
76
+ font-size: calc(var(--size) - var(--border) * 2) !important;
77
+ color: var(--color);
78
+ font-weight: var(--weight) !important;
79
+ }
80
+ </style>