Skip to content

Commit 0c0606d

Browse files
committed
Merge branch 'dev' of github.com:opentiny/tiny-vue into wyp/tag-xdesign-0904
2 parents 828264b + 363e730 commit 0c0606d

File tree

212 files changed

+1290
-2552
lines changed

Some content is hidden

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

212 files changed

+1290
-2552
lines changed

.github/labeler.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
labels:
2+
- label: 'enhancement'
3+
sync: true
4+
matcher:
5+
title: '^feat.*: ?.*'
6+
commit: '^feat.*: ?.*'
7+
- label: 'bug'
8+
sync: true
9+
matcher:
10+
title: '^fix.*: ?.*'
11+
commit: '^fix.*: ?.*'
12+
- label: 'documentation'
13+
sync: true
14+
matcher:
15+
title: '^docs?: ?.*'
16+
commit: '^docs?: ?.*'
17+
- label: 'refactoring'
18+
sync: true
19+
matcher:
20+
title: '^refactor.*: ?.*'
21+
commit: '^refactor.*: ?.*'
22+
- label: 'chore'
23+
sync: true
24+
matcher:
25+
title: '^chore.*: ?.*'
26+
commit: '^chore.*: ?.*'
27+
- label: 'ospp-2024'
28+
sync: true
29+
matcher:
30+
baseBranch: '^ospp-2024/.*'

.github/workflows/auto-label.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Auto Label (Pull Request)
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
label:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: fuxingloh/[email protected]
16+
with:
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
config-path: .github/labeler.yaml

