No notes defined.
<div class="sds-splitBtn">
<div class="btn-group">
<button type="button" class="sds-btn -btnPrimary">
<span class="sds-btn__text">button text</span>
</button>
<button type="button" class="sds-btn -iconBtn -btnPrimary sds-splitBtn__toggle dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="sds-icon sds-icon-chevrondown"></span>
</button>
<div aria-labelledby="" class="sds-actionMenu dropdown-menu sds-splitBtn__actionMenu dropdown-menu-right">
<a href="" class="sds-actionMenu__item dropdown-item">
<span class="sds-iconCircle -secondary10" aria-hidden="true">
<span class="sds-icon sds-icon-edit"></span>
</span>
<span>Signer maintenant</span>
</a>
<a href="" class="sds-actionMenu__item dropdown-item">
<span class="sds-iconCircle -secondary10" aria-hidden="true">
<span class="sds-icon sds-icon-infocircleborder"></span>
</span>
<span>Signer plus tard</span>
</a>
</div>
</div>
</div>
<div class="{{ namespace }}splitBtn{% for mod in modifiers %} {{ mod }}{% endfor %}{% for mod in classes %} {{ mod }}{% endfor %}" {% for attrKey, attr in splitBtnAttrs %} {{ attrKey }}="{{ attr }}"{% endfor %}>
<div class="btn-group">
{% render "@btn-primary",{text: text},true %}
{% render "@icon-btn-primary",{
classes: [namespace+"splitBtn__toggle","dropdown-toggle"],
icon: "icon-chevrondown",
attrs: {
"data-toggle":"dropdown",
"aria-expanded":"false"
}
},true %}
{% render "@snet-action-menu",splitBtnActionMenuOptions,true %}
</div>
{% if popover %}
<div class="{{ namespace }}splitBtn__popoverIndicator sr-only" data-popover-page-load="" data-container="body" data-toggle=popover" data-placement="top" data-content="Changez de type d’action, lorem ipsum dolor sit amet."></div>
{% endif %}
</div>
export default class SplitBtn {
constructor() {
this.handlePopover();
}
handlePopover() {
$(".sds-splitBtn").each(function( index, element ) {
$(element).on("click", function (e) {
$(this).find(".sds-splitBtn__popoverIndicator").popover('dispose');
});
})
}
}
/* variables specific to current element */
$element-specific-variables: "";
.#{$namespace}splitBtn {
/* Save root element context for easy access if nesting is needed */
$self: &;
/* properties of current element + media queries */
position: relative;
/* Pseudo Elements */
&::before {
}
&::after {
}
/*
Include elements that are linked to the current element but have to reside at the root level of the stylesheet
(e.g: keyframes)
*/
@at-root {
}
/* children - write selector in full in comments in order to facilitate search */
// splitBtn__toggle
&__toggle#{$self}__toggle {
// follows same logic as parent
//font-size: map-deep-get($token-button-size-map, "big", "font-size");
line-height: map-deep-get($token-button-size-map, "big", "desktop", "line-height");
border-radius: map-deep-get($token-button-size-map, "big", "desktop" ,"border-radius");
height: auto;
width: map-deep-get($token-button-size-map, "big", "desktop", "min-height");
background-image: none;
@include custom-prop-fallback("background-color","comp-button-primary-hovered-background-color","true","true");
&[aria-expanded="true"] {
[class*="#{$namespace}icon"] {
transform: rotate(180deg);
}
}
}
&__actionMenu {
margin: 0 0 map-deep-get($token-spacer-unit-map, "8") 0;
}
&__popoverIndicator {
width: map-deep-get($token-button-size-map,"big","desktop","min-height");
height: map-deep-get($token-button-size-map,"big","desktop","min-height");
top: -(map-deep-get($token-spacer-unit-map,"8"));
right: 0;
margin-left: -32px;
}
/* modifiers */
// splitBtn -altStyle
&.-altStyle {
// follows same logic as base element
}
/* random parent element */
/*
*
* Syntax : .randomParentElt & {}
*
*/
/* Pseudo Classes */
&:hover {
@media (hover: hover) {
}
}
&:focus {
}
&:active {
}
&:focus,
&:active {
}
}