@wot-ui/ui 1.0.0 → 2.0.0-alpha.4

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 (386) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +134 -0
  3. package/attributes.json +1 -0
  4. package/changelog.md +63 -0
  5. package/common/AbortablePromise.ts +28 -0
  6. package/common/canvasHelper.ts +49 -0
  7. package/common/clickoutside.ts +25 -0
  8. package/common/event.ts +8 -0
  9. package/common/formatDate.ts +68 -0
  10. package/common/interceptor.ts +43 -0
  11. package/common/props.ts +53 -0
  12. package/common/util.ts +836 -0
  13. package/components/wd-action-sheet/index.scss +232 -0
  14. package/components/wd-action-sheet/types.ts +155 -0
  15. package/components/wd-action-sheet/wd-action-sheet.vue +176 -0
  16. package/components/wd-avatar/index.scss +150 -0
  17. package/components/wd-avatar/types.ts +98 -0
  18. package/components/wd-avatar/wd-avatar.vue +184 -0
  19. package/components/wd-avatar-group/index.scss +11 -0
  20. package/components/wd-avatar-group/types.ts +61 -0
  21. package/components/wd-avatar-group/wd-avatar-group.vue +115 -0
  22. package/components/wd-backtop/index.scss +67 -0
  23. package/components/wd-backtop/types.ts +66 -0
  24. package/components/wd-backtop/wd-backtop.vue +57 -0
  25. package/components/wd-badge/index.scss +116 -0
  26. package/components/wd-badge/types.ts +94 -0
  27. package/components/wd-badge/wd-badge.vue +78 -0
  28. package/components/wd-button/index.scss +436 -0
  29. package/components/wd-button/types.ts +204 -0
  30. package/components/wd-button/wd-button.vue +210 -0
  31. package/components/wd-calendar/index.scss +97 -0
  32. package/components/wd-calendar/types.ts +221 -0
  33. package/components/wd-calendar/wd-calendar.vue +339 -0
  34. package/components/wd-calendar-view/index.scss +41 -0
  35. package/components/wd-calendar-view/month/index.scss +144 -0
  36. package/components/wd-calendar-view/month/month.vue +389 -0
  37. package/components/wd-calendar-view/month/types.ts +70 -0
  38. package/components/wd-calendar-view/monthPanel/index.scss +84 -0
  39. package/components/wd-calendar-view/monthPanel/month-panel.vue +541 -0
  40. package/components/wd-calendar-view/monthPanel/types.ts +151 -0
  41. package/components/wd-calendar-view/types.ts +166 -0
  42. package/components/wd-calendar-view/utils.ts +318 -0
  43. package/components/wd-calendar-view/wd-calendar-view.vue +117 -0
  44. package/components/wd-calendar-view/year/index.scss +148 -0
  45. package/components/wd-calendar-view/year/types.ts +74 -0
  46. package/components/wd-calendar-view/year/year.vue +206 -0
  47. package/components/wd-calendar-view/yearPanel/index.scss +42 -0
  48. package/components/wd-calendar-view/yearPanel/types.ts +96 -0
  49. package/components/wd-calendar-view/yearPanel/year-panel.vue +249 -0
  50. package/components/wd-card/index.scss +104 -0
  51. package/components/wd-card/types.ts +47 -0
  52. package/components/wd-card/wd-card.vue +38 -0
  53. package/components/wd-cascader/index.scss +154 -0
  54. package/components/wd-cascader/types.ts +191 -0
  55. package/components/wd-cascader/wd-cascader.vue +589 -0
  56. package/components/wd-cell/index.scss +244 -0
  57. package/components/wd-cell/types.ts +205 -0
  58. package/components/wd-cell/wd-cell.vue +172 -0
  59. package/components/wd-cell-group/index.scss +53 -0
  60. package/components/wd-cell-group/types.ts +97 -0
  61. package/components/wd-cell-group/wd-cell-group.vue +48 -0
  62. package/components/wd-checkbox/index.scss +166 -0
  63. package/components/wd-checkbox/types.ts +118 -0
  64. package/components/wd-checkbox/wd-checkbox.vue +216 -0
  65. package/components/wd-checkbox-group/index.scss +5 -0
  66. package/components/wd-checkbox-group/types.ts +93 -0
  67. package/components/wd-checkbox-group/wd-checkbox-group.vue +148 -0
  68. package/components/wd-circle/index.scss +28 -0
  69. package/components/wd-circle/types.ts +54 -0
  70. package/components/wd-circle/wd-circle.vue +306 -0
  71. package/components/wd-col/index.scss +5 -0
  72. package/components/wd-col/types.ts +16 -0
  73. package/components/wd-col/wd-col.vue +83 -0
  74. package/components/wd-collapse/index.scss +71 -0
  75. package/components/wd-collapse/types.ts +68 -0
  76. package/components/wd-collapse/wd-collapse.vue +165 -0
  77. package/components/wd-collapse-item/index.scss +86 -0
  78. package/components/wd-collapse-item/types.ts +62 -0
  79. package/components/wd-collapse-item/wd-collapse-item.vue +184 -0
  80. package/components/wd-config-provider/index.scss +10 -0
  81. package/components/wd-config-provider/types.ts +2061 -0
  82. package/components/wd-config-provider/wd-config-provider.vue +61 -0
  83. package/components/wd-count-down/index.scss +16 -0
  84. package/components/wd-count-down/types.ts +58 -0
  85. package/components/wd-count-down/utils.ts +52 -0
  86. package/components/wd-count-down/wd-count-down.vue +62 -0
  87. package/components/wd-count-to/index.scss +25 -0
  88. package/components/wd-count-to/types.ts +121 -0
  89. package/components/wd-count-to/wd-count-to.vue +126 -0
  90. package/components/wd-curtain/index.scss +96 -0
  91. package/components/wd-curtain/types.ts +82 -0
  92. package/components/wd-curtain/wd-curtain.vue +172 -0
  93. package/components/wd-datetime-picker/index.scss +133 -0
  94. package/components/wd-datetime-picker/types.ts +198 -0
  95. package/components/wd-datetime-picker/wd-datetime-picker.vue +526 -0
  96. package/components/wd-datetime-picker-view/types.ts +171 -0
  97. package/components/wd-datetime-picker-view/util.ts +30 -0
  98. package/components/wd-datetime-picker-view/wd-datetime-picker-view.vue +402 -0
  99. package/components/wd-dialog/index.scss +281 -0
  100. package/components/wd-dialog/index.ts +168 -0
  101. package/components/wd-dialog/types.ts +452 -0
  102. package/components/wd-dialog/wd-dialog.vue +586 -0
  103. package/components/wd-divider/index.scss +122 -0
  104. package/components/wd-divider/types.ts +50 -0
  105. package/components/wd-divider/wd-divider.vue +54 -0
  106. package/components/wd-drop-menu/index.scss +90 -0
  107. package/components/wd-drop-menu/types.ts +38 -0
  108. package/components/wd-drop-menu/wd-drop-menu.vue +168 -0
  109. package/components/wd-drop-menu-item/index.scss +96 -0
  110. package/components/wd-drop-menu-item/types.ts +93 -0
  111. package/components/wd-drop-menu-item/wd-drop-menu-item.vue +205 -0
  112. package/components/wd-empty/index.scss +46 -0
  113. package/components/wd-empty/types.ts +37 -0
  114. package/components/wd-empty/wd-empty.vue +47 -0
  115. package/components/wd-fab/index.scss +124 -0
  116. package/components/wd-fab/types.ts +119 -0
  117. package/components/wd-fab/wd-fab.vue +322 -0
  118. package/components/wd-floating-panel/index.scss +73 -0
  119. package/components/wd-floating-panel/type.ts +32 -0
  120. package/components/wd-floating-panel/wd-floating-panel.vue +142 -0
  121. package/components/wd-form/adapters/zod.ts +56 -0
  122. package/components/wd-form/index.ts +2 -0
  123. package/components/wd-form/types.ts +133 -0
  124. package/components/wd-form/wd-form.vue +121 -0
  125. package/components/wd-form-item/index.scss +26 -0
  126. package/components/wd-form-item/types.ts +134 -0
  127. package/components/wd-form-item/wd-form-item.vue +182 -0
  128. package/components/wd-gap/index.scss +9 -0
  129. package/components/wd-gap/types.ts +26 -0
  130. package/components/wd-gap/wd-gap.vue +38 -0
  131. package/components/wd-grid/index.scss +11 -0
  132. package/components/wd-grid/types.ts +97 -0
  133. package/components/wd-grid/wd-grid.vue +48 -0
  134. package/components/wd-grid-item/index.scss +187 -0
  135. package/components/wd-grid-item/types.ts +98 -0
  136. package/components/wd-grid-item/wd-grid-item.vue +295 -0
  137. package/components/wd-icon/index.scss +46 -0
  138. package/components/wd-icon/types.ts +44 -0
  139. package/components/wd-icon/wd-icon.vue +66 -0
  140. package/components/wd-image-preview/index.scss +94 -0
  141. package/components/wd-image-preview/index.ts +95 -0
  142. package/components/wd-image-preview/types.ts +165 -0
  143. package/components/wd-image-preview/wd-image-preview.vue +233 -0
  144. package/components/wd-img/index.scss +82 -0
  145. package/components/wd-img/types.ts +96 -0
  146. package/components/wd-img/wd-img.vue +91 -0
  147. package/components/wd-img-cropper/index.scss +259 -0
  148. package/components/wd-img-cropper/types.ts +101 -0
  149. package/components/wd-img-cropper/wd-img-cropper.vue +653 -0
  150. package/components/wd-index-anchor/index.scss +34 -0
  151. package/components/wd-index-anchor/type.ts +9 -0
  152. package/components/wd-index-anchor/wd-index-anchor.vue +55 -0
  153. package/components/wd-index-bar/index.scss +68 -0
  154. package/components/wd-index-bar/type.ts +23 -0
  155. package/components/wd-index-bar/wd-index-bar.vue +157 -0
  156. package/components/wd-input/index.scss +129 -0
  157. package/components/wd-input/types.ts +165 -0
  158. package/components/wd-input/wd-input.vue +237 -0
  159. package/components/wd-input-number/index.scss +233 -0
  160. package/components/wd-input-number/types.ts +131 -0
  161. package/components/wd-input-number/wd-input-number.vue +473 -0
  162. package/components/wd-keyboard/constants.ts +81 -0
  163. package/components/wd-keyboard/index.scss +104 -0
  164. package/components/wd-keyboard/key/index.scss +103 -0
  165. package/components/wd-keyboard/key/index.vue +84 -0
  166. package/components/wd-keyboard/key/types.ts +44 -0
  167. package/components/wd-keyboard/types.ts +138 -0
  168. package/components/wd-keyboard/wd-keyboard.vue +236 -0
  169. package/components/wd-loading/index.scss +205 -0
  170. package/components/wd-loading/types.ts +61 -0
  171. package/components/wd-loading/wd-loading.vue +70 -0
  172. package/components/wd-loadmore/index.scss +62 -0
  173. package/components/wd-loadmore/types.ts +42 -0
  174. package/components/wd-loadmore/wd-loadmore.vue +68 -0
  175. package/components/wd-navbar/index.scss +96 -0
  176. package/components/wd-navbar/types.ts +74 -0
  177. package/components/wd-navbar/wd-navbar.vue +136 -0
  178. package/components/wd-navbar-capsule/index.scss +70 -0
  179. package/components/wd-navbar-capsule/types.ts +11 -0
  180. package/components/wd-navbar-capsule/wd-navbar-capsule.vue +48 -0
  181. package/components/wd-notice-bar/index.scss +94 -0
  182. package/components/wd-notice-bar/types.ts +97 -0
  183. package/components/wd-notice-bar/wd-notice-bar.vue +270 -0
  184. package/components/wd-notify/index.scss +114 -0
  185. package/components/wd-notify/index.ts +63 -0
  186. package/components/wd-notify/types.ts +130 -0
  187. package/components/wd-notify/wd-notify.vue +162 -0
  188. package/components/wd-overlay/index.scss +14 -0
  189. package/components/wd-overlay/types.ts +42 -0
  190. package/components/wd-overlay/wd-overlay.vue +55 -0
  191. package/components/wd-pagination/index.scss +71 -0
  192. package/components/wd-pagination/types.ts +69 -0
  193. package/components/wd-pagination/wd-pagination.vue +118 -0
  194. package/components/wd-password-input/index.scss +134 -0
  195. package/components/wd-password-input/types.ts +42 -0
  196. package/components/wd-password-input/wd-password-input.vue +51 -0
  197. package/components/wd-picker/index.scss +72 -0
  198. package/components/wd-picker/types.ts +141 -0
  199. package/components/wd-picker/wd-picker.vue +220 -0
  200. package/components/wd-picker-view/index.scss +93 -0
  201. package/components/wd-picker-view/types.ts +145 -0
  202. package/components/wd-picker-view/useSelection.ts +385 -0
  203. package/components/wd-picker-view/wd-picker-view.vue +227 -0
  204. package/components/wd-popover/index.scss +117 -0
  205. package/components/wd-popover/types.ts +106 -0
  206. package/components/wd-popover/wd-popover.vue +212 -0
  207. package/components/wd-popup/index.scss +89 -0
  208. package/components/wd-popup/types.ts +110 -0
  209. package/components/wd-popup/wd-popup.vue +174 -0
  210. package/components/wd-progress/index.scss +155 -0
  211. package/components/wd-progress/types.ts +94 -0
  212. package/components/wd-progress/wd-progress.vue +249 -0
  213. package/components/wd-radio/index.scss +189 -0
  214. package/components/wd-radio/types.ts +64 -0
  215. package/components/wd-radio/wd-radio.vue +164 -0
  216. package/components/wd-radio-group/index.scss +5 -0
  217. package/components/wd-radio-group/types.ts +70 -0
  218. package/components/wd-radio-group/wd-radio-group.vue +53 -0
  219. package/components/wd-rate/index.scss +57 -0
  220. package/components/wd-rate/types.ts +86 -0
  221. package/components/wd-rate/wd-rate.vue +168 -0
  222. package/components/wd-resize/index.scss +31 -0
  223. package/components/wd-resize/types.ts +14 -0
  224. package/components/wd-resize/wd-resize.vue +157 -0
  225. package/components/wd-root-portal/wd-root-portal.vue +77 -0
  226. package/components/wd-row/index.scss +6 -0
  227. package/components/wd-row/types.ts +36 -0
  228. package/components/wd-row/wd-row.vue +88 -0
  229. package/components/wd-search/index.scss +171 -0
  230. package/components/wd-search/types.ts +107 -0
  231. package/components/wd-search/wd-search.vue +198 -0
  232. package/components/wd-segmented/index.scss +155 -0
  233. package/components/wd-segmented/types.ts +81 -0
  234. package/components/wd-segmented/wd-segmented.vue +169 -0
  235. package/components/wd-select-picker/index.scss +72 -0
  236. package/components/wd-select-picker/types.ts +72 -0
  237. package/components/wd-select-picker/wd-select-picker.vue +371 -0
  238. package/components/wd-sidebar/index.scss +25 -0
  239. package/components/wd-sidebar/types.ts +34 -0
  240. package/components/wd-sidebar/wd-sidebar.vue +57 -0
  241. package/components/wd-sidebar-item/index.scss +91 -0
  242. package/components/wd-sidebar-item/types.ts +28 -0
  243. package/components/wd-sidebar-item/wd-sidebar-item.vue +118 -0
  244. package/components/wd-signature/index.scss +42 -0
  245. package/components/wd-signature/types.ts +295 -0
  246. package/components/wd-signature/wd-signature.vue +664 -0
  247. package/components/wd-skeleton/index.scss +112 -0
  248. package/components/wd-skeleton/types.ts +124 -0
  249. package/components/wd-skeleton/wd-skeleton.vue +110 -0
  250. package/components/wd-slide-verify/index.scss +112 -0
  251. package/components/wd-slide-verify/types.ts +98 -0
  252. package/components/wd-slide-verify/wd-slide-verify.vue +222 -0
  253. package/components/wd-slider/index.scss +485 -0
  254. package/components/wd-slider/types.ts +166 -0
  255. package/components/wd-slider/wd-slider.vue +529 -0
  256. package/components/wd-sort-button/index.scss +126 -0
  257. package/components/wd-sort-button/types.ts +68 -0
  258. package/components/wd-sort-button/wd-sort-button.vue +67 -0
  259. package/components/wd-step/index.scss +366 -0
  260. package/components/wd-step/types.ts +43 -0
  261. package/components/wd-step/wd-step.vue +181 -0
  262. package/components/wd-steps/index.scss +7 -0
  263. package/components/wd-steps/types.ts +50 -0
  264. package/components/wd-steps/wd-steps.vue +39 -0
  265. package/components/wd-sticky/index.scss +9 -0
  266. package/components/wd-sticky/types.ts +13 -0
  267. package/components/wd-sticky/wd-sticky.vue +192 -0
  268. package/components/wd-sticky-box/index.scss +6 -0
  269. package/components/wd-sticky-box/types.ts +20 -0
  270. package/components/wd-sticky-box/wd-sticky-box.vue +157 -0
  271. package/components/wd-swipe-action/index.scss +22 -0
  272. package/components/wd-swipe-action/types.ts +87 -0
  273. package/components/wd-swipe-action/wd-swipe-action.vue +320 -0
  274. package/components/wd-swiper/index.scss +69 -0
  275. package/components/wd-swiper/types.ts +275 -0
  276. package/components/wd-swiper/wd-swiper.vue +332 -0
  277. package/components/wd-swiper-nav/index.scss +179 -0
  278. package/components/wd-swiper-nav/types.ts +42 -0
  279. package/components/wd-swiper-nav/wd-swiper-nav.vue +42 -0
  280. package/components/wd-switch/index.scss +177 -0
  281. package/components/wd-switch/types.ts +93 -0
  282. package/components/wd-switch/wd-switch.vue +107 -0
  283. package/components/wd-tab/index.scss +16 -0
  284. package/components/wd-tab/types.ts +45 -0
  285. package/components/wd-tab/wd-tab.vue +99 -0
  286. package/components/wd-tabbar/index.scss +71 -0
  287. package/components/wd-tabbar/types.ts +79 -0
  288. package/components/wd-tabbar/wd-tabbar.vue +109 -0
  289. package/components/wd-tabbar-item/index.scss +50 -0
  290. package/components/wd-tabbar-item/types.ts +45 -0
  291. package/components/wd-tabbar-item/wd-tabbar-item.vue +101 -0
  292. package/components/wd-table/index.scss +128 -0
  293. package/components/wd-table/types.ts +160 -0
  294. package/components/wd-table/wd-table.vue +331 -0
  295. package/components/wd-table-column/index.scss +15 -0
  296. package/components/wd-table-column/types.ts +81 -0
  297. package/components/wd-table-column/wd-table-column.vue +198 -0
  298. package/components/wd-tabs/index.scss +332 -0
  299. package/components/wd-tabs/types.ts +155 -0
  300. package/components/wd-tabs/wd-tabs.vue +508 -0
  301. package/components/wd-tag/index.scss +325 -0
  302. package/components/wd-tag/types.ts +90 -0
  303. package/components/wd-tag/wd-tag.vue +158 -0
  304. package/components/wd-text/index.scss +52 -0
  305. package/components/wd-text/types.ts +107 -0
  306. package/components/wd-text/wd-text.vue +141 -0
  307. package/components/wd-textarea/index.scss +112 -0
  308. package/components/wd-textarea/types.ts +151 -0
  309. package/components/wd-textarea/wd-textarea.vue +212 -0
  310. package/components/wd-toast/index.scss +92 -0
  311. package/components/wd-toast/index.ts +97 -0
  312. package/components/wd-toast/types.ts +190 -0
  313. package/components/wd-toast/wd-toast.vue +158 -0
  314. package/components/wd-tooltip/index.scss +77 -0
  315. package/components/wd-tooltip/types.ts +105 -0
  316. package/components/wd-tooltip/wd-tooltip.vue +169 -0
  317. package/components/wd-tour/index.scss +106 -0
  318. package/components/wd-tour/types.ts +268 -0
  319. package/components/wd-tour/wd-tour.vue +518 -0
  320. package/components/wd-transition/index.scss +67 -0
  321. package/components/wd-transition/types.ts +106 -0
  322. package/components/wd-transition/wd-transition.vue +238 -0
  323. package/components/wd-upload/index.scss +204 -0
  324. package/components/wd-upload/types.ts +390 -0
  325. package/components/wd-upload/wd-upload.vue +565 -0
  326. package/components/wd-video-preview/index.scss +54 -0
  327. package/components/wd-video-preview/index.ts +64 -0
  328. package/components/wd-video-preview/types.ts +66 -0
  329. package/components/wd-video-preview/wd-video-preview.vue +141 -0
  330. package/components/wd-watermark/index.scss +21 -0
  331. package/components/wd-watermark/types.ts +130 -0
  332. package/components/wd-watermark/wd-watermark.vue +718 -0
  333. package/components/wot-ui/wot-ui.vue +5 -0
  334. package/composables/index.ts +16 -0
  335. package/composables/useCell.ts +34 -0
  336. package/composables/useChildren.ts +120 -0
  337. package/composables/useConfigProvider.ts +45 -0
  338. package/composables/useCountDown.ts +138 -0
  339. package/composables/useDeviceInfo.ts +136 -0
  340. package/composables/useLockScroll.ts +37 -0
  341. package/composables/useParent.ts +51 -0
  342. package/composables/usePopover.ts +212 -0
  343. package/composables/useQueue.ts +52 -0
  344. package/composables/useRaf.ts +37 -0
  345. package/composables/useTouch.ts +43 -0
  346. package/composables/useTranslate.ts +12 -0
  347. package/composables/useUpload.ts +366 -0
  348. package/global.d.ts +106 -0
  349. package/index.ts +6 -0
  350. package/locale/index.ts +32 -0
  351. package/locale/lang/ar-SA.ts +150 -0
  352. package/locale/lang/de-DE.ts +150 -0
  353. package/locale/lang/en-US.ts +150 -0
  354. package/locale/lang/es-ES.ts +150 -0
  355. package/locale/lang/fr-FR.ts +150 -0
  356. package/locale/lang/ja-JP.ts +150 -0
  357. package/locale/lang/ko-KR.ts +150 -0
  358. package/locale/lang/pt-PT.ts +150 -0
  359. package/locale/lang/ru-RU.ts +150 -0
  360. package/locale/lang/th-TH.ts +150 -0
  361. package/locale/lang/tr-TR.ts +155 -0
  362. package/locale/lang/ug-CN.ts +154 -0
  363. package/locale/lang/vi-VN.ts +89 -0
  364. package/locale/lang/zh-CN.ts +154 -0
  365. package/locale/lang/zh-HK.ts +78 -0
  366. package/locale/lang/zh-TW.ts +78 -0
  367. package/package.json +1 -11
  368. package/styles/iconfont/iconfont.scss +1243 -0
  369. package/styles/mixin/_config.scss +7 -0
  370. package/styles/mixin/_function.scss +44 -0
  371. package/styles/mixin/_mixin.scss +473 -0
  372. package/styles/theme/base/color.scss +210 -0
  373. package/styles/theme/base/font.scss +13 -0
  374. package/styles/theme/base/index.scss +8 -0
  375. package/styles/theme/base/insets.scss +32 -0
  376. package/styles/theme/base/number.scss +36 -0
  377. package/styles/theme/base/opacity.scss +9 -0
  378. package/styles/theme/base/radius.scss +13 -0
  379. package/styles/theme/base/stroke.scss +9 -0
  380. package/styles/theme/base/typography.scss +44 -0
  381. package/styles/theme/dark.scss +101 -0
  382. package/styles/theme/index.scss +16 -0
  383. package/styles/theme/light.scss +101 -0
  384. package/styles/variable.scss +472 -0
  385. package/tags.json +1 -0
  386. package/web-types.json +1 -0
