-
Checked
+
+ Checked
Toggle me
+
+
+ Tag 1
+
+
+ Tag 2
+
+
+ Tag 3
+
+
+ Tag 4
+
+
+ Tag 5
+
+
diff --git a/docs/examples/tag/editable.vue b/docs/examples/tag/editable.vue
index edfb049145..4148114461 100644
--- a/docs/examples/tag/editable.vue
+++ b/docs/examples/tag/editable.vue
@@ -1,26 +1,27 @@
-
- {{ tag }}
-
-
-
- + New Tag
-
+
+
+ {{ tag }}
+
+
+
+ + New Tag
+
+
diff --git a/docs/examples/tag/sizes.vue b/docs/examples/tag/sizes.vue
index 3809432c2a..9de4d89fae 100644
--- a/docs/examples/tag/sizes.vue
+++ b/docs/examples/tag/sizes.vue
@@ -1,13 +1,7 @@
-
- Large
- Default
- Small
-
-
-
- Large
- Default
- Small
-
+
+ Large
+ Default
+ Small
+
diff --git a/docs/examples/tag/theme.vue b/docs/examples/tag/theme.vue
index 4cadb36759..de046dd271 100644
--- a/docs/examples/tag/theme.vue
+++ b/docs/examples/tag/theme.vue
@@ -1,69 +1,36 @@
-
-
Dark
+
+ Dark
{{ item.label }}
-
- {{ item.label }}
-
-
-
Light
+
+ Light
{{ item.label }}
-
- {{ item.label }}
-
-
-
Plain
+
+ Plain
{{ item.label }}
-
- {{ item.label }}
-
@@ -75,10 +42,10 @@ import type { TagProps } from 'element-plus'
type Item = { type: TagProps['type']; label: string }
const items = ref
>([
- { type: '', label: 'Tag 1' },
+ { type: 'primary', label: 'Tag 1' },
{ type: 'success', label: 'Tag 2' },
{ type: 'info', label: 'Tag 3' },
- { type: 'danger', label: 'Tag 4' },
- { type: 'warning', label: 'Tag 5' },
+ { type: 'warning', label: 'Tag 4' },
+ { type: 'danger', label: 'Tag 5' },
])
diff --git a/packages/components/check-tag/src/check-tag.ts b/packages/components/check-tag/src/check-tag.ts
index b8bc99e4fc..405f863a96 100644
--- a/packages/components/check-tag/src/check-tag.ts
+++ b/packages/components/check-tag/src/check-tag.ts
@@ -12,6 +12,14 @@ export const checkTagProps = buildProps({
type: Boolean,
default: false,
},
+ /**
+ * @description type of Tag
+ */
+ type: {
+ type: String,
+ values: ['primary', 'success', 'info', 'warning', 'danger'],
+ default: 'primary',
+ },
} as const)
export type CheckTagProps = ExtractPropTypes
diff --git a/packages/components/check-tag/src/check-tag.vue b/packages/components/check-tag/src/check-tag.vue
index 9ff65faa42..596fbddcee 100644
--- a/packages/components/check-tag/src/check-tag.vue
+++ b/packages/components/check-tag/src/check-tag.vue
@@ -17,7 +17,11 @@ const props = defineProps(checkTagProps)
const emit = defineEmits(checkTagEmits)
const ns = useNamespace('check-tag')
-const containerKls = computed(() => [ns.b(), ns.is('checked', props.checked)])
+const containerKls = computed(() => [
+ ns.b(),
+ ns.is('checked', props.checked),
+ ns.m(props.type || 'primary'),
+])
const handleChange = () => {
const checked = !props.checked
diff --git a/packages/components/tag/src/tag.ts b/packages/components/tag/src/tag.ts
index 853308e244..5d502ab419 100644
--- a/packages/components/tag/src/tag.ts
+++ b/packages/components/tag/src/tag.ts
@@ -10,8 +10,8 @@ export const tagProps = buildProps({
*/
type: {
type: String,
- values: ['success', 'info', 'warning', 'danger', ''],
- default: '',
+ values: ['primary', 'success', 'info', 'warning', 'danger'],
+ default: 'primary',
},
/**
* @description whether Tag can be removed
@@ -28,17 +28,13 @@ export const tagProps = buildProps({
/**
* @description background color of the Tag
*/
- color: {
- type: String,
- default: '',
- },
+ color: String,
/**
* @description size of Tag
*/
size: {
type: String,
values: componentSizes,
- default: '',
},
/**
* @description theme of Tag
diff --git a/packages/components/tag/src/tag.vue b/packages/components/tag/src/tag.vue
index f33c47a918..81d80d0cee 100644
--- a/packages/components/tag/src/tag.vue
+++ b/packages/components/tag/src/tag.vue
@@ -50,7 +50,7 @@ const containerKls = computed(() => {
return [
ns.b(),
ns.is('closable', closable),
- ns.m(type),
+ ns.m(type || 'primary'),
ns.m(tagSize.value),
ns.m(effect),
ns.is('hit', hit),
diff --git a/packages/theme-chalk/src/check-tag.scss b/packages/theme-chalk/src/check-tag.scss
index 88c7e1a2c8..017febb554 100644
--- a/packages/theme-chalk/src/check-tag.scss
+++ b/packages/theme-chalk/src/check-tag.scss
@@ -18,10 +18,15 @@
}
@include when(checked) {
- background-color: getCssVar('color', 'primary', 'light-8');
- color: getCssVar('color', 'primary');
- &:hover {
- background-color: getCssVar('color', 'primary', 'light-7');
+ @each $type in $types {
+ &.#{bem('check-tag', '', $type)} {
+ background-color: getCssVar('color', $type, 'light-8');
+ color: getCssVar('color', $type);
+
+ &:hover {
+ background-color: getCssVar('color', $type, 'light-7');
+ }
+ }
}
}
}
diff --git a/packages/theme-chalk/src/tag.scss b/packages/theme-chalk/src/tag.scss
index d92f71f754..d1ddda33dd 100644
--- a/packages/theme-chalk/src/tag.scss
+++ b/packages/theme-chalk/src/tag.scss
@@ -63,7 +63,6 @@ $tag-icon-span-gap: map.merge(
@include b(tag) {
@include genTheme('light-9', 'light-8', '');
- @include css-var-from-global(('tag', 'text-color'), ('color', 'primary'));
@each $type in $types {
&.#{bem('tag', '', $type)} {
@include css-var-from-global(('tag', 'text-color'), ('color', $type));
From 880417bbecfb20f74f5dc215989ccbd5b48028a2 Mon Sep 17 00:00:00 2001
From: btea <2356281422@qq.com>
Date: Fri, 2 Feb 2024 15:06:43 +0800
Subject: [PATCH 20/22] test(components): [tree] setCheckedNodes with disabled
node (#15753)
---
.../components/tree/__tests__/tree.test.ts | 94 +++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/packages/components/tree/__tests__/tree.test.ts b/packages/components/tree/__tests__/tree.test.ts
index 2019b9f3b3..0c74ab6c47 100644
--- a/packages/components/tree/__tests__/tree.test.ts
+++ b/packages/components/tree/__tests__/tree.test.ts
@@ -536,6 +536,100 @@ describe('Tree.vue', () => {
expect(treeVm.getCheckedNodes().length).toEqual(0)
})
+ test('setCheckedNodes with disabled node', async () => {
+ const nodes = [
+ {
+ id: 1,
+ label: 'Level one 1',
+ children: [
+ {
+ id: 4,
+ label: 'Level two 1-1',
+ children: [
+ {
+ id: 9,
+ label: 'Level three 1-1-1',
+ },
+ {
+ id: 10,
+ label: 'Level three 1-1-2',
+ },
+ ],
+ },
+ ],
+ },
+ {
+ id: 2,
+ label: 'Level one 2',
+ children: [
+ {
+ id: 5,
+ disabled: true,
+ label: 'Level two 2-1',
+ },
+ {
+ id: 6,
+ label: 'Level two 2-2',
+ },
+ ],
+ },
+ {
+ id: 3,
+ label: 'Level one 3',
+ children: [
+ {
+ id: 7,
+ label: 'Level two 3-1',
+ },
+ {
+ id: 8,
+ label: 'Level two 3-2',
+ },
+ ],
+ },
+ ]
+ const wrapper = mount(
+ Object.assign({
+ components: {
+ 'el-tree': Tree,
+ },
+ template: `
+
+ `,
+ data() {
+ return {
+ data: nodes,
+ defaultProps: {
+ children: 'children',
+ label: 'label',
+ },
+ }
+ },
+ })
+ )
+ const treeWrapper = wrapper.findComponent(Tree)
+ const treeVm = treeWrapper.vm as InstanceType
+ expect(treeVm.getCheckedNodes().length).toEqual(0)
+
+ function flattenTree(data) {
+ const result = []
+
+ function flatten(node) {
+ result.push(node)
+ if (node?.children?.length) {
+ node.children.forEach(flatten)
+ }
+ }
+
+ data.forEach(flatten)
+ return result
+ }
+ const list = flattenTree(nodes).filter((item) => !item.disabled)
+
+ treeVm.setCheckedNodes(list)
+ expect(treeVm.getCheckedNodes().length).toEqual(8)
+ })
+
test('setCheckedKeys', async () => {
const { wrapper } = getTreeVm(
`:props="defaultProps" show-checkbox node-key="id"`
From 7fd6e4f4530668665cf4cad21bd1dadd02e25e26 Mon Sep 17 00:00:00 2001
From: Xc <124118265@qq.com>
Date: Fri, 2 Feb 2024 15:24:13 +0800
Subject: [PATCH 21/22] fix(components): [tabs] slot name use kebab-case style
(#15733)
* fix(components): [tabs] slot name use kebab-case style
* fix(components): [tabs] slot name use kebab-case style
* fix(components): [tabs] slot name use kebab-case style
* docs(components): [tabs] use deprecated tag
---
docs/en-US/component/tabs.md | 9 +++++----
.../tabs/customized-add-button-icon.vue | 2 +-
packages/components/tabs/src/tabs.tsx | 17 +++++++++++++++--
3 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/docs/en-US/component/tabs.md b/docs/en-US/component/tabs.md
index c3a116992d..ceed07b078 100644
--- a/docs/en-US/component/tabs.md
+++ b/docs/en-US/component/tabs.md
@@ -108,10 +108,11 @@ tabs/customized-trigger
## Tabs Slots
-| Name | Description | Subtags |
-| ---------------- | ------------------------- | -------- |
-| - | customize default content | Tab-pane |
-| addIcon ^(2.4.0) | customize add button icon | - |
+| Name | Description | Subtags |
+| ------------------------------ | ------------------------- | -------- |
+| - | customize default content | Tab-pane |
+| addIcon ^(2.4.0) ^(deprecated) | customize add button icon | - |
+| add-icon ^(2.5.4) | customize add button icon | - |
## Tab-pane Attributes
diff --git a/docs/examples/tabs/customized-add-button-icon.vue b/docs/examples/tabs/customized-add-button-icon.vue
index 01a4b69abc..6befa9226b 100644
--- a/docs/examples/tabs/customized-add-button-icon.vue
+++ b/docs/examples/tabs/customized-add-button-icon.vue
@@ -7,7 +7,7 @@ addIcon
editable
@edit="handleTabsEdit"
>
-
+
!!props.activeName)
)
+ useDeprecated(
+ {
+ from: '"addIcon"',
+ replacement: '"add-icon"',
+ scope: 'ElTabs',
+ version: '2.6.0',
+ ref: 'https://element-plus.org/en-US/component/tabs.html#slots',
+ type: 'Slot',
+ },
+ computed(() => !!slots.addIcon)
+ )
+
watch(
() => props.activeName,
(modelValue) => setCurrentName(modelValue)
@@ -178,7 +190,8 @@ const Tabs = defineComponent({
})
return () => {
- const addSlot = slots.addIcon
+ const addSlot = slots['add-icon'] || slots['addIcon']
+ const isCamelCase = addSlot && slots['addIcon']
const newButton =
props.editable || props.addable ? (
{addSlot ? (
- renderSlot(slots, 'addIcon')
+ renderSlot(slots, isCamelCase ? 'addIcon' : 'add-icon')
) : (
From 6d5460cf95fc98fab0b25f4a78b4b3e4f36634a6 Mon Sep 17 00:00:00 2001
From: Element
Date: Fri, 2 Feb 2024 15:40:45 +0800
Subject: [PATCH 22/22] chore: Update changelog 2.5.4 (#15766)
chore: update changelog 2.5.4
---
CHANGELOG.en-US.md | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md
index 9a9db423d4..60ea71b983 100644
--- a/CHANGELOG.en-US.md
+++ b/CHANGELOG.en-US.md
@@ -1,5 +1,29 @@
## Changelog
+### 2.5.4
+
+_2024-02-02_
+
+#### Features
+
+- Components [dialog] Dialog can drag overflow the viewport (#15643 by @kooriookami)
+- Components [message-box] MessageBox can drag overflow the viewport (#15674 by @kooriookami)
+- Play custom namespace (#15677 by @btea)
+- Components [check-tag] add type prop (#15727 by @kooriookami)
+
+#### Bug fixes
+
+- Components [table] The namespace of the showOverflowTooltip is invalid. (#15627 by @xingyixiang)
+- Components [select] Remote search does not show menu when it has options and no query (#15683 by @wen403)
+- Docs overlay error caused by sidebar (#15694 by @heygsc)
+- Components [select] Fix value with value-key not selected (#15681 by @kooriookami)
+- Components [tour] buttonProps & isSameProps errors (#15680 by @Fuphoenixes)
+- Components [select] el-option-group error when el-option in a component (#15703 by @Fuphoenixes)
+- Components [drawer] click allow focus out (#11965 by @tolking)
+- Components [menu] Add menu-item margin when calculating `calcSliceIndex` (#15699 by @zhixiaotong)
+- Components [upload] Add crossorigin property (#15524 by @wkasunsampath)
+- Components [tabs] slot name use kebab-case style (#15733 by @chenxch)
+
### 2.5.3
_2024-01-22_