Skip to content

refactor(tree-menu): [tree-menu] refactor tree-menu thems vars #2123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
2aa16c6
feat(tree-menu): [tree-menu] updata tree-menu xdesign
wuyiping0628 Sep 11, 2024
373d3a6
Merge branch 'dev' of github.com:opentiny/tiny-vue into wyp/tree-menu…
wuyiping0628 Sep 11, 2024
de5f0a2
feat(tree-menu): [tree-menu] updata tree-menu xdesign
wuyiping0628 Sep 11, 2024
fdbd5b7
Merge branch 'dev' of github.com:opentiny/tiny-vue into wyp/tree-menu…
wuyiping0628 Sep 11, 2024
9899092
fix(tree-menu): [tree-menu] fix tree-menu bug
wuyiping0628 Sep 11, 2024
7e91dbd
Merge branch 'dev' of github.com:opentiny/tiny-vue into wyp/tree-menu…
wuyiping0628 Sep 12, 2024
4686dac
feat(tree-menu): [tree-menu] updata tree-menu xdesign
wuyiping0628 Sep 12, 2024
52ae38b
Merge branch 'dev' of github.com:opentiny/tiny-vue into wyp/tree-menu…
wuyiping0628 Sep 12, 2024
58824be
feat(tree-menu): [tree-menu] updata tree-menu xdesign
wuyiping0628 Sep 13, 2024
874e4dd
Merge branch 'dev' of github.com:opentiny/tiny-vue into wyp/tree-menu…
wuyiping0628 Sep 13, 2024
05a0ce5
Merge branch 'dev' of github.com:opentiny/tiny-vue into wyp/tree-menu…
wuyiping0628 Sep 18, 2024
71c67c2
feat(tree-menu): [tree-menu] conflict resolution
wuyiping0628 Oct 16, 2024
bf7442c
feat(tree-menu): [tree-menu] conflict resolution
wuyiping0628 Oct 16, 2024
1e1ab96
refactor(tree-menu): [tree-menu] refactor tree-menu thems vars
wuyiping0628 Oct 17, 2024
ccfd767
Merge branch 'dev' of github.com:opentiny/tiny-vue into wyp/tree-menu…
wuyiping0628 Oct 17, 2024
5f7e38b
refactor(tree-menu): [tree-menu] refactor tree-menu thems vars
wuyiping0628 Oct 17, 2024
eed2871
refactor(tree-menu): [tree-menu] refactor tree-menu thems vars
wuyiping0628 Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<tiny-tree-menu placeholder="请输入内容进行筛选"></tiny-tree-menu>
<tiny-tree-menu placeholder="输入关键字搜索"></tiny-tree-menu>
</template>

<script setup>
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/tree-menu/basic-usage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<tiny-tree-menu placeholder="请输入内容进行筛选"></tiny-tree-menu>
<tiny-tree-menu placeholder="输入关键字搜索"></tiny-tree-menu>
</template>

