From 7bbaa84aa5591b7c8a8b94cf0b97ca7896a577df Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 00:32:57 -0300 Subject: [PATCH 01/18] fix(b-table, b-table-lite, b-table-simple): handle header variant --- src/components/table/td.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/table/td.js b/src/components/table/td.js index b35763c831f..3c0fc0976f5 100644 --- a/src/components/table/td.js +++ b/src/components/table/td.js @@ -124,7 +124,8 @@ export const BTd = /*#__PURE__*/ Vue.extend({ let variant = this.variant if ( (!variant && this.isStickyHeader && !this.headVariant) || - (!variant && this.isStickyColumn) + (!variant && this.isStickyColumn && this.isTbody) || + (!variant && this.isStickyColumn && this.isThead && !this.headVariant) ) { // Needed for sticky-header mode as Bootstrap v4 table cells do // not inherit parent's background-color. Boo! From 3cf632245a09e24071ba86f6dc2bbd82a218ff29 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 00:40:02 -0300 Subject: [PATCH 02/18] Update tfoot.js --- src/components/table/tfoot.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/table/tfoot.js b/src/components/table/tfoot.js index 4e21ec21c10..ffcf6d69ab0 100644 --- a/src/components/table/tfoot.js +++ b/src/components/table/tfoot.js @@ -33,6 +33,7 @@ export const BTfoot = /*#__PURE__*/ Vue.extend({ // Sniffed by / / return true }, + /* istanbul ignore next: Not currently sniffed in tests */ isDark() /* istanbul ignore next: Not currently sniffed in tests */ { // Sniffed by / / return this.bvTable.dark @@ -56,6 +57,7 @@ export const BTfoot = /*#__PURE__*/ Vue.extend({ // background color inheritance with Bootstrap v4 table CSS return !this.isStacked && this.bvTable.stickyHeader }, + /* istanbul ignore next: Not currently sniffed in tests */ tableVariant() /* istanbul ignore next: Not currently sniffed in tests */ { // Sniffed by / / return this.bvTable.tableVariant From 51e7ada21666f892dbb40c4657951b691f4fc1d1 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 00:40:54 -0300 Subject: [PATCH 03/18] Update tbody.js --- src/components/table/tbody.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/table/tbody.js b/src/components/table/tbody.js index 50672312daa..a0df7b36ee1 100644 --- a/src/components/table/tbody.js +++ b/src/components/table/tbody.js @@ -60,6 +60,7 @@ export const BTbody = /*#__PURE__*/ Vue.extend({ // background color inheritance with Bootstrap v4 table CSS return !this.isStacked && this.bvTable.stickyHeader }, + /* istanbul ignore next: Not currently sniffed in tests * tableVariant() /* istanbul ignore next: Not currently sniffed in tests */ { // Sniffed by / / return this.bvTable.tableVariant From 532e4073109d5c613d9efa0c6336c88e60a21353 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 00:44:52 -0300 Subject: [PATCH 04/18] Update tbody.js --- src/components/table/tbody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/table/tbody.js b/src/components/table/tbody.js index a0df7b36ee1..1728cd390a5 100644 --- a/src/components/table/tbody.js +++ b/src/components/table/tbody.js @@ -60,7 +60,7 @@ export const BTbody = /*#__PURE__*/ Vue.extend({ // background color inheritance with Bootstrap v4 table CSS return !this.isStacked && this.bvTable.stickyHeader }, - /* istanbul ignore next: Not currently sniffed in tests * + /* istanbul ignore next: Not currently sniffed in tests */ tableVariant() /* istanbul ignore next: Not currently sniffed in tests */ { // Sniffed by / / return this.bvTable.tableVariant From 1778085c5e1d6736d128b44e0c894754cfc496ac Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 00:58:44 -0300 Subject: [PATCH 05/18] Update td.js --- src/components/table/td.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/table/td.js b/src/components/table/td.js index 3c0fc0976f5..e1bfdf0b577 100644 --- a/src/components/table/td.js +++ b/src/components/table/td.js @@ -124,7 +124,7 @@ export const BTd = /*#__PURE__*/ Vue.extend({ let variant = this.variant if ( (!variant && this.isStickyHeader && !this.headVariant) || - (!variant && this.isStickyColumn && this.isTbody) || + (!variant && this.isStickyColumn && !this.isThead) || (!variant && this.isStickyColumn && this.isThead && !this.headVariant) ) { // Needed for sticky-header mode as Bootstrap v4 table cells do From 550cb2f40b00167416f522ade12b31c911dee2ca Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 01:28:09 -0300 Subject: [PATCH 06/18] Update td.js --- src/components/table/td.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/table/td.js b/src/components/table/td.js index e1bfdf0b577..58c77b1750d 100644 --- a/src/components/table/td.js +++ b/src/components/table/td.js @@ -104,8 +104,7 @@ export const BTd = /*#__PURE__*/ Vue.extend({ headVariant() { return this.bvTableTr.headVariant }, - /* istanbul ignore next: need to add in tests for footer variant */ - footVariant() /* istanbul ignore next: need to add in tests for footer variant */ { + footVariant() { return this.bvTableTr.footVariant }, tableVariant() { @@ -120,12 +119,12 @@ export const BTd = /*#__PURE__*/ Vue.extend({ cellClasses() { // We use computed props here for improved performance by caching // the results of the string interpolation - // TODO: need to add handling for footVariant let variant = this.variant if ( (!variant && this.isStickyHeader && !this.headVariant) || - (!variant && this.isStickyColumn && !this.isThead) || - (!variant && this.isStickyColumn && this.isThead && !this.headVariant) + (!variant && this.isStickyColumn && this.isTbody) || + (!variant && this.isStickyColumn && this.isThead && !this.headVariant) || + (!variant && this.isStickyColumn && this.isTfoot && !this.footVariant) ) { // Needed for sticky-header mode as Bootstrap v4 table cells do // not inherit parent's background-color. Boo! From a995597079757344a563a1c98026173a437ed9d1 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 01:33:17 -0300 Subject: [PATCH 07/18] Update td.js --- src/components/table/td.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/table/td.js b/src/components/table/td.js index 58c77b1750d..57cf3577caa 100644 --- a/src/components/table/td.js +++ b/src/components/table/td.js @@ -122,9 +122,9 @@ export const BTd = /*#__PURE__*/ Vue.extend({ let variant = this.variant if ( (!variant && this.isStickyHeader && !this.headVariant) || - (!variant && this.isStickyColumn && this.isTbody) || + (!variant && this.isStickyColumn && this.isTfoot && !this.footVariant) || (!variant && this.isStickyColumn && this.isThead && !this.headVariant) || - (!variant && this.isStickyColumn && this.isTfoot && !this.footVariant) + (!variant && this.isStickyColumn && this.isTbody) ) { // Needed for sticky-header mode as Bootstrap v4 table cells do // not inherit parent's background-color. Boo! From 04561cae20bdb715165774d376265a22b0c08b50 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 01:57:04 -0300 Subject: [PATCH 08/18] Update tbody.js --- src/components/table/tbody.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/table/tbody.js b/src/components/table/tbody.js index 1728cd390a5..5f7938c9afb 100644 --- a/src/components/table/tbody.js +++ b/src/components/table/tbody.js @@ -12,6 +12,9 @@ export const props = { } } +// TODO: +// In Bootstrap v5, we won't need "sniffing" as table element variants properly inherit +// to the child elements, so this can be converted to a functional component // @vue/component export const BTbody = /*#__PURE__*/ Vue.extend({ name: 'BTbody', From b1a09db5d01cba62b3c7b65db989e2faab38051a Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 01:57:25 -0300 Subject: [PATCH 09/18] Update tfoot.js --- src/components/table/tfoot.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/table/tfoot.js b/src/components/table/tfoot.js index ffcf6d69ab0..50e185ba11b 100644 --- a/src/components/table/tfoot.js +++ b/src/components/table/tfoot.js @@ -8,6 +8,9 @@ export const props = { } } +// TODO: +// In Bootstrap v5, we won't need "sniffing" as table element variants properly inherit +// to the child elements, so this can be converted to a functional component // @vue/component export const BTfoot = /*#__PURE__*/ Vue.extend({ name: 'BTfoot', From ef4cbbb093d1549f3372f1f537225a832a21a935 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 01:57:54 -0300 Subject: [PATCH 10/18] Update td.js --- src/components/table/td.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/table/td.js b/src/components/table/td.js index 57cf3577caa..2e4cdb1caf7 100644 --- a/src/components/table/td.js +++ b/src/components/table/td.js @@ -38,6 +38,9 @@ export const props = { } } +// TODO: +// In Bootstrap v5, we won't need "sniffing" as table element variants properly inherit +// to the child elements, so this can be converted to a functional component // @vue/component export const BTd = /*#__PURE__*/ Vue.extend({ name: 'BTableCell', From e5b8c0d2ba0c2cfabfb9235b8b293da09568e7d0 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 01:58:49 -0300 Subject: [PATCH 11/18] Update th.js --- src/components/table/th.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/table/th.js b/src/components/table/th.js index a7bd353e562..bc84165b65e 100644 --- a/src/components/table/th.js +++ b/src/components/table/th.js @@ -1,6 +1,9 @@ import Vue from '../../utils/vue' import { BTd } from './td' +// TODO: +// In Bootstrap v5, we won't need "sniffing" as table element variants properly inherit +// to the child elements, so this can be converted to a functional component // @vue/component export const BTh = /*#__PURE__*/ Vue.extend({ name: 'BTh', From 74c995f8fa8af1347456d00f15b913258f8946ab Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 01:59:09 -0300 Subject: [PATCH 12/18] Update tr.js --- src/components/table/tr.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/table/tr.js b/src/components/table/tr.js index 4acdc7af8d7..47601f04cbb 100644 --- a/src/components/table/tr.js +++ b/src/components/table/tr.js @@ -11,6 +11,9 @@ export const props = { const LIGHT = 'light' const DARK = 'dark' +// TODO: +// In Bootstrap v5, we won't need "sniffing" as table element variants properly inherit +// to the child elements, so this can be converted to a functional component // @vue/component export const BTr = /*#__PURE__*/ Vue.extend({ name: 'BTr', From 26c2d91d840476f1385d6697d3bd1688b186c50d Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 01:59:42 -0300 Subject: [PATCH 13/18] Update thead.js --- src/components/table/thead.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/table/thead.js b/src/components/table/thead.js index 92cdeb7c938..d7ba068a1d9 100644 --- a/src/components/table/thead.js +++ b/src/components/table/thead.js @@ -9,6 +9,9 @@ export const props = { } } +// TODO: +// In Bootstrap v5, we won't need "sniffing" as table element variants properly inherit +// to the child elements, so this can be converted to a functional component // @vue/component export const BThead = /*#__PURE__*/ Vue.extend({ name: 'BThead', From e59a25992867e795e4337c25c426ce204ec8ca4a Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 02:10:46 -0300 Subject: [PATCH 14/18] Update td.js --- src/components/table/td.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/table/td.js b/src/components/table/td.js index 2e4cdb1caf7..c3c950b4973 100644 --- a/src/components/table/td.js +++ b/src/components/table/td.js @@ -107,7 +107,8 @@ export const BTd = /*#__PURE__*/ Vue.extend({ headVariant() { return this.bvTableTr.headVariant }, - footVariant() { + /* istanbul ignore next: need to add in tests for footer variant */ + footVariant() /* istanbul ignore next: need to add in tests for footer variant */ { return this.bvTableTr.footVariant }, tableVariant() { From 867466af37d489b0c55c179fa975453dae9af49e Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 02:35:56 -0300 Subject: [PATCH 15/18] Update td.js --- src/components/table/td.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/table/td.js b/src/components/table/td.js index c3c950b4973..03b129c71c1 100644 --- a/src/components/table/td.js +++ b/src/components/table/td.js @@ -107,8 +107,7 @@ export const BTd = /*#__PURE__*/ Vue.extend({ headVariant() { return this.bvTableTr.headVariant }, - /* istanbul ignore next: need to add in tests for footer variant */ - footVariant() /* istanbul ignore next: need to add in tests for footer variant */ { + footVariant() { return this.bvTableTr.footVariant }, tableVariant() { @@ -126,9 +125,9 @@ export const BTd = /*#__PURE__*/ Vue.extend({ let variant = this.variant if ( (!variant && this.isStickyHeader && !this.headVariant) || - (!variant && this.isStickyColumn && this.isTfoot && !this.footVariant) || - (!variant && this.isStickyColumn && this.isThead && !this.headVariant) || - (!variant && this.isStickyColumn && this.isTbody) + (!variant && this.isStickyColumn && this.inTfoot && !this.footVariant) || + (!variant && this.isStickyColumn && this.inThead && !this.headVariant) || + (!variant && this.isStickyColumn && this.inTbody) ) { // Needed for sticky-header mode as Bootstrap v4 table cells do // not inherit parent's background-color. Boo! From d88bf4f403f250f916307254e55968e5f8707ac3 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 02:53:26 -0300 Subject: [PATCH 16/18] Update tbody.js --- src/components/table/tbody.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/table/tbody.js b/src/components/table/tbody.js index 5f7938c9afb..61920237b20 100644 --- a/src/components/table/tbody.js +++ b/src/components/table/tbody.js @@ -63,8 +63,7 @@ export const BTbody = /*#__PURE__*/ Vue.extend({ // background color inheritance with Bootstrap v4 table CSS return !this.isStacked && this.bvTable.stickyHeader }, - /* istanbul ignore next: Not currently sniffed in tests */ - tableVariant() /* istanbul ignore next: Not currently sniffed in tests */ { + tableVariant() { // Sniffed by / / return this.bvTable.tableVariant }, From 0a210b0acebe82766e22d288624f98a1cf41a6ae Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 02:58:21 -0300 Subject: [PATCH 17/18] Update tfoot.js --- src/components/table/tfoot.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/table/tfoot.js b/src/components/table/tfoot.js index 50e185ba11b..98f35ea5e7d 100644 --- a/src/components/table/tfoot.js +++ b/src/components/table/tfoot.js @@ -60,8 +60,7 @@ export const BTfoot = /*#__PURE__*/ Vue.extend({ // background color inheritance with Bootstrap v4 table CSS return !this.isStacked && this.bvTable.stickyHeader }, - /* istanbul ignore next: Not currently sniffed in tests */ - tableVariant() /* istanbul ignore next: Not currently sniffed in tests */ { + tableVariant() { // Sniffed by / / return this.bvTable.tableVariant }, From d1cbd7083a47ddbc4a2fe95e58df4b1d159f6d35 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Thu, 30 Apr 2020 03:00:57 -0300 Subject: [PATCH 18/18] Update tfoot.js --- src/components/table/tfoot.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/table/tfoot.js b/src/components/table/tfoot.js index 98f35ea5e7d..534d2889c38 100644 --- a/src/components/table/tfoot.js +++ b/src/components/table/tfoot.js @@ -36,8 +36,7 @@ export const BTfoot = /*#__PURE__*/ Vue.extend({ // Sniffed by / / return true }, - /* istanbul ignore next: Not currently sniffed in tests */ - isDark() /* istanbul ignore next: Not currently sniffed in tests */ { + isDark() { // Sniffed by / / return this.bvTable.dark },