@gitlab/ui 128.13.2 → 128.13.3
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/dist/components/base/toast/toast.js +26 -24
- package/dist/index.css.map +1 -1
- package/dist/vendor/bootstrap-vue/src/components/toast/helpers/bv-toast.js +17 -3
- package/dist/vendor/bootstrap-vue/src/components/toast/toast.js +6 -1
- package/package.json +2 -2
- package/src/components/base/alert/alert.scss +11 -6
- package/src/components/base/animated_icon/animated_icon.scss +31 -20
- package/src/components/base/avatar/avatar.scss +8 -9
- package/src/components/base/avatars_inline/avatars_inline.scss +12 -4
- package/src/components/base/breadcrumb/breadcrumb.scss +2 -2
- package/src/components/base/button/button.scss +16 -14
- package/src/components/base/button_group/button_group.scss +9 -9
- package/src/components/base/datepicker/datepicker.scss +6 -6
- package/src/components/base/drawer/drawer.scss +2 -2
- package/src/components/base/dropdown/dropdown.scss +4 -4
- package/src/components/base/dropdown/dropdown_divider.scss +1 -1
- package/src/components/base/form/form_checkbox/form_checkbox.scss +12 -12
- package/src/components/base/form/form_combobox/form_combobox.scss +3 -2
- package/src/components/base/form/form_input/form_input.scss +3 -1
- package/src/components/base/form/form_select/form_select.scss +2 -2
- package/src/components/base/label/label.scss +5 -2
- package/src/components/base/link/link.scss +1 -1
- package/src/components/base/loading_icon/loading_icon.scss +1 -1
- package/src/components/base/markdown/markdown.scss +1 -1
- package/src/components/base/new_dropdowns/dropdown.scss +15 -3
- package/src/components/base/new_dropdowns/dropdown_item.scss +3 -2
- package/src/components/base/pagination/pagination.scss +5 -4
- package/src/components/base/path/path.scss +8 -3
- package/src/components/base/progress_bar/progress_bar.scss +2 -2
- package/src/components/base/table/table.scss +4 -4
- package/src/components/base/tabs/tabs/tabs.scss +7 -6
- package/src/components/base/toast/toast.js +31 -29
- package/src/components/base/toast/toast.scss +2 -2
- package/src/components/charts/legend/legend.scss +12 -8
- package/src/components/charts/single_stat/single_stat.scss +2 -2
- package/src/components/dashboards/dashboard_layout/grid_layout/grid_layout.scss +1 -1
- package/src/components/regions/empty_state/empty_state.scss +1 -1
- package/src/components/utilities/truncate/truncate.scss +1 -1
- package/src/scss/bootstrap.scss +34 -34
- package/src/scss/bootstrap_vue.scss +10 -10
- package/src/scss/components.scss +77 -77
- package/src/scss/fonts.scss +10 -10
- package/src/scss/functions.scss +6 -6
- package/src/scss/gitlab_ui.scss +10 -10
- package/src/scss/mixins.scss +23 -23
- package/src/scss/storybook.scss +14 -15
- package/src/scss/tokens.scss +2 -2
- package/src/scss/typescale/_index.scss +1 -1
- package/src/scss/typescale/typescale_demo.scss +4 -4
- package/src/scss/typography.scss +16 -6
- package/src/scss/variables.scss +29 -14
- package/src/vendor/bootstrap-vue/src/components/toast/helpers/bv-toast.js +19 -3
- package/src/vendor/bootstrap-vue/src/components/toast/toast.js +6 -1
|
@@ -10,7 +10,7 @@ import { concat } from '../../../utils/array'
|
|
|
10
10
|
import { getComponentConfig } from '../../../utils/config'
|
|
11
11
|
import { requestAF } from '../../../utils/dom'
|
|
12
12
|
import { getRootEventName, getRootActionEventName } from '../../../utils/events'
|
|
13
|
-
import { isUndefined } from '../../../utils/inspect'
|
|
13
|
+
import { isUndefined, isFunction } from '../../../utils/inspect'
|
|
14
14
|
import {
|
|
15
15
|
assign,
|
|
16
16
|
defineProperties,
|
|
@@ -24,6 +24,7 @@ import { pluginFactory } from '../../../utils/plugins'
|
|
|
24
24
|
import { warn, warnNotClient } from '../../../utils/warn'
|
|
25
25
|
import { createNewChildComponent } from '../../../utils/create-new-child-component'
|
|
26
26
|
import { getEventRoot } from '../../../utils/get-event-root'
|
|
27
|
+
import { isVue3 } from '../../../vue'
|
|
27
28
|
import { BToast, props as toastProps } from '../toast'
|
|
28
29
|
|
|
29
30
|
// --- Constants ---
|
|
@@ -129,9 +130,24 @@ const plugin = Vue => {
|
|
|
129
130
|
})
|
|
130
131
|
// Convert certain props to slots
|
|
131
132
|
keys(propsToSlots).forEach(prop => {
|
|
132
|
-
|
|
133
|
+
let value = props[prop]
|
|
133
134
|
if (!isUndefined(value)) {
|
|
134
|
-
|
|
135
|
+
if (isVue3(toast)) {
|
|
136
|
+
// In Vue 3 compat, $slots is readonly. Set slots on the internal
|
|
137
|
+
// instance as functions so VNodes are available during the
|
|
138
|
+
// component's render cycle. When the value is a render function,
|
|
139
|
+
// defer calling it until the slot is evaluated during render so
|
|
140
|
+
// that $createElement runs within an active component context.
|
|
141
|
+
const slotFn = isFunction(value)
|
|
142
|
+
? () => concat(value(toast.$createElement))
|
|
143
|
+
: () => concat(value)
|
|
144
|
+
toast.$.slots[propsToSlots[prop]] = slotFn
|
|
145
|
+
} else {
|
|
146
|
+
if (isFunction(value)) {
|
|
147
|
+
value = value(toast.$createElement)
|
|
148
|
+
}
|
|
149
|
+
toast.$slots[propsToSlots[prop]] = concat(value)
|
|
150
|
+
}
|
|
135
151
|
}
|
|
136
152
|
})
|
|
137
153
|
// Create a mount point (a DIV) and mount it (which triggers the show)
|
|
@@ -259,7 +259,12 @@ export const BToast = /*#__PURE__*/ extend({
|
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
const { computedToaster } = this
|
|
262
|
-
|
|
262
|
+
const hasTarget = Wormhole.hasTarget(computedToaster)
|
|
263
|
+
const hasDOM = document.getElementById(computedToaster)
|
|
264
|
+
if (!hasTarget || !hasDOM) {
|
|
265
|
+
if (hasTarget && !hasDOM) {
|
|
266
|
+
Wormhole.unregisterTarget(computedToaster)
|
|
267
|
+
}
|
|
263
268
|
const div = document.createElement('div')
|
|
264
269
|
document.body.appendChild(div)
|
|
265
270
|
|