@tdesign/uniapp 0.0.1-alpha.1 → 0.7.1

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 (698) hide show
  1. package/CHANGELOG.md +213 -0
  2. package/LICENSE +9 -0
  3. package/README.md +144 -0
  4. package/dist/action-sheet/README.en-US.md +60 -0
  5. package/dist/action-sheet/README.md +131 -0
  6. package/dist/action-sheet/action-sheet.css +162 -0
  7. package/dist/action-sheet/action-sheet.vue +367 -0
  8. package/dist/action-sheet/computed.js +29 -0
  9. package/dist/action-sheet/index.d.ts +11 -0
  10. package/dist/action-sheet/index.js +13 -0
  11. package/dist/action-sheet/props.ts +86 -0
  12. package/dist/action-sheet/show.d.ts +28 -0
  13. package/dist/action-sheet/show.js +33 -0
  14. package/dist/action-sheet/type.ts +93 -0
  15. package/dist/avatar/README.en-US.md +102 -0
  16. package/dist/avatar/README.md +152 -0
  17. package/dist/avatar/avatar.css +77 -0
  18. package/dist/avatar/avatar.vue +200 -0
  19. package/dist/avatar/computed.js +30 -0
  20. package/dist/avatar/props.ts +54 -0
  21. package/dist/avatar/type.ts +58 -0
  22. package/dist/avatar-group/avatar-group.css +187 -0
  23. package/dist/avatar-group/avatar-group.vue +121 -0
  24. package/dist/avatar-group/props.ts +44 -0
  25. package/dist/avatar-group/type.ts +38 -0
  26. package/dist/back-top/README.en-US.md +49 -0
  27. package/dist/back-top/README.md +67 -0
  28. package/dist/back-top/back-top.css +65 -0
  29. package/dist/back-top/back-top.vue +122 -0
  30. package/dist/back-top/props.ts +48 -0
  31. package/dist/back-top/type.ts +42 -0
  32. package/dist/badge/README.en-US.md +54 -0
  33. package/dist/badge/README.md +85 -0
  34. package/dist/badge/badge.css +140 -0
  35. package/dist/badge/badge.vue +134 -0
  36. package/dist/badge/computed.js +63 -0
  37. package/dist/badge/props.ts +55 -0
  38. package/dist/badge/type.ts +60 -0
  39. package/dist/button/README.en-US.md +241 -0
  40. package/dist/button/README.md +232 -0
  41. package/dist/button/button.css +514 -0
  42. package/dist/button/button.vue +247 -0
  43. package/dist/button/props.ts +221 -0
  44. package/dist/button/type.ts +206 -0
  45. package/dist/calendar/README.en-US.md +63 -0
  46. package/dist/calendar/README.md +113 -0
  47. package/dist/calendar/calendar-header.props.js +42 -0
  48. package/dist/calendar/calendar-header.vue +98 -0
  49. package/dist/calendar/calendar.css +205 -0
  50. package/dist/calendar/calendar.vue +454 -0
  51. package/dist/calendar/computed.js +42 -0
  52. package/dist/calendar/props.ts +113 -0
  53. package/dist/calendar/template.props.js +57 -0
  54. package/dist/calendar/template.vue +261 -0
  55. package/dist/calendar/type.ts +141 -0
  56. package/dist/calendar/utils.js +16 -0
  57. package/dist/cascader/README.en-US.md +56 -0
  58. package/dist/cascader/README.md +96 -0
  59. package/dist/cascader/cascader.css +102 -0
  60. package/dist/cascader/cascader.vue +523 -0
  61. package/dist/cascader/props.ts +73 -0
  62. package/dist/cascader/type.ts +77 -0
  63. package/dist/cell/README.en-US.md +116 -0
  64. package/dist/cell/README.md +147 -0
  65. package/dist/cell/cell.css +94 -0
  66. package/dist/cell/cell.vue +260 -0
  67. package/dist/cell/props.ts +87 -0
  68. package/dist/cell/type.ts +82 -0
  69. package/dist/cell-group/cell-group.css +44 -0
  70. package/dist/cell-group/cell-group.vue +69 -0
  71. package/dist/cell-group/props.ts +25 -0
  72. package/dist/cell-group/type.ts +23 -0
  73. package/dist/check-tag/check-tag.css +197 -0
  74. package/dist/check-tag/check-tag.vue +149 -0
  75. package/dist/check-tag/props.ts +67 -0
  76. package/dist/check-tag/type.ts +63 -0
  77. package/dist/checkbox/README.en-US.md +103 -0
  78. package/dist/checkbox/README.md +158 -0
  79. package/dist/checkbox/checkbox.css +174 -0
  80. package/dist/checkbox/checkbox.vue +238 -0
  81. package/dist/checkbox/props.ts +90 -0
  82. package/dist/checkbox/type.ts +96 -0
  83. package/dist/checkbox-group/checkbox-group.css +0 -0
  84. package/dist/checkbox-group/checkbox-group.vue +261 -0
  85. package/dist/checkbox-group/props.ts +58 -0
  86. package/dist/checkbox-group/type.ts +72 -0
  87. package/dist/col/README.en-US.md +31 -0
  88. package/dist/col/README.md +60 -0
  89. package/dist/col/col.css +149 -0
  90. package/dist/col/col.vue +58 -0
  91. package/dist/col/computed.js +14 -0
  92. package/dist/col/props.ts +16 -0
  93. package/dist/col/type.ts +16 -0
  94. package/dist/collapse/README.en-US.md +82 -0
  95. package/dist/collapse/README.md +119 -0
  96. package/dist/collapse/collapse.css +5 -0
  97. package/dist/collapse/collapse.vue +119 -0
  98. package/dist/collapse/props.ts +42 -0
  99. package/dist/collapse/type.ts +46 -0
  100. package/dist/collapse-panel/collapse-panel.css +154 -0
  101. package/dist/collapse-panel/collapse-panel.vue +238 -0
  102. package/dist/collapse-panel/props.ts +48 -0
  103. package/dist/collapse-panel/type.ts +41 -0
  104. package/dist/color-picker/README.en-US.md +62 -0
  105. package/dist/color-picker/README.md +110 -0
  106. package/dist/color-picker/color-picker.css +271 -0
  107. package/dist/color-picker/color-picker.vue +501 -0
  108. package/dist/color-picker/constants.ts +26 -0
  109. package/dist/color-picker/props.ts +75 -0
  110. package/dist/color-picker/template.props.js +58 -0
  111. package/dist/color-picker/template.vue +198 -0
  112. package/dist/color-picker/type.ts +96 -0
  113. package/dist/color-picker/utils.js +1 -0
  114. package/dist/common/bus.js +84 -0
  115. package/dist/common/canvas/index.js +53 -0
  116. package/dist/common/common.ts +173 -0
  117. package/dist/common/config.js +9 -0
  118. package/dist/common/dom/index.js +1 -0
  119. package/dist/common/dom/select-component.js +26 -0
  120. package/dist/common/event/dynamic.js +10 -0
  121. package/dist/common/functional/mixin.js +51 -0
  122. package/dist/common/relation/index.js +6 -0
  123. package/dist/common/relation/parent-map.js +26 -0
  124. package/dist/common/relation/relation.js +213 -0
  125. package/dist/common/route.js +13 -0
  126. package/dist/common/runtime/index.js +5 -0
  127. package/dist/common/runtime/relation.js +0 -0
  128. package/dist/common/runtime/wxs-polyfill.js +16 -0
  129. package/dist/common/shared/calendar/index.js +128 -0
  130. package/dist/common/shared/calendar/type.ts +14 -0
  131. package/dist/common/shared/color-picker/cmyk.js +78 -0
  132. package/dist/common/shared/color-picker/color.js +428 -0
  133. package/dist/common/shared/color-picker/gradient.js +180 -0
  134. package/dist/common/shared/color-picker/index.js +3 -0
  135. package/dist/common/shared/date.js +46 -0
  136. package/dist/common/shared/qrcode/qrcodegen.js +884 -0
  137. package/dist/common/shared/qrcode/utils.js +124 -0
  138. package/dist/common/src/control.js +66 -0
  139. package/dist/common/src/flatTool.js +99 -0
  140. package/dist/common/src/index.js +4 -0
  141. package/dist/common/src/instantiationDecorator.js +259 -0
  142. package/dist/common/src/superComponent.js +5 -0
  143. package/dist/common/style/_variables.less +232 -0
  144. package/dist/common/style/base.less +4 -0
  145. package/dist/common/style/icons.css +0 -0
  146. package/dist/common/style/index.css +13 -0
  147. package/dist/common/style/mixins/_border.less +34 -0
  148. package/dist/common/style/mixins/_clearfix.less +7 -0
  149. package/dist/common/style/mixins/_cursor.less +6 -0
  150. package/dist/common/style/mixins/_ellipsis.less +15 -0
  151. package/dist/common/style/mixins/_hairline.less +55 -0
  152. package/dist/common/style/mixins/_index.less +6 -0
  153. package/dist/common/style/mixins/_other.less +14 -0
  154. package/dist/common/style/theme/index.css +471 -0
  155. package/dist/common/style/theme/index.less +11 -0
  156. package/dist/common/style/theme/raw/_components.less +30 -0
  157. package/dist/common/style/theme/raw/_dark.less +178 -0
  158. package/dist/common/style/theme/raw/_font.less +90 -0
  159. package/dist/common/style/theme/raw/_light.less +182 -0
  160. package/dist/common/style/theme/raw/_radius.less +10 -0
  161. package/dist/common/style/theme/raw/_spacer.less +11 -0
  162. package/dist/common/style/utilities/index.css +13 -0
  163. package/dist/common/utils.js +358 -0
  164. package/dist/common/utils.wxs.js +139 -0
  165. package/dist/common/validator.js +38 -0
  166. package/dist/common/version.js +66 -0
  167. package/dist/common/wechat.js +22 -0
  168. package/dist/count-down/README.en-US.md +50 -0
  169. package/dist/count-down/README.md +76 -0
  170. package/dist/count-down/computed.js +3 -0
  171. package/dist/count-down/count-down.css +110 -0
  172. package/dist/count-down/count-down.vue +166 -0
  173. package/dist/count-down/props.ts +62 -0
  174. package/dist/count-down/type.ts +64 -0
  175. package/dist/count-down/utils.js +72 -0
  176. package/dist/date-time-picker/README.en-US.md +61 -0
  177. package/dist/date-time-picker/README.md +105 -0
  178. package/dist/date-time-picker/date-time-picker.css +4 -0
  179. package/dist/date-time-picker/date-time-picker.vue +570 -0
  180. package/dist/date-time-picker/locale/dayjs.js +81 -0
  181. package/dist/date-time-picker/locale/en.js +12 -0
  182. package/dist/date-time-picker/locale/ja.js +12 -0
  183. package/dist/date-time-picker/locale/ko.js +12 -0
  184. package/dist/date-time-picker/locale/ru.js +12 -0
  185. package/dist/date-time-picker/locale/tc.js +12 -0
  186. package/dist/date-time-picker/locale/zh.js +12 -0
  187. package/dist/date-time-picker/props.ts +114 -0
  188. package/dist/date-time-picker/type.ts +134 -0
  189. package/dist/demo/demo.vue +97 -0
  190. package/dist/demo/index.css +46 -0
  191. package/dist/demo-header/demo-header.vue +60 -0
  192. package/dist/demo-header/index.css +0 -0
  193. package/dist/demo-navbar/demo-navbar.vue +42 -0
  194. package/dist/dialog/README.en-US.md +69 -0
  195. package/dist/dialog/README.md +120 -0
  196. package/dist/dialog/computed.js +15 -0
  197. package/dist/dialog/dialog.css +102 -0
  198. package/dist/dialog/dialog.vue +422 -0
  199. package/dist/dialog/index.d.ts +42 -0
  200. package/dist/dialog/index.js +90 -0
  201. package/dist/dialog/props.ts +94 -0
  202. package/dist/dialog/type.ts +97 -0
  203. package/dist/divider/README.en-US.md +40 -0
  204. package/dist/divider/README.md +64 -0
  205. package/dist/divider/divider.css +56 -0
  206. package/dist/divider/divider.vue +79 -0
  207. package/dist/divider/props.ts +33 -0
  208. package/dist/divider/type.ts +27 -0
  209. package/dist/draggable/draggable.css +16 -0
  210. package/dist/draggable/draggable.vue +92 -0
  211. package/dist/draggable/props.js +19 -0
  212. package/dist/drawer/README.en-US.md +54 -0
  213. package/dist/drawer/README.md +80 -0
  214. package/dist/drawer/drawer.css +62 -0
  215. package/dist/drawer/drawer.vue +144 -0
  216. package/dist/drawer/props.ts +72 -0
  217. package/dist/drawer/type.ts +81 -0
  218. package/dist/dropdown-item/computed.js +6 -0
  219. package/dist/dropdown-item/dropdown-item.css +97 -0
  220. package/dist/dropdown-item/dropdown-item.vue +403 -0
  221. package/dist/dropdown-item/props.ts +71 -0
  222. package/dist/dropdown-item/type.ts +76 -0
  223. package/dist/dropdown-menu/README.en-US.md +95 -0
  224. package/dist/dropdown-menu/README.md +125 -0
  225. package/dist/dropdown-menu/dropdown-menu.css +59 -0
  226. package/dist/dropdown-menu/dropdown-menu.vue +188 -0
  227. package/dist/dropdown-menu/props.ts +44 -0
  228. package/dist/dropdown-menu/type.ts +41 -0
  229. package/dist/empty/README.en-US.md +39 -0
  230. package/dist/empty/README.md +69 -0
  231. package/dist/empty/empty.css +21 -0
  232. package/dist/empty/empty.vue +140 -0
  233. package/dist/empty/props.ts +20 -0
  234. package/dist/empty/type.ts +20 -0
  235. package/dist/fab/README.en-US.md +37 -0
  236. package/dist/fab/README.md +81 -0
  237. package/dist/fab/fab.css +9 -0
  238. package/dist/fab/fab.vue +238 -0
  239. package/dist/fab/props.ts +54 -0
  240. package/dist/fab/type.ts +57 -0
  241. package/dist/footer/README.en-US.md +33 -0
  242. package/dist/footer/README.md +61 -0
  243. package/dist/footer/footer.css +47 -0
  244. package/dist/footer/footer.vue +117 -0
  245. package/dist/footer/props.ts +23 -0
  246. package/dist/footer/type.ts +34 -0
  247. package/dist/form/README.en-US.md +137 -0
  248. package/dist/form/README.md +146 -0
  249. package/dist/form/form-item-props.ts +56 -0
  250. package/dist/form/form.css +169 -0
  251. package/dist/form/form.vue +287 -0
  252. package/dist/form/props.ts +109 -0
  253. package/dist/form/type.ts +387 -0
  254. package/dist/form-item/README.en-US.md +37 -0
  255. package/dist/form-item/README.md +37 -0
  256. package/dist/form-item/form-item.css +120 -0
  257. package/dist/form-item/form-item.vue +396 -0
  258. package/dist/form-item/form-model.ts +198 -0
  259. package/dist/form-item/props.ts +64 -0
  260. package/dist/form-item/type.ts +7 -0
  261. package/dist/grid/README.en-US.md +92 -0
  262. package/dist/grid/README.md +143 -0
  263. package/dist/grid/grid.css +13 -0
  264. package/dist/grid/grid.vue +94 -0
  265. package/dist/grid/props.ts +43 -0
  266. package/dist/grid/type.ts +43 -0
  267. package/dist/grid-item/README.en-US.md +65 -0
  268. package/dist/grid-item/README.md +65 -0
  269. package/dist/grid-item/grid-item.css +103 -0
  270. package/dist/grid-item/grid-item.vue +292 -0
  271. package/dist/grid-item/props.ts +63 -0
  272. package/dist/grid-item/type.ts +56 -0
  273. package/dist/guide/README.en-US.md +103 -0
  274. package/dist/guide/README.md +140 -0
  275. package/dist/guide/content.vue +325 -0
  276. package/dist/guide/guide.css +64 -0
  277. package/dist/guide/guide.vue +534 -0
  278. package/dist/guide/props.ts +98 -0
  279. package/dist/guide/type.ts +174 -0
  280. package/dist/icon/README.en-US.md +32 -0
  281. package/dist/icon/README.md +109 -0
  282. package/dist/icon/icon.css +7073 -0
  283. package/dist/icon/icon.vue +121 -0
  284. package/dist/icon/props.ts +35 -0
  285. package/dist/icon/type.ts +32 -0
  286. package/dist/image/README.en-US.md +51 -0
  287. package/dist/image/README.md +86 -0
  288. package/dist/image/image.css +44 -0
  289. package/dist/image/image.vue +207 -0
  290. package/dist/image/props.ts +71 -0
  291. package/dist/image/type.ts +85 -0
  292. package/dist/image-viewer/README.en-US.md +49 -0
  293. package/dist/image-viewer/README.md +78 -0
  294. package/dist/image-viewer/computed.js +4 -0
  295. package/dist/image-viewer/image-viewer.css +75 -0
  296. package/dist/image-viewer/image-viewer.vue +317 -0
  297. package/dist/image-viewer/props.ts +69 -0
  298. package/dist/image-viewer/type.ts +76 -0
  299. package/dist/indexes/README.en-US.md +76 -0
  300. package/dist/indexes/README.md +105 -0
  301. package/dist/indexes/computed.js +4 -0
  302. package/dist/indexes/indexes-anchor-props.ts +12 -0
  303. package/dist/indexes/indexes.css +50 -0
  304. package/dist/indexes/indexes.vue +371 -0
  305. package/dist/indexes/props.ts +40 -0
  306. package/dist/indexes/type.ts +38 -0
  307. package/dist/indexes-anchor/README.en-US.md +24 -0
  308. package/dist/indexes-anchor/README.md +28 -0
  309. package/dist/indexes-anchor/indexes-anchor.css +49 -0
  310. package/dist/indexes-anchor/indexes-anchor.vue +73 -0
  311. package/dist/indexes-anchor/props.ts +12 -0
  312. package/dist/indexes-anchor/type.ts +12 -0
  313. package/dist/input/README.en-US.md +121 -0
  314. package/dist/input/README.md +190 -0
  315. package/dist/input/computed.js +13 -0
  316. package/dist/input/input.css +161 -0
  317. package/dist/input/input.vue +407 -0
  318. package/dist/input/props.ts +247 -0
  319. package/dist/input/type.ts +237 -0
  320. package/dist/input/utils.js +38 -0
  321. package/dist/link/README.en-US.md +67 -0
  322. package/dist/link/README.md +115 -0
  323. package/dist/link/link.css +118 -0
  324. package/dist/link/link.vue +175 -0
  325. package/dist/link/props.ts +65 -0
  326. package/dist/link/type.ts +62 -0
  327. package/dist/loading/README.en-US.md +49 -0
  328. package/dist/loading/README.md +96 -0
  329. package/dist/loading/loading.css +203 -0
  330. package/dist/loading/loading.vue +157 -0
  331. package/dist/loading/props.ts +68 -0
  332. package/dist/loading/type.ts +70 -0
  333. package/dist/message/README.en-US.md +69 -0
  334. package/dist/message/README.md +105 -0
  335. package/dist/message/config.js +10 -0
  336. package/dist/message/index.d.ts +17 -0
  337. package/dist/message/index.js +39 -0
  338. package/dist/message/message.css +0 -0
  339. package/dist/message/message.interface.ts +30 -0
  340. package/dist/message/message.vue +275 -0
  341. package/dist/message/props.ts +101 -0
  342. package/dist/message/type.ts +101 -0
  343. package/dist/message-item/computed.js +23 -0
  344. package/dist/message-item/index.js +40 -0
  345. package/dist/message-item/message-item.css +63 -0
  346. package/dist/message-item/message-item.vue +353 -0
  347. package/dist/mixins/page-scroll.js +115 -0
  348. package/dist/mixins/skyline.js +12 -0
  349. package/dist/mixins/theme-change.js +16 -0
  350. package/dist/mixins/touch.js +29 -0
  351. package/dist/mixins/transition.js +133 -0
  352. package/dist/mixins/using-custom-navbar.js +38 -0
  353. package/dist/navbar/README.en-US.md +76 -0
  354. package/dist/navbar/README.md +121 -0
  355. package/dist/navbar/navbar.css +106 -0
  356. package/dist/navbar/navbar.vue +293 -0
  357. package/dist/navbar/props.ts +75 -0
  358. package/dist/navbar/type.ts +76 -0
  359. package/dist/notice-bar/README.en-US.md +62 -0
  360. package/dist/notice-bar/README.md +116 -0
  361. package/dist/notice-bar/notice-bar.css +75 -0
  362. package/dist/notice-bar/notice-bar.vue +326 -0
  363. package/dist/notice-bar/props.ts +71 -0
  364. package/dist/notice-bar/type.ts +71 -0
  365. package/dist/npm/dayjs/esm/constant.js +25 -0
  366. package/dist/npm/dayjs/esm/index.js +541 -0
  367. package/dist/npm/dayjs/esm/locale/en.js +12 -0
  368. package/dist/npm/dayjs/esm/locale/ja.js +45 -0
  369. package/dist/npm/dayjs/esm/locale/ko.js +45 -0
  370. package/dist/npm/dayjs/esm/locale/ru.js +99 -0
  371. package/dist/npm/dayjs/esm/locale/zh-cn.js +67 -0
  372. package/dist/npm/dayjs/esm/locale/zh-tw.js +65 -0
  373. package/dist/npm/dayjs/esm/plugin/localeData/index.js +114 -0
  374. package/dist/npm/dayjs/esm/plugin/localizedFormat/index.js +20 -0
  375. package/dist/npm/dayjs/esm/plugin/localizedFormat/utils.js +20 -0
  376. package/dist/npm/dayjs/esm/utils.js +58 -0
  377. package/dist/npm/tinycolor2/esm/tinycolor.js +1180 -0
  378. package/dist/overlay/README.en-US.md +34 -0
  379. package/dist/overlay/README.md +54 -0
  380. package/dist/overlay/overlay.css +17 -0
  381. package/dist/overlay/overlay.vue +105 -0
  382. package/dist/overlay/props.ts +37 -0
  383. package/dist/overlay/type.ts +42 -0
  384. package/dist/picker/README.en-US.md +77 -0
  385. package/dist/picker/README.md +112 -0
  386. package/dist/picker/picker.css +71 -0
  387. package/dist/picker/picker.vue +315 -0
  388. package/dist/picker/props.ts +95 -0
  389. package/dist/picker/type.ts +114 -0
  390. package/dist/picker-item/README.en-US.md +25 -0
  391. package/dist/picker-item/README.md +25 -0
  392. package/dist/picker-item/picker-item.css +32 -0
  393. package/dist/picker-item/picker-item.vue +446 -0
  394. package/dist/picker-item/props.ts +18 -0
  395. package/dist/picker-item/type.ts +23 -0
  396. package/dist/popover/README.en-US.md +55 -0
  397. package/dist/popover/README.md +85 -0
  398. package/dist/popover/popover.css +271 -0
  399. package/dist/popover/popover.vue +352 -0
  400. package/dist/popover/props.ts +58 -0
  401. package/dist/popover/type.ts +61 -0
  402. package/dist/popup/README.en-US.md +53 -0
  403. package/dist/popup/README.md +82 -0
  404. package/dist/popup/computed.js +14 -0
  405. package/dist/popup/popup.css +80 -0
  406. package/dist/popup/popup.vue +141 -0
  407. package/dist/popup/props.ts +67 -0
  408. package/dist/popup/type.ts +72 -0
  409. package/dist/progress/README.en-US.md +52 -0
  410. package/dist/progress/README.md +87 -0
  411. package/dist/progress/computed.js +81 -0
  412. package/dist/progress/progress.css +136 -0
  413. package/dist/progress/progress.vue +259 -0
  414. package/dist/progress/props.ts +55 -0
  415. package/dist/progress/type.ts +50 -0
  416. package/dist/progress/utils.js +19 -0
  417. package/dist/pull-down-refresh/README.en-US.md +60 -0
  418. package/dist/pull-down-refresh/README.md +83 -0
  419. package/dist/pull-down-refresh/props.ts +112 -0
  420. package/dist/pull-down-refresh/pull-down-refresh.css +29 -0
  421. package/dist/pull-down-refresh/pull-down-refresh.vue +366 -0
  422. package/dist/pull-down-refresh/type.ts +118 -0
  423. package/dist/qrcode/README.en-US.md +40 -0
  424. package/dist/qrcode/README.md +97 -0
  425. package/dist/qrcode/components/qrcode-canvas/props.ts +48 -0
  426. package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.css +7 -0
  427. package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +413 -0
  428. package/dist/qrcode/components/qrcode-status/props.ts +22 -0
  429. package/dist/qrcode/components/qrcode-status/qrcode-status.css +25 -0
  430. package/dist/qrcode/components/qrcode-status/qrcode-status.vue +94 -0
  431. package/dist/qrcode/components/qrcode-status/type.ts +25 -0
  432. package/dist/qrcode/hooks/useQRCode.js +25 -0
  433. package/dist/qrcode/props.ts +66 -0
  434. package/dist/qrcode/qrcode.css +31 -0
  435. package/dist/qrcode/qrcode.vue +144 -0
  436. package/dist/qrcode/type.ts +66 -0
  437. package/dist/radio/README.en-US.md +104 -0
  438. package/dist/radio/README.md +148 -0
  439. package/dist/radio/props.ts +86 -0
  440. package/dist/radio/radio.css +177 -0
  441. package/dist/radio/radio.vue +227 -0
  442. package/dist/radio/type.ts +89 -0
  443. package/dist/radio-group/props.ts +68 -0
  444. package/dist/radio-group/radio-group.css +0 -0
  445. package/dist/radio-group/radio-group.vue +205 -0
  446. package/dist/radio-group/type.ts +79 -0
  447. package/dist/rate/README.en-US.md +50 -0
  448. package/dist/rate/README.md +107 -0
  449. package/dist/rate/computed.js +66 -0
  450. package/dist/rate/props.ts +85 -0
  451. package/dist/rate/rate.css +81 -0
  452. package/dist/rate/rate.vue +276 -0
  453. package/dist/rate/type.ts +79 -0
  454. package/dist/result/README.en-US.md +47 -0
  455. package/dist/result/README.md +88 -0
  456. package/dist/result/props.ts +36 -0
  457. package/dist/result/result.css +35 -0
  458. package/dist/result/result.vue +128 -0
  459. package/dist/result/type.ts +31 -0
  460. package/dist/row/computed.js +13 -0
  461. package/dist/row/props.ts +12 -0
  462. package/dist/row/row.css +6 -0
  463. package/dist/row/row.vue +63 -0
  464. package/dist/row/type.ts +12 -0
  465. package/dist/script/postinstall.js +46 -0
  466. package/dist/scroll-view/scroll-view.css +0 -0
  467. package/dist/scroll-view/scroll-view.vue +52 -0
  468. package/dist/search/README.en-US.md +88 -0
  469. package/dist/search/README.md +126 -0
  470. package/dist/search/computed.js +3 -0
  471. package/dist/search/props.ts +171 -0
  472. package/dist/search/search.css +75 -0
  473. package/dist/search/search.vue +292 -0
  474. package/dist/search/type.ts +165 -0
  475. package/dist/side-bar/README.en-US.md +58 -0
  476. package/dist/side-bar/README.md +89 -0
  477. package/dist/side-bar/props.ts +26 -0
  478. package/dist/side-bar/side-bar-item-props.ts +27 -0
  479. package/dist/side-bar/side-bar.css +14 -0
  480. package/dist/side-bar/side-bar.vue +84 -0
  481. package/dist/side-bar/type.ts +24 -0
  482. package/dist/side-bar-item/props.ts +27 -0
  483. package/dist/side-bar-item/side-bar-item.css +66 -0
  484. package/dist/side-bar-item/side-bar-item.vue +168 -0
  485. package/dist/side-bar-item/type.ts +32 -0
  486. package/dist/skeleton/README.en-US.md +44 -0
  487. package/dist/skeleton/README.md +82 -0
  488. package/dist/skeleton/props.ts +41 -0
  489. package/dist/skeleton/skeleton.css +77 -0
  490. package/dist/skeleton/skeleton.vue +211 -0
  491. package/dist/skeleton/type.ts +44 -0
  492. package/dist/slider/README.en-US.md +63 -0
  493. package/dist/slider/README.md +127 -0
  494. package/dist/slider/computed.js +9 -0
  495. package/dist/slider/props.ts +79 -0
  496. package/dist/slider/slider.css +239 -0
  497. package/dist/slider/slider.vue +719 -0
  498. package/dist/slider/tool.js +43 -0
  499. package/dist/slider/type.ts +81 -0
  500. package/dist/step-item/computed.js +4 -0
  501. package/dist/step-item/props.ts +36 -0
  502. package/dist/step-item/step-item.css +182 -0
  503. package/dist/step-item/step-item.vue +175 -0
  504. package/dist/step-item/type.ts +33 -0
  505. package/dist/stepper/README.en-US.md +49 -0
  506. package/dist/stepper/README.md +90 -0
  507. package/dist/stepper/props.ts +88 -0
  508. package/dist/stepper/stepper.css +105 -0
  509. package/dist/stepper/stepper.vue +223 -0
  510. package/dist/stepper/type.ts +79 -0
  511. package/dist/steps/README.en-US.md +99 -0
  512. package/dist/steps/README.md +157 -0
  513. package/dist/steps/props.ts +63 -0
  514. package/dist/steps/steps.css +19 -0
  515. package/dist/steps/steps.vue +122 -0
  516. package/dist/steps/type.ts +44 -0
  517. package/dist/sticky/README.en-US.md +32 -0
  518. package/dist/sticky/README.md +66 -0
  519. package/dist/sticky/props.ts +30 -0
  520. package/dist/sticky/sticky.css +3 -0
  521. package/dist/sticky/sticky.vue +144 -0
  522. package/dist/sticky/type.ts +31 -0
  523. package/dist/swipe-cell/README.en-US.md +29 -0
  524. package/dist/swipe-cell/README.md +66 -0
  525. package/dist/swipe-cell/computed.js +166 -0
  526. package/dist/swipe-cell/props.ts +39 -0
  527. package/dist/swipe-cell/swipe-cell.css +31 -0
  528. package/dist/swipe-cell/swipe-cell.vue +245 -0
  529. package/dist/swipe-cell/type.ts +48 -0
  530. package/dist/swiper/README.en-US.md +89 -0
  531. package/dist/swiper/README.md +139 -0
  532. package/dist/swiper/computed.js +29 -0
  533. package/dist/swiper/props.ts +117 -0
  534. package/dist/swiper/swiper.css +21 -0
  535. package/dist/swiper/swiper.vue +193 -0
  536. package/dist/swiper/type.ts +112 -0
  537. package/dist/swiper-nav/props.ts +49 -0
  538. package/dist/swiper-nav/swiper-nav.css +130 -0
  539. package/dist/swiper-nav/swiper-nav.vue +93 -0
  540. package/dist/swiper-nav/type.ts +45 -0
  541. package/dist/switch/README.en-US.md +70 -0
  542. package/dist/switch/README.md +104 -0
  543. package/dist/switch/props.ts +53 -0
  544. package/dist/switch/switch.css +123 -0
  545. package/dist/switch/switch.vue +122 -0
  546. package/dist/switch/type.ts +51 -0
  547. package/dist/tab-bar/README.en-US.md +58 -0
  548. package/dist/tab-bar/README.md +104 -0
  549. package/dist/tab-bar/props.ts +62 -0
  550. package/dist/tab-bar/tab-bar.css +42 -0
  551. package/dist/tab-bar/tab-bar.vue +141 -0
  552. package/dist/tab-bar/type.ts +56 -0
  553. package/dist/tab-bar-item/props.ts +25 -0
  554. package/dist/tab-bar-item/tab-bar-item.css +117 -0
  555. package/dist/tab-bar-item/tab-bar-item.vue +222 -0
  556. package/dist/tab-bar-item/type.ts +32 -0
  557. package/dist/tab-panel/props.ts +34 -0
  558. package/dist/tab-panel/tab-panel.css +15 -0
  559. package/dist/tab-panel/tab-panel.vue +100 -0
  560. package/dist/tab-panel/type.ts +42 -0
  561. package/dist/tabs/README.en-US.md +89 -0
  562. package/dist/tabs/README.md +198 -0
  563. package/dist/tabs/computed.js +26 -0
  564. package/dist/tabs/props.ts +80 -0
  565. package/dist/tabs/tabs.css +183 -0
  566. package/dist/tabs/tabs.vue +494 -0
  567. package/dist/tabs/type.ts +77 -0
  568. package/dist/tag/README.en-US.md +113 -0
  569. package/dist/tag/README.md +151 -0
  570. package/dist/tag/props.ts +70 -0
  571. package/dist/tag/tag.css +208 -0
  572. package/dist/tag/tag.vue +161 -0
  573. package/dist/tag/type.ts +54 -0
  574. package/dist/tdesign-uniapp/tdesign-uniapp.vue +11 -0
  575. package/dist/textarea/README.en-US.md +78 -0
  576. package/dist/textarea/README.md +132 -0
  577. package/dist/textarea/computed.js +14 -0
  578. package/dist/textarea/props.ts +152 -0
  579. package/dist/textarea/textarea.css +67 -0
  580. package/dist/textarea/textarea.vue +227 -0
  581. package/dist/textarea/type.ts +167 -0
  582. package/dist/toast/README.en-US.md +51 -0
  583. package/dist/toast/README.md +78 -0
  584. package/dist/toast/index.d.ts +20 -0
  585. package/dist/toast/index.js +27 -0
  586. package/dist/toast/props.ts +68 -0
  587. package/dist/toast/toast.css +73 -0
  588. package/dist/toast/toast.vue +213 -0
  589. package/dist/toast/type.ts +64 -0
  590. package/dist/transition/README.en-US.md +13 -0
  591. package/dist/transition/README.md +45 -0
  592. package/dist/transition/props.js +22 -0
  593. package/dist/transition/transition.css +14 -0
  594. package/dist/transition/transition.vue +51 -0
  595. package/dist/tree-select/README.en-US.md +48 -0
  596. package/dist/tree-select/README.md +78 -0
  597. package/dist/tree-select/computed.js +6 -0
  598. package/dist/tree-select/props.ts +42 -0
  599. package/dist/tree-select/tree-select.css +44 -0
  600. package/dist/tree-select/tree-select.vue +319 -0
  601. package/dist/tree-select/type.ts +49 -0
  602. package/dist/types/action-sheet.d.ts +7 -0
  603. package/dist/types/avatar-group.d.ts +7 -0
  604. package/dist/types/avatar.d.ts +7 -0
  605. package/dist/types/back-top.d.ts +7 -0
  606. package/dist/types/badge.d.ts +7 -0
  607. package/dist/types/button.d.ts +7 -0
  608. package/dist/types/calendar.d.ts +7 -0
  609. package/dist/types/cascader.d.ts +7 -0
  610. package/dist/types/cell-group.d.ts +7 -0
  611. package/dist/types/cell.d.ts +7 -0
  612. package/dist/types/check-tag.d.ts +7 -0
  613. package/dist/types/checkbox-group.d.ts +7 -0
  614. package/dist/types/checkbox.d.ts +7 -0
  615. package/dist/types/col.d.ts +7 -0
  616. package/dist/types/collapse-panel.d.ts +7 -0
  617. package/dist/types/collapse.d.ts +7 -0
  618. package/dist/types/color-picker.d.ts +7 -0
  619. package/dist/types/count-down.d.ts +7 -0
  620. package/dist/types/date-time-picker.d.ts +7 -0
  621. package/dist/types/dialog.d.ts +7 -0
  622. package/dist/types/divider.d.ts +7 -0
  623. package/dist/types/drawer.d.ts +7 -0
  624. package/dist/types/dropdown-item.d.ts +7 -0
  625. package/dist/types/dropdown-menu.d.ts +7 -0
  626. package/dist/types/empty.d.ts +7 -0
  627. package/dist/types/fab.d.ts +7 -0
  628. package/dist/types/footer.d.ts +7 -0
  629. package/dist/types/form-item.d.ts +7 -0
  630. package/dist/types/form.d.ts +7 -0
  631. package/dist/types/grid-item.d.ts +7 -0
  632. package/dist/types/grid.d.ts +7 -0
  633. package/dist/types/guide.d.ts +7 -0
  634. package/dist/types/icon.d.ts +7 -0
  635. package/dist/types/image-viewer.d.ts +7 -0
  636. package/dist/types/image.d.ts +7 -0
  637. package/dist/types/index.d.ts +77 -0
  638. package/dist/types/indexes-anchor.d.ts +7 -0
  639. package/dist/types/indexes.d.ts +7 -0
  640. package/dist/types/input.d.ts +7 -0
  641. package/dist/types/link.d.ts +7 -0
  642. package/dist/types/loading.d.ts +7 -0
  643. package/dist/types/message.d.ts +7 -0
  644. package/dist/types/navbar.d.ts +7 -0
  645. package/dist/types/notice-bar.d.ts +7 -0
  646. package/dist/types/overlay.d.ts +7 -0
  647. package/dist/types/picker-item.d.ts +7 -0
  648. package/dist/types/picker.d.ts +7 -0
  649. package/dist/types/popup.d.ts +7 -0
  650. package/dist/types/progress.d.ts +7 -0
  651. package/dist/types/pull-down-refresh.d.ts +7 -0
  652. package/dist/types/qrcode.d.ts +7 -0
  653. package/dist/types/radio-group.d.ts +7 -0
  654. package/dist/types/radio.d.ts +7 -0
  655. package/dist/types/rate.d.ts +7 -0
  656. package/dist/types/result.d.ts +7 -0
  657. package/dist/types/row.d.ts +7 -0
  658. package/dist/types/search.d.ts +7 -0
  659. package/dist/types/side-bar-item.d.ts +7 -0
  660. package/dist/types/side-bar.d.ts +7 -0
  661. package/dist/types/skeleton.d.ts +7 -0
  662. package/dist/types/slider.d.ts +7 -0
  663. package/dist/types/step-item.d.ts +7 -0
  664. package/dist/types/stepper.d.ts +7 -0
  665. package/dist/types/steps.d.ts +7 -0
  666. package/dist/types/sticky.d.ts +7 -0
  667. package/dist/types/swipe-cell.d.ts +7 -0
  668. package/dist/types/swiper-nav.d.ts +7 -0
  669. package/dist/types/swiper.d.ts +7 -0
  670. package/dist/types/switch.d.ts +7 -0
  671. package/dist/types/tab-bar-item.d.ts +7 -0
  672. package/dist/types/tab-bar.d.ts +7 -0
  673. package/dist/types/tab-panel.d.ts +7 -0
  674. package/dist/types/tabs.d.ts +7 -0
  675. package/dist/types/tag.d.ts +7 -0
  676. package/dist/types/textarea.d.ts +7 -0
  677. package/dist/types/toast.d.ts +7 -0
  678. package/dist/types/tree-select.d.ts +7 -0
  679. package/dist/types/upload.d.ts +7 -0
  680. package/dist/types/watermark.d.ts +7 -0
  681. package/dist/upload/README.en-US.md +63 -0
  682. package/dist/upload/README.md +116 -0
  683. package/dist/upload/drag.computed.js +227 -0
  684. package/dist/upload/props.ts +136 -0
  685. package/dist/upload/type.ts +197 -0
  686. package/dist/upload/upload.computed.js +13 -0
  687. package/dist/upload/upload.css +116 -0
  688. package/dist/upload/upload.vue +887 -0
  689. package/dist/watermark/README.en-US.md +63 -0
  690. package/dist/watermark/README.md +115 -0
  691. package/dist/watermark/props.ts +82 -0
  692. package/dist/watermark/type.ts +121 -0
  693. package/dist/watermark/utils/generateBase64Url.js +360 -0
  694. package/dist/watermark/utils/randomMovingStyle.js +27 -0
  695. package/dist/watermark/watermark.css +28 -0
  696. package/dist/watermark/watermark.vue +200 -0
  697. package/global.d.ts +84 -0
  698. package/package.json +505 -7
