Skip to content

Commit 5174e54

Browse files
uyarnRSS1102wangyang0210rzzfcenturyPark
authored
chore: release 1.10.5-naruto (#3391)
* fix(DatePicker): panel top arrow doesn't work when using week mode * fix(table): resolve colspan handling for multi-header (#3372) * fix(tag-input): prevent backspace event in readonly mode and add test (#3376) * fix(drawer): fix the issue where the header does not behave as expected (#3385) * feat(switch): support beforeChange API (#3386) * feat(DatePicker): support disableTime API (#3324) * fix(TimePicker): fixed only support hh:mm format * fix(TimePicker): disabled position only is start * fix(Upload): fixed vue error on uploadPastedFiles is false * docs: add readonly in api * feat(DatePicker): add disableTime prop * chore: fix typo and desc (#3388) * chore: fix typo * chore: fix descriptions * fix(color-picker): recentColors delete (#3384) * fix(color-picker): recentColors delete * fix(color-picker): format * feat(cascader): click item to close panel when trigger is hover (#3389) * chore: release 1.10.5 (#3390) * chore: release 1.10.5 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: 阿菜 Cai <[email protected]> Co-authored-by: 王洋 <[email protected]> Co-authored-by: Zhong <[email protected]> Co-authored-by: centuryPark <[email protected]> Co-authored-by: myron <[email protected]> Co-authored-by: wuxx <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 2329afb commit 5174e54

32 files changed

+301
-60
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ toc: false
55
docClass: timeline
66
---
77

8+
## 🌈 1.10.5 `2024-11-08`
9+
### 🚀 Features
10+
- `Switch`: 新增 `before-change` API, 用于需要发起异步请求的场景 @centuryPark ([#3386](https://github.com/Tencent/tdesign-vue/pull/3386))
11+
- `DatePicker`: 新增 `disableTime` API,在日期时间选择器场景下使用 @myronliu347 ([#3324](https://github.com/Tencent/tdesign-vue/pull/3324))
12+
- `Cascader`: 单选模式下当`trigger``hover`时,选中选项后自动关闭面板 @uyarn ([#3389](https://github.com/Tencent/tdesign-vue/pull/3389))
13+
### 🐞 Bug Fixes
14+
- `DatePicker`: `DateRangePickerPanel`组件`mode``week`时无法通过左右箭头调整月份 @RSS1102 ([#3370](https://github.com/Tencent/tdesign-vue/pull/3370))
15+
- `Table`: 修复多级表头下的通过`colspan`合并表头的问题 @wangyang0210 ([#3372](https://github.com/Tencent/tdesign-vue/pull/3372))
16+
- `ColorPicker`: 修复最近使用颜色删除的缺陷,调整为选中才能删除 @superNos ([#3384](https://github.com/Tencent/tdesign-vue/pull/3384))
17+
- `TagInput`: 修复在`readonly` 模式下仍可以通过`Backspace` 删除已选项的缺陷 @RSS1102 ([#3376](https://github.com/Tencent/tdesign-vue/pull/3376))
18+
### 🚧 Others
19+
- `Drawer`: 修复 `live demo` 中头部配置展示异常的问题 @cszhjh ([#3385](https://github.com/Tencent/tdesign-vue/pull/3385))
20+
821
## 🌈 1.10.4 `2024-10-18`
922
### 🚀 Features
1023
- `TimePicker`: 新增 `autoSwap` API,支持`1.10.2` 版本之后仍支持保持选定的左右侧时间大小顺序 @uyarn ([#3363](https://github.com/Tencent/tdesign-vue/pull/3363))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tdesign-vue",
33
"purename": "tdesign",
4-
"version": "1.10.4-naruto",
4+
"version": "1.10.5-naruto",
55
"description": "tdesign-vue",
66
"title": "tdesign-vue",
77
"keywords": [

script/generate-usage/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,8 @@ module.exports = {
624624
drawer: `
625625
<div>
626626
<t-button @click="handleClick">Open Drawer</t-button>
627-
<t-drawer v-bind="configProps" :visible.sync="visible" header="header">
627+
<t-drawer v-bind="configProps" :visible.sync="visible">
628+
<template #header>header</template>
628629
<p>This is a Drawer</p>
629630
</t-drawer>
630631
</div>

src/cascader/core/effect.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export function expendClickEffect(
6161
// 非受控状态下更新状态
6262
setValue(valueType === 'single' ? value : node.getPath().map((item) => item.value), 'check', node.getModel());
6363

64-
if (!checkStrictly) {
64+
// 当 trigger 为 hover 时 ,点击节点一定是关闭 panel 的操作
65+
if (!checkStrictly || propsTrigger === 'hover') {
6566
setVisible(false, {});
6667
}
6768
}

src/color-picker/panel/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ export default defineComponent({
283283
},
284284
render() {
285285
const {
286-
baseClassName, statusClassNames, t, global, recentColors, swatchColors, previewColorStyle, isGradient,
286+
baseClassName, statusClassNames, t, global, swatchColors, previewColorStyle, isGradient,
287287
} = this;
288288

289-
const showUsedColors = recentColors !== null && recentColors !== false;
289+
const showUsedColors = this.recentlyUsedColors !== null && this.recentlyUsedColors !== false;
290290

291291
let systemColors = swatchColors;
292292
if (systemColors === undefined) {

src/color-picker/panel/swatches.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,10 @@ export default defineComponent({
6969
* 移除颜色
7070
*/
7171
const handleRemoveColor = () => {
72-
const colors = [...props.colors];
72+
const { colors } = props;
7373
const selectedIndex = selectedColorIndex.value;
74-
if (selectedIndex > -1) {
75-
colors.splice(selectedIndex, 1);
76-
} else {
77-
colors.length = 0;
78-
}
74+
if (selectedIndex === -1) return;
75+
colors.splice(selectedIndex, 1);
7976
props.handleChange?.(colors);
8077
setVisiblePopConfirm(false);
8178
};

src/date-picker/DatePicker.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ export default defineComponent({
237237
presets: props.presets,
238238
time: time.value as string,
239239
disableDate: props.disableDate,
240+
disableTime: props.disableTime,
240241
firstDayOfWeek: props.firstDayOfWeek,
241242
timePickerProps: props.timePickerProps,
242243
enableTimePicker: props.enableTimePicker,

src/date-picker/DateRangePicker.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ export default defineComponent({
403403
presets: props.presets,
404404
time: time.value,
405405
disableDate: props.disableDate,
406+
disableTime: props.disableTime,
406407
firstDayOfWeek: props.firstDayOfWeek,
407408
timePickerProps: props.timePickerProps,
408409
enableTimePicker: props.enableTimePicker,

src/date-picker/DateRangePickerPanel.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default defineComponent({
2626
defaultValue: dateRangePickerProps.defaultValue,
2727
disabled: dateRangePickerProps.disabled,
2828
disableDate: dateRangePickerProps.disableDate,
29+
disableTime: dateRangePickerProps.disableTime,
2930
enableTimePicker: dateRangePickerProps.enableTimePicker,
3031
firstDayOfWeek: dateRangePickerProps.firstDayOfWeek,
3132
format: dateRangePickerProps.format,
@@ -135,7 +136,13 @@ export default defineComponent({
135136
prev: 'arrow-previous',
136137
next: 'arrow-next',
137138
};
138-
const monthCountMap = { date: 1, month: 12, year: 120 };
139+
const monthCountMap = {
140+
date: 1,
141+
week: 1,
142+
month: 12,
143+
quarter: 12,
144+
year: 120,
145+
};
139146
const monthCount = monthCountMap[props.mode] || 0;
140147
const current = new Date(year.value[partialIndex], month.value[partialIndex]);
141148

@@ -385,6 +392,7 @@ export default defineComponent({
385392
presets: props.presets,
386393
time: time.value,
387394
disableDate: props.disableDate,
395+
disableTime: props.disableTime,
388396
firstDayOfWeek: props.firstDayOfWeek,
389397
timePickerProps: props.timePickerProps,
390398
enableTimePicker: props.enableTimePicker,

src/date-picker/_example-composition/disable-date.vue

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
placeholder="禁用日期精确到时间"
2424
enable-time-picker
2525
:disable-date="{ before: dayjs().subtract(1, 'day').format() }"
26-
:time-picker-props="timePickerProps"
27-
@pick="(date) => (pickDate = dayjs(date).format('YYYY-MM-DD'))"
26+
:disable-time="disableTime"
2827
/>
2928
<t-date-range-picker
3029
placeholder="禁用最近 5 天外的日期"
@@ -37,18 +36,14 @@
3736
</template>
3837

3938
<script setup>
40-
import { ref, computed } from 'vue';
4139
import dayjs from 'dayjs';
4240
43-
const pickDate = ref('');
44-
const timePickerProps = computed(() => ({
45-
disableTime: () => {
46-
if (pickDate.value === dayjs().format('YYYY-MM-DD')) {
47-
return {
48-
hour: [0, 1, 2, 3, 4, 5, 6],
49-
};
50-
}
51-
return {};
52-
},
53-
}));
41+
const disableTime = (time) => {
42+
if (dayjs(time).format('YYYY-MM-DD') === dayjs().format('YYYY-MM-DD')) {
43+
return {
44+
hour: [0, 1, 2, 3, 4, 5, 6],
45+
};
46+
}
47+
return {};
48+
};
5449
</script>

0 commit comments

Comments
 (0)