init component

This commit is contained in:
Robin COuret
2026-02-16 17:28:37 +01:00
parent 460c7a25e0
commit e0e50af706
4557 changed files with 666911 additions and 8 deletions

79
node_modules/buetify/lib/composables/message/useMessage.js generated vendored Executable file
View File

@@ -0,0 +1,79 @@
import { constant } from 'fp-ts/lib/function';
import { defineAsyncComponent, computed } from 'vue';
import { getUseTogglePropsDefinition, useToggle } from '../toggle';
const DEFAULT_MESSAGE_ICONS = {
'is-info': defineAsyncComponent(() => import('../../components/icons/infoCircle')),
'is-success': defineAsyncComponent(() => import('../../components/icons/checkCircle')),
'is-warning': defineAsyncComponent(() => import('../../components/icons/exclamationTriangle')),
'is-danger': defineAsyncComponent(() => import('../../components/icons/exclamationCircle'))
};
export function getMessageIcons(icons) {
return { ...DEFAULT_MESSAGE_ICONS,
...icons
};
}
export const UseMessagePropsDefinition = { ...getUseTogglePropsDefinition('isActive', true),
title: {
type: String
},
isClosable: {
type: Boolean,
default: true
},
message: {
type: String
},
variant: {
type: String,
default: ''
},
size: {
type: String,
default: ''
},
iconSize: {
type: String,
default: ''
},
useAutoClose: {
type: Boolean,
default: false
},
duration: {
type: Number,
default: 2000
},
useIcon: {
type: Boolean,
default: false
},
icons: {
type: Object,
default: constant(DEFAULT_MESSAGE_ICONS)
},
icon: {
type: [Object, Function]
}
};
export function useMessage(props) {
const toggle = useToggle(props, 'isActive');
const icon = computed(() => props.icon ?? props.icons[props.variant]);
const iconSize = computed(() => props.iconSize || props.size || 'is-large');
function setAutoClose() {
if (props.useAutoClose) {
setTimeout(() => {
if (toggle.isOn.value) {
toggle.setOff();
}
}, props.duration);
}
}
return { ...toggle,
icon,
iconSize,
setAutoClose
};
}
//# sourceMappingURL=useMessage.js.map