@@ -0,0 +1,89 @@
1
+ :: BASE_DOC ::
2
+
3
+ ## API
4
+
5
+ ### Swiper Props
6
+
7
+ name | type | default | description | required
8
+ -- | -- | -- | -- | --
9
+ custom-style | Object | - | CSS(Cascading Style Sheets) | N
10
+ autoplay | Boolean | true | \- | N
11
+ current | Number | 0 | \- | N
12
+ direction | String | horizontal | options: horizontal/vertical | N
13
+ display-multiple-items | Number | 1 | \- | N
14
+ duration | Number | 300 | \- | N
15
+ easing-function | String | default | options: default/linear/easeInCubic/easeOutCubic/easeInOutCubic | N
16
+ height | String / Number | 192 | \- | N
17
+ image-props | Object | {} | \- | N
18
+ interval | Number | 5000 | \- | N
19
+ list | Array | - | Typescript:`string[] \| SwiperList[]` `interface SwiperList { value: string, ariaLabel: string }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/swiper/type.ts) | N
20
+ loop | Boolean | true | \- | N
21
+ navigation | Boolean / Object | true | Typescript:`SwiperNavProps \| boolean`,[SwiperNav API Documents](./swiper-nav?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/swiper/type.ts) | N
22
+ next-margin | String / Number | 0 | \- | N
23
+ pagination-position | String | bottom | options: top-left/top/top-right/bottom-left/bottom/bottom-right/left/right | N
24
+ previous-margin | String / Number | 0 | \- | N
25
+ snap-to-edge | Boolean | false | \- | N
26
+
27
+ ### Swiper Events
28
+
29
+ name | params | description
30
+ -- | -- | --
31
+ animationfinish | `(context: { current: number, source: SwiperChangeSource })` | 动画结束时会触发 animationfinish 事件
32
+ change | `(context: { current: number, source: SwiperChangeSource })` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/>
33
+ click | `(context: { index: number })` | \-
34
+ image-load | `(context: { index: number})` | \-
35
+
36
+ ### Swiper Slots
37
+
38
+ name | Description
39
+ -- | --
40
+ navigation | \-
41
+
42
+ ### Swiper External Classes
43
+
44
+ className | Description
45
+ -- | --
46
+ t-class | \-
47
+ t-class-image | \-
48
+ t-class-nav | \-
49
+ t-class-next-image | \-
50
+ t-class-prev-image | \-
51
+
52
+
53
+ ### SwiperNav Props
54
+
55
+ name | type | default | description | required
56
+ -- | -- | -- | -- | --
57
+ custom-style | Object | - | CSS(Cascading Style Sheets) | N
58
+ current | Number | 0 | \- | N
59
+ direction | String | horizontal | options: horizontal/vertical | N
60
+ min-show-num | Number | 2 | \- | N
61
+ pagination-position | String | bottom | options: top-left/top/top-right/bottom-left/bottom/bottom-right/left/right | N
62
+ show-controls | Boolean | false | \- | N
63
+ total | Number | 0 | \- | N
64
+ type | String | dots | Typescript:`SwiperNavigationType` `type SwiperNavigationType = 'dots' \| 'dots-bar' \| 'fraction'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/swiper-nav/type.ts) | N
65
+
66
+ ### SwiperNav External Classes
67
+
68
+ className | Description
69
+ -- | --
70
+ t-class | \-
71
+
72
+ ### CSS Variables
73
+
74
+ The component provides the following CSS variables, which can be used to customize styles.
75
+ Name | Default Value | Description
76
+ -- | -- | --
77
+ --td-swiper-item-padding | 0 | -
78
+ --td-swiper-radius | @radius-large | -
79
+ --td-swiper-nav-btn-bg-color | @font-gray-3 | -
80
+ --td-swiper-nav-btn-color | @text-color-anti | -
81
+ --td-swiper-nav-btn-size | 48rpx | -
82
+ --td-swiper-nav-dot-active-color | @text-color-anti | -
83
+ --td-swiper-nav-dot-color | @font-white-2 | -
84
+ --td-swiper-nav-dot-size | 12rpx | -
85
+ --td-swiper-nav-dots-bar-active-width | 40rpx | -
86
+ --td-swiper-nav-fraction-bg-color | @font-gray-3 | -
87
+ --td-swiper-nav-fraction-color | @text-color-anti | -
88
+ --td-swiper-nav-fraction-font | @font-body-small | -
89
+ --td-swiper-nav-fraction-height | 48rpx | -
@@ -0,0 +1,139 @@
1
+ ---
2
+ title: Swiper 轮播图
3
+ description: 用于循环轮播一组图片或内容,也可以滑动进行切换,轮播动效时间可以设置。
4
+ spline: message
5
+ isComponent: true
6
+ ---
7
+
8
+
9
+ ## 引入
10
+
11
+ 可在 `main.ts` 或在需要使用的页面或组件中引入。
12
+
13
+ ```js
14
+ import TSwiper from '@tdesign/uniapp/swiper/swiper.vue';
15
+ import TSwiperNav from '@tdesign/uniapp/swiper-nav/swiper-nav.vue';
16
+ ```
17
+ ### 组件说明
18
+
19
+ 从 `0.32.0` 版本开始,依赖原生 `swiper` 组件实现,移除了 `swiper-item` 组件,新增了 `list` 属性;
20
+
21
+ ## 代码演示
22
+
23
+ 多种轮播样式,通过 `navigation` 设置导航样式,没有值则不显示,也可以自定义 `nav` 组件
24
+
25
+ ### 组件类型
26
+
27
+ #### 点状(dots)轮播图
28
+
29
+ {{ base }}
30
+
31
+ #### 点条状(dots-bar)轮播图
32
+
33
+ {{ custom }}
34
+
35
+ #### 分式(fraction)导航器轮播图
36
+
37
+ {{ fraction }}
38
+
39
+ #### 切换按钮(controls)轮播图
40
+
41
+ {{ nav-btn }}
42
+
43
+ #### 卡片式(cards)轮播图
44
+
45
+ {{ cards }}
46
+
47
+ ### 组件样式
48
+
49
+ #### 垂直模式
50
+
51
+ {{ vertical }}
52
+
53
+ ## API
54
+
55
+ ### Swiper Props
56
+
57
+ 名称 | 类型 | 默认值 | 描述 | 必传
58
+ -- | -- | -- | -- | --
59
+ custom-style | Object | - | 自定义样式 | N
60
+ autoplay | Boolean | true | 是否自动播放 | N
61
+ current | Number | 0 | 当前轮播在哪一项(下标) | N
62
+ direction | String | horizontal | 轮播滑动方向,包括横向滑动和纵向滑动两个方向。可选项:horizontal/vertical | N
63
+ display-multiple-items | Number | 1 | 同时显示的滑块数量 | N
64
+ duration | Number | 300 | 滑动动画时长 | N
65
+ easing-function | String | default | 指定 swiper 切换缓动动画类型。可选项:default/linear/easeInCubic/easeOutCubic/easeInOutCubic | N
66
+ height | String / Number | 192 | 轮播的高度;默认单位 `px` | N
67
+ image-props | Object | {} | 透传至 Image 组件 | N
68
+ interval | Number | 5000 | 轮播间隔时间 | N
69
+ list | Array | - | 图片列表。TS 类型:`string[] \| SwiperList[]` `interface SwiperList { value: string, ariaLabel: string }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/swiper/type.ts) | N
70
+ loop | Boolean | true | 是否循环播放 | N
71
+ navigation | Boolean / Object | true | 导航器全部配置,true 的话使用默认配置。TS 类型:`SwiperNavProps \| boolean`,[SwiperNav API Documents](./swiper-nav?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/swiper/type.ts) | N
72
+ next-margin | String / Number | 0 | 后边距,可用于露出后一项的一小部分。默认单位 `px` | N
73
+ pagination-position | String | bottom | 页码信息展示位置。可选项:top-left/top/top-right/bottom-left/bottom/bottom-right/left/right | N
74
+ previous-margin | String / Number | 0 | 前边距,可用于露出前一项的一小部分。默认单位 `px` | N
75
+ snap-to-edge | Boolean | false | 当 swiper-item 的个数大于等于 2,关闭 circular 并且开启 previous-margin 或 next-margin 的时候,可以指定这个边距是否应用到第一个、最后一个元素 | N
76
+
77
+ ### Swiper Events
78
+
79
+ 名称 | 参数 | 描述
80
+ -- | -- | --
81
+ animationfinish | `(context: { current: number, source: SwiperChangeSource })` | 轮播切换时触发
82
+ change | `(context: { current: number, source: SwiperChangeSource })` | 轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/>
83
+ click | `(context: { index: number })` | 点击轮播项时触发
84
+ image-load | `(context: { index: number})` | 图片加载时触发
85
+
86
+ ### Swiper Slots
87
+
88
+ 名称 | 描述
89
+ -- | --
90
+ navigation | 导航器全部配置
91
+
92
+ ### Swiper External Classes
93
+
94
+ 类名 | 描述
95
+ -- | --
96
+ t-class | 根节点样式类
97
+ t-class-image | 当前图片样式类
98
+ t-class-nav | 导航样式类
99
+ t-class-next-image | 下一图片样式类
100
+ t-class-prev-image | 上一图片样式类
101
+
102
+
103
+ ### SwiperNav Props
104
+
105
+ 名称 | 类型 | 默认值 | 描述 | 必传
106
+ -- | -- | -- | -- | --
107
+ custom-style | Object | - | 自定义样式 | N
108
+ current | Number | 0 | 当前轮播在哪一项(下标) | N
109
+ direction | String | horizontal | 轮播滑动方向,包括横向滑动和纵向滑动两个方向。可选项:horizontal/vertical | N
110
+ min-show-num | Number | 2 | 小于这个数字不会显示导航器 | N
111
+ pagination-position | String | bottom | 页码信息展示位置。可选项:top-left/top/top-right/bottom-left/bottom/bottom-right/left/right | N
112
+ show-controls | Boolean | false | 是否显示两侧的控制按钮 | N
113
+ total | Number | 0 | 总共的项数 | N
114
+ type | String | dots | 导航器类型,点状(dots)、点条状(dots-bar)、分式(fraction)等。TS 类型:`SwiperNavigationType` `type SwiperNavigationType = 'dots' \| 'dots-bar' \| 'fraction'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/swiper-nav/type.ts) | N
115
+
116
+ ### SwiperNav External Classes
117
+
118
+ 类名 | 描述
119
+ -- | --
120
+ t-class | 根节点样式类
121
+
122
+ ### CSS Variables
123
+
124
+ 组件提供了下列 CSS 变量,可用于自定义样式。
125
+ 名称 | 默认值 | 描述
126
+ -- | -- | --
127
+ --td-swiper-item-padding | 0 | -
128
+ --td-swiper-radius | @radius-large | -
129
+ --td-swiper-nav-btn-bg-color | @font-gray-3 | -
130
+ --td-swiper-nav-btn-color | @text-color-anti | -
131
+ --td-swiper-nav-btn-size | 48rpx | -
132
+ --td-swiper-nav-dot-active-color | @text-color-anti | -
133
+ --td-swiper-nav-dot-color | @font-white-2 | -
134
+ --td-swiper-nav-dot-size | 12rpx | -
135
+ --td-swiper-nav-dots-bar-active-width | 40rpx | -
136
+ --td-swiper-nav-fraction-bg-color | @font-gray-3 | -
137
+ --td-swiper-nav-fraction-color | @text-color-anti | -
138
+ --td-swiper-nav-fraction-font | @font-body-small | -
139
+ --td-swiper-nav-fraction-height | 48rpx | -
@@ -0,0 +1,29 @@
1
+ export function isPrev(current, index, list) {
2
+ return (current - 1 + list.length) % list.length === index;
3
+ }
4
+
5
+ export function isNext(current, index, list) {
6
+ return (current + 1 + list.length) % list.length === index;
7
+ }
8
+
9
+ export function getImageClass(
10
+ prefix,
11
+ current,
12
+ index,
13
+ list,
14
+ tClassImage,
15
+ tClassPrevImage,
16
+ tClassNextImage,
17
+ ) {
18
+ const arr = [`${prefix}-swiper__image-host`, `${prefix}-swiper__image`, tClassImage];
19
+
20
+ if (isPrev(current, index, list)) {
21
+ arr.push(tClassPrevImage);
22
+ }
23
+
24
+ if (isNext(current, index, list)) {
25
+ arr.push(tClassNextImage);
26
+ }
27
+
28
+ return arr.join(' ');
29
+ }
@@ -0,0 +1,117 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
5
+ * */
6
+
7
+ import type { TdSwiperProps } from './type';
8
+ export default {
9
+ /** 是否自动播放 */
10
+ autoplay: {
11
+ type: Boolean,
12
+ default: true,
13
+ },
14
+ /** 当前轮播在哪一项(下标) */
15
+ current: {
16
+ type: Number,
17
+ default: 0,
18
+ },
19
+ /** 轮播滑动方向,包括横向滑动和纵向滑动两个方向 */
20
+ direction: {
21
+ type: String,
22
+ default: 'horizontal' as TdSwiperProps['direction'],
23
+ validator(val: TdSwiperProps['direction']): boolean {
24
+ if (!val) return true;
25
+ return ['horizontal', 'vertical'].includes(val);
26
+ },
27
+ },
28
+ /** 同时显示的滑块数量 */
29
+ displayMultipleItems: {
30
+ type: Number,
31
+ default: 1,
32
+ },
33
+ /** 滑动动画时长 */
34
+ duration: {
35
+ type: Number,
36
+ default: 300,
37
+ },
38
+ /** 指定 swiper 切换缓动动画类型 */
39
+ easingFunction: {
40
+ type: String,
41
+ default: 'default' as TdSwiperProps['easingFunction'],
42
+ validator(val: TdSwiperProps['easingFunction']): boolean {
43
+ if (!val) return true;
44
+ return ['default', 'linear', 'easeInCubic', 'easeOutCubic', 'easeInOutCubic'].includes(val);
45
+ },
46
+ },
47
+ /** 轮播的高度;默认单位 `px` */
48
+ height: {
49
+ type: [String, Number],
50
+ default: 192 as TdSwiperProps['height'],
51
+ },
52
+ /** 透传至 Image 组件 */
53
+ imageProps: {
54
+ type: Object,
55
+ default: () => ({}),
56
+ },
57
+ /** 轮播间隔时间 */
58
+ interval: {
59
+ type: Number,
60
+ default: 5000,
61
+ },
62
+ /** 图片列表 */
63
+ list: {
64
+ type: Array,
65
+ },
66
+ /** 是否循环播放 */
67
+ loop: {
68
+ type: Boolean,
69
+ default: true,
70
+ },
71
+ /** 导航器全部配置,true 的话使用默认配置 */
72
+ navigation: {
73
+ type: [Boolean, Object],
74
+ default: true as TdSwiperProps['navigation'],
75
+ },
76
+ /** 后边距,可用于露出后一项的一小部分。默认单位 `px` */
77
+ nextMargin: {
78
+ type: [String, Number],
79
+ default: 0 as TdSwiperProps['nextMargin'],
80
+ },
81
+ /** 页码信息展示位置 */
82
+ paginationPosition: {
83
+ type: String,
84
+ default: 'bottom' as TdSwiperProps['paginationPosition'],
85
+ validator(val: TdSwiperProps['paginationPosition']): boolean {
86
+ if (!val) return true;
87
+ return ['top-left', 'top', 'top-right', 'bottom-left', 'bottom', 'bottom-right', 'left', 'right'].includes(val);
88
+ },
89
+ },
90
+ /** 前边距,可用于露出前一项的一小部分。默认单位 `px` */
91
+ previousMargin: {
92
+ type: [String, Number],
93
+ default: 0 as TdSwiperProps['previousMargin'],
94
+ },
95
+ /** 当 swiper-item 的个数大于等于 2,关闭 circular 并且开启 previous-margin 或 next-margin 的时候,可以指定这个边距是否应用到第一个、最后一个元素 */
96
+ snapToEdge: Boolean,
97
+ /** 轮播切换时触发 */
98
+ onAnimationfinish: {
99
+ type: Function,
100
+ default: () => ({}),
101
+ },
102
+ /** 轮播切换时触发 */
103
+ onChange: {
104
+ type: Function,
105
+ default: () => ({}),
106
+ },
107
+ /** 点击轮播项时触发 */
108
+ onClick: {
109
+ type: Function,
110
+ default: () => ({}),
111
+ },
112
+ /** 图片加载时触发 */
113
+ onImageLoad: {
114
+ type: Function,
115
+ default: () => ({}),
116
+ },
117
+ };
@@ -0,0 +1,21 @@
1
+ .t-swiper {
2
+ position: relative;
3
+ }
4
+ .t-swiper-host {
5
+ border-radius: var(--td-swiper-radius, var(--td-radius-large, 18rpx));
6
+ overflow: hidden;
7
+ transform: translateY(0);
8
+ }
9
+ .t-swiper__item {
10
+ display: flex;
11
+ align-items: center;
12
+ box-sizing: border-box;
13
+ padding: var(--td-swiper-item-padding, 0);
14
+ }
15
+ :deep(.t-swiper__image) {
16
+ width: 100%;
17
+ transition: all 0.3s ease;
18
+ }
19
+ :deep(.t-swiper__image)-host {
20
+ width: 100%;
21
+ }
@@ -0,0 +1,193 @@
1
+ <template>
2
+ <view
3
+ :class="classPrefix + ' ' + tClass"
4
+ :style="tools._style([customStyle])"
5
+ >
6
+ <swiper
7
+ :class="classPrefix + '-host'"
8
+ :autoplay="autoplay"
9
+ :current="current"
10
+ :interval="interval"
11
+ :duration="duration"
12
+ :circular="loop"
13
+ :vertical="direction == 'vertical'"
14
+ :easing-function="easingFunction"
15
+ :previous-margin="tools.addUnit(previousMargin)"
16
+ :next-margin="tools.addUnit(nextMargin)"
17
+ :snap-to-edge="snapToEdge"
18
+ :display-multiple-items="displayMultipleItems"
19
+ :style="'height: ' + tools.addUnit(height)"
20
+ @change="onChange"
21
+ @animationfinish="onAnimationFinish"
22
+ >
23
+ <swiper-item
24
+ v-for="(item, index) in list"
25
+ :key="index"
26
+ :class="
27
+ tools.cls(classPrefix + '__item', [
28
+ ['preview', isPrev(navCurrent, index, list)],
29
+ ['next', isNext(navCurrent, index, list)]
30
+ ])
31
+ "
32
+ :data-index="index"
33
+ :aria-hidden="navCurrent !== index"
34
+ aria-role="image"
35
+ :aria-label="tools.isObject(item) ? item.ariaLabel : ''"
36
+ @click="onTap($event, { index })"
37
+ >
38
+ <t-image
39
+ :t-class="getImageClass(prefix, navCurrent, index, list, tClassImage, tClassPrevImage, tClassNextImage)"
40
+ :custom-style="'height: ' + tools.addUnit(height) || ''"
41
+ :error="imageProps.error || 'default'"
42
+ :lazy="imageProps.lazy || false"
43
+ :loading="imageProps.loading || 'default'"
44
+ :shape="imageProps.shape || 'square'"
45
+ :src="tools.isObject(item) ? item.value : item"
46
+ :mode="imageProps.mode || 'aspectFill'"
47
+ :webp="imageProps.webp || false"
48
+ :show-menu-by-longpress="imageProps.showMenuByLongpress || false"
49
+ @load="onImageLoad($event, { custom: index || null })"
50
+ />
51
+ </swiper-item>
52
+ </swiper>
53
+ <t-swiper-nav
54
+ v-if="navigation"
55
+ :t-class="tClassNav"
56
+ :type="navigation.type || 'dots'"
57
+ :current="navCurrent || 0"
58
+ :total="list.length || 0"
59
+ :direction="direction || 'horizontal'"
60
+ :pagination-position="paginationPosition || 'bottom'"
61
+ :min-show-num="navigation.minShowNum || 2"
62
+ :show-controls="navigation.showControls || false"
63
+ @nav-btn-change="onNavBtnChange"
64
+ />
65
+ <slot name="navigation" />
66
+ <slot name="nav" />
67
+ </view>
68
+ </template>
69
+ <script>
70
+ import TSwiperNav from '../swiper-nav/swiper-nav';
71
+ import TImage from '../image/image';
72
+ import { uniComponent } from '../common/src/index';
73
+ import { prefix } from '../common/config';
74
+ import props from './props';
75
+ import tools from '../common/utils.wxs';
76
+ import { isPrev, isNext, getImageClass } from './computed.js';
77
+ import { ParentMixin, RELATION_MAP } from '../common/relation';
78
+
79
+ const name = `${prefix}-swiper`;
80
+
81
+ export default uniComponent({
82
+ name,
83
+ options: {
84
+ multipleSlots: true,
85
+ styleIsolation: 'shared',
86
+ },
87
+ externalClasses: [`${prefix}-class`, `${prefix}-class-nav`, `${prefix}-class-image`, `${prefix}-class-prev-image`, `${prefix}-class-next-image`],
88
+ mixins: [ParentMixin(RELATION_MAP.SwiperNav)],
89
+ components: {
90
+ TSwiperNav,
91
+ TImage,
92
+ },
93
+ props: {
94
+ ...props,
95
+ },
96
+ emits: [
97
+ 'click',
98
+ 'change',
99
+ 'animationfinish',
100
+ 'image-load',
101
+ ],
102
+ data() {
103
+ return {
104
+ prefix,
105
+ classPrefix: name,
106
+ tools,
107
+ navCurrent: 0,
108
+ };
109
+ },
110
+ watch: {
111
+ navCurrent(t) {
112
+ this.updateNav(t);
113
+ },
114
+ },
115
+
116
+ mounted() {
117
+ this.navCurrent = this.current;
118
+ },
119
+
120
+ methods: {
121
+ isPrev,
122
+ isNext,
123
+ getImageClass,
124
+
125
+ updateNav(currentValue) {
126
+ if (this.navigation) return;
127
+ const $nav = this.getRelationNodes('./swiper-nav')?.[0];
128
+ if (!$nav) return;
129
+ const { direction, paginationPosition, list } = this;
130
+
131
+ this.current = currentValue;
132
+ this.total = list.length;
133
+ this.direction = direction;
134
+ this.paginationPosition = paginationPosition;
135
+ },
136
+
137
+ onTap(e, dataset) {
138
+ const { index } = dataset;
139
+ this.$emit('click', { index });
140
+ },
141
+
142
+ onChange(e) {
143
+ const { current, source } = e.detail;
144
+
145
+ if (!source) return;
146
+
147
+ this.navCurrent = current;
148
+ this.triggerSource = source;
149
+
150
+ this.$emit('change', { current, source });
151
+ },
152
+
153
+ onAnimationFinish(e) {
154
+ const { current, source } = e.detail;
155
+
156
+ this.$emit('animationfinish', { current, source: source || this.triggerSource });
157
+ },
158
+
159
+ onNavBtnChange(e) {
160
+ const { dir, source } = e;
161
+
162
+ this.doNavBtnChange(dir, source);
163
+ },
164
+
165
+ doNavBtnChange(dir, source) {
166
+ const { current, list, loop, navCurrent } = this;
167
+ const count = list.length;
168
+ let nextPos = dir === 'next' ? current + 1 : current - 1;
169
+
170
+ if (loop) {
171
+ nextPos = dir === 'next' ? (current + 1) % count : (current - 1 + count) % count;
172
+ } else {
173
+ nextPos = nextPos < 0 || nextPos >= count ? current : nextPos;
174
+ }
175
+
176
+ if (nextPos === navCurrent) return;
177
+
178
+ this.navCurrent = nextPos;
179
+ this.triggerSource = source;
180
+
181
+ this.$emit('change', { current: nextPos, source });
182
+ },
183
+
184
+ onImageLoad(e, dataset) {
185
+ this.$emit('image-load', { index: dataset.custom });
186
+ },
187
+ },
188
+ });
189
+
190
+ </script>
191
+ <style scoped>
192
+ @import './swiper.css';
193
+ </style>
@@ -0,0 +1,112 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
5
+ * */
6
+
7
+ import type { TdSwiperNavProps as SwiperNavProps } from '../swiper-nav/type';
8
+
9
+ export interface TdSwiperProps {
10
+ /**
11
+ * 是否自动播放
12
+ * @default true
13
+ */
14
+ autoplay?: boolean;
15
+ /**
16
+ * 当前轮播在哪一项(下标)
17
+ * @default 0
18
+ */
19
+ current?: number;
20
+ /**
21
+ * 轮播滑动方向,包括横向滑动和纵向滑动两个方向
22
+ * @default horizontal
23
+ */
24
+ direction?: 'horizontal' | 'vertical';
25
+ /**
26
+ * 同时显示的滑块数量
27
+ * @default 1
28
+ */
29
+ displayMultipleItems?: number;
30
+ /**
31
+ * 滑动动画时长
32
+ * @default 300
33
+ */
34
+ duration?: number;
35
+ /**
36
+ * 指定 swiper 切换缓动动画类型
37
+ * @default default
38
+ */
39
+ easingFunction?: 'default' | 'linear' | 'easeInCubic' | 'easeOutCubic' | 'easeInOutCubic';
40
+ /**
41
+ * 轮播的高度;默认单位 `px`
42
+ * @default 192
43
+ */
44
+ height?: string | number;
45
+ /**
46
+ * 透传至 Image 组件
47
+ * @default {}
48
+ */
49
+ imageProps?: object;
50
+ /**
51
+ * 轮播间隔时间
52
+ * @default 5000
53
+ */
54
+ interval?: number;
55
+ /**
56
+ * 图片列表
57
+ */
58
+ list?: string[] | SwiperList[];
59
+ /**
60
+ * 是否循环播放
61
+ * @default true
62
+ */
63
+ loop?: boolean;
64
+ /**
65
+ * 导航器全部配置,true 的话使用默认配置
66
+ * @default true
67
+ */
68
+ navigation?: SwiperNavProps | boolean;
69
+ /**
70
+ * 后边距,可用于露出后一项的一小部分。默认单位 `px`
71
+ * @default 0
72
+ */
73
+ nextMargin?: string | number;
74
+ /**
75
+ * 页码信息展示位置
76
+ * @default bottom
77
+ */
78
+ paginationPosition?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right' | 'left' | 'right';
79
+ /**
80
+ * 前边距,可用于露出前一项的一小部分。默认单位 `px`
81
+ * @default 0
82
+ */
83
+ previousMargin?: string | number;
84
+ /**
85
+ * 当 swiper-item 的个数大于等于 2,关闭 circular 并且开启 previous-margin 或 next-margin 的时候,可以指定这个边距是否应用到第一个、最后一个元素
86
+ * @default false
87
+ */
88
+ snapToEdge?: boolean;
89
+ /**
90
+ * 轮播切换时触发
91
+ */
92
+ onAnimationfinish?: (context: { current: number; source: SwiperChangeSource }) => void;
93
+ /**
94
+ * 轮播切换时触发
95
+ */
96
+ onChange?: (context: { current: number; source: SwiperChangeSource }) => void;
97
+ /**
98
+ * 点击轮播项时触发
99
+ */
100
+ onClick?: (context: { index: number }) => void;
101
+ /**
102
+ * 图片加载时触发
103
+ */
104
+ onImageLoad?: (context: { index: number }) => void;
105
+ }
106
+
107
+ export interface SwiperList {
108
+ value: string;
109
+ ariaLabel: string;
110
+ }
111
+
112
+ export type SwiperChangeSource = 'autoplay' | 'touch' | 'nav';