@opentiny/vue-docs 3.17.4 → 3.18.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.
- package/demos/apis/button.js +2 -2
- package/demos/apis/dropdown.js +1 -1
- package/demos/apis/fluent-editor.js +2 -2
- package/demos/apis/link-menu.js +7 -7
- package/demos/apis/link.js +15 -1
- package/demos/apis/pager.js +3 -0
- package/demos/apis/pop-upload.js +15 -1
- package/demos/mobile-first/app/fluent-editor/basic-usage.vue +22 -0
- package/demos/mobile-first/app/fluent-editor/data-switch.vue +22 -0
- package/demos/mobile-first/app/fluent-editor/disabled.vue +22 -0
- package/demos/mobile-first/app/fluent-editor/image-upload.vue +46 -0
- package/demos/mobile-first/app/fluent-editor/options.vue +51 -0
- package/demos/mobile-first/app/fluent-editor/webdoc/fluent-editor.cn.md +9 -0
- package/demos/mobile-first/app/fluent-editor/webdoc/fluent-editor.en.md +9 -0
- package/demos/mobile-first/app/fluent-editor/webdoc/fluent-editor.js +68 -0
- package/demos/mobile-first/app/time-line-new/auto-slot.vue +50 -0
- package/demos/mobile-first/app/time-line-new/basic-usage.vue +23 -0
- package/demos/mobile-first/app/time-line-new/fold-time.vue +29 -0
- package/demos/mobile-first/app/time-line-new/limited-nodes.vue +29 -0
- package/demos/mobile-first/app/time-line-new/many-status.vue +24 -0
- package/demos/mobile-first/app/time-line-new/node-max.vue +26 -0
- package/demos/mobile-first/app/time-line-new/node-toset.vue +32 -0
- package/demos/mobile-first/app/time-line-new/single-status.vue +40 -0
- package/demos/mobile-first/app/time-line-new/sub-field.vue +23 -0
- package/demos/mobile-first/app/time-line-new/webdoc/time-line-new.cn.md +9 -0
- package/demos/mobile-first/app/time-line-new/webdoc/time-line-new.en.md +9 -0
- package/demos/mobile-first/app/time-line-new/webdoc/time-line-new.js +120 -0
- package/demos/mobile-first/menus.js +1 -0
- package/demos/pc/app/autocomplete/clearable.spec.ts +5 -3
- package/demos/pc/app/base-select/collapse-tags.spec.ts +3 -3
- package/demos/pc/app/base-select/size.spec.ts +1 -1
- package/demos/pc/app/carousel/autoplay.spec.ts +1 -1
- package/demos/pc/app/checkbox/checkbox-button-multiple.spec.ts +0 -10
- package/demos/pc/app/color-select-panel/alpha.spec.ts +6 -2
- package/demos/pc/app/color-select-panel/base.spec.ts +7 -3
- package/demos/pc/app/color-select-panel/event.spec.ts +5 -6
- package/demos/pc/app/color-select-panel/history.spec.ts +7 -9
- package/demos/pc/app/color-select-panel/predefine.spec.ts +4 -18
- package/demos/pc/app/config-provider/tag.spec.ts +5 -4
- package/demos/pc/app/date-picker/align.spec.ts +1 -0
- package/demos/pc/app/date-picker/clear.spec.ts +4 -4
- package/demos/pc/app/date-picker/custom-suffix-icon.spec.ts +1 -1
- package/demos/pc/app/dialog-box/custom-dialog-content.spec.ts +1 -1
- package/demos/pc/app/fluent-editor/basic-usage-composition-api.vue +14 -0
- package/demos/pc/app/fluent-editor/basic-usage.vue +22 -0
- package/demos/pc/app/fluent-editor/data-switch-composition-api.vue +14 -0
- package/demos/pc/app/fluent-editor/data-switch.vue +22 -0
- package/demos/pc/app/fluent-editor/disabled-composition-api.vue +12 -0
- package/demos/pc/app/fluent-editor/disabled.vue +20 -0
- package/demos/pc/app/fluent-editor/image-upload-composition-api.vue +39 -0
- package/demos/pc/app/fluent-editor/image-upload.vue +47 -0
- package/demos/pc/app/fluent-editor/options-composition-api.vue +63 -0
- package/demos/pc/app/fluent-editor/options.vue +71 -0
- package/demos/pc/app/fluent-editor/webdoc/fluent-editor.cn.md +7 -0
- package/demos/pc/app/fluent-editor/webdoc/fluent-editor.en.md +7 -0
- package/demos/pc/app/fluent-editor/webdoc/fluent-editor.js +69 -0
- package/demos/pc/app/form/form-disabled.spec.js +2 -2
- package/demos/pc/app/input/show-password.spec.ts +7 -8
- package/demos/pc/app/logout/basic-usage.spec.ts +4 -9
- package/demos/pc/app/logout/redirecturl.spec.ts +9 -0
- package/demos/pc/app/modal/basic-usage.spec.ts +1 -1
- package/demos/pc/app/modal/lock-view.spec.ts +5 -0
- package/demos/pc/app/modal/title-composition-api.vue +7 -2
- package/demos/pc/app/modal/title.spec.ts +10 -1
- package/demos/pc/app/modal/title.vue +7 -2
- package/demos/pc/app/nav-menu/slot-logo-composition-api.vue +0 -5
- package/demos/pc/app/nav-menu/slot-logo.vue +0 -5
- package/demos/pc/app/pop-upload/upload-tip-composition-api.vue +40 -0
- package/demos/pc/app/pop-upload/upload-tip.vue +50 -0
- package/demos/pc/app/pop-upload/webdoc/pop-upload.js +14 -2
- package/demos/pc/app/popeditor/clearable.spec.ts +2 -2
- package/demos/pc/app/popeditor/events.spec.ts +1 -4
- package/demos/pc/app/rate/not-selected-class.spec.js +1 -6
- package/demos/pc/app/rate/not-selected-color.spec.js +1 -1
- package/demos/pc/app/select/multiple.vue +49 -13
- package/demos/pc/app/split/moveend-event.spec.ts +3 -2
- package/demos/pc/app/split/movestart-event.spec.ts +1 -1
- package/demos/pc/app/split/trigger-slot-composition-api.vue +26 -3
- package/demos/pc/app/split/trigger-slot.spec.ts +1 -1
- package/demos/pc/app/split/trigger-slot.vue +27 -4
- package/demos/pc/app/tabs/basic-usage.spec.ts +2 -1
- package/demos/pc/app/tabs/before-leave.spec.ts +2 -1
- package/demos/pc/app/tabs/custom-more-icon.spec.ts +2 -1
- package/demos/pc/app/tabs/custom-tab-title.spec.ts +2 -1
- package/demos/pc/app/tabs/lazy.spec.ts +2 -1
- package/demos/pc/app/tabs/more-show-all.spec.ts +4 -4
- package/demos/pc/app/tabs/position.spec.ts +6 -5
- package/demos/pc/app/tabs/show-different-grid-data.spec.ts +4 -3
- package/demos/pc/app/tabs/size.spec.ts +4 -3
- package/demos/pc/app/tabs/stretch-wh.spec.ts +2 -1
- package/demos/pc/app/tabs/tab-style-bordercard.spec.ts +2 -1
- package/demos/pc/app/tabs/tab-style-card.spec.ts +2 -1
- package/demos/pc/app/tabs/tabs-draggable.spec.ts +5 -4
- package/demos/pc/app/tabs/tabs-events-click.spec.ts +3 -2
- package/demos/pc/app/tabs/tabs-events-close.spec.ts +2 -1
- package/demos/pc/app/tabs/tabs-second-layer.spec.ts +2 -1
- package/demos/pc/app/tabs/tabs-separator.spec.ts +2 -1
- package/demos/pc/app/tabs/tooltip.spec.ts +3 -2
- package/demos/pc/app/tabs/with-add.spec.ts +2 -1
- package/demos/pc/app/time-line-new/basic-usage.vue +32 -0
- package/demos/pc/app/time-line-new/custom-normal-step.vue +39 -0
- package/demos/pc/app/time-line-new/custom-vertical-step.vue +39 -0
- package/demos/pc/app/time-line-new/different-data1.vue +44 -0
- package/demos/pc/app/time-line-new/different-data2.vue +36 -0
- package/demos/pc/app/time-line-new/event.vue +29 -0
- package/demos/pc/app/time-line-new/node-toset1.vue +35 -0
- package/demos/pc/app/time-line-new/node-toset2.vue +36 -0
- package/demos/pc/app/time-line-new/set-start-value.vue +32 -0
- package/demos/pc/app/time-line-new/show-number.vue +28 -0
- package/demos/pc/app/time-line-new/show-status.vue +32 -0
- package/demos/pc/app/time-line-new/vertical1.vue +28 -0
- package/demos/pc/app/time-line-new/vertical2.vue +29 -0
- package/demos/pc/app/time-line-new/webdoc/time-line-new.cn.md +7 -0
- package/demos/pc/app/time-line-new/webdoc/time-line-new.en.md +7 -0
- package/demos/pc/app/time-line-new/webdoc/time-line-new.js +184 -0
- package/demos/pc/app/time-line-new/width.vue +28 -0
- package/demos/pc/app/time-picker/clearable.spec.ts +0 -3
- package/demos/pc/app/time-picker/editable.spec.ts +1 -6
- package/demos/pc/app/time-picker/format.spec.ts +4 -0
- package/demos/pc/app/time-picker/suffix-icon.spec.ts +4 -1
- package/demos/pc/app/tooltip/basic-usage.spec.js +1 -1
- package/demos/pc/app/tooltip/delay.spec.js +3 -3
- package/demos/pc/app/tooltip/pre.spec.js +7 -26
- package/demos/pc/app/user-contact/not-displayed-content.spec.ts +2 -1
- package/demos/pc/app/user-link/custom-service.spec.ts +4 -2
- package/demos/pc/menus.js +7 -1
- package/demos/pc/overviewimage/chart-radar.svg +2 -2
- package/demos/pc/webdoc/changelog.md +99 -0
- package/demos/pc/webdoc/theme.md +65 -230
- package/env/.env.innersaas +1 -2
- package/env/.env.saasopen +1 -2
- package/env/.env.saasprod +1 -2
- package/package.json +14 -14
- package/playground/App.vue +20 -4
- package/src/style.css +5 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<tiny-fluent-editor v-model="content" :image-upload="imageUpload"></tiny-fluent-editor>
|
|
4
|
+
内容:<br />
|
|
5
|
+
{{ content }}
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import { Modal } from '@opentiny/vue'
|
|
11
|
+
import { TinyFluentEditor } from '@opentiny/vue'
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
components: {
|
|
15
|
+
TinyFluentEditor
|
|
16
|
+
},
|
|
17
|
+
data() {
|
|
18
|
+
return {
|
|
19
|
+
content: '{"ops":[{"insert":"Hello "},{"attributes":{"bold":true},"insert":"FluentEditor"},{"insert":"!"}]}',
|
|
20
|
+
imageUpload: {
|
|
21
|
+
url: 'https://run.mocky.io/v3/f34365b4-679d-4e8f-8313-ddb11d6750be',
|
|
22
|
+
method: 'POST',
|
|
23
|
+
name: 'image',
|
|
24
|
+
withCredentials: true,
|
|
25
|
+
headers: {},
|
|
26
|
+
success: (serverResponse, next) => {
|
|
27
|
+
let file = {}
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line no-unreachable-loop
|
|
30
|
+
for (const key in serverResponse) {
|
|
31
|
+
file = serverResponse[key]
|
|
32
|
+
break
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
next(file.downloadUrl)
|
|
36
|
+
},
|
|
37
|
+
fail: (serverError) => {
|
|
38
|
+
Modal.message({
|
|
39
|
+
message: `上传失败回调事件:${serverError}`,
|
|
40
|
+
status: 'info'
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<tiny-fluent-editor v-model="content" :options="options"></tiny-fluent-editor>
|
|
4
|
+
内容:<br />
|
|
5
|
+
{{ content }}
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
import { ref } from 'vue'
|
|
11
|
+
import { TinyFluentEditor } from '@opentiny/vue'
|
|
12
|
+
|
|
13
|
+
const content = ref('')
|
|
14
|
+
const options = ref({
|
|
15
|
+
placeholder: '请输入内容',
|
|
16
|
+
modules: {
|
|
17
|
+
// 工具栏
|
|
18
|
+
toolbar: [
|
|
19
|
+
['bold', 'italic', 'underline', 'strike'],
|
|
20
|
+
[{ list: 'bullet' }, { list: 'ordered' }],
|
|
21
|
+
[{ align: '' }, { align: 'center' }, { align: 'right' }],
|
|
22
|
+
['better-table'],
|
|
23
|
+
['fullscreen']
|
|
24
|
+
],
|
|
25
|
+
// 字数统计
|
|
26
|
+
counter: true,
|
|
27
|
+
// 表格
|
|
28
|
+
'better-table': {
|
|
29
|
+
operationMenu: {
|
|
30
|
+
color: {
|
|
31
|
+
text: '主题色',
|
|
32
|
+
colors: [
|
|
33
|
+
'#ffffff',
|
|
34
|
+
'#f2f2f2',
|
|
35
|
+
'#dddddd',
|
|
36
|
+
'#a6a6a6',
|
|
37
|
+
'#666666',
|
|
38
|
+
'#000000',
|
|
39
|
+
'#c00000',
|
|
40
|
+
'#ff0000',
|
|
41
|
+
'#ffc8d3',
|
|
42
|
+
'#ffc000',
|
|
43
|
+
'#ffff00',
|
|
44
|
+
'#fff4cb',
|
|
45
|
+
'#92d050',
|
|
46
|
+
'#00b050',
|
|
47
|
+
'#dff3d2',
|
|
48
|
+
'#00b0f0',
|
|
49
|
+
'#0070c0',
|
|
50
|
+
'#d4f1f5',
|
|
51
|
+
'#002060',
|
|
52
|
+
'#7030a0',
|
|
53
|
+
'#7b69ee',
|
|
54
|
+
'#1476ff',
|
|
55
|
+
'#ec66ab',
|
|
56
|
+
'#42b883'
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<tiny-fluent-editor v-model="content" :options="options"></tiny-fluent-editor>
|
|
4
|
+
内容:<br />
|
|
5
|
+
{{ content }}
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import { TinyFluentEditor } from '@opentiny/vue'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
components: {
|
|
14
|
+
TinyFluentEditor
|
|
15
|
+
},
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
content: '',
|
|
19
|
+
options: {
|
|
20
|
+
placeholder: '请输入内容',
|
|
21
|
+
modules: {
|
|
22
|
+
// 工具栏
|
|
23
|
+
toolbar: [
|
|
24
|
+
['bold', 'italic', 'underline', 'strike'],
|
|
25
|
+
[{ list: 'bullet' }, { list: 'ordered' }],
|
|
26
|
+
[{ align: '' }, { align: 'center' }, { align: 'right' }],
|
|
27
|
+
['better-table'],
|
|
28
|
+
['fullscreen']
|
|
29
|
+
],
|
|
30
|
+
// 字数统计
|
|
31
|
+
counter: true,
|
|
32
|
+
// 表格
|
|
33
|
+
'better-table': {
|
|
34
|
+
operationMenu: {
|
|
35
|
+
color: {
|
|
36
|
+
text: '主题色',
|
|
37
|
+
colors: [
|
|
38
|
+
'#ffffff',
|
|
39
|
+
'#f2f2f2',
|
|
40
|
+
'#dddddd',
|
|
41
|
+
'#a6a6a6',
|
|
42
|
+
'#666666',
|
|
43
|
+
'#000000',
|
|
44
|
+
'#c00000',
|
|
45
|
+
'#ff0000',
|
|
46
|
+
'#ffc8d3',
|
|
47
|
+
'#ffc000',
|
|
48
|
+
'#ffff00',
|
|
49
|
+
'#fff4cb',
|
|
50
|
+
'#92d050',
|
|
51
|
+
'#00b050',
|
|
52
|
+
'#dff3d2',
|
|
53
|
+
'#00b0f0',
|
|
54
|
+
'#0070c0',
|
|
55
|
+
'#d4f1f5',
|
|
56
|
+
'#002060',
|
|
57
|
+
'#7030a0',
|
|
58
|
+
'#7b69ee',
|
|
59
|
+
'#1476ff',
|
|
60
|
+
'#ec66ab',
|
|
61
|
+
'#42b883'
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
column: '2',
|
|
3
|
+
owner: '',
|
|
4
|
+
metaData: {
|
|
5
|
+
experimental: '3.17.0'
|
|
6
|
+
},
|
|
7
|
+
demos: [
|
|
8
|
+
{
|
|
9
|
+
demoId: 'basic-usage',
|
|
10
|
+
name: {
|
|
11
|
+
'zh-CN': '基本用法',
|
|
12
|
+
'en-US': 'Basic Usage'
|
|
13
|
+
},
|
|
14
|
+
desc: {
|
|
15
|
+
'zh-CN': '通过 <code>v-model</code> 设置绑定值,默认数据保存格式为 Delta 数据格式。',
|
|
16
|
+
'en-US': 'You can refer to component label.'
|
|
17
|
+
},
|
|
18
|
+
codeFiles: ['basic-usage.vue']
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
demoId: 'disabled',
|
|
22
|
+
name: {
|
|
23
|
+
'zh-CN': '禁用状态',
|
|
24
|
+
'en-US': ''
|
|
25
|
+
},
|
|
26
|
+
desc: {
|
|
27
|
+
'zh-CN': '<p>通过属性 <code>disabled</code> 可设置编辑器为不可编辑状态。</p>',
|
|
28
|
+
'en-US': ''
|
|
29
|
+
},
|
|
30
|
+
codeFiles: ['disabled.vue']
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
demoId: 'image-upload',
|
|
34
|
+
name: {
|
|
35
|
+
'zh-CN': '图片上传',
|
|
36
|
+
'en-US': 'Image Upload'
|
|
37
|
+
},
|
|
38
|
+
desc: {
|
|
39
|
+
'zh-CN': '通过 <code>image-upload</code> 设置图片上传模块的配置项。',
|
|
40
|
+
'en-US': ''
|
|
41
|
+
},
|
|
42
|
+
codeFiles: ['image-upload.vue']
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
demoId: 'options',
|
|
46
|
+
name: {
|
|
47
|
+
'zh-CN': '编辑器配置',
|
|
48
|
+
'en-US': ''
|
|
49
|
+
},
|
|
50
|
+
desc: {
|
|
51
|
+
'zh-CN': '通过 <code>options</code> 设置编辑器的配置项,支持的配置项和 Quill 的相同,可参考 <a href="https://quilljs.com/docs/configuration#options" target="_blank">Quill</a> 文档。',
|
|
52
|
+
'en-US': ''
|
|
53
|
+
},
|
|
54
|
+
codeFiles: ['options.vue']
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
demoId: 'data-switch',
|
|
58
|
+
name: {
|
|
59
|
+
'zh-CN': '数据格式转换',
|
|
60
|
+
'en-US': ''
|
|
61
|
+
},
|
|
62
|
+
desc: {
|
|
63
|
+
'zh-CN': '<p>通过 <code>data-type</code> 指定富文本数据保存的格式。数据默认保存格式为 Delta 形式,若需要将数据保存格式设置为 HTML 形式,并关闭 HTML 格式自动转 Delta 格式,设置 <code>:data-type="false"</code>,<code>:data-upgrade="false"</code>。</p>',
|
|
64
|
+
'en-US': ''
|
|
65
|
+
},
|
|
66
|
+
codeFiles: ['data-switch.vue']
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
@@ -26,7 +26,7 @@ test('测试表单禁用', async ({ page }) => {
|
|
|
26
26
|
await expect(formItem.nth(5).locator('input').nth(1)).toBeDisabled()
|
|
27
27
|
await expect(formItem.nth(6).locator('input').first()).toBeDisabled()
|
|
28
28
|
await expect(formItem.nth(7).locator('input').first()).toBeDisabled()
|
|
29
|
-
await expect(formItem.nth(8).locator('input')).toBeDisabled()
|
|
29
|
+
await expect(formItem.nth(8).locator('input').first()).toBeDisabled()
|
|
30
30
|
await expect(formItem.nth(9).locator('input')).toBeDisabled()
|
|
31
31
|
await expect(formItem.nth(10).locator('input')).toBeDisabled()
|
|
32
32
|
await expect(formItem.nth(11).locator('textarea')).toBeDisabled()
|
|
@@ -53,7 +53,7 @@ test('测试表单禁用', async ({ page }) => {
|
|
|
53
53
|
await expect(formItem.nth(5).locator('input').nth(1)).not.toBeDisabled()
|
|
54
54
|
await expect(formItem.nth(6).locator('input').first()).not.toBeDisabled()
|
|
55
55
|
await expect(formItem.nth(7).locator('input').first()).not.toBeDisabled()
|
|
56
|
-
await expect(formItem.nth(8).locator('input')).not.toBeDisabled()
|
|
56
|
+
await expect(formItem.nth(8).locator('input').first()).not.toBeDisabled()
|
|
57
57
|
await expect(formItem.nth(9).locator('input')).not.toBeDisabled()
|
|
58
58
|
await expect(formItem.nth(10).locator('input')).not.toBeDisabled()
|
|
59
59
|
await expect(formItem.nth(11).locator('textarea')).not.toBeDisabled()
|
|
@@ -4,22 +4,21 @@ test('[Input]show-password', async ({ page }) => {
|
|
|
4
4
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
5
5
|
await page.goto('input#show-password')
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const demo = page.locator('#show-password')
|
|
8
|
+
|
|
9
|
+
const svg = demo.locator('.tiny-input__suffix > .tiny-input__suffix-inner .tiny-input__icon')
|
|
10
|
+
const input = demo.locator('.tiny-input.tiny-input-suffix input')
|
|
9
11
|
|
|
10
12
|
// 密码隐藏
|
|
11
13
|
await expect(svg).toBeVisible()
|
|
12
14
|
await expect(input).toHaveAttribute('type', 'password')
|
|
13
15
|
|
|
14
16
|
// 值
|
|
15
|
-
await
|
|
16
|
-
const value = await
|
|
17
|
+
await demo.locator('input[type="password"]').fill('123123123')
|
|
18
|
+
const value = await demo.locator('input[type="password"]').inputValue()
|
|
17
19
|
await expect(value).toBe('123123123')
|
|
18
|
-
|
|
19
|
-
// 密码图标
|
|
20
|
-
await expect(svg).toHaveAttribute('d', 'm3.486 3.207.712.712-.233.187c-.154.127-.307.261-.458.402l-.287.276c-.374.373-.712.762-1.011 1.151l-.047.061-.044.06-.184.251.275.374.232.291c.318.388.675.773 1.066 1.136l.244.22C5.059 9.47 6.489 10.14 8 10.14l.295-.009a5.472 5.472 0 0 0 1.722-.392l.76.762-.295.13c-.792.33-1.62.51-2.482.51l-.298-.007c-1.78-.086-3.414-.937-4.876-2.294l-.312-.3A12.91 12.91 0 0 1 1.416 7.29l-.051-.068-.05-.065-.174-.237-.135-.197-.099-.153-.04-.083a.501.501 0 0 1-.001-.357l.041-.084.099-.153.135-.197.174-.237.101-.133.252-.317c.346-.421.732-.839 1.158-1.234.216-.201.437-.39.66-.568ZM3.757.858l.096.01a.506.506 0 0 1 .258.137l1.112 1.11A6.491 6.491 0 0 1 8 1.474l.298.007c1.78.086 3.414.937 4.876 2.294l.312.3c.406.406.772.829 1.098 1.251l.051.068.05.065.173.237.136.197.098.153.042.083a.497.497 0 0 1 0 .357l-.042.084-.098.153-.136.197-.173.237-.101.133-.252.317c-.346.42-.732.838-1.158 1.234l-.288.26c-.123.106-.247.209-.372.308l.789.788.058.07a.5.5 0 0 1-.058.637l-.07.058a.499.499 0 0 1-.637-.058l-.907-.907v.002l-.727-.728V9.27l-.841-.841-.707-.706v-.002l-6.01-6.009-.058-.07a.5.5 0 0 1 .411-.784Zm1.535 4.157.775.775-.037.169c-.02.114-.03.23-.03.35l.005.15A2 2 0 0 0 8 8.308l.177-.008c.116-.01.23-.03.34-.06l.777.774-.2.087A2.99 2.99 0 0 1 8 9.308l-.176-.005a3 3 0 0 1-2.532-4.288ZM8 2.475l-.28.008a5.465 5.465 0 0 0-1.736.393l.722.724c.392-.187.83-.292 1.294-.292l.176.005A3 3 0 0 1 11 6.31l-.007.205a2.977 2.977 0 0 1-.285 1.087L11.8 8.697c.235-.182.465-.378.692-.589l.287-.276c.374-.373.712-.762 1.011-1.151l.047-.062.044-.059.183-.253-.274-.372-.232-.291a11.566 11.566 0 0 0-1.066-1.136l-.244-.22C10.941 3.146 9.511 2.475 8 2.475Zm0 1.833-.182.008c-.115.01-.227.03-.335.06l2.45 2.45c.043-.165.067-.338.067-.517l-.005-.15A2 2 0 0 0 8 4.309Z') // TODO
|
|
21
20
|
|
|
22
21
|
// 密码开放显示
|
|
23
|
-
await
|
|
22
|
+
await demo.locator('.tiny-input__suffix > .tiny-input__suffix-inner').click()
|
|
24
23
|
await expect(input).toHaveAttribute('type', 'text')
|
|
25
24
|
})
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { test, expect } from '@playwright/test'
|
|
2
2
|
|
|
3
|
-
test('
|
|
4
|
-
await page.goto('logout#
|
|
3
|
+
test('基本用法', async ({ page }) => {
|
|
4
|
+
await page.goto('logout#basic-usage')
|
|
5
5
|
const button = page.locator('.tiny-logout')
|
|
6
|
-
const status = page.locator('.
|
|
7
|
-
|
|
8
|
-
await expect(button).toHaveText(/登录/)
|
|
9
|
-
await expect(status).toContainText(['false'])
|
|
6
|
+
const status = page.locator('.demo-logout')
|
|
10
7
|
await button.click()
|
|
11
8
|
await page.getByRole('button', { name: /确定/ }).click()
|
|
12
9
|
await page.waitForTimeout(1000)
|
|
13
|
-
await expect(button).toHaveText(/注销/)
|
|
14
|
-
await expect(status).toContainText(['true'])
|
|
15
10
|
await button.click()
|
|
16
11
|
await page.waitForTimeout(1000)
|
|
17
12
|
await expect(button).toHaveText(/登录/)
|
|
18
|
-
await expect(status).toContainText(
|
|
13
|
+
await expect(status).toContainText('true')
|
|
19
14
|
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test'
|
|
2
|
+
|
|
3
|
+
test('自定义配置', async ({ page }) => {
|
|
4
|
+
await page.goto('logout#redirecturl')
|
|
5
|
+
const button = page.locator('.tiny-logout')
|
|
6
|
+
await button.click()
|
|
7
|
+
await page.waitForTimeout(1000)
|
|
8
|
+
await expect(button).toHaveText(/登录/)
|
|
9
|
+
})
|
|
@@ -19,7 +19,7 @@ test('基本用法', async ({ page }) => {
|
|
|
19
19
|
// 成功提示框
|
|
20
20
|
await page.getByRole('button', { name: /成功提示框/ }).click()
|
|
21
21
|
await expect(modal).toHaveClass(/status__success/)
|
|
22
|
-
await expect(modal.locator('.tiny-modal__header svg').first()).toHaveClass(/tiny-
|
|
22
|
+
await expect(modal.locator('.tiny-modal__header svg').first()).toHaveClass(/tiny-modal-svg__success/)
|
|
23
23
|
await page.getByRole('button', { name: /确定/, exact: true }).click()
|
|
24
24
|
await expect(page.locator('.tiny-modal.type__alert.status__success')).not.toBeVisible()
|
|
25
25
|
|
|
@@ -5,6 +5,11 @@ test('锁住页面', async ({ page }) => {
|
|
|
5
5
|
await page.goto('modal#lock-view')
|
|
6
6
|
|
|
7
7
|
const modal = page.locator('.tiny-modal.active')
|
|
8
|
+
|
|
9
|
+
// 新版示例页单示例无滚动条,先展开代码保证有滚动条
|
|
10
|
+
await page.locator('.i-ti-code').click()
|
|
11
|
+
await page.waitForTimeout(100)
|
|
12
|
+
|
|
8
13
|
await page.getByRole('button', { name: '不锁界面 且 隐藏遮罩层' }).click()
|
|
9
14
|
await expect(modal).not.toHaveClass(/lock__view/)
|
|
10
15
|
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<tiny-button @click="
|
|
2
|
+
<tiny-button @click="customClick" :reset-time="0">自定义标题</tiny-button>
|
|
3
|
+
<tiny-button @click="noTitleClick" :reset-time="0">无标题</tiny-button>
|
|
3
4
|
</template>
|
|
4
5
|
|
|
5
6
|
<script setup>
|
|
6
7
|
import { Button as TinyButton, Modal } from '@opentiny/vue'
|
|
7
8
|
|
|
8
|
-
function
|
|
9
|
+
function customClick() {
|
|
9
10
|
Modal.alert({ message: '自定义标题', title: '自定义标题' })
|
|
10
11
|
}
|
|
12
|
+
|
|
13
|
+
function noTitleClick() {
|
|
14
|
+
Modal.alert({ message: '无标题', title: '' })
|
|
15
|
+
}
|
|
11
16
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { test, expect } from '@playwright/test'
|
|
2
2
|
|
|
3
|
-
test('
|
|
3
|
+
test('自定义标题', async ({ page }) => {
|
|
4
4
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
5
5
|
await page.goto('modal#title')
|
|
6
6
|
|
|
@@ -8,3 +8,12 @@ test('标题', async ({ page }) => {
|
|
|
8
8
|
await page.getByRole('button', { name: '自定义标题' }).click()
|
|
9
9
|
await expect(modal.locator('.tiny-modal__header')).toHaveText('自定义标题')
|
|
10
10
|
})
|
|
11
|
+
|
|
12
|
+
test('无标题', async ({ page }) => {
|
|
13
|
+
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
14
|
+
await page.goto('modal#title')
|
|
15
|
+
|
|
16
|
+
const modal = page.locator('.tiny-modal.active')
|
|
17
|
+
await page.getByRole('button', { name: '无标题' }).click()
|
|
18
|
+
await expect(modal.locator('.tiny-modal__title')).not.toBeVisible()
|
|
19
|
+
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<tiny-button @click="
|
|
2
|
+
<tiny-button @click="customClick" :reset-time="0">自定义标题</tiny-button>
|
|
3
|
+
<tiny-button @click="noTitleClick" :reset-time="0">无标题</tiny-button>
|
|
3
4
|
</template>
|
|
4
5
|
|
|
5
6
|
<script>
|
|
@@ -10,8 +11,12 @@ export default {
|
|
|
10
11
|
TinyButton: Button
|
|
11
12
|
},
|
|
12
13
|
methods: {
|
|
13
|
-
|
|
14
|
+
customClick() {
|
|
14
15
|
Modal.alert({ message: '自定义标题', title: '自定义标题' })
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
noTitleClick() {
|
|
19
|
+
Modal.alert({ message: '无标题', title: '' })
|
|
15
20
|
}
|
|
16
21
|
}
|
|
17
22
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<tiny-pop-upload
|
|
3
|
+
:action="action"
|
|
4
|
+
accept="image/*"
|
|
5
|
+
:limit="limit"
|
|
6
|
+
:upload-file-type="fileType"
|
|
7
|
+
:max-upload-file-size="fileSize"
|
|
8
|
+
upload-button-text="添加文件"
|
|
9
|
+
>
|
|
10
|
+
<template #uploadTip>
|
|
11
|
+
<tiny-alert type="info">
|
|
12
|
+
<template #description>
|
|
13
|
+
<p class="tips-item">1.上传数据应不超过{{ limit }}条,超过数量不允许上传;</p>
|
|
14
|
+
<p class="tips-item">2.相同数据不会重复发</p>
|
|
15
|
+
<p class="tips-item">
|
|
16
|
+
3.上传文件限{{ fileType.join(',') }}格式,文件不超过{{ fileSize / 1024 }}KB,点击<tiny-link
|
|
17
|
+
>下载模板</tiny-link
|
|
18
|
+
>
|
|
19
|
+
</p>
|
|
20
|
+
</template>
|
|
21
|
+
</tiny-alert>
|
|
22
|
+
</template>
|
|
23
|
+
</tiny-pop-upload>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup lang="jsx">
|
|
27
|
+
import { ref } from 'vue'
|
|
28
|
+
import { PopUpload as TinyPopUpload, Alert as TinyAlert, Link as TinyLink } from '@opentiny/vue'
|
|
29
|
+
|
|
30
|
+
const action = ref('http://localhost:3000/api/upload')
|
|
31
|
+
const limit = ref(500)
|
|
32
|
+
const fileSize = ref(512000)
|
|
33
|
+
const fileType = ref(['.png', '.jpg'])
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style scoped>
|
|
37
|
+
.tips-item {
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<tiny-pop-upload
|
|
3
|
+
:action="action"
|
|
4
|
+
accept="image/*"
|
|
5
|
+
:limit="limit"
|
|
6
|
+
:upload-file-type="fileType"
|
|
7
|
+
:max-upload-file-size="fileSize"
|
|
8
|
+
upload-button-text="添加文件"
|
|
9
|
+
>
|
|
10
|
+
<template #uploadTip>
|
|
11
|
+
<tiny-alert type="info">
|
|
12
|
+
<template #description>
|
|
13
|
+
<p class="tips-item">1.上传数据应不超过{{ limit }}条,超过数量不允许上传;</p>
|
|
14
|
+
<p class="tips-item">2.相同数据不会重复发</p>
|
|
15
|
+
<p class="tips-item">
|
|
16
|
+
3.上传文件限{{ fileType.join(',') }}格式,文件不超过{{ fileSize / 1024 }}KB,点击<tiny-link
|
|
17
|
+
>下载模板</tiny-link
|
|
18
|
+
>
|
|
19
|
+
</p>
|
|
20
|
+
</template>
|
|
21
|
+
</tiny-alert>
|
|
22
|
+
</template>
|
|
23
|
+
</tiny-pop-upload>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script lang="jsx">
|
|
27
|
+
import { PopUpload, Alert, Link } from '@opentiny/vue'
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
components: {
|
|
31
|
+
TinyPopUpload: PopUpload,
|
|
32
|
+
TinyAlert: Alert,
|
|
33
|
+
TinyLink: Link
|
|
34
|
+
},
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
action: 'http://localhost:3000/api/upload',
|
|
38
|
+
limit: 500,
|
|
39
|
+
fileSize: 512000,
|
|
40
|
+
fileType: ['.png', '.jpg']
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style scoped>
|
|
47
|
+
.tips-item {
|
|
48
|
+
margin: 0;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -65,9 +65,9 @@ export default {
|
|
|
65
65
|
},
|
|
66
66
|
desc: {
|
|
67
67
|
'zh-CN':
|
|
68
|
-
'通过 <code>dialog-title</code> 设置弹框的标题,<code>cancel-button-text</code> 设置取消按钮的文本, \n <code>submit-button-text</code> 设置提交按钮的文本, <code>
|
|
68
|
+
'通过 <code>dialog-title</code> 设置弹框的标题,<code>cancel-button-text</code> 设置取消按钮的文本, \n <code>submit-button-text</code> 设置提交按钮的文本, <code>upload-button-text</code> 设置上传按钮的文本。',
|
|
69
69
|
'en-US':
|
|
70
|
-
'Set the title of the pop-up box through<code>dialog-title</code>, and set the text of the cancel button through<code>cancel-button-text</code>,\n <code>submit-button-text</code>Set the text for the submit button,<code>
|
|
70
|
+
'Set the title of the pop-up box through<code>dialog-title</code>, and set the text of the cancel button through<code>cancel-button-text</code>,\n <code>submit-button-text</code>Set the text for the submit button,<code>upload-button-text</code>Set the text for the upload button.'
|
|
71
71
|
},
|
|
72
72
|
codeFiles: ['fill-button-text.vue']
|
|
73
73
|
},
|
|
@@ -98,6 +98,18 @@ export default {
|
|
|
98
98
|
},
|
|
99
99
|
codeFiles: ['file-type.vue']
|
|
100
100
|
},
|
|
101
|
+
{
|
|
102
|
+
demoId: 'upload-tip',
|
|
103
|
+
name: {
|
|
104
|
+
'zh-CN': '自定义上传提示',
|
|
105
|
+
'en-US': 'Customize upload prompts'
|
|
106
|
+
},
|
|
107
|
+
desc: {
|
|
108
|
+
'zh-CN': '通过 <code>uploadTip</code> 插槽自定义上传提示的内容块。',
|
|
109
|
+
'en-US': 'Customize the content block for upload prompts through the<code>uploadTip</code>slot.'
|
|
110
|
+
},
|
|
111
|
+
codeFiles: ['upload-tip.vue']
|
|
112
|
+
},
|
|
101
113
|
{
|
|
102
114
|
demoId: 'prevent-delete-file',
|
|
103
115
|
name: {
|
|
@@ -8,9 +8,9 @@ test('PopEditor 弹出窗筛选条件支持可清空', async ({ page }) => {
|
|
|
8
8
|
const textBox = preview.getByRole('textbox')
|
|
9
9
|
const dialogBox = page.locator('.tiny-dialog-box')
|
|
10
10
|
const company = dialogBox.getByRole('listitem').filter({ hasText: '公司名' }).getByRole('textbox')
|
|
11
|
-
const companyDel = dialogBox.getByRole('listitem').filter({ hasText: '公司名' }).locator('
|
|
11
|
+
const companyDel = dialogBox.getByRole('listitem').filter({ hasText: '公司名' }).locator('.tiny-input__clear')
|
|
12
12
|
const city = dialogBox.getByRole('listitem').filter({ hasText: '城市' }).getByRole('textbox')
|
|
13
|
-
const cityDel = page.getByRole('listitem').filter({ hasText: '城市' }).
|
|
13
|
+
const cityDel = page.getByRole('listitem').filter({ hasText: '城市' }).locator('.tiny-input__clear')
|
|
14
14
|
|
|
15
15
|
// 弹出框搜索框支持清空
|
|
16
16
|
await textBox.click()
|
|
@@ -8,11 +8,8 @@ test('PopEditor change 事件', async ({ page }) => {
|
|
|
8
8
|
const textBox = preview.getByRole('textbox')
|
|
9
9
|
const dialogBox = page.locator('.tiny-dialog-box')
|
|
10
10
|
const confirmBtn = dialogBox.getByRole('button', { name: '确 认' })
|
|
11
|
-
const cancelBtn = dialogBox.getByRole('button', { name: '取 消' })
|
|
12
11
|
const dataItem = dialogBox.getByRole('row', { name: '1 GFD科技YX公司 福建 福州' }).locator('span')
|
|
13
|
-
const infoModal = page.getByText(
|
|
14
|
-
'值变为1,{"id":"1","name":"GFD科技YX公司","city":"福州","province":"福建","_$index_":"1"}'
|
|
15
|
-
)
|
|
12
|
+
const infoModal = page.getByText('值变为1,{"id":"1","name":"GFD科技YX公司","city":"福州","province":"福建"}')
|
|
16
13
|
|
|
17
14
|
await textBox.click()
|
|
18
15
|
await dataItem.click()
|
|
@@ -6,12 +6,7 @@ test.describe('Rate 自定义未选中图标类名', () => {
|
|
|
6
6
|
await page.goto('rate#not-selected-class')
|
|
7
7
|
|
|
8
8
|
const icon = page.locator('.tiny-rate__star > .tiny-svg')
|
|
9
|
-
const svg = page.locator('span:nth-child(5) > .tiny-svg > path')
|
|
10
9
|
|
|
11
|
-
await icon.nth(4).
|
|
12
|
-
await expect(svg).toHaveAttribute(
|
|
13
|
-
'd',
|
|
14
|
-
'M12 1c-.4 0-.8.1-1.1.3-.4.2-.6.5-.8.9L7.8 7l-5 .8c-.8.1-1.4.7-1.7 1.4s-.1 1.6.5 2.2l3.7 3.8-.9 5.4c-.1.6.1 1.2.5 1.7s1 .8 1.6.8c.4 0 .7-.1 1-.3l4.4-2.5 4.4 2.5c.3.2.7.3 1 .3.6 0 1.2-.3 1.6-.8.4-.5.6-1.1.5-1.7l-.9-5.4 3.7-3.8c.6-.6.7-1.4.5-2.2-.3-.8-.9-1.3-1.7-1.4L16 7l-2.2-4.8c-.2-.4-.5-.7-.8-.9-.2-.2-.6-.3-1-.3z'
|
|
15
|
-
)
|
|
10
|
+
await expect(icon.nth(4)).toHaveCSS('fill', 'rgba(25, 25, 25, 0.05)')
|
|
16
11
|
})
|
|
17
12
|
})
|
|
@@ -10,7 +10,7 @@ test.describe('Rate 自 定义未选中图标颜色', () => {
|
|
|
10
10
|
await expect(icon.nth(4)).toHaveCSS('fill', 'rgb(255, 0, 0)')
|
|
11
11
|
|
|
12
12
|
await icon.nth(4).hover()
|
|
13
|
-
await expect(icon.nth(4)).toHaveCSS('fill', 'rgb(255,
|
|
13
|
+
await expect(icon.nth(4)).toHaveCSS('fill', 'rgb(255, 187, 51)')
|
|
14
14
|
|
|
15
15
|
await icon.nth(4).click()
|
|
16
16
|
await expect(icon.nth(4)).toHaveCSS('fill', 'rgb(255, 187, 51)')
|