examples/sites/demos/apis/checkbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export default {
145145
type: "'medium' | 'small' | 'mini'",
146146
defaultValue: '',
147147
desc: {
148-
'zh-CN': 'checkbox 的尺寸,仅在 border 为真时有效',
148+
'zh-CN': 'checkbox 的尺寸,仅在 border 为true时有效',
149149
'en-US': 'Checkbox size. This parameter is valid only when border is set to true'
150150
},
151151
mode: ['pc', 'mobile-first'],
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
<template>
22
<tiny-badge is-dot>小圆点显示</tiny-badge>
3+
<br /><br />
4+
<tiny-badge is-dot>
5+
<template #default>
6+
<tiny-button type="text" :icon="TinyIconMail"> </tiny-button>
7+
</template>
8+
</tiny-badge>
39
</template>
410

511
<script setup>
612
import { Badge as TinyBadge } from '@opentiny/vue'
13+
import { iconMail } from '@opentiny/vue-icon'
14+
import { Button as TinyButton } from '@opentiny/vue'
15+
16+
const TinyIconMail = iconMail()
717
</script>

examples/sites/demos/pc/app/badge/is-dot.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ test('小圆点标记', async ({ page }) => {
44
page.on('pageerror', (exception) => expect(exception).toBeNull())
55
await page.goto('badge#is-dot')
66

7-
const demo = page.locator('#is-dot')
8-
const badge = demo.locator('.tiny-badge')
7+
const demo = page
8+
.locator('div')
9+
.filter({ hasText: /^$/ })
10+
.first()
11+
const badge = demo.locator('.tiny-badge').first()
912

1013
await expect(badge).toHaveClass(/tiny-badge--default/)
1114
await expect(badge).toHaveCSS('width', '6px')
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
<template>
22
<tiny-badge is-dot>小圆点显示</tiny-badge>
3+
<br /><br />
4+
<tiny-badge is-dot>
5+
<template #default>
6+
<tiny-button type="text" :icon="TinyIconMail"> </tiny-button>
7+
</template>
8+
</tiny-badge>
39
</template>
410

511
<script>
612
import { Badge } from '@opentiny/vue'
13+
import { Button } from '@opentiny/vue'
14+
import { iconMail } from '@opentiny/vue-icon'
715
816
export default {
917
components: {
18+
TinyButton: Button,
1019
TinyBadge: Badge
20+
},
21+
data() {
22+
return {
23+
TinyIconMail: iconMail()
24+
}
1125
}
1226
}
1327
</script>

examples/sites/demos/pc/app/badge/max-composition-api.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<template>
2-
<tiny-badge :value="5" :max="2">最大值显示</tiny-badge>
2+
<tiny-badge :value="10" :max="9">最大值显示</tiny-badge>
3+
<br />
4+
<tiny-badge value="100" :max="99" data="我的待办"></tiny-badge>
5+
<br />
6+
<tiny-badge value="1000" :max="999" data="我的待办"></tiny-badge>
37
</template>
48

59
<script setup>

examples/sites/demos/pc/app/badge/max.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test('计数最大值', async ({ page }) => {
55
await page.goto('badge#max')
66

77
const demo = page.locator('#max')
8-
const badge = demo.locator('.tiny-badge')
8+
const badge = demo.locator('.tiny-badge').first()
99

10-
await expect(badge).toContainText('2+')
10+
await expect(badge).toContainText('9+')
1111
})

examples/sites/demos/pc/app/badge/max.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<template>
2-
<tiny-badge :value="5" :max="2">最大值显示</tiny-badge>
2+
<template>
3+
<tiny-badge :value="10" :max="9">最大值显示</tiny-badge>
4+
<br />
5+
<tiny-badge value="100" :max="99" data="我的待办"></tiny-badge>
6+
<br />
7+
<tiny-badge value="1000" :max="999" data="我的待办"></tiny-badge>
8+
</template>
39
</template>
410

511
<script>

examples/sites/demos/pc/app/badge/offset-composition-api.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<div>
33
<p>使用字符串:</p>
44
<br />
5-
<tiny-badge :value="2" :offset="['0', '-50%']">我的待办</tiny-badge>
5+
<tiny-badge :value="2" :offset="['0', '-20%']">我的待办</tiny-badge>
66
<br /><br />
77
<p>使用数字:</p>
88
<br />
9-
<tiny-badge :value="2" :offset="[0, -10]">我的待办</tiny-badge>
9+
<tiny-badge :value="2" :offset="[0, -6]">我的待办</tiny-badge>
1010
</div>
1111
</template>
1212

examples/sites/demos/pc/app/badge/offset.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ test('标记的位置', async ({ page }) => {
77
const demo = page.locator('#offset')
88
const badge = demo.locator('.tiny-badge')
99

10-
await expect(badge.first()).toHaveCSS('transform', 'matrix(1, 0, 0, 1, 0, -10)')
11-
await expect(badge.nth(1)).toHaveCSS('transform', 'matrix(1, 0, 0, 1, 0, -10)')
10+
await expect(badge.first()).toHaveCSS('transform', 'matrix(1, 0, 0, 1, 0, -4)')
11+
await expect(badge.nth(1)).toHaveCSS('transform', 'matrix(1, 0, 0, 1, 0, -6)')
1212
})

examples/sites/demos/pc/app/badge/offset.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<div>
33
<p>使用字符串:</p>
44
<br />
5-
<tiny-badge :value="2" :offset="['0', '-50%']">我的待办</tiny-badge>
5+
<tiny-badge :value="2" :offset="['0', '-20%']">我的待办</tiny-badge>
66
<br /><br />
77
<p>使用数字:</p>
88
<br />
9-
<tiny-badge :value="2" :offset="[0, -10]">我的待办</tiny-badge>
9+
<tiny-badge :value="2" :offset="[0, -6]">我的待办</tiny-badge>
1010
</div>
1111
</template>
1212

examples/sites/demos/pc/app/button-group/border-composition-api.vue

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/sites/demos/pc/app/button-group/border.spec.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/sites/demos/pc/app/button-group/border.vue

Lines changed: 0 additions & 23 deletions
This file was deleted.

examples/sites/demos/pc/app/button-group/sup-composition-api.vue

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
<template>
22
<div class="demo-button">
33
<p>原生及插槽</p>
4-
<tiny-button-group :data="groupData" v-model="checkedVal">
5-
<template #button4="{ sup }">
6-
<tiny-icon-plus-circle></tiny-icon-plus-circle>
7-
<span>
8-
{{ sup.text }}
9-
</span>
10-
</template>
11-
</tiny-button-group>
4+
<div class="sup">
5+
<tiny-button-group :data="groupData" v-model="checkedVal">
6+
<template #button4="{ sup }">
7+
<tiny-icon-plus-circle></tiny-icon-plus-circle>
8+
<span>
9+
{{ sup.text }}
10+
</span>
11+
</template>
12+
</tiny-button-group>
13+
</div>
1214
<br /><br />
1315
<p>插槽引用tag角标</p>
14-
<tiny-button-group :data="groupDataTag" v-model="checkedVal">
15-
<template #btn="{ sup }">
16-
<tiny-tag type="warning" size="small" hit>
17-
<component :is="sup.icon" class="tiny-svg-size"></component>
18-
{{ sup.text }}
19-
</tiny-tag>
20-
</template>
21-
</tiny-button-group>
16+
<div class="tag">
17+
<tiny-button-group :data="groupDataTag" v-model="checkedVal">
18+
<template #btn="{ sup }">
19+
<tiny-tag type="warning" size="small" hit>
20+
<component :is="sup.icon" class="tiny-svg-size"></component>
21+
{{ sup.text }}
22+
</tiny-tag>
23+
</template>
24+
</tiny-button-group>
25+
</div>
2226
</div>
2327
</template>
2428

@@ -32,31 +36,31 @@ const TinyIconPlusCircle = iconPlusCircle()
3236
const checkedVal = ref('Button1')
3337
const groupData = ref([
3438
{
35-
text: '1年',
39+
text: '文字',
3640
value: 'Button1',
3741
sup: {
3842
class: ['success-bg'],
3943
text: '特惠'
4044
}
4145
},
4246
{
43-
text: '2年',
47+
text: '图标',
4448
value: 'Button2',
4549
sup: {
4650
class: 'sup-icon',
4751
icon: iconSearch()
4852
}
4953
},
5054
{
51-
text: '3年',
55+
text: '文字',
5256
value: 'Button3',
5357
sup: {
5458
class: 'sup-text',
5559
text: '8折'
5660
}
5761
},
5862
{
59-
text: '4年',
63+
text: '组合',
6064
value: 'Button4',
6165
sup: {
6266
slot: 'button4',
@@ -67,7 +71,7 @@ const groupData = ref([
6771
])
6872
const groupDataTag = ref([
6973
{
70-
text: '1年',
74+
text: '文本',
7175
value: 'Button1',
7276
sup: {
7377
slot: 'btn',
@@ -76,7 +80,7 @@ const groupDataTag = ref([
7680
}
7781
},
7882
{
79-
text: '2年',
83+
text: '图标',
8084
value: 'Button2',
8185
sup: {
8286
slot: 'btn',
@@ -85,7 +89,7 @@ const groupDataTag = ref([
8589
}
8690
},
8791
{
88-
text: '3年',
92+
text: '图标',
8993
value: 'Button3',
9094
sup: {
9195
slot: 'btn',
@@ -94,7 +98,7 @@ const groupDataTag = ref([
9498
}
9599
},
96100
{
97-
text: '4年',
101+
text: '组合',
98102
value: 'Button4',
99103
sup: {
100104
slot: 'btn',
@@ -128,9 +132,18 @@ const groupDataTag = ref([
128132
</style>
129133

130134
<style>
131-
.demo-button button {
135+
.demo-button .sup button {
136+
width: 84px;
137+
}
138+
.demo-button .sup li:nth-of-type(4) button {
132139
width: 124px;
133140
}
141+
.demo-button .tag button {
142+
width: 84px;
143+
}
144+
.demo-button .tag li:last-child button {
145+
width: 120px;
146+
}
134147
.demo-button p {
135148
margin-bottom: 8px;
136149
}

0 commit comments

Comments
 (0)