@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
5 lines (4 loc) • 2.59 kB
JavaScript
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
v3.2.1 */
import{a as p,b as h}from"./BVJFCLMH.js";import{a as r,b as d}from"./5RDOSP2E.js";import{l as b}from"./3ADX47DD.js";import{d as u}from"./HPN2C7M6.js";import"./JOSABGK6.js";import"./NNVH7JUI.js";import{E as i,F as c,H as s,R as n,c as l,d as o}from"./BJZTU5BQ.js";var w={button:"button"},F={plus:"plus"},R=l`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;background-color:transparent}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}calcite-button{--calcite-fab-shadow-internal: 0 6px 20px -4px rgba(0, 0, 0, .1), 0 4px 12px -2px rgba(0, 0, 0, .08);box-shadow:var(--calcite-fab-shadow, var(--calcite-fab-shadow-internal));--calcite-button-background-color: var(--calcite-fab-background-color);--calcite-button-border-color: var(--calcite-fab-border-color);--calcite-button-corner-radius: var(--calcite-fab-corner-radius);--calcite-button-text-color: var(--calcite-fab-text-color);--calcite-button-loader-color: var(--calcite-fab-loader-color)}:host([hidden]){display:none}[hidden]{display:none}`,t=class extends i{constructor(){super(...arguments),this.buttonEl=r(),this.appearance="solid",this.disabled=!1,this.icon=F.plus,this.iconFlipRtl=!1,this.kind="brand",this.loading=!1,this.scale="m",this.textEnabled=!1}static{this.properties={appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],icon:[3,{},{reflect:!0}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],kind:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],text:1,textEnabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=R}async setFocus(){await u(this),b(this.buttonEl.value)}updated(){p(this)}render(){let{appearance:f,kind:m,disabled:e,loading:x,scale:y,textEnabled:$,icon:g,label:a,text:v,iconFlipRtl:E}=this,k=$?null:a||v||null;return h({disabled:e,children:o`<calcite-button .appearance=${f==="solid"?"solid":"outline-fill"} class=${c(w.button)} .disabled=${e} .iconFlipRtl=${E?"start":null} .iconStart=${g} .kind=${m} .label=${a} .loading=${x} round .scale=${y} title=${k??s} type=button width=auto ${d(this.buttonEl)}>${this.textEnabled?this.text:null}</calcite-button>`})}};n("calcite-fab",t);export{t as Fab};