@gitlab/ui 114.1.0 → 114.1.2

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.
Files changed (141) hide show
  1. package/dist/components/base/breadcrumb/breadcrumb.js +4 -16
  2. package/dist/index.css +1 -1
  3. package/dist/index.css.map +1 -1
  4. package/package.json +7 -26
  5. package/src/components/base/breadcrumb/breadcrumb.scss +18 -2
  6. package/src/components/base/breadcrumb/breadcrumb.vue +4 -17
  7. package/CHANGELOG.md +0 -13139
  8. package/src/vendor/bootstrap/LICENSE +0 -11
  9. package/src/vendor/bootstrap-vue/LICENSE +0 -11
  10. package/src/vendor/bootstrap-vue/package.json +0 -144
  11. package/src/vendor/bootstrap-vue/src/components/button/MODIFICATIONS.md +0 -16
  12. package/src/vendor/bootstrap-vue/src/components/button/README.md +0 -240
  13. package/src/vendor/bootstrap-vue/src/components/button/button-close.spec.js +0 -210
  14. package/src/vendor/bootstrap-vue/src/components/button/button.spec.js +0 -349
  15. package/src/vendor/bootstrap-vue/src/components/button/package.json +0 -105
  16. package/src/vendor/bootstrap-vue/src/components/dropdown/README.md +0 -730
  17. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.spec.js +0 -58
  18. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.spec.js +0 -110
  19. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.spec.js +0 -94
  20. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.spec.js +0 -73
  21. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.spec.js +0 -117
  22. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.spec.js +0 -147
  23. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.spec.js +0 -59
  24. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.spec.js +0 -1121
  25. package/src/vendor/bootstrap-vue/src/components/dropdown/package.json +0 -368
  26. package/src/vendor/bootstrap-vue/src/components/form/README.md +0 -365
  27. package/src/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.spec.js +0 -170
  28. package/src/vendor/bootstrap-vue/src/components/form/form-text.spec.js +0 -93
  29. package/src/vendor/bootstrap-vue/src/components/form/form-valid-feedback.spec.js +0 -157
  30. package/src/vendor/bootstrap-vue/src/components/form/form.spec.js +0 -97
  31. package/src/vendor/bootstrap-vue/src/components/form/package.json +0 -112
  32. package/src/vendor/bootstrap-vue/src/components/form-checkbox/README.md +0 -691
  33. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.spec.js +0 -525
  34. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.spec.js +0 -922
  35. package/src/vendor/bootstrap-vue/src/components/form-checkbox/package.json +0 -172
  36. package/src/vendor/bootstrap-vue/src/components/form-group/README.md +0 -339
  37. package/src/vendor/bootstrap-vue/src/components/form-group/form-group.spec.js +0 -477
  38. package/src/vendor/bootstrap-vue/src/components/form-group/package.json +0 -183
  39. package/src/vendor/bootstrap-vue/src/components/form-radio/README.md +0 -437
  40. package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio-group.spec.js +0 -357
  41. package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio.spec.js +0 -587
  42. package/src/vendor/bootstrap-vue/src/components/form-radio/package.json +0 -162
  43. package/src/vendor/bootstrap-vue/src/components/form-select/README.md +0 -504
  44. package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.spec.js +0 -138
  45. package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.spec.js +0 -75
  46. package/src/vendor/bootstrap-vue/src/components/form-select/form-select.spec.js +0 -723
  47. package/src/vendor/bootstrap-vue/src/components/form-select/package.json +0 -132
  48. package/src/vendor/bootstrap-vue/src/components/form-textarea/README.md +0 -453
  49. package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.spec.js +0 -1000
  50. package/src/vendor/bootstrap-vue/src/components/form-textarea/package.json +0 -122
  51. package/src/vendor/bootstrap-vue/src/components/layout/README.md +0 -791
  52. package/src/vendor/bootstrap-vue/src/components/layout/col.spec.js +0 -192
  53. package/src/vendor/bootstrap-vue/src/components/layout/form-row.spec.js +0 -45
  54. package/src/vendor/bootstrap-vue/src/components/layout/package.json +0 -99
  55. package/src/vendor/bootstrap-vue/src/components/link/README.md +0 -76
  56. package/src/vendor/bootstrap-vue/src/components/link/link.spec.js +0 -434
  57. package/src/vendor/bootstrap-vue/src/components/link/package.json +0 -57
  58. package/src/vendor/bootstrap-vue/src/components/modal/MODIFICATIONS.md +0 -30
  59. package/src/vendor/bootstrap-vue/src/components/modal/README.md +0 -1067
  60. package/src/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.spec.js +0 -82
  61. package/src/vendor/bootstrap-vue/src/components/modal/modal.spec.js +0 -1418
  62. package/src/vendor/bootstrap-vue/src/components/modal/package.json +0 -544
  63. package/src/vendor/bootstrap-vue/src/components/nav/README.md +0 -362
  64. package/src/vendor/bootstrap-vue/src/components/nav/nav-item.spec.js +0 -127
  65. package/src/vendor/bootstrap-vue/src/components/nav/nav.spec.js +0 -177
  66. package/src/vendor/bootstrap-vue/src/components/nav/package.json +0 -73
  67. package/src/vendor/bootstrap-vue/src/components/popover/README.md +0 -919
  68. package/src/vendor/bootstrap-vue/src/components/popover/package.json +0 -261
  69. package/src/vendor/bootstrap-vue/src/components/popover/popover.spec.js +0 -198
  70. package/src/vendor/bootstrap-vue/src/components/table/README.md +0 -3157
  71. package/src/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.spec.js +0 -112
  72. package/src/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.spec.js +0 -93
  73. package/src/vendor/bootstrap-vue/src/components/table/package.json +0 -1763
  74. package/src/vendor/bootstrap-vue/src/components/table/table-busy.spec.js +0 -150
  75. package/src/vendor/bootstrap-vue/src/components/table/table-caption.spec.js +0 -176
  76. package/src/vendor/bootstrap-vue/src/components/table/table-colgroup.spec.js +0 -81
  77. package/src/vendor/bootstrap-vue/src/components/table/table-filtering.spec.js +0 -409
  78. package/src/vendor/bootstrap-vue/src/components/table/table-item-formatter.spec.js +0 -56
  79. package/src/vendor/bootstrap-vue/src/components/table/table-lite.spec.js +0 -682
  80. package/src/vendor/bootstrap-vue/src/components/table/table-pagination.spec.js +0 -133
  81. package/src/vendor/bootstrap-vue/src/components/table/table-primarykey.spec.js +0 -83
  82. package/src/vendor/bootstrap-vue/src/components/table/table-provider.spec.js +0 -411
  83. package/src/vendor/bootstrap-vue/src/components/table/table-row-details.spec.js +0 -459
  84. package/src/vendor/bootstrap-vue/src/components/table/table-selectable.spec.js +0 -1182
  85. package/src/vendor/bootstrap-vue/src/components/table/table-simple.spec.js +0 -206
  86. package/src/vendor/bootstrap-vue/src/components/table/table-sorting.spec.js +0 -858
  87. package/src/vendor/bootstrap-vue/src/components/table/table-sticky-column.spec.js +0 -377
  88. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-bottom-row.spec.js +0 -94
  89. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-row-events.spec.js +0 -529
  90. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-top-row.spec.js +0 -88
  91. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-transition.spec.js +0 -83
  92. package/src/vendor/bootstrap-vue/src/components/table/table-tfoot-custom.spec.js +0 -91
  93. package/src/vendor/bootstrap-vue/src/components/table/table-tfoot-events.spec.js +0 -137
  94. package/src/vendor/bootstrap-vue/src/components/table/table-thead-events.spec.js +0 -155
  95. package/src/vendor/bootstrap-vue/src/components/table/table-thead-top.spec.js +0 -96
  96. package/src/vendor/bootstrap-vue/src/components/table/table.spec.js +0 -692
  97. package/src/vendor/bootstrap-vue/src/components/tabs/README.md +0 -433
  98. package/src/vendor/bootstrap-vue/src/components/tabs/package.json +0 -205
  99. package/src/vendor/bootstrap-vue/src/components/tabs/tab.spec.js +0 -330
  100. package/src/vendor/bootstrap-vue/src/components/tabs/tabs.spec.js +0 -778
  101. package/src/vendor/bootstrap-vue/src/components/toast/README.md +0 -655
  102. package/src/vendor/bootstrap-vue/src/components/toast/helpers/bv-toast.spec.js +0 -117
  103. package/src/vendor/bootstrap-vue/src/components/toast/package.json +0 -184
  104. package/src/vendor/bootstrap-vue/src/components/toast/toast.spec.js +0 -294
  105. package/src/vendor/bootstrap-vue/src/components/toast/toaster.spec.js +0 -77
  106. package/src/vendor/bootstrap-vue/src/components/tooltip/README.md +0 -559
  107. package/src/vendor/bootstrap-vue/src/components/tooltip/package.json +0 -258
  108. package/src/vendor/bootstrap-vue/src/components/tooltip/tooltip.spec.js +0 -1240
  109. package/src/vendor/bootstrap-vue/src/components/transition/package.json +0 -5
  110. package/src/vendor/bootstrap-vue/src/components/transporter/package.json +0 -5
  111. package/src/vendor/bootstrap-vue/src/components/transporter/transporter.spec.js +0 -85
  112. package/src/vendor/bootstrap-vue/src/directives/modal/modal.spec.js +0 -191
  113. package/src/vendor/bootstrap-vue/src/directives/tooltip/README.md +0 -521
  114. package/src/vendor/bootstrap-vue/src/directives/tooltip/package.json +0 -131
  115. package/src/vendor/bootstrap-vue/src/directives/tooltip/tooltip.spec.js +0 -190
  116. package/src/vendor/bootstrap-vue/src/directives/visible/README.md +0 -244
  117. package/src/vendor/bootstrap-vue/src/directives/visible/package.json +0 -24
  118. package/src/vendor/bootstrap-vue/src/mixins/attrs.spec.js +0 -194
  119. package/src/vendor/bootstrap-vue/src/mixins/click-out.spec.js +0 -52
  120. package/src/vendor/bootstrap-vue/src/mixins/focus-in.spec.js +0 -53
  121. package/src/vendor/bootstrap-vue/src/mixins/listen-on-document.spec.js +0 -117
  122. package/src/vendor/bootstrap-vue/src/mixins/listen-on-root.spec.js +0 -77
  123. package/src/vendor/bootstrap-vue/src/mixins/listen-on-window.spec.js +0 -115
  124. package/src/vendor/bootstrap-vue/src/mixins/listeners.spec.js +0 -245
  125. package/src/vendor/bootstrap-vue/src/utils/bv-event.class.spec.js +0 -66
  126. package/src/vendor/bootstrap-vue/src/utils/clone-deep.spec.js +0 -70
  127. package/src/vendor/bootstrap-vue/src/utils/config.spec.js +0 -169
  128. package/src/vendor/bootstrap-vue/src/utils/css-escape.spec.js +0 -82
  129. package/src/vendor/bootstrap-vue/src/utils/dom.spec.js +0 -291
  130. package/src/vendor/bootstrap-vue/src/utils/events.spec.js +0 -41
  131. package/src/vendor/bootstrap-vue/src/utils/get.spec.js +0 -109
  132. package/src/vendor/bootstrap-vue/src/utils/inspect.spec.js +0 -251
  133. package/src/vendor/bootstrap-vue/src/utils/loose-equal.spec.js +0 -203
  134. package/src/vendor/bootstrap-vue/src/utils/normalize-slot.spec.js +0 -63
  135. package/src/vendor/bootstrap-vue/src/utils/number.spec.js +0 -72
  136. package/src/vendor/bootstrap-vue/src/utils/object.spec.js +0 -61
  137. package/src/vendor/bootstrap-vue/src/utils/props.spec.js +0 -112
  138. package/src/vendor/bootstrap-vue/src/utils/router.spec.js +0 -248
  139. package/src/vendor/bootstrap-vue/src/utils/string.spec.js +0 -65
  140. package/src/vendor/bootstrap-vue/src/utils/stringify-object-values.spec.js +0 -47
  141. package/src/vendor/bootstrap-vue/src/utils/warn.spec.js +0 -54
