@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
|
@@ -100,42 +100,6 @@ describe('button', () => {
|
|
|
100
100
|
wrapper.destroy()
|
|
101
101
|
})
|
|
102
102
|
|
|
103
|
-
it('applies rounded-pill class when pill prop set', async () => {
|
|
104
|
-
const wrapper = mount(BButton, {
|
|
105
|
-
propsData: {
|
|
106
|
-
pill: true
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
expect(wrapper.element.tagName).toBe('BUTTON')
|
|
111
|
-
expect(wrapper.attributes('type')).toBeDefined()
|
|
112
|
-
expect(wrapper.attributes('type')).toBe('button')
|
|
113
|
-
expect(wrapper.classes()).toContain('btn')
|
|
114
|
-
expect(wrapper.classes()).toContain('btn-secondary')
|
|
115
|
-
expect(wrapper.classes()).toContain('rounded-pill')
|
|
116
|
-
expect(wrapper.classes().length).toBe(3)
|
|
117
|
-
|
|
118
|
-
wrapper.destroy()
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
it('applies rounded-0 class when squared prop set', async () => {
|
|
122
|
-
const wrapper = mount(BButton, {
|
|
123
|
-
propsData: {
|
|
124
|
-
squared: true
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
expect(wrapper.element.tagName).toBe('BUTTON')
|
|
129
|
-
expect(wrapper.attributes('type')).toBeDefined()
|
|
130
|
-
expect(wrapper.attributes('type')).toBe('button')
|
|
131
|
-
expect(wrapper.classes()).toContain('btn')
|
|
132
|
-
expect(wrapper.classes()).toContain('btn-secondary')
|
|
133
|
-
expect(wrapper.classes()).toContain('rounded-0')
|
|
134
|
-
expect(wrapper.classes().length).toBe(3)
|
|
135
|
-
|
|
136
|
-
wrapper.destroy()
|
|
137
|
-
})
|
|
138
|
-
|
|
139
103
|
it('renders custom root element', async () => {
|
|
140
104
|
const wrapper = mount(BButton, {
|
|
141
105
|
propsData: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { extend } from '../../vue'
|
|
2
2
|
import { NAME_COLLAPSE } from '../../constants/components'
|
|
3
|
-
import { CLASS_NAME_SHOW } from '../../constants/classes'
|
|
4
3
|
import {
|
|
5
4
|
EVENT_NAME_HIDDEN,
|
|
6
5
|
EVENT_NAME_HIDE,
|
|
@@ -20,6 +19,7 @@ import { normalizeSlotMixin } from '../../mixins/normalize-slot'
|
|
|
20
19
|
import { BVCollapse } from './helpers/bv-collapse'
|
|
21
20
|
|
|
22
21
|
// --- Constants ---
|
|
22
|
+
const CLASS_NAME_SHOW = 'show'
|
|
23
23
|
|
|
24
24
|
const ROOT_ACTION_EVENT_NAME_TOGGLE = getRootActionEventName(NAME_COLLAPSE, 'toggle')
|
|
25
25
|
const ROOT_ACTION_EVENT_NAME_REQUEST_STATE = getRootActionEventName(NAME_COLLAPSE, 'request-state')
|
|
@@ -364,128 +364,10 @@ Whenever using multiple checkboxes, it is recommended that the checkboxes be pla
|
|
|
364
364
|
[`<gl-form-group>`](?path=/docs/base-form-form-group--docs) component to associate a label with the
|
|
365
365
|
entire group of checkboxes. See examples above.
|
|
366
366
|
|
|
367
|
-
## Button style checkboxes
|
|
368
|
-
|
|
369
|
-
You can optionally render checkboxes to appear as buttons, either individually, or in a group.
|
|
370
|
-
|
|
371
|
-
Button style checkboxes will have the class `.active` automatically applied to the label when they
|
|
372
|
-
are in the _checked_ state.
|
|
373
|
-
|
|
374
|
-
### Individual checkbox button style
|
|
375
|
-
|
|
376
|
-
A single checkbox can be rendered with a button appearance by setting the prop `button` to `true`
|
|
377
|
-
|
|
378
|
-
Change the button variant by setting the `button-variant` prop to one of the standard Bootstrap
|
|
379
|
-
button variants (see [`<gl-button>`](?path=/docs/base-button--docs) for supported variants). The
|
|
380
|
-
default variant is `secondary`.
|
|
381
|
-
|
|
382
|
-
```html
|
|
383
|
-
<template>
|
|
384
|
-
<div>
|
|
385
|
-
<b-form-checkbox v-model="checked1" name="check-button" button>
|
|
386
|
-
Button Checkbox <b>(Checked: {{ checked1 }})</b>
|
|
387
|
-
</b-form-checkbox>
|
|
388
|
-
<b-form-checkbox v-model="checked2" name="check-button" button button-variant="info">
|
|
389
|
-
Button Checkbox <b>(Checked: {{ checked2 }})</b>
|
|
390
|
-
</b-form-checkbox>
|
|
391
|
-
</div>
|
|
392
|
-
</template>
|
|
393
|
-
|
|
394
|
-
<script>
|
|
395
|
-
export default {
|
|
396
|
-
data() {
|
|
397
|
-
return {
|
|
398
|
-
checked1: false,
|
|
399
|
-
checked2: false
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
</script>
|
|
404
|
-
|
|
405
|
-
<!-- b-form-checkbox-button.vue -->
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
The `inline` prop has no effect on individual button-style checkboxes.
|
|
409
|
-
|
|
410
|
-
### Grouped button style checkboxes
|
|
411
|
-
|
|
412
|
-
Render groups of checkboxes with the look of a button-group by setting the prop `buttons` on
|
|
413
|
-
`<b-form-checkbox-group>`. Change the button variant by setting the `button-variant` prop to one of
|
|
414
|
-
the standard Bootstrap button variants (see [`<gl-button>`](?path=/docs/base-button--docs) for
|
|
415
|
-
supported variants). The default `button-variant` is `secondary`.
|
|
416
|
-
|
|
417
|
-
```html
|
|
418
|
-
<template>
|
|
419
|
-
<div>
|
|
420
|
-
<b-form-group
|
|
421
|
-
label="Button-group style checkboxes"
|
|
422
|
-
v-slot="{ ariaDescribedby }"
|
|
423
|
-
>
|
|
424
|
-
<b-form-checkbox-group
|
|
425
|
-
v-model="selected"
|
|
426
|
-
:options="options"
|
|
427
|
-
:aria-describedby="ariaDescribedby"
|
|
428
|
-
name="buttons-1"
|
|
429
|
-
buttons
|
|
430
|
-
></b-form-checkbox-group>
|
|
431
|
-
</b-form-group>
|
|
432
|
-
|
|
433
|
-
<b-form-group
|
|
434
|
-
label="Button-group style checkboxes with variant primary and large buttons"
|
|
435
|
-
v-slot="{ ariaDescribedby }"
|
|
436
|
-
>
|
|
437
|
-
<b-form-checkbox-group
|
|
438
|
-
v-model="selected"
|
|
439
|
-
:options="options"
|
|
440
|
-
:aria-describedby="ariaDescribedby"
|
|
441
|
-
buttons
|
|
442
|
-
button-variant="primary"
|
|
443
|
-
size="lg"
|
|
444
|
-
name="buttons-2"
|
|
445
|
-
></b-form-checkbox-group>
|
|
446
|
-
</b-form-group>
|
|
447
|
-
|
|
448
|
-
<b-form-group
|
|
449
|
-
label="Stacked (vertical) button-group style checkboxes"
|
|
450
|
-
v-slot="{ ariaDescribedby }"
|
|
451
|
-
>
|
|
452
|
-
<b-form-checkbox-group
|
|
453
|
-
v-model="selected"
|
|
454
|
-
:options="options"
|
|
455
|
-
:aria-describedby="ariaDescribedby"
|
|
456
|
-
stacked
|
|
457
|
-
buttons
|
|
458
|
-
></b-form-checkbox-group>
|
|
459
|
-
</b-form-group>
|
|
460
|
-
</div>
|
|
461
|
-
</template>
|
|
462
|
-
|
|
463
|
-
<script>
|
|
464
|
-
export default {
|
|
465
|
-
data() {
|
|
466
|
-
return {
|
|
467
|
-
selected: [], // Must be an array reference!
|
|
468
|
-
options: [
|
|
469
|
-
{ text: 'Orange', value: 'orange' },
|
|
470
|
-
{ text: 'Apple', value: 'apple' },
|
|
471
|
-
{ text: 'Pineapple', value: 'pineapple' },
|
|
472
|
-
{ text: 'Grape', value: 'grape' }
|
|
473
|
-
]
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
</script>
|
|
478
|
-
|
|
479
|
-
<!-- b-form-checkbox-button-group.vue -->
|
|
480
|
-
```
|
|
481
|
-
|
|
482
367
|
## Switch style checkboxes
|
|
483
368
|
|
|
484
369
|
Switch styling is supported on `<b-form-checkbox>` and `<b-form-checkbox-group>` components.
|
|
485
370
|
|
|
486
|
-
**Note:** If the checkbox is in [button mode](#button-style-checkboxes), switch mode will have no
|
|
487
|
-
effect.
|
|
488
|
-
|
|
489
371
|
### Individual checkbox switch style
|
|
490
372
|
|
|
491
373
|
A single checkbox can be rendered with a switch appearance by setting the prop `switch` to `true`
|
|
@@ -587,56 +469,6 @@ Sizes can be set on individual `<b-form-checkbox>` components, or inherited from
|
|
|
587
469
|
**Note:** Bootstrap v4.x does not natively support sizes for the custom switch control. However,
|
|
588
470
|
BootstrapVue includes custom SCSS/CSS that adds support for sizing the custom switches.
|
|
589
471
|
|
|
590
|
-
## Non custom check inputs (plain)
|
|
591
|
-
|
|
592
|
-
You can have `<b-form-checkbox-group>` or `<b-form-checkbox>` render a browser native checkbox input
|
|
593
|
-
by setting the `plain` prop.
|
|
594
|
-
|
|
595
|
-
```html
|
|
596
|
-
<template>
|
|
597
|
-
<div>
|
|
598
|
-
<b-form-group label="Plain inline checkboxes" v-slot="{ ariaDescribedby }">
|
|
599
|
-
<b-form-checkbox-group
|
|
600
|
-
v-model="selected"
|
|
601
|
-
:options="options"
|
|
602
|
-
:aria-describedby="ariaDescribedby"
|
|
603
|
-
plain
|
|
604
|
-
></b-form-checkbox-group>
|
|
605
|
-
</b-form-group>
|
|
606
|
-
|
|
607
|
-
<b-form-group label="Plain stacked checkboxes" v-slot="{ ariaDescribedby }">
|
|
608
|
-
<b-form-checkbox-group
|
|
609
|
-
v-model="selected"
|
|
610
|
-
:options="options"
|
|
611
|
-
:aria-describedby="ariaDescribedby"
|
|
612
|
-
plain
|
|
613
|
-
stacked
|
|
614
|
-
></b-form-checkbox-group>
|
|
615
|
-
</b-form-group>
|
|
616
|
-
</div>
|
|
617
|
-
</template>
|
|
618
|
-
|
|
619
|
-
<script>
|
|
620
|
-
export default {
|
|
621
|
-
data() {
|
|
622
|
-
return {
|
|
623
|
-
selected: [], // Must be an array reference!
|
|
624
|
-
options: [
|
|
625
|
-
{ text: 'Orange', value: 'orange' },
|
|
626
|
-
{ text: 'Apple', value: 'apple' },
|
|
627
|
-
{ text: 'Pineapple', value: 'pineapple' },
|
|
628
|
-
{ text: 'Grape', value: 'grape' }
|
|
629
|
-
]
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
</script>
|
|
634
|
-
|
|
635
|
-
<!-- b-form-checkbox-plain.vue -->
|
|
636
|
-
```
|
|
637
|
-
|
|
638
|
-
**Note:** The `plain` prop has no effect when `button` or `buttons` is set.
|
|
639
|
-
|
|
640
472
|
## Contextual states
|
|
641
473
|
|
|
642
474
|
Bootstrap includes validation styles for `valid` and `invalid` states on most form controls.
|
|
@@ -652,8 +484,6 @@ Generally speaking, you'll want to use a particular state for specific types of
|
|
|
652
484
|
To apply one of the contextual state icons on `<b-form-checkbox>`, set the `state` prop to `false`
|
|
653
485
|
(for invalid), `true` (for valid), or `null` (no validation state).
|
|
654
486
|
|
|
655
|
-
**Note:** Contextual states are **not** supported when in button mode.
|
|
656
|
-
|
|
657
487
|
### Contextual state and validation example
|
|
658
488
|
|
|
659
489
|
```html
|
|
@@ -732,7 +562,7 @@ better make sense in your UI!
|
|
|
732
562
|
prop can be synced to the checkbox's state by v-binding the `indeterminate` prop with the `.sync`
|
|
733
563
|
modifier.
|
|
734
564
|
|
|
735
|
-
**Note:** indeterminate styling is not supported in
|
|
565
|
+
**Note:** indeterminate styling is not supported in switch mode, nor is it supported in
|
|
736
566
|
`<b-form-checkbox-group>` (multiple checkboxes).
|
|
737
567
|
|
|
738
568
|
**Single Indeterminate checkbox:**
|
|
@@ -849,9 +679,8 @@ modifier.
|
|
|
849
679
|
<!-- b-form-checkbox-indeterminate-multiple.vue -->
|
|
850
680
|
```
|
|
851
681
|
|
|
852
|
-
**Note:**
|
|
853
|
-
|
|
854
|
-
Windows/Linux/Mac/Android, but not on iOS.
|
|
682
|
+
**Note:** Pay attention that plain checkbox (i.e. with prop `plain`) also supports indeterminate
|
|
683
|
+
state on Windows/Linux/Mac/Android, but not on iOS.
|
|
855
684
|
|
|
856
685
|
### Indeterminate state and accessibility
|
|
857
686
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils'
|
|
2
2
|
import { waitNT } from '../../../tests/utils'
|
|
3
3
|
import { BFormCheckboxGroup } from './form-checkbox-group'
|
|
4
|
-
import { BFormCheckbox } from './form-checkbox'
|
|
5
4
|
|
|
6
5
|
describe('form-checkbox-group', () => {
|
|
7
6
|
// --- Structure, class and attributes tests ---
|
|
@@ -238,122 +237,6 @@ describe('form-checkbox-group', () => {
|
|
|
238
237
|
wrapper.destroy()
|
|
239
238
|
})
|
|
240
239
|
|
|
241
|
-
// --- Button mode structure ---
|
|
242
|
-
|
|
243
|
-
it('button mode has classes button-group and button-group-toggle', async () => {
|
|
244
|
-
const wrapper = mount(BFormCheckboxGroup, {
|
|
245
|
-
attachTo: document.body,
|
|
246
|
-
propsData: {
|
|
247
|
-
buttons: true
|
|
248
|
-
}
|
|
249
|
-
})
|
|
250
|
-
|
|
251
|
-
expect(wrapper.classes()).toBeDefined()
|
|
252
|
-
expect(wrapper.classes().length).toBe(3)
|
|
253
|
-
expect(wrapper.classes()).toContain('btn-group')
|
|
254
|
-
expect(wrapper.classes()).toContain('btn-group-toggle')
|
|
255
|
-
expect(wrapper.classes()).toContain('bv-no-focus-ring')
|
|
256
|
-
|
|
257
|
-
wrapper.destroy()
|
|
258
|
-
})
|
|
259
|
-
|
|
260
|
-
it('button mode has classes button-group-vertical and button-group-toggle when stacked=true', async () => {
|
|
261
|
-
const wrapper = mount(BFormCheckboxGroup, {
|
|
262
|
-
attachTo: document.body,
|
|
263
|
-
propsData: {
|
|
264
|
-
buttons: true,
|
|
265
|
-
stacked: true
|
|
266
|
-
}
|
|
267
|
-
})
|
|
268
|
-
|
|
269
|
-
expect(wrapper.classes()).toBeDefined()
|
|
270
|
-
expect(wrapper.classes().length).toBe(3)
|
|
271
|
-
expect(wrapper.classes()).toContain('btn-group-vertical')
|
|
272
|
-
expect(wrapper.classes()).toContain('btn-group-toggle')
|
|
273
|
-
expect(wrapper.classes()).toContain('bv-no-focus-ring')
|
|
274
|
-
|
|
275
|
-
wrapper.destroy()
|
|
276
|
-
})
|
|
277
|
-
|
|
278
|
-
it('button mode has size class when size prop set', async () => {
|
|
279
|
-
const wrapper = mount(BFormCheckboxGroup, {
|
|
280
|
-
attachTo: document.body,
|
|
281
|
-
propsData: {
|
|
282
|
-
buttons: true,
|
|
283
|
-
size: 'lg'
|
|
284
|
-
}
|
|
285
|
-
})
|
|
286
|
-
|
|
287
|
-
expect(wrapper.classes()).toBeDefined()
|
|
288
|
-
expect(wrapper.classes().length).toBe(4)
|
|
289
|
-
expect(wrapper.classes()).toContain('btn-group')
|
|
290
|
-
expect(wrapper.classes()).toContain('btn-group-toggle')
|
|
291
|
-
expect(wrapper.classes()).toContain('btn-group-lg')
|
|
292
|
-
expect(wrapper.classes()).toContain('bv-no-focus-ring')
|
|
293
|
-
|
|
294
|
-
wrapper.destroy()
|
|
295
|
-
})
|
|
296
|
-
|
|
297
|
-
it('button mode has size class when size prop set and stacked', async () => {
|
|
298
|
-
const wrapper = mount(BFormCheckboxGroup, {
|
|
299
|
-
attachTo: document.body,
|
|
300
|
-
propsData: {
|
|
301
|
-
buttons: true,
|
|
302
|
-
stacked: true,
|
|
303
|
-
size: 'lg'
|
|
304
|
-
}
|
|
305
|
-
})
|
|
306
|
-
|
|
307
|
-
expect(wrapper.classes()).toBeDefined()
|
|
308
|
-
expect(wrapper.classes().length).toBe(4)
|
|
309
|
-
expect(wrapper.classes()).toContain('btn-group-vertical')
|
|
310
|
-
expect(wrapper.classes()).toContain('btn-group-toggle')
|
|
311
|
-
expect(wrapper.classes()).toContain('btn-group-lg')
|
|
312
|
-
expect(wrapper.classes()).toContain('bv-no-focus-ring')
|
|
313
|
-
|
|
314
|
-
wrapper.destroy()
|
|
315
|
-
})
|
|
316
|
-
|
|
317
|
-
it('button mode button variant works', async () => {
|
|
318
|
-
const App = {
|
|
319
|
-
render(h) {
|
|
320
|
-
return h(
|
|
321
|
-
BFormCheckboxGroup,
|
|
322
|
-
{
|
|
323
|
-
props: {
|
|
324
|
-
checked: [],
|
|
325
|
-
buttons: true,
|
|
326
|
-
buttonVariant: 'primary'
|
|
327
|
-
}
|
|
328
|
-
},
|
|
329
|
-
[
|
|
330
|
-
h(BFormCheckbox, { props: { value: 'one' } }, 'button 1'),
|
|
331
|
-
h(BFormCheckbox, { props: { value: 'two' } }, 'button 2'),
|
|
332
|
-
h(BFormCheckbox, { props: { value: 'three', buttonVariant: 'danger' } }, 'button 3')
|
|
333
|
-
]
|
|
334
|
-
)
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
const wrapper = mount(App, {
|
|
339
|
-
attachTo: document.body
|
|
340
|
-
})
|
|
341
|
-
|
|
342
|
-
expect(wrapper).toBeDefined()
|
|
343
|
-
await waitNT(wrapper.vm)
|
|
344
|
-
|
|
345
|
-
// Find all the labels with `.btn` class
|
|
346
|
-
const $btns = wrapper.findAll('label.btn')
|
|
347
|
-
expect($btns).toBeDefined()
|
|
348
|
-
expect($btns.length).toBe(3)
|
|
349
|
-
// Expect them to have the correct variant classes
|
|
350
|
-
expect($btns.at(0).classes()).toContain('btn-primary')
|
|
351
|
-
expect($btns.at(1).classes()).toContain('btn-primary')
|
|
352
|
-
expect($btns.at(2).classes()).toContain('btn-danger')
|
|
353
|
-
|
|
354
|
-
wrapper.destroy()
|
|
355
|
-
})
|
|
356
|
-
|
|
357
240
|
// --- Functionality testing ---
|
|
358
241
|
|
|
359
242
|
it('has checkboxes via options array', async () => {
|