@opentiny/vue-docs 2.2.7 → 2.2.9

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 (494) hide show
  1. package/demos/mobile/app/button/base.vue +42 -0
  2. package/demos/mobile/app/button/disabled.vue +42 -0
  3. package/demos/mobile/app/button/event.vue +46 -0
  4. package/demos/mobile/app/button/icon.vue +8 -7
  5. package/demos/mobile/app/button/loading.vue +21 -9
  6. package/demos/mobile/app/button/reset-time.vue +9 -16
  7. package/demos/mobile/app/button/size.vue +28 -11
  8. package/demos/mobile/app/button/webdoc/button.js +43 -98
  9. package/demos/mobile/app/file-upload/custom-upload-tip.vue +1 -1
  10. package/demos/mobile/app/switch/webdoc/switch.cn.md +3 -4
  11. package/demos/mobile-first/app/switch/webdoc/switch.cn.md +1 -1
  12. package/demos/mobile-first/app/switch/webdoc/switch.en.md +1 -1
  13. package/demos/pc/app/action-menu/webdoc/action-menu.js +2 -2
  14. package/demos/pc/app/alert/basic-usage-composition-api.vue +1 -0
  15. package/demos/pc/app/alert/basic-usage.vue +1 -0
  16. package/demos/pc/app/alert/custom-close.spec.ts +1 -1
  17. package/demos/pc/app/alert/icon-composition-api.vue +3 -2
  18. package/demos/pc/app/alert/icon.vue +4 -3
  19. package/demos/pc/app/alert/webdoc/alert.js +12 -2
  20. package/demos/pc/app/anchor/basic-usage-composition-api.vue +7 -7
  21. package/demos/pc/app/anchor/basic-usage.spec.ts +2 -2
  22. package/demos/pc/app/anchor/basic-usage.vue +7 -7
  23. package/demos/pc/app/anchor/change-composition-api.vue +7 -7
  24. package/demos/pc/app/anchor/change.spec.ts +2 -2
  25. package/demos/pc/app/anchor/change.vue +7 -7
  26. package/demos/pc/app/anchor/is-affix-composition-api.vue +7 -7
  27. package/demos/pc/app/anchor/is-affix.vue +7 -7
  28. package/demos/pc/app/anchor/webdoc/anchor.js +4 -4
  29. package/demos/pc/app/autocomplete/webdoc/autocomplete.js +2 -2
  30. package/demos/pc/app/badge/webdoc/badge.js +1 -1
  31. package/demos/pc/app/button/webdoc/button.js +1 -1
  32. package/demos/pc/app/button-group/basic-usage.spec.ts +1 -0
  33. package/demos/pc/app/button-group/slot-empty-composition-api.vue +25 -0
  34. package/demos/pc/app/button-group/slot-empty.spec.ts +11 -0
  35. package/demos/pc/app/button-group/slot-empty.vue +33 -0
  36. package/demos/pc/app/button-group/webdoc/button-group.js +9 -0
  37. package/demos/pc/app/calendar/basic-usage-composition-api.vue +1 -1
  38. package/demos/pc/app/calendar/basic-usage.spec.ts +33 -0
  39. package/demos/pc/app/calendar/basic-usage.vue +1 -1
  40. package/demos/pc/app/calendar/calendar-mode-composition-api.vue +1 -1
  41. package/demos/pc/app/calendar/calendar-mode.spec.ts +33 -0
  42. package/demos/pc/app/calendar/calendar-mode.vue +1 -1
  43. package/demos/pc/app/calendar/custom-calendar-toolbar-composition-api.vue +3 -3
  44. package/demos/pc/app/calendar/custom-calendar-toolbar.spec.ts +18 -0
  45. package/demos/pc/app/calendar/custom-calendar-toolbar.vue +3 -3
  46. package/demos/pc/app/calendar/custom-day-cell-composition-api.vue +1 -1
  47. package/demos/pc/app/calendar/custom-day-cell.spec.ts +10 -0
  48. package/demos/pc/app/calendar/custom-day-cell.vue +1 -1
  49. package/demos/pc/app/calendar/dynamic-add-schedule-composition-api.vue +1 -1
  50. package/demos/pc/app/calendar/dynamic-add-schedule.spec.ts +26 -0
  51. package/demos/pc/app/calendar/dynamic-add-schedule.vue +1 -1
  52. package/demos/pc/app/calendar/show-selected-date-composition-api.vue +1 -1
  53. package/demos/pc/app/calendar/show-selected-date.spec.ts +14 -0
  54. package/demos/pc/app/calendar/show-selected-date.vue +1 -1
  55. package/demos/pc/app/calendar/webdoc/calendar.js +22 -8
  56. package/demos/pc/app/calendar-view/basic-usage.spec.ts +18 -0
  57. package/demos/pc/app/calendar-view/calendar-day-mark.spec.ts +23 -0
  58. package/demos/pc/app/calendar-view/calendar-disabled-day-composition-api.vue +2 -2
  59. package/demos/pc/app/calendar-view/calendar-disabled-day.spec.ts +12 -0
  60. package/demos/pc/app/calendar-view/calendar-disabled-day.vue +1 -1
  61. package/demos/pc/app/calendar-view/calendar-event.spec.ts +25 -0
  62. package/demos/pc/app/calendar-view/calendar-mode.spec.ts +25 -0
  63. package/demos/pc/app/calendar-view/calendar-schedule-slot.spec.ts +18 -0
  64. package/demos/pc/app/calendar-view/calendar-timeline-range.spec.ts +11 -0
  65. package/demos/pc/app/calendar-view/calendar-timeline-slot.spec.ts +23 -0
  66. package/demos/pc/app/calendar-view/custom-calendar-toolbar.spec.ts +8 -0
  67. package/demos/pc/app/calendar-view/custom-day-bg-color.spec.ts +8 -0
  68. package/demos/pc/app/calendar-view/custom-header.spec.ts +11 -0
  69. package/demos/pc/app/calendar-view/multi-select-composition-api.vue +2 -2
  70. package/demos/pc/app/calendar-view/multi-select.spec.ts +13 -0
  71. package/demos/pc/app/calendar-view/multi-select.vue +1 -1
  72. package/demos/pc/app/calendar-view/set-working-day-composition-api.vue +3 -7
  73. package/demos/pc/app/calendar-view/set-working-day.spec.ts +22 -0
  74. package/demos/pc/app/calendar-view/set-working-day.vue +1 -1
  75. package/demos/pc/app/calendar-view/webdoc/calendar-view.js +1 -1
  76. package/demos/pc/app/carousel/autoplay-composition-api.vue +2 -2
  77. package/demos/pc/app/carousel/autoplay.spec.ts +2 -0
  78. package/demos/pc/app/carousel/autoplay.vue +2 -2
  79. package/demos/pc/app/carousel/basic-usage-composition-api.vue +2 -2
  80. package/demos/pc/app/carousel/basic-usage.spec.ts +1 -8
  81. package/demos/pc/app/carousel/basic-usage.vue +2 -2
  82. package/demos/pc/app/carousel/card-mode-composition-api.vue +2 -2
  83. package/demos/pc/app/carousel/card-mode.vue +2 -2
  84. package/demos/pc/app/carousel/carousel-arrow-always-composition-api.vue +2 -2
  85. package/demos/pc/app/carousel/carousel-arrow-always.vue +2 -2
  86. package/demos/pc/app/carousel/carousel-arrow-hover-composition-api.vue +2 -2
  87. package/demos/pc/app/carousel/carousel-arrow-hover.vue +2 -2
  88. package/demos/pc/app/carousel/carousel-arrow-never-composition-api.vue +2 -2
  89. package/demos/pc/app/carousel/carousel-arrow-never.vue +2 -2
  90. package/demos/pc/app/carousel/carousel-events-composition-api.vue +2 -2
  91. package/demos/pc/app/carousel/carousel-events.vue +2 -2
  92. package/demos/pc/app/carousel/close-loop-composition-api.vue +2 -2
  93. package/demos/pc/app/carousel/close-loop.vue +2 -2
  94. package/demos/pc/app/carousel/custom-height-composition-api.vue +2 -2
  95. package/demos/pc/app/carousel/custom-height.vue +2 -2
  96. package/demos/pc/app/carousel/indicator-trigger-composition-api.vue +2 -2
  97. package/demos/pc/app/carousel/indicator-trigger.vue +2 -2
  98. package/demos/pc/app/carousel/initial-index-composition-api.vue +2 -2
  99. package/demos/pc/app/carousel/initial-index.vue +2 -2
  100. package/demos/pc/app/carousel/manual-play-composition-api.vue +19 -8
  101. package/demos/pc/app/carousel/manual-play.vue +18 -8
  102. package/demos/pc/app/carousel/play-interval-composition-api.vue +2 -2
  103. package/demos/pc/app/carousel/play-interval.vue +2 -2
  104. package/demos/pc/app/carousel/show-title-composition-api.vue +2 -2
  105. package/demos/pc/app/carousel/show-title.vue +2 -2
  106. package/demos/pc/app/carousel/up-down-carousel-composition-api.vue +2 -2
  107. package/demos/pc/app/carousel/up-down-carousel.vue +2 -2
  108. package/demos/pc/app/chart/histogram/demo4-composition-api.vue +0 -2
  109. package/demos/pc/app/chart/histogram/demo4.vue +0 -2
  110. package/demos/pc/app/checkbox/checkbox-events-composition-api.vue +2 -3
  111. package/demos/pc/app/checkbox/checkbox-events.vue +2 -3
  112. package/demos/pc/app/checkbox/group-options-composition-api.vue +1 -1
  113. package/demos/pc/app/checkbox/group-options.vue +1 -1
  114. package/demos/pc/app/checkbox/size-composition-api.vue +0 -1
  115. package/demos/pc/app/checkbox/text-composition-api.vue +3 -2
  116. package/demos/pc/app/checkbox/text.vue +2 -1
  117. package/demos/pc/app/checkbox/webdoc/checkbox.js +3 -3
  118. package/demos/pc/app/collapse/title-composition-api.vue +3 -2
  119. package/demos/pc/app/collapse/title.vue +3 -2
  120. package/demos/pc/app/collapse/webdoc/collapse.js +11 -11
  121. package/demos/pc/app/config-provider/webdoc/config-provider.js +3 -3
  122. package/demos/pc/app/date-picker/align.spec.ts +11 -12
  123. package/demos/pc/app/date-picker/basic-usage.spec.ts +17 -23
  124. package/demos/pc/app/date-picker/clear.spec.ts +24 -5
  125. package/demos/pc/app/date-picker/date-range.spec.ts +63 -11
  126. package/demos/pc/app/date-picker/default-value.spec.ts +19 -4
  127. package/demos/pc/app/date-picker/events.spec.ts +24 -10
  128. package/demos/pc/app/date-picker/format.spec.ts +12 -11
  129. package/demos/pc/app/date-picker/shortcuts.spec.ts +6 -5
  130. package/demos/pc/app/dialog-box/basic-usage-composition-api.vue +1 -1
  131. package/demos/pc/app/dialog-box/basic-usage.vue +1 -1
  132. package/demos/pc/app/dialog-box/center-composition-api.vue +2 -2
  133. package/demos/pc/app/dialog-box/center.vue +2 -2
  134. package/demos/pc/app/dialog-box/close-on-click-modal-composition-api.vue +2 -2
  135. package/demos/pc/app/dialog-box/close-on-click-modal.vue +2 -2
  136. package/demos/pc/app/dialog-box/close-on-press-escape-composition-api.vue +2 -2
  137. package/demos/pc/app/dialog-box/close-on-press-escape.vue +2 -2
  138. package/demos/pc/app/dialog-box/custom-dialog-content-composition-api.vue +2 -2
  139. package/demos/pc/app/dialog-box/custom-dialog-content.vue +2 -2
  140. package/demos/pc/app/dialog-box/custom-dialog-footer-composition-api.vue +2 -2
  141. package/demos/pc/app/dialog-box/custom-dialog-footer.vue +4 -4
  142. package/demos/pc/app/dialog-box/custom-dialog-title-composition-api.vue +2 -2
  143. package/demos/pc/app/dialog-box/custom-dialog-title.vue +2 -2
  144. package/demos/pc/app/dialog-box/dialog-top-height-composition-api.vue +2 -2
  145. package/demos/pc/app/dialog-box/dialog-top-height.vue +2 -2
  146. package/demos/pc/app/dialog-box/dialog-width-composition-api.vue +3 -3
  147. package/demos/pc/app/dialog-box/dialog-width.vue +3 -3
  148. package/demos/pc/app/dialog-box/lock-scroll-composition-api.vue +2 -2
  149. package/demos/pc/app/dialog-box/lock-scroll.vue +2 -2
  150. package/demos/pc/app/dialog-box/webdoc/dialog-box.js +63 -63
  151. package/demos/pc/app/dialog-select/nest-grid-multi-composition-api.vue +9 -3
  152. package/demos/pc/app/dialog-select/nest-grid-multi.vue +8 -3
  153. package/demos/pc/app/dialog-select/nest-grid-single-composition-api.vue +3 -2
  154. package/demos/pc/app/dialog-select/nest-grid-single.vue +3 -2
  155. package/demos/pc/app/dialog-select/nest-tree-multi-composition-api.vue +3 -2
  156. package/demos/pc/app/dialog-select/nest-tree-multi.vue +3 -2
  157. package/demos/pc/app/dialog-select/nest-tree-single-composition-api.vue +3 -2
  158. package/demos/pc/app/dialog-select/nest-tree-single.vue +3 -2
  159. package/demos/pc/app/dialog-select/webdoc/dialog-select.js +90 -42
  160. package/demos/pc/app/drawer/confirm-event-composition-api.vue +1 -1
  161. package/demos/pc/app/drawer/confirm-event.vue +1 -1
  162. package/demos/pc/app/drawer/webdoc/drawer.cn.md +1 -1
  163. package/demos/pc/app/drawer/webdoc/drawer.en.md +7 -0
  164. package/demos/pc/app/drawer/webdoc/drawer.js +94 -47
  165. package/demos/pc/app/drawer/z-index-composition-api.vue +1 -1
  166. package/demos/pc/app/drawer/z-index.spec.ts +1 -1
  167. package/demos/pc/app/drawer/z-index.vue +1 -1
  168. package/demos/pc/app/drop-times/basic-usage-composition-api.vue +7 -1
  169. package/demos/pc/app/drop-times/basic-usage.spec.ts +1 -1
  170. package/demos/pc/app/drop-times/basic-usage.vue +8 -2
  171. package/demos/pc/app/drop-times/size-composition-api.vue +14 -4
  172. package/demos/pc/app/drop-times/size.spec.ts +5 -1
  173. package/demos/pc/app/drop-times/size.vue +14 -4
  174. package/demos/pc/app/drop-times/start-end-step-composition-api.vue +8 -13
  175. package/demos/pc/app/drop-times/start-end-step.spec.ts +1 -1
  176. package/demos/pc/app/drop-times/start-end-step.vue +10 -16
  177. package/demos/pc/app/drop-times/webdoc/drop-times.js +27 -17
  178. package/demos/pc/app/dropdown/webdoc/dropdown.js +2 -2
  179. package/demos/pc/app/fall-menu/webdoc/fall-menu.js +4 -10
  180. package/demos/pc/app/file-upload/abort-quest-composition-api.vue +1 -1
  181. package/demos/pc/app/file-upload/abort-quest.vue +1 -1
  182. package/demos/pc/app/file-upload/basic-usage.spec.ts +2 -2
  183. package/demos/pc/app/file-upload/{prevent-upload-file-composition-api.vue → before-upload-limit-composition-api.vue} +13 -5
  184. package/demos/pc/app/file-upload/{prevent-upload-file.spec.ts → before-upload-limit.spec.ts} +9 -4
  185. package/demos/pc/app/file-upload/{prevent-upload-file.vue → before-upload-limit.vue} +15 -5
  186. package/demos/pc/app/file-upload/custom-upload-tip-composition-api.vue +1 -1
  187. package/demos/pc/app/file-upload/custom-upload-tip.spec.ts +1 -1
  188. package/demos/pc/app/file-upload/custom-upload-tip.vue +1 -1
  189. package/demos/pc/app/file-upload/form-validation-composition-api.vue +10 -4
  190. package/demos/pc/app/file-upload/form-validation.vue +9 -3
  191. package/demos/pc/app/file-upload/multiple-file.spec.ts +3 -1
  192. package/demos/pc/app/file-upload/upload-events-composition-api.vue +8 -8
  193. package/demos/pc/app/file-upload/upload-events.vue +8 -8
  194. package/demos/pc/app/file-upload/upload-request-composition-api.vue +1 -1
  195. package/demos/pc/app/file-upload/upload-request.vue +1 -1
  196. package/demos/pc/app/file-upload/webdoc/file-upload.js +97 -96
  197. package/demos/pc/app/form/form-validation-composition-api.vue +2 -2
  198. package/demos/pc/app/form/form-validation.vue +1 -1
  199. package/demos/pc/app/form/label-position.spec.ts +3 -0
  200. package/demos/pc/app/form/popper-options.spec.ts +1 -0
  201. package/demos/pc/app/form/slot-label-composition-api.vue +1 -1
  202. package/demos/pc/app/form/validate-debounce-composition-api.vue +3 -3
  203. package/demos/pc/app/form/validate-debounce.vue +3 -3
  204. package/demos/pc/app/form/webdoc/form.js +10 -9
  205. package/demos/pc/app/grid/dynamically-columns/dynamically-columns-composition-api.vue +6 -4
  206. package/demos/pc/app/grid/dynamically-columns/dynamically-columns.vue +6 -4
  207. package/demos/pc/app/grid/dynamically-columns/reverse-row-composition-api.vue +3 -1
  208. package/demos/pc/app/grid/dynamically-columns/reverse-row.vue +3 -1
  209. package/demos/pc/app/grid/faq/grid-in-dialog-box-composition-api.vue +1 -1
  210. package/demos/pc/app/grid/faq/grid-in-dialog-box.spec.js +1 -1
  211. package/demos/pc/app/grid/faq/grid-in-dialog-box.vue +1 -1
  212. package/demos/pc/app/grid/filter/advanced-filter-composition-api.vue +0 -15
  213. package/demos/pc/app/grid/filter/advanced-filter.spec.js +1 -1
  214. package/demos/pc/app/grid/filter/advanced-filter.vue +0 -14
  215. package/demos/pc/app/grid/filter/custom-filter.spec.js +1 -1
  216. package/demos/pc/app/grid/filter/default-filter-composition-api.vue +1 -1
  217. package/demos/pc/app/grid/filter/default-filter.spec.ts +1 -1
  218. package/demos/pc/app/grid/filter/default-filter.vue +1 -1
  219. package/demos/pc/app/grid/filter/simple-default-value-filter-composition-api.vue +0 -14
  220. package/demos/pc/app/grid/filter/simple-default-value-filter.vue +0 -14
  221. package/demos/pc/app/grid/filter/simple-filter-composition-api.vue +0 -14
  222. package/demos/pc/app/grid/filter/simple-filter.vue +0 -14
  223. package/demos/pc/app/grid/footer/configuration-summary.spec.js +1 -1
  224. package/demos/pc/app/grid/highlight/set-current-row-composition-api.vue +4 -1
  225. package/demos/pc/app/grid/highlight/set-current-row.vue +4 -1
  226. package/demos/pc/app/grid/large-data/scroll-to-composition-api.vue +6 -3
  227. package/demos/pc/app/grid/large-data/scroll-to.vue +6 -3
  228. package/demos/pc/app/grid/pager/inner-pager-composition-api.vue +1 -1
  229. package/demos/pc/app/grid/pager/inner-pager.spec.js +1 -1
  230. package/demos/pc/app/grid/pager/inner-pager.vue +1 -1
  231. package/demos/pc/app/grid/sort/server-sort-composition-api.vue +3 -3
  232. package/demos/pc/app/grid/sort/server-sort.vue +2 -2
  233. package/demos/pc/app/grid/sort/sort-composition-api.vue +4 -1
  234. package/demos/pc/app/grid/sort/sort.spec.js +1 -1
  235. package/demos/pc/app/grid/sort/sort.vue +4 -1
  236. package/demos/pc/app/grid/toolbar/insert-delete-update-composition-api.vue +2 -1
  237. package/demos/pc/app/grid/toolbar/insert-delete-update.vue +2 -1
  238. package/demos/pc/app/grid/toolbar/toolbar-op-config-composition-api.vue +3 -2
  239. package/demos/pc/app/grid/toolbar/toolbar-op-config.vue +3 -2
  240. package/demos/pc/app/grid/validation/before-submit-validation-composition-api.vue +5 -5
  241. package/demos/pc/app/grid/validation/before-submit-validation.spec.js +2 -2
  242. package/demos/pc/app/grid/validation/before-submit-validation.vue +5 -5
  243. package/demos/pc/app/grid/webdoc/grid-appearance-settings.js +2 -2
  244. package/demos/pc/app/grid/webdoc/grid-context-menu.js +4 -4
  245. package/demos/pc/app/grid/webdoc/grid-custom-style.js +2 -2
  246. package/demos/pc/app/grid/webdoc/grid-custom.js +31 -31
  247. package/demos/pc/app/grid/webdoc/grid-drag.js +1 -1
  248. package/demos/pc/app/grid/webdoc/grid-dynamically-columns.js +4 -1
  249. package/demos/pc/app/grid/webdoc/grid-editor.js +2 -2
  250. package/demos/pc/app/grid/webdoc/grid-empty.js +4 -1
  251. package/demos/pc/app/grid/webdoc/grid-expand.js +3 -3
  252. package/demos/pc/app/grid/webdoc/grid-faq.js +4 -4
  253. package/demos/pc/app/grid/webdoc/grid-filter.js +4 -4
  254. package/demos/pc/app/grid/webdoc/grid-footer.js +1 -1
  255. package/demos/pc/app/grid/webdoc/grid-highlight.js +2 -2
  256. package/demos/pc/app/grid/webdoc/grid-import-export.js +5 -2
  257. package/demos/pc/app/grid/webdoc/grid-large-data.js +6 -5
  258. package/demos/pc/app/grid/webdoc/grid-mouse-keyboard.js +2 -2
  259. package/demos/pc/app/grid/webdoc/grid-pager.js +11 -2
  260. package/demos/pc/app/grid/webdoc/grid-renderer.js +11 -11
  261. package/demos/pc/app/grid/webdoc/grid-row-grouping.js +2 -2
  262. package/demos/pc/app/grid/webdoc/grid-size.js +6 -6
  263. package/demos/pc/app/grid/webdoc/grid-slot.js +16 -4
  264. package/demos/pc/app/grid/webdoc/grid-tip.js +3 -3
  265. package/demos/pc/app/grid/webdoc/grid-toolbar.js +17 -9
  266. package/demos/pc/app/grid/webdoc/grid-tree-table.js +9 -7
  267. package/demos/pc/app/grid/webdoc/grid-validation.js +6 -6
  268. package/demos/pc/app/grid/webdoc/grid.js +160 -85
  269. package/demos/pc/app/icon/iconGroups.js +1 -0
  270. package/demos/pc/app/icon/list-composition-api.vue +8 -0
  271. package/demos/pc/app/icon/list.vue +7 -0
  272. package/demos/pc/app/image/basic-usage.spec.ts +1 -1
  273. package/demos/pc/app/image/events.spec.ts +1 -1
  274. package/demos/pc/app/image/lazy.spec.ts +1 -1
  275. package/demos/pc/app/image/preview-in-dialog.spec.ts +1 -1
  276. package/demos/pc/app/image/preview.spec.ts +1 -1
  277. package/demos/pc/app/image/slot.spec.ts +1 -1
  278. package/demos/pc/app/image/webdoc/image.cn.md +3 -1
  279. package/demos/pc/app/image/webdoc/image.en.md +3 -1
  280. package/demos/pc/app/image/webdoc/image.js +34 -18
  281. package/demos/pc/app/input/method-addMemory-composition-api.vue +1 -0
  282. package/demos/pc/app/input/method-addMemory.spec.ts +11 -0
  283. package/demos/pc/app/input/method-addMemory.vue +1 -0
  284. package/demos/pc/app/input/webdoc/input.js +12 -2
  285. package/demos/pc/app/ip-address/webdoc/ip-address.cn.md +2 -2
  286. package/demos/pc/app/ip-address/webdoc/ip-address.js +2 -2
  287. package/demos/pc/app/link/webdoc/link.js +1 -1
  288. package/demos/pc/app/loading/webdoc/loading.js +1 -1
  289. package/demos/pc/app/milestone/show-number-composition-api.vue +1 -1
  290. package/demos/pc/app/milestone/show-number.vue +1 -1
  291. package/demos/pc/app/milestone/solid-style-composition-api.vue +1 -1
  292. package/demos/pc/app/milestone/solid-style.vue +1 -1
  293. package/demos/pc/app/milestone/webdoc/milestone.js +9 -9
  294. package/demos/pc/app/mind-map/basic-usage-composition-api.vue +14 -0
  295. package/demos/pc/app/mind-map/basic-usage.spec.ts +36 -0
  296. package/demos/pc/app/mind-map/basic-usage.vue +20 -0
  297. package/demos/pc/app/mind-map/event-composition-api.vue +125 -0
  298. package/demos/pc/app/mind-map/event.spec.ts +52 -0
  299. package/demos/pc/app/mind-map/event.vue +136 -0
  300. package/demos/pc/app/mind-map/export-data-composition-api.vue +108 -0
  301. package/demos/pc/app/mind-map/export-data.spec.ts +19 -0
  302. package/demos/pc/app/mind-map/export-data.vue +119 -0
  303. package/demos/pc/app/mind-map/webdoc/mind-map.cn.md +7 -0
  304. package/demos/pc/app/mind-map/webdoc/mind-map.en.md +7 -0
  305. package/demos/pc/app/mind-map/webdoc/mind-map.js +250 -0
  306. package/demos/pc/app/modal/webdoc/modal.js +47 -47
  307. package/demos/pc/app/nav-menu/custom-service-composition-api.vue +5 -5
  308. package/demos/pc/app/nav-menu/custom-service.vue +5 -5
  309. package/demos/pc/app/notify/webdoc/notify.js +9 -6
  310. package/demos/pc/app/numeric/webdoc/numeric.js +23 -23
  311. package/demos/pc/app/pager/before-page-change-composition-api.vue +1 -1
  312. package/demos/pc/app/pager/before-page-change.vue +1 -1
  313. package/demos/pc/app/pager/custom-layout-composition-api.vue +8 -6
  314. package/demos/pc/app/pager/custom-layout.vue +8 -6
  315. package/demos/pc/app/pager/custom-total-composition-api.vue +20 -18
  316. package/demos/pc/app/pager/custom-total.vue +20 -18
  317. package/demos/pc/app/pager/hide-on-single-page-composition-api.vue +1 -1
  318. package/demos/pc/app/pager/hide-on-single-page.spec.ts +1 -1
  319. package/demos/pc/app/pager/hide-on-single-page.vue +1 -1
  320. package/demos/pc/app/pager/pager-event-composition-api.vue +10 -5
  321. package/demos/pc/app/pager/pager-event.vue +10 -5
  322. package/demos/pc/app/pager/webdoc/pager.js +3 -3
  323. package/demos/pc/app/pop-upload/webdoc/pop-upload.js +3 -3
  324. package/demos/pc/app/popconfirm/webdoc/popconfirm.js +1 -1
  325. package/demos/pc/app/progress/custom-color-composition-api.vue +10 -5
  326. package/demos/pc/app/progress/custom-color.spec.ts +14 -1
  327. package/demos/pc/app/progress/custom-color.vue +10 -5
  328. package/demos/pc/app/progress/custom-status-composition-api.vue +30 -11
  329. package/demos/pc/app/progress/custom-status.vue +30 -11
  330. package/demos/pc/app/progress/webdoc/progress.js +7 -8
  331. package/demos/pc/app/qr-code/level-composition-api.vue +5 -8
  332. package/demos/pc/app/qr-code/style-composition-api.vue +1 -0
  333. package/demos/pc/app/qr-code/style.vue +1 -0
  334. package/demos/pc/app/qr-code/webdoc/qr-code.js +22 -10
  335. package/demos/pc/app/radio/group-options-composition-api.vue +13 -0
  336. package/demos/pc/app/radio/group-options.vue +20 -2
  337. package/demos/pc/app/radio/webdoc/radio.js +3 -3
  338. package/demos/pc/app/rate/webdoc/rate.js +8 -10
  339. package/demos/pc/app/search/events-composition-api.vue +4 -4
  340. package/demos/pc/app/search/events.vue +4 -4
  341. package/demos/pc/app/search/slot-prefix-composition-api.vue +1 -1
  342. package/demos/pc/app/search/slot-prefix.vue +1 -1
  343. package/demos/pc/app/search/webdoc/search.js +2 -2
  344. package/demos/pc/app/select/basic-usage-composition-api.vue +11 -6
  345. package/demos/pc/app/select/basic-usage.spec.ts +34 -9
  346. package/demos/pc/app/select/basic-usage.vue +11 -6
  347. package/demos/pc/app/select/clear-no-match-value-composition-api.vue +1 -1
  348. package/demos/pc/app/select/clear-no-match-value.vue +1 -1
  349. package/demos/pc/app/select/events-composition-api.vue +12 -6
  350. package/demos/pc/app/select/events.vue +10 -5
  351. package/demos/pc/app/select/is-drop-inherit-width-composition-api.vue +1 -2
  352. package/demos/pc/app/select/is-drop-inherit-width.vue +1 -2
  353. package/demos/pc/app/select/no-data-text-composition-api.vue +1 -1
  354. package/demos/pc/app/select/no-data-text.spec.ts +1 -1
  355. package/demos/pc/app/select/no-data-text.vue +1 -1
  356. package/demos/pc/app/select/optimization-composition-api.vue +5 -2
  357. package/demos/pc/app/select/optimization.vue +4 -1
  358. package/demos/pc/app/select/option-group-composition-api.vue +33 -11
  359. package/demos/pc/app/select/option-group.spec.ts +2 -2
  360. package/demos/pc/app/select/option-group.vue +34 -13
  361. package/demos/pc/app/select/slot-default-composition-api.vue +49 -13
  362. package/demos/pc/app/select/slot-default.spec.ts +5 -2
  363. package/demos/pc/app/select/slot-default.vue +50 -14
  364. package/demos/pc/app/select/slot-empty-composition-api.vue +16 -3
  365. package/demos/pc/app/select/slot-empty.spec.ts +1 -1
  366. package/demos/pc/app/select/slot-empty.vue +18 -4
  367. package/demos/pc/app/select/webdoc/select.js +89 -16
  368. package/demos/pc/app/slider/basic-usage-composition-api.vue +1 -1
  369. package/demos/pc/app/slider/basic-usage.vue +1 -1
  370. package/demos/pc/app/switch/before-change-composition-api.vue +4 -1
  371. package/demos/pc/app/switch/before-change.vue +4 -3
  372. package/demos/pc/app/switch/custom-true-false-value-composition-api.vue +1 -1
  373. package/demos/pc/app/switch/custom-true-false-value.spec.ts +2 -2
  374. package/demos/pc/app/switch/custom-true-false-value.vue +1 -1
  375. package/demos/pc/app/switch/event-change-composition-api.vue +1 -1
  376. package/demos/pc/app/switch/event-change.vue +1 -1
  377. package/demos/pc/app/switch/webdoc/switch.cn.md +1 -1
  378. package/demos/pc/app/switch/webdoc/switch.js +1 -1
  379. package/demos/pc/app/tabs/webdoc/tabs.js +3 -3
  380. package/demos/pc/app/tag/webdoc/tag.js +1 -1
  381. package/demos/pc/app/tag-group/basic-usage.vue +1 -1
  382. package/demos/pc/app/tag-group/webdoc/tag-group.js +2 -2
  383. package/demos/pc/app/time-select/basic-usage-composition-api.vue +10 -2
  384. package/demos/pc/app/time-select/basic-usage.spec.ts +6 -5
  385. package/demos/pc/app/time-select/basic-usage.vue +10 -2
  386. package/demos/pc/app/time-select/clear-icon-composition-api.vue +17 -9
  387. package/demos/pc/app/time-select/clear-icon.spec.ts +7 -5
  388. package/demos/pc/app/time-select/clear-icon.vue +17 -9
  389. package/demos/pc/app/time-select/default-value-composition-api.vue +10 -2
  390. package/demos/pc/app/time-select/default-value.spec.ts +3 -2
  391. package/demos/pc/app/time-select/default-value.vue +10 -2
  392. package/demos/pc/app/time-select/editable-composition-api.vue +10 -2
  393. package/demos/pc/app/time-select/editable.vue +10 -2
  394. package/demos/pc/app/time-select/event-blur-composition-api.vue +8 -2
  395. package/demos/pc/app/time-select/event-blur.spec.ts +2 -2
  396. package/demos/pc/app/time-select/event-blur.vue +10 -4
  397. package/demos/pc/app/time-select/focus-composition-api.vue +12 -3
  398. package/demos/pc/app/time-select/focus.spec.ts +5 -4
  399. package/demos/pc/app/time-select/focus.vue +12 -3
  400. package/demos/pc/app/time-select/picker-options-composition-api.vue +21 -13
  401. package/demos/pc/app/time-select/picker-options.spec.ts +1 -1
  402. package/demos/pc/app/time-select/picker-options.vue +21 -13
  403. package/demos/pc/app/time-select/range-placeholder-composition-api.vue +17 -3
  404. package/demos/pc/app/time-select/range-placeholder.spec.ts +16 -13
  405. package/demos/pc/app/time-select/range-placeholder.vue +17 -3
  406. package/demos/pc/app/time-select/size-medium-composition-api.vue +15 -2
  407. package/demos/pc/app/time-select/size-medium.spec.ts +5 -1
  408. package/demos/pc/app/time-select/size-medium.vue +15 -2
  409. package/demos/pc/app/time-select/suffix-icon-composition-api.vue +8 -2
  410. package/demos/pc/app/time-select/suffix-icon.vue +8 -2
  411. package/demos/pc/app/time-select/webdoc/time-select.js +57 -78
  412. package/demos/pc/app/toggle-menu/webdoc/toggle-menu.js +2 -2
  413. package/demos/pc/app/transfer/basic-usage.spec.ts +1 -1
  414. package/demos/pc/app/transfer/before-transfer.spec.ts +1 -1
  415. package/demos/pc/app/transfer/custom-btns.spec.ts +1 -1
  416. package/demos/pc/app/transfer/custom-filter.spec.ts +1 -1
  417. package/demos/pc/app/transfer/custom-footer.spec.ts +2 -1
  418. package/demos/pc/app/transfer/custom-render.spec.ts +1 -1
  419. package/demos/pc/app/transfer/custom-titles.spec.ts +1 -1
  420. package/demos/pc/app/transfer/default-checked.spec.ts +1 -1
  421. package/demos/pc/app/transfer/drop-config.spec.ts +1 -1
  422. package/demos/pc/app/transfer/nested-table.spec.ts +1 -1
  423. package/demos/pc/app/transfer/nested-tree.spec.ts +1 -1
  424. package/demos/pc/app/transfer/target-order.spec.ts +1 -1
  425. package/demos/pc/app/transfer/transfer-events.spec.ts +1 -1
  426. package/demos/pc/app/transfer/webdoc/transfer.cn.md +1 -1
  427. package/demos/pc/app/transfer/webdoc/transfer.en.md +3 -3
  428. package/demos/pc/app/transfer/webdoc/transfer.js +76 -43
  429. package/demos/pc/app/tree/basic-usage.spec.ts +1 -1
  430. package/demos/pc/app/tree/check-op.spec.ts +1 -1
  431. package/demos/pc/app/tree/checkbox.spec.ts +1 -1
  432. package/demos/pc/app/tree/contextmenu.spec.ts +1 -1
  433. package/demos/pc/app/tree/drag.spec.ts +1 -1
  434. package/demos/pc/app/tree/edit.spec.ts +1 -1
  435. package/demos/pc/app/tree/expand-control.spec.ts +1 -1
  436. package/demos/pc/app/tree/filter-view.spec.ts +1 -1
  437. package/demos/pc/app/tree/icons.spec.ts +1 -1
  438. package/demos/pc/app/tree/lazy.spec.ts +1 -1
  439. package/demos/pc/app/tree/node-hl.spec.ts +1 -1
  440. package/demos/pc/app/tree/node-op.spec.ts +1 -1
  441. package/demos/pc/app/tree/other.spec.ts +1 -1
  442. package/demos/pc/app/tree/props.spec.ts +1 -1
  443. package/demos/pc/app/tree/radio.spec.ts +1 -1
  444. package/demos/pc/app/tree/slot.spec.ts +1 -1
  445. package/demos/pc/app/tree/webdoc/tree.cn.md +1 -1
  446. package/demos/pc/app/tree/webdoc/tree.en.md +1 -1
  447. package/demos/pc/app/tree/webdoc/tree.js +67 -19
  448. package/demos/pc/app/tree-menu/custom-icon.spec.ts +1 -0
  449. package/demos/pc/app/tree-menu/only-check-children.spec.ts +24 -2
  450. package/demos/pc/app/tree-menu/props.spec.ts +22 -2
  451. package/demos/pc/app/tree-menu/show-expand.spec.ts +36 -4
  452. package/demos/pc/app/tree-menu/show-filter.spec.ts +54 -3
  453. package/demos/pc/app/tree-menu/show-number.spec.ts +14 -1
  454. package/demos/pc/app/tree-menu/webdoc/tree-menu.js +4 -4
  455. package/demos/pc/app/user-head/image-user-head-composition-api.vue +1 -1
  456. package/demos/pc/app/user-head/image-user-head.vue +1 -1
  457. package/demos/pc/app/user-head/webdoc/user-head.js +17 -17
  458. package/demos/pc/app/watermark/webdoc/watermark.js +32 -16
  459. package/demos/pc/menus.js +6 -1
  460. package/demos/pc/webdoc/form-valid-en.md +9 -3
  461. package/demos/pc/webdoc/form-valid.md +3 -1
  462. package/demos/pc/webdoc/theme-en.md +10 -8
  463. package/package.json +9 -8
  464. package/playground/App.vue +9 -0
  465. package/demos/mobile/app/button/event-click.vue +0 -40
  466. package/demos/mobile/app/button/native-type.vue +0 -105
  467. package/demos/mobile/app/button/plain.vue +0 -33
  468. package/demos/mobile/app/button/round.vue +0 -34
  469. package/demos/mobile/app/button/text.vue +0 -38
  470. package/demos/pc/app/calendar-view/hide-mode-composition-api.vue +0 -7
  471. package/demos/pc/app/calendar-view/hide-mode.vue +0 -13
  472. package/demos/pc/app/calendar-view/mode-combination-composition-api.vue +0 -7
  473. package/demos/pc/app/calendar-view/mode-combination.vue +0 -14
  474. package/demos/pc/app/file-upload/upload-limit-composition-api.vue +0 -22
  475. package/demos/pc/app/file-upload/upload-limit.spec.ts +0 -20
  476. package/demos/pc/app/file-upload/upload-limit.vue +0 -32
  477. package/demos/pc/app/time-select/default-time-composition-api.vue +0 -11
  478. package/demos/pc/app/time-select/default-time.vue +0 -19
  479. package/demos/pc/app/time-select/disabled-composition-api.vue +0 -10
  480. package/demos/pc/app/time-select/disabled.spec.ts +0 -8
  481. package/demos/pc/app/time-select/disabled.vue +0 -18
  482. package/demos/pc/app/time-select/event-change-composition-api.vue +0 -16
  483. package/demos/pc/app/time-select/event-change.vue +0 -25
  484. package/demos/pc/app/time-select/popper-class-composition-api.vue +0 -27
  485. package/demos/pc/app/time-select/popper-class.spec.ts +0 -9
  486. package/demos/pc/app/time-select/popper-class.vue +0 -35
  487. package/demos/pc/app/time-select/size-mini-composition-api.vue +0 -10
  488. package/demos/pc/app/time-select/size-mini.spec.ts +0 -8
  489. package/demos/pc/app/time-select/size-mini.vue +0 -18
  490. package/demos/pc/app/time-select/size-small-composition-api.vue +0 -10
  491. package/demos/pc/app/time-select/size-small.spec.ts +0 -8
  492. package/demos/pc/app/time-select/size-small.vue +0 -18
  493. package/demos/pc/resource/user-group-2.png +0 -0
  494. package/demos/pc/resource/user-group.png +0 -0
