@gitlab/ui 114.1.0 → 114.1.1

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 (136) hide show
  1. package/package.json +7 -26
  2. package/CHANGELOG.md +0 -13139
  3. package/src/vendor/bootstrap/LICENSE +0 -11
  4. package/src/vendor/bootstrap-vue/LICENSE +0 -11
  5. package/src/vendor/bootstrap-vue/package.json +0 -144
  6. package/src/vendor/bootstrap-vue/src/components/button/MODIFICATIONS.md +0 -16
  7. package/src/vendor/bootstrap-vue/src/components/button/README.md +0 -240
  8. package/src/vendor/bootstrap-vue/src/components/button/button-close.spec.js +0 -210
  9. package/src/vendor/bootstrap-vue/src/components/button/button.spec.js +0 -349
  10. package/src/vendor/bootstrap-vue/src/components/button/package.json +0 -105
  11. package/src/vendor/bootstrap-vue/src/components/dropdown/README.md +0 -730
  12. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.spec.js +0 -58
  13. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.spec.js +0 -110
  14. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.spec.js +0 -94
  15. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.spec.js +0 -73
  16. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.spec.js +0 -117
  17. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.spec.js +0 -147
  18. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.spec.js +0 -59
  19. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.spec.js +0 -1121
  20. package/src/vendor/bootstrap-vue/src/components/dropdown/package.json +0 -368
  21. package/src/vendor/bootstrap-vue/src/components/form/README.md +0 -365
  22. package/src/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.spec.js +0 -170
  23. package/src/vendor/bootstrap-vue/src/components/form/form-text.spec.js +0 -93
  24. package/src/vendor/bootstrap-vue/src/components/form/form-valid-feedback.spec.js +0 -157
  25. package/src/vendor/bootstrap-vue/src/components/form/form.spec.js +0 -97
  26. package/src/vendor/bootstrap-vue/src/components/form/package.json +0 -112
  27. package/src/vendor/bootstrap-vue/src/components/form-checkbox/README.md +0 -691
  28. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.spec.js +0 -525
  29. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.spec.js +0 -922
  30. package/src/vendor/bootstrap-vue/src/components/form-checkbox/package.json +0 -172
  31. package/src/vendor/bootstrap-vue/src/components/form-group/README.md +0 -339
  32. package/src/vendor/bootstrap-vue/src/components/form-group/form-group.spec.js +0 -477
  33. package/src/vendor/bootstrap-vue/src/components/form-group/package.json +0 -183
  34. package/src/vendor/bootstrap-vue/src/components/form-radio/README.md +0 -437
  35. package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio-group.spec.js +0 -357
  36. package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio.spec.js +0 -587
  37. package/src/vendor/bootstrap-vue/src/components/form-radio/package.json +0 -162
  38. package/src/vendor/bootstrap-vue/src/components/form-select/README.md +0 -504
  39. package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.spec.js +0 -138
  40. package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.spec.js +0 -75
  41. package/src/vendor/bootstrap-vue/src/components/form-select/form-select.spec.js +0 -723
  42. package/src/vendor/bootstrap-vue/src/components/form-select/package.json +0 -132
  43. package/src/vendor/bootstrap-vue/src/components/form-textarea/README.md +0 -453
  44. package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.spec.js +0 -1000
  45. package/src/vendor/bootstrap-vue/src/components/form-textarea/package.json +0 -122
  46. package/src/vendor/bootstrap-vue/src/components/layout/README.md +0 -791
  47. package/src/vendor/bootstrap-vue/src/components/layout/col.spec.js +0 -192
  48. package/src/vendor/bootstrap-vue/src/components/layout/form-row.spec.js +0 -45
  49. package/src/vendor/bootstrap-vue/src/components/layout/package.json +0 -99
  50. package/src/vendor/bootstrap-vue/src/components/link/README.md +0 -76
  51. package/src/vendor/bootstrap-vue/src/components/link/link.spec.js +0 -434
  52. package/src/vendor/bootstrap-vue/src/components/link/package.json +0 -57
  53. package/src/vendor/bootstrap-vue/src/components/modal/MODIFICATIONS.md +0 -30
  54. package/src/vendor/bootstrap-vue/src/components/modal/README.md +0 -1067
  55. package/src/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.spec.js +0 -82
  56. package/src/vendor/bootstrap-vue/src/components/modal/modal.spec.js +0 -1418
  57. package/src/vendor/bootstrap-vue/src/components/modal/package.json +0 -544
  58. package/src/vendor/bootstrap-vue/src/components/nav/README.md +0 -362
  59. package/src/vendor/bootstrap-vue/src/components/nav/nav-item.spec.js +0 -127
  60. package/src/vendor/bootstrap-vue/src/components/nav/nav.spec.js +0 -177
  61. package/src/vendor/bootstrap-vue/src/components/nav/package.json +0 -73
  62. package/src/vendor/bootstrap-vue/src/components/popover/README.md +0 -919
  63. package/src/vendor/bootstrap-vue/src/components/popover/package.json +0 -261
  64. package/src/vendor/bootstrap-vue/src/components/popover/popover.spec.js +0 -198
  65. package/src/vendor/bootstrap-vue/src/components/table/README.md +0 -3157
  66. package/src/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.spec.js +0 -112
  67. package/src/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.spec.js +0 -93
  68. package/src/vendor/bootstrap-vue/src/components/table/package.json +0 -1763
  69. package/src/vendor/bootstrap-vue/src/components/table/table-busy.spec.js +0 -150
  70. package/src/vendor/bootstrap-vue/src/components/table/table-caption.spec.js +0 -176
  71. package/src/vendor/bootstrap-vue/src/components/table/table-colgroup.spec.js +0 -81
  72. package/src/vendor/bootstrap-vue/src/components/table/table-filtering.spec.js +0 -409
  73. package/src/vendor/bootstrap-vue/src/components/table/table-item-formatter.spec.js +0 -56
  74. package/src/vendor/bootstrap-vue/src/components/table/table-lite.spec.js +0 -682
  75. package/src/vendor/bootstrap-vue/src/components/table/table-pagination.spec.js +0 -133
  76. package/src/vendor/bootstrap-vue/src/components/table/table-primarykey.spec.js +0 -83
  77. package/src/vendor/bootstrap-vue/src/components/table/table-provider.spec.js +0 -411
  78. package/src/vendor/bootstrap-vue/src/components/table/table-row-details.spec.js +0 -459
  79. package/src/vendor/bootstrap-vue/src/components/table/table-selectable.spec.js +0 -1182
  80. package/src/vendor/bootstrap-vue/src/components/table/table-simple.spec.js +0 -206
  81. package/src/vendor/bootstrap-vue/src/components/table/table-sorting.spec.js +0 -858
  82. package/src/vendor/bootstrap-vue/src/components/table/table-sticky-column.spec.js +0 -377
  83. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-bottom-row.spec.js +0 -94
  84. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-row-events.spec.js +0 -529
  85. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-top-row.spec.js +0 -88
  86. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-transition.spec.js +0 -83
  87. package/src/vendor/bootstrap-vue/src/components/table/table-tfoot-custom.spec.js +0 -91
  88. package/src/vendor/bootstrap-vue/src/components/table/table-tfoot-events.spec.js +0 -137
  89. package/src/vendor/bootstrap-vue/src/components/table/table-thead-events.spec.js +0 -155
  90. package/src/vendor/bootstrap-vue/src/components/table/table-thead-top.spec.js +0 -96
  91. package/src/vendor/bootstrap-vue/src/components/table/table.spec.js +0 -692
  92. package/src/vendor/bootstrap-vue/src/components/tabs/README.md +0 -433
  93. package/src/vendor/bootstrap-vue/src/components/tabs/package.json +0 -205
  94. package/src/vendor/bootstrap-vue/src/components/tabs/tab.spec.js +0 -330
  95. package/src/vendor/bootstrap-vue/src/components/tabs/tabs.spec.js +0 -778
  96. package/src/vendor/bootstrap-vue/src/components/toast/README.md +0 -655
  97. package/src/vendor/bootstrap-vue/src/components/toast/helpers/bv-toast.spec.js +0 -117
  98. package/src/vendor/bootstrap-vue/src/components/toast/package.json +0 -184
  99. package/src/vendor/bootstrap-vue/src/components/toast/toast.spec.js +0 -294
  100. package/src/vendor/bootstrap-vue/src/components/toast/toaster.spec.js +0 -77
  101. package/src/vendor/bootstrap-vue/src/components/tooltip/README.md +0 -559
  102. package/src/vendor/bootstrap-vue/src/components/tooltip/package.json +0 -258
  103. package/src/vendor/bootstrap-vue/src/components/tooltip/tooltip.spec.js +0 -1240
  104. package/src/vendor/bootstrap-vue/src/components/transition/package.json +0 -5
  105. package/src/vendor/bootstrap-vue/src/components/transporter/package.json +0 -5
  106. package/src/vendor/bootstrap-vue/src/components/transporter/transporter.spec.js +0 -85
  107. package/src/vendor/bootstrap-vue/src/directives/modal/modal.spec.js +0 -191
  108. package/src/vendor/bootstrap-vue/src/directives/tooltip/README.md +0 -521
  109. package/src/vendor/bootstrap-vue/src/directives/tooltip/package.json +0 -131
  110. package/src/vendor/bootstrap-vue/src/directives/tooltip/tooltip.spec.js +0 -190
  111. package/src/vendor/bootstrap-vue/src/directives/visible/README.md +0 -244
  112. package/src/vendor/bootstrap-vue/src/directives/visible/package.json +0 -24
  113. package/src/vendor/bootstrap-vue/src/mixins/attrs.spec.js +0 -194
  114. package/src/vendor/bootstrap-vue/src/mixins/click-out.spec.js +0 -52
  115. package/src/vendor/bootstrap-vue/src/mixins/focus-in.spec.js +0 -53
  116. package/src/vendor/bootstrap-vue/src/mixins/listen-on-document.spec.js +0 -117
  117. package/src/vendor/bootstrap-vue/src/mixins/listen-on-root.spec.js +0 -77
  118. package/src/vendor/bootstrap-vue/src/mixins/listen-on-window.spec.js +0 -115
  119. package/src/vendor/bootstrap-vue/src/mixins/listeners.spec.js +0 -245
  120. package/src/vendor/bootstrap-vue/src/utils/bv-event.class.spec.js +0 -66
  121. package/src/vendor/bootstrap-vue/src/utils/clone-deep.spec.js +0 -70
  122. package/src/vendor/bootstrap-vue/src/utils/config.spec.js +0 -169
  123. package/src/vendor/bootstrap-vue/src/utils/css-escape.spec.js +0 -82
  124. package/src/vendor/bootstrap-vue/src/utils/dom.spec.js +0 -291
  125. package/src/vendor/bootstrap-vue/src/utils/events.spec.js +0 -41
  126. package/src/vendor/bootstrap-vue/src/utils/get.spec.js +0 -109
  127. package/src/vendor/bootstrap-vue/src/utils/inspect.spec.js +0 -251
  128. package/src/vendor/bootstrap-vue/src/utils/loose-equal.spec.js +0 -203
  129. package/src/vendor/bootstrap-vue/src/utils/normalize-slot.spec.js +0 -63
  130. package/src/vendor/bootstrap-vue/src/utils/number.spec.js +0 -72
  131. package/src/vendor/bootstrap-vue/src/utils/object.spec.js +0 -61
  132. package/src/vendor/bootstrap-vue/src/utils/props.spec.js +0 -112
  133. package/src/vendor/bootstrap-vue/src/utils/router.spec.js +0 -248
  134. package/src/vendor/bootstrap-vue/src/utils/string.spec.js +0 -65
  135. package/src/vendor/bootstrap-vue/src/utils/stringify-object-values.spec.js +0 -47
  136. package/src/vendor/bootstrap-vue/src/utils/warn.spec.js +0 -54
