@gitlab/ui 101.15.0 → 102.0.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 +39 -0
- package/dist/components/base/animated_icon/animated_loader_icon.js +45 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.js +3 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.js +5 -3
- package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +3 -3
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +0 -4
- 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/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/package.json +1 -2
- package/src/components/base/animated_icon/animated_icon.scss +21 -0
- package/src/components/base/animated_icon/animated_loader_icon.vue +44 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.vue +3 -0
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.scss +6 -33
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.vue +4 -6
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +3 -3
- 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/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/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/dist/index.css +0 -7
- package/dist/index.css.map +0 -1
- package/dist/index.js +0 -114
- package/dist/vendor/bootstrap-vue/src/components/index.js +0 -11
- package/src/index.js +0 -129
- package/src/vendor/bootstrap-vue/src/components/index.js +0 -11
package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.scss
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
@apply gl-text-gray-500;
|
|
4
4
|
|
|
5
5
|
.transition {
|
|
6
|
-
transition
|
|
6
|
+
@include gl-prefers-reduced-motion-transition;
|
|
7
|
+
transition: width 200ms $gl-easing-out-cubic;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.text-enter {
|
|
@@ -11,7 +12,8 @@
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
.text-enter-active {
|
|
14
|
-
|
|
15
|
+
@include gl-prefers-reduced-motion-transition;
|
|
16
|
+
transition: opacity 400ms $gl-easing-out-cubic; // we intentionally overlap this transition with .text-leave-active by 200ms
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
.text-enter-to {
|
|
@@ -23,40 +25,11 @@
|
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
.text-leave-active {
|
|
26
|
-
transition
|
|
28
|
+
@include gl-prefers-reduced-motion-transition;
|
|
29
|
+
transition: opacity 200ms $gl-easing-out-cubic;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
.text-leave-to {
|
|
30
33
|
@apply gl-opacity-0;
|
|
31
34
|
}
|
|
32
|
-
|
|
33
|
-
&__dot {
|
|
34
|
-
display: inline-block;
|
|
35
|
-
width: 0.3rem;
|
|
36
|
-
height: 0.3rem;
|
|
37
|
-
background-color: $gray-200;
|
|
38
|
-
border-radius: 100%;
|
|
39
|
-
animation: DuoChatLoading 1400ms ease-in-out infinite;
|
|
40
|
-
animation-fill-mode: both;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&__dot--1 {
|
|
44
|
-
animation-delay: -0.3s;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&__dot--2 {
|
|
48
|
-
animation-delay: -0.15s;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@keyframes DuoChatLoading {
|
|
53
|
-
0%,
|
|
54
|
-
80%,
|
|
55
|
-
100% {
|
|
56
|
-
transform: scale(0);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
40% {
|
|
60
|
-
transform: scale(1);
|
|
61
|
-
}
|
|
62
35
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { translate } from '../../../../../../utils/i18n';
|
|
3
3
|
import GlSprintf from '../../../../../utilities/sprintf/sprintf.vue';
|
|
4
|
+
import GlAnimatedLoaderIcon from '../../../../../base/animated_icon/animated_loader_icon.vue';
|
|
4
5
|
import { LOADING_TRANSITION_DURATION } from '../../constants';
|
|
5
6
|
|
|
6
7
|
export const i18n = {
|
|
@@ -21,6 +22,7 @@ export default {
|
|
|
21
22
|
name: 'GlDuoChatLoader',
|
|
22
23
|
components: {
|
|
23
24
|
GlSprintf,
|
|
25
|
+
GlAnimatedLoaderIcon,
|
|
24
26
|
},
|
|
25
27
|
i18n,
|
|
26
28
|
props: {
|
|
@@ -70,12 +72,8 @@ export default {
|
|
|
70
72
|
</script>
|
|
71
73
|
|
|
72
74
|
<template>
|
|
73
|
-
<div class="duo-chat-loader gl-mt-5 gl-flex gl-items-center">
|
|
74
|
-
<
|
|
75
|
-
<div class="duo-chat-loader__dot duo-chat-loader__dot--1"></div>
|
|
76
|
-
<div class="duo-chat-loader__dot duo-chat-loader__dot--2"></div>
|
|
77
|
-
<div class="duo-chat-loader__dot duo-chat-loader__dot--3"></div>
|
|
78
|
-
</div>
|
|
75
|
+
<div class="duo-chat-loader gl-mt-5 gl-flex gl-items-center gl-gap-3">
|
|
76
|
+
<gl-animated-loader-icon :is-on="true" />
|
|
79
77
|
<div>
|
|
80
78
|
<gl-sprintf :message="$options.i18n.LOADER_LOADING_MESSAGE">
|
|
81
79
|
<template #tool>
|
package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import throttle from 'lodash/throttle';
|
|
3
3
|
import GlIcon from '../../../../../base/icon/icon.vue';
|
|
4
|
-
import
|
|
4
|
+
import GlAnimatedLoaderIcon from '../../../../../base/animated_icon/animated_loader_icon.vue';
|
|
5
5
|
import { GlTooltipDirective } from '../../../../../../directives/tooltip';
|
|
6
6
|
import GlDuoChatContextItemSelections from '../duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.vue';
|
|
7
7
|
import GlDuoUserFeedback from '../../../user_feedback/user_feedback.vue';
|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
59
59
|
GlFormGroup,
|
|
60
60
|
GlFormTextarea,
|
|
61
61
|
GlIcon,
|
|
62
|
-
|
|
62
|
+
GlAnimatedLoaderIcon,
|
|
63
63
|
},
|
|
64
64
|
directives: {
|
|
65
65
|
SafeHtml,
|
|
@@ -315,7 +315,7 @@ export default {
|
|
|
315
315
|
<documentation-sources v-if="sources" :sources="sources" />
|
|
316
316
|
|
|
317
317
|
<div class="duo-chat-message-feedback gl-mt-4 gl-flex gl-items-end">
|
|
318
|
-
<gl-
|
|
318
|
+
<gl-animated-loader-icon v-if="isChunkAndNotCancelled" :is-on="true" />
|
|
319
319
|
<gl-duo-user-feedback
|
|
320
320
|
v-if="isNotChunkOrCancelled"
|
|
321
321
|
:feedback-received="hasFeedback"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Modifications to Vendored Code
|
|
2
|
+
|
|
3
|
+
**Library**: BootstrapVue
|
|
4
|
+
**Version**: 2.23.1 **Link:** https://bootstrap-vue.org **Source:**
|
|
5
|
+
https://github.com/bootstrap-vue/bootstrap-vue **Copyright:** (c) 2016-2024 BootstrapVue
|
|
6
|
+
**License:** (c)
|
|
7
|
+
[2016-2024 BootstrapVue](https://github.com/bootstrap-vue/bootstrap-vue/blob/master/LICENSE)
|
|
8
|
+
|
|
9
|
+
This file documents modifications made to the original BootstrapVue component files.
|
|
10
|
+
|
|
11
|
+
## Removed unnecessary properties
|
|
12
|
+
|
|
13
|
+
The following properties have been removed as they are no longer supported in our implementation:
|
|
14
|
+
|
|
15
|
+
- `pill`
|
|
16
|
+
- `squared`
|
|
@@ -134,45 +134,6 @@ prop.
|
|
|
134
134
|
<!-- b-button-block.vue -->
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
## Pill style
|
|
138
|
-
|
|
139
|
-
Prefer buttons with a more rounded-pill style? Just set the prop `pill` to true.
|
|
140
|
-
|
|
141
|
-
```html
|
|
142
|
-
<div>
|
|
143
|
-
<b-button pill>Button</b-button>
|
|
144
|
-
<b-button pill variant="primary">Button</b-button>
|
|
145
|
-
<b-button pill variant="outline-secondary">Button</b-button>
|
|
146
|
-
<b-button pill variant="success">Button</b-button>
|
|
147
|
-
<b-button pill variant="outline-danger">Button</b-button>
|
|
148
|
-
<b-button pill variant="info">Button</b-button>
|
|
149
|
-
</div>
|
|
150
|
-
|
|
151
|
-
<!-- b-button-pill.vue -->
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
This prop adds the Bootstrap v4.3 utility class `.rounded-pill` on the rendered button.
|
|
155
|
-
|
|
156
|
-
## Squared style
|
|
157
|
-
|
|
158
|
-
Prefer buttons with a more square corner style? Just set the prop `squared` to true.
|
|
159
|
-
|
|
160
|
-
```html
|
|
161
|
-
<div>
|
|
162
|
-
<b-button squared>Button</b-button>
|
|
163
|
-
<b-button squared variant="primary">Button</b-button>
|
|
164
|
-
<b-button squared variant="outline-secondary">Button</b-button>
|
|
165
|
-
<b-button squared variant="success">Button</b-button>
|
|
166
|
-
<b-button squared variant="outline-danger">Button</b-button>
|
|
167
|
-
<b-button squared variant="info">Button</b-button>
|
|
168
|
-
</div>
|
|
169
|
-
|
|
170
|
-
<!-- b-button-square.vue -->
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
The `squared` prop adds the Bootstrap v4.3 utility class `.rounded-0` on the rendered button. The
|
|
174
|
-
`pill` prop takes precedence over the `squared` prop.
|
|
175
|
-
|
|
176
137
|
## Disabled state
|
|
177
138
|
|
|
178
139
|
Set the `disabled` prop to disable button default functionality. `disabled` also works with buttons
|
|
@@ -22,12 +22,10 @@ export const props = makePropsConfigurable(
|
|
|
22
22
|
...linkProps,
|
|
23
23
|
block: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
24
24
|
disabled: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
25
|
-
pill: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
26
25
|
// Tri-state: `true`, `false` or `null`
|
|
27
26
|
// => On, off, not a toggle
|
|
28
27
|
pressed: makeProp(PROP_TYPE_BOOLEAN, null),
|
|
29
28
|
size: makeProp(PROP_TYPE_STRING),
|
|
30
|
-
squared: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
31
29
|
tag: makeProp(PROP_TYPE_STRING, 'button'),
|
|
32
30
|
type: makeProp(PROP_TYPE_STRING, 'button'),
|
|
33
31
|
variant: makeProp(PROP_TYPE_STRING, 'secondary')
|
|
@@ -66,8 +64,6 @@ const computeClass = props => [
|
|
|
66
64
|
{
|
|
67
65
|
[`btn-${props.size}`]: props.size,
|
|
68
66
|
'btn-block': props.block,
|
|
69
|
-
'rounded-pill': props.pill,
|
|
70
|
-
'rounded-0': props.squared && !props.pill,
|
|
71
67
|
disabled: props.disabled,
|
|
72
68
|
active: props.pressed
|
|
73
69
|
}
|
|
@@ -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: {
|
|
@@ -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 () => {
|