@gitlab/ui 101.16.0 → 102.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/constants.js +9 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.js +11 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_category_items.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_item.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items_loading.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/mock_context_data.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/utils.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_message/buttons_utils.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_message/constants.js +9 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_message/copy_code_element.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_message/utils.js +9 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.js +8 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.js +8 -0
- package/dist/components/experimental/duo/chat/constants.js +9 -0
- package/dist/components/experimental/duo/chat/duo_chat.js +8 -0
- package/dist/components/experimental/duo/chat/markdown_renderer.js +8 -1
- package/dist/components/experimental/duo/chat/mock_data.js +8 -0
- package/dist/components/experimental/duo/user_feedback/user_feedback.js +8 -0
- package/dist/components/experimental/duo/user_feedback/user_feedback_modal.js +1 -0
- package/dist/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.js +8 -0
- package/dist/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.js +8 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +0 -4
- package/dist/vendor/bootstrap-vue/src/components/collapse/collapse.js +1 -2
- package/dist/vendor/bootstrap-vue/src/components/nav/nav.js +6 -9
- package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +6 -30
- package/dist/vendor/bootstrap-vue/src/constants/env.js +1 -10
- package/dist/vendor/bootstrap-vue/src/constants/key-codes.js +1 -2
- package/dist/vendor/bootstrap-vue/src/index.js +1 -11
- package/dist/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +2 -16
- package/dist/vendor/bootstrap-vue/src/mixins/form-radio-check.js +14 -104
- package/dist/vendor/bootstrap-vue/src/utils/plugins.js +1 -41
- package/package.json +1 -1
- package/src/components/experimental/duo/chat/components/duo_chat_context/constants.js +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.vue +12 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.md +12 -3
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_category_items.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_item.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items_loading.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/mock_context_data.js +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/utils.js +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.md +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.md +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.scss +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/buttons_utils.js +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/constants.js +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/copy_code_element.js +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/insert_code_snippet_element.js +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/utils.js +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.md +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.vue +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.md +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.vue +9 -0
- package/src/components/experimental/duo/chat/constants.js +9 -0
- package/src/components/experimental/duo/chat/duo_chat.md +8 -0
- package/src/components/experimental/duo/chat/duo_chat.scss +9 -0
- package/src/components/experimental/duo/chat/duo_chat.vue +9 -0
- package/src/components/experimental/duo/chat/markdown_renderer.js +9 -0
- package/src/components/experimental/duo/chat/mock_data.js +9 -0
- package/src/components/experimental/duo/chat/variables.scss +9 -1
- package/src/components/experimental/duo/user_feedback/user_feedback.md +9 -0
- package/src/components/experimental/duo/user_feedback/user_feedback.vue +9 -0
- package/src/components/experimental/duo/user_feedback/user_feedback_modal.vue +6 -0
- package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.md +9 -0
- package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.vue +9 -0
- package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.md +9 -0
- package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.vue +9 -0
- package/src/vendor/bootstrap/scss/_reboot.scss +2 -5
- package/src/vendor/bootstrap-vue/src/components/button/MODIFICATIONS.md +16 -0
- package/src/vendor/bootstrap-vue/src/components/button/README.md +0 -39
- package/src/vendor/bootstrap-vue/src/components/button/button.js +0 -4
- package/src/vendor/bootstrap-vue/src/components/button/button.spec.js +0 -36
- package/src/vendor/bootstrap-vue/src/components/collapse/collapse.js +1 -1
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/README.md +3 -174
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.spec.js +0 -117
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.spec.js +0 -409
- package/src/vendor/bootstrap-vue/src/components/form-radio/README.md +0 -129
- package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio-group.spec.js +0 -112
- package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio.spec.js +0 -365
- package/src/vendor/bootstrap-vue/src/components/nav/README.md +0 -20
- package/src/vendor/bootstrap-vue/src/components/nav/nav.js +7 -9
- package/src/vendor/bootstrap-vue/src/components/nav/nav.spec.js +0 -67
- package/src/vendor/bootstrap-vue/src/components/tabs/README.md +45 -187
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +6 -29
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.spec.js +0 -58
- package/src/vendor/bootstrap-vue/src/constants/env.js +0 -14
- package/src/vendor/bootstrap-vue/src/constants/key-codes.js +0 -1
- package/src/vendor/bootstrap-vue/src/index.js +0 -17
- package/src/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +3 -20
- package/src/vendor/bootstrap-vue/src/mixins/form-radio-check.js +19 -114
- package/src/vendor/bootstrap-vue/src/utils/config.spec.js +0 -18
- package/src/vendor/bootstrap-vue/src/utils/plugins.js +0 -33
- package/dist/vendor/bootstrap-vue/src/browser.js +0 -8
- package/dist/vendor/bootstrap-vue/src/components/index.js +0 -11
- package/dist/vendor/bootstrap-vue/src/constants/classes.js +0 -3
- package/src/vendor/bootstrap-vue/src/browser.js +0 -9
- package/src/vendor/bootstrap-vue/src/components/index.js +0 -11
- package/src/vendor/bootstrap-vue/src/constants/classes.js +0 -1
|
@@ -369,371 +369,6 @@ describe('form-radio', () => {
|
|
|
369
369
|
wrapper.destroy()
|
|
370
370
|
})
|
|
371
371
|
|
|
372
|
-
// --- Plain styling ---
|
|
373
|
-
|
|
374
|
-
it('plain has structure <div><input><label></label></div>', async () => {
|
|
375
|
-
const wrapper = mount(BFormRadio, {
|
|
376
|
-
propsData: {
|
|
377
|
-
plain: true,
|
|
378
|
-
checked: '',
|
|
379
|
-
value: 'a'
|
|
380
|
-
},
|
|
381
|
-
slots: {
|
|
382
|
-
default: 'foobar'
|
|
383
|
-
}
|
|
384
|
-
})
|
|
385
|
-
expect(wrapper).toBeDefined()
|
|
386
|
-
expect(wrapper.element.tagName).toBe('DIV')
|
|
387
|
-
const children = wrapper.element.children
|
|
388
|
-
expect(children.length).toEqual(2)
|
|
389
|
-
expect(children[0].tagName).toEqual('INPUT')
|
|
390
|
-
expect(children[1].tagName).toEqual('LABEL')
|
|
391
|
-
|
|
392
|
-
wrapper.destroy()
|
|
393
|
-
})
|
|
394
|
-
|
|
395
|
-
it('plain has wrapper class form-check', async () => {
|
|
396
|
-
const wrapper = mount(BFormRadio, {
|
|
397
|
-
propsData: {
|
|
398
|
-
plain: true,
|
|
399
|
-
checked: '',
|
|
400
|
-
value: 'a'
|
|
401
|
-
},
|
|
402
|
-
slots: {
|
|
403
|
-
default: 'foobar'
|
|
404
|
-
}
|
|
405
|
-
})
|
|
406
|
-
expect(wrapper.classes().length).toEqual(1)
|
|
407
|
-
expect(wrapper.classes()).toContain('form-check')
|
|
408
|
-
|
|
409
|
-
wrapper.destroy()
|
|
410
|
-
})
|
|
411
|
-
|
|
412
|
-
it('plain has input type radio', async () => {
|
|
413
|
-
const wrapper = mount(BFormRadio, {
|
|
414
|
-
propsData: {
|
|
415
|
-
plain: true,
|
|
416
|
-
checked: '',
|
|
417
|
-
value: 'a'
|
|
418
|
-
},
|
|
419
|
-
slots: {
|
|
420
|
-
default: 'foobar'
|
|
421
|
-
}
|
|
422
|
-
})
|
|
423
|
-
const input = wrapper.find('input')
|
|
424
|
-
expect(input.attributes('type')).toBeDefined()
|
|
425
|
-
expect(input.attributes('type')).toEqual('radio')
|
|
426
|
-
|
|
427
|
-
wrapper.destroy()
|
|
428
|
-
})
|
|
429
|
-
|
|
430
|
-
it('plain has input class form-check-input', async () => {
|
|
431
|
-
const wrapper = mount(BFormRadio, {
|
|
432
|
-
propsData: {
|
|
433
|
-
plain: true,
|
|
434
|
-
checked: '',
|
|
435
|
-
value: 'a'
|
|
436
|
-
},
|
|
437
|
-
slots: {
|
|
438
|
-
default: 'foobar'
|
|
439
|
-
}
|
|
440
|
-
})
|
|
441
|
-
const input = wrapper.find('input')
|
|
442
|
-
expect(input.classes().length).toEqual(1)
|
|
443
|
-
expect(input.classes()).toContain('form-check-input')
|
|
444
|
-
|
|
445
|
-
wrapper.destroy()
|
|
446
|
-
})
|
|
447
|
-
|
|
448
|
-
it('plain has label class form-check-label', async () => {
|
|
449
|
-
const wrapper = mount(BFormRadio, {
|
|
450
|
-
propsData: {
|
|
451
|
-
plain: true,
|
|
452
|
-
checked: '',
|
|
453
|
-
value: 'a'
|
|
454
|
-
},
|
|
455
|
-
slots: {
|
|
456
|
-
default: 'foobar'
|
|
457
|
-
}
|
|
458
|
-
})
|
|
459
|
-
const input = wrapper.find('label')
|
|
460
|
-
expect(input.classes().length).toEqual(1)
|
|
461
|
-
expect(input.classes()).toContain('form-check-label')
|
|
462
|
-
|
|
463
|
-
wrapper.destroy()
|
|
464
|
-
})
|
|
465
|
-
|
|
466
|
-
it('plain has default slot content in label', async () => {
|
|
467
|
-
const wrapper = mount(BFormRadio, {
|
|
468
|
-
propsData: {
|
|
469
|
-
plain: true,
|
|
470
|
-
checked: '',
|
|
471
|
-
value: 'a'
|
|
472
|
-
},
|
|
473
|
-
slots: {
|
|
474
|
-
default: 'foobar'
|
|
475
|
-
}
|
|
476
|
-
})
|
|
477
|
-
const label = wrapper.find('label')
|
|
478
|
-
expect(label.text()).toEqual('foobar')
|
|
479
|
-
|
|
480
|
-
wrapper.destroy()
|
|
481
|
-
})
|
|
482
|
-
|
|
483
|
-
it('plain has no input validation classes by default', async () => {
|
|
484
|
-
const wrapper = mount(BFormRadio, {
|
|
485
|
-
propsData: {
|
|
486
|
-
plain: true,
|
|
487
|
-
checked: '',
|
|
488
|
-
value: 'a'
|
|
489
|
-
},
|
|
490
|
-
slots: {
|
|
491
|
-
default: 'foobar'
|
|
492
|
-
}
|
|
493
|
-
})
|
|
494
|
-
const input = wrapper.find('input')
|
|
495
|
-
expect(input).toBeDefined()
|
|
496
|
-
expect(input.classes()).not.toContain('is-invalid')
|
|
497
|
-
expect(input.classes()).not.toContain('is-valid')
|
|
498
|
-
|
|
499
|
-
wrapper.destroy()
|
|
500
|
-
})
|
|
501
|
-
|
|
502
|
-
it('plain has no input validation classes when state=null', async () => {
|
|
503
|
-
const wrapper = mount(BFormRadio, {
|
|
504
|
-
propsData: {
|
|
505
|
-
state: null,
|
|
506
|
-
plain: true,
|
|
507
|
-
checked: '',
|
|
508
|
-
value: 'a'
|
|
509
|
-
},
|
|
510
|
-
slots: {
|
|
511
|
-
default: 'foobar'
|
|
512
|
-
}
|
|
513
|
-
})
|
|
514
|
-
const input = wrapper.find('input')
|
|
515
|
-
expect(input).toBeDefined()
|
|
516
|
-
expect(input.classes()).not.toContain('is-invalid')
|
|
517
|
-
expect(input.classes()).not.toContain('is-valid')
|
|
518
|
-
|
|
519
|
-
wrapper.destroy()
|
|
520
|
-
})
|
|
521
|
-
|
|
522
|
-
it('plain has input validation class is-valid when state=true', async () => {
|
|
523
|
-
const wrapper = mount(BFormRadio, {
|
|
524
|
-
propsData: {
|
|
525
|
-
state: true,
|
|
526
|
-
plain: true,
|
|
527
|
-
checked: '',
|
|
528
|
-
value: 'a'
|
|
529
|
-
},
|
|
530
|
-
slots: {
|
|
531
|
-
default: 'foobar'
|
|
532
|
-
}
|
|
533
|
-
})
|
|
534
|
-
const input = wrapper.find('input')
|
|
535
|
-
expect(input).toBeDefined()
|
|
536
|
-
expect(input.classes()).not.toContain('is-invalid')
|
|
537
|
-
expect(input.classes()).toContain('is-valid')
|
|
538
|
-
|
|
539
|
-
wrapper.destroy()
|
|
540
|
-
})
|
|
541
|
-
|
|
542
|
-
it('plain has input validation class is-invalid when state=false', async () => {
|
|
543
|
-
const wrapper = mount(BFormRadio, {
|
|
544
|
-
propsData: {
|
|
545
|
-
state: false,
|
|
546
|
-
plain: true,
|
|
547
|
-
checked: '',
|
|
548
|
-
value: 'a'
|
|
549
|
-
},
|
|
550
|
-
slots: {
|
|
551
|
-
default: 'foobar'
|
|
552
|
-
}
|
|
553
|
-
})
|
|
554
|
-
const input = wrapper.find('input')
|
|
555
|
-
expect(input).toBeDefined()
|
|
556
|
-
expect(input.classes()).toContain('is-invalid')
|
|
557
|
-
expect(input.classes()).not.toContain('is-valid')
|
|
558
|
-
|
|
559
|
-
wrapper.destroy()
|
|
560
|
-
})
|
|
561
|
-
|
|
562
|
-
// --- Button styling - stand-alone mode ---
|
|
563
|
-
|
|
564
|
-
it('stand-alone button has structure <div><label><input></label></div>', async () => {
|
|
565
|
-
const wrapper = mount(BFormRadio, {
|
|
566
|
-
propsData: {
|
|
567
|
-
button: true,
|
|
568
|
-
checked: '',
|
|
569
|
-
value: 'a'
|
|
570
|
-
},
|
|
571
|
-
slots: {
|
|
572
|
-
default: 'foobar'
|
|
573
|
-
}
|
|
574
|
-
})
|
|
575
|
-
expect(wrapper).toBeDefined()
|
|
576
|
-
expect(wrapper.element.tagName).toBe('DIV')
|
|
577
|
-
const label = wrapper.element.children
|
|
578
|
-
expect(label.length).toEqual(1)
|
|
579
|
-
expect(label[0].tagName).toEqual('LABEL')
|
|
580
|
-
const input = label[0].children
|
|
581
|
-
expect(input.length).toEqual(1)
|
|
582
|
-
expect(input[0].tagName).toEqual('INPUT')
|
|
583
|
-
|
|
584
|
-
wrapper.destroy()
|
|
585
|
-
})
|
|
586
|
-
|
|
587
|
-
it('stand-alone button has wrapper classes btn-group-toggle and d-inline-block', async () => {
|
|
588
|
-
const wrapper = mount(BFormRadio, {
|
|
589
|
-
propsData: {
|
|
590
|
-
button: true,
|
|
591
|
-
checked: '',
|
|
592
|
-
value: 'a'
|
|
593
|
-
},
|
|
594
|
-
slots: {
|
|
595
|
-
default: 'foobar'
|
|
596
|
-
}
|
|
597
|
-
})
|
|
598
|
-
expect(wrapper.classes().length).toEqual(2)
|
|
599
|
-
expect(wrapper.classes()).toContain('btn-group-toggle')
|
|
600
|
-
expect(wrapper.classes()).toContain('d-inline-block')
|
|
601
|
-
|
|
602
|
-
wrapper.destroy()
|
|
603
|
-
})
|
|
604
|
-
|
|
605
|
-
it('stand-alone button has label classes btn and btn-secondary when unchecked', async () => {
|
|
606
|
-
const wrapper = mount(BFormRadio, {
|
|
607
|
-
propsData: {
|
|
608
|
-
button: true,
|
|
609
|
-
checked: '',
|
|
610
|
-
value: 'a'
|
|
611
|
-
},
|
|
612
|
-
slots: {
|
|
613
|
-
default: 'foobar'
|
|
614
|
-
}
|
|
615
|
-
})
|
|
616
|
-
const label = wrapper.find('label')
|
|
617
|
-
expect(label).toBeDefined()
|
|
618
|
-
expect(label.classes().length).toEqual(2)
|
|
619
|
-
expect(label.classes()).not.toContain('active')
|
|
620
|
-
expect(label.classes()).not.toContain('focus')
|
|
621
|
-
expect(label.classes()).toContain('btn')
|
|
622
|
-
expect(label.classes()).toContain('btn-secondary')
|
|
623
|
-
|
|
624
|
-
wrapper.destroy()
|
|
625
|
-
})
|
|
626
|
-
|
|
627
|
-
it('stand-alone button has label classes btn, btn-secondary and active when checked by default', async () => {
|
|
628
|
-
const wrapper = mount(BFormRadio, {
|
|
629
|
-
propsData: {
|
|
630
|
-
button: true,
|
|
631
|
-
checked: 'a',
|
|
632
|
-
value: 'a'
|
|
633
|
-
},
|
|
634
|
-
slots: {
|
|
635
|
-
default: 'foobar'
|
|
636
|
-
}
|
|
637
|
-
})
|
|
638
|
-
const label = wrapper.find('label')
|
|
639
|
-
expect(label).toBeDefined()
|
|
640
|
-
expect(label.classes().length).toEqual(3)
|
|
641
|
-
expect(label.classes()).not.toContain('focus')
|
|
642
|
-
expect(label.classes()).toContain('btn')
|
|
643
|
-
expect(label.classes()).toContain('btn-secondary')
|
|
644
|
-
expect(label.classes()).toContain('active')
|
|
645
|
-
|
|
646
|
-
wrapper.destroy()
|
|
647
|
-
})
|
|
648
|
-
|
|
649
|
-
it('stand-alone button has label class active when clicked (checked)', async () => {
|
|
650
|
-
const wrapper = mount(BFormRadio, {
|
|
651
|
-
propsData: {
|
|
652
|
-
button: true,
|
|
653
|
-
checked: '',
|
|
654
|
-
value: 'a'
|
|
655
|
-
},
|
|
656
|
-
slots: {
|
|
657
|
-
default: 'foobar'
|
|
658
|
-
}
|
|
659
|
-
})
|
|
660
|
-
const label = wrapper.find('label')
|
|
661
|
-
expect(label).toBeDefined()
|
|
662
|
-
const input = wrapper.find('input')
|
|
663
|
-
expect(input).toBeDefined()
|
|
664
|
-
expect(label.classes().length).toEqual(2)
|
|
665
|
-
expect(label.classes()).not.toContain('focus')
|
|
666
|
-
expect(label.classes()).not.toContain('active')
|
|
667
|
-
expect(label.classes()).toContain('btn')
|
|
668
|
-
expect(label.classes()).toContain('btn-secondary')
|
|
669
|
-
await input.setChecked(true)
|
|
670
|
-
expect(label.classes().length).toEqual(3)
|
|
671
|
-
expect(label.classes()).toContain('active')
|
|
672
|
-
expect(label.classes()).toContain('btn')
|
|
673
|
-
expect(label.classes()).toContain('btn-secondary')
|
|
674
|
-
|
|
675
|
-
wrapper.destroy()
|
|
676
|
-
})
|
|
677
|
-
|
|
678
|
-
it('stand-alone button has label class focus when input focused', async () => {
|
|
679
|
-
const wrapper = mount(BFormRadio, {
|
|
680
|
-
attachTo: document.body,
|
|
681
|
-
propsData: {
|
|
682
|
-
button: true,
|
|
683
|
-
checked: '',
|
|
684
|
-
value: 'a'
|
|
685
|
-
},
|
|
686
|
-
slots: {
|
|
687
|
-
default: 'foobar'
|
|
688
|
-
}
|
|
689
|
-
})
|
|
690
|
-
|
|
691
|
-
const label = wrapper.find('label')
|
|
692
|
-
expect(label).toBeDefined()
|
|
693
|
-
|
|
694
|
-
const input = wrapper.find('input')
|
|
695
|
-
expect(label.classes().length).toEqual(2)
|
|
696
|
-
expect(label.classes()).not.toContain('focus')
|
|
697
|
-
expect(label.classes()).not.toContain('active')
|
|
698
|
-
expect(label.classes()).toContain('btn')
|
|
699
|
-
expect(label.classes()).toContain('btn-secondary')
|
|
700
|
-
expect(input).toBeDefined()
|
|
701
|
-
|
|
702
|
-
await input.trigger('focus')
|
|
703
|
-
expect(label.classes().length).toEqual(3)
|
|
704
|
-
expect(label.classes()).toContain('focus')
|
|
705
|
-
|
|
706
|
-
await input.trigger('blur')
|
|
707
|
-
expect(label.classes().length).toEqual(2)
|
|
708
|
-
expect(label.classes()).not.toContain('focus')
|
|
709
|
-
|
|
710
|
-
wrapper.destroy()
|
|
711
|
-
})
|
|
712
|
-
|
|
713
|
-
it('stand-alone button has label btn-primary when prop btn-variant set to primary', async () => {
|
|
714
|
-
const wrapper = mount(BFormRadio, {
|
|
715
|
-
propsData: {
|
|
716
|
-
button: true,
|
|
717
|
-
buttonVariant: 'primary',
|
|
718
|
-
checked: '',
|
|
719
|
-
value: 'a'
|
|
720
|
-
},
|
|
721
|
-
slots: {
|
|
722
|
-
default: 'foobar'
|
|
723
|
-
}
|
|
724
|
-
})
|
|
725
|
-
const label = wrapper.find('label')
|
|
726
|
-
expect(label).toBeDefined()
|
|
727
|
-
expect(label.classes().length).toEqual(2)
|
|
728
|
-
expect(label.classes()).not.toContain('focus')
|
|
729
|
-
expect(label.classes()).not.toContain('active')
|
|
730
|
-
expect(label.classes()).not.toContain('btn-secondary')
|
|
731
|
-
expect(label.classes()).toContain('btn')
|
|
732
|
-
expect(label.classes()).toContain('btn-primary')
|
|
733
|
-
|
|
734
|
-
wrapper.destroy()
|
|
735
|
-
})
|
|
736
|
-
|
|
737
372
|
// --- Functionality testing ---
|
|
738
373
|
|
|
739
374
|
it('default has internal localChecked="" when prop checked=""', async () => {
|
|
@@ -144,24 +144,6 @@ and `right`.
|
|
|
144
144
|
<!-- b-nav-alignment.vue -->
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
## Vertical variation
|
|
148
|
-
|
|
149
|
-
By default `<b-nav>` appear on a horizontal line. Stack your navigation by setting the `vertical`
|
|
150
|
-
prop.
|
|
151
|
-
|
|
152
|
-
```html
|
|
153
|
-
<div>
|
|
154
|
-
<b-nav vertical class="w-25">
|
|
155
|
-
<b-nav-item active>Active</b-nav-item>
|
|
156
|
-
<b-nav-item>Link</b-nav-item>
|
|
157
|
-
<b-nav-item>Another Link</b-nav-item>
|
|
158
|
-
<b-nav-item disabled>Disabled</b-nav-item>
|
|
159
|
-
</b-nav>
|
|
160
|
-
</div>
|
|
161
|
-
|
|
162
|
-
<!-- b-nav-vertical.vue -->
|
|
163
|
-
```
|
|
164
|
-
|
|
165
147
|
## Dropdown support
|
|
166
148
|
|
|
167
149
|
Use `<b-nav-item-dropdown>` to place dropdown items within your nav.
|
|
@@ -371,8 +353,6 @@ Bootstrap v4 SCSS does not have special styling for `active` state plain style n
|
|
|
371
353
|
<!-- nav-card-plain.vue -->
|
|
372
354
|
```
|
|
373
355
|
|
|
374
|
-
The `card-header` prop has no styling effect if the `<b-nav>` is in `vertical` mode.
|
|
375
|
-
|
|
376
356
|
### Using with Vue Router
|
|
377
357
|
|
|
378
358
|
Have your card `<b-nav>` control vue router nested routes via `<router-view>` or `<nuxt-child>`
|
|
@@ -22,8 +22,7 @@ export const props = makePropsConfigurable(
|
|
|
22
22
|
pills: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
23
23
|
small: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
24
24
|
tabs: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
25
|
-
tag: makeProp(PROP_TYPE_STRING, 'ul')
|
|
26
|
-
vertical: makeProp(PROP_TYPE_BOOLEAN, false)
|
|
25
|
+
tag: makeProp(PROP_TYPE_STRING, 'ul')
|
|
27
26
|
},
|
|
28
27
|
NAME_NAV
|
|
29
28
|
)
|
|
@@ -36,7 +35,7 @@ export const BNav = /*#__PURE__*/ extend({
|
|
|
36
35
|
functional: true,
|
|
37
36
|
props,
|
|
38
37
|
render(h, { props, data, children }) {
|
|
39
|
-
const { tabs, pills,
|
|
38
|
+
const { tabs, pills, align, cardHeader } = props
|
|
40
39
|
|
|
41
40
|
return h(
|
|
42
41
|
props.tag,
|
|
@@ -45,12 +44,11 @@ export const BNav = /*#__PURE__*/ extend({
|
|
|
45
44
|
class: {
|
|
46
45
|
'nav-tabs': tabs,
|
|
47
46
|
'nav-pills': pills && !tabs,
|
|
48
|
-
'card-header-tabs':
|
|
49
|
-
'card-header-pills':
|
|
50
|
-
'
|
|
51
|
-
'nav-
|
|
52
|
-
|
|
53
|
-
[computeJustifyContent(align)]: !vertical && align,
|
|
47
|
+
'card-header-tabs': cardHeader && tabs,
|
|
48
|
+
'card-header-pills': cardHeader && pills && !tabs,
|
|
49
|
+
'nav-fill': props.fill,
|
|
50
|
+
'nav-justified': props.justified,
|
|
51
|
+
[computeJustifyContent(align)]: align,
|
|
54
52
|
small: props.small
|
|
55
53
|
}
|
|
56
54
|
}),
|
|
@@ -75,22 +75,6 @@ describe('nav', () => {
|
|
|
75
75
|
wrapper.destroy()
|
|
76
76
|
})
|
|
77
77
|
|
|
78
|
-
it('applies vertical style', async () => {
|
|
79
|
-
const wrapper = mount(BNav, {
|
|
80
|
-
propsData: {
|
|
81
|
-
vertical: true
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
expect(wrapper.element.tagName).toBe('UL')
|
|
86
|
-
expect(wrapper.classes()).toContain('nav')
|
|
87
|
-
expect(wrapper.classes()).toContain('flex-column')
|
|
88
|
-
expect(wrapper.classes().length).toBe(2)
|
|
89
|
-
expect(wrapper.text()).toBe('')
|
|
90
|
-
|
|
91
|
-
wrapper.destroy()
|
|
92
|
-
})
|
|
93
|
-
|
|
94
78
|
it('applies justify style when justified', async () => {
|
|
95
79
|
const wrapper = mount(BNav, {
|
|
96
80
|
propsData: {
|
|
@@ -107,23 +91,6 @@ describe('nav', () => {
|
|
|
107
91
|
wrapper.destroy()
|
|
108
92
|
})
|
|
109
93
|
|
|
110
|
-
it("doesn't apply justify style when vertical", async () => {
|
|
111
|
-
const wrapper = mount(BNav, {
|
|
112
|
-
propsData: {
|
|
113
|
-
justified: true,
|
|
114
|
-
vertical: true
|
|
115
|
-
}
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
expect(wrapper.element.tagName).toBe('UL')
|
|
119
|
-
expect(wrapper.classes()).toContain('nav')
|
|
120
|
-
expect(wrapper.classes()).toContain('flex-column')
|
|
121
|
-
expect(wrapper.classes().length).toBe(2)
|
|
122
|
-
expect(wrapper.text()).toBe('')
|
|
123
|
-
|
|
124
|
-
wrapper.destroy()
|
|
125
|
-
})
|
|
126
|
-
|
|
127
94
|
it('applies fill style style when fill set', async () => {
|
|
128
95
|
const wrapper = mount(BNav, {
|
|
129
96
|
propsData: {
|
|
@@ -140,23 +107,6 @@ describe('nav', () => {
|
|
|
140
107
|
wrapper.destroy()
|
|
141
108
|
})
|
|
142
109
|
|
|
143
|
-
it("doesn't apply fill style when vertical", async () => {
|
|
144
|
-
const wrapper = mount(BNav, {
|
|
145
|
-
propsData: {
|
|
146
|
-
fill: true,
|
|
147
|
-
vertical: true
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
expect(wrapper.element.tagName).toBe('UL')
|
|
152
|
-
expect(wrapper.classes()).toContain('nav')
|
|
153
|
-
expect(wrapper.classes()).toContain('flex-column')
|
|
154
|
-
expect(wrapper.classes().length).toBe(2)
|
|
155
|
-
expect(wrapper.text()).toBe('')
|
|
156
|
-
|
|
157
|
-
wrapper.destroy()
|
|
158
|
-
})
|
|
159
|
-
|
|
160
110
|
it('applies alignment correctly', async () => {
|
|
161
111
|
const wrapper = mount(BNav, {
|
|
162
112
|
propsData: {
|
|
@@ -173,23 +123,6 @@ describe('nav', () => {
|
|
|
173
123
|
wrapper.destroy()
|
|
174
124
|
})
|
|
175
125
|
|
|
176
|
-
it("doesn't apply alignment when vertical", async () => {
|
|
177
|
-
const wrapper = mount(BNav, {
|
|
178
|
-
propsData: {
|
|
179
|
-
align: 'center',
|
|
180
|
-
vertical: true
|
|
181
|
-
}
|
|
182
|
-
})
|
|
183
|
-
|
|
184
|
-
expect(wrapper.element.tagName).toBe('UL')
|
|
185
|
-
expect(wrapper.classes()).toContain('nav')
|
|
186
|
-
expect(wrapper.classes()).toContain('flex-column')
|
|
187
|
-
expect(wrapper.classes().length).toBe(2)
|
|
188
|
-
expect(wrapper.text()).toBe('')
|
|
189
|
-
|
|
190
|
-
wrapper.destroy()
|
|
191
|
-
})
|
|
192
|
-
|
|
193
126
|
it('applies small style', async () => {
|
|
194
127
|
const wrapper = mount(BNav, {
|
|
195
128
|
propsData: {
|