@gitlab/ui 128.13.2 → 128.14.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/dist/components/base/banner/banner.js +1 -1
- package/dist/components/base/toast/toast.js +26 -24
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/dist/tokens/build/js/tokens.dark.js +1 -1
- package/dist/tokens/build/js/tokens.js +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 +3 -3
- 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/banner/banner.vue +1 -1
- 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/card/card.scss +33 -24
- 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/tokens/build/css/tokens.css +1 -1
- package/src/tokens/build/css/tokens.dark.css +1 -1
- package/src/tokens/build/figma/constants.dark.json +2 -2
- package/src/tokens/build/figma/constants.json +2 -2
- package/src/tokens/build/js/tokens.dark.js +1 -1
- package/src/tokens/build/js/tokens.js +1 -1
- package/src/tokens/build/json/tokens.dark.json +2 -2
- package/src/tokens/build/json/tokens.json +2 -2
- package/src/tokens/build/scss/_tokens.dark.scss +1 -1
- package/src/tokens/build/scss/_tokens.scss +1 -1
- package/src/tokens/contextual/card.tokens.json +1 -1
- 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
- package/src/tokens/build/figma/mode.dark.json +0 -6855
- package/src/tokens/build/figma/mode.json +0 -6767
package/src/scss/storybook.scss
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import "tokens";
|
|
2
2
|
|
|
3
|
-
@import
|
|
4
|
-
@import
|
|
3
|
+
@import "functions";
|
|
4
|
+
@import "variables";
|
|
5
5
|
|
|
6
|
-
@import
|
|
7
|
-
@import
|
|
8
|
-
@import
|
|
6
|
+
@import "../vendor/bootstrap/scss/functions";
|
|
7
|
+
@import "../vendor/bootstrap/scss/variables";
|
|
8
|
+
@import "../vendor/bootstrap/scss/mixins";
|
|
9
9
|
|
|
10
|
-
@import
|
|
10
|
+
@import "mixins";
|
|
11
11
|
|
|
12
|
-
@import
|
|
13
|
-
@import
|
|
12
|
+
@import "bootstrap";
|
|
13
|
+
@import "bootstrap_vue";
|
|
14
14
|
|
|
15
|
+
@import "fonts";
|
|
15
16
|
|
|
16
|
-
@import
|
|
17
|
-
|
|
18
|
-
@import
|
|
19
|
-
@import 'typography';
|
|
20
|
-
@import 'components';
|
|
17
|
+
@import "body";
|
|
18
|
+
@import "typography";
|
|
19
|
+
@import "components";
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* Custom padding for docs pages. This improves the integration in Pajamas pages.
|
|
@@ -36,4 +35,4 @@
|
|
|
36
35
|
// Note that adding `.css` here would break the inline import.
|
|
37
36
|
// These utilities are imported last, because that's
|
|
38
37
|
// what we do in GitLab as well.
|
|
39
|
-
@import
|
|
38
|
+
@import "tailwind";
|
package/src/scss/tokens.scss
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
1
|
+
@import "../tokens/build/css/tokens";
|
|
2
|
+
@import "../tokens/build/css/tokens.dark";
|
package/src/scss/typography.scss
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
|
|
1
|
+
h1,
|
|
2
|
+
h2,
|
|
3
|
+
h3,
|
|
4
|
+
h4,
|
|
5
|
+
h5,
|
|
6
|
+
h6,
|
|
7
|
+
.h1,
|
|
8
|
+
.h2,
|
|
9
|
+
.h3,
|
|
10
|
+
.h4,
|
|
11
|
+
.h5,
|
|
12
|
+
.h6 {
|
|
3
13
|
@apply gl-text-heading;
|
|
4
14
|
}
|
|
5
15
|
|
|
@@ -25,7 +35,7 @@ pre {
|
|
|
25
35
|
}
|
|
26
36
|
|
|
27
37
|
kbd {
|
|
28
|
-
@apply gl-inline-block gl-
|
|
38
|
+
@apply gl-border gl-inline-block gl-border-b-strong gl-bg-subtle gl-leading-1 gl-text-default;
|
|
29
39
|
font-size: 87.5%;
|
|
30
40
|
padding: 3px 5px;
|
|
31
41
|
vertical-align: unset;
|
|
@@ -35,15 +45,15 @@ kbd {
|
|
|
35
45
|
}
|
|
36
46
|
|
|
37
47
|
.table {
|
|
38
|
-
@apply gl-w-full gl-
|
|
48
|
+
@apply gl-mb-3 gl-w-full gl-bg-transparent gl-text-default;
|
|
39
49
|
|
|
40
50
|
th,
|
|
41
51
|
td {
|
|
42
|
-
@apply gl-p-4 gl-align-top
|
|
52
|
+
@apply gl-border-t gl-p-4 gl-align-top;
|
|
43
53
|
}
|
|
44
54
|
|
|
45
55
|
thead th {
|
|
46
|
-
@apply gl-
|
|
56
|
+
@apply gl-border-b gl-border-b-2 gl-align-bottom;
|
|
47
57
|
}
|
|
48
58
|
|
|
49
59
|
tbody + tbody {
|
package/src/scss/variables.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@import "functions";
|
|
3
|
+
@import "../tokens/build/scss/tokens";
|
|
4
4
|
|
|
5
5
|
// Layout
|
|
6
6
|
$grid-size: px-to-rem(8px);
|
|
@@ -45,20 +45,33 @@ $gl-font-weight-semibold: 500;
|
|
|
45
45
|
$gl-font-weight-bold: 600;
|
|
46
46
|
|
|
47
47
|
$gl-font-weights: (
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
"normal": $gl-font-weight-normal,
|
|
49
|
+
"bold": $gl-font-weight-bold,
|
|
50
50
|
);
|
|
51
51
|
|
|
52
52
|
// Fonts
|
|
53
|
-
$gl-monospace-font:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
$gl-monospace-font:
|
|
54
|
+
"GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas",
|
|
55
|
+
"Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace !default;
|
|
56
|
+
$gl-regular-font:
|
|
57
|
+
"GitLab Sans",
|
|
58
|
+
-apple-system,
|
|
59
|
+
BlinkMacSystemFont,
|
|
60
|
+
"Segoe UI",
|
|
61
|
+
Roboto,
|
|
62
|
+
"Noto Sans",
|
|
63
|
+
Ubuntu,
|
|
64
|
+
Cantarell,
|
|
65
|
+
"Helvetica Neue",
|
|
66
|
+
sans-serif,
|
|
67
|
+
"Apple Color Emoji",
|
|
68
|
+
"Segoe UI Emoji",
|
|
69
|
+
"Segoe UI Symbol",
|
|
70
|
+
"Noto Color Emoji" !default;
|
|
58
71
|
|
|
59
72
|
$gl-fonts: (
|
|
60
|
-
|
|
61
|
-
|
|
73
|
+
"monospace": $gl-monospace-font,
|
|
74
|
+
"regular": $gl-regular-font,
|
|
62
75
|
);
|
|
63
76
|
|
|
64
77
|
// New UI type scale
|
|
@@ -195,9 +208,11 @@ $gl-easing-out-cubic: cubic-bezier(0.22, 0.61, 0.36, 1);
|
|
|
195
208
|
$outline-offset: 1px;
|
|
196
209
|
$outline-width: 2px;
|
|
197
210
|
$outline: #{$outline-offset + $outline-width};
|
|
198
|
-
$focus-ring:
|
|
211
|
+
$focus-ring:
|
|
212
|
+
0 0 0 $outline-offset var(--gl-focus-ring-inner-color),
|
|
199
213
|
0 0 0 #{$outline-offset + $outline-width} var(--gl-focus-ring-outer-color);
|
|
200
|
-
$focus-ring-inset:
|
|
214
|
+
$focus-ring-inset:
|
|
215
|
+
inset 0 0 0 #{$outline-width + $outline-offset} var(--gl-focus-ring-inner-color),
|
|
201
216
|
inset 0 0 0 $outline-offset var(--gl-focus-ring-inner-color);
|
|
202
217
|
$focus-ring-outline: $outline-width solid var(--gl-focus-ring-outer-color);
|
|
203
218
|
|
|
@@ -1129,7 +1129,7 @@
|
|
|
1129
1129
|
--gl-button-selected-background-color-hover: var(--gl-button-default-primary-background-color-hover); /** Used for the background of a selected button in the hover state. */
|
|
1130
1130
|
--gl-button-selected-background-color-active: var(--gl-button-default-primary-background-color-active); /** Used for the background of a selected button in the active state. */
|
|
1131
1131
|
--gl-button-selected-border-color-focus: var(--gl-button-selected-border-color-hover); /** Used for the border of a selected button in the focus state. */
|
|
1132
|
-
--gl-card-border-radius: var(--gl-border-radius-
|
|
1132
|
+
--gl-card-border-radius: var(--gl-border-radius-xl); /** Used for card border radius. */
|
|
1133
1133
|
--gl-chart-axis-text-color: var(--gl-text-color-subtle); /** Used in charts for the text color of axis titles and labels. */
|
|
1134
1134
|
--gl-datepicker-date-text-color-selected: var(--gl-control-indicator-color-selected); /** Used for the datepicker date text color state indicators. */
|
|
1135
1135
|
--gl-drawer-border-radius: var(--gl-border-radius-2xl); /** Used for drawer border radius. */
|
|
@@ -1136,7 +1136,7 @@
|
|
|
1136
1136
|
--gl-button-link-border-radius: var(--gl-border-radius-md); /** Used for link button border radius. */
|
|
1137
1137
|
--gl-button-link-text-color-default: var(--gl-text-color-link); /** Used for the text of a link button in the default state. */
|
|
1138
1138
|
--gl-button-selected-border-color-focus: var(--gl-button-selected-border-color-hover); /** Used for the border of a selected button in the focus state. */
|
|
1139
|
-
--gl-card-border-radius: var(--gl-border-radius-
|
|
1139
|
+
--gl-card-border-radius: var(--gl-border-radius-xl); /** Used for card border radius. */
|
|
1140
1140
|
--gl-chart-axis-text-color: var(--gl-text-color-subtle); /** Used in charts for the text color of axis titles and labels. */
|
|
1141
1141
|
--gl-datepicker-date-text-color-selected: var(--gl-control-indicator-color-selected); /** Used for the datepicker date text color state indicators. */
|
|
1142
1142
|
--gl-drawer-border-radius: var(--gl-border-radius-2xl); /** Used for drawer border radius. */
|
|
@@ -3692,7 +3692,7 @@
|
|
|
3692
3692
|
}
|
|
3693
3693
|
},
|
|
3694
3694
|
"font-family-regular": {
|
|
3695
|
-
"$value": "
|
|
3695
|
+
"$value": "GitLab Sans",
|
|
3696
3696
|
"$type": "fontFamily",
|
|
3697
3697
|
"$extensions": {
|
|
3698
3698
|
"com.figma.scopes": [
|
|
@@ -3701,7 +3701,7 @@
|
|
|
3701
3701
|
}
|
|
3702
3702
|
},
|
|
3703
3703
|
"font-family-monospace": {
|
|
3704
|
-
"$value": "
|
|
3704
|
+
"$value": "GitLab Mono",
|
|
3705
3705
|
"$type": "fontFamily",
|
|
3706
3706
|
"$extensions": {
|
|
3707
3707
|
"com.figma.scopes": [
|
|
@@ -3695,7 +3695,7 @@
|
|
|
3695
3695
|
}
|
|
3696
3696
|
},
|
|
3697
3697
|
"font-family-regular": {
|
|
3698
|
-
"$value": "
|
|
3698
|
+
"$value": "GitLab Sans",
|
|
3699
3699
|
"$type": "fontFamily",
|
|
3700
3700
|
"$extensions": {
|
|
3701
3701
|
"com.figma.scopes": [
|
|
@@ -3704,7 +3704,7 @@
|
|
|
3704
3704
|
}
|
|
3705
3705
|
},
|
|
3706
3706
|
"font-family-monospace": {
|
|
3707
|
-
"$value": "
|
|
3707
|
+
"$value": "GitLab Mono",
|
|
3708
3708
|
"$type": "fontFamily",
|
|
3709
3709
|
"$extensions": {
|
|
3710
3710
|
"com.figma.scopes": [
|
|
@@ -744,7 +744,7 @@ export const GL_BUTTON_DISABLED_FOREGROUND_COLOR = '#89888d';
|
|
|
744
744
|
export const GL_BUTTON_DISABLED_BACKGROUND_COLOR = 'rgba(137, 136, 141, 0.16)';
|
|
745
745
|
export const GL_BUTTON_DISABLED_BORDER_COLOR = 'rgba(0, 0, 0, 0)';
|
|
746
746
|
export const GL_BUTTON_COUNT_BACKGROUND_COLOR = 'rgba(255, 255, 255, 0.16)';
|
|
747
|
-
export const GL_CARD_BORDER_RADIUS = '0.
|
|
747
|
+
export const GL_CARD_BORDER_RADIUS = '0.75rem';
|
|
748
748
|
export const GL_CHART_AXIS_POINTER_COLOR = '#bfbfc3';
|
|
749
749
|
export const GL_CHART_AXIS_LINE_COLOR = '#4c4b51';
|
|
750
750
|
export const GL_CHART_AXIS_TEXT_COLOR = '#bfbfc3';
|
|
@@ -744,7 +744,7 @@ export const GL_BUTTON_DISABLED_FOREGROUND_COLOR = '#737278';
|
|
|
744
744
|
export const GL_BUTTON_DISABLED_BACKGROUND_COLOR = '#fbfafd';
|
|
745
745
|
export const GL_BUTTON_DISABLED_BORDER_COLOR = '#dcdcde';
|
|
746
746
|
export const GL_BUTTON_COUNT_BACKGROUND_COLOR = 'rgba(5, 5, 6, 0.08)';
|
|
747
|
-
export const GL_CARD_BORDER_RADIUS = '0.
|
|
747
|
+
export const GL_CARD_BORDER_RADIUS = '0.75rem';
|
|
748
748
|
export const GL_CHART_AXIS_POINTER_COLOR = '#626168';
|
|
749
749
|
export const GL_CHART_AXIS_LINE_COLOR = '#bfbfc3';
|
|
750
750
|
export const GL_CHART_AXIS_TEXT_COLOR = '#626168';
|
|
@@ -21063,7 +21063,7 @@
|
|
|
21063
21063
|
"border": {
|
|
21064
21064
|
"radius": {
|
|
21065
21065
|
"key": "{card.border.radius}",
|
|
21066
|
-
"$value": "0.
|
|
21066
|
+
"$value": "0.75rem",
|
|
21067
21067
|
"$type": "dimension",
|
|
21068
21068
|
"$description": "Used for card border radius.",
|
|
21069
21069
|
"$extensions": {
|
|
@@ -21074,7 +21074,7 @@
|
|
|
21074
21074
|
"filePath": "src/tokens/contextual/card.tokens.json",
|
|
21075
21075
|
"isSource": true,
|
|
21076
21076
|
"original": {
|
|
21077
|
-
"$value": "{border.radius.
|
|
21077
|
+
"$value": "{border.radius.xl}",
|
|
21078
21078
|
"$type": "dimension",
|
|
21079
21079
|
"$description": "Used for card border radius.",
|
|
21080
21080
|
"$extensions": {
|
|
@@ -21063,7 +21063,7 @@
|
|
|
21063
21063
|
"border": {
|
|
21064
21064
|
"radius": {
|
|
21065
21065
|
"key": "{card.border.radius}",
|
|
21066
|
-
"$value": "0.
|
|
21066
|
+
"$value": "0.75rem",
|
|
21067
21067
|
"$type": "dimension",
|
|
21068
21068
|
"$description": "Used for card border radius.",
|
|
21069
21069
|
"$extensions": {
|
|
@@ -21074,7 +21074,7 @@
|
|
|
21074
21074
|
"filePath": "src/tokens/contextual/card.tokens.json",
|
|
21075
21075
|
"isSource": true,
|
|
21076
21076
|
"original": {
|
|
21077
|
-
"$value": "{border.radius.
|
|
21077
|
+
"$value": "{border.radius.xl}",
|
|
21078
21078
|
"$type": "dimension",
|
|
21079
21079
|
"$description": "Used for card border radius.",
|
|
21080
21080
|
"$extensions": {
|
|
@@ -1134,7 +1134,7 @@ $gl-button-dashed-border-color-focus: $gl-button-dashed-border-color-default; //
|
|
|
1134
1134
|
$gl-button-link-border-radius: $gl-border-radius-md; // Used for link button border radius.
|
|
1135
1135
|
$gl-button-link-text-color-default: $gl-text-color-link; // Used for the text of a link button in the default state.
|
|
1136
1136
|
$gl-button-selected-border-color-focus: $gl-button-selected-border-color-hover; // Used for the border of a selected button in the focus state.
|
|
1137
|
-
$gl-card-border-radius: $gl-border-radius-
|
|
1137
|
+
$gl-card-border-radius: $gl-border-radius-xl; // Used for card border radius.
|
|
1138
1138
|
$gl-chart-axis-text-color: $gl-text-color-subtle; // Used in charts for the text color of axis titles and labels.
|
|
1139
1139
|
$gl-datepicker-date-text-color-selected: $gl-control-indicator-color-selected; // Used for the datepicker date text color state indicators.
|
|
1140
1140
|
$gl-drawer-border-radius: $gl-border-radius-2xl; // Used for drawer border radius.
|
|
@@ -1127,7 +1127,7 @@ $gl-button-selected-foreground-color-default: $gl-button-default-primary-foregro
|
|
|
1127
1127
|
$gl-button-selected-background-color-hover: $gl-button-default-primary-background-color-hover; // Used for the background of a selected button in the hover state.
|
|
1128
1128
|
$gl-button-selected-background-color-active: $gl-button-default-primary-background-color-active; // Used for the background of a selected button in the active state.
|
|
1129
1129
|
$gl-button-selected-border-color-focus: $gl-button-selected-border-color-hover; // Used for the border of a selected button in the focus state.
|
|
1130
|
-
$gl-card-border-radius: $gl-border-radius-
|
|
1130
|
+
$gl-card-border-radius: $gl-border-radius-xl; // Used for card border radius.
|
|
1131
1131
|
$gl-chart-axis-text-color: $gl-text-color-subtle; // Used in charts for the text color of axis titles and labels.
|
|
1132
1132
|
$gl-datepicker-date-text-color-selected: $gl-control-indicator-color-selected; // Used for the datepicker date text color state indicators.
|
|
1133
1133
|
$gl-drawer-border-radius: $gl-border-radius-2xl; // Used for drawer border radius.
|
|
@@ -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
|
|