Skip to content
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

fix(time-range): [date-picker,time-picker,select,action-menu] optimization demo and modify style for time-range #2481

Merged
merged 3 commits into from
Nov 5, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<p>场景1:只显示图标</p>
<p>场景1:显示图标</p>
<tiny-action-menu
class="custom-icon"
:options="options"
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/action-menu/icon.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<p>场景1:只显示图标</p>
<p>场景1:显示图标</p>
<tiny-action-menu
class="custom-icon"
:options="options"
Expand Down
8 changes: 4 additions & 4 deletions examples/sites/demos/pc/app/select/size-composition-api.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div>
<p>默认</p>
<p>medium</p>
<br />
<tiny-select v-model="value1" multiple :options="options"></tiny-select>
<tiny-select v-model="value2" size="medium" multiple :options="options"></tiny-select>
<br />
<br />
<p>medium</p>
<p>默认</p>
<br />
<tiny-select v-model="value2" size="medium" multiple :options="options"></tiny-select>
<tiny-select v-model="value1" multiple :options="options"></tiny-select>
<br />
<br />
<p>small</p>
Expand Down
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/select/size.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('默认尺寸', async ({ page }) => {
await page.goto('select#size')

const wrap = page.locator('#size')
const select = wrap.locator('.tiny-select').nth(0)
const select = wrap.locator('.tiny-select').nth(1)
const input = select.locator('.tiny-input')
const tag = select.locator('.tiny-tag')

Expand All @@ -18,12 +18,12 @@ test('medium 尺寸', async ({ page }) => {
await page.goto('select#size')

const wrap = page.locator('#size')
const select = wrap.locator('.tiny-select').nth(1)
const select = wrap.locator('.tiny-select').nth(0)
const input = select.locator('.tiny-input')
const tag = select.locator('.tiny-tag')

await expect(input).toHaveClass(/tiny-input-medium/)
// TODO: 此处继承input 尺寸的话,应该是32

await expect(input.locator('.tiny-input__inner')).toHaveCSS('height', '40px')
await expect(tag.nth(0)).toHaveClass(/tiny-tag--medium tiny-tag--light/)
})
Expand Down
8 changes: 4 additions & 4 deletions examples/sites/demos/pc/app/select/size.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div>
<p>默认</p>
<p>medium</p>
<br />
<tiny-select v-model="value1" multiple :options="options"></tiny-select>
<tiny-select v-model="value2" size="medium" multiple :options="options"></tiny-select>
<br />
<br />
<p>medium</p>
<p>默认</p>
<br />
<tiny-select v-model="value2" size="medium" multiple :options="options"></tiny-select>
<tiny-select v-model="value1" multiple :options="options"></tiny-select>
<br />
<br />
<p>small</p>
Expand Down
23 changes: 7 additions & 16 deletions packages/theme/src/time-range/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
&__content {
position: relative;
text-align: center;
padding: var(--tv-TimeRange-content-padding);
display: flex;
justify-content: flex-start;
align-items: flex-start;
Expand All @@ -39,31 +38,26 @@
display: flex;
justify-content: space-around;
color: var(--tv-TimeRange-header-text-color);
padding: 8px;
height: 30px;
padding: var(--tv-TimeRange-title-padding);
align-items: center;
line-height: 30px;
}

&__cell {
box-sizing: border-box;
margin: 0;
padding: var(--tv-TimeRange-cell-padding);
width: 50%;

.tiny-time-panel__content {
padding-bottom: var(--tv-TimeRange-cell-content-padding-bottom);
}
}

&__header {
height: var(--tv-TimeRange-header-height);
color: var(--tv-TimeRange-header-text-color);
line-height: var(--tv-TimeRange-header-line-height);
margin-bottom: var(--tv-TimeRange-header-margin-bottom);
padding: var(--tv-TimeRange-header-padding);
text-align: left;
font-size: var(--tv-TimeRange-font-size);
border-bottom: 1px solid var(--tv-TimeRange-header-border-bottom);

span {
margin-left: var(--tv-TimeRange-header-margin-left);
}
border-bottom: 1px solid var(--tv-TimeRange-border-color-divider);
}

&__body {
Expand All @@ -73,9 +67,6 @@
&__footer {
border-top: 1px solid var(--tv-TimeRange-border-color-divider);
padding: var(--tv-TimeRange-footer-padding);
height: var(--tv-TimeRange-footer-height);
box-sizing: border-box;
margin-top: 12px;
display: flex;
justify-content: flex-end;
align-items: center;
Expand Down
22 changes: 10 additions & 12 deletions packages/theme/src/time-range/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,25 @@
--tv-TimeRange-border-color-divider: var(--tv-color-border-divider, #f0f0f0);

// 单元格内间距
--tv-TimeRange-cell-padding: 0px;
// 内容区内间距
--tv-TimeRange-content-padding: 0px;
--tv-TimeRange-cell-content-padding-bottom: var(--tv-space-xl, 16px);

// 头部高度
--tv-TimeRange-header-height: var(--tv-size-height-xl, 48px);
// 头部行高
--tv-TimeRange-header-line-height: calc(var(--tv-size-height-xl, 48px) - 2px);
// 头部底部外间距
--tv-TimeRange-header-margin-bottom: 0px;
--tv-TimeRange-header-line-height: var(--tv-TimeRange-header-height, 48px);

// 头部文本色
--tv-TimeRange-header-text-color: var(--tv-color-text-weaken, #808080);
// 头部右侧外间距
--tv-TimeRange-header-margin-left: var(--tv-space-xl, 16px);
// 头部内间距
--tv-TimeRange-header-padding: 0 var(--tv-space-xl, 16px);
// 标题内间距
--tv-TimeRange-title-padding: var(--tv-space-lg, 12px) var(--tv-space-md, 8px) var(--tv-space-md, 8px)
var(--tv-space-md, 8px);

// 底部高度
--tv-TimeRange-footer-height: 56px;
// 底部内间距
--tv-TimeRange-footer-padding: var(--tv-space-xl, 16px) var(--tv-space-xl, 16px) 0 0;
--tv-TimeRange-footer-padding: var(--tv-space-xl, 16px);

//按钮内间距
// 按钮内间距
--tv-TimeRange-btn-padding: 0 var(--tv-space-sm, 4px);
// 按钮高度
--tv-TimeRange-btn-height: var(--tv-size-height-sm, 28px);
Expand Down
Loading