@opentiny/vue-docs 3.24.6 → 3.26.0

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 (249) hide show
  1. package/.stylelintrc.js +2 -2
  2. package/demos/apis/button.js +15 -0
  3. package/demos/apis/calendar-view.js +3 -2
  4. package/demos/apis/chart-demo.js +1 -1
  5. package/demos/apis/chart-docs.js +1 -1
  6. package/demos/apis/chart-events.js +1 -1
  7. package/demos/apis/chart-question.js +1 -1
  8. package/demos/apis/chart.js +1 -1
  9. package/demos/apis/form.js +3 -0
  10. package/demos/apis/grid.js +76 -16
  11. package/demos/apis/modal.js +1 -1
  12. package/demos/apis/numeric.js +3 -3
  13. package/demos/apis/search.js +28 -0
  14. package/demos/apis/slider-button.js +22 -0
  15. package/demos/apis/split.js +11 -0
  16. package/demos/apis/steps.js +3 -3
  17. package/demos/apis/tabs.js +12 -0
  18. package/demos/apis/time-line.js +20 -0
  19. package/demos/mobile-first/app/button/type.vue +1 -1
  20. package/demos/mobile-first/app/button/webdoc/button.js +2 -2
  21. package/demos/mobile-first/app/slider-button/basic-usage.vue +5 -5
  22. package/demos/mobile-first/app/slider-button/webdoc/slider-button.js +1 -1
  23. package/demos/mobile-first/app/steps/advanced-steps.vue +8 -1
  24. package/demos/mobile-first/menus.js +16 -9
  25. package/demos/pc/app/action-menu/basic-usage-composition-api.vue +1 -1
  26. package/demos/pc/app/action-menu/basic-usage.vue +1 -1
  27. package/demos/pc/app/action-menu/card-mode-composition-api.vue +1 -1
  28. package/demos/pc/app/action-menu/card-mode.vue +1 -1
  29. package/demos/pc/app/action-menu/disabled-composition-api.vue +2 -2
  30. package/demos/pc/app/action-menu/disabled.vue +2 -2
  31. package/demos/pc/app/action-menu/events-composition-api.vue +1 -1
  32. package/demos/pc/app/action-menu/events.vue +1 -1
  33. package/demos/pc/app/action-menu/icon-composition-api.vue +2 -2
  34. package/demos/pc/app/action-menu/icon.vue +2 -2
  35. package/demos/pc/app/action-menu/max-show-num-composition-api.vue +1 -1
  36. package/demos/pc/app/action-menu/max-show-num.vue +1 -1
  37. package/demos/pc/app/action-menu/more-text-composition-api.vue +1 -1
  38. package/demos/pc/app/action-menu/more-text.vue +1 -1
  39. package/demos/pc/app/action-menu/popper-class-composition-api.vue +1 -1
  40. package/demos/pc/app/action-menu/popper-class.vue +1 -1
  41. package/demos/pc/app/action-menu/slot-item-composition-api.vue +1 -1
  42. package/demos/pc/app/action-menu/slot-item.vue +1 -1
  43. package/demos/pc/app/action-menu/spacing-composition-api.vue +1 -1
  44. package/demos/pc/app/action-menu/spacing.vue +1 -1
  45. package/demos/pc/app/action-menu/text-field-composition-api.vue +1 -1
  46. package/demos/pc/app/action-menu/text-field.spec.ts +1 -1
  47. package/demos/pc/app/action-menu/text-field.vue +1 -1
  48. package/demos/pc/app/amount/custom-service.spec.js +4 -4
  49. package/demos/pc/app/base-select/slot-reference.spec.ts +1 -1
  50. package/demos/pc/app/button/icon-composition-api.vue +3 -1
  51. package/demos/pc/app/button/icon.vue +3 -1
  52. package/demos/pc/app/button/webdoc/button.js +3 -2
  53. package/demos/pc/app/calendar-view/calendar-mode-composition-api.vue +7 -1
  54. package/demos/pc/app/calendar-view/calendar-mode.spec.ts +3 -0
  55. package/demos/pc/app/calendar-view/calendar-mode.vue +7 -1
  56. package/demos/pc/app/carousel/webdoc/carousel.js +0 -18
  57. package/demos/pc/app/color-picker/alpha-composition-api.vue +1 -1
  58. package/demos/pc/app/color-picker/alpha.spec.ts +2 -2
  59. package/demos/pc/app/color-picker/alpha.vue +1 -1
  60. package/demos/pc/app/color-picker/base.spec.ts +2 -2
  61. package/demos/pc/app/color-picker/default-visible.spec.ts +1 -1
  62. package/demos/pc/app/color-picker/event-composition-api.vue +2 -2
  63. package/demos/pc/app/color-picker/event.spec.ts +4 -4
  64. package/demos/pc/app/color-picker/event.vue +1 -1
  65. package/demos/pc/app/color-picker/format.spec.ts +6 -6
  66. package/demos/pc/app/color-picker/history.spec.ts +1 -7
  67. package/demos/pc/app/color-picker/predefine.spec.ts +3 -10
  68. package/demos/pc/app/color-picker/size.spec.ts +4 -4
  69. package/demos/pc/app/color-select-panel/format.spec.ts +2 -8
  70. package/demos/pc/app/color-select-panel/history.spec.ts +0 -2
  71. package/demos/pc/app/color-select-panel/predefine.spec.ts +0 -3
  72. package/demos/pc/app/container/basic-usage-composition-api.vue +10 -10
  73. package/demos/pc/app/container/basic-usage.vue +10 -10
  74. package/demos/pc/app/container/custom-with-height-composition-api.vue +8 -8
  75. package/demos/pc/app/container/custom-with-height.vue +10 -10
  76. package/demos/pc/app/date-panel/custom-week.spec.ts +2 -2
  77. package/demos/pc/app/dialog-select/nest-grid-single.spec.ts +40 -0
  78. package/demos/pc/app/dialog-select/nest-tree-multi.spec.ts +53 -0
  79. package/demos/pc/app/dialog-select/nest-tree-single.spec.ts +25 -0
  80. package/demos/pc/app/dialog-select/set-selection.spec.ts +20 -0
  81. package/demos/pc/app/file-upload/before-upload-limit-composition-api.vue +1 -1
  82. package/demos/pc/app/file-upload/before-upload-limit.spec.ts +1 -1
  83. package/demos/pc/app/file-upload/before-upload-limit.vue +1 -1
  84. package/demos/pc/app/file-upload/custom-trigger-composition-api.vue +1 -1
  85. package/demos/pc/app/file-upload/custom-trigger.spec.ts +1 -1
  86. package/demos/pc/app/file-upload/custom-trigger.vue +1 -1
  87. package/demos/pc/app/file-upload/custom-upload-tip-composition-api.vue +1 -1
  88. package/demos/pc/app/file-upload/custom-upload-tip.vue +1 -1
  89. package/demos/pc/app/file-upload/form-validation-composition-api.vue +1 -1
  90. package/demos/pc/app/file-upload/form-validation.vue +1 -1
  91. package/demos/pc/app/file-upload/image-size-composition-api.vue +1 -1
  92. package/demos/pc/app/file-upload/image-size.spec.ts +1 -1
  93. package/demos/pc/app/file-upload/image-size.vue +1 -1
  94. package/demos/pc/app/file-upload/multiple-file-composition-api.vue +1 -1
  95. package/demos/pc/app/file-upload/multiple-file.spec.ts +1 -1
  96. package/demos/pc/app/file-upload/multiple-file.vue +1 -1
  97. package/demos/pc/app/file-upload/prevent-delete-file-composition-api.vue +1 -1
  98. package/demos/pc/app/file-upload/prevent-delete-file.vue +1 -1
  99. package/demos/pc/app/file-upload/upload-request-composition-api.vue +1 -1
  100. package/demos/pc/app/file-upload/upload-request.spec.ts +2 -2
  101. package/demos/pc/app/file-upload/upload-request.vue +1 -1
  102. package/demos/pc/app/grid/base/basic-usage-composition-api.vue +1 -17
  103. package/demos/pc/app/grid/custom/column-fixed.spec.js +2 -1
  104. package/demos/pc/app/grid/custom/page-size.spec.js +1 -1
  105. package/demos/pc/app/grid/data-source/auto-load.spec.js +0 -1
  106. package/demos/pc/app/grid/data-source/request-service.spec.js +1 -1
  107. package/demos/pc/app/grid/data-source/static-data.spec.js +1 -1
  108. package/demos/pc/app/grid/dynamically-columns/dynamically-columns.spec.js +2 -1
  109. package/demos/pc/app/grid/edit/scrollbar-not-blur-composition-api.vue +119 -0
  110. package/demos/pc/app/grid/edit/scrollbar-not-blur.spec.ts +28 -0
  111. package/demos/pc/app/grid/edit/scrollbar-not-blur.vue +129 -0
  112. package/demos/pc/app/grid/editor/custom-edit.spec.js +7 -2
  113. package/demos/pc/app/grid/empty/empty-data-iscenter.spec.js +1 -1
  114. package/demos/pc/app/grid/event/toolbar-button-click-event.spec.js +1 -1
  115. package/demos/pc/app/grid/expand/expand-trigger-slot-composition-api.vue +85 -0
  116. package/demos/pc/app/grid/expand/expand-trigger-slot.spec.ts +11 -0
  117. package/demos/pc/app/grid/expand/expand-trigger-slot.vue +95 -0
  118. package/demos/pc/app/grid/expand/set-row-expansion.spec.js +4 -0
  119. package/demos/pc/app/grid/filter/custom-filter.spec.js +3 -3
  120. package/demos/pc/app/grid/filter/default-filter-composition-api.vue +6 -0
  121. package/demos/pc/app/grid/filter/default-filter.vue +6 -0
  122. package/demos/pc/app/grid/filter/default-relation.spec.js +1 -1
  123. package/demos/pc/app/grid/filter/server-filter.spec.js +1 -1
  124. package/demos/pc/app/grid/filter/simple-filter.spec.ts +5 -4
  125. package/demos/pc/app/grid/fixed/right-fixed-composition-api.vue +4 -4
  126. package/demos/pc/app/grid/fixed/right-fixed.vue +4 -4
  127. package/demos/pc/app/grid/footer/footer-summation-empty.spec.js +0 -1
  128. package/demos/pc/app/grid/large-data/full-data-loading.spec.js +10 -3
  129. package/demos/pc/app/grid/large-data/virtual-rolling.spec.js +9 -2
  130. package/demos/pc/app/grid/mouse-keyboard/keyboard-navigation.spec.js +4 -1
  131. package/demos/pc/app/grid/renderer/inner-renderer-date-composition-api.vue +4 -3
  132. package/demos/pc/app/grid/renderer/inner-renderer-date.spec.js +2 -2
  133. package/demos/pc/app/grid/renderer/inner-renderer-date.vue +3 -3
  134. package/demos/pc/app/grid/renderer/inner-renderer.spec.js +4 -0
  135. package/demos/pc/app/grid/size/max-min-grid-height.spec.js +2 -2
  136. package/demos/pc/app/grid/slot/slot-conf-composition-api.vue +141 -0
  137. package/demos/pc/app/grid/slot/slot-conf.spec.js +12 -0
  138. package/demos/pc/app/grid/slot/slot-conf.vue +151 -0
  139. package/demos/pc/app/grid/sort/combinations-sort.spec.js +2 -2
  140. package/demos/pc/app/grid/webdoc/grid-edit.js +12 -0
  141. package/demos/pc/app/grid/webdoc/grid-empty.js +1 -1
  142. package/demos/pc/app/grid/webdoc/grid-expand.js +11 -0
  143. package/demos/pc/app/grid/webdoc/grid-slot.js +9 -0
  144. package/demos/pc/app/icon/iconGroups.js +8 -2
  145. package/demos/pc/app/input/basic-usage.spec.ts +1 -1
  146. package/demos/pc/app/loading/background.spec.ts +3 -1
  147. package/demos/pc/app/loading/custom-class.spec.ts +4 -2
  148. package/demos/pc/app/loading/fullscreen.spec.ts +6 -4
  149. package/demos/pc/app/loading/loading-tip-text.spec.ts +3 -1
  150. package/demos/pc/app/loading/size.spec.ts +5 -3
  151. package/demos/pc/app/locales/custom-service-composition-api.vue +3 -3
  152. package/demos/pc/app/locales/custom-service.spec.ts +1 -1
  153. package/demos/pc/app/locales/custom-service.vue +3 -3
  154. package/demos/pc/app/modal/basic-usage.spec.ts +2 -1
  155. package/demos/pc/app/modal/message-close.spec.ts +2 -2
  156. package/demos/pc/app/modal/message-id.spec.ts +2 -2
  157. package/demos/pc/app/modal/modal-fn-slots.spec.ts +5 -7
  158. package/demos/pc/app/modal/modal-header.spec.ts +2 -1
  159. package/demos/pc/app/numeric/input-event-composition-api.vue +26 -0
  160. package/demos/pc/app/numeric/input-event.spec.ts +15 -0
  161. package/demos/pc/app/numeric/input-event.vue +34 -0
  162. package/demos/pc/app/numeric/webdoc/numeric.js +12 -0
  163. package/demos/pc/app/pager/align-composition-api.vue +10 -13
  164. package/demos/pc/app/pager/align.spec.ts +8 -3
  165. package/demos/pc/app/pager/align.vue +11 -5
  166. package/demos/pc/app/pager/page-size-composition-api.vue +2 -2
  167. package/demos/pc/app/pager/page-size.spec.ts +1 -1
  168. package/demos/pc/app/pager/page-size.vue +2 -2
  169. package/demos/pc/app/pager/pager-in-grid-composition-api.vue +0 -1
  170. package/demos/pc/app/pager/pager-in-grid.vue +0 -1
  171. package/demos/pc/app/pager/popper-append-to-body-composition-api.vue +1 -7
  172. package/demos/pc/app/pager/popper-append-to-body.vue +1 -7
  173. package/demos/pc/app/pager/popper-class-composition-api.vue +1 -7
  174. package/demos/pc/app/pager/popper-class.vue +1 -7
  175. package/demos/pc/app/popeditor/conditions.spec.ts +1 -1
  176. package/demos/pc/app/popeditor/suggest.spec.ts +1 -1
  177. package/demos/pc/app/qr-code/icon-composition-api.vue +17 -3
  178. package/demos/pc/app/qr-code/icon.spec.ts +19 -0
  179. package/demos/pc/app/qr-code/icon.vue +25 -4
  180. package/demos/pc/app/qr-code/style-composition-api.vue +2 -9
  181. package/demos/pc/app/qr-code/style.spec.ts +18 -1
  182. package/demos/pc/app/qr-code/style.vue +11 -8
  183. package/demos/pc/app/query-builder/webdoc/query-builder.js +5 -3
  184. package/demos/pc/app/search/events.spec.ts +1 -1
  185. package/demos/pc/app/search/events.vue +9 -0
  186. package/demos/pc/app/search/slot-prefix-suffix.spec.ts +1 -1
  187. package/demos/pc/app/search/webdoc/search.js +12 -4
  188. package/demos/pc/app/select/nest-grid-remote.spec.ts +3 -3
  189. package/demos/pc/app/select/nest-grid.spec.ts +1 -1
  190. package/demos/pc/app/select/nest-radio-grid-much-data.spec.ts +5 -7
  191. package/demos/pc/app/tabs/basic-usage.spec.ts +2 -2
  192. package/demos/pc/app/tabs/header-only.vue +56 -0
  193. package/demos/pc/app/tabs/size.spec.ts +2 -2
  194. package/demos/pc/app/tabs/webdoc/tabs.js +12 -0
  195. package/demos/pc/app/time-line/slot-default-composition-api.vue +81 -0
  196. package/demos/pc/app/time-line/slot-default.spec.ts +13 -0
  197. package/demos/pc/app/time-line/slot-default.vue +95 -0
  198. package/demos/pc/app/time-line/webdoc/time-line.js +12 -0
  199. package/demos/pc/menus.js +20 -10
  200. package/demos/pc/webdoc/changelog-en.md +224 -197
  201. package/demos/pc/webdoc/changelog.md +167 -387
  202. package/demos/pc/webdoc/faq.md +14 -0
  203. package/demos/saas/menus.js +2 -14
  204. package/env/.env +3 -0
  205. package/package.json +25 -24
  206. package/playground/App.vue +2 -2
  207. package/postcss.config.cjs +1 -0
  208. package/src/App.vue +26 -59
  209. package/src/components/anchor.vue +5 -1
  210. package/src/components/demo.vue +18 -7
  211. package/src/components/design-token.vue +90 -0
  212. package/src/components/float-settings.vue +4 -23
  213. package/src/components/mcp-docs.vue +4 -26
  214. package/src/components/version-tip.vue +1 -1
  215. package/src/composable/useTinyRemoter.ts +176 -0
  216. package/src/composable/utils.ts +2 -166
  217. package/src/const.ts +6 -1
  218. package/src/i18n/en.json +2 -0
  219. package/src/i18n/es.json +47 -0
  220. package/src/i18n/index.js +24 -5
  221. package/src/i18n/pt.json +47 -0
  222. package/src/i18n/zh.json +2 -0
  223. package/src/main.js +17 -13
  224. package/src/{menus.jsx → menus.js} +0 -1
  225. package/src/router.js +3 -18
  226. package/src/tools/appData.js +6 -16
  227. package/src/tools/storage.js +5 -3
  228. package/src/tools/useApiMode.js +11 -3
  229. package/src/tools/useBulletin.jsx +9 -8
  230. package/src/tools/useStyleSettings.js +8 -0
  231. package/src/tools/useTemplateMode.js +5 -1
  232. package/src/tools/utils.js +32 -1
  233. package/src/views/components-doc/cmp-config.js +13 -1
  234. package/src/views/components-doc/common.vue +42 -15
  235. package/src/views/layout/layout.vue +5 -8
  236. package/src/views/overview.vue +1 -1
  237. package/tsconfig.node.json +2 -4
  238. package/src/components/MessageCard.vue +0 -117
  239. package/src/components/tiny-robot-chat.vue +0 -128
  240. package/src/composable/DifyModelProvider.ts +0 -65
  241. package/src/composable/useTinyRobot.ts +0 -167
  242. package/src/tools/useAllTaskFinish.ts +0 -0
  243. package/src/views/comprehensive/Demo.vue +0 -212
  244. package/src/views/comprehensive/index.vue +0 -380
  245. package/src/views/comprehensive/products.json +0 -98
  246. package/src/views/comprehensive/types/index.ts +0 -37
  247. package/src/views/remoter/index.vue +0 -63
  248. package/src/views/remoter/sound.vue +0 -349
  249. /package/demos/pc/app/grid/expand/{expand-config.spec.js → expand-config.spec.ts} +0 -0
