@opentiny/vue-docs 2.2.2 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/demos/pc/app/anchor/change.spec.ts +1 -2
  2. package/demos/pc/app/anchor/is-affix.spec.ts +4 -3
  3. package/demos/pc/app/anchor/set-container.spec.ts +7 -7
  4. package/demos/pc/app/anchor/webdoc/anchor.js +17 -16
  5. package/demos/pc/app/button/basic-usage-composition-api.vue +1 -1
  6. package/demos/pc/app/button/basic-usage.vue +1 -1
  7. package/demos/pc/app/button/dynamic-disabled-composition-api.vue +0 -1
  8. package/demos/pc/app/button/dynamic-disabled.spec.js +3 -0
  9. package/demos/pc/app/button/dynamic-disabled.vue +0 -1
  10. package/demos/pc/app/button/icon-composition-api.vue +2 -1
  11. package/demos/pc/app/button/icon.vue +2 -1
  12. package/demos/pc/app/credit-card-form/webdoc/credit-card-form.js +4 -0
  13. package/demos/pc/app/grid/data-source/static-data-composition-api.vue +1 -1
  14. package/demos/pc/app/grid/expand/expand-config-composition-api.vue +1 -1
  15. package/demos/pc/app/grid/filter/simple-date-filter.spec.ts +2 -20
  16. package/demos/pc/app/grid/operation-column/selection-config-composition-api.vue +1 -1
  17. package/demos/pc/app/grid/operation-column/selection-config.vue +2 -3
  18. package/demos/pc/app/grid/slot/editor-slot-composition-api.vue +1 -1
  19. package/demos/pc/app/grid/slot/header-slot-composition-api.vue +4 -1
  20. package/demos/pc/app/grid/slot/header-slot.vue +2 -1
  21. package/demos/pc/app/icon/basic-usage.spec.js +8 -1
  22. package/demos/pc/app/icon/iconGroups.js +195 -195
  23. package/demos/pc/app/icon/list.spec.js +10 -5
  24. package/demos/pc/app/icon/show-title.spec.ts +8 -0
  25. package/demos/pc/app/layout/gutter-composition-api.vue +11 -0
  26. package/demos/pc/app/layout/gutter.spec.ts +3 -0
  27. package/demos/pc/app/layout/gutter.vue +11 -0
  28. package/demos/pc/app/layout/webdoc/layout.js +14 -3
  29. package/demos/pc/app/qr-code/webdoc/qr-code.js +6 -0
  30. package/demos/pc/app/rich-text-editor/webdoc/rich-text-editor.js +3 -0
  31. package/demos/pc/app/select/copy-multi.spec.ts +15 -6
  32. package/demos/pc/app/select/is-drop-inherit-width.spec.ts +2 -3
  33. package/demos/pc/app/select/nest-grid-composition-api.vue +3 -1
  34. package/demos/pc/app/select/optimization.spec.ts +1 -0
  35. package/demos/pc/app/slide-bar/webdoc/slide-bar.js +4 -0
  36. package/demos/pc/app/tabs/tabs-draggable.spec.ts +8 -8
  37. package/demos/pc/app/tag/closable.spec.ts +1 -1
  38. package/demos/pc/app/tag/color3.spec.ts +1 -1
  39. package/demos/pc/app/tag/content.spec.ts +2 -2
  40. package/demos/pc/app/tag/create.spec.ts +3 -3
  41. package/demos/pc/app/tag/disabled.spec.ts +1 -1
  42. package/demos/pc/app/tag/effect.spec.ts +4 -3
  43. package/demos/pc/app/watermark/webdoc/watermark.js +6 -0
  44. package/demos/pc/app/wizard/btn-events-composition-api.vue +5 -5
  45. package/demos/pc/app/wizard/btn-events.spec.ts +63 -0
  46. package/demos/pc/app/wizard/btn-events.vue +5 -5
  47. package/demos/pc/app/wizard/page-guide.spec.ts +6 -6
  48. package/demos/pc/app/wizard/slot-step-button.spec.ts +1 -1
  49. package/demos/pc/app/wizard/time-line-flow.spec.ts +5 -5
  50. package/demos/pc/menus.js +43 -5
  51. package/demos/pc/webdoc/changelog.md +521 -305
  52. package/demos/pc/webdoc/installation-en.md +11 -6
  53. package/demos/pc/webdoc/installation.md +14 -8
  54. package/package.json +6 -6
  55. package/playground/App.vue +2 -2
  56. package/src/App.vue +2 -0
  57. package/src/tools/useBulletin.jsx +43 -0
  58. package/src/views/components/VersionTip.vue +9 -2
