@opentiny/vue-docs 2.2.3 → 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.
- package/demos/pc/app/anchor/change.spec.ts +1 -2
- package/demos/pc/app/anchor/is-affix.spec.ts +4 -3
- package/demos/pc/app/anchor/set-container.spec.ts +7 -7
- package/demos/pc/app/anchor/webdoc/anchor.js +17 -16
- package/demos/pc/app/button/basic-usage-composition-api.vue +1 -1
- package/demos/pc/app/button/basic-usage.vue +1 -1
- package/demos/pc/app/button/dynamic-disabled-composition-api.vue +0 -1
- package/demos/pc/app/button/dynamic-disabled.spec.js +3 -0
- package/demos/pc/app/button/dynamic-disabled.vue +0 -1
- package/demos/pc/app/button/icon-composition-api.vue +2 -1
- package/demos/pc/app/button/icon.vue +2 -1
- package/demos/pc/app/grid/data-source/static-data-composition-api.vue +1 -1
- package/demos/pc/app/grid/expand/expand-config-composition-api.vue +1 -1
- package/demos/pc/app/grid/filter/simple-date-filter.spec.ts +2 -20
- package/demos/pc/app/grid/operation-column/selection-config-composition-api.vue +1 -1
- package/demos/pc/app/grid/operation-column/selection-config.vue +2 -3
- package/demos/pc/app/grid/slot/editor-slot-composition-api.vue +1 -1
- package/demos/pc/app/grid/slot/header-slot-composition-api.vue +4 -1
- package/demos/pc/app/grid/slot/header-slot.vue +2 -1
- package/demos/pc/app/icon/basic-usage.spec.js +8 -1
- package/demos/pc/app/icon/iconGroups.js +195 -195
- package/demos/pc/app/icon/list.spec.js +10 -5
- package/demos/pc/app/icon/show-title.spec.ts +8 -0
- package/demos/pc/app/layout/gutter-composition-api.vue +11 -0
- package/demos/pc/app/layout/gutter.spec.ts +3 -0
- package/demos/pc/app/layout/gutter.vue +11 -0
- package/demos/pc/app/layout/webdoc/layout.js +14 -3
- package/demos/pc/app/select/copy-multi.spec.ts +15 -6
- package/demos/pc/app/select/is-drop-inherit-width.spec.ts +2 -3
- package/demos/pc/app/select/nest-grid-composition-api.vue +3 -1
- package/demos/pc/app/select/optimization.spec.ts +1 -0
- package/demos/pc/app/tag/closable.spec.ts +1 -1
- package/demos/pc/app/tag/color3.spec.ts +1 -1
- package/demos/pc/app/tag/content.spec.ts +2 -2
- package/demos/pc/app/tag/create.spec.ts +3 -3
- package/demos/pc/app/tag/disabled.spec.ts +1 -1
- package/demos/pc/app/tag/effect.spec.ts +4 -3
- package/demos/pc/app/wizard/btn-events-composition-api.vue +5 -5
- package/demos/pc/app/wizard/btn-events.spec.ts +63 -0
- package/demos/pc/app/wizard/btn-events.vue +5 -5
- package/demos/pc/app/wizard/page-guide.spec.ts +6 -6
- package/demos/pc/app/wizard/slot-step-button.spec.ts +1 -1
- package/demos/pc/app/wizard/time-line-flow.spec.ts +5 -5
- package/demos/pc/menus.js +1 -1
- package/demos/pc/webdoc/changelog.md +521 -305
- package/demos/pc/webdoc/installation-en.md +11 -6
- package/demos/pc/webdoc/installation.md +14 -8
- package/package.json +6 -6
- package/playground/App.vue +2 -2
- package/src/App.vue +2 -0
- package/src/tools/useBulletin.jsx +43 -0
|
@@ -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
|
-
|
|
40
|
+
Modal.message('btn-prev' + JSON.stringify(datas))
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const handleNext = (datas) => {
|
|
44
|
-
|
|
44
|
+
Modal.message('btn-next' + JSON.stringify(datas))
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const handleSave = (datas) => {
|
|
48
|
-
|
|
48
|
+
Modal.message('btn-save' + JSON.stringify(datas))
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
const handleSubmit = (datas) => {
|
|
52
|
-
|
|
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
|
-
|
|
47
|
+
Modal.message('btn-prev' + JSON.stringify(datas))
|
|
48
48
|
},
|
|
49
49
|
handleNext(datas) {
|
|
50
|
-
|
|
50
|
+
Modal.message('btn-next' + JSON.stringify(datas))
|
|
51
51
|
},
|
|
52
52
|
handleSave(datas) {
|
|
53
|
-
|
|
53
|
+
Modal.message('btn-save' + JSON.stringify(datas))
|
|
54
54
|
},
|
|
55
55
|
handleSubmit(datas) {
|
|
56
|
-
|
|
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).
|
|
25
|
-
await expect(height).
|
|
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).
|
|
37
|
-
await expect(height).
|
|
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).
|
|
49
|
-
await expect(height).
|
|
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
|
|
53
|
-
await expect(xiaoHongTop).
|
|
54
|
-
await expect(xiaoHongBottom).
|
|
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)
|