@@ -9,7 +9,7 @@ test('事件是否正常触发', async ({ page }) => {
9
9
  const button = page.locator('.tiny-search__input-btn > a').first()
10
10
 
11
11
  await button.click()
12
- await expect(modal).toHaveCount(1)
12
+ await expect(modal).toHaveCount(2)
13
13
  await input.first().fill('111')
14
14
  await button.click()
15
15
  await modal.getByText('111').isVisible()
@@ -15,6 +15,9 @@
15
15
  <p>类型选中事件</p>
16
16
  <br />
17
17
  <tiny-search :search-types="searchTypes" @select="select"></tiny-search>
18
+ <p>mini模式展开和收起事件</p>
19
+ <br />
20
+ <tiny-search mini @collapse="handleCollapse" @expand="handleExpand"></tiny-search>
18
21
  </div>
19
22
  </template>
20
23
 
@@ -58,6 +61,12 @@ export default {
58
61
  },
59
62
  select(value) {
60
63
  TinyModal.message({ message: `${value.text}`, status: 'info' })
64
+ },
65
+ handleCollapse() {
66
+ TinyModal.message({ message: '收回', status: 'info' })
67
+ },
68
+ handleExpand() {
69
+ TinyModal.message({ message: '展开', status: 'info' })
61
70
  }
62
71
  }
63
72
  }
