Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:Tencent/tdesign-common into feat…
Browse files Browse the repository at this point in the history
…/tree-set-indeterminate
  • Loading branch information
uyarn committed Dec 19, 2024
2 parents e93fe0c + b0815e9 commit 2cb5eb5
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 24 deletions.
4 changes: 4 additions & 0 deletions docs/mobile/api_v2/search.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Basic Search

{{ base }}

Word limit

{{max-length}}

Display the cancel button after obtaining focus

{{ action }}
Expand Down
4 changes: 4 additions & 0 deletions docs/mobile/api_v2/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ toc: false

{{ base }}

字数限制

{{max-length}}

获取焦点后显示取消按钮

{{ action }}
Expand Down
11 changes: 11 additions & 0 deletions docs/web/api/tree.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,14 @@ Connects parent nodes in the tree with their child nodes at the same level. This
### Why doesn't the `onChange` callback return the value of the parent node when child node is selected in `valueMode = 'all'` mode?

In `valueMode = 'all'` mode, the parent node will only appear in the selected values if all its child nodes are selected.

### Why do other nodes get selected when I select a node?

The `value` field of each item in the `data` array provided to the `Tree` component must be unique to avoid multiple selection issues caused by duplicate indices.

### Why can't I expand nodes correctly even though I set `expanded`?

The `value` field of each item in the `data` array provided to the `Tree` component must be unique to avoid incorrect expansion caused by duplicate indices.

### Are `value` or unique `key` values in any level of the `Tree` structure non-repetitive?
Yes, `value` or value defined by the alias `keys` in any level of the `Tree` structure are unique and non-repetitive.
12 changes: 12 additions & 0 deletions docs/web/api/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,15 @@ spline: data
### 为什么在 `valueMode = 'all'` 模式下,选中子节点时 `onChange` 回调并没有返回父节点的值?

`valueMode = 'all'` 模式下,必须当前子节点被全部选中后,父节点才会出现在选中值里面。

### 为什么我选中了一个选中了一个节点,但是其他节点也有被选中的情况?

提供给 `Tree` 组件的数组 `data` 数据中的每个 `value` 字段的值必须是唯一的,避免重复索引导致多选问题。

### 为什么我设置了 `expanded` 却不能正确展开节点?

提供给 `Tree` 组件的数组 `data` 数据中的每个 `value` 字段的值必须是唯一的,避免重复索引导致不能正确展开。

### `Tree` 中任意一级结构中的 `value` 或唯一 `key` 值都不可重复吗?

是的, 在 `Tree` 中任意一级结构中的 `value` 或使用 `keys` 别名定义的 `value` 值都是唯一的,不可重复。
2 changes: 1 addition & 1 deletion js/date-picker/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export function flagActive(data: any[], { ...args }: FlagActiveOptions) {
const _item = item;

if (multiple) {
_item.active = (value as DateValue[]).some((val) => isSame(dayjs(val).toDate(), _item.value));
_item.active = (value as DateValue[]).some((val) => isSame(dayjs(val).toDate(), _item.value, type) && !_item.additional);
} else {
_item.active = start && isSame(item.value, start, type) && !_item.additional;
}
Expand Down
20 changes: 20 additions & 0 deletions style/mobile/components/search/v2/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@

.@{prefix}-icon {
color: @search-icon-color;
font-size: @search-icon-font-size;
}
}

&__clear {
position: relative;
margin-left: 10px;
font-size: @search-clear-icon-font-size;
color: @search-clear-icon-color;
.hotspot-expanded();
}
Expand All @@ -70,6 +72,24 @@

&__placeholder {
color: @search-placeholder-color;

&--center {
text-align: center;
}
}

&__result-item {
&--highLight {
color: @search-result-high-light-color;
}
}

&__result-list &__result-item {
padding-left: 0;

&::after {
left: 0;
}
}

// mobile vue
Expand Down
3 changes: 3 additions & 0 deletions style/mobile/components/search/v2/_var.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
@search-padding: var(--td-search-padding, 8px 12px);
@search-placeholder-color: var(--td-search-placeholder-color, @text-color-placeholder);
@search-icon-color: var(--td-search-icon-color, @text-color-placeholder);
@search-icon-font-size: var(--td-search-icon-font-size, 24px);
@search-square-radius: var(--td-search-square-radius, @radius-default);
@search-round-radius: calc(@search-height / 2);
@search-action-color: var(--td-search-action-color, @brand-color);
@search-clear-icon-color: var(--td-search-clear-icon-color, @text-color-placeholder);
@search-clear-icon-font-size: var(--td-search-clear-icon-font-size, 24px);
@search-result-high-light-color: var(--td-search-result-high-light-color, @brand-color);
6 changes: 2 additions & 4 deletions style/web/components/avatar/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@

