Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion examples/sites/demos/pc/app/search/mini-mode-composition-api.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<template>
<tiny-search mini></tiny-search>
<div>
<tiny-search mini></tiny-search>
<tiny-search mini class="mt24 custom-search"></tiny-search>
</div>
</template>

<script setup lang="jsx">
import { Search as TinySearch } from '@opentiny/vue'
</script>

<style scoped>
:deep(.tiny-search.custom-search.collapse .tiny-search__line) {
border: none;
}
</style>
3 changes: 2 additions & 1 deletion examples/sites/demos/pc/app/search/mini-mode.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ test('迷你模式', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('search#mini-mode')

const search = page.locator('.tiny-search.mini')
const container = page.locator('#mini-mode')
const search = container.locator('.tiny-search.mini').first()
const blank = page.getByRole('code').first()
const line = search.locator('.tiny-search__line')
const input = search.locator('.tiny-search__input')
Expand Down
11 changes: 10 additions & 1 deletion examples/sites/demos/pc/app/search/mini-mode.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<tiny-search mini></tiny-search>
<div>
<tiny-search mini></tiny-search>
<tiny-search mini class="mt24 custom-search"></tiny-search>
</div>
</template>

<script lang="jsx">
Expand All @@ -11,3 +14,9 @@ export default {
}
}
</script>

<style scoped>
:deep(.tiny-search.custom-search.collapse .tiny-search__line) {
border: none;
}
</style>
18 changes: 18 additions & 0 deletions packages/theme/src/search/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,24 @@
}
}

// tiny新增
& &__input-btn.@{css-prefix}icon-close {
margin-right: var(--ti-search-input-btn-close-margin-right);

& a::after {
content: '';
display: var(--ti-search-input-btn-close-display);
position: absolute;
top: 50%;
right: 7px;
transform: translateY(-50%);
width: 1px;
height: 16px;
background-color: #000000;
opacity: 8%;
}
}

& &__input-btn {
text-align: center;

Expand Down
5 changes: 4 additions & 1 deletion packages/theme/src/search/smb-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ export const tinySearchSmbTheme = {
'ti-search-selector-box-shadow': 'var(--ti-common-shadow-3-up)',
'ti-search-input-btn-icon-size': 'var(--ti-common-font-size-2)',
'ti-search-input-placeholder-text-color': 'var(--ti-common-color-placeholder)',
'ti-search-input-left-svg-margin-right': 'calc(0px - var(--ti-common-space-2x))'
'ti-search-input-left-svg-margin-right': 'calc(0px - var(--ti-common-space-2x))',
'ti-search-input-btn-width': 'var(--ti-common-size-7x)',
'ti-search-input-btn-close-display': 'inline-block',
'ti-search-input-btn-close-margin-right': '-3px'
}
4 changes: 4 additions & 0 deletions packages/theme/src/search/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
--ti-search-input-btn-icon-size: var(--ti-common-font-size-1, 14px);
// 搜索按钮宽度(hide)
--ti-search-input-btn-width: var(--ti-common-size-6x, 24px);
// 搜索关闭按钮右边距(hide)
--ti-search-input-btn-close-margin-right: var(--ti-common-space-0, 0px);
// 搜索关闭按钮显示方式(hide)
--ti-search-input-btn-close-display: none;
// 搜索框按钮行高(hide)
--ti-search-input-btn-line-height: var(--ti-search-input-height);
// 搜索图标边框色(hide)
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/search/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
:tabindex="tabindex"
/>
<transition name="tiny-transition-icon-scale-in">
<div class="tiny-search__input-btn" v-if="state.showClear && !state.collapse">
<div class="tiny-search__input-btn tiny-icon-close" v-if="state.showClear && !state.collapse">
<a @click="clear($event)">
<icon-close @mousedown.prevent class="tiny-svg-size" />
</a>
Expand Down