{{ title }}
diff --git a/packages/sources/vue/src/components/overlays/VtmnSnackbar/VtmnSnackbar.vue b/packages/sources/vue/src/components/overlays/VtmnSnackbar/VtmnSnackbar.vue
index 57775f02a..5375b0336 100644
--- a/packages/sources/vue/src/components/overlays/VtmnSnackbar/VtmnSnackbar.vue
+++ b/packages/sources/vue/src/components/overlays/VtmnSnackbar/VtmnSnackbar.vue
@@ -2,6 +2,9 @@
import '@vtmn/css-snackbar/dist/index-with-vars.css';
import { computed, defineComponent, PropType } from 'vue';
import { VtmnButton } from '../../index';
+
+const INFINITE_TIMEOUT_MS = 9999000;
+
export default /*#__PURE__*/ defineComponent({
name: 'VtmnSnackbar',
inheritAttrs: false,
@@ -11,13 +14,17 @@ export default /*#__PURE__*/ defineComponent({
type: Boolean as PropType
,
default: false,
},
+ timeout: {
+ type: Number as PropType,
+ default: 4500,
+ },
actionLabel: {
type: String as PropType,
default: undefined,
},
},
emits: ['close', 'action'],
- setup(_, { emit }) {
+ setup(props, { emit }) {
const handleClose = (event: Event) => {
return emit('close', (event.target as HTMLInputElement).value);
};
@@ -29,8 +36,15 @@ export default /*#__PURE__*/ defineComponent({
return {
classes: computed(() => ({
'vtmn-snackbar': true,
- show: true,
+ 'show animate-delay': props.timeout > 0,
})),
+ style: {
+ '--vtmn-animation_overlay-duration': `${
+ typeof props.timeout === 'number' && props.timeout < Infinity
+ ? props.timeout
+ : INFINITE_TIMEOUT_MS
+ }ms`,
+ },
handleClose,
handleAction,
};
@@ -39,7 +53,7 @@ export default /*#__PURE__*/ defineComponent({
-
+
diff --git a/packages/sources/vue/src/components/overlays/VtmnToast/VtmnToast.vue b/packages/sources/vue/src/components/overlays/VtmnToast/VtmnToast.vue
index 465130719..cf0b2c194 100644
--- a/packages/sources/vue/src/components/overlays/VtmnToast/VtmnToast.vue
+++ b/packages/sources/vue/src/components/overlays/VtmnToast/VtmnToast.vue
@@ -3,6 +3,8 @@ import '@vtmn/css-toast/dist/index-with-vars.css';
import { computed, defineComponent, PropType, reactive } from 'vue';
import { VtmnButton } from '../../index';
+const INFINITE_TIMEOUT_MS = 9999000;
+
export default /*#__PURE__*/ defineComponent({
name: 'VtmnToast',
inheritAttrs: false,
@@ -12,6 +14,10 @@ export default /*#__PURE__*/ defineComponent({
type: Boolean as PropType
,
default: false,
},
+ timeout: {
+ type: Number as PropType,
+ default: 4500,
+ },
withCloseButton: {
type: Boolean as PropType,
default: false,
@@ -28,9 +34,16 @@ export default /*#__PURE__*/ defineComponent({
return {
classes: computed(() => ({
'vtmn-toast': true,
- show: true,
+ 'show animate-delay': props.timeout > 0,
[`vtmn-toast--with-icon-info`]: props.withIcon,
})),
+ style: {
+ '--vtmn-animation_overlay-duration': `${
+ typeof props.timeout === 'number' && props.timeout < Infinity
+ ? props.timeout
+ : INFINITE_TIMEOUT_MS
+ }ms`,
+ },
handleClose,
};
},
@@ -38,7 +51,7 @@ export default /*#__PURE__*/ defineComponent({
-