@@ -21,7 +21,7 @@ test('disabled', async ({ page }) => {
21
21
  page.on('pageerror', (exception) => expect(exception).toBeNull())
22
22
  await page.goto('search#slot-prefix-suffix')
23
23
 
24
- await page.locator('.tiny-button').last().click()
24
+ await page.getByRole('button', { name: '点击切换为“禁用状态”' }).click()
25
25
 
26
26
  const searchLocators = await page.locator('.tiny-search').all()
27
27
  for (const search of searchLocators) {
@@ -112,10 +112,18 @@ export default {
112
112
  'en-US': 'Search event'
113
113
  },
114
114
  desc: {
115
- 'zh-CN':
116
- '<div class="tip custom-block">通过 <code>is-enter-search</code> 设置回车触发搜索事件, <code>search</code> 监听搜索事件;<br />\n 通过 <code>change</code> 监听输入框失焦时搜索值改变事件,<code>input</code> 监听搜索值实时改变事件;<br />\n 通过 <code>select</code> 监听搜索类型选中事件。</div>',
117
- 'en-US':
118
- '<div class="tip custom-block">Set a carriage return to trigger a search event by <code>is enter search</code> , and listen for search events by <code>search</code> <br />\n By <code>change</code> listening for search value change events when the input box is out of focus, and <code>input</code> listening for real-time search value change events<br />\n Listen for search type selection events through <code>select</code> .</div>'
115
+ 'zh-CN': `
116
+ <div class="tip custom-block">通过 <code>is-enter-search</code> 设置回车触发搜索事件, <code>search</code> 监听搜索事件;<br />\n
117
+ 通过 <code>change</code> 监听输入框失焦时搜索值改变事件,<code>input</code> 监听搜索值实时改变事件;<br />\n
118
+ 通过 <code>select</code> 监听搜索类型选中事件;<br />\n
119
+ 通过 <code>expand</code> 监听 mini 搜索框展开事件;<br />\n
120
+ 通过 <code>collapse</code> 监听 mini 搜索框收起事件。</div>`,
121
+ 'en-US': `<div class="tip custom-block">
122
+ Set carriage return to trigger search event through<code>is-enter-search</code>, and<code>search</code>to listen for search events; <br />\n
123
+ Monitor the search value change event when the input box loses focus through<code>change</code>, and monitor the real-time search value change event through<code>input</code>; <br />\n
124
+ Monitor the search type selection event through<code>select</code>; <br />\n
125
+ Monitor mini search box expansion events through<code>expand</code>; <br />\n
126
+ Monitor the mini search box collapse event through<code>collapse</code>.</div>`
119
127
  },
120
128
  codeFiles: ['events.vue']
121
129
  }
@@ -28,7 +28,7 @@ test.describe('下拉表格远程搜索', () => {
28
28
  const row2 = page.getByRole('row', { name: '省份 2 城市 2 区域 2' })
29
29
  await expect(row2).not.toBeVisible()
30
30
  await row1.getByRole('cell').first().click()
31
- await expect(row1).toHaveClass(/tiny-grid-body__row row__radio/)
31
+ await expect(row1).toHaveClass(/row__current/)
32
32
  await expect(input).toHaveValue('省 1-市 1')
33
33
 
34
34
  const row3 = page.getByRole('row', { name: '省份 10 城市 10 区域 10' })
@@ -64,7 +64,7 @@ test.describe('下拉表格远程搜索', () => {
64
64
  await input.fill(' ' + ' ')
65
65
  await input.press('Enter')
66
66
  await expect(dropdown).toBeVisible()
67
- await expect(dropdown.locator('.tiny-grid__body tbody')).toBeEmpty()
67
+ await expect(dropdown.locator('.tiny-grid__body tbody tr').first()).toBeHidden()
68
68
  })
69
69
 
70
70
  test('多选,下拉表格远程搜索基础用法', async ({ page }) => {
@@ -131,6 +131,6 @@ test.describe('下拉表格远程搜索', () => {
131
131
  await input.fill(' ' + ' ')
132
132
  await input.press('Enter')
133
133
  await expect(dropdown).toBeVisible()
134
- await expect(dropdown.locator('.tiny-grid__body tbody')).toBeEmpty()
134
+ await expect(dropdown.locator('.tiny-grid__body tbody tr').first()).toBeHidden()
135
135
  })
136
136
  })
@@ -21,7 +21,7 @@ test('嵌套表格(单选)', async ({ page }) => {
21
21
  await row.nth(1).getByRole('cell').first().click()
22
22
  await expect(input).toHaveValue('深圳 1')
23
23
  await input.click()
24
- await expect(row.filter({ hasText: '深圳 1' })).toHaveClass(/tiny-grid-body__row row__radio/)
24
+ await expect(row.filter({ hasText: '深圳 1' })).toHaveClass(/row__current/)
25
25
  })
26
26
 
27
27
  test('嵌套表格(多选)', async ({ page }) => {
@@ -23,15 +23,13 @@ test('下拉表格大数据', async ({ page }) => {
23
23
 
24
24
  await input.click()
25
25
  await page.waitForTimeout(200)
26
- await expect(row.nth(1)).toHaveClass(/tiny-grid-body__row row__radio/)
27
- await expect(row).toHaveCount(6)
26
+ await expect(row.nth(1)).toHaveClass(/row__current/)
27
+ await expect(row).toHaveCount(8)
28
28
  await expect(page.getByRole('row', { name: '华南区 12 广东省 广州市' })).toBeHidden()
29
29
  await row.nth(5).scrollIntoViewIfNeeded()
30
- await expect(row).toHaveCount(6)
30
+ await expect(row).toHaveCount(8)
31
31
  await row.nth(5).scrollIntoViewIfNeeded()
32
- await expect(row).toHaveCount(6)
32
+ await expect(row).toHaveCount(8)
33
33
  await row.nth(5).scrollIntoViewIfNeeded()
34
- await expect(row).toHaveCount(6)
35
- await page.waitForTimeout(500)
36
- await page.getByRole('row', { name: '华南区 12 广东省 广州市' }).getByRole('cell').first().click()
34
+ await expect(row).toHaveCount(8)
37
35
  })
@@ -20,11 +20,11 @@ test('基本用法', async ({ page }) => {
20
20
  /tiny-tabs__item is-top/
21
21
  ])
22
22
  await expect(content).toHaveText(/表单组件/)
23
- await expect(activeBar).toHaveCSS('width', '64px')
23
+ await expect(activeBar).toHaveCSS('width', '56px')
24
24
  await expect(activeBar).toHaveCSS('transform', 'matrix(1, 0, 0, 1, 0, 0)')
25
25
  await item1.click()
26
26
  await expect(item1).toHaveClass(/is-active/)
27
- await expect(activeBar).toHaveCSS('width', '64px')
27
+ await expect(activeBar).toHaveCSS('width', '56px')
28
28
  await expect(activeBar).toHaveCSS('transform', 'matrix(1, 0, 0, 1, 0, 0)')
29
29
  await expect(item1).toHaveCSS('color', 'rgb(25, 25, 25)')
30
30
  await expect(content).toHaveText(/表单组件/)
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <div class="tab-demo-position">
3
+ <tiny-radio-group v-model="position" class="mb10">
4
+ <tiny-radio-button label="top">top 显示</tiny-radio-button>
5
+ <tiny-radio-button label="bottom">bottom 显示</tiny-radio-button>
6
+ <tiny-radio-button label="left">left 显示</tiny-radio-button>
7
+ <tiny-radio-button label="right">right 显示</tiny-radio-button>
8
+ </tiny-radio-group>
9
+ <tiny-tabs v-model="activeName4" tab-style="card" :position="position" header-only>
10
+ <tiny-tab-item v-for="item in tabs3" :key="item.name" :title="item.title" :name="item.name">
11
+ {{ item.content }}
12
+ </tiny-tab-item>
13
+ </tiny-tabs>
14
+ </div>
15
+ </template>
16
+
17
+ <script setup lang="jsx">
18
+ import { ref } from 'vue'
19
+ import { TinyTabs, TinyTabItem, TinyRadioGroup, TinyRadioButton } from '@opentiny/vue'
20
+
21
+ const activeName4 = ref('navigation1')
22
+ const position = ref('left')
23
+ const tabs3 = ref([
24
+ {
25
+ name: 'navigation1',
26
+ title: 'Navigation 1',
27
+ content: 'Navigation 1'
28
+ },
29
+ {
30
+ name: 'navigation2',
31
+ title: 'Navigation 2',
32
+ content: 'Navigation 2'
33
+ },
34
+ {
35
+ name: 'navigation3',
36
+ title: 'Navigation 3',
37
+ content: 'Navigation 3'
38
+ },
39
+ {
40
+ name: 'navigation4',
41
+ title: 'Navigation 4',
42
+ content: 'Navigation 4'
43
+ },
44
+ {
45
+ name: 'navigation5',
46
+ title: 'Navigation 5',
47
+ content: 'Navigation 5'
48
+ }
49
+ ])
50
+ </script>
51
+
52
+ <style scoped>
53
+ .tab-demo-position {
54
+ min-height: 250px;
55
+ }
56
+ </style>
@@ -8,9 +8,9 @@ test('小尺寸', async ({ page }) => {
8
8
  const headerBox = container.locator('.tiny-tabs .tiny-tabs__nav-scroll')
9
9
 
10
10
  await expect(headerBox.nth(0)).toHaveCSS('height', '40px')
11
- await expect(headerBox.nth(0)).toHaveCSS('font-size', '12px')
11
+ await expect(headerBox.nth(0).locator('.tiny-tabs__item').first()).toHaveCSS('font-size', '12px')
12
12
  await expect(headerBox.nth(1)).toHaveCSS('height', '24px')
13
- await expect(headerBox.nth(1).locator('.tiny-tabs__item').first()).toHaveCSS('font-size', '16px')
13
+ await expect(headerBox.nth(1).locator('.tiny-tabs__item').first()).toHaveCSS('font-size', '12px')
14
14
  await expect(headerBox.nth(2)).toHaveCSS('height', '24px')
15
15
  await expect(headerBox.nth(2).locator('.tiny-tabs__item').first()).toHaveCSS('font-size', '12px')
16
16
  })
@@ -282,6 +282,18 @@ export default {
282
282
  'Use <code>overflow-title</code> to set the title to hide and show when it exceeds a certain length (default 256px)... , move the cursor to the title to display the tooltip, and set <code>title-width</code> to the excess length of the title.'
283
283
  },
284
284
  codeFiles: ['overflow-title.vue']
285
+ },
286
+ {
287
+ demoId: 'header-only',
288
+ name: {
289
+ 'zh-CN': '仅展示头部',
290
+ 'en-US': 'Header only'
291
+ },
292
+ desc: {
293
+ 'zh-CN': '通过 <code>header-only</code> 仅展示头部。',
294
+ 'en-US': 'Use <code>>header-only</code> header only.'
295
+ },
296
+ codeFiles: ['header-only.vue']
285
297
  }
286
298
  ],
287
299
  features: [
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <div class="demo-timeline-default-slot">
3
+ <tiny-time-line>
4
+ <template #default>
5
+ <ol>
6
+ <li v-for="(item, index) in items" :key="index" :class="item.status">
7
+ <div>
8
+ <div class="index-icon">{{ index + 1 }}</div>
9
+ <hr />
10
+ </div>
11
+ <div>{{ item.desc }}</div>
12
+ <div v-if="item.user">{{ item.user }}</div>
13
+ <div v-if="item.datetime">{{ item.datetime }}</div>
14
+ </li>
15
+ </ol>
16
+ </template>
17
+ </tiny-time-line>
18
+ </div>
19
+ </template>
20
+
21
+ <script setup>
22
+ import { TinyTimeLine } from '@opentiny/vue'
23
+
24
+ const items = [
25
+ { desc: '提交申请', user: '张三', datetime: new Date(Date.now() - 60 * 60 * 1e3).toLocaleString(), status: 'done' },
26
+ { desc: '直接主管', user: '李四', datetime: new Date().toLocaleString(), status: 'done' },
27
+ { desc: '部门主管', user: '王五' },
28
+ { desc: '完成' }
29
+ ]
30
+ </script>
31
+
32
+ <style scoped lang="less">
33
+ .demo-timeline-default-slot {
34
+ --color: #d3d5d6;
35
+ .done {
36
+ --color: #5073e5;
37
+ }
38
+ --size: 20px;
39
+ }
40
+
41
+ ol {
42
+ display: flex;
43
+ }
44
+
45
+ li {
46
+ margin: 10px 0;
47
+ color: var(--color);
48
+ min-width: 200px;
49
+ }
50
+
51
+ div {
52
+ position: relative;
53
+ color: var(--active-color);
54
+ &:not(:first-of-type) {
55
+ margin: 5px 0;
56
+ display: flex;
57
+ justify-content: center;
58
+ }
59
+ }
60
+
61
+ hr {
62
+ position: absolute;
63
+ top: 15%;
64
+ width: 100%;
65
+ height: 5px;
66
+ background-color: var(--color);
67
+ }
68
+
69
+ .index-icon {
70
+ width: var(--size);
71
+ height: var(--size);
72
+ border-radius: var(--size);
73
+ background-color: var(--color);
74
+ color: #fff;
75
+ padding: 1px;
76
+ font-size: calc(var(--size) - 2px);
77
+ text-align: center;
78
+ z-index: 1;
79
+ margin: auto;
80
+ }
81
+ </style>
@@ -0,0 +1,13 @@
1
+ import { test, expect } from '@playwright/test'
2
+
3
+ test('默认插槽', async ({ page }) => {
4
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
5
+
6
+ await page.goto('time-line#slot-default')
7
+
8
+ const timeline = await page.locator('.tiny-timeline')
9
+ await page.waitForSelector('.tiny-timeline')
10
+
11
+ expect(await timeline.locator('.tiny-timeline-item').count()).toBe(0)
12
+ expect(await timeline.locator('ol').count()).toBeGreaterThan(0)
13
+ })
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <div class="demo-timeline">
3
+ <tiny-time-line vertical shape="dot">
4
+ <template #default>
5
+ <ol>
6
+ <li v-for="(item, index) in items" :key="index" :class="item.status">
7
+ <div>
8
+ <div class="index-icon">{{ index + 1 }}</div>
9
+ <hr />
10
+ </div>
11
+ <div>{{ item.desc }}</div>
12
+ <div v-if="item.user">{{ item.user }}</div>
13
+ <div v-if="item.datetime">{{ item.datetime }}</div>
14
+ </li>
15
+ </ol>
16
+ </template>
17
+ </tiny-time-line>
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ import { TinyTimeLine } from '@opentiny/vue'
23
+
24
+ export default {
25
+ components: {
26
+ TinyTimeLine
27
+ },
28
+ data() {
29
+ return {
30
+ items: [
31
+ {
32
+ desc: '提交申请',
33
+ user: '张三',
34
+ datetime: new Date(Date.now() - 60 * 60 * 1e3).toLocaleString(),
35
+ status: 'done'
36
+ },
37
+ { desc: '直接主管', user: '李四', datetime: new Date().toLocaleString(), status: 'done' },
38
+ { desc: '部门主管', user: '王五' },
39
+ { desc: '完成' }
40
+ ]
41
+ }
42
+ }
43
+ }
44
+ </script>
45
+
46
+ <style scoped lang="less">
47
+ .demo-timeline {
48
+ --color: #d3d5d6;
49
+ .done {
50
+ --color: #5073e5;
51
+ }
52
+ --size: 20px;
53
+ }
54
+
55
+ ol {
56
+ display: flex;
57
+ }
58
+
59
+ li {
60
+ margin: 10px 0;
61
+ color: var(--color);
62
+ min-width: 200px;
63
+ }
64
+
65
+ div {
66
+ position: relative;
67
+ color: var(--active-color);
68
+ &:not(:first-of-type) {
69
+ margin: 5px 0;
70
+ display: flex;
71
+ justify-content: center;
72
+ }
73
+ }
74
+
75
+ hr {
76
+ position: absolute;
77
+ top: 15%;
78
+ width: 100%;
79
+ height: 5px;
80
+ background-color: var(--color);
81
+ }
82
+
83
+ .index-icon {
84
+ width: var(--size);
85
+ height: var(--size);
86
+ border-radius: var(--size);
87
+ background-color: var(--color);
88
+ color: #fff;
89
+ padding: 1px;
90
+ font-size: calc(var(--size) - 2px);
91
+ text-align: center;
92
+ z-index: 1;
93
+ margin: auto;
94
+ }
95
+ </style>
@@ -186,6 +186,18 @@ export default {
186
186
  'en-US': '<p>Add description information for a single node through the <code>description</code> slot.</p>'
187
187
  },
188
188
  codeFiles: ['slot-description.vue']
189
+ },
190
+ {
191
+ demoId: 'slot-default',
192
+ name: {
193
+ 'zh-CN': '默认插槽',
194
+ 'en-US': 'Default Slot'
195
+ },
196
+ desc: {
197
+ 'zh-CN': '组件默认插槽',
198
+ 'en-US': 'Component Default Slot'
199
+ },
200
+ codeFiles: ['slot-default.vue']
189
201
  }
190
202
  ],
191
203
  features: [
package/demos/pc/menus.js CHANGED
@@ -10,6 +10,14 @@ export const standaloneMenus = [
10
10
  const docMenusChildren = [
11
11
  { 'title': '更新日志', 'titleEn': 'Changelog', 'key': 'changelog' },
12
12
  { 'title': '环境准备', 'titleEn': 'envpreparation', 'key': 'envpreparation' },
13
+ {
14
+ 'title': '适配AUI',
15
+ 'titleEn': 'Adapter AUI',
16
+ 'key': 'aui-adapter',
17
+ showScene: {
18
+ theme: ['saas']
19
+ }
20
+ },
13
21
  { 'title': '安装', 'titleEn': 'installation', 'key': 'installation' },
14
22
  { 'title': '引入组件', 'titleEn': 'importComponents', 'key': 'import-components' },
15
23
  {
@@ -40,7 +48,10 @@ const docMenusChildren = [
40
48
  {
41
49
  'title': '暗黑模式',
42
50
  'titleEn': 'theme-dark',
43
- 'key': 'theme-dark'
51
+ 'key': 'theme-dark',
52
+ showScene: {
53
+ theme: ['default']
54
+ }
44
55
  },
45
56
  {
46
57
  'title': '智能化',
@@ -56,14 +67,6 @@ const docMenusChildren = [
56
67
  showScene: {
57
68
  target: ['inner']
58
69
  }
59
- },
60
- {
61
- 'title': '适配AUI',
62
- 'titleEn': 'Adapter AUI',
63
- 'key': 'aui-adapter',
64
- showScene: {
65
- theme: ['saas']
66
- }
67
70
  }
68
71
  ]
69
72
  export const docMenus = [
@@ -91,7 +94,14 @@ export const cmpMenus = [
91
94
  { 'nameCn': '按钮', 'name': 'Button', 'key': 'button' },
92
95
  { 'nameCn': '按钮组', 'name': 'ButtonGroup', 'key': 'button-group' },
93
96
  { 'nameCn': '全局配置', 'name': 'ConfigProvider', 'key': 'config-provider' },
94
- { 'nameCn': '容器布局', 'name': 'Container', 'key': 'container' },
97
+ {
98
+ 'nameCn': '容器布局',
99
+ 'name': 'Container',
100
+ 'key': 'container',
101
+ showScene: {
102
+ theme: ['default']
103
+ }
104
+ },
95
105
  { 'nameCn': '图标', 'name': 'Icon', 'key': 'icon' },
96
106
  // { 'nameCn': '多色图标', 'name': 'IconMulticolor', 'key': 'icon-multicolor' }, // 隐藏路由,目前只有saas使用
97
107
  { 'nameCn': '栅格布局', 'name': 'Layout', 'key': 'layout' },