@@ -1,437 +0,0 @@
1
- # Form Radio
2
-
3
- > For cross browser consistency, `<b-form-radio-group>` and `<b-form-radio>` uses Bootstrap's custom
4
- > radio input to replace the browser default radio input. It is built on top of semantic and
5
- > accessible markup, so it is a solid replacement for the default radio input.
6
-
7
- ## Individual radios
8
-
9
- ```html
10
- <template>
11
- <div>
12
- <b-form-group label="Individual radios" v-slot="{ ariaDescribedby }">
13
- <b-form-radio v-model="selected" :aria-describedby="ariaDescribedby" name="some-radios" value="A">Option A</b-form-radio>
14
- <b-form-radio v-model="selected" :aria-describedby="ariaDescribedby" name="some-radios" value="B">Option B</b-form-radio>
15
- </b-form-group>
16
-
17
- <div class="mt-3">Selected: <strong>{{ selected }}</strong></div>
18
- </div>
19
- </template>
20
-
21
- <script>
22
- export default {
23
- data() {
24
- return {
25
- selected: ''
26
- }
27
- }
28
- }
29
- </script>
30
-
31
- <!-- b-form-radio.vue -->
32
- ```
33
-
34
- ## Grouped radios
35
-
36
- The individual radio inputs in `<b-form-radio-group>` can be specified via the `options` prop, or
37
- via manual placement of the `<b-form-radio>` sub component. When using manually placed
38
- `<b-form-radio>` components within a `<b-form-radio-group>`, they will inherit most props and the
39
- v-model from the `<b-form-radio-group>`.
40
-
41
- ```html
42
- <template>
43
- <div>
44
- <b-form-group label="Radios using options" v-slot="{ ariaDescribedby }">
45
- <b-form-radio-group
46
- id="radio-group-1"
47
- v-model="selected"
48
- :options="options"
49
- :aria-describedby="ariaDescribedby"
50
- name="radio-options"
51
- ></b-form-radio-group>
52
- </b-form-group>
53
-
54
- <b-form-group label="Radios using sub-components" v-slot="{ ariaDescribedby }">
55
- <b-form-radio-group
56
- id="radio-group-2"
57
- v-model="selected"
58
- :aria-describedby="ariaDescribedby"
59
- name="radio-sub-component"
60
- >
61
- <b-form-radio value="first">Toggle this custom radio</b-form-radio>
62
- <b-form-radio value="second">Or toggle this other custom radio</b-form-radio>
63
- <b-form-radio value="third" disabled>This one is Disabled</b-form-radio>
64
- <b-form-radio :value="{ fourth: 4 }">This is the 4th radio</b-form-radio>
65
- </b-form-radio-group>
66
- </b-form-group>
67
-
68
- <div class="mt-3">Selected: <strong>{{ selected }}</strong></div>
69
- </div>
70
- </template>
71
-
72
- <script>
73
- export default {
74
- data() {
75
- return {
76
- selected: 'first',
77
- options: [
78
- { text: 'Toggle this custom radio', value: 'first' },
79
- { text: 'Or toggle this other custom radio', value: 'second' },
80
- { text: 'This one is Disabled', value: 'third', disabled: true },
81
- { text: 'This is the 4th radio', value: { fourth: 4 } }
82
- ]
83
- }
84
- }
85
- }
86
- </script>
87
-
88
- <!-- b-form-radio-group.vue -->
89
- ```
90
-
91
- Feel free to mix and match `options` prop and `<b-form-radio>` in `<b-form-radio-group>`. Manually
92
- placed `<b-form-radio>` inputs will appear _below_ any radio inputs generated by the `options` prop.
93
- To have them appear _above_ the inputs generated by `options`, place them in the named slot `first`.
94
-
95
- ```html
96
- <template>
97
- <div>
98
- <b-form-group label="Radios using options and slots" v-slot="{ ariaDescribedby }">
99
- <b-form-radio-group
100
- id="radio-slots"
101
- v-model="selected"
102
- :options="options"
103
- :aria-describedby="ariaDescribedby"
104
- name="radio-options-slots"
105
- >
106
- <!-- Radios in this slot will appear first -->
107
- <template #first>
108
- <b-form-radio value="first">Toggle this custom radio from slot first</b-form-radio>
109
- </template>
110
-
111
- <!-- Radios in the default slot will appear after any option generated radios -->
112
- <b-form-radio :value="{ fourth: 4 }">This is the 4th radio</b-form-radio>
113
- <b-form-radio value="fifth">This is the 5th radio</b-form-radio>
114
- </b-form-radio-group>
115
- </b-form-group>
116
-
117
- <div class="mt-3">Selected: <strong>{{ selected }}</strong></div>
118
- </div>
119
- </template>
120
-
121
- <script>
122
- export default {
123
- data() {
124
- return {
125
- selected: '',
126
- options: [
127
- { text: 'Or toggle this other custom radio', value: 'second' },
128
- { text: 'Third radio', value: 'third' }
129
- ]
130
- }
131
- }
132
- }
133
- </script>
134
-
135
- <!-- b-form-radio-group-slot.vue -->
136
- ```
137
-
138
- ## Radio group options array
139
-
140
- `options` can be an array of strings or objects. Available fields:
141
-
142
- - **`value`** The selected value which will be set on `v-model`
143
- - **`disabled`** Disables item for selection
144
- - **`text`** Display text, or **`html`** Display basic inline html
145
-
146
- `value` can be a string, number, or simple object. Avoid using complex types in values.
147
-
148
- If both `html` and `text` are provided, `html` will take precedence. Only basic/native HTML is
149
- supported in the `html` field (components will not work). Note that not all browsers will render
150
- inline html (i.e. `<i>`, `<strong>`, etc.) inside `<option>` elements of a `<select>`.
151
-
152
- <p class="alert alert-danger">
153
- <strong>Be cautious</strong> of placing user supplied content in the <code>html</code> field,
154
- as it may make you vulnerable to
155
- <a class="alert-link" href="https://en.wikipedia.org/wiki/Cross-site_scripting">
156
- <abbr title="Cross Site Scripting Attacks">XSS attacks</abbr></a>, if you do not first
157
- <a class="alert-link" href="https://en.wikipedia.org/wiki/HTML_sanitization">sanitize</a> the
158
- user supplied string.
159
- </p>
160
-
161
- <!-- eslint-disable no-unused-vars -->
162
-
163
- ```js
164
- const options = ['A', 'B', 'C', { text: 'D', value: { d: 1 }, disabled: true }, 'E', 'F']
165
- ```
166
-
167
- If an array entry is a string, it will be used for both the generated `value` and `text` fields.
168
-
169
- You can mix using strings and [objects](#options-as-an-array-of-objects) in the array.
170
-
171
- Internally, BootstrapVue will convert the above array to the following array (the
172
- [array of objects](#options-as-an-array-of-objects)) format:
173
-
174
- <!-- eslint-disable no-unused-vars -->
175
-
176
- ```js
177
- const options = [
178
- { text: 'A', value: 'A', disabled: false },
179
- { text: 'B', value: 'B', disabled: false },
180
- { text: 'C', value: 'C', disabled: false },
181
- { text: 'D', value: { d: 1 }, disabled: true },
182
- { text: 'E', value: 'E', disabled: false },
183
- { text: 'F', value: 'F', disabled: false }
184
- ]
185
- ```
186
-
187
- ### Options as an array of objects
188
-
189
- <!-- eslint-disable no-unused-vars -->
190
-
191
- ```js
192
- const options = [
193
- { text: 'Item 1', value: 'first' },
194
- { text: 'Item 2', value: 'second' },
195
- { html: '<b>Item</b> 3', value: 'third', disabled: true },
196
- { text: 'Item 4' },
197
- { text: 'Item 5', value: { foo: 'bar', baz: true } }
198
- ]
199
- ```
200
-
201
- If `value` is missing, then `text` will be used as both the `value` and `text` fields. If you use
202
- the `html` property, you **must** supply a `value` property.
203
-
204
- Internally, BootstrapVue will convert the above array to the following array (the
205
- [array of objects](#options-as-an-array-of-objects)) format:
206
-
207
- <!-- eslint-disable no-unused-vars -->
208
-
209
- ```js
210
- const options = [
211
- { text: 'Item 1', value: 'first', disabled: false },
212
- { text: 'Item 2', value: 'second', disabled: false },
213
- { html: '<b>Item</b> 3', value: 'third', disabled: true },
214
- { text: 'Item 4', value: 'Item 4', disabled: false },
215
- { text: 'Item 5', value: 'E', disabled: false }
216
- ]
217
- ```
218
-
219
- ### Changing the option field names
220
-
221
- If you want to customize the field property names (for example using `name` field for display
222
- `text`) you can easily change them by setting the `text-field`, `html-field`, `value-field`, and
223
- `disabled-field` props to a string that contains the property name you would like to use:
224
-
225
- ```html
226
- <template>
227
- <div>
228
- <b-form-radio-group
229
- v-model="selected"
230
- :options="options"
231
- class="mb-3"
232
- value-field="item"
233
- text-field="name"
234
- disabled-field="notEnabled"
235
- ></b-form-radio-group>
236
- <div class="mt-3">Selected: <strong>{{ selected }}</strong></div>
237
- </div>
238
- </template>
239
-
240
- <script>
241
- export default {
242
- data() {
243
- return {
244
- selected: 'A',
245
- options: [
246
- { item: 'A', name: 'Option A' },
247
- { item: 'B', name: 'Option B' },
248
- { item: 'D', name: 'Option C', notEnabled: true },
249
- { item: { d: 1 }, name: 'Option D' }
250
- ]
251
- }
252
- }
253
- }
254
- </script>
255
-
256
- <!-- b-form-radio-group-options-fields.vue -->
257
- ```
258
-
259
- ## Radio value and v-model
260
-
261
- `<b-form-radio>` components do not have a value by default. You must explicitly supply a value via
262
- the `value` prop on `<b-form-radio>`. This value will be sent to the `v-model` when the radio is
263
- checked.
264
-
265
- The `v-model` of both `<b-form-radio>` and `<b-form-radio-group>` binds to the `checked` prop. To
266
- pre-check a radio, you must set the `v-model` value to the one of the radio's value (i.e. must match
267
- the value of specified on one of the the radio's `value` prop). Do not use the `checked` prop
268
- directly. Each radio in a radio group _must_ have a unique value.
269
-
270
- Radios support values of many types, such as a `string`, `boolean`, `number`, or a plain `object`.
271
-
272
- ## Inline or stacked radios
273
-
274
- By default `<b-form-radio-group>` generates inline radio inputs, while `<b-form-radio>` generates
275
- stacked radios. Set the prop `stacked` on `<b-form-radio-group>` to make the radios appear one over
276
- the other, or when using radios not in a group, set the `inline` prop on `b-form-radio` to true to
277
- render them inline.
278
-
279
- ```html
280
- <template>
281
- <div>
282
- <b-form-group label="Inline radios (default)" v-slot="{ ariaDescribedby }">
283
- <b-form-radio-group
284
- v-model="selected"
285
- :options="options"
286
- :aria-describedby="ariaDescribedby"
287
- name="radio-inline"
288
- ></b-form-radio-group>
289
- </b-form-group>
290
-
291
- <b-form-group label="Stacked radios" v-slot="{ ariaDescribedby }">
292
- <b-form-radio-group
293
- v-model="selected"
294
- :options="options"
295
- :aria-describedby="ariaDescribedby"
296
- name="radios-stacked"
297
- stacked
298
- ></b-form-radio-group>
299
- </b-form-group>
300
-
301
- <div class="mt-3">Selected: <strong>{{ selected }}</strong></div>
302
- </div>
303
- </template>
304
-
305
- <script>
306
- export default {
307
- data() {
308
- return {
309
- selected: 'first',
310
- options: [
311
- { text: 'First radio', value: 'first' },
312
- { text: 'Second radio', value: 'second' },
313
- { text: 'Third radio', value: 'third' }
314
- ]
315
- }
316
- }
317
- }
318
- </script>
319
-
320
- <!-- b-form-radio-stacked.vue -->
321
- ```
322
-
323
- ## Control sizing
324
-
325
- Use the `size` prop to control the size of the radio. The default size is medium. Supported size
326
- values are `sm` (small) and `lg` (large).
327
-
328
- ```html
329
- <div>
330
- <b-form-radio name="radio-size" size="sm">Small</b-form-radio>
331
- <b-form-radio name="radio-size">Default</b-form-radio>
332
- <b-form-radio name="radio-size" size="lg">Large</b-form-radio>
333
- </div>
334
-
335
- <!-- form-radio-sizes.vue -->
336
- ```
337
-
338
- Sizes can be set on individual `<b-form-radio>` components, or inherited from the `size` setting of
339
- `<b-form-radio-group>`.
340
-
341
- **Note:** Bootstrap v4.x does not natively support sizes for the custom radio control. However,
342
- BootstrapVue includes custom SCSS/CSS that adds support for sizing the custom radios.
343
-
344
- ## Required constraint
345
-
346
- When using individual `<b-form-radio>` components (not in a `<b-form-radio-group>`), and you want
347
- the radio(s) to be `required` in your form, you **must** provide a `name` on each `<b-form-radio>`
348
- in order for the required constraint to work. All `<b-form-radio>` components tied to the same
349
- `v-model` **must** have the same `name`.
350
-
351
- The `name` is required in order for Assistive Technologies (such as screen readers, and keyboard
352
- only users) to know which radios belong to the same form variable (the name also automatically
353
- enables native browser keyboard navigation), hence `required` will only work if `name` is set.
354
- `<b-form-radio-group>` will automatically generate a unique input name if one is not provided on the
355
- group.
356
-
357
- ## Autofocus
358
-
359
- When the `autofocus` prop is set on `<b-form-radio>`, the input will be auto-focused when it is
360
- inserted (i.e. **mounted**) into the document or re-activated when inside a Vue `<keep-alive>`
361
- component. Note that this prop **does not** set the `autofocus` attribute on the input, nor can it
362
- tell when the input becomes visible.
363
-
364
- ## Contextual states
365
-
366
- Bootstrap includes validation styles for `valid` and `invalid` states on most form controls.
367
-
368
- Generally speaking, you'll want to use a particular state for specific types of feedback:
369
-
370
- - `false` (denotes invalid state) is great for when there's a blocking or required field. A user
371
- must fill in this field properly to submit the form.
372
- - `true` (denotes valid state) is ideal for situations when you have per-field validation throughout
373
- a form and want to encourage a user through the rest of the fields.
374
- - `null` Displays no validation state (neither valid nor invalid)
375
-
376
- To apply one of the contextual state icons on `<b-form-radio>`, set the `state` prop to `false` (for
377
- invalid), `true` (for valid), or `null` (no validation state).
378
-
379
- ### Contextual state with feedback example
380
-
381
- ```html
382
- <template>
383
- <div>
384
- <b-form-radio-group v-model="value" :options="options" :state="state" name="radio-validation">
385
- <b-form-invalid-feedback :state="state">Please select one</b-form-invalid-feedback>
386
- <b-form-valid-feedback :state="state">Thank you</b-form-valid-feedback>
387
- </b-form-radio-group>
388
- </div>
389
- </template>
390
-
391
- <script>
392
- export default {
393
- data() {
394
- return {
395
- value: null,
396
- options: [
397
- { text: 'First radio', value: 'first' },
398
- { text: 'Second radio', value: 'second' },
399
- { text: 'Third radio', value: 'third' }
400
- ]
401
- }
402
- },
403
- computed: {
404
- state() {
405
- return Boolean(this.value)
406
- }
407
- }
408
- }
409
- </script>
410
-
411
- <!-- b-form-radio-validation.vue -->
412
- ```
413
-
414
- ### Conveying contextual validation state to assistive technologies and colorblind users
415
-
416
- Using these contextual states to denote the state of a form control only provides a visual,
417
- color-based indication, which will not be conveyed to users of assistive technologies - such as
418
- screen readers - or to colorblind users.
419
-
420
- Ensure that an alternative indication of state is also provided. For instance, you could include a
421
- hint about state in the form control's `<label>` text itself, or by providing an additional help
422
- text block (i.e. `<b-form-invalid-feedback>`). Specifically for assistive technologies, invalid form
423
- controls can also be assigned an `aria-invalid="true"` attribute (see below).
424
-
425
- ### ARIA `aria-invalid` attribute
426
-
427
- When `<b-form-radio-group>` has an invalid contextual state (i.e. state = `false`) you may also want
428
- to set the `<b-form-radio-group>` prop `aria-invalid` to `true`.
429
-
430
- Supported `aria-invalid` values are:
431
-
432
- - `false` (default) No errors detected
433
- - `true` The value has failed validation.
434
-
435
- `aria-invalid` is automatically set to `true` if the `state` prop is `false`.
436
-
437
- <!-- Component reference added automatically from component package.json -->