<script>
Expand Down
7 changes: 3 additions & 4 deletions examples/sites/demos/pc/app/tree-menu/clearable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ test('搜索框可清除', async ({ page }) => {

await page.goto('tree-menu#clearable')

await page.locator('#clearable').getByRole('textbox', { name: '请输入内容进行筛选' }).click()
await page.locator('#clearable').getByRole('textbox', { name: '请输入内容进行筛选' }).click()
await page.locator('#clearable').getByRole('textbox', { name: '请输入内容进行筛选' }).fill('123')
await page.locator('#clearable').getByRole('textbox', { name: '输入关键字搜索' }).click()
await page.locator('#clearable').getByRole('textbox', { name: '输入关键字搜索' }).fill('123')
await expect(page.getByText('暂无数据')).toBeVisible()
const icon = getIcon(page)
await icon.click()
const val = await page.locator('#clearable').getByRole('textbox', { name: '请输入内容进行筛选' }).inputValue()
const val = await page.locator('#clearable').getByRole('textbox', { name: '输入关键字搜索' }).inputValue()
expect(val).toBe('')
await expect(page.getByText('暂无数据')).not.toBeVisible()
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<tiny-tree-menu
class="demo-tree-menu"
node-key="id"
:data="treeData"
:default-checked-keys="expandeArr"
Expand Down Expand Up @@ -170,8 +171,8 @@ const treeData = ref([
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
</style>
5 changes: 3 additions & 2 deletions examples/sites/demos/pc/app/tree-menu/default-expand-all.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<tiny-tree-menu
class="demo-tree-menu"
node-key="id"
:data="treeData"
:default-checked-keys="expandeArr"
Expand Down Expand Up @@ -178,8 +179,8 @@ export default {
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
</style>
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<tiny-tree-menu :data="treeData" node-key="id" :default-expanded-keys="expandeArr"></tiny-tree-menu>
<tiny-tree-menu
class="demo-tree-menu"
:data="treeData"
node-key="id"
:default-expanded-keys="expandeArr"
></tiny-tree-menu>
</template>

<script setup>
Expand Down Expand Up @@ -112,8 +117,8 @@ const treeData = ref([
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div>
<tiny-button @click="changeHighlight" type="primary">设置展开并高亮</tiny-button>
<tiny-tree-menu
class="demo-tree-menu"
node-key="id"
:data="treeData"
:default-expanded-keys="expandeArr"
Expand Down Expand Up @@ -128,8 +129,8 @@ const changeHighlight = () => {
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
.tiny-button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div>
<tiny-button @click="changeHighlight" type="primary">设置展开并高亮</tiny-button>
<tiny-tree-menu
class="demo-tree-menu"
node-key="id"
:data="treeData"
:default-expanded-keys="expandeArr"
Expand Down Expand Up @@ -142,8 +143,8 @@ export default {
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
.tiny-button {
Expand Down
12 changes: 6 additions & 6 deletions examples/sites/demos/pc/app/tree-menu/default-expanded-keys.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<tiny-tree-menu :data="treeData" node-key="id" :default-expanded-keys="expandeArr"> </tiny-tree-menu>
<tiny-tree-menu class="demo-tree-menu" :data="treeData" node-key="id" :default-expanded-keys="expandeArr">
</tiny-tree-menu>
</template>

<script>
import { TreeMenu, Button } from '@opentiny/vue'
import { TreeMenu } from '@opentiny/vue'

export default {
components: {
TinyTreeMenu: TreeMenu,
TinyButton: Button
TinyTreeMenu: TreeMenu
},
data() {
return {
Expand Down Expand Up @@ -121,8 +121,8 @@ export default {
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
</style>
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/tree-menu/draggable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('拖动菜单', async ({ page }) => {

await page.mouse.move(x0, y0)
await page.mouse.down()
await page.mouse.move(x0, y0 + 80)
await page.mouse.move(x0, y0 + 64)
await page.mouse.up()

await node.hover()
Expand All @@ -41,7 +41,7 @@ test('拖动菜单', async ({ page }) => {

await page.mouse.move(x2, y2)
await page.mouse.down()
await page.mouse.move(x2, y2 + 80)
await page.mouse.move(x2, y2 + 64)
await page.mouse.up()
await expect(treeMenu.getByRole('treeitem', { name: '指南' }).getByRole('treeitem', { name: '首页' })).toBeVisible()
})
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div>
<p>场景1:默认点击文字展开菜单</p>
<tiny-tree-menu :data="treeData"></tiny-tree-menu>
<tiny-tree-menu class="demo-tree-menu" :data="treeData"></tiny-tree-menu>
<br /><br />
<p>场景2:点击展开按钮才可展开菜单</p>
<tiny-tree-menu :data="treeData" :expand-on-click-node="false"></tiny-tree-menu>
<tiny-tree-menu class="demo-tree-menu" :data="treeData" :expand-on-click-node="false"></tiny-tree-menu>
</div>
</template>

Expand Down Expand Up @@ -169,8 +169,8 @@ const treeData = ref([
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
p {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div>
<p>场景1:默认点击文字展开菜单</p>
<tiny-tree-menu :data="treeData"></tiny-tree-menu>
<tiny-tree-menu class="demo-tree-menu" :data="treeData"></tiny-tree-menu>
<br /><br />
<p>场景2:点击展开按钮才可展开菜单</p>
<tiny-tree-menu :data="treeData" :expand-on-click-node="false"></tiny-tree-menu>
<tiny-tree-menu class="demo-tree-menu" :data="treeData" :expand-on-click-node="false"></tiny-tree-menu>
</div>
</template>

Expand Down Expand Up @@ -181,8 +181,8 @@ export default {
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
p {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ test('菜单可折叠', async ({ page }) => {
await expect(treeMenu).toHaveCSS('width', '0px')
await toggleBtn.click()
await expect(treeMenu).not.toHaveClass(/is-collapsed/)
await expect(treeMenu).toHaveCSS('width', '270px')
await expect(treeMenu).toHaveCSS('width', '220px')
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<tiny-tree-menu :data="treeData" :props="mapField"></tiny-tree-menu>
<tiny-tree-menu class="demo-tree-menu" :data="treeData" :props="mapField"></tiny-tree-menu>
</template>

<script setup>
Expand Down Expand Up @@ -122,8 +122,8 @@ const treeData = reactive([
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
</style>
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<template>
<div>
<p>场景1:节点可勾选 + 默认选中</p>
<tiny-tree-menu node-key="id" show-checkbox :data="treeData" :default-checked-keys="expandeArr"></tiny-tree-menu>
<tiny-tree-menu
class="demo-tree-menu"
node-key="id"
show-checkbox
:data="treeData"
:default-checked-keys="expandeArr"
></tiny-tree-menu>
<br /><br />
<p>场景2:节点可勾选 + 父子级不相关联</p>
<tiny-tree-menu :data="treeData" show-checkbox check-strictly></tiny-tree-menu>
<tiny-tree-menu class="demo-tree-menu" :data="treeData" show-checkbox check-strictly></tiny-tree-menu>
</div>
</template>

Expand Down Expand Up @@ -170,8 +176,8 @@ const treeData = ref([
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
p {
Expand Down
14 changes: 10 additions & 4 deletions examples/sites/demos/pc/app/tree-menu/show-checkbox.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<template>
<div>
<p>场景1:节点可勾选 + 默认选中</p>
<tiny-tree-menu node-key="id" show-checkbox :data="treeData" :default-checked-keys="expandeArr"></tiny-tree-menu>
<tiny-tree-menu
class="demo-tree-menu"
node-key="id"
show-checkbox
:data="treeData"
:default-checked-keys="expandeArr"
></tiny-tree-menu>
<br /><br />
<p>场景2:节点可勾选 + 父子级不相关联</p>
<tiny-tree-menu :data="treeData" show-checkbox check-strictly></tiny-tree-menu>
<tiny-tree-menu class="demo-tree-menu" :data="treeData" show-checkbox check-strictly></tiny-tree-menu>
</div>
</template>

Expand Down Expand Up @@ -179,8 +185,8 @@ export default {
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
p {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
<tiny-radio label="hide"> 默认不变 </tiny-radio>
</tiny-radio-group>
</div>
<tiny-tree-menu :highlight-query="highlightQuery === 'show'" :data="treeData"></tiny-tree-menu>
<tiny-tree-menu
class="demo-tree-menu"
:highlight-query="highlightQuery === 'show'"
:data="treeData"
></tiny-tree-menu>
<br /><br />
<p>场景2:不可过滤 + 不设置原生 title 属性</p>
<tiny-tree-menu :data="treeData" :show-filter="false" :show-title="false"></tiny-tree-menu>
<tiny-tree-menu class="demo-tree-menu" :data="treeData" :show-filter="false" :show-title="false"></tiny-tree-menu>
</div>
</template>

Expand Down Expand Up @@ -178,8 +182,8 @@ const treeData = ref([
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
p {
Expand Down
12 changes: 8 additions & 4 deletions examples/sites/demos/pc/app/tree-menu/show-filter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
<tiny-radio label="hide"> 默认不变 </tiny-radio>
</tiny-radio-group>
</div>
<tiny-tree-menu :highlight-query="highlightQuery === 'show'" :data="treeData"></tiny-tree-menu>
<tiny-tree-menu
class="demo-tree-menu"
:highlight-query="highlightQuery === 'show'"
:data="treeData"
></tiny-tree-menu>
<br /><br />
<p>场景2:不可过滤 + 不设置原生 title 属性</p>
<tiny-tree-menu :data="treeData" :show-filter="false" :show-title="false"></tiny-tree-menu>
<tiny-tree-menu class="demo-tree-menu" :data="treeData" :show-filter="false" :show-title="false"></tiny-tree-menu>
</div>
</template>

Expand Down Expand Up @@ -187,8 +191,8 @@ export default {
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
p {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<tiny-tree-menu
class="demo-tree-menu"
:data="treeData"
default-expand-all
show-number
Expand Down Expand Up @@ -124,8 +125,8 @@ const treeData = reactive([
</script>

<style lang="less" scoped>
.tiny-tree-menu {
height: 300px;
.demo-tree-menu ::v-deep .tiny-tree {
height: 320px;
overflow: auto;
}
p {
Expand Down
Loading
Loading