@@ -0,0 +1,7 @@
1
+ /**
2
+ * SCSS 配置项:命名空间以及BEM
3
+ */
4
+ $namespace: 'wd';
5
+ $elementSeparator: '__';
6
+ $modifierSeparator: '--';
7
+ $state-prefix: 'is-';
@@ -0,0 +1,44 @@
1
+ /**
2
+ * 辅助函数
3
+ */
4
+ @use "sass:meta";
5
+ @use "sass:string";
6
+ @use 'config';
7
+
8
+ /* 转换成字符串 */
9
+ @function selectorToString($selector) {
10
+ $selector: meta.inspect($selector);
11
+ $selector: string.slice($selector, 2, -2);
12
+
13
+ @return $selector;
14
+ }
15
+
16
+ /* 判断是否存在 Modifier */
17
+ @function containsModifier($selector) {
18
+ $selector: selectorToString($selector);
19
+
20
+ @if string.index($selector, config.$modifierSeparator) {
21
+ @return true;
22
+ }
23
+
24
+ @else {
25
+ @return false;
26
+ }
27
+ }
28
+
29
+ /* 判断是否存在伪类 */
30
+ @function containsPseudo($selector) {
31
+ $selector: selectorToString($selector);
32
+
33
+ @if string.index($selector, ':') {
34
+ @return true;
35
+ }
36
+
37
+ @else {
38
+ @return false;
39
+ }
40
+ }
41
+
42
+
43
+
44
+
@@ -0,0 +1,473 @@
1
+ @use "../variable";
2
+
3
+ /**
4
+ * 混合宏
5
+ */
6
+ @use "config";
7
+ @use "function";
8
+
9
+ $B: null;
10
+
11
+ /**
12
+ * BEM,定义块(b)
13
+ */
14
+ @mixin b($block) {
15
+ $B: config.$namespace + "-"+ $block !global;
16
+
17
+ .#{$B} {
18
+ @content;
19
+ }
20
+ }
21
+
22
+ /* 定义元素(e),对于伪类,会自动将 e 嵌套在 伪类 底下 */
23
+ @mixin e($element...) {
24
+ $selector: &;
25
+ $selectors: "";
26
+
27
+ @if function.containsPseudo($selector) {
28
+ @each $item in $element {
29
+ $selectors: #{$selectors + "." + $B + config.$elementSeparator + $item + ","};
30
+ }
31
+
32
+ @at-root {
33
+ #{$selector} {
34
+ #{$selectors} {
35
+ @content;
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ @else {
42
+ @each $item in $element {
43
+ $selectors: #{$selectors + $selector + config.$elementSeparator + $item + ","};
44
+ }
45
+
46
+ @at-root {
47
+ #{$selectors} {
48
+ @content;
49
+ }
50
+ }
51
+ }
52
+ }
53
+
54
+
55
+
56
+ /* 此方法用于生成穿透样式 */
57
+
58
+ /* 定义元素(e),对于伪类,会自动将 e 嵌套在 伪类 底下 */
59
+ @mixin edeep($element...) {
60
+ $selector: &;
61
+ $selectors: "";
62
+
63
+ @if function.containsPseudo($selector) {
64
+ @each $item in $element {
65
+ $selectors: #{$selectors + "." + $B + config.$elementSeparator + $item + ","};
66
+ }
67
+
68
+ @at-root {
69
+ #{$selector} {
70
+ :deep() {
71
+ #{$selectors} {
72
+ @content;
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
78
+
79
+ @else {
80
+ @each $item in $element {
81
+ $selectors: #{$selectors + "." + $B + config.$elementSeparator + $item + ","};
82
+ }
83
+
84
+ :deep() {
85
+ #{$selectors} {
86
+ @content;
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+
93
+ /* 定义状态(m) */
94
+ @mixin m($modifier...) {
95
+ $selectors: "";
96
+
97
+ @each $item in $modifier {
98
+ $selectors: #{$selectors + & + config.$modifierSeparator + $item + ","};
99
+ }
100
+
101
+ @at-root {
102
+ #{$selectors} {
103
+ @content;
104
+ }
105
+ }
106
+ }
107
+
108
+ /* 过渡帧(enter 与 leave-to) */
109
+ @mixin transitionFrame($names...) {
110
+ $selector: &;
111
+ $selectors: "";
112
+
113
+ @each $name in $names {
114
+ $selectors: #{$selectors + $selector + config.$modifierSeparator + $name + "-enter,"};
115
+ $selectors: #{$selectors + $selector + config.$modifierSeparator + $name + "-leave-to,"};
116
+ }
117
+
118
+ @at-root {
119
+ #{$selectors} {
120
+ @content;
121
+ }
122
+ }
123
+ }
124
+
125
+ /* 过渡激活态(enter-active 与 leave-active) */
126
+ @mixin transitionActive($names...) {
127
+ $selector: &;
128
+ $selectors: "";
129
+
130
+ @each $name in $names {
131
+ $selectors: #{$selectors + $selector + config.$modifierSeparator + $name + "-enter-active,"};
132
+ $selectors: #{$selectors + $selector + config.$modifierSeparator + $name + "-leave-active,"};
133
+ }
134
+
135
+ @at-root {
136
+ #{$selectors} {
137
+ @content;
138
+ }
139
+ }
140
+ }
141
+
142
+ /* 定义状态(m) */
143
+ @mixin mdeep($modifier...) {
144
+ $selectors: "";
145
+
146
+ @each $item in $modifier {
147
+ $selectors: #{$selectors + & + config.$modifierSeparator + $item + ","};
148
+ }
149
+
150
+ @at-root {
151
+ :deep() {
152
+ #{$selectors} {
153
+ @content;
154
+ }
155
+ }
156
+ }
157
+ }
158
+
159
+ /* 对于需要需要嵌套在 m 底下的 e,调用这个混合宏,一般在切换整个组件的状态,如切换颜色的时候 */
160
+ @mixin me($element...) {
161
+ $selector: &;
162
+ $selectors: "";
163
+
164
+ @if function.containsModifier($selector) {
165
+ @each $item in $element {
166
+ $selectors: #{$selectors + "." + $B + config.$elementSeparator + $item + ","};
167
+ }
168
+
169
+ @at-root {
170
+ #{$selector} {
171
+ #{$selectors} {
172
+ @content;
173
+ }
174
+ }
175
+ }
176
+ }
177
+
178
+ @else {
179
+ @each $item in $element {
180
+ $selectors: #{$selectors + $selector + config.$elementSeparator + $item + ","};
181
+ }
182
+
183
+ @at-root {
184
+ #{$selectors} {
185
+ @content;
186
+ }
187
+ }
188
+ }
189
+ }
190
+
191
+ /* 状态,生成 is-$state 类名 */
192
+ @mixin when($states...) {
193
+ @at-root {
194
+ @each $state in $states {
195
+ &.#{config.$state-prefix + $state} {
196
+ @content;
197
+ }
198
+ }
199
+ }
200
+ }
201
+
202
+ /**
203
+ * 常用混合宏
204
+ */
205
+
206
+ /* 单行超出隐藏 */
207
+ @mixin lineEllipsis {
208
+ overflow: hidden;
209
+ text-overflow: ellipsis;
210
+ white-space: nowrap;
211
+ }
212
+
213
+ /* 多行超出隐藏 */
214
+ @mixin multiEllipsis($lineNumber: 3) {
215
+ display: -webkit-box;
216
+ -webkit-box-orient: vertical;
217
+ -webkit-line-clamp: $lineNumber;
218
+ overflow: hidden;
219
+ }
220
+
221
+ /* 清除浮动 */
222
+ @mixin clearFloat {
223
+ &::after {
224
+ display: block;
225
+ content: "";
226
+ height: 0;
227
+ clear: both;
228
+ overflow: hidden;
229
+ visibility: hidden;
230
+ }
231
+ }
232
+
233
+ /* 0.5px 边框 指定方向*/
234
+ @mixin halfPixelBorder($direction: "bottom", $left: 0, $color: variable.$border-main) {
235
+ position: relative;
236
+
237
+ &::after {
238
+ position: absolute;
239
+ display: block;
240
+ content: "";
241
+
242
+ @if ($left==0) {
243
+ width: 100%;
244
+ }
245
+
246
+ @else {
247
+ width: calc(100% - #{$left} * 2);
248
+ }
249
+
250
+ height: variable.$stroke-main;
251
+ left: $left;
252
+
253
+ @if ($direction=="bottom") {
254
+ bottom: 0;
255
+ }
256
+
257
+ @else {
258
+ top: 0;
259
+ }
260
+
261
+ transform: scaleY(0.5);
262
+ background: $color;
263
+ }
264
+ }
265
+
266
+
267
+ /* 0.5px 边框 环绕 */
268
+ @mixin halfPixelBorderSurround($color: variable.$border-main) {
269
+ position: relative;
270
+
271
+ &::after {
272
+ position: absolute;
273
+ display: block;
274
+ content: ' ';
275
+ pointer-events: none;
276
+ width: 200%;
277
+ height: 200%;
278
+ left: 0;
279
+ top: 0;
280
+ border: variable.$stroke-main solid $color;
281
+ transform: scale(0.5);
282
+ box-sizing: border-box;
283
+ transform-origin: left top;
284
+ border-radius: inherit;
285
+ }
286
+ }
287
+
288
+ /* 1px 边框 指定方向 */
289
+ @mixin pixelBorder($direction: "bottom", $left: 0, $color: variable.$border-main, $width: variable.$stroke-main) {
290
+ position: relative;
291
+
292
+ &::after {
293
+ position: absolute;
294
+ display: block;
295
+ content: "";
296
+
297
+ @if ($left==0) {
298
+ width: 100%;
299
+ }
300
+
301
+ @else {
302
+ width: calc(100% - #{$left} * 2);
303
+ }
304
+
305
+ height: $width;
306
+ left: $left;
307
+
308
+ @if ($direction=="bottom") {
309
+ bottom: 0;
310
+ }
311
+
312
+ @else {
313
+ top: 0;
314
+ }
315
+
316
+ background: $color;
317
+ }
318
+ }
319
+
320
+ /* 1px 边框 环绕 */
321
+ @mixin pixelBorderSurround($color: variable.$border-main, $style: solid, $width: variable.$stroke-main) {
322
+ position: relative;
323
+
324
+ &::after {
325
+ position: absolute;
326
+ display: block;
327
+ content: ' ';
328
+ pointer-events: none;
329
+ width: 100%;
330
+ height: 100%;
331
+ left: 0;
332
+ top: 0;
333
+ border: $width $style $color;
334
+ box-sizing: border-box;
335
+ border-radius: inherit;
336
+ }
337
+ }
338
+
339
+ @mixin buttonClear {
340
+ outline: none;
341
+ -webkit-appearance: none;
342
+ -webkit-tap-highlight-color: transparent;
343
+ background: transparent;
344
+ }
345
+
346
+ /**
347
+ * 三角形实现尖角样式,适用于背景透明情况
348
+ * @param $size 三角形高,底边为 $size * 2
349
+ * @param $bg 三角形背景颜色
350
+ */
351
+ @mixin triangleArrow($size, $bg) {
352
+ @include e(arrow) {
353
+ position: absolute;
354
+ width: 0;
355
+ height: 0;
356
+ }
357
+
358
+ @include e(arrow-down) {
359
+ border-left: $size solid transparent;
360
+ border-right: $size solid transparent;
361
+ border-top: $size solid $bg;
362
+ transform: translateX(-50%);
363
+ bottom: calc(-1 * $size)
364
+ }
365
+
366
+ @include e(arrow-up) {
367
+ border-left: $size solid transparent;
368
+ border-right: $size solid transparent;
369
+ border-bottom: $size solid $bg;
370
+ transform: translateX(-50%);
371
+ top: calc(-1 * $size)
372
+ }
373
+
374
+ @include e(arrow-left) {
375
+ border-top: $size solid transparent;
376
+ border-bottom: $size solid transparent;
377
+ border-right: $size solid $bg;
378
+ transform: translateY(-50%);
379
+ left: calc(-1 * $size)
380
+ }
381
+
382
+ @include e(arrow-right) {
383
+ border-top: $size solid transparent;
384
+ border-bottom: $size solid transparent;
385
+ border-left: $size solid $bg;
386
+ transform: translateY(-50%);
387
+ right: calc(-1 * $size)
388
+ }
389
+ }
390
+
391
+ /**
392
+ * 正方形实现尖角样式,适用于背景不透明情况
393
+ * @param $size 正方形边长
394
+ * @param $bg 正方形背景颜色
395
+ * @param $z-index z-index属性值,不得大于外部包裹器
396
+ * @param $box-shadow 阴影
397
+ */
398
+ @mixin squareArrow($size, $bg, $z-index, $box-shadow) {
399
+ @include e(arrow) {
400
+ position: absolute;
401
+ width: $size;
402
+ height: $size;
403
+ z-index: $z-index;
404
+ }
405
+
406
+ @include e(arrow-down) {
407
+ transform: translateX(-50%);
408
+ bottom: 0;
409
+
410
+ &:after {
411
+ content: "";
412
+ width: $size;
413
+ height: $size;
414
+ background-color: $bg;
415
+ position: absolute;
416
+ left: 0;
417
+ bottom: calc(-1 * $size / 2);
418
+ transform: rotateZ(45deg);
419
+ box-shadow: $box-shadow;
420
+ }
421
+ }
422
+
423
+ @include e(arrow-up) {
424
+ transform: translateX(-50%);
425
+ top: 0;
426
+
427
+ &:after {
428
+ content: "";
429
+ width: $size;
430
+ height: $size;
431
+ background-color: $bg;
432
+ position: absolute;
433
+ left: 0;
434
+ top: calc(-1 * $size / 2);
435
+ transform: rotateZ(45deg);
436
+ box-shadow: $box-shadow;
437
+ }
438
+ }
439
+
440
+ @include e(arrow-left) {
441
+ transform: translateY(-50%);
442
+ left: 0;
443
+
444
+ &:after {
445
+ content: "";
446
+ width: $size;
447
+ height: $size;
448
+ background-color: $bg;
449
+ position: absolute;
450
+ left: calc(-1 * $size / 2);
451
+ top: 0;
452
+ transform: rotateZ(45deg);
453
+ box-shadow: $box-shadow;
454
+ }
455
+ }
456
+
457
+ @include e(arrow-right) {
458
+ transform: translateY(-50%);
459
+ right: 0;
460
+
461
+ &:after {
462
+ content: "";
463
+ width: $size;
464
+ height: $size;
465
+ background-color: $bg;
466
+ position: absolute;
467
+ right: calc(-1 * $size / 2);
468
+ top: 0;
469
+ transform: rotateZ(45deg);
470
+ box-shadow: $box-shadow;
471
+ }
472
+ }
473
+ }
@@ -0,0 +1,210 @@
1
+ :root,
2
+ page,
3
+ .wd-root-portal {
4
+ // 颜色
5
+ --wot-base-black: #000000FF;
6
+ --wot-base-white: #FFFFFFFF;
7
+ --wot-base-transparent: transparent;
8
+ // 蓝色
9
+ --wot-blue-1: #F5F8FFFF;
10
+ --wot-blue-2: #E5EDFFFF;
11
+ --wot-blue-3: #B8CFFFFF;
12
+ --wot-blue-4: #7CA4FFFF;
13
+ --wot-blue-5: #4480FFFF;
14
+ --wot-blue-6: #1C64FDFF;
15
+ --wot-blue-7: #164ED1FF;
16
+ --wot-blue-8: #1341ADFF;
17
+ --wot-blue-9: #0F3285FF;
18
+ --wot-blue-10: #0A235CFF;
19
+ --wot-blue-opac: #1C64FD14;
20
+
21
+ // 亮蓝
22
+ --wot-lightblue-1: #E8FBFFFF;
23
+ --wot-lightblue-2: #BFF2FFFF;
24
+ --wot-lightblue-3: #96E7FFFF;
25
+ --wot-lightblue-4: #6ED8FFFF;
26
+ --wot-lightblue-5: #45C7FFFF;
27
+ --wot-lightblue-6: #1CB2FDFF;
28
+ --wot-lightblue-7: #0D8CD6FF;
29
+ --wot-lightblue-8: #026AB0FF;
30
+ --wot-lightblue-9: #004E8AFF;
31
+ --wot-lightblue-10: #003563FF;
32
+ --wot-lightblue-opac: #1CB2FD14;
33
+
34
+ // 粉色
35
+ --wot-pink-1: #FFF0F6FF;
36
+ --wot-pink-2: #FFDEEBFF;
37
+ --wot-pink-3: #FCC2D7FF;
38
+ --wot-pink-4: #FAA2C1FF;
39
+ --wot-pink-5: #F783ACFF;
40
+ --wot-pink-6: #FF357CFF;
41
+ --wot-pink-7: #FF0A60FF;
42
+ --wot-pink-8: #E0004FFF;
43
+ --wot-pink-9: #B80040FF;
44
+ --wot-pink-10: #8F0032FF;
45
+ --wot-pink-opac: #FF357C14;
46
+
47
+ // 红色
48
+ --wot-red-1: #FFF5F5FF;
49
+ --wot-red-2: #FFE3E3FF;
50
+ --wot-red-3: #FFC9C9FF;
51
+ --wot-red-4: #FFA8A8FF;
52
+ --wot-red-5: #FB7C7CFF;
53
+ --wot-red-6: #F14646FF;
54
+ --wot-red-7: #DC2C2CFF;
55
+ --wot-red-8: #BC2626FF;
56
+ --wot-red-9: #A01515FF;
57
+ --wot-red-10: #790909FF;
58
+ --wot-red-opac: #F1464614;
59
+
60
+ // 橘红色
61
+ --wot-volcano-1: #FFF2E8FF;
62
+ --wot-volcano-2: #FFDABFFF;
63
+ --wot-volcano-3: #FFBF96FF;
64
+ --wot-volcano-4: #FFA16EFF;
65
+ --wot-volcano-5: #FF8045FF;
66
+ --wot-volcano-6: #FD5C1CFF;
67
+ --wot-volcano-7: #D63F0DFF;
68
+ --wot-volcano-8: #B02802FF;
69
+ --wot-volcano-9: #8A1900FF;
70
+ --wot-volcano-10: #630F00FF;
71
+ --wot-volcano-opac: #FD5C1C14;
72
+
73
+ // 橙色
74
+ --wot-orange-1: #FFF6EBFF;
75
+ --wot-orange-2: #FFE8CCFF;
76
+ --wot-orange-3: #FFD8A8FF;
77
+ --wot-orange-4: #FFC078FF;
78
+ --wot-orange-5: #FFA94DFF;
79
+ --wot-orange-6: #F57F00FF;
80
+ --wot-orange-7: #D05706FF;
81
+ --wot-orange-8: #A94605FF;
82
+ --wot-orange-9: #813604FF;
83
+ --wot-orange-10: #592503FF;
84
+ --wot-orange-opac: #F57F0014;
85
+
86
+ // 黄色
87
+ --wot-yellow-1: #FFFAF1FF;
88
+ --wot-yellow-2: #FDE5B4FF;
89
+ --wot-yellow-3: #FDD78CFF;
90
+ --wot-yellow-4: #FCC964FF;
91
+ --wot-yellow-5: #FBBB3CFF;
92
+ --wot-yellow-6: #FAAD14FF;
93
+ --wot-yellow-7: #E19705FF;
94
+ --wot-yellow-8: #B97C04FF;
95
+ --wot-yellow-9: #916103FF;
96
+ --wot-yellow-10: #694702FF;
97
+ --wot-yellow-opac: #FAAD1414;
98
+
99
+ // 绿色
100
+ --wot-green-1: #F3FBF9FF;
101
+ --wot-green-2: #E7F8F3FF;
102
+ --wot-green-3: #B8EADBFF;
103
+ --wot-green-4: #88DBC3FF;
104
+ --wot-green-5: #59CDAAFF;
105
+ --wot-green-6: #12B886FF;
106
+ --wot-green-7: #0F956CFF;
107
+ --wot-green-8: #0B6F51FF;
108
+ --wot-green-9: #074A36FF;
109
+ --wot-green-10: #04251BFF;
110
+ --wot-green-opac: #12B88614;
111
+
112
+ // 青色
113
+ --wot-cyan-1: #F4FBFDFF;
114
+ --wot-cyan-2: #E9F8FAFF;
115
+ --wot-cyan-3: #BDEAF1FF;
116
+ --wot-cyan-4: #90DBE7FF;
117
+ --wot-cyan-5: #64CDDDFF;
118
+ --wot-cyan-6: #22B8CFFF;
119
+ --wot-cyan-7: #1C98ABFF;
120
+ --wot-cyan-8: #167988FF;
121
+ --wot-cyan-9: #115A65FF;
122
+ --wot-cyan-10: #0B3A42FF;
123
+ --wot-cyan-opac: #22B8CF14;
124
+
125
+ // 紫色
126
+ --wot-purple-1: #F9F8FFFF;
127
+ --wot-purple-2: #E5DBFFFF;
128
+ --wot-purple-3: #D0BFFFFF;
129
+ --wot-purple-4: #B197FCFF;
130
+ --wot-purple-5: #9775FAFF;
131
+ --wot-purple-6: #8059F3FF;
132
+ --wot-purple-7: #5B29EFFF;
133
+ --wot-purple-8: #4511DFFF;
134
+ --wot-purple-9: #390EB9FF;
135
+ --wot-purple-10: #2D0B93FF;
136
+ --wot-purple-opac: #8059F314;
137
+
138
+ // 靛色
139
+ --wot-grape-1: #FBF6FDFF;
140
+ --wot-grape-2: #F3D9FAFF;
141
+ --wot-grape-3: #EEBEFAFF;
142
+ --wot-grape-4: #E599F7FF;
143
+ --wot-grape-5: #DA77F2FF;
144
+ --wot-grape-6: #AE3EC9FF;
145
+ --wot-grape-7: #9731AFFF;
146
+ --wot-grape-8: #7B288FFF;
147
+ --wot-grape-9: #601F70FF;
148
+ --wot-grape-10: #451650FF;
149
+ --wot-grape-opac: #AE3EC914;
150
+
151
+ // 冷灰
152
+ --wot-coolgrey-1: #F7F8FAFF;
153
+ --wot-coolgrey-2: #F2F3F5FF;
154
+ --wot-coolgrey-3: #E5E6EBFF;
155
+ --wot-coolgrey-4: #C9CBD4FF;
156
+ --wot-coolgrey-5: #A9ACB8FF;
157
+ --wot-coolgrey-6: #868A9CFF;
158
+ --wot-coolgrey-7: #6B7085FF;
159
+ --wot-coolgrey-8: #4E5369FF;
160
+ --wot-coolgrey-9: #272B3BFF;
161
+ --wot-coolgrey-10: #1D1F29FF;
162
+
163
+ // 中性灰
164
+ --wot-neutralgrey-1: #FAFAFAFF;
165
+ --wot-neutralgrey-2: #F5F5F5FF;
166
+ --wot-neutralgrey-3: #EBEBEBFF;
167
+ --wot-neutralgrey-4: #D4D4D4FF;
168
+ --wot-neutralgrey-5: #B8B8B8FF;
169
+ --wot-neutralgrey-6: #9C9C9CFF;
170
+ --wot-neutralgrey-7: #858585FF;
171
+ --wot-neutralgrey-8: #696969FF;
172
+ --wot-neutralgrey-9: #3D3D3DFF;
173
+ --wot-neutralgrey-10: #292929FF;
174
+
175
+ // 暖灰
176
+ --wot-warmgrey-1: #FAF8F7FF;
177
+ --wot-warmgrey-2: #F5F3F2FF;
178
+ --wot-warmgrey-3: #EBE7E5FF;
179
+ --wot-warmgrey-4: #D4CECCFF;
180
+ --wot-warmgrey-5: #B8B0ADFF;
181
+ --wot-warmgrey-6: #9C918CFF;
182
+ --wot-warmgrey-7: #857A75FF;
183
+ --wot-warmgrey-8: #695E5AFF;
184
+ --wot-warmgrey-9: #3B332FFF;
185
+ --wot-warmgrey-10: #292321FF;
186
+
187
+ // 遮罩
188
+ --wot-opac-1_02: #00000005;
189
+ --wot-opac-2_04: #0000000A;
190
+ --wot-opac-3_08: #00000014;
191
+ --wot-opac-4_15: #00000026;
192
+ --wot-opac-5_20: #00000033;
193
+ --wot-opac-6_30: #0000004D;
194
+ --wot-opac-7_45: #00000073;
195
+ --wot-opac-7_55: #0000008C;
196
+ --wot-opac-8_65: #000000A6;
197
+ --wot-opac-9_75: #000000BF;
198
+ --wot-opac-10_85: #000000D9;
199
+ --wot-opacwhite-1_02: #FFFFFF05;
200
+ --wot-opacwhite-2_04: #FFFFFF0A;
201
+ --wot-opacwhite-3_08: #FFFFFF14;
202
+ --wot-opacwhite-4_15: #FFFFFF26;
203
+ --wot-opacwhite-5_20: #FFFFFF33;
204
+ --wot-opacwhite-6_30: #FFFFFF4D;
205
+ --wot-opacwhite-7_45: #FFFFFF73;
206
+ --wot-opacwhite-7_55: #FFFFFF8C;
207
+ --wot-opacwhite-8_65: #FFFFFFA6;
208
+ --wot-opacwhite-9_75: #FFFFFFBF;
209
+ --wot-opacwhite-10_85: #FFFFFFD9;
210
+ }