@@ -45,21 +45,10 @@ export const BTd = /*#__PURE__*/ Vue.extend({
45
45
mixins: [normalizeSlotMixin],
46
46
inheritAttrs: false,
47
47
inject: {
48
-
// Injections for feature / attribute detection
49
-
bvTable: {
50
-
default: null
51
-
},
52
-
bvTableTbody: {
53
-
default: null
54
-
},
55
-
bvTableThead: {
56
-
default: null
57
-
},
58
-
bvTableTfoot: {
59
-
default: null
60
-
},
61
48
bvTableTr: {
62
-
default: null
49
+
default() /* istanbul ignore next */ {
50
+
return {}
51
+
}
63
52
}
64
53
},
65
54
props,
@@ -68,72 +57,82 @@ export const BTd = /*#__PURE__*/ Vue.extend({
68
57
// Overridden by <b-th>
69
58
return 'td'
70
59
},
60
+
inTbody() {
61
+
return this.bvTableTr.inTbody
62
+
},
63
+
inThead() {
64
+
return this.bvTableTr.inThead
65
+
},
66
+
inTfoot() {
67
+
return this.bvTableTr.inTfoot
68
+
},
71
69
isDark() {
72
-
return this.bvTable && this.bvTable.dark
70
+
return this.bvTableTr.isDark
73
71
},
74
72
isStacked() {
75
-
return this.bvTable && this.bvTable.isStacked
73
+
return this.bvTableTr.isStacked
76
74
},
77
75
isStackedCell() {
78
76
// We only support stacked-heading in tbody in stacked mode
79
-
return this.bvTableTbody && this.isStacked
77
+
return this.inTbody && this.isStacked
80
78
},
81
79
isResponsive() {
82
-
return this.bvTable && this.bvTable.isResponsive && !this.isStacked
80
+
return this.bvTableTr.isResponsive
83
81
},
84
82
isStickyHeader() {
85
83
// Needed to handle header background classes, due to lack of
86
84
// background color inheritance with Bootstrap v4 table CSS
87
85
// Sticky headers only apply to cells in table `thead`
88
-
return (
89
-
!this.isStacked &&
90
-
this.bvTable &&
91
-
this.bvTableThead &&
92
-
this.bvTableTr &&
93
-
this.bvTable.stickyHeader
94
-
)
86
+
return this.bvTableTr.isStickyHeader
95
87
},
96
88
isStickyColumn() {
97
89
// Needed to handle header background classes, due to lack of
98
90
// background color inheritance with Bootstrap v4 table CSS
99
91
// Sticky column cells are only available in responsive
100
92
// mode (horizontal scrolling) or when sticky header mode
101
93
// Applies to cells in `thead`, `tbody` and `tfoot`
102
-
return (
103
-
(this.isResponsive || this.isStickyHeader) &&
104
-
this.stickyColumn &&
105
-
!this.isStacked &&
106
-
this.bvTable &&
107
-
this.bvTableTr
108
-
)
94
+
return !this.isStacked && (this.isResponsive || this.isStickyHeader) && this.stickyColumn
95
+
},
96
+
rowVariant() {
97
+
return this.bvTableTr.variant
98
+
},
99
+
headVariant() {
100
+
return this.bvTableTr.headVariant
101
+
},
102
+
footVariant() /* istanbul ignore next: need to add in tests for footer variant */ {
103
+
return this.bvTableTr.footVariant
104
+
},
105
+
tableVariant() {
106
+
return this.bvTableTr.tableVariant
107
+
},
108
+
computedColspan() {
109
+
return parseSpan(this.colspan)
110
+
},
111
+
computedRowspan() {
112
+
return parseSpan(this.rowspan)
109
113
},
110
114
cellClasses() {
111
115
// We use computed props here for improved performance by caching
112
116
// the results of the string interpolation
117
+
// TODO: need to add handling for footVariant
113
118
let variant = this.variant
114
119
if (
115
-
(!variant && this.isStickyHeader && !this.bvTableThead.headVariant) ||
120
+
(!variant && this.isStickyHeader && !this.headVariant) ||
116
121
(!variant && this.isStickyColumn)
117
122
) {
118
123
// Needed for sticky-header mode as Bootstrap v4 table cells do
119
124
// not inherit parent's background-color. Boo!
120
-
variant = this.bvTableTr.variant || this.bvTable.tableVariant || 'b-table-default'
125
+
variant = this.rowVariant || this.tableVariant || 'b-table-default'
121
126
}
122
127
return [
123
128
variant ? `${this.isDark ? 'bg' : 'table'}-${variant}` : null,
124
129
this.isStickyColumn ? 'b-table-sticky-column' : null
125
130
]
126
131
},
127
-
computedColspan() {
128
-
return parseSpan(this.colspan)
129
-
},
130
-
computedRowspan() {
131
-
return parseSpan(this.rowspan)
132
-
},
133
132
cellAttrs() {
134
133
// We use computed props here for improved performance by caching
135
134
// the results of the object spread (Object.assign)
136
-
const headOrFoot = this.bvTableThead || this.bvTableTfoot
135
+
const headOrFoot = this.inThead || this.inTfoot
137
136
// Make sure col/rowspan's are > 0 or null
138
137
const colspan = this.computedColspan
139
138
const rowspan = this.computedRowspan
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4