@@ -1,20 +1,45 @@
1
1
  import { test, expect } from '@playwright/test'
2
2
 
3
- test('基础用法', async ({ page }) => {
3
+ test('基础用法标签式', async ({ page }) => {
4
4
  await page.goto('select#basic-usage')
5
5
  const wrap = page.locator('#basic-usage')
6
- const input = wrap.locator('.tiny-input__inner')
7
- const dropdown = page.locator('.tiny-select-dropdown')
6
+ const select = wrap.locator('.tiny-select').nth(0)
7
+ const input = select.locator('.tiny-input__inner')
8
+ const dropdown = page.locator('body > .tiny-select-dropdown')
9
+ const option = dropdown.locator('.tiny-option')
8
10
 
9
11
  await input.click()
10
- await dropdown.getByRole('listitem').filter({ hasText: '蚵仔煎' }).click()
12
+ await option.filter({ hasText: '蚵仔煎' }).click()
11
13
  await expect(input).toHaveValue('蚵仔煎')
12
- await wrap.locator('.tiny-input__suffix svg').click()
14
+ await select.locator('.tiny-input__suffix svg').click()
13
15
  await expect(page.getByRole('listitem').filter({ hasText: '蚵仔煎' })).toHaveClass(/selected/)
14
- await dropdown.getByRole('listitem').filter({ hasText: '北京烤鸭' }).click()
16
+ await option.filter({ hasText: '北京烤鸭' }).click()
15
17
  await expect(input).toHaveValue('北京烤鸭')
16
18
  await input.click()
17
- await expect(dropdown.getByRole('listitem').filter({ hasText: '北京烤鸭' })).toHaveClass(/selected/)
18
- await wrap.click()
19
- await expect(page.locator('div').filter({ hasText: '黄金糕双皮奶蚵仔煎龙须面北京烤鸭' }).first()).toBeHidden()
19
+ await expect(option.filter({ hasText: '北京烤鸭' })).toHaveClass(/selected/)
20
+ await expect(option.locator('.tiny-option__icon')).toHaveCount(5)
21
+ await option.nth(0).click()
22
+ await expect(dropdown).toBeHidden()
23
+ })
24
+
25
+ test('基础用法配置式', async ({ page }) => {
26
+ await page.goto('select#basic-usage')
27
+ const wrap = page.locator('#basic-usage')
28
+ const select = wrap.locator('.tiny-select').nth(1)
29
+ const input = select.locator('.tiny-input__inner')
30
+ const dropdown = page.locator('body > .tiny-select-dropdown')
31
+ const option = dropdown.locator('.tiny-option')
32
+
33
+ await input.click()
34
+ await option.filter({ hasText: '蚵仔煎' }).click()
35
+ await expect(input).toHaveValue('蚵仔煎')
36
+ await select.locator('.tiny-input__suffix svg').click()
37
+ await expect(page.getByRole('listitem').filter({ hasText: '蚵仔煎' })).toHaveClass(/selected/)
38
+ await option.filter({ hasText: '北京烤鸭' }).click()
39
+ await expect(input).toHaveValue('北京烤鸭')
40
+ await input.click()
41
+ await expect(option.filter({ hasText: '北京烤鸭' })).toHaveClass(/selected/)
42
+ await expect(option.locator('.tiny-option__icon')).toHaveCount(5)
43
+ await option.nth(0).click()
44
+ await expect(dropdown).toBeHidden()
20
45
  })
@@ -1,14 +1,19 @@
1
1
  <template>
2
2
  <div>
3
3
  <p>选中的值为: {{ value }}</p>
4
+ <p>场景1:标签式</p>
4
5
  <tiny-select v-model="value">
5
- <tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
6
+ <tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" :icon="item.icon">
7
+ </tiny-option>
6
8
  </tiny-select>
9
+ <p>场景1:配置式</p>
10
+ <tiny-select v-model="value" :options="options"> </tiny-select>
7
11
  </div>
8
12
  </template>
9
13
 
10
14
  <script>
11
15
  import { Select, Option } from '@opentiny/vue'
16
+ import { iconFile } from '@opentiny/vue-icon'
12
17
 
13
18
  export default {
14
19
  components: {
@@ -18,11 +23,11 @@ export default {
18
23
  data() {
19
24
  return {
20
25
  options: [
21
- { value: '选项1', label: '黄金糕' },
22
- { value: '选项2', label: '双皮奶' },
23
- { value: '选项3', label: '蚵仔煎' },
24
- { value: '选项4', label: '龙须面' },
25
- { value: '选项5', label: '北京烤鸭' }
26
+ { value: '选项1', label: '黄金糕', icon: iconFile() },
27
+ { value: '选项2', label: '双皮奶', icon: iconFile() },
28
+ { value: '选项3', label: '蚵仔煎', icon: iconFile() },
29
+ { value: '选项4', label: '龙须面', icon: iconFile() },
30
+ { value: '选项5', label: '北京烤鸭', icon: iconFile() }
26
31
  ],
27
32
  value: ''
28
33
  }
@@ -8,7 +8,7 @@
8
8
  </tiny-select>
9
9
 
10
10
  <p>
11
- 场景2:多选,multiVal 找不到匹配值,multiVal为:<span class="multi-val">{{ multiVal }}</span>
11
+ 场景2:多选,multiVal 找不到匹配值,multiVal 为:<span class="multi-val">{{ multiVal }}</span>
12
12
  </p>
13
13
  <tiny-select v-model="multiVal" :clear-no-match-value="true" multiple>
14
14
  <tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
@@ -8,7 +8,7 @@
8
8
  </tiny-select>
9
9
 
10
10
  <p>
11
- 场景2:多选,multiVal 找不到匹配值,multiVal为:<span class="multi-val">{{ multiVal }}</span>
11
+ 场景2:多选,multiVal 找不到匹配值,multiVal 为:<span class="multi-val">{{ multiVal }}</span>
12
12
  </p>
13
13
  <tiny-select v-model="multiVal" :clear-no-match-value="true" multiple>
14
14
  <tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
@@ -46,37 +46,43 @@ const value2 = ref([])
46
46
  const change = () => {
47
47
  Modal.message({
48
48
  message: '触发 change 事件',
49
- duration: 500
49
+ duration: 500,
50
+ status: 'info'
50
51
  })
51
52
  }
52
53
 
53
54
  const clear = () => {
54
55
  Modal.message({
55
- message: '触发 clear 事件'
56
+ message: '触发 clear 事件',
57
+ status: 'info'
56
58
  })
57
59
  }
58
60
 
59
61
  const focus = () => {
60
62
  Modal.message({
61
- message: '触发 focus 事件'
63
+ message: '触发 focus 事件',
64
+ status: 'info'
62
65
  })
63
66
  }
64
67
 
65
68
  const blur = () => {
66
69
  Modal.message({
67
- message: '触发 blur 事件'
70
+ message: '触发 blur 事件',
71
+ status: 'info'
68
72
  })
69
73
  }
70
74
 
71
75
  const removeTag = () => {
72
76
  Modal.message({
73
- message: '触发 remove-tag 事件'
77
+ message: '触发 remove-tag 事件',
78
+ status: 'info'
74
79
  })
75
80
  }
76
81
 
77
82
  const visibleChange = () => {
78
83
  Modal.message({
79
- message: '触发 visible-change 事件'
84
+ message: '触发 visible-change 事件',
85
+ status: 'info'
80
86
  })
81
87
  }
82
88
  </script>
@@ -54,12 +54,14 @@ export default {
54
54
  change() {
55
55
  Modal.message({
56
56
  message: '触发 change 事件',
57
- duration: 500
57
+ duration: 500,
58
+ status: 'info'
58
59
  })
59
60
  },
60
61
  clear() {
61
62
  Modal.message({
62
- message: '触发 clear 事件'
63
+ message: '触发 clear 事件',
64
+ status: 'info'
63
65
  })
64
66
  },
65
67
  focus() {
@@ -69,17 +71,20 @@ export default {
69
71
  },
70
72
  blur() {
71
73
  Modal.message({
72
- message: '触发 blur 事件'
74
+ message: '触发 blur 事件',
75
+ status: 'info'
73
76
  })
74
77
  },
75
78
  removeTag() {
76
79
  Modal.message({
77
- message: '触发 remove-tag 事件'
80
+ message: '触发 remove-tag 事件',
81
+ status: 'info'
78
82
  })
79
83
  },
80
84
  visibleChange() {
81
85
  Modal.message({
82
- message: '触发 visible-change 事件'
86
+ message: '触发 visible-change 事件',
87
+ status: 'info'
83
88
  })
84
89
  }
85
90
  }
@@ -18,8 +18,7 @@ import { Select as TinySelect, Option as TinyOption } from '@opentiny/vue'
18
18
  const options = ref([
19
19
  {
20
20
  value: '选项1',
21
- label:
22
- '黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕'
21
+ label: '黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕'
23
22
  },
24
23
  { value: '选项2', label: '双皮奶' },
25
24
  { value: '选项3', label: '蚵仔煎' },
@@ -24,8 +24,7 @@ export default {
24
24
  options: [
25
25
  {
26
26
  value: '选项1',
27
- label:
28
- '黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕'
27
+ label: '黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕黄金糕'
29
28
  },
30
29
  { value: '选项2', label: '双皮奶' },
31
30
  { value: '选项3', label: '蚵仔煎' },
@@ -5,7 +5,7 @@
5
5
  <tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
6
6
  </tiny-select>
7
7
  <p>场景2:自定义空数据文本</p>
8
- <tiny-select v-model="value" no-data-text="None">
8
+ <tiny-select v-model="value" no-data-text="暂无数据">
9
9
  <tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
10
10
  </tiny-select>
11
11
  <p>场景3:显示空数据图片</p>
@@ -21,7 +21,7 @@ test('自定义空数据文本', async ({ page }) => {
21
21
  const dropdown = page.locator('body > .tiny-select-dropdown')
22
22
 
23
23
  await input.click()
24
- await expect(dropdown.locator('.tiny-select-dropdown__empty')).toHaveText('None')
24
+ await expect(dropdown.locator('.tiny-select-dropdown__empty')).toHaveText('暂无数据')
25
25
  })
26
26
 
27
27
  test('显示空数据图片', async ({ page }) => {
@@ -5,7 +5,7 @@
5
5
  <tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
6
6
  </tiny-select>
7
7
  <p>场景2:自定义空数据文本</p>
8
- <tiny-select v-model="value" no-data-text="None">
8
+ <tiny-select v-model="value" no-data-text="暂无数据">
9
9
  <tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
10
10
  </tiny-select>
11
11
  <p>场景3:显示空数据图片</p>
@@ -17,7 +17,7 @@
17
17
 
18
18
  <script setup>
19
19
  import { ref } from 'vue'
20
- import { Form as TinyForm, FormItem as TinyFormItem, Select as TinySelect, Modal } from '@opentiny/vue'
20
+ import { Select as TinySelect, Modal } from '@opentiny/vue'
21
21
 
22
22
  const buildOptions = () =>
23
23
  Array.from({ length: 100000 }).map((item, i) => JSON.parse(`{"value":"选项${i}","label":"黄金糕${i}"}`))
@@ -27,7 +27,10 @@ const value2 = ref([])
27
27
  const options = ref(buildOptions())
28
28
 
29
29
  const onChange = (value) => {
30
- Modal.message(JSON.stringify(value))
30
+ Modal.message({
31
+ message: JSON.stringify(value),
32
+ status: 'info'
33
+ })
31
34
  }
32
35
  </script>
33
36
 
@@ -34,7 +34,10 @@ export default {
34
34
  },
35
35
  methods: {
36
36
  onChange(value) {
37
- Modal.message(JSON.stringify(value))
37
+ Modal.message({
38
+ message: JSON.stringify(value),
39
+ status: 'info'
40
+ })
38
41
  }
39
42
  }
40
43
  }
@@ -1,14 +1,28 @@
1
1
  <template>
2
- <tiny-select v-model="value" multiple filterable :searchable="true">
3
- <tiny-option-group v-for="group in options3" :key="group.label" :label="group.label" :disabled="!!group.disabled">
4
- <tiny-option
5
- v-for="item in group.options"
6
- :key="item.value"
7
- :label="item.label"
8
- :value="item.value"
9
- ></tiny-option>
10
- </tiny-option-group>
11
- </tiny-select>
2
+ <div>
3
+ <p>场景1:分组 + 多选 + 面板可搜索</p>
4
+ <tiny-select v-model="value" multiple filterable :searchable="true">
5
+ <tiny-option-group v-for="group in options3" :key="group.label" :label="group.label" :disabled="!!group.disabled">
6
+ <tiny-option
7
+ v-for="item in group.options"
8
+ :key="item.value"
9
+ :label="item.label"
10
+ :value="item.value"
11
+ ></tiny-option>
12
+ </tiny-option-group>
13
+ </tiny-select>
14
+ <p>场景2:分组</p>
15
+ <tiny-select v-model="value" filterable>
16
+ <tiny-option-group v-for="group in options3" :key="group.label" :label="group.label" :disabled="!!group.disabled">
17
+ <tiny-option
18
+ v-for="item in group.options"
19
+ :key="item.value"
20
+ :label="item.label"
21
+ :value="item.value"
22
+ ></tiny-option>
23
+ </tiny-option-group>
24
+ </tiny-select>
25
+ </div>
12
26
  </template>
13
27
 
14
28
  <script setup>
@@ -30,7 +44,11 @@ const options3 = ref([
30
44
  { value: 'Chengdu', label: '成都' },
31
45
  { value: 'Shenzhen', label: '深圳' },
32
46
  { value: 'Guangzhou', label: '广州' },
33
- { value: 'Dalian', label: '大连' }
47
+ { value: 'Dalian', label: '大连' },
48
+ { value: 'Chongqing', label: '重庆' },
49
+ { value: 'Xianggang', label: '香港' },
50
+ { value: 'Aomen', label: '澳门' },
51
+ { value: 'Wulumuqi', label: '乌鲁木齐' }
34
52
  ]
35
53
  }
36
54
  ])
@@ -41,4 +59,8 @@ const value = ref('')
41
59
  .tiny-select {
42
60
  width: 280px;
43
61
  }
62
+ p {
63
+ font-size: 14px;
64
+ line-height: 1.5;
65
+ }
44
66
  </style>
@@ -4,7 +4,7 @@ test('option-group', async ({ page }) => {
4
4
  await page.goto('select#option-group')
5
5
 
6
6
  const wrap = page.locator('#option-group')
7
- const select = wrap.locator('.tiny-select')
7
+ const select = wrap.locator('.tiny-select').nth(0)
8
8
  const dropdown = page.locator('body > .tiny-select-dropdown')
9
9
  const option = dropdown.locator('.tiny-option')
10
10
  const title = dropdown.locator('.tiny-option-group__title')
@@ -16,6 +16,6 @@ test('option-group', async ({ page }) => {
16
16
  await expect(option.filter({ hasText: '上海' })).toHaveClass(/is-disabled/)
17
17
  await expect(option.filter({ hasText: '北京' })).toHaveClass(/is-disabled/)
18
18
  await expect(group.nth(0).locator('.tiny-option')).toHaveCount(2)
19
- await expect(group.nth(1).locator('.tiny-option')).toHaveCount(4)
19
+ await expect(group.nth(1).locator('.tiny-option')).toHaveCount(8)
20
20
  await expect((await group.all()).length).toEqual(2)
21
21
  })
@@ -1,14 +1,28 @@
1
1
  <template>
2
- <tiny-select v-model="value" multiple filterable :searchable="true">
3
- <tiny-option-group v-for="group in options3" :key="group.label" :label="group.label" :disabled="!!group.disabled">
4
- <tiny-option
5
- v-for="item in group.options"
6
- :key="item.value"
7
- :label="item.label"
8
- :value="item.value"
9
- ></tiny-option>
10
- </tiny-option-group>
11
- </tiny-select>
2
+ <div>
3
+ <p>场景1:分组 + 多选 + 面板可搜索</p>
4
+ <tiny-select v-model="value" multiple filterable :searchable="true">
5
+ <tiny-option-group v-for="group in options3" :key="group.label" :label="group.label" :disabled="!!group.disabled">
6
+ <tiny-option
7
+ v-for="item in group.options"
8
+ :key="item.value"
9
+ :label="item.label"
10
+ :value="item.value"
11
+ ></tiny-option>
12
+ </tiny-option-group>
13
+ </tiny-select>
14
+ <p>场景2:分组</p>
15
+ <tiny-select v-model="value" filterable>
16
+ <tiny-option-group v-for="group in options3" :key="group.label" :label="group.label" :disabled="!!group.disabled">
17
+ <tiny-option
18
+ v-for="item in group.options"
19
+ :key="item.value"
20
+ :label="item.label"
21
+ :value="item.value"
22
+ ></tiny-option>
23
+ </tiny-option-group>
24
+ </tiny-select>
25
+ </div>
12
26
  </template>
13
27
 
14
28
  <script>
@@ -37,11 +51,14 @@ export default {
37
51
  { value: 'Chengdu', label: '成都' },
38
52
  { value: 'Shenzhen', label: '深圳' },
39
53
  { value: 'Guangzhou', label: '广州' },
40
- { value: 'Dalian', label: '大连' }
54
+ { value: 'Dalian', label: '大连' },
55
+ { value: 'Chongqing', label: '重庆' },
56
+ { value: 'Xianggang', label: '香港' },
57
+ { value: 'Aomen', label: '澳门' },
58
+ { value: 'Wulumuqi', label: '乌鲁木齐' }
41
59
  ]
42
60
  }
43
- ],
44
- value: ''
61
+ ]
45
62
  }
46
63
  }
47
64
  }
@@ -51,4 +68,8 @@ export default {
51
68
  .tiny-select {
52
69
  width: 280px;
53
70
  }
71
+ p {
72
+ font-size: 14px;
73
+ line-height: 1.5;
74
+ }
54
75
  </style>
@@ -1,24 +1,53 @@
1
1
  <template>
2
- <tiny-select v-model="value" popper-class="slot-default">
3
- <tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
4
- <span class="left">{{ item.label }}</span>
5
- <span class="right">{{ item.value }}</span>
6
- </tiny-option>
7
- </tiny-select>
2
+ <div>
3
+ <p>场景1:带标签和提示信息</p>
4
+ <tiny-select v-model="value1" popper-class="slot-default">
5
+ <template v-for="item in options1" :key="item.value">
6
+ <tiny-tooltip :content="item.tip" placement="right" effect="light">
7
+ <tiny-option :label="item.label" :value="item.value">
8
+ <span class="left">{{ item.label }}</span>
9
+ <tiny-tag v-if="item.tag" type="danger" effect="light" size="small">{{ item.tag }}</tiny-tag>
10
+ </tiny-option>
11
+ </tiny-tooltip>
12
+ </template>
13
+ </tiny-select>
14
+
15
+ <p>场景2:选项双行</p>
16
+ <tiny-select v-model="value2" popper-class="double-row">
17
+ <tiny-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
18
+ <div>
19
+ <p>
20
+ {{ item.label }}
21
+ </p>
22
+ <p>{{ item.desc }}</p>
23
+ </div>
24
+ </tiny-option>
25
+ </tiny-select>
26
+ </div>
8
27
  </template>
9
28
 
10
29
  <script setup>
11
30
  import { ref } from 'vue'
12
- import { Select as TinySelect, Option as TinyOption } from '@opentiny/vue'
31
+ import { Select as TinySelect, Option as TinyOption, Tag as TinyTag, Tooltip as TinyTooltip } from '@opentiny/vue'
13
32
 
14
- const options = ref([
15
- { value: '选项1', label: '黄金糕' },
33
+ const options1 = ref([
34
+ { value: '选项1', label: '黄金糕', tag: 'New', tip: '自定义提示' },
16
35
  { value: '选项2', label: '双皮奶' },
17
36
  { value: '选项3', label: '蚵仔煎' },
18
37
  { value: '选项4', label: '龙须面' },
19
38
  { value: '选项5', label: '北京烤鸭' }
20
39
  ])
21
- const value = ref('')
40
+
41
+ const options2 = ref([
42
+ { value: '选项1', label: '子网1 (192.168.0.1/24)', desc: '可用 IP 数 250' },
43
+ { value: '选项2', label: '子网2 (192.168.0.1/24)', desc: '可用 IP 数 250' },
44
+ { value: '选项3', label: '子网3 (192.168.0.1/24)', desc: '可用 IP 数 250' },
45
+ { value: '选项4', label: '子网4 (192.168.0.1/24)', desc: '可用 IP 数 250' },
46
+ { value: '选项5', label: '子网5 (192.168.0.1/24)', desc: '可用 IP 数 250' }
47
+ ])
48
+
49
+ const value1 = ref('选项1')
50
+ const value2 = ref('选项1')
22
51
  </script>
23
52
 
24
53
  <style lang="less" scoped>
@@ -29,9 +58,16 @@ const value = ref('')
29
58
  .left {
30
59
  margin-right: 8px;
31
60
  }
32
- .right {
33
- color: #8492a6;
34
- font-size: 12px;
61
+ }
62
+ </style>
63
+
64
+ <style lang="less">
65
+ .double-row {
66
+ &.tiny-select-dropdown .tiny-select-dropdown__wrap {
67
+ max-height: 224px;
68
+ .tiny-option {
69
+ height: 54px;
70
+ }
35
71
  }
36
72
  }
37
73
  </style>
@@ -4,11 +4,14 @@ test('选项插槽', async ({ page }) => {
4
4
  await page.goto('select#slot-default')
5
5
 
6
6
  const wrap = page.locator('#slot-default')
7
- const select = wrap.locator('.tiny-select')
7
+ const select = wrap.locator('.tiny-select').nth(0)
8
8
  const input = select.locator('.tiny-input__inner')
9
9
  const dropdown = page.locator('body > .tiny-select-dropdown')
10
10
  const option = dropdown.locator('.tiny-option')
11
11
 
12
12
  await input.click()
13
- await expect(option.filter({ hasText: '选项1' })).toBeVisible()
13
+ await expect(option.filter({ hasText: '黄金糕' })).toBeVisible()
14
+ await expect(option.filter({ hasText: '黄金糕' }).locator('.tiny-tag')).toHaveText('New')
15
+ await option.filter({ hasText: '黄金糕' }).hover()
16
+ await expect(page.locator('body > .tiny-tooltip').filter({ hasText: '自定义提示' })).toBeVisible()
14
17
  })
@@ -1,30 +1,59 @@
1
1
  <template>
2
- <tiny-select v-model="value" popper-class="slot-default">
3
- <tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
4
- <span class="left">{{ item.label }}</span>
5
- <span class="right">{{ item.value }}</span>
6
- </tiny-option>
7
- </tiny-select>
2
+ <div>
3
+ <p>场景1:带标签和提示信息</p>
4
+ <tiny-select v-model="value1" popper-class="slot-default">
5
+ <template v-for="item in options1" :key="item.value">
6
+ <tiny-tooltip :content="item.tip" placement="right" effect="light">
7
+ <tiny-option :label="item.label" :value="item.value">
8
+ <span class="left">{{ item.label }}</span>
9
+ <tiny-tag v-if="item.tag" type="danger" effect="light" size="small">{{ item.tag }}</tiny-tag>
10
+ </tiny-option>
11
+ </tiny-tooltip>
12
+ </template>
13
+ </tiny-select>
14
+
15
+ <p>场景2:选项双行</p>
16
+ <tiny-select v-model="value2" popper-class="double-row">
17
+ <tiny-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
18
+ <div>
19
+ <p>
20
+ {{ item.label }}
21
+ </p>
22
+ <p>{{ item.desc }}</p>
23
+ </div>
24
+ </tiny-option>
25
+ </tiny-select>
26
+ </div>
8
27
  </template>
9
28
 
10
29
  <script>
11
- import { Select, Option } from '@opentiny/vue'
30
+ import { Select, Option, Tag, Tooltip } from '@opentiny/vue'
12
31
 
13
32
  export default {
14
33
  components: {
15
34
  TinySelect: Select,
16
- TinyOption: Option
35
+ TinyOption: Option,
36
+ TinyTag: Tag,
37
+ TinyTooltip: Tooltip
17
38
  },
18
39
  data() {
19
40
  return {
20
- options: [
21
- { value: '选项1', label: '黄金糕' },
41
+ options1: [
42
+ { value: '选项1', label: '黄金糕', tag: 'New', tip: '自定义提示' },
22
43
  { value: '选项2', label: '双皮奶' },
23
44
  { value: '选项3', label: '蚵仔煎' },
24
45
  { value: '选项4', label: '龙须面' },
25
46
  { value: '选项5', label: '北京烤鸭' }
26
47
  ],
27
- value: ''
48
+ options2: [
49
+ { value: '选项1', label: '子网1 (192.168.0.1/24)', desc: '可用 IP 数 250' },
50
+ { value: '选项2', label: '子网2 (192.168.0.1/24)', desc: '可用 IP 数 250' },
51
+ { value: '选项3', label: '子网3 (192.168.0.1/24)', desc: '可用 IP 数 250' },
52
+ { value: '选项4', label: '子网4 (192.168.0.1/24)', desc: '可用 IP 数 250' },
53
+ { value: '选项5', label: '子网5 (192.168.0.1/24)', desc: '可用 IP 数 250' }
54
+ ],
55
+ value1: '选项1',
56
+ value2: '选项1'
28
57
  }
29
58
  }
30
59
  }
@@ -38,9 +67,16 @@ export default {
38
67
  .left {
39
68
  margin-right: 8px;
40
69
  }
41
- .right {
42
- color: #8492a6;
43
- font-size: 12px;
70
+ }
71
+ </style>
72
+
73
+ <style lang="less">
74
+ .double-row {
75
+ &.tiny-select-dropdown .tiny-select-dropdown__wrap {
76
+ max-height: 224px;
77
+ .tiny-option {
78
+ height: 54px;
79
+ }
44
80
  }
45
81
  }
46
82
  </style>