Skip to content

Commit 7b93e2c

Browse files
authored
Merge branch 'dev' into feat-old-vars-1028
2 parents 412b6f1 + 418c1d5 commit 7b93e2c

File tree

259 files changed

+1955
-1168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+1955
-1168
lines changed

examples/sites/demos/.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/** @type {import('eslint').Linter.Config} */
44
module.exports = {
55
rules: {
6-
'no-console': 'off'
6+
'no-console': 'off',
7+
'vue/no-unused-vars': 'off'
78
}
89
}

examples/sites/demos/apis/dialog-box.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export default {
133133
'en-US': 'Achieve the maximum height of the window'
134134
},
135135
mode: ['pc'],
136-
pcDemo: 'form-in-dialog'
136+
pcDemo: 'dialog-width'
137137
},
138138
{
139139
name: 'modal',

examples/sites/demos/apis/tag-group.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default {
3232
},
3333
{
3434
name: 'size',
35-
type: "'medium' | 'small' | 'mini'",
35+
type: "'medium' | 'small'",
3636
defaultValue: "'medium'",
3737
desc: {
3838
'zh-CN': '尺寸',

examples/sites/demos/apis/tag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ type IEffect = 'dark' | 'light' | 'plain'
271271
name: 'ISize',
272272
type: 'type',
273273
code: `
274-
type ISize = 'medium' | 'small' | 'mini' | ''
274+
type ISize = 'medium' | 'small' | ''
275275
`
276276
},
277277
{

examples/sites/demos/mobile-first/app/tabs/tabdata-title.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<tiny-tabs v-model="activeName" v-if="showTab" tab-style="card" :with-close="true" @close="close">
3-
<tiny-tab-item :key="item.name" v-for="item in Tabs" :title="item.title" :name="item.name">
3+
<tiny-tab-item :key="item.name" v-for="item in tabs" :title="item.title" :name="item.name">
44
{{ item.content }}
55
</tiny-tab-item>
66
</tiny-tabs>
@@ -18,12 +18,12 @@ export default {
1818
return {
1919
activeName: '',
2020
showTab: false,
21-
TinyTabs: []
21+
tabs: []
2222
}
2323
},
2424
mounted() {
2525
setTimeout(() => {
26-
this.TinyTabs = [
26+
this.tabs = [
2727
{
2828
title: '表单组件',
2929
name: 'first',
@@ -57,7 +57,7 @@ export default {
5757
},
5858
methods: {
5959
close(name) {
60-
this.TinyTabs = this.TinyTabs.filter((tab) => {
60+
this.tabs = this.tabs.filter((tab) => {
6161
return tab.name !== name
6262
})
6363
}

examples/sites/demos/mobile-first/app/tabs/tabs-draggable.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@tab-drag-over="handleOver"
1313
@tab-drag-end="handleEnd"
1414
>
15-
<tiny-tab-item :key="item.name" v-for="item in Tabs" :title="item.title" :name="item.name">
15+
<tiny-tab-item :key="item.name" v-for="item in tabs" :title="item.title" :name="item.name">
1616
{{ item.content }}
1717
</tiny-tab-item>
1818
</tiny-tabs>
@@ -34,7 +34,7 @@ export default {
3434
dropConfig: {
3535
plugin: Sortable
3636
},
37-
TinyTabs: [
37+
tabs: [
3838
{
3939
title: 'Tab 1',
4040
name: '1',
@@ -62,15 +62,15 @@ export default {
6262
},
6363
handleEnd(event) {
6464
const { oldDraggableIndex, newDraggableIndex } = event
65-
const tab = this.TinyTabs.splice(oldDraggableIndex, 1)[0]
66-
this.TinyTabs.splice(newDraggableIndex, 0, tab)
65+
const tab = this.tabs.splice(oldDraggableIndex, 1)[0]
66+
this.tabs.splice(newDraggableIndex, 0, tab)
6767
68-
console.log(this.TinyTabs)
68+
console.log(this.tabs)
6969
},
7070
handleAdd() {
71-
this.TinyTabs.push({
72-
title: 'Tab ' + String(this.TinyTabs.length + 1),
73-
name: String(this.TinyTabs.length + 1),
71+
this.tabs.push({
72+
title: 'Tab ' + String(this.tabs.length + 1),
73+
name: String(this.tabs.length + 1),
7474
content: '动态增加tabitem'
7575
})
7676
}

examples/sites/demos/mobile-first/app/tabs/tabs-events-add.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<tiny-tabs v-model="activeName" :with-add="true" @add="add" tab-style="card">
3-
<tiny-tab-item :key="item.name" v-for="item in Tabs" :title="item.title" :name="item.name">
3+
<tiny-tab-item :key="item.name" v-for="item in tabs" :title="item.title" :name="item.name">
44
{{ item.content }}
55
</tiny-tab-item>
66
</tiny-tabs>
@@ -16,7 +16,7 @@ export default {
1616
},
1717
data() {
1818
return {
19-
TinyTabs: [
19+
tabs: [
2020
{
2121
title: '表单组件',
2222
name: 'first',
@@ -49,7 +49,7 @@ export default {
4949
message: '动态增加 tabitem'
5050
})
5151
52-
this.TinyTabs.push({
52+
this.tabs.push({
5353
title: 'Tab ++',
5454
name: ++this.tabIndex + '',
5555
content: '动态增加 tabitem'

examples/sites/demos/mobile-first/app/tabs/tabs-events-close.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<tiny-tabs v-model="activeName" tab-style="card" :with-close="true" :before-close="beforeClose" @close="close">
3-
<tiny-tab-item :key="item.name" v-for="item in Tabs" :title="item.title" :name="item.name">
3+
<tiny-tab-item :key="item.name" v-for="item in tabs" :title="item.title" :name="item.name">
44
{{ item.content }}
55
</tiny-tab-item>
66
</tiny-tabs>
@@ -17,7 +17,7 @@ export default {
1717
data() {
1818
return {
1919
activeName: 'first',
20-
TinyTabs: [
20+
tabs: [
2121
{
2222
title: '表单组件',
2323
name: 'first',
@@ -57,7 +57,7 @@ export default {
5757
message: '关闭 ' + name + ' 页签'
5858
})
5959
60-
this.TinyTabs = this.TinyTabs.filter((tab) => {
60+
this.tabs = this.tabs.filter((tab) => {
6161
return tab.name !== name
6262
})
6363
}

examples/sites/demos/mobile-first/app/tabs/tabs-events-edit.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<tiny-tabs v-model="activeName" tab-style="card" editable @edit="edit">
3-
<tiny-tab-item :key="item.name" v-for="item in Tabs" :title="item.title" :name="item.name">
3+
<tiny-tab-item :key="item.name" v-for="item in tabs" :title="item.title" :name="item.name">
44
{{ item.content }}
55
</tiny-tab-item>
66
</tiny-tabs>
@@ -17,7 +17,7 @@ export default {
1717
data() {
1818
return {
1919
activeName: 'first',
20-
TinyTabs: [
20+
tabs: [
2121
{
2222
title: '表单组件',
2323
name: 'first',

examples/sites/demos/mobile-first/app/tabs/tabs-tabs.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<tiny-tabs v-model="activeName" v-if="showTab" tab-style="card" :with-close="true" @close="close">
3-
<tiny-tab-item :key="item.name" v-for="item in Tabs" :title="item.title" :name="item.name">
3+
<tiny-tab-item :key="item.name" v-for="item in tabs" :title="item.title" :name="item.name">
44
{{ item.content }}
55
<tiny-tabs v-model="activeName1" v-if="item.name === 'f1'">
66
<tiny-tab-item title="s1子标签页" name="s1">
@@ -32,7 +32,7 @@ export default {
3232
activeName: 'f1',
3333
activeName2: 'ss1',
3434
showTab: true,
35-
TinyTabs: [
35+
tabs: [
3636
{
3737
title: '表单组件',
3838
name: 'f1',
@@ -53,7 +53,7 @@ export default {
5353
},
5454
methods: {
5555
close(name) {
56-
this.TinyTabs = this.TinyTabs.filter((tab) => {
56+
this.tabs = this.tabs.filter((tab) => {
5757
return tab.name !== name
5858
})
5959
}

examples/sites/demos/mobile-first/app/tabs/with-add.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<tiny-tabs tab-style="card" :editable="false" :with-add="true" @add="handleadd" style="width: 500px" show-more-tabs>
3-
<tiny-tab-item :key="item.name" v-for="item in Tabs" :title="item.title" :name="item.name">
3+
<tiny-tab-item :key="item.name" v-for="item in tabs" :title="item.title" :name="item.name">
44
{{ item.content }}
55
</tiny-tab-item>
66
</tiny-tabs>
@@ -16,7 +16,7 @@ export default {
1616
},
1717
data() {
1818
return {
19-
TinyTabs: [
19+
tabs: [
2020
{
2121
title: 'Tab 1',
2222
name: '1',
@@ -35,10 +35,10 @@ export default {
3535
methods: {
3636
handleadd() {
3737
// 如果tabItem数量小于指定值就可以新增
38-
if (this.TinyTabs.length < this.maxCount) {
38+
if (this.tabs.length < this.maxCount) {
3939
const name = `${++this.tabIndex}`
4040
const title = `Tab ++ ${name}`
41-
this.TinyTabs.push({ title, name, content: '动态增加tabitem - ' + name })
41+
this.tabs.push({ title, name, content: '动态增加tabitem - ' + name })
4242
} else {
4343
TinyModal.message('tabitem数量已到最大值')
4444
}

examples/sites/demos/mobile/app/input/webdoc/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default {
3737
},
3838
desc: {
3939
'zh-CN':
40-
'<p>通过对应的 <code>type</code> 属性,可以设置为对应的类型。默认为 text,可选值为 text,textarea 和其他 原生 input 的 type 值</p>',
40+
'<p>通过对应的 <code>type</code> 属性,可以设置为对应的类型。默认为 text,可选值为 text,number 等其他 原生 input 的 type 值</p>',
4141
'en-US':
4242
'<p>You can set the corresponding type through the corresponding <code>type</code> attribute. The default value is text. The options are text, textarea, and other type values of the native input</p>'
4343
},

examples/sites/demos/mobile/app/tabs/expand.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="demo-tabs">
33
<tiny-tabs v-model="activeName" show-expand-tabs expand-tabs-title="请选择" expand-tabs-mode="columns">
4-
<tiny-tab-item :key="item.name" v-for="item in Tabs" :title="item.title" :name="item.name"> </tiny-tab-item>
4+
<tiny-tab-item :key="item.name" v-for="item in tabs" :title="item.title" :name="item.name"> </tiny-tab-item>
55
</tiny-tabs>
66
</div>
77
</template>
@@ -16,7 +16,7 @@ export default {
1616
},
1717
data() {
1818
return {
19-
TinyTabs: [
19+
tabs: [
2020
{
2121
title: '标签 1',
2222
name: '1',

examples/sites/demos/pc/app/action-menu/basic-usage.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ test('基本用法', async ({ page }) => {
1616
// 更多按钮
1717
await expect(moreItem).toHaveText(//)
1818
// 图标显示
19-
await expect(moreItem.locator('svg > path').nth(0)).toHaveAttribute(
20-
'd',
21-
'M8 11.43c-.15 0-.31-.06-.42-.18L1.92 5.6c-.23-.23-.23-.61 0-.85s.61-.23.85 0L8 9.98l5.23-5.23a.61.61 0 0 1 .85 0c.23.23.23.61 0 .85l-5.66 5.66c-.11.11-.27.17-.42.17z'
22-
)
19+
await expect(moreItem.locator('.tiny-dropdown__trigger .tiny-svg')).toBeVisible()
2320
// 分割线
2421
await expect(actionMenu.locator('.tiny-action-menu__item-line')).toHaveCount(2)
2522
// 图标旋转

examples/sites/demos/pc/app/action-menu/card-mode.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ test('基本用法', async ({ page }) => {
1212
await expect(visibleItem).toHaveCount(4)
1313
await expect(moreItem).not.toHaveText(//)
1414
// 三点图标
15-
await expect(moreItem.locator('circle')).toHaveCount(3)
15+
const SvgPathReg = /^M2\.3 7\.78v.+219-1\.17Z$/
16+
await expect(moreItem.locator('.tiny-svg path').first()).toHaveAttribute('d', SvgPathReg)
1617
})

examples/sites/demos/pc/app/action-menu/icon.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test('只显示文本', async ({ page }) => {
2424
await page.goto('action-menu#icon')
2525

2626
const wrap = page.locator('#icon')
27-
const actionMenu = wrap.locator('.tiny-action-menu').nth(2)
27+
const actionMenu = wrap.locator('.tiny-action-menu').nth(1)
2828
const actionMenuItem = actionMenu.locator('.tiny-action-menu__item')
2929

3030
await expect(actionMenuItem.nth(0).locator('.tiny-svg')).toBeHidden()

examples/sites/demos/pc/app/anchor/change-composition-api.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<script setup>
66
import { ref } from 'vue'
7-
import { TinyAnchor, TinyModal } from '@opentiny/vue'
7+
import { TinyAnchor } from '@opentiny/vue'
88
99
const links = ref([
1010
{
@@ -42,6 +42,6 @@ const links = ref([
4242
])
4343
4444
function handleChange(link) {
45-
TinyModal.message({ message: `change${link}`, status: 'info' })
45+
console.log(`当前锚点${link}`)
4646
}
4747
</script>

examples/sites/demos/pc/app/anchor/change.spec.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ test('change事件', async ({ page }) => {
55
await page.goto('anchor#change')
66

77
const anchor = page.locator('.tiny-anchor')
8-
const link1 = anchor.getByRole('link', { name: '演示' })
8+
const link1 = anchor.getByRole('link', { name: '基本用法' })
99
const link2 = anchor.getByRole('link', { name: 'change 事件' })
10-
const modal = page.locator('.tiny-modal')
1110

11+
const values = [] as string[]
12+
page.on('console', async (msg) => {
13+
for (const arg of msg.args()) {
14+
const text = await arg.jsonValue()
15+
if (text.includes('当前锚点')) {
16+
values.push(text)
17+
}
18+
}
19+
})
1220
await link1.click()
13-
await expect(modal).toHaveCount(1)
1421
await link2.click()
15-
await expect(modal).toHaveCount(2)
16-
await expect(modal.last()).toHaveText(/#change/)
22+
expect(values.length).toBe(2)
23+
expect(values[0].startsWith('当前锚点#basic-usage')).toBeTruthy()
1724
})

examples/sites/demos/pc/app/anchor/change.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</template>
44

55
<script>
6-
import { TinyAnchor, TinyModal } from '@opentiny/vue'
6+
import { TinyAnchor } from '@opentiny/vue'
77
88
export default {
99
components: {
@@ -49,7 +49,7 @@ export default {
4949
},
5050
methods: {
5151
handleChange(link) {
52-
TinyModal.message({ message: `change${link}`, status: 'info' })
52+
console.log(`当前锚点${link}`)
5353
}
5454
}
5555
}

examples/sites/demos/pc/app/anchor/set-container-composition-api.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,29 @@ function handleClick(e, link) {
6767
.scroll-container {
6868
height: 40vh;
6969
overflow: auto;
70+
text-align: center;
71+
font-size: 24px;
72+
}
73+
.scroll-container > div {
74+
padding-top: 20%;
7075
}
7176
.sec-1 {
7277
height: 50vh;
73-
background: rgba(135, 206, 235, 0.1);
78+
background: #b6d4f2;
7479
}
7580
.sec-2 {
7681
height: 50vh;
77-
background: rgba(135, 206, 235, 0.3);
82+
background: #c2c2c2;
7883
}
7984
.sec-3 {
80-
background: rgba(135, 206, 235, 0.6);
81-
padding-top: 20vh;
85+
background: #fff4e8;
8286
}
8387
.sec-3-1 {
8488
height: 50vh;
85-
background: rgba(135, 206, 235, 0.8);
89+
background: #b9e683;
8690
}
8791
.sec-3-2 {
8892
height: 50vh;
89-
background: rgba(135, 206, 235, 1);
93+
background: #f2c5c2;
9094
}
9195
</style>

0 commit comments

Comments
 (0)