@@ -1,655 +0,0 @@
1
- # Toast
2
-
3
- > Push notifications to your visitors with a `<b-toast>` and `<b-toaster>`, lightweight components
4
- > which are easily customizable for generating alert messages.
5
-
6
- Toasts are lightweight notifications designed to mimic the push notifications that have been
7
- popularized by mobile and desktop operating systems.
8
-
9
- Toasts are intended to be small interruptions to your visitors or users, and therefore should
10
- contain minimal, to-the-point, non-interactive content. Please refer to the
11
- [Accessibility tips](#accessibility-tips) section below for **important** usage information.
12
-
13
- ## Overview
14
-
15
- To encourage extensible and predictable toasts, we recommend providing a header (title) and body.
16
- Toast headers use the style `'display: flex'`, allowing easy alignment of content thanks to
17
- Bootstrap's [margin and flexbox utility classes](/docs/reference/utility-classes).
18
-
19
- Toasts are slightly translucent, too, so they blend over whatever they might appear over. For
20
- browsers that support the `backdrop-filter` CSS property, they also attempt to blur the elements
21
- under the toast.
22
-
23
- ```html
24
- <template>
25
- <div class="p-3 bg-secondary" style="min-height: 170px;">
26
- <b-button class="mb-2" variant="primary" @click="$bvToast.show('example-toast')">
27
- Show toast
28
- </b-button>
29
- <b-toast id="example-toast" title="BootstrapVue" static no-auto-hide>
30
- Hello, world! This is a toast message.
31
- </b-toast>
32
- </div>
33
- </template>
34
-
35
- <!-- toast-intro.vue -->
36
- ```
37
-
38
- **Note:** we are using the `static` prop in the above example to render the toast in-place in the
39
- document, rather than transporting it to a `<b-toaster>` target container. And we have added class
40
- `bg-secondary` to the outer `<div>` for illustrative purposes of toast
41
- transparency only.
42
-
43
- ### Toast features and notes
44
-
45
- - Toasts can be generated on demand via the injection `this.$bvToast` object, or manually created
46
- using the `<b-toast>` component.
47
- - Titles are optional, but should be included, titles are rendered inside a `<strong>` element,
48
- unless using the `toast-title` slot.
49
- - The close button at the top right of the toast can be removed via the `no-close-button` prop.
50
- - A title bar is shown, unless you give no title and set the `no-close-button` prop.
51
- - Auto-hiding occurs after 5000 ms, which can be changed via the `auto-hide-delay` prop, or disabled
52
- with the `no-auto-hide` prop.
53
- - When auto-hide is enabled, while you hover over the toast, the auto-hide countdown will pause. You
54
- can disable this feature by setting the `no-hover-pause` prop to `true`.
55
- - If you disable the auto-hide feature, avoid hiding the close button, or if you hide the close
56
- button be sure to allow the toast to auto-dismiss. Please refer to the
57
- [Accessibility tips](#accessibility-tips) section below for **important** usage information.
58
- - Toast transparency can be disabled by setting the `solid` prop to `true`.
59
- - Toasts will show inside a named `<b-toaster>` target component. BootstrapVue comes with several
60
- pre-defined toaster targets. Toasts will check for the named toaster in the document before they
61
- are shown, and will dynamically create the named toaster target if one is not found.
62
- - Toaster targets are defined completely with CSS for controlling the positioning of the contained
63
- `<b-toast>` components.
64
- - Toasts can can targeted to any named toaster.
65
- - Toasts are wrapped in a `<div>` with class `b-toast` to allow for Vue list-transition support when
66
- displayed in a toaster component.
67
-
68
- BootstrapVue uses [PortalVue](https://portal-vue.linusb.org/) to transport toasts into the toasters.
69
-
70
- ## Toasts on demand
71
-
72
- Generate a dynamic toast from anywhere in your app via the `this.$bvToast` Vue component _instance_
73
- injection, without the need to place a [`<b-toast>`](#b-toast-component) component in your app.
74
-
75
- Use the `this.$bvToast.toast()` method to generate on demand toasts. The method accepts two
76
- arguments:
77
-
78
- - `message`: the content of the toast body (either a string, or an array of `VNodes`). Required.
79
- Toasts with an empty message will not be shown. See the [Advanced usage](#advanced-usage) section
80
- for an example of passing an array of `VNodes` as the message.
81
- - `options`: an optional options object for providing a title and/or additional configuration
82
- options. The `title` option can be either a string or an array of `VNodes`
83
-
84
- The options argument accepts most of the props that the `<b-toast>` component accepts (with the
85
- exception of `static`, and `visible`) in <samp>camelCase</samp> name format instead of
86
- <samp>kebab-case</samp>.
87
-
88
- ```html
89
- <template>
90
- <div>
91
- <b-button @click="makeToast()">Show Toast</b-button>
92
- <b-button @click="makeToast(true)">Show Toast (appended)</b-button>
93
- </div>
94
- </template>
95
-
96
- <script>
97
- export default {
98
- data() {
99
- return {
100
- toastCount: 0
101
- }
102
- },
103
- methods: {
104
- makeToast(append = false) {
105
- this.toastCount++
106
- this.$bvToast.toast(`This is toast number ${this.toastCount}`, {
107
- title: 'BootstrapVue Toast',
108
- autoHideDelay: 5000,
109
- appendToast: append
110
- })
111
- }
112
- }
113
- }
114
- </script>
115
-
116
- <!-- toasts-bv-toast-example.vue -->
117
- ```
118
-
119
- Once a toast which was generated using `this.$bvToast.toast()` has been hidden, it will
120
- automatically be destroyed and removed from the document.
121
-
122
- **Notes:**
123
-
124
- - The `this.$bvToast` injection is only available when using the full `BootstrapVue` plugin or the
125
- `ToastPlugin` plugin. It is not available if importing just the `b-toast` or `b-toaster`
126
- components. To just import the `$bvToast` injection, use the `BVToastPlugin` plugin.
127
- - A new `$bvToast` injection (mixin) is created for each Vue virtual machine instance (i.e. each
128
- instantiated component), and is not usable via direct access to the `Vue.prototype`, as it needs
129
- access to the instance's `this` and `$root` contexts.
130
- - Toasts generated via `this.$bvToast.toast()` are children of the Vue instance that calls the
131
- `this.$bvToast.toast()` method, and will be hidden and destroyed if that Vue instance (i.e. your
132
- component or app) is also destroyed. If the vm context is inside a `<router-view>`, and the
133
- `$route` changes, the toast will also be destroyed (as all the children of `<router-view>` are
134
- destroyed. To make on-demand toasts persist across router `$route` changes, use
135
- `this.$root.$bvToast.toast()` instead to make the toast's parent the root of your app.
136
- - Toasts require a message. Toasts on demand with an empty message will silently not be shown.
137
-
138
- ## Options
139
-
140
- Toasts have various options that can control their style and behaviour. Options are available both
141
- as props on the `<b-toast>` component and as properties of the options object passed to
142
- `this.$bvToast.toast()`. When passing options to `this.$bvToast.toast()`, use the
143
- <samp>camelCase</samp> version of the component prop name, i.e. use `noAutoHide` instead of
144
- `no-auto-hide`.
145
-
146
- ### Title
147
-
148
- Add a title to your toast via the `title` option. Just like the toast `message`, the title can be a
149
- simple string, or an array of VNodes. See the [Advanced usage](#advanced-usage) section for an
150
- example of passing an array of `VNodes` as the message and title.
151
-
152
- ### Transparency
153
-
154
- Toasts have a semi-transparent background by default. To disable the default transparency, just set
155
- the `solid` prop to `true` to remove the alpha channel from the background color.
156
-
157
- Transparency can also be altered via the BootstrapVue custom SCSS variable
158
- `$b-toast-background-opacity` when using the SCSS files rather than CSS files. Refer to the
159
- [Theming](/docs/reference/theming) reference section.
160
-
161
- ### Variants
162
-
163
- BootstrapVue toasts provide custom CSS to define color variants. Variants follow the standard
164
- Bootstrap v4 variant names. If you have custom SCSS defined Bootstrap color theme variants, the
165
- toast custom SCSS will automatically create toast variants for you (refer to the
166
- [Theming](/docs/reference/theming) reference section).
167
-
168
- ```html
169
- <template>
170
- <div>
171
- <b-button @click="makeToast()" class="mb-2">Default</b-button>
172
- <b-button variant="primary" @click="makeToast('primary')" class="mb-2">Primary</b-button>
173
- <b-button variant="secondary" @click="makeToast('secondary')" class="mb-2">Secondary</b-button>
174
- <b-button variant="danger" @click="makeToast('danger')" class="mb-2">Danger</b-button>
175
- <b-button variant="warning" @click="makeToast('warning')" class="mb-2">Warning</b-button>
176
- <b-button variant="success" @click="makeToast('success')" class="mb-2">Success</b-button>
177
- <b-button variant="info" @click="makeToast('info')" class="mb-2">Info</b-button>
178
- </div>
179
- </template>
180
-
181
- <script>
182
- export default {
183
- methods: {
184
- makeToast(variant = null) {
185
- this.$bvToast.toast('Toast body content', {
186
- title: `Variant ${variant || 'default'}`,
187
- variant: variant,
188
- solid: true
189
- })
190
- }
191
- }
192
- }
193
- </script>
194
-
195
- <!-- toast-variants.vue -->
196
- ```
197
-
198
- ### Toaster target
199
-
200
- BootstrapVue comes with the following "built-in" toaster names (and associated styles defined in
201
- SCSS):
202
-
203
- - `b-toaster-top-right`
204
- - `b-toaster-top-left`
205
- - `b-toaster-top-center`
206
- - `b-toaster-top-full`
207
- - `b-toaster-bottom-right`
208
- - `b-toaster-bottom-left`
209
- - `b-toaster-bottom-center`
210
- - `b-toaster-bottom-full`
211
-
212
- ```html
213
- <template>
214
- <div>
215
- <b-button @click="toast('b-toaster-top-right')" class="mb-2">b-toaster-top-right</b-button>
216
- <b-button @click="toast('b-toaster-top-left')" class="mb-2">b-toaster-top-left</b-button>
217
- <b-button @click="toast('b-toaster-top-center')" class="mb-2">b-toaster-top-center</b-button>
218
- <b-button @click="toast('b-toaster-top-full')" class="mb-2">b-toaster-top-full</b-button>
219
- <b-button @click="toast('b-toaster-bottom-right', true)" class="mb-2">b-toaster-bottom-right</b-button>
220
- <b-button @click="toast('b-toaster-bottom-left', true)" class="mb-2">b-toaster-bottom-left</b-button>
221
- <b-button @click="toast('b-toaster-bottom-center', true)" class="mb-2">b-toaster-bottom-center</b-button>
222
- <b-button @click="toast('b-toaster-bottom-full', true)" class="mb-2">b-toaster-bottom-full</b-button>
223
- </div>
224
- </template>
225
-
226
- <script>
227
- export default {
228
- data() {
229
- return {
230
- counter: 0
231
- }
232
- },
233
- methods: {
234
- toast(toaster, append = false) {
235
- this.counter++
236
- this.$bvToast.toast(`Toast ${this.counter} body content`, {
237
- title: `Toaster ${toaster}`,
238
- toaster: toaster,
239
- solid: true,
240
- appendToast: append
241
- })
242
- }
243
- }
244
- }
245
- </script>
246
-
247
- <!-- toast-targets.vue -->
248
- ```
249
-
250
- **Notes:**
251
-
252
- - Toaster target names that have not been defined in CSS will render at the bottom of the document,
253
- stacked and not positioned (appended to `<body>` inside a `<b-toaster>` with class name and ID set
254
- to the toaster target name). The only default styling the toaster will have is a `z-index` of
255
- `1100`.
256
- - Avoid using `b-toaster-top-*` toasters together, or `b-toaster-bottom-*` toasters together, at the
257
- same time in your app as notifications could be obscured/overlap on small screens (i.e. `xs`).
258
-
259
- ### Prepend and append
260
-
261
- Toasts default to prepending themselves to the top of the toasts shown in the specified toaster in
262
- the order they were created. To append new toasts to the bottom, set the `append-toast` prop to
263
- `true`.
264
-
265
- ### Auto-hide
266
-
267
- Change to auto hide delay time via the `auto-hide-delay` prop (value is in milliseconds), which
268
- defaults to `5000` (minimum value `1000`). Or, disable the auto-hide feature completely by setting
269
- the `no-auto-hide` prop to `true`.
270
-
271
- When auto-hide is enabled, hovering over the toast will pause the auto-hide timer. When you un-hover
272
- the toast, the auto-hide timer will be resumed. You can disable this feature by setting the
273
- `no-hover-pause` prop to `true`.
274
-
275
- ### Close button
276
-
277
- Toasts have a close button to hide them on use click by default. Setting the `no-close-button` prop
278
- to `true` will prevent this and creates a toast without the default close button.
279
-
280
- It is still possible to create a custom close button for the toast by providing a unique ID and use
281
- the `this.$bvToast.hide(id)` method to hide the specific toast:
282
-
283
- ```html
284
- <template>
285
- <div>
286
- <b-button @click="showToast">Show Toast</b-button>
287
- </div>
288
- </template>
289
-
290
- <script>
291
- export default {
292
- data() {
293
- return {
294
- count: 0
295
- }
296
- },
297
- methods: {
298
- showToast() {
299
- // Use a shorter name for `this.$createElement`
300
- const h = this.$createElement
301
- // Create a ID with a incremented count
302
- const id = `my-toast-${this.count++}`
303
-
304
- // Create the custom close button
305
- const $closeButton = h(
306
- 'b-button',
307
- {
308
- on: { click: () => this.$bvToast.hide(id) }
309
- },
310
- 'Close'
311
- )
312
-
313
- // Create the toast
314
- this.$bvToast.toast([$closeButton], {
315
- id: id,
316
- title: `Toast ${this.count}`
317
- })
318
- }
319
- }
320
- }
321
- </script>
322
-
323
- <!-- toasts-advanced.vue -->
324
- ```
325
-
326
- ### Toast roles
327
-
328
- Toasts are rendered with a default `role` attribute of `'alert'` and `aria-live` attribute of
329
- `'assertive'`. For toasts that are meant for a casual notification, set the `is-status` prop to
330
- `true`, which will change the `role` and `aria-live` attributes to `'status'` and `'polite'`
331
- respectively.
332
-
333
- For more information, please the the [Accessibility](#accessibility) section below.
334
-
335
- ### Links
336
-
337
- Optionally convert the toast body to a link (`<a>`) or `<router-link>` (or `<nuxt-link>`) via the
338
- `href` and `to` props respectively. When set, the entire toast body becomes a link.
339
-
340
- ```html
341
- <template>
342
- <div>
343
- <b-button @click="toast()">Toast with link</b-button>
344
- </div>
345
- </template>
346
-
347
- <script>
348
- export default {
349
- methods: {
350
- toast() {
351
- this.$bvToast.toast(`Toast with action link`, {
352
- href: '#foo',
353
- title: 'Example'
354
- })
355
- }
356
- }
357
- }
358
- </script>
359
-
360
- <!-- toast-link.vue -->
361
- ```
362
-
363
- ## `<b-toast>` component
364
-
365
- When you have a custom component that would like to display just a single toast at a time, use the
366
- `<b-toast>` component. The `<b-toast>` component can be placed anywhere in your custom component or
367
- app, and does not render an element (they render a comment placeholder node which will not affect
368
- layout).
369
-
370
- The toast can be made visible via a `v-model` (which is tied to the `visible` prop), or shown using
371
- the component's `show()` and `hide()` instance methods, or via the `this.$bvToast.show(id)` and
372
- `this.$bvToast.hide(id)` methods (requires that a unique ID be set on the `<b-toast>` component).
373
-
374
- Toasts, by default will be paced into the `b-toaster-top-right` `<b-toaster>` component. The toaster
375
- specified by the `toaster` prop will be created on demand if it doesn't already exist in document.
376
-
377
- You can force a `<b-toast>` to appear in-place in the document by setting the `static` prop to
378
- `true`. you still need to show and hide the toast, but it will not be transported into a toaster
379
- component.
380
-
381
- ```html
382
- <template>
383
- <div>
384
- <b-button @click="$bvToast.show('my-toast')">Show toast</b-button>
385
-
386
- <b-toast id="my-toast" variant="warning" solid>
387
- <template #toast-title>
388
- <div class="d-flex flex-grow-1 align-items-baseline">
389
- <b-img blank blank-color="#ff5555" class="mr-2" width="12" height="12"></b-img>
390
- <strong class="mr-auto">Notice!</strong>
391
- <small class="text-muted mr-2">42 seconds ago</small>
392
- </div>
393
- </template>
394
- This is the content of the toast.
395
- It is short and to the point.
396
- </b-toast>
397
- </div>
398
- </template>
399
-
400
- <!-- toast-component.vue -->
401
- ```
402
-
403
- ### Slots
404
-
405
- - `toast-title`: Content to replace the default title element.
406
- - `default`: Content of the toast body
407
-
408
- Both slots are optionally scoped with the following scope:
409
-
410
- | Method or property | Description |
411
- | ------------------ | ------------------------------------------------------------------------------- |
412
- | `hide()` | Hides the toast when called. Useful if you are providing your own close button. |
413
-
414
- Slots are only available when using the `<b-toast>` component.
415
-
416
- ## `<b-toaster>` target component
417
-
418
- The `<b-toaster>` component provides a container where toasts will appear (the _Toaster_). Toasters
419
- require a unique name, and toasts can be targeted to appear in a specific named toaster.
420
-
421
- In most cases you will not need to directly use this component, as `<b-toast>` will automatically
422
- insert a `<b-toaster>` component (appended to `<body>`) with the requested toaster name if one is
423
- not found in the document. But sometimes you may want to explicitly place a toaster in your app.
424
-
425
- The toaster `name` becomes the ID of the inserted container, and will also be used a class name on
426
- the rendered toaster container.
427
-
428
- Toaster positioning and the positioning of toasts inside the toaster is driven completely by CSS
429
- classes (based on the name of the toaster)
430
-
431
- The following "built-in" toaster names (and associated styles) are defined in BootstrapVue's custom
432
- SCSS:
433
-
434
- - `b-toaster-top-right`
435
- - `b-toaster-top-left`
436
- - `b-toaster-top-center`
437
- - `b-toaster-top-full`
438
- - `b-toaster-bottom-right`
439
- - `b-toaster-bottom-left`
440
- - `b-toaster-bottom-center`
441
- - `b-toaster-bottom-full`
442
-
443
- The above toasters place the toasts in a stacked (columnar format), fixed within the viewport
444
- (meaning they will always be in view regardless of viewport scroll position). If there are more
445
- toasts than can fit on the viewport screen, some will be visually hidden offscreen until other
446
- toasts are closed/hidden.
447
-
448
- `<b-toast>` uses the `b-toaster-top-right` toaster by default.
449
-
450
- **Notes:**
451
-
452
- - If a `<b-toaster>` with the same name already exists in document (either auto-created by
453
- `<b-toast>`, `this.$bvToast.toast()`, or manually placed), then `<b-toaster>` will just render an
454
- empty `<div>` element and issue a console warning.
455
- - If manually placing a `<b-toaster>` component, make sure it is placed as the last element in
456
- bottom of your app root element, so that it will be available to all pages in your app.
457
- - Toasters that get destroyed will be auto re-created if a new toast targeted for the toaster name
458
- is shown.
459
- - In the majority of use cases, you should not need to manually place/create a `<b-toaster>`
460
- component in your app, as they will be auto generated on demand if needed. But if you need to
461
- override any of the toaster default settings, ensure that you place the toaster in your app in a
462
- location that will not be destroyed due to changes in the route.
463
-
464
- ## Advanced usage
465
-
466
- When using the `this.$bvToast.toast(...)` method for generating toasts, you may want the toast
467
- content to be more than just a string message. As mentioned in the
468
- [Toasts on demand](#toasts-on-demand) section above, you can pass arrays of `VNodes` as the message
469
- and title for more complex content.
470
-
471
- Remember to keep toast content simple and to the point. Avoid placing interactive components or
472
- elements inside toasts, as this can cause issues for users of assistive technologies. Refer to the
473
- [Accessibility](#accessibility) section below.
474
-
475
- Below is an example of using Vue's
476
- [`this.$createElement()`](https://vuejs.org/v2/guide/render-function.html#The-Virtual-DOM) method
477
- for generating more complex toast content:
478
-
479
- ```html
480
- <template>
481
- <div>
482
- <b-button @click="showToast">Show Toast with custom content</b-button>
483
- </div>
484
- </template>
485
-
486
- <script>
487
- export default {
488
- data() {
489
- return {
490
- count: 0
491
- }
492
- },
493
- methods: {
494
- showToast() {
495
- // Use a shorter name for this.$createElement
496
- const h = this.$createElement
497
- // Increment the toast count
498
- this.count++
499
- // Create the message
500
- const vNodesMsg = h(
501
- 'p',
502
- { class: ['text-center', 'mb-0'] },
503
- [
504
- ' Flashy ',
505
- h('strong', 'toast'),
506
- ` message #${this.count} `
507
- ]
508
- )
509
- // Create the title
510
- const vNodesTitle = h(
511
- 'div',
512
- { class: ['d-flex', 'flex-grow-1', 'align-items-baseline', 'mr-2'] },
513
- [
514
- h('strong', { class: 'mr-2' }, 'The Title'),
515
- h('small', { class: 'ml-auto text-italics' }, '5 minutes ago')
516
- ]
517
- )
518
- // Pass the VNodes as an array for message and title
519
- this.$bvToast.toast([vNodesMsg], {
520
- title: [vNodesTitle],
521
- solid: true,
522
- variant: 'info'
523
- })
524
- }
525
- }
526
- }
527
- </script>
528
-
529
- <!-- toasts-advanced.vue -->
530
- ```
531
-
532
- ## Alerts versus toasts
533
-
534
- In some cases you may need just a simple alert style message (i.e. cookie usage notifications,
535
- etc.). In these cases it is usually better to use an fixed position alert instead of a toast, by
536
- applying a few Bootstrap [utility classes](/docs/reference/utility-classes) and a small bit of
537
- custom styling on a [`<gl-alert>`](?path=/docs/base-alert--docs) component:
538
-
539
- ```html
540
- <template>
541
- <div>
542
- <b-button size="sm" @click="showBottom = !showBottom">
543
- {{ showBottom ? 'Hide' : 'Show' }} Fixed bottom Alert
544
- </b-button>
545
- <b-alert
546
- v-model="showBottom"
547
- class="position-fixed fixed-bottom m-0 rounded-0"
548
- style="z-index: 2000;"
549
- variant="warning"
550
- dismissible
551
- >
552
- Fixed position (bottom) alert!
553
- </b-alert>
554
-
555
- <b-button size="sm" @click="showTop = !showTop">
556
- {{ showTop ? 'Hide' : 'Show' }} Fixed top Alert
557
- </b-button>
558
- <b-alert
559
- v-model="showTop"
560
- class="position-fixed fixed-top m-0 rounded-0"
561
- style="z-index: 2000;"
562
- variant="success"
563
- dismissible
564
- >
565
- Fixed position (top) alert!
566
- </b-alert>
567
- </div>
568
- </template>
569
-
570
- <script>
571
- export default {
572
- data() {
573
- return {
574
- showBottom: false,
575
- showTop: false
576
- }
577
- }
578
- }
579
- </script>
580
-
581
- <!-- fixed-position-alerts.vue -->
582
- ```
583
-
584
- We use class `position-fixed` to set the positioning to fixed within the user's viewport, and either
585
- class `fixed-bottom` or `fixed-top` to position the alert on the bottom or top of the viewport.
586
- Class `m-0` removes the default margins around the alert and `rounded-0` removes the default rounded
587
- corners. We also set the `z-index` to a large value to ensure the alert appears over any other
588
- content on the page (the default for `fixed-top` and `fixed-bottom` is `1030`). You may need to
589
- adjust the `z-index` for your specific layout.
590
-
591
- Since the alert markup remains in the DOM where you placed the `<b-alert>` component, its tab
592
- sequence (for accessing the dismiss button) is easily accessible to screen reader and keyboard-only
593
- users.
594
-
595
- ## Accessibility
596
-
597
- Toasts are intended to be **small interruptions** to your visitors or users, so to help those with
598
- screen readers and similar assistive technologies, toasts are wrapped in an aria-live region.
599
- Changes to live regions (such as injecting/updating a toast component) are automatically announced
600
- by screen readers without needing to move the user's focus or otherwise interrupt the user.
601
- Additionally, `aria-atomic="true"` is automatically set to ensure that the entire toast is always
602
- announced as a single (atomic) unit, rather than announcing what was changed (which could lead to
603
- problems if you only update part of the toast's content, or if displaying the same toast content at
604
- a later point in time).
605
-
606
- If you just need a single simple message to appear along the bottom or top of the user's window, use
607
- a [fixed position `<b-alert>`](#alerts-versus-toasts) instead.
608
-
609
- ### Accessibility tips
610
-
611
- Typically, toast messages should display one or two-line non-critical messages that **do not**
612
- require user interaction. Without taking extra steps, toasts can have numerous accessibility issues
613
- that can impact both people with and without disabilities. The following list, while not complete,
614
- provides general guidelines when using toasts.
615
-
616
- - If the information needed is important for the process, e.g. for a list of errors in a form, then
617
- use the [`<gl-alert>`](?path=/docs/base-alert--docs) component instead of `<b-toast>`.
618
- - `<b-toast>`, by default, sets the attributes `role` to `'alert'` and `aria-live` to `'assertive'`.
619
- If it's an important message like an error, this default setting is appropriate, otherwise set the
620
- prop `is-status` to `true` which will change the attributes `role` to `'status'` and `aria-live`
621
- to `'polite'`.
622
- - Avoid popping up a toast message on page load. Performing unexpected actions on page load is very
623
- confusing to screen reader users. If a toast is needed on page load or route change, delay showing
624
- the toast by several seconds so that the screen reader will finishing announcing information about
625
- the current page without interruption by a the toast.
626
- - When setting prop `no-auto-hide` to `true`, you must have a close button to allow users to dismiss
627
- the toast. If you have also set prop `no-close-button` to `true`, you must provide your own close
628
- button or dismiss the toast by some other means. Toasts have a tab index of `0` so that they can
629
- be reached by keyboard-only users.
630
- - Avoid initiating many toasts in quick succession, as screen readers may interrupt reading the
631
- current toast and announce the new toast, causing the context of the previous toast to be missed.
632
- - For toasts with long textual content, adjust the `auto-hide-delay` to a larger timeout, to allow
633
- users time to read the content of the toast. The average person reads about 200 words per minute,
634
- so a good length of time to keep messages up is 5 seconds, plus 300 extra milliseconds per word.
635
- The shortest default that should be used as a best practice is 5 seconds (5000ms). In addition to
636
- a reasonable default timeout, you could also allow the user to choose how long they want toasts to
637
- stay up for. Most people inherently understand whether they are fast or slow readers. Having a
638
- profile setting that is part of the user login will allow slow readers to pick a longer time if
639
- the messages are going away too fast, and fast readers to pick a short time if the messages are
640
- staying up too long.
641
- - To account for memory loss and distraction as well as disability-related issues such as ADHD, a
642
- best practice would be to implement a location where users can refer to a list of past toast
643
- messages which have been shown. Preferably this list should be sortable, with the default being
644
- chronological.
645
-
646
- ### Internet Explorer screen reader support
647
-
648
- Unfortunately, IE 11 when used with [NVDA](https://github.com/nvaccess/nvda) or
649
- [JAWS](https://www.freedomscientific.com/products/software/jaws/) screen readers, will not properly
650
- announce/voice toasts when they appear. If you have a large non-sighted user-base using IE 11, you
651
- may want to create an additional off-screen `aria-live` region for IE 11 browsers only (created on
652
- page load) where copies of toast message text are placed dynamically, in addition to displaying
653
- toasts.
654
-
655
- <!-- Component reference added automatically from component package.json -->