UNPKG

@sandlada/mdc

Version:

@sandlada/mdc is an open source component library that follows the Material Design 3 design specifications.

8 lines 2.08 kB
import{property as e}from"../../../node_modules/@lit/reactive-element/decorators/property.js";import{state as t}from"../../../node_modules/@lit/reactive-element/decorators/state.js";import{query as n}from"../../../node_modules/@lit/reactive-element/decorators/query.js";import"../../../node_modules/lit/decorators.js";import{html as r,nothing as i}from"../../../node_modules/lit-html/lit-html.js";import"../../../node_modules/lit/index.js";import{classMap as a}from"../../../node_modules/lit-html/directives/class-map.js";import"../../../node_modules/lit/directives/class-map.js";import o from"../../../_virtual/_@oxc-project_runtime@0.144.0/helpers/esm/decorate.js";import{MeasuredDimensionController as s}from"../../../utils/controller/measured-dimension-controller.js";import{OpacityTransitionController as c}from"../../../utils/controller/opacity-transition-controller.js";import"../../icon/icon.js";import{BaseFab as l}from"./base-fab.js"; /** * @license * Copyright 2025 Kai-Orion & Sandlada * SPDX-License-Identifier: MIT */ var u=class extends l{constructor(){super(),this.extended=!1,this.trailingIcon=!1,this.hasLabel=!1,new s(this,{target:()=>this.labelElement}),new c(this,{target:()=>this.labelElement})}render(){return r`<button class="${a(this.getRenderClasses())}">${this.renderRipple()} ${this.renderFocusRing()} ${this.renderElevation()} ${this.trailingIcon?i:this.renderIcon()} ${this.renderLabel()} ${this.trailingIcon?this.renderIcon():i}</button>`}renderLabel(){return r`<span class="label"><slot @slotchange="${this.handleLabelSlotChange}"></slot></span>`}getRenderClasses(){return{...super.getRenderClasses(),"has-label":this.hasLabel,extended:this.extended}}handleLabelSlotChange(e){this.hasLabel=e.target.assignedElements().length>0}};o([n(`.label`)],u.prototype,`labelElement`,void 0),o([e({type:Boolean,reflect:!0})],u.prototype,`extended`,void 0),o([e({type:Boolean,reflect:!0,attribute:`trailing-icon`})],u.prototype,`trailingIcon`,void 0),o([t()],u.prototype,`hasLabel`,void 0);export{u as BaseExtendedFab}; //# sourceMappingURL=base-extended-fab.js.map