@@ -4,16 +4,16 @@ test('动态编辑标签', async ({ page }) => {
4
4
  page.on('pageerror', (exception) => expect(exception).not.toBeNull())
5
5
  await page.goto('tag#create')
6
6
 
7
- const preview = page.locator('#preview')
7
+ const preview = page.locator('.all-demos-container')
8
8
  const add = page.getByRole('button', { name: '+ New Tag' })
9
9
  const input = preview.getByRole('textbox')
10
- const newTag = preview.getByText('新标签')
10
+ const newTag = preview.locator('.tiny-tag').filter({ hasText: '新标签' })
11
11
  const close = page.locator('span').filter({ hasText: '新标签' }).locator('svg')
12
12
 
13
13
  await add.click()
14
14
  await input.fill('新标签')
15
15
  await input.press('Enter')
16
- await expect(newTag, 'Creation failed').toBeVisible()
16
+ await expect(newTag).toHaveCount(1)
17
17
  await close.click()
18
18
  await expect(newTag, 'Deletion failed').not.toBeVisible()
19
19
  })
@@ -4,7 +4,7 @@ test('是否正常禁用', async ({ page }) => {
4
4
  page.on('pageerror', (exception) => expect(exception).not.toBeNull())
5
5
  await page.goto('tag#disabled')
6
6
 
7
- const tags = page.locator('.tiny-tag')
7
+ const tags = page.locator('.all-demos-container').locator('.tiny-tag')
8
8
  const close = tags.last().locator('.tiny-tag__close')
9
9
 
10
10
  await expect(tags).toHaveClass([/is-disabled/, /is-disabled/, /is-disabled/])
@@ -4,9 +4,10 @@ test('三大主题分别对应的五种类型', async ({ page }) => {
4
4
  page.on('pageerror', (exception) => expect(exception).not.toBeNull())
5
5
  await page.goto('tag#effect')
6
6
 
7
- const light = page.locator('.tiny-tag--light')
8
- const dark = page.locator('.tiny-tag--dark')
9
- const plain = page.locator('.tiny-tag--plain')
7
+ const scoped = page.locator('.all-demos-container')
8
+ const light = scoped.locator('.tiny-tag--light')
9
+ const dark = scoped.locator('.tiny-tag--dark')
10
+ const plain = scoped.locator('.tiny-tag--plain')
10
11
 
11
12
  await expect(light).toHaveCount(5)
12
13
  await expect(dark).toHaveCount(5)
@@ -1,6 +1,12 @@
1
1
  export default {
2
2
  column: '2',
3
3
  owner: '',
4
+ metaData: {
5
+ stable: '3.12.0'
6
+ },
7
+ versionTipOption: {
8
+ stages: ['stable']
9
+ },
4
10
  demos: [
5
11
  {
6
12
  'demoId': 'basic',
@@ -11,7 +11,7 @@
11
11
 
12
12
  <script setup lang="jsx">
13
13
  import { ref } from 'vue'
14
- import { Wizard as TinyWizard } from '@opentiny/vue'
14
+ import { Wizard as TinyWizard, Modal } from '@opentiny/vue'
15
15
 
16
16
  const dataSet = ref([
17
17
  {
@@ -37,18 +37,18 @@ const dataSet = ref([
37
37
  ])
38
38
 
39
39
  const handlePrev = (datas) => {
40
- console.log('handlePrev:上一步,', datas)
40
+ Modal.message('btn-prev' + JSON.stringify(datas))
41
41
  }
42
42
 
43
43
  const handleNext = (datas) => {
44
- console.log('handleNext:下一步,', datas)
44
+ Modal.message('btn-next' + JSON.stringify(datas))
45
45
  }
46
46
 
47
47
  const handleSave = (datas) => {
48
- console.log('handleSave:保存,', datas)
48
+ Modal.message('btn-save' + JSON.stringify(datas))
49
49
  }
50
50
 
51
51
  const handleSubmit = (datas) => {
52
- console.log('handleSubmit:提交,', datas)
52
+ Modal.message('btn-submit' + JSON.stringify(datas))
53
53
  }
54
54
  </script>
@@ -0,0 +1,63 @@
1
+ import { test, expect } from '@playwright/test'
2
+
3
+ test('按钮事件', async ({ page }) => {
4
+ page.on('pageerror', (exception) => expect(exception).not.toBeNull())
5
+ await page.goto('wizard#btn-events')
6
+
7
+ const stepItems = page.locator('.tiny-wizard__steps-item')
8
+ const buttons = page.locator('.tiny-wizard__button')
9
+ const prev = buttons.getByRole('button', { name: '上一步' })
10
+ const next = buttons.getByRole('button', { name: '下一步' })
11
+ const save = buttons.getByRole('button', { name: '保存' })
12
+ const submit = buttons.getByRole('button', { name: '提交' })
13
+ const charts = stepItems.locator('.tiny-wizard__chart')
14
+ const prevClasss = [/is-ready/, /is-doing/]
15
+ const nextClasss = [/is-ready/, /is-ready/, /is-doing/]
16
+ const modal = page.locator('.tiny-modal')
17
+
18
+ await save.click()
19
+ await expect(modal.nth(1)).toHaveText(/btn-save/)
20
+ await expect(charts).toHaveCount(5)
21
+ for (let i = 0; i < 2; i++) {
22
+ await expect(stepItems.nth(i)).toHaveClass(prevClasss[i])
23
+ if (i === 1) {
24
+ const currentNode = stepItems.nth(i).locator('.tiny-wizard__chart > span').nth(1)
25
+ const { width, height } = await currentNode.boundingBox()
26
+ await expect(currentNode).toHaveClass('tiny-wizard__chart-svg')
27
+ await expect(width).toBeGreaterThanOrEqual(20)
28
+ await expect(height).toBeGreaterThanOrEqual(20)
29
+ }
30
+ }
31
+
32
+ await next.click()
33
+ await expect(modal.nth(2)).toHaveText(/btn-next/)
34
+ for (let i = 0; i < 3; i++) {
35
+ await expect(stepItems.nth(i)).toHaveClass(nextClasss[i])
36
+ if (i === 2) {
37
+ const currentNode = stepItems.nth(i).locator('.tiny-wizard__chart > span').nth(1)
38
+ const { width, height } = await currentNode.boundingBox()
39
+ await expect(currentNode).toHaveClass('tiny-wizard__chart-svg')
40
+ await expect(width).toBeGreaterThanOrEqual(20)
41
+ await expect(height).toBeGreaterThanOrEqual(20)
42
+ }
43
+ }
44
+
45
+ await prev.click()
46
+ await expect(modal.nth(3)).toHaveText(/btn-prev/)
47
+ for (let i = 0; i < 2; i++) {
48
+ await expect(stepItems.nth(i)).toHaveClass(prevClasss[i])
49
+ if (i === 1) {
50
+ const currentNode = stepItems.nth(i).locator('.tiny-wizard__chart > span').nth(1)
51
+ const { width, height } = await currentNode.boundingBox()
52
+ await expect(currentNode).toHaveClass('tiny-wizard__chart-svg')
53
+ await expect(width).toBeGreaterThanOrEqual(20)
54
+ await expect(height).toBeGreaterThanOrEqual(20)
55
+ }
56
+ }
57
+ await next.click()
58
+ await next.click()
59
+ await next.click()
60
+ await next.click()
61
+ await submit.click()
62
+ await expect(modal.nth(7)).toHaveText(/btn-submit/)
63
+ })
@@ -10,7 +10,7 @@
10
10
  </template>
11
11
 
12
12
  <script lang="jsx">
13
- import { Wizard } from '@opentiny/vue'
13
+ import { Wizard, Modal } from '@opentiny/vue'
14
14
 
15
15
  export default {
16
16
  components: {
@@ -44,16 +44,16 @@ export default {
44
44
  },
45
45
  methods: {
46
46
  handlePrev(datas) {
47
- console.log('handlePrev:上一步,', datas)
47
+ Modal.message('btn-prev' + JSON.stringify(datas))
48
48
  },
49
49
  handleNext(datas) {
50
- console.log('handleNext:下一步,', datas)
50
+ Modal.message('btn-next' + JSON.stringify(datas))
51
51
  },
52
52
  handleSave(datas) {
53
- console.log('handleSave:保存,', datas)
53
+ Modal.message('btn-save' + JSON.stringify(datas))
54
54
  },
55
55
  handleSubmit(datas) {
56
- console.log('handleSubmit:提交,', datas)
56
+ Modal.message('btn-submit' + JSON.stringify(datas))
57
57
  }
58
58
  }
59
59
  }
@@ -21,8 +21,8 @@ test('页向导流程图', async ({ page }) => {
21
21
  const currentNode = stepItems.nth(i).locator('.tiny-wizard__chart > span').nth(1)
22
22
  const { width, height } = await currentNode.boundingBox()
23
23
  await expect(currentNode).toHaveClass('tiny-wizard__chart-svg')
24
- await expect(width).toBeCloseTo(20)
25
- await expect(height).toBeCloseTo(22.67, 2)
24
+ await expect(width).toBeGreaterThanOrEqual(20)
25
+ await expect(height).toBeGreaterThanOrEqual(20)
26
26
  }
27
27
  }
28
28
 
@@ -33,8 +33,8 @@ test('页向导流程图', async ({ page }) => {
33
33
  const currentNode = stepItems.nth(i).locator('.tiny-wizard__chart > span').nth(1)
34
34
  const { width, height } = await currentNode.boundingBox()
35
35
  await expect(currentNode).toHaveClass('tiny-wizard__chart-svg')
36
- await expect(width).toBeCloseTo(20)
37
- await expect(height).toBeCloseTo(22.67, 2)
36
+ await expect(width).toBeGreaterThanOrEqual(20)
37
+ await expect(height).toBeGreaterThanOrEqual(20)
38
38
  }
39
39
  }
40
40
 
@@ -45,8 +45,8 @@ test('页向导流程图', async ({ page }) => {
45
45
  const currentNode = stepItems.nth(i).locator('.tiny-wizard__chart > span').nth(1)
46
46
  const { width, height } = await currentNode.boundingBox()
47
47
  await expect(currentNode).toHaveClass('tiny-wizard__chart-svg')
48
- await expect(width).toBeCloseTo(20)
49
- await expect(height).toBeCloseTo(22.67, 2)
48
+ await expect(width).toBeGreaterThanOrEqual(20)
49
+ await expect(height).toBeGreaterThanOrEqual(20)
50
50
  }
51
51
  }
52
52
  })
@@ -12,6 +12,6 @@ test('步骤插槽', async ({ page }) => {
12
12
  for (let i = 0; i < 3; i++) {
13
13
  await expect(buttons.nth(i)).toHaveText(texts[i])
14
14
  await buttons.nth(i).click()
15
- await expect(modal.nth(i)).toHaveText(`步骤${i + 1}`)
15
+ await expect(modal.nth(i + 1)).toHaveText(`步骤${i + 1}`)
16
16
  }
17
17
  })
@@ -17,12 +17,12 @@ test('时间线流程图', async ({ page }) => {
17
17
  const texts = [/提交小红/, /转他人处理小胡/, /主管审批小张/]
18
18
  const expandBtns = page.getByRole('listitem').locator('svg')
19
19
  const xiaoHongTop = page
20
- .getByRole('tooltip', { name: '小红 部门:某部门 邮件:example@example.com 手机:1234567890' })
20
+ .getByRole('tooltip', { name: '小红 工号:123456890 部门:某部门 邮件:example@example.com 手机:1234567890' })
21
21
  .locator('div')
22
22
  .filter({ hasText: '小红工号:123456890' })
23
23
  .nth(3)
24
24
  const xiaoHongBottom = page
25
- .getByRole('tooltip', { name: '小红 部门:某部门 邮件:example@example.com 手机:1234567890' })
25
+ .getByRole('tooltip', { name: '小红 工号:123456890 部门:某部门 邮件:example@example.com 手机:1234567890' })
26
26
  .getByText('部门:某部门邮件:example@example.com手机:1234567890')
27
27
 
28
28
  await expect(nodeLines).toHaveCount(2)
@@ -49,9 +49,9 @@ test('时间线流程图', async ({ page }) => {
49
49
  }
50
50
  }
51
51
 
52
- await userNames.first().hover()
53
- await expect(xiaoHongTop).toBeVisible()
54
- await expect(xiaoHongBottom).toBeVisible()
52
+ await page.getByRole('link', { name: '小红 123456890' }).hover()
53
+ await expect(xiaoHongTop).toHaveCount(1)
54
+ await expect(xiaoHongBottom).toHaveCount(1)
55
55
  await expandBtns.nth(0).click()
56
56
  await expect(nodeLines).toHaveCount(2)
57
57
  await expect(nodeDates).toHaveCount(2)
package/demos/pc/menus.js CHANGED
@@ -103,7 +103,15 @@ export const cmpMenus = [
103
103
  { 'nameCn': '弹出编辑', 'name': 'PopEditor', 'key': 'popeditor' },
104
104
  { 'nameCn': '弹出框上传', 'name': 'PopUpload', 'key': 'pop-upload' },
105
105
  { 'nameCn': '单选框', 'name': 'Radio', 'key': 'radio' },
106
- { 'nameCn': '富文本', 'name': 'RichTextEditor', 'key': 'rich-text-editor' },
106
+ {
107
+ 'nameCn': '富文本',
108
+ 'name': 'RichTextEditor',
109
+ 'key': 'rich-text-editor',
110
+ 'mark': {
111
+ 'type': 'warning',
112
+ 'text': 'Beta'
113
+ }
114
+ },
107
115
  { 'nameCn': '搜索', 'name': 'Search', 'key': 'search' },
108
116
  { 'nameCn': '选择器', 'name': 'Select', 'key': 'select' },
109
117
  { 'nameCn': '滑块', 'name': 'Slider', 'key': 'slider' },
@@ -226,13 +234,29 @@ export const cmpMenus = [
226
234
  { 'nameCn': '公告牌', 'name': 'BulletinBoard', 'key': 'bulletin-board' },
227
235
  { 'nameCn': '日历', 'name': 'Calendar', 'key': 'calendar' },
228
236
  { 'nameCn': '日历视图', 'name': 'CalendarView', 'key': 'calendar-view' },
229
- { 'nameCn': '信用卡表单', 'name': 'CreditCardForm', 'key': 'credit-card-form' },
237
+ {
238
+ 'nameCn': '信用卡表单',
239
+ 'name': 'CreditCardForm',
240
+ 'key': 'credit-card-form',
241
+ 'mark': {
242
+ 'type': 'danger',
243
+ 'text': 'Del'
244
+ }
245
+ },
230
246
  { 'nameCn': '图片裁剪', 'name': 'Crop', 'key': 'crop' },
231
247
  { 'nameCn': '表头详情栏', 'name': 'DetailPage', 'key': 'detail-page' },
232
248
  { 'nameCn': '图片预览', 'name': 'Image', 'key': 'image' },
233
249
  { 'nameCn': '评分', 'name': 'Rate', 'key': 'rate' },
234
250
  { 'nameCn': '文字滚动', 'name': 'ScrollText', 'key': 'scroll-text' },
235
- { 'nameCn': '滚动块', 'name': 'SlideBar', 'key': 'slide-bar' },
251
+ {
252
+ 'nameCn': '滚动块',
253
+ 'name': 'SlideBar',
254
+ 'key': 'slide-bar',
255
+ 'mark': {
256
+ 'type': 'danger',
257
+ 'text': 'Del'
258
+ }
259
+ },
236
260
  { 'nameCn': '标签', 'name': 'Tag', 'key': 'tag' },
237
261
  { 'nameCn': '标签组', 'name': 'TagGroup', 'key': 'tag-group' },
238
262
  { 'nameCn': '输入框', 'name': 'TextPopup', 'key': 'text-popup' },
@@ -241,8 +265,22 @@ export const cmpMenus = [
241
265
  { 'nameCn': '全屏显示', 'name': 'Fullscreen', 'key': 'fullscreen' },
242
266
  { 'nameCn': '全局设置', 'name': 'ConfigProvider', 'key': 'config-provider' },
243
267
  { 'nameCn': '分割线', 'name': 'Divider', 'key': 'divider' },
244
- { 'nameCn': '二维码', 'name': 'QrCode', 'key': 'qr-code' },
245
- { 'nameCn': '水印', 'name': 'Watermark', 'key': 'watermark' }
268
+ {
269
+ 'nameCn': '二维码',
270
+ 'name': 'QrCode',
271
+ 'key': 'qr-code',
272
+ 'mark': {
273
+ 'text': 'New'
274
+ }
275
+ },
276
+ {
277
+ 'nameCn': '水印',
278
+ 'name': 'Watermark',
279
+ 'key': 'watermark',
280
+ 'mark': {
281
+ 'text': 'New'
282
+ }
283
+ }
246
284
  ]
247
285
  }
248
286
  ]