+237
-40
lines changedFilter options
+237
-40
lines changed Original file line number Diff line number Diff line change
@@ -114,6 +114,7 @@ export const props = makePropsConfigurable(
114
114
// 'ltr', 'rtl', or `null` (for auto detect)
115
115
direction: makeProp(PROP_TYPE_STRING),
116
116
disabled: makeProp(PROP_TYPE_BOOLEAN, false),
117
+
headerTag: makeProp(PROP_TYPE_STRING, 'header'),
117
118
// When `true`, renders a comment node, but keeps the component instance active
118
119
// Mainly for <b-form-date>, so that we can get the component's value and locale
119
120
// But we might just use separate date formatters, using the resolved locale
@@ -806,7 +807,7 @@ export const BCalendar = Vue.extend({
806
807
: this.labelNoDateSelected || '\u00a0' // ' '
807
808
)
808
809
$header = h(
809
-
'header',
810
+
this.headerTag,
810
811
{
811
812
staticClass: 'b-calendar-header',
812
813
class: { 'sr-only': this.hideHeader },
@@ -936,7 +937,7 @@ export const BCalendar = Vue.extend({
936
937
937
938
// Caption for calendar grid
938
939
const $gridCaption = h(
939
-
'header',
940
+
'div',
940
941
{
941
942
staticClass: 'b-calendar-grid-caption text-center font-weight-bold',
942
943
class: { 'text-muted': disabled },
@@ -1065,7 +1066,7 @@ export const BCalendar = Vue.extend({
1065
1066
)
1066
1067
1067
1068
const $gridHelp = h(
1068
-
'footer',
1069
+
'div',
1069
1070
{
1070
1071
staticClass: 'b-calendar-grid-help border-top small text-muted text-center bg-light',
1071
1072
attrs: {
Original file line number Diff line number Diff line change
@@ -244,6 +244,26 @@ describe('calendar', () => {
244
244
wrapper.destroy()
245
245
})
246
246
247
+
it('has correct header tag when "header-tag" prop is set', async () => {
248
+
const wrapper = mount(BCalendar, {
249
+
attachTo: createContainer(),
250
+
propsData: {
251
+
value: '2020-02-15', // Leap year,
252
+
headerTag: 'div'
253
+
}
254
+
})
255
+
256
+
expect(wrapper.vm).toBeDefined()
257
+
await waitNT(wrapper.vm)
258
+
await waitRAF()
259
+
260
+
const $header = wrapper.find('.b-calendar-header')
261
+
expect($header.exists()).toBe(true)
262
+
expect($header.element.tagName).toBe('DIV')
263
+
264
+
wrapper.destroy()
265
+
})
266
+
247
267
it('keyboard navigation works', async () => {
248
268
const wrapper = mount(BCalendar, {
249
269
attachTo: createContainer(),
Original file line number Diff line number Diff line change
@@ -36,6 +36,11 @@
36
36
"prop": "disabled",
37
37
"description": "Places the calendar in a non-interactive disabled state"
38
38
},
39
+
{
40
+
"prop": "headerTag",
41
+
"version": "2.22.0",
42
+
"description": "Specify the HTML tag to render instead of the default tag for the footer"
43
+
},
39
44
{
40
45
"prop": "hidden",
41
46
"description": "When `true`, renders a comment node instead of the calendar widget while keeping the Vue instance active. Mainly used when implementing a custom date picker"
Original file line number Diff line number Diff line change
@@ -128,13 +128,15 @@ export const props = makePropsConfigurable(
128
128
footerBgVariant: makeProp(PROP_TYPE_STRING),
129
129
footerBorderVariant: makeProp(PROP_TYPE_STRING),
130
130
footerClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
131
+
footerTag: makeProp(PROP_TYPE_STRING, 'footer'),
131
132
footerTextVariant: makeProp(PROP_TYPE_STRING),
132
133
headerBgVariant: makeProp(PROP_TYPE_STRING),
133
134
headerBorderVariant: makeProp(PROP_TYPE_STRING),
134
135
headerClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
135
136
headerCloseContent: makeProp(PROP_TYPE_STRING, '×'),
136
137
headerCloseLabel: makeProp(PROP_TYPE_STRING, 'Close'),
137
138
headerCloseVariant: makeProp(PROP_TYPE_STRING),
139
+
headerTag: makeProp(PROP_TYPE_STRING, 'header'),
138
140
headerTextVariant: makeProp(PROP_TYPE_STRING),
139
141
// TODO: Rename to `noBackdrop` and deprecate `hideBackdrop`
140
142
hideBackdrop: makeProp(PROP_TYPE_BOOLEAN, false),
@@ -813,7 +815,7 @@ export const BModal = /*#__PURE__*/ Vue.extend({
813
815
}
814
816
815
817
$header = h(
816
-
'header',
818
+
this.headerTag,
817
819
{
818
820
staticClass: 'modal-header',
819
821
class: this.headerClasses,
@@ -887,7 +889,7 @@ export const BModal = /*#__PURE__*/ Vue.extend({
887
889
}
888
890
889
891
$footer = h(
890
-
'footer',
892
+
this.footerTag,
891
893
{
892
894
staticClass: 'modal-footer',
893
895
class: this.footerClasses,
Original file line number Diff line number Diff line change
@@ -262,6 +262,48 @@ describe('modal', () => {
262
262
263
263
wrapper.destroy()
264
264
})
265
+
266
+
it('has correct header tag when "header-tag" prop is set', async () => {
267
+
const wrapper = mount(BModal, {
268
+
attachTo: createContainer(),
269
+
propsData: {
270
+
static: true,
271
+
id: 'test',
272
+
headerTag: 'div'
273
+
}
274
+
})
275
+
276
+
expect(wrapper.vm).toBeDefined()
277
+
await waitNT(wrapper.vm)
278
+
await waitRAF()
279
+
280
+
const $header = wrapper.find('.modal-header')
281
+
expect($header.exists()).toBe(true)
282
+
expect($header.element.tagName).toBe('DIV')
283
+
284
+
wrapper.destroy()
285
+
})
286
+
287
+
it('has correct footer tag when "footer-tag" prop is set', async () => {
288
+
const wrapper = mount(BModal, {
289
+
attachTo: createContainer(),
290
+
propsData: {
291
+
static: true,
292
+
id: 'test',
293
+
footerTag: 'div'
294
+
}
295
+
})
296
+
297
+
expect(wrapper.vm).toBeDefined()
298
+
await waitNT(wrapper.vm)
299
+
await waitRAF()
300
+
301
+
const $footer = wrapper.find('.modal-footer')
302
+
expect($footer.exists()).toBe(true)
303
+
expect($footer.element.tagName).toBe('DIV')
304
+
305
+
wrapper.destroy()
306
+
})
265
307
})
266
308
267
309
describe('default button content, classes and attributes', () => {
Original file line number Diff line number Diff line change
@@ -104,6 +104,11 @@
104
104
"prop": "footerTextVariant",
105
105
"description": "Applies one of the Bootstrap theme color variants to the footer text"
106
106
},
107
+
{
108
+
"prop": "footerTag",
109
+
"version": "2.22.0",
110
+
"description": "Specify the HTML tag to render instead of the default tag for the footer"
111
+
},
107
112
{
108
113
"prop": "headerBgVariant",
109
114
"description": "Applies one of the Bootstrap theme color variants to the header background"
@@ -133,6 +138,11 @@
133
138
"prop": "headerTextVariant",
134
139
"description": "Applies one of the Bootstrap theme color variants to the header text"
135
140
},
141
+
{
142
+
"prop": "headerTag",
143
+
"version": "2.22.0",
144
+
"description": "Specify the HTML tag to render instead of the default tag for the footer"
145
+
},
136
146
{
137
147
"prop": "hideBackdrop",
138
148
"description": "Disables rendering of the modal backdrop"
Original file line number Diff line number Diff line change
@@ -39,10 +39,20 @@
39
39
"prop": "footerClass",
40
40
"description": "Class, or classes, to apply to the optional `footer` slot"
41
41
},
42
+
{
43
+
"prop": "footerTag",
44
+
"version": "2.22.0",
45
+
"description": "Specify the HTML tag to render instead of the default tag for the footer"
46
+
},
42
47
{
43
48
"prop": "headerClass",
44
49
"description": "Class, or classes, to apply to the built in header. Has no effect if prop `no-header` is set"
45
50
},
51
+
{
52
+
"prop": "headerTag",
53
+
"version": "2.22.0",
54
+
"description": "Specify the HTML tag to render instead of the default tag for the footer"
55
+
},
46
56
{
47
57
"prop": "lazy",
48
58
"description": "When set to `true`, the content of the sidebar will only be rendered while the sidebar is open"
Original file line number Diff line number Diff line change
@@ -67,7 +67,9 @@ export const props = makePropsConfigurable(
67
67
// `aria-label` for close button
68
68
closeLabel: makeProp(PROP_TYPE_STRING),
69
69
footerClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
70
+
footerTag: makeProp(PROP_TYPE_STRING, 'footer'),
70
71
headerClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
72
+
headerTag: makeProp(PROP_TYPE_STRING, 'header'),
71
73
lazy: makeProp(PROP_TYPE_BOOLEAN, false),
72
74
noCloseOnBackdrop: makeProp(PROP_TYPE_BOOLEAN, false),
73
75
noCloseOnEsc: makeProp(PROP_TYPE_BOOLEAN, false),
@@ -131,7 +133,7 @@ const renderHeader = (h, ctx) => {
131
133
}
132
134
133
135
return h(
134
-
'header',
136
+
ctx.headerTag,
135
137
{
136
138
staticClass: `${CLASS_NAME}-header`,
137
139
class: ctx.headerClass,
@@ -160,7 +162,7 @@ const renderFooter = (h, ctx) => {
160
162
}
161
163
162
164
return h(
163
-
'footer',
165
+
ctx.footerTag,
164
166
{
165
167
staticClass: `${CLASS_NAME}-footer`,
166
168
class: ctx.footerClass,
Original file line number Diff line number Diff line change
@@ -331,7 +331,8 @@ describe('sidebar', () => {
331
331
propsData: {
332
332
id: 'sidebar-header-slot',
333
333
visible: true,
334
-
title: 'TITLE'
334
+
title: 'TITLE',
335
+
headerTag: 'div'
335
336
},
336
337
slots: {
337
338
header: 'Custom header'
@@ -343,6 +344,7 @@ describe('sidebar', () => {
343
344
344
345
const $header = wrapper.find('.b-sidebar-header')
345
346
expect($header.exists()).toBe(true)
347
+
expect($header.element.tagName).toBe('DIV')
346
348
expect($header.find('strong').exists()).toBe(false)
347
349
expect($header.find('button').exists()).toBe(false)
348
350
expect($header.text()).toContain('Custom header')
@@ -358,7 +360,8 @@ describe('sidebar', () => {
358
360
attachTo: createContainer(),
359
361
propsData: {
360
362
id: 'test-5',
361
-
visible: true
363
+
visible: true,
364
+
footerTag: 'div'
362
365
},
363
366
slots: {
364
367
footer: '<span>FOOTER</span>'
@@ -367,10 +370,14 @@ describe('sidebar', () => {
367
370
368
371
expect(wrapper.vm).toBeDefined()
369
372
expect(wrapper.element.tagName).toBe('DIV')
373
+
370
374
expect(wrapper.find('.b-sidebar-header').exists()).toBe(true)
371
375
expect(wrapper.find('.b-sidebar-body').exists()).toBe(true)
372
-
expect(wrapper.find('.b-sidebar-footer').exists()).toBe(true)
373
-
expect(wrapper.find('.b-sidebar-footer').text()).toEqual('FOOTER')
376
+
377
+
const $footer = wrapper.find('.b-sidebar-footer')
378
+
expect($footer.exists()).toBe(true)
379
+
expect($footer.element.tagName).toBe('DIV')
380
+
expect($footer.text()).toEqual('FOOTER')
374
381
375
382
wrapper.destroy()
376
383
})
Original file line number Diff line number Diff line change
@@ -10,6 +10,16 @@
10
10
"component": "BTime",
11
11
"version": "2.6.0",
12
12
"props": [
13
+
{
14
+
"prop": "footerTag",
15
+
"version": "2.22.0",
16
+
"description": "Specify the HTML tag to render instead of the default tag for the footer"
17
+
},
18
+
{
19
+
"prop": "headerTag",
20
+
"version": "2.22.0",
21
+
"description": "Specify the HTML tag to render instead of the default tag for the footer"
22
+
},
13
23
{
14
24
"prop": "hideHeader",
15
25
"description": "When set, visually hides the selected time header"
You can’t perform that action at this time.
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