diff --git a/build/config.js b/build/config.js index d6c7ad3..eeb1c1d 100644 --- a/build/config.js +++ b/build/config.js @@ -41,7 +41,7 @@ module.exports = { }, dev: { env: devEnv, - port: 8002, + port: 8003, proxyTable: {} } } diff --git a/example/components/changelog/readme.md b/example/components/changelog/readme.md index ee07372..2a0137d 100644 --- a/example/components/changelog/readme.md +++ b/example/components/changelog/readme.md @@ -8,6 +8,27 @@
+### 2.5.8 {page=#/changelog} +###### 2023.12.05 + +* **[add]**: + - [DatePicker 日期选择器](#/date-picker) 年/月选择器新增 `cell-class` 配置项以支持自定义日期样式 + - [Form 表单](#/form) 验证时错误信息样式调整 + - [Message 消息提示](#/message) 高阶模式图钉增加取消快捷键 + - [Table表格](#/table) Column resize style update + - [Table表格](#/table) 增加[合并行或列](#/table?anchor=he-bing-xing-huo-lie)示例 +* **[fix]**: + - [Message 消息提示](#/message) [规范化高阶使用配置](#/message?anchor=gao-jie-yong-fa) 问题修复 + - [Select 下拉选框](#/select) 修复 checkbox 模式时 options 的 disabled 属性没有传递问题 + - [Message 消息提示](#/message) 高阶模式支持多开 & 互斥模式 + - [Pagination 分页](#/pagination) 修复跳转分页输入非整数时显示错误的问题 + - [Message 消息提示](#/message) 高阶模式容器 zIndex 问题修复 + - [Tab 选项卡](#/tab) 修复 tab 组件 type 类型为 card-tab 一直抛 warn 的问题 +* **[update]**: + - [DatePicker 日期选择器](#/date-picker) 年/月/日选择器 `cell-class` 配置回调函数参数增加 `pickerType` 属性,标识当前是什么类型的 picker + +--- + ### 2.5.7 {page=#/changelog} ###### 2023.07.24 @@ -31,7 +52,7 @@ * **[fix]**: - [SearchSelect 查询选择器](#/searchselect) 修复 window 系统中,中文输入法的情况下,输入后直接回车数据展示问题 - [Sideslider 侧栏](#/sideslider) 修复侧边栏宽度仅支持数字的问题 - - [ Table表格](#/table) 修复设置 fixed 属性时,页面宽度变化不能及时响应重新绘制的问题 [#387](https://github.com/TencentBlueKing/bkui-vue2/issues/387) + - [Table表格](#/table) 修复设置 fixed 属性时,页面宽度变化不能及时响应重新绘制的问题 [#387](https://github.com/TencentBlueKing/bkui-vue2/issues/387) - [Button 基础按钮](#/button) 修复 outline 与 loading 同时为 true 时, loading 指示器不可见的问题 [#404](https://github.com/TencentBlueKing/bkui-vue2/issues/404) --- diff --git a/example/components/date-picker/example copy.vue b/example/components/date-picker/example copy.vue deleted file mode 100644 index 2169df4..0000000 --- a/example/components/date-picker/example copy.vue +++ /dev/null @@ -1,384 +0,0 @@ - - - - - - diff --git a/example/components/date-picker/readme.md b/example/components/date-picker/readme.md index 3fada4b..56bd9cc 100644 --- a/example/components/date-picker/readme.md +++ b/example/components/date-picker/readme.md @@ -630,41 +630,41 @@
``` ::: @@ -677,11 +677,11 @@ + ``` ::: diff --git a/example/components/input/readme.md b/example/components/input/readme.md index 6b812a6..6dc68a4 100644 --- a/example/components/input/readme.md +++ b/example/components/input/readme.md @@ -59,6 +59,9 @@ cursor: pointer; } } + .btn-search-input { + display: flex; + } [[toc]] @@ -332,6 +335,21 @@ v-model="value" @right-icon-click="handlerIconClick"> +
+ + + + + 搜索 + +
+``` +::: + ### bk-table 属性 {page=#/table} | 参数 | 说明 | 类型 | 可选值 | 默认值 | diff --git a/example/components/tooltips/example.vue b/example/components/tooltips/example.vue index 21b43d3..87b8d56 100644 --- a/example/components/tooltips/example.vue +++ b/example/components/tooltips/example.vue @@ -14,7 +14,7 @@ -->
+ v-bk-tooltips="{ content: '*', allowHTML: false }"> allowHTML - false
diff --git a/package.json b/package.json index ea082b8..70d5053 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bk-magic-vue", - "version": "2.5.7", + "version": "2.5.8", "description": "基于蓝鲸 Magicbox 和 Vue 的前端组件库", "main": "dist/bk-magic-vue.min.js", "files": [ @@ -58,7 +58,7 @@ "@babel/register": "~7.4.4", "@babel/runtime": "~7.4.5", "@babel/runtime-corejs2": "~7.4.5", - "@blueking/magicbox-header": "~1.1.60", + "@blueking/magicbox-header": "~1.1.61", "@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^11.0.0", "@vue/babel-helper-vue-jsx-merge-props": "~1.0.0", diff --git a/src/components/date-picker/base/date-table.vue b/src/components/date-picker/base/date-table.vue index 13e920c..417b25d 100644 --- a/src/components/date-picker/base/date-table.vue +++ b/src/components/date-picker/base/date-table.vue @@ -55,6 +55,12 @@ import mixin from './mixin' export default { mixins: [mixin, locale.mixin], + props: { + realPickerType: { + type: String, + default: '' + } + }, data () { return {} }, @@ -101,7 +107,8 @@ export default { disabled: cell.date && disabledTestFn && disabledTestFn(new Date(time)), range: dateIsInCurrentMonth && isRange && isInRange(time, rangeStart, rangeEnd), start: dateIsInCurrentMonth && isRange && time === minDay, - end: dateIsInCurrentMonth && isRange && time === maxDay + end: dateIsInCurrentMonth && isRange && time === maxDay, + pickerType: this.realPickerType } }).cells.slice(0) } diff --git a/src/components/date-picker/base/month-table.vue b/src/components/date-picker/base/month-table.vue index 5f379ad..9d0beed 100644 --- a/src/components/date-picker/base/month-table.vue +++ b/src/components/date-picker/base/month-table.vue @@ -39,6 +39,12 @@ import mixin from './mixin' export default { mixins: [mixin], + props: { + realPickerType: { + type: String, + default: '' + } + }, computed: { cells () { const cells = [] @@ -66,6 +72,7 @@ export default { && this.selectionMode === 'month' cell.selected = selectedDays.includes(day) cell.focused = day === focusedDate + cell.pickerType = this.realPickerType cells.push(cell) } @@ -73,6 +80,13 @@ export default { } }, methods: { + getExternalCellClass (cell) { + if (typeof this.cellClass === 'function') { + return this.cellClass(cell) + } + + return '' + }, getCellCls (cell) { return [ `bk-date-picker-cells-cell`, @@ -81,7 +95,8 @@ export default { [`bk-date-picker-cells-cell-disabled`]: cell.disabled, // [`bk-date-picker-cells-cell-focused`]: cell.focused, [`bk-date-picker-cells-cell-range`]: cell.range && !cell.start && !cell.end - } + }, + this.getExternalCellClass(cell) ] }, tCell (nr) { diff --git a/src/components/date-picker/base/year-table.vue b/src/components/date-picker/base/year-table.vue index 2f7e671..854827c 100644 --- a/src/components/date-picker/base/year-table.vue +++ b/src/components/date-picker/base/year-table.vue @@ -39,6 +39,12 @@ import mixin from './mixin' export default { mixins: [mixin], + props: { + realPickerType: { + type: String, + default: '' + } + }, computed: { startYear () { return Math.floor(this.tableDate.getFullYear() / 10) * 10 @@ -65,6 +71,7 @@ export default { const day = clearHours(cell.date) cell.selected = selectedDays.includes(day) cell.focused = day === focusedDate + cell.pickerType = this.realPickerType cells.push(cell) } @@ -72,6 +79,13 @@ export default { } }, methods: { + getExternalCellClass (cell) { + if (typeof this.cellClass === 'function') { + return this.cellClass(cell) + } + + return '' + }, getCellCls (cell) { return [ 'bk-date-picker-cells-cell', @@ -80,7 +94,8 @@ export default { 'bk-date-picker-cells-cell-disabled': cell.disabled, // ['bk-date-picker-cells-cell-focused']: cell.focused, 'bk-date-picker-cells-cell-range': cell.range && !cell.start && !cell.end - } + }, + this.getExternalCellClass(cell) ] } } diff --git a/src/components/date-picker/panel/date-range.vue b/src/components/date-picker/panel/date-range.vue index 044affb..57688d0 100644 --- a/src/components/date-picker/panel/date-range.vue +++ b/src/components/date-picker/panel/date-range.vue @@ -45,6 +45,7 @@ + @@ -196,7 +199,9 @@ export default { rangeState: { from: this.value[0], to: this.value[1], selecting: minDate && !maxDate }, currentView: this.selectionMode || 'range', leftPickerTable: `${this.selectionMode}-table`, + leftRealPickerType: this.selectionMode, rightPickerTable: `${this.selectionMode}-table`, + rightRealPickerType: this.selectionMode, leftPanelDate: leftPanelDate, rightPanelDate: new Date(leftPanelDate.getFullYear(), leftPanelDate.getMonth() + 1, 1), // 判断 range 中,第一次选的时间是否晚于当前时间 @@ -274,6 +279,12 @@ export default { }, focusedDate (date) { this.setPanelDates(date || new Date()) + }, + leftPickerTable (val) { + this.leftRealPickerType = val.replace('-table', '') + }, + rightPickerTable (val) { + this.rightRealPickerType = val.replace('-table', '') } }, methods: { diff --git a/src/components/date-picker/panel/date.vue b/src/components/date-picker/panel/date.vue index 9d7890b..2e29361 100644 --- a/src/components/date-picker/panel/date.vue +++ b/src/components/date-picker/panel/date.vue @@ -73,7 +73,7 @@
- + @@ -163,10 +164,12 @@ export default { data () { const { selectionMode, value } = this const dates = value.slice().sort() + const pickerTable = this.getTableType(selectionMode) return { currentView: selectionMode || 'date', - pickerTable: this.getTableType(selectionMode), + pickerTable, + realPickerType: pickerTable.replace('-table', ''), dates: dates, panelDate: this.startDate || dates[0] || new Date() } @@ -227,6 +230,9 @@ export default { this.panelDate = date } } + }, + pickerTable (val) { + this.realPickerType = val.replace('-table', '') } }, methods: { diff --git a/src/components/input/input.vue b/src/components/input/input.vue index dc27e4b..2ed1f1e 100644 --- a/src/components/input/input.vue +++ b/src/components/input/input.vue @@ -103,8 +103,8 @@ ? inputPasswordIcon[0] : inputPasswordIcon[1] ]"> - - + +