From d6934b2d2414c8452ca97a487981098fafe6934c Mon Sep 17 00:00:00 2001 From: ielgnaw Date: Mon, 5 Jun 2023 21:12:14 +0800 Subject: [PATCH 01/43] feat: bump to 2.5.6-beta.2 --- example/App.vue | 12 ++++++------ example/components/changelog/readme.md | 14 ++++++++++++++ package.json | 4 ++-- src/components/date-picker/panel/date.vue | 1 + 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/example/App.vue b/example/App.vue index add2385..01849dc 100644 --- a/example/App.vue +++ b/example/App.vue @@ -29,12 +29,12 @@ diff --git a/example/components/button/readme.md b/example/components/button/readme.md index 973ed6d..2e8799f 100644 --- a/example/components/button/readme.md +++ b/example/components/button/readme.md @@ -315,6 +315,9 @@ 反色按钮 + + 反色按钮 + + + diff --git a/package.json b/package.json index 99acae1..aeda918 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bk-magic-vue", - "version": "2.5.6-beta.3", + "version": "2.5.6", "description": "基于蓝鲸 Magicbox 和 Vue 的前端组件库", "main": "dist/bk-magic-vue.min.js", "files": [ diff --git a/single.html b/single.html index 1a017aa..038e8d2 100644 --- a/single.html +++ b/single.html @@ -78,7 +78,7 @@ } - + @@ -263,7 +263,6 @@ bkMagicVue.locale.use(bkMagicVue.lang['enUS']) - Vue.mixin(bkMagicVue.locale.mixin) const remoteLen = 50 diff --git a/src/components/table/table-layout.js b/src/components/table/table-layout.js index d96e065..086fabc 100644 --- a/src/components/table/table-layout.js +++ b/src/components/table/table-layout.js @@ -131,16 +131,21 @@ class TableLayout { ) { return Vue.nextTick(() => this.updateElsHeight()) } - const tableHeight = (this.tableHeight = this.table.$el.offsetHeight - this.paginationHeight) - const footerHeight = (this.footerHeight = footerWrapper ? footerWrapper.offsetHeight : 0) - this.bodyHeight = tableHeight - headerHeight - footerHeight + (footerWrapper ? 1 : 0) - this.fixedBodyHeight = this.scrollX ? this.bodyHeight - this.gutterWidth : this.bodyHeight - - const noData = !this.table.data || this.table.data.length === 0 - this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight - this.syncRowHeight() - this.updateScrollY() - this.notifyObservers('scrollable') + + // setTimeout 0 for https://github.com/TencentBlueKing/bkui-vue2/issues/387 + setTimeout(() => { + const tableHeight = (this.tableHeight = this.table.$el.offsetHeight - this.paginationHeight) + console.warn(`this.table.$el.offsetHeight: ${this.table.$el.offsetHeight} --- this.paginationHeight: ${this.paginationHeight} --- tableHeight: ${tableHeight}`) + const footerHeight = (this.footerHeight = footerWrapper ? footerWrapper.offsetHeight : 0) + this.bodyHeight = tableHeight - headerHeight - footerHeight + (footerWrapper ? 1 : 0) + this.fixedBodyHeight = this.scrollX ? this.bodyHeight - this.gutterWidth : this.bodyHeight + + const noData = !this.table.data || this.table.data.length === 0 + this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight + this.syncRowHeight() + this.updateScrollY() + this.notifyObservers('scrollable') + }, 0) } getFlattenColumns () { diff --git a/src/ui/button.css b/src/ui/button.css index 0968150..9f2a4de 100644 --- a/src/ui/button.css +++ b/src/ui/button.css @@ -208,7 +208,7 @@ outline: none; height: 22px; padding: 0; - + .bk-loading-wrapper { display: inline-block; } @@ -447,6 +447,10 @@ transition: background-color ease 0.3s; min-width: 68px; + .bk-loading-wrapper { + opacity: 0; + } + .bk-button-loading { width: 58px; display: inline-block; diff --git a/src/ui/mixins/create-button.css b/src/ui/mixins/create-button.css index a13dfbc..65d1b04 100644 --- a/src/ui/mixins/create-button.css +++ b/src/ui/mixins/create-button.css @@ -34,18 +34,41 @@ } &.is-loading { - cursor: default; + cursor: default; + &:hover, + &.hover { + background-color: $color; + border-color: $color; + opacity: 1; + } + &:active, + &.active { + background-color: $color; + border-color: $color; + } + &.is-outline { + .bk-button-loading { + div { + background-color: $color; + } + } &:hover, &.hover { - background-color: $color; - border-color: $color; - opacity: 1; + .bk-button-loading { + div { + background-color: #fff; + } + } } - &:active, - &.active { - background-color: $color; - border-color: $color; + &.active, + &:active { + .bk-button-loading { + div { + background-color: #fff; + } + } } + } } &.is-outline { From 467b67906fe6bca5250448f00706a3552f576a86 Mon Sep 17 00:00:00 2001 From: ielgnaw Date: Thu, 29 Jun 2023 16:27:52 +0800 Subject: [PATCH 04/43] feat: update @blueking/magicbox-header --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aeda918..c2aeae3 100644 --- a/package.json +++ b/package.json @@ -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.59", + "@blueking/magicbox-header": "~1.1.60", "@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^11.0.0", "@vue/babel-helper-vue-jsx-merge-props": "~1.0.0", From 1c85ecd6842101af5f1738035893e169cf65fd7a Mon Sep 17 00:00:00 2001 From: ielgnaw Date: Mon, 24 Jul 2023 19:04:47 +0800 Subject: [PATCH 05/43] feat: bump to 2.5.7 --- example/components/changelog/readme.md | 14 ++++++++++++ example/components/message/readme.md | 9 ++++---- example/components/navigation/demo.vue | 2 +- example/components/navigation/demo1.vue | 2 +- example/components/navigation/readme.md | 4 ++-- example/components/search-select/example.vue | 2 +- example/components/search-select/readme.md | 24 ++++++++++---------- example/components/tooltips/readme.md | 4 ++-- package.json | 2 +- 9 files changed, 39 insertions(+), 24 deletions(-) diff --git a/example/components/changelog/readme.md b/example/components/changelog/readme.md index 175bd3b..ee07372 100644 --- a/example/components/changelog/readme.md +++ b/example/components/changelog/readme.md @@ -8,6 +8,20 @@
+### 2.5.7 {page=#/changelog} +###### 2023.07.24 + +* **[add]**: + - [Select 下拉选框](#/select) 多选新增 [checkbox 模式](#/select?anchor=duo-xuan) + - [SearchSelect 查询选择器](#/searchselect) 新增 [checkbox 模式](#/search-select?anchor=checkbox-mo-shi) + - [SearchSelect 查询选择器](#/searchselect) 新增推荐搜索选择的功能 + - [Message 消息提示](#/message) 支持[规范化高阶使用配置](#/message?anchor=gao-jie-yong-fa) + - [Message 消息提示](#/message) 支持自定义 z-index +* **[fix]**: + - [Cascade 级联选框](#/cascade) 修复 filterable 和 check-any-level 卡死的问题 [#407](https://github.com/TencentBlueKing/bkui-vue2/issues/407) + +--- + ### 2.5.6 {page=#/changelog} ###### 2023.06.21 diff --git a/example/components/message/readme.md b/example/components/message/readme.md index 8f29777..2f8a1a4 100644 --- a/example/components/message/readme.md +++ b/example/components/message/readme.md @@ -134,7 +134,7 @@ ellipsisLine: 2, ellipsisCopy: true }) - + } } } @@ -394,12 +394,12 @@ -### 内容超出被截断时显示复制按钮 +### 内容超出被截断时显示复制按钮 {page=#/message} :::demo 内容超出被截断时显示复制按钮 ```html ``` +::: -### 高阶用法 +### 高阶用法 {page=#/message} :::demo 高阶用法 ```html diff --git a/example/components/navigation/demo.vue b/example/components/navigation/demo.vue index 0bb5903..2279513 100644 --- a/example/components/navigation/demo.vue +++ b/example/components/navigation/demo.vue @@ -156,7 +156,7 @@ ``` ::: @@ -677,11 +677,11 @@ + ``` ::: diff --git a/package.json b/package.json index ea082b8..653c84c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bk-magic-vue", - "version": "2.5.7", + "version": "2.5.8-beta.1", "description": "基于蓝鲸 Magicbox 和 Vue 的前端组件库", "main": "dist/bk-magic-vue.min.js", "files": [ diff --git a/src/components/date-picker/base/month-table.vue b/src/components/date-picker/base/month-table.vue index 5f379ad..aeeb8b9 100644 --- a/src/components/date-picker/base/month-table.vue +++ b/src/components/date-picker/base/month-table.vue @@ -73,6 +73,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 +88,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..7ac780c 100644 --- a/src/components/date-picker/base/year-table.vue +++ b/src/components/date-picker/base/year-table.vue @@ -72,6 +72,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 +87,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/ui/form.css b/src/ui/form.css index 346956d..2a2037e 100644 --- a/src/ui/form.css +++ b/src/ui/form.css @@ -269,36 +269,36 @@ input[type="url"], textarea, select { - border-color: $dangerColor; - color: $dangerColor; + border-color: $newRedColor; + color: $newRedColor; /*&::placeholder { - color: $dangerColor; + color: $newRedColor; }*/ } .bk-textarea-wrapper { - border-color: $dangerColor; + border-color: $newRedColor; } .bk-tag-selector .bk-tag-input { - border-color: $dangerColor; + border-color: $newRedColor; /*.placeholder { - color: $dangerColor; + color: $newRedColor; }*/ } .bk-form-tip { .bk-tip-text { - color: $dangerColor; + color: $newRedColor; } } .bk-select { - border-color: $dangerColor; + border-color: $newRedColor; /*&.is-default-trigger.is-unselected:before { - color: $dangerColor; + color: $newRedColor; }*/ } } From bd98a8f99d33c0a56335d1c4fb080dd7af3adbac Mon Sep 17 00:00:00 2001 From: ielgnaw Date: Sat, 29 Jul 2023 14:44:56 +0800 Subject: [PATCH 07/43] feat: bump to 2.5.8-beta.1 --- example/components/changelog/readme.md | 9 ++ example/components/date-picker/readme.md | 85 ++++++++++++------- package.json | 2 +- .../date-picker/base/month-table.vue | 10 ++- .../date-picker/base/year-table.vue | 10 ++- src/ui/form.css | 18 ++-- 6 files changed, 90 insertions(+), 44 deletions(-) diff --git a/example/components/changelog/readme.md b/example/components/changelog/readme.md index ee07372..e682080 100644 --- a/example/components/changelog/readme.md +++ b/example/components/changelog/readme.md @@ -8,6 +8,15 @@
+### 2.5.8-beta.1 {page=#/changelog} + +* **[add]**: + - [DatePicker 日期选择器](#/date-picker) 年/月选择器新增 `cell-class` 配置项以支持自定义日期样式 +* **[update]**: + - [Form 表单](#/form) 验证时错误信息样式调整 + +--- + ### 2.5.7 {page=#/changelog} ###### 2023.07.24 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/package.json b/package.json index ea082b8..653c84c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bk-magic-vue", - "version": "2.5.7", + "version": "2.5.8-beta.1", "description": "基于蓝鲸 Magicbox 和 Vue 的前端组件库", "main": "dist/bk-magic-vue.min.js", "files": [ diff --git a/src/components/date-picker/base/month-table.vue b/src/components/date-picker/base/month-table.vue index 5f379ad..aeeb8b9 100644 --- a/src/components/date-picker/base/month-table.vue +++ b/src/components/date-picker/base/month-table.vue @@ -73,6 +73,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 +88,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..7ac780c 100644 --- a/src/components/date-picker/base/year-table.vue +++ b/src/components/date-picker/base/year-table.vue @@ -72,6 +72,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 +87,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/ui/form.css b/src/ui/form.css index 346956d..2a2037e 100644 --- a/src/ui/form.css +++ b/src/ui/form.css @@ -269,36 +269,36 @@ input[type="url"], textarea, select { - border-color: $dangerColor; - color: $dangerColor; + border-color: $newRedColor; + color: $newRedColor; /*&::placeholder { - color: $dangerColor; + color: $newRedColor; }*/ } .bk-textarea-wrapper { - border-color: $dangerColor; + border-color: $newRedColor; } .bk-tag-selector .bk-tag-input { - border-color: $dangerColor; + border-color: $newRedColor; /*.placeholder { - color: $dangerColor; + color: $newRedColor; }*/ } .bk-form-tip { .bk-tip-text { - color: $dangerColor; + color: $newRedColor; } } .bk-select { - border-color: $dangerColor; + border-color: $newRedColor; /*&.is-default-trigger.is-unselected:before { - color: $dangerColor; + color: $newRedColor; }*/ } } From c16d5c94958e205aacf7eaddd7db97bba1f8ef28 Mon Sep 17 00:00:00 2001 From: ielgnaw Date: Mon, 31 Jul 2023 20:46:23 +0800 Subject: [PATCH 08/43] feat: 2.5.8-beta.2 --- example/components/changelog/readme.md | 7 + .../components/date-picker/example copy.vue | 384 ------------------ package.json | 2 +- .../date-picker/base/date-table.vue | 9 +- .../date-picker/base/month-table.vue | 7 + .../date-picker/base/year-table.vue | 7 + src/components/date-picker/panel/date.vue | 14 +- 7 files changed, 42 insertions(+), 388 deletions(-) delete mode 100644 example/components/date-picker/example copy.vue diff --git a/example/components/changelog/readme.md b/example/components/changelog/readme.md index e682080..9dd357b 100644 --- a/example/components/changelog/readme.md +++ b/example/components/changelog/readme.md @@ -8,6 +8,13 @@
+### 2.5.8-beta.2 {page=#/changelog} + +* **[add]**: + - [DatePicker 日期选择器](#/date-picker) 年/月/日选择器 `cell-class` 配置回调函数参数增加 `pickerType` 属性,标识当前是什么类型的 picker + +--- + ### 2.5.8-beta.1 {page=#/changelog} * **[add]**: 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/package.json b/package.json index 653c84c..1afd2e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bk-magic-vue", - "version": "2.5.8-beta.1", + "version": "2.5.8-beta.2", "description": "基于蓝鲸 Magicbox 和 Vue 的前端组件库", "main": "dist/bk-magic-vue.min.js", "files": [ 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 aeeb8b9..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) } diff --git a/src/components/date-picker/base/year-table.vue b/src/components/date-picker/base/year-table.vue index 7ac780c..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) } diff --git a/src/components/date-picker/panel/date.vue b/src/components/date-picker/panel/date.vue index 9d7890b..79fc6a8 100644 --- a/src/components/date-picker/panel/date.vue +++ b/src/components/date-picker/panel/date.vue @@ -73,7 +73,7 @@
- + @@ -168,7 +169,8 @@ export default { currentView: selectionMode || 'date', pickerTable: this.getTableType(selectionMode), dates: dates, - panelDate: this.startDate || dates[0] || new Date() + panelDate: this.startDate || dates[0] || new Date(), + realPickerType: this.getRealPickerType(selectionMode) } }, computed: { @@ -184,6 +186,7 @@ export default { const handler = (type) => { return () => { this.pickerTable = this.getTableType(type) + this.realPickerType = this.getRealPickerType(type) } } @@ -218,6 +221,7 @@ export default { selectionMode (type) { this.currentView = type this.pickerTable = this.getTableType(type) + this.realPickerType = this.getRealPickerType(type) }, focusedDate (date) { const isDifferentYear = date.getFullYear() !== this.panelDate.getFullYear() @@ -233,6 +237,7 @@ export default { reset () { this.currentView = this.selectionMode this.pickerTable = this.getTableType(this.currentView) + this.realPickerType = this.getRealPickerType(this.currentView) }, changeYear (dir) { if (this.selectionMode === 'year' || this.pickerTable === 'year-table') { @@ -244,6 +249,9 @@ export default { getTableType (currentView) { return currentView.match(/^time/) ? 'time-picker' : `${currentView}-table` }, + getRealPickerType (currentView) { + return currentView.match(/^time/) ? 'time-picker' : `${currentView}` + }, changeMonth (dir) { this.panelDate = siblingMonth(this.panelDate, dir) }, @@ -251,8 +259,10 @@ export default { this.panelDate = value if (this.pickerTable === 'year-table') { this.pickerTable = 'month-table' + this.realPickerType = 'month' } else { this.pickerTable = this.getTableType(this.currentView) + this.realPickerType = this.getRealPickerType(this.currentView) } }, handlePick (value, type) { From 45600bc81b5ad7eba665f2d69036ecd020ecc1ea Mon Sep 17 00:00:00 2001 From: ielgnaw Date: Mon, 31 Jul 2023 20:46:23 +0800 Subject: [PATCH 09/43] feat: 2.5.8-beta.2 --- example/components/changelog/readme.md | 7 + .../components/date-picker/example copy.vue | 384 ------------------ package.json | 2 +- .../date-picker/base/date-table.vue | 9 +- .../date-picker/base/month-table.vue | 7 + .../date-picker/base/year-table.vue | 7 + src/components/date-picker/panel/date.vue | 14 +- 7 files changed, 42 insertions(+), 388 deletions(-) delete mode 100644 example/components/date-picker/example copy.vue diff --git a/example/components/changelog/readme.md b/example/components/changelog/readme.md index e682080..9dd357b 100644 --- a/example/components/changelog/readme.md +++ b/example/components/changelog/readme.md @@ -8,6 +8,13 @@
+### 2.5.8-beta.2 {page=#/changelog} + +* **[add]**: + - [DatePicker 日期选择器](#/date-picker) 年/月/日选择器 `cell-class` 配置回调函数参数增加 `pickerType` 属性,标识当前是什么类型的 picker + +--- + ### 2.5.8-beta.1 {page=#/changelog} * **[add]**: 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/package.json b/package.json index 653c84c..1afd2e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bk-magic-vue", - "version": "2.5.8-beta.1", + "version": "2.5.8-beta.2", "description": "基于蓝鲸 Magicbox 和 Vue 的前端组件库", "main": "dist/bk-magic-vue.min.js", "files": [ 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 aeeb8b9..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) } diff --git a/src/components/date-picker/base/year-table.vue b/src/components/date-picker/base/year-table.vue index 7ac780c..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) } diff --git a/src/components/date-picker/panel/date.vue b/src/components/date-picker/panel/date.vue index 9d7890b..79fc6a8 100644 --- a/src/components/date-picker/panel/date.vue +++ b/src/components/date-picker/panel/date.vue @@ -73,7 +73,7 @@
- + @@ -168,7 +169,8 @@ export default { currentView: selectionMode || 'date', pickerTable: this.getTableType(selectionMode), dates: dates, - panelDate: this.startDate || dates[0] || new Date() + panelDate: this.startDate || dates[0] || new Date(), + realPickerType: this.getRealPickerType(selectionMode) } }, computed: { @@ -184,6 +186,7 @@ export default { const handler = (type) => { return () => { this.pickerTable = this.getTableType(type) + this.realPickerType = this.getRealPickerType(type) } } @@ -218,6 +221,7 @@ export default { selectionMode (type) { this.currentView = type this.pickerTable = this.getTableType(type) + this.realPickerType = this.getRealPickerType(type) }, focusedDate (date) { const isDifferentYear = date.getFullYear() !== this.panelDate.getFullYear() @@ -233,6 +237,7 @@ export default { reset () { this.currentView = this.selectionMode this.pickerTable = this.getTableType(this.currentView) + this.realPickerType = this.getRealPickerType(this.currentView) }, changeYear (dir) { if (this.selectionMode === 'year' || this.pickerTable === 'year-table') { @@ -244,6 +249,9 @@ export default { getTableType (currentView) { return currentView.match(/^time/) ? 'time-picker' : `${currentView}-table` }, + getRealPickerType (currentView) { + return currentView.match(/^time/) ? 'time-picker' : `${currentView}` + }, changeMonth (dir) { this.panelDate = siblingMonth(this.panelDate, dir) }, @@ -251,8 +259,10 @@ export default { this.panelDate = value if (this.pickerTable === 'year-table') { this.pickerTable = 'month-table' + this.realPickerType = 'month' } else { this.pickerTable = this.getTableType(this.currentView) + this.realPickerType = this.getRealPickerType(this.currentView) } }, handlePick (value, type) { From 8b756e3112d14d27c9d351017a3af08f3a53ccc4 Mon Sep 17 00:00:00 2001 From: ielgnaw Date: Mon, 31 Jul 2023 21:23:28 +0800 Subject: [PATCH 10/43] feat: 2.5.8-beta.3 --- example/components/changelog/readme.md | 7 +++++++ package.json | 2 +- .../date-picker/panel/date-range.vue | 11 +++++++++++ src/components/date-picker/panel/date.vue | 18 +++++++----------- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/example/components/changelog/readme.md b/example/components/changelog/readme.md index 9dd357b..4f98053 100644 --- a/example/components/changelog/readme.md +++ b/example/components/changelog/readme.md @@ -8,6 +8,13 @@
+### 2.5.8-beta.3 {page=#/changelog} + +* **[update]**: + - [DatePicker 日期选择器](#/date-picker) 年/月/日选择器 `cell-class` 配置回调函数参数增加 `pickerType` 属性,标识当前是什么类型的 picker + +--- + ### 2.5.8-beta.2 {page=#/changelog} * **[add]**: diff --git a/package.json b/package.json index 1afd2e8..41f787a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bk-magic-vue", - "version": "2.5.8-beta.2", + "version": "2.5.8-beta.3", "description": "基于蓝鲸 Magicbox 和 Vue 的前端组件库", "main": "dist/bk-magic-vue.min.js", "files": [ 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 79fc6a8..2e29361 100644 --- a/src/components/date-picker/panel/date.vue +++ b/src/components/date-picker/panel/date.vue @@ -164,13 +164,14 @@ 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(), - realPickerType: this.getRealPickerType(selectionMode) + panelDate: this.startDate || dates[0] || new Date() } }, computed: { @@ -186,7 +187,6 @@ export default { const handler = (type) => { return () => { this.pickerTable = this.getTableType(type) - this.realPickerType = this.getRealPickerType(type) } } @@ -221,7 +221,6 @@ export default { selectionMode (type) { this.currentView = type this.pickerTable = this.getTableType(type) - this.realPickerType = this.getRealPickerType(type) }, focusedDate (date) { const isDifferentYear = date.getFullYear() !== this.panelDate.getFullYear() @@ -231,13 +230,15 @@ export default { this.panelDate = date } } + }, + pickerTable (val) { + this.realPickerType = val.replace('-table', '') } }, methods: { reset () { this.currentView = this.selectionMode this.pickerTable = this.getTableType(this.currentView) - this.realPickerType = this.getRealPickerType(this.currentView) }, changeYear (dir) { if (this.selectionMode === 'year' || this.pickerTable === 'year-table') { @@ -249,9 +250,6 @@ export default { getTableType (currentView) { return currentView.match(/^time/) ? 'time-picker' : `${currentView}-table` }, - getRealPickerType (currentView) { - return currentView.match(/^time/) ? 'time-picker' : `${currentView}` - }, changeMonth (dir) { this.panelDate = siblingMonth(this.panelDate, dir) }, @@ -259,10 +257,8 @@ export default { this.panelDate = value if (this.pickerTable === 'year-table') { this.pickerTable = 'month-table' - this.realPickerType = 'month' } else { this.pickerTable = this.getTableType(this.currentView) - this.realPickerType = this.getRealPickerType(this.currentView) } }, handlePick (value, type) { From a89080b833168c7fcbb4c76cb2058966573f20ad Mon Sep 17 00:00:00 2001 From: ielgnaw Date: Mon, 31 Jul 2023 21:23:28 +0800 Subject: [PATCH 11/43] feat: 2.5.8-beta.3 --- example/components/changelog/readme.md | 7 +++++++ package.json | 2 +- .../date-picker/panel/date-range.vue | 11 +++++++++++ src/components/date-picker/panel/date.vue | 18 +++++++----------- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/example/components/changelog/readme.md b/example/components/changelog/readme.md index 9dd357b..4f98053 100644 --- a/example/components/changelog/readme.md +++ b/example/components/changelog/readme.md @@ -8,6 +8,13 @@
+### 2.5.8-beta.3 {page=#/changelog} + +* **[update]**: + - [DatePicker 日期选择器](#/date-picker) 年/月/日选择器 `cell-class` 配置回调函数参数增加 `pickerType` 属性,标识当前是什么类型的 picker + +--- + ### 2.5.8-beta.2 {page=#/changelog} * **[add]**: diff --git a/package.json b/package.json index 1afd2e8..41f787a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bk-magic-vue", - "version": "2.5.8-beta.2", + "version": "2.5.8-beta.3", "description": "基于蓝鲸 Magicbox 和 Vue 的前端组件库", "main": "dist/bk-magic-vue.min.js", "files": [ 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 79fc6a8..2e29361 100644 --- a/src/components/date-picker/panel/date.vue +++ b/src/components/date-picker/panel/date.vue @@ -164,13 +164,14 @@ 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(), - realPickerType: this.getRealPickerType(selectionMode) + panelDate: this.startDate || dates[0] || new Date() } }, computed: { @@ -186,7 +187,6 @@ export default { const handler = (type) => { return () => { this.pickerTable = this.getTableType(type) - this.realPickerType = this.getRealPickerType(type) } } @@ -221,7 +221,6 @@ export default { selectionMode (type) { this.currentView = type this.pickerTable = this.getTableType(type) - this.realPickerType = this.getRealPickerType(type) }, focusedDate (date) { const isDifferentYear = date.getFullYear() !== this.panelDate.getFullYear() @@ -231,13 +230,15 @@ export default { this.panelDate = date } } + }, + pickerTable (val) { + this.realPickerType = val.replace('-table', '') } }, methods: { reset () { this.currentView = this.selectionMode this.pickerTable = this.getTableType(this.currentView) - this.realPickerType = this.getRealPickerType(this.currentView) }, changeYear (dir) { if (this.selectionMode === 'year' || this.pickerTable === 'year-table') { @@ -249,9 +250,6 @@ export default { getTableType (currentView) { return currentView.match(/^time/) ? 'time-picker' : `${currentView}-table` }, - getRealPickerType (currentView) { - return currentView.match(/^time/) ? 'time-picker' : `${currentView}` - }, changeMonth (dir) { this.panelDate = siblingMonth(this.panelDate, dir) }, @@ -259,10 +257,8 @@ export default { this.panelDate = value if (this.pickerTable === 'year-table') { this.pickerTable = 'month-table' - this.realPickerType = 'month' } else { this.pickerTable = this.getTableType(this.currentView) - this.realPickerType = this.getRealPickerType(this.currentView) } }, handlePick (value, type) { From e62ae60fa0c92173cd1b1e0839743a8f0ca60477 Mon Sep 17 00:00:00 2001 From: israelli Date: Tue, 1 Aug 2023 11:44:18 +0800 Subject: [PATCH 12/43] =?UTF-8?q?bugfix(message):=20message=20=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=B6=88=E6=81=AF=E5=86=85=E5=AE=B9=20VNode?= =?UTF-8?q?=E6=8A=A5=E9=94=99=20#426?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/config.js | 2 +- src/components/message/message.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build/config.js b/build/config.js index d6c7ad3..c75433f 100644 --- a/build/config.js +++ b/build/config.js @@ -41,7 +41,7 @@ module.exports = { }, dev: { env: devEnv, - port: 8002, + port: 8006, proxyTable: {} } } diff --git a/src/components/message/message.js b/src/components/message/message.js index d1e9759..84a9852 100644 --- a/src/components/message/message.js +++ b/src/components/message/message.js @@ -39,7 +39,16 @@ const messageList = [] let seed = 0 const BkMessage = function (config) { - const originConfig = typeof config === 'object' ? JSON.parse(JSON.stringify(config)) : config + const formatConfig = () => { + if (typeof config === 'object') { + if (config.message && !config.message.hasOwnProperty('componentOptions')) { + return JSON.parse(JSON.stringify(config)) + } + } + + return config + } + const originConfig = formatConfig() // 限制个数为 0 时,清除所有实例 if (config.limit === 0) { BkMessage.batchClose() From 9810e4c19da4b9a2e1313658b37349f7fce59f8d Mon Sep 17 00:00:00 2001 From: israelli Date: Tue, 1 Aug 2023 11:44:54 +0800 Subject: [PATCH 13/43] =?UTF-8?q?bugfix(message):=20message=20=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=B6=88=E6=81=AF=E5=86=85=E5=AE=B9=20VNode?= =?UTF-8?q?=E6=8A=A5=E9=94=99=20#426?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/config.js b/build/config.js index c75433f..d6c7ad3 100644 --- a/build/config.js +++ b/build/config.js @@ -41,7 +41,7 @@ module.exports = { }, dev: { env: devEnv, - port: 8006, + port: 8002, proxyTable: {} } } From 9fa23dd28b25058dc559afdb5c1b0a6b49cf410e Mon Sep 17 00:00:00 2001 From: hitozhang <1214105385@qq.com> Date: Tue, 8 Aug 2023 15:59:52 +0800 Subject: [PATCH 14/43] =?UTF-8?q?bugfix(select):=20=E4=BF=AE=E5=A4=8Dcheck?= =?UTF-8?q?box=E6=A8=A1=E5=BC=8F=E6=97=B6options=E7=9A=84disabled=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=B2=A1=E6=9C=89=E4=BC=A0=E9=80=92=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20#428?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/components/select/example.vue | 7 ++++--- src/components/select/option.vue | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/example/components/select/example.vue b/example/components/select/example.vue index b159715..8a863f3 100644 --- a/example/components/select/example.vue +++ b/example/components/select/example.vue @@ -28,10 +28,11 @@