Split Button

No notes defined.

<div class="sds-splitButton">
    <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-splitButton__toggle dropdown-toggle" data-toggle="dropdown" aria-expanded="false">

            <span aria-hidden="true" class="sds-icon sds-icon-chevrondown"></span>

            <span class="sr-only">Afficher plus d’options</span>

        </button>
        <div aria-labelledby="" class="sds-actionMenu dropdown-menu sds-splitButton__actionMenu dropdown-menu-right">
            <ul class="list-unstyled">

                <li>
                    <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>
                </li>

                <li>
                    <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>
                </li>

            </ul>

        </div>
    </div>

</div>
<div class="{{ namespace }}splitButton{% for mod in modifiers %} {{ mod }}{% endfor %}{% for mod in classes %} {{ mod }}{% endfor %}" {% for attrKey, attr in splitButtonAttrs %} {{ attrKey }}="{{ attr }}"{% endfor %}>
	<div class="btn-group">
		{% render "@btn-primary",{text: text},true %}
		{% render "@icon-btn-primary",{
			classes: [namespace+"splitButton__toggle","dropdown-toggle"],
			icon: "icon-chevrondown",
			action: "Afficher plus d’options",
			attrs: {
				"data-toggle":"dropdown",
				"aria-expanded":"false"
			}
		},true %}
		{% render "@snet-action-menu",splitButtonActionMenuOptions,true %}
	</div>
	{% if popover %}
		<div class="{{ namespace }}splitButton__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>
  • Content:
    export default class SplitButton {
    
    	constructor() {
    		this.handlePopover();
    	}
    
    	handlePopover() {
    		$(".sds-splitButton").each(function( index, element ) {
    			$(element).on("click", function (e) {
    				$(this).find(".sds-splitButton__popoverIndicator").popover('dispose');
    			});
    		})
    	}
    
    }
    
  • URL: /components/raw/split-button/SplitButton.js
  • Filesystem Path: components/token-based/actions-and-inputs/split-button/SplitButton.js
  • Size: 292 Bytes
  • Content:
    /* variables specific to current element */
    
    $element-specific-variables: "";
    
    .#{$namespace}splitButton {
    
    	/* 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 */
    
    	.#{$namespace}btn {
    		&:not(:last-child):not(.dropdown-toggle) {
    			border-right: map-deep-get($design-tokens, "comp-split-button-border-width") solid;
    			border-color: var(--comp-common-button-border-color);
    		}
    	}
    
    	// splitButton__toggle
    	&__toggle#{$self}__toggle {
    
    		// follows same logic as parent
    
    		height: auto;
    
    		&[aria-expanded="true"] {
    
    			[class*="#{$namespace}icon"] {
    				transform: rotate(180deg);
    			}
    
    		}
    
    	}
    
    	&__actionMenu {
    
    		margin: 0 0 map-deep-get($token-spacer-unit-map, "8") 0;
    
    	}
    	
    	&__popoverIndicator {
    
    		@include icon-btn-default-size;
    		top: 0;
    		right: 0;
    
    	}
    
    
    	/* modifiers */
    
    	// splitButton -alt
    	&.-altStyle {
    
    		// follows same logic as base element
    
    	}
    
    	/* random parent element */
    	/* 
    	*
    	*   Syntax : .randomParentElt & {}
    	*
    	*/
    
    	/* Pseudo Classes */
    
    	&:hover {
    		@media (hover: hover) {
    
    		}
    	}
    
    	&:focus {
    	}
    
    	&:active {
    	}
    
    	&:focus,
    	&:active {
    	}
    
    }
  • URL: /components/raw/split-button/_split-button.scss
  • Filesystem Path: components/token-based/actions-and-inputs/split-button/_split-button.scss
  • Size: 1.5 KB