Skip to content

Commit

Permalink
fix(date-picker): fix date-picker style was covered by table (#4925)
Browse files Browse the repository at this point in the history
* fix(date-picker): fix date-picker style was covered by table

closed #4900

* chore: update common

* chore: update snapshot

---------

Co-authored-by: naishwang <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 22, 2025
1 parent fbdf231 commit 6a21dbe
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 48 deletions.
14 changes: 8 additions & 6 deletions src/date-picker/base/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineComponent, PropType, computed } from 'vue';
import TDatePickerCell from './Cell';
import isArray from 'lodash/isArray';
import { computed, defineComponent, PropType } from 'vue';
import { parseToDayjs } from '../../_common/js/date-picker/format';
import { useConfig, usePrefixClass } from '../../hooks/useConfig';
import type { TdDatePickerProps } from '../type';
import { parseToDayjs } from '../../_common/js/date-picker/format';
import isArray from 'lodash/isArray';
import TDatePickerCell from './Cell';

export default defineComponent({
name: 'TDatePickerTable',
Expand Down Expand Up @@ -80,9 +80,11 @@ export default defineComponent({
<table>
{showThead.value && (
<thead>
<tr>
<tr class={`${COMPONENT_NAME.value}-header-row`}>
{weekArr.value.map((value: string, i: number) => (
<th key={i}>{value}</th>
<th class={`${COMPONENT_NAME.value}-header-cell`} key={i}>
{value}
</th>
))}
</tr>
</thead>
Expand Down
160 changes: 120 additions & 40 deletions test/unit/snap/__snapshots__/csr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -48984,27 +48984,43 @@ exports[`csr snapshot test > csr test ./src/date-picker/_example/panel.vue 1`] =
>
<table>
<thead>
<tr>
<tr
class="t-date-picker__table-header-row"
>

<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>

Expand Down Expand Up @@ -49690,27 +49706,43 @@ exports[`csr snapshot test > csr test ./src/date-picker/_example/panel.vue 1`] =
>
<table>
<thead>
<tr>
<tr
class="t-date-picker__table-header-row"
>

<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>

Expand Down Expand Up @@ -50454,27 +50486,43 @@ exports[`csr snapshot test > csr test ./src/date-picker/_example/panel.vue 1`] =
>
<table>
<thead>
<tr>
<tr
class="t-date-picker__table-header-row"
>

<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>

Expand Down Expand Up @@ -51143,27 +51191,43 @@ exports[`csr snapshot test > csr test ./src/date-picker/_example/panel.vue 1`] =
>
<table>
<thead>
<tr>
<tr
class="t-date-picker__table-header-row"
>

<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>

Expand Down Expand Up @@ -51854,27 +51918,43 @@ exports[`csr snapshot test > csr test ./src/date-picker/_example/panel.vue 1`] =
>
<table>
<thead>
<tr>
<tr
class="t-date-picker__table-header-row"
>

<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>
<th>
<th
class="t-date-picker__table-header-cell"
>
</th>

Expand Down
2 changes: 1 addition & 1 deletion test/unit/snap/__snapshots__/ssr.test.js.snap

Large diffs are not rendered by default.

0 comments on commit 6a21dbe

Please sign in to comment.