2026-04-08 15:56:59 +00:00
/ * *
* < bubble >
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
* A styled span used in documentation .
*
* @ type { Component }
*
* @ event click [ emitted when clicked ]
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
* /
parasails . registerComponent ( 'bubble' , {
// ╔═╗╦═╗╔═╗╔═╗╔═╗
// ╠═╝╠╦╝║ ║╠═╝╚═╗
// ╩ ╩╚═╚═╝╩ ╚═╝
props : [
'type' ,
] ,
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
data : function ( ) {
2026-04-16 15:38:38 +00:00
let rawType = this . type ? this . type . toLowerCase ( ) : '' ;
let roleLink = '' ;
switch ( rawType ) {
case 'admin' :
roleLink = '/guides/role-based-access#admin' ;
break ;
case 'maintainer' :
roleLink = '/guides/role-based-access#maintainer' ;
break ;
case 'observer' :
roleLink = '/guides/role-based-access#observer' ;
break ;
case 'observer+' :
roleLink = '/guides/role-based-access#observer2' ;
rawType = 'observer-plus' ;
break ;
case 'technician' :
roleLink = '/guides/role-based-access#technician' ;
break ;
case 'gitops' :
roleLink = '/guides/role-based-access#gitops' ;
break ;
}
2026-04-08 15:56:59 +00:00
return {
2026-04-16 15:38:38 +00:00
rawType : rawType ,
roleLink : roleLink
2026-04-08 15:56:59 +00:00
} ;
} ,
// ╦ ╦╔╦╗╔╦╗╦
// ╠═╣ ║ ║║║║
// ╩ ╩ ╩ ╩ ╩╩═╝
template : `
2026-04-16 15:38:38 +00:00
< a v - if = "roleLink" class = "role-link" : href = "roleLink" >
< span purpose = "bubble-heart" : class = "rawType" > { { type } } < / s p a n >
< / a >
< span v - else >
< span purpose = "bubble-heart" : class = "rawType" > { { type } } < / s p a n >
2026-04-08 15:56:59 +00:00
< / s p a n >
` ,
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
beforeMount : function ( ) {
if ( this . type === undefined ) {
throw new Error ( ` Incomplete usage of <bubble>: Please provide a 'type' that will be displayed as text inside the bubble. e.g., <bubble type="Observer"></bubble> ` ) ;
}
} ,
mounted : async function ( ) {
//…
} ,
beforeDestroy : function ( ) {
//…
} ,
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
methods : {
//…
}
} ) ;