Skip to content
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
12 changes: 6 additions & 6 deletions examples/sites/demos/pc/app/calendar-view/calendar-event.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ import { test, expect } from '@playwright/test'
test('事件', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('calendar-view#calendar-event')
const timeInput = page.locator('.tiny-filter-box').locator('.value')
const timeBtn = page.getByText('2023 年 05 月')
const timeInput = page.locator('.tiny-calendar-view').locator('.tiny-input__inner')
const timeBtn = page.getByRole('textbox', { name: '年 05 月' })
const leftYear = page.getByRole('button', { name: '前一年' })
const month6 = page.getByText('六月')
const leftSvg = page.locator('.header-left > .tiny-svg')
const rightSvg = page.locator('.header-right > .tiny-svg')
const mode = page.locator('label').nth(2)
const modalVal = page.getByText('模式切换事件: timeline')
const modalVal = page.getByText('模式切换事件: schedule')
await timeBtn.click()
await page.waitForTimeout(100)
await leftYear.click()
await page.waitForTimeout(100)
await month6.click()
await page.waitForTimeout(100)
await expect(timeInput).toHaveText('2022 年 06 月')
await expect(timeInput).toHaveAttribute('title', '2022 年 06 月')
await leftSvg.click()
await page.waitForTimeout(100)
await expect(timeInput).toHaveText('2022 年 05 月')
await expect(timeInput).toHaveAttribute('title', '2022 年 05 月')
await rightSvg.click()
await page.waitForTimeout(100)
await expect(timeInput).toHaveText('2022 年 06 月')
await expect(timeInput).toHaveAttribute('title', '2022 年 06 月')
await mode.click()
await page.waitForTimeout(100)
await expect(modalVal).toBeVisible()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { test, expect } from '@playwright/test'
test('显示模式', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('calendar-view#calendar-mode')
const monthBtn = page.locator('label').nth(1)
const timelineBtn = page.locator('label').nth(2)
const scheduleBtn = page.locator('label').nth(3)
const monthBtn = page.getByLabel('示例', { exact: true }).locator('label').first()
const timelineBtn = page.getByLabel('示例', { exact: true }).locator('label').nth(1)
const scheduleBtn = page.getByLabel('示例', { exact: true }).locator('label').nth(2)
const dmonthDom = page.locator('.tiny-calendar-view-month__main')
const timelineDom = page.locator('.tiny-calendar-view-week__timeline')
const scheduleDom = page.locator('.tiny-calendar-view-week__schedule')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('自定义头部显示', async ({ page }) => {
await page.goto('calendar-view#custom-header')

const demo = page.locator('#custom-header')
const timelineBtn = demo.locator('label').nth(3)
const timelineBtn = page.getByLabel('示例', { exact: true }).locator('label').nth(2)
const customHeader = demo.getByText('2023-5-3 周三')
await timelineBtn.click()
await page.waitForTimeout(200)
Expand Down
6 changes: 3 additions & 3 deletions packages/theme/src/calendar-view/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -675,18 +675,18 @@
margin-bottom: 6px;
border-left-width: 2px;
border-left-color: #1890ff;
font-weight: var(--ti-calendar-view-tooltip-title-font-weight);
}

.date{
margin-bottom: 6px;
padding: 0 8px;
color: #8d959e;
font-weight: var(--ti-calendar-view-tooltip-title-font-weight);
color: var(--ti-calendar-view-tooltip-date-text-color, #8d959e);
}

.content{
padding: 0 8px;
color: var(--ti-calendar-view-tooltip-content-color);
color: var(--ti-calendar-view-tooltip-content-text-color, #8d959e);
}
}
}
4 changes: 2 additions & 2 deletions packages/theme/src/calendar-view/smb-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const tinyCalendarViewSmbTheme = {
'ti-calendar-view-header-main-text-color': 'var(--ti-common-color-text-weaken)',
'ti-calendar-view-tooltip-title-font-size': 'var(--ti-common-font-size-2)',
'ti-calendar-view-tooltip-title-font-weight': 'var(--ti-common-font-weight-bold)',
'ti-calendar-view-tooltip-content-color': 'var(--ti-common-color-text-primary)',
'ti-calendar-view-tooltip-date-color': 'var(--ti-common-color-text-secondary)',
'ti-calendar-view-tooltip-content-text-color': 'var(--ti-common-color-text-primary)',
'ti-calendar-view-tooltip-date-text-color': 'var(--ti-common-color-text-secondary)',
'ti-calendar-view-day-selected-border-radius': 'unset',
'ti-calendar-view-day-selected-svg-right': 'unset',
'ti-calendar-view-day-selected-svg-top': 'unset',
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/src/calendar-view/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
// 提示
--ti-calendar-view-tooltip-title-font-size: var(--ti-common-font-size-base);
--ti-calendar-view-tooltip-title-font-weight: var(--ti-common-font-weight-5);
--ti-calendar-view-tooltip-date-color: #8d959e;
--ti-calendar-view-tooltip-content-color: #8d959e;
--ti-calendar-view-tooltip-date-text-color: #8d959e;
--ti-calendar-view-tooltip-content-text-color: #8d959e;
// 箭头
--ti-calendar-view-header-left-svg-fill: unset;
--ti-calendar-view-header-right-svg-fill: unset;
Expand Down
1 change: 1 addition & 0 deletions packages/theme/src/theme.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default {
'color-select-panel': 'color-select-panel',
'color-picker': 'color-picker',
'calendar-view': 'calendar-view',
'calendar-view-tooltip': 'calendar-view-tooltip',
'detail-page': 'detail-page',
'dialog-box': 'dialog-box__wrapper',
'dropdown-item': 'dropdown-item',
Expand Down
5 changes: 2 additions & 3 deletions packages/vue/src/calendar-view/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<tiny-date-picker
v-model="state.currentDate"
class="tiny-calendar-view__picker"
shape="filter"
type="month"
:clearable="false"
@change="currentDateChange"
Expand Down Expand Up @@ -60,8 +59,8 @@
day.isLast || day.isNext
? 'is-next-or-last'
: isToday(day) || isSelectedDate(day)
? 'is-selected'
: '',
? 'is-selected'
: '',
day.disabled ? 'is-disabled' : ''
]"
>
Expand Down