&.@{prefix}-avatar--offset-right {

& .@{prefix}-avatar,
& @{prefix}-avatar-light-dom {
& .@{prefix}-avatar {
&:not(:last-child) {
.avatar-group-offset-right(@avatar-group-offset-medium);

Expand All @@ -73,8 +72,7 @@
&.@{prefix}-avatar--offset-left {
.generate-z-index(@avatar-group-init-zIndex);

& .@{prefix}-avatar,
& @{prefix}-avatar-light-dom {
& .@{prefix}-avatar {
&:not(:first-child) {
.avatar-group-size--left();
}
Expand Down
1 change: 1 addition & 0 deletions style/web/components/checkbox/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
border-radius: @checkbox-border-radius;
background-color: @checkbox-input-color;
box-sizing: border-box;
flex-shrink: 0;

&::after {
content: "";
Expand Down
22 changes: 6 additions & 16 deletions style/web/components/dialog/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,19 @@
border-radius: @border-radius-large;

// icon theme
.t-icon.@{prefix}-is-info,
t-icon-info-circle.@{prefix}-is-info {
.t-icon.@{prefix}-is-info {
color: @dialog-info-icon-color;
}

.t-icon.@{prefix}-is-success,
t-icon-check-circle.@{prefix}-is-success {
.t-icon.@{prefix}-is-success {
color: @dialog-success-icon-color;
}

.t-icon.@{prefix}-is-warning,
t-icon-error-circle.@{prefix}-is-warning {
.t-icon.@{prefix}-is-warning {
color: @dialog-warning-icon-color;
}

.t-icon.@{prefix}-is-error,
t-icon-error-circle.@{prefix}-is-error {
.t-icon.@{prefix}-is-error {
color: @dialog-error-icon-color;
}

Expand All @@ -63,10 +59,7 @@
width: 100%;
}

.t-icon:not(.t-icon-close),
t-icon-check-circle,
t-icon-info-circle,
t-icon-error-circle {
.t-icon:not(.t-icon-close) {
font-size: @dialog-icon-size;
display: inline-flex;
align-items: center;
Expand Down Expand Up @@ -127,10 +120,7 @@
width: 100%;
text-align: right;
padding: @dialog-footer-padding;

// 兼容 web components
.@{prefix}-button + .@{prefix}-button,
.@{prefix}-dialog__button + .@{prefix}-dialog__button {
.@{prefix}-button + .@{prefix}-button {
margin-left: @dialog-footer-button-margin-left;
}
}
Expand Down
3 changes: 1 addition & 2 deletions style/web/components/slider/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@
}
}

.@{prefix}-slider--vertical .@{prefix}-slider__button-wrapper,
.@{prefix}-slider__button-wrapper--vertical {
.@{prefix}-slider--vertical .@{prefix}-slider__button-wrapper {
top: auto;
position: absolute;
z-index: 2;
Expand Down
13 changes: 13 additions & 0 deletions style/web/components/steps/_mixin.less
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@
left: @steps-dot-connector-position-left-horizontal;
top: @steps-dot-connector-position-top-horizontal;
}
&:not(.@{prefix}-steps-item--finish) {
&::after {
border-color: @text-color-placeholder;
}
}
}

.@{prefix}-steps-item--finish:not(:last-child) {
Expand Down Expand Up @@ -506,6 +511,14 @@
}
}
}

&:not(:last-child) {
&.@{prefix}-steps-item--default {
&::before {
border-color: @text-color-placeholder;
}
}
}
}
}
}
1 change: 0 additions & 1 deletion style/web/components/textarea/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
display: flex;
width: 100%;
height: @textarea-height;
min-height: @textarea-height;
border: 1px solid @textarea-border-color;
border-radius: @textarea-border-radius;
padding: @textarea-padding;
Expand Down
2 changes: 2 additions & 0 deletions style/web/components/upload/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@
&-image {
max-width: 100%;
max-height: 100%;
width: 100%;
height: 100%;
}

&-status {
Expand Down

0 comments on commit 2cb5eb5

Please sign in to comment.