@m3e/split-button 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +159 -0
- package/cem.config.mjs +16 -0
- package/demo/index.html +179 -0
- package/dist/css-custom-data.json +207 -0
- package/dist/custom-elements.json +447 -0
- package/dist/html-custom-data.json +23 -0
- package/dist/index.js +562 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +292 -0
- package/dist/index.min.js.map +1 -0
- package/dist/src/SplitButtonElement.d.ts +107 -0
- package/dist/src/SplitButtonElement.d.ts.map +1 -0
- package/dist/src/SplitButtonVariant.d.ts +3 -0
- package/dist/src/SplitButtonVariant.d.ts.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/eslint.config.mjs +13 -0
- package/package.json +51 -0
- package/rollup.config.js +32 -0
- package/src/SplitButtonElement.ts +488 -0
- package/src/SplitButtonVariant.ts +2 -0
- package/src/index.ts +2 -0
- package/tsconfig.json +9 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* Copyright (c) 2025 matraic
|
|
4
|
+
* See LICENSE file in the project root for full license text.
|
|
5
|
+
*/
|
|
6
|
+
import { LitElement, html, css } from 'lit';
|
|
7
|
+
import { Role, PressedController, HoverController, DesignToken } from '@m3e/core';
|
|
8
|
+
import { M3eButtonElement } from '@m3e/button';
|
|
9
|
+
import { M3eIconButtonElement } from '@m3e/icon-button';
|
|
10
|
+
|
|
11
|
+
/******************************************************************************
|
|
12
|
+
Copyright (c) Microsoft Corporation.
|
|
13
|
+
|
|
14
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
15
|
+
purpose with or without fee is hereby granted.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
18
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
19
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
20
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
21
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
22
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
23
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
+
***************************************************************************** */
|
|
25
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
function __decorate(decorators, target, key, desc) {
|
|
29
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
30
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
31
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
32
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
36
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
37
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
38
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
42
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
43
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
44
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
45
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
49
|
+
var e = new Error(message);
|
|
50
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @license
|
|
55
|
+
* Copyright 2017 Google LLC
|
|
56
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
57
|
+
*/
|
|
58
|
+
const t$1=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @license
|
|
62
|
+
* Copyright 2019 Google LLC
|
|
63
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
64
|
+
*/
|
|
65
|
+
const t=globalThis,e$3=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o$2=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$3&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$2.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$2.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$2("string"==typeof t?t:t+"",void 0,s),S=(s,o)=>{if(e$3)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$1=e$3?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @license
|
|
69
|
+
* Copyright 2017 Google LLC
|
|
70
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
71
|
+
*/const{is:i,defineProperty:e$2,getOwnPropertyDescriptor:h,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$1,getPrototypeOf:n$1}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f=(t,s)=>!i(t,s),b={attribute:true,type:String,converter:u,reflect:false,useDefault:false,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$2(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=n$1(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...r$1(t),...o$1(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$1(s));}else void 0!==s&&i.push(c$1(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[d("elementProperties")]=new Map,y[d("finalized")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push("2.1.1");
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @license
|
|
75
|
+
* Copyright 2017 Google LLC
|
|
76
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
77
|
+
*/const o={attribute:true,type:String,converter:u,reflect:false,hasChanged:f},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n(t){return (e,o)=>"object"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @license
|
|
81
|
+
* Copyright 2017 Google LLC
|
|
82
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
83
|
+
*/
|
|
84
|
+
const e$1=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @license
|
|
88
|
+
* Copyright 2017 Google LLC
|
|
89
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
90
|
+
*/function e(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$1(n,s,{get(){return o(this)}})}}
|
|
91
|
+
|
|
92
|
+
var _M3eSplitButtonElement_instances, _M3eSplitButtonElement_leadingButton, _M3eSplitButtonElement_trailingButton, _M3eSplitButtonElement_trailingButtonHover, _M3eSplitButtonElement_pressedController, _M3eSplitButtonElement_hoverController, _M3eSplitButtonElement_handleLeadingSlotChange, _M3eSplitButtonElement_handleTrailingSlotChange, _M3eSplitButtonElement_updateButtons, _M3eSplitButtonElement_updateLeadingButtonShape, _M3eSplitButtonElement_updateTrailingButtonShape, _M3eSplitButtonElement_updateButtonShape;
|
|
93
|
+
/**
|
|
94
|
+
* @summary
|
|
95
|
+
* A button used to show an action with a menu of related actions.
|
|
96
|
+
*
|
|
97
|
+
* @description
|
|
98
|
+
* The `m3e-split-button` component presents a primary action alongside a menu of related actions,
|
|
99
|
+
* uniting two buttons in a single expressive surface. Designed for Material 3, it supports `elevated`,
|
|
100
|
+
* `filled`, `tonal`, and `outlined` variants, and adapts to all button sizes. The leading button triggers
|
|
101
|
+
* the main action, while the trailing icon button reveals additional options, enabling efficient workflows
|
|
102
|
+
* and clear visual hierarchy. The split button ensures accessible, adaptive, and visually harmonious
|
|
103
|
+
* interactions, reflecting Material 3’s principles of clarity, flexibility, and expressive design.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* The following example illustrates use of the `m3e-split-button` to combine the `m3e-button`,
|
|
107
|
+
* `m3e-icon-button`, and `m3e-menu` components into a split button.
|
|
108
|
+
*
|
|
109
|
+
* ```html
|
|
110
|
+
* <m3e-split-button>
|
|
111
|
+
* <m3e-button slot="leading-button">
|
|
112
|
+
* <m3e-icon slot="icon" name="edit"></m3e-icon>Edit
|
|
113
|
+
* </m3e-button>
|
|
114
|
+
* <m3e-icon-button slot="trailing-button">
|
|
115
|
+
* <m3e-icon name="keyboard_arrow_down"></m3e-icon>
|
|
116
|
+
* <m3e-menu-trigger for="menu1"></m3e-menu-trigger>
|
|
117
|
+
* </m3e-icon-button>
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* @tag m3e-split-button
|
|
121
|
+
*
|
|
122
|
+
* @slot leading-button - The leading button used to perform the primary action.
|
|
123
|
+
* @slot trailing-button - The trailing icon button used to open a menu of related actions.
|
|
124
|
+
*
|
|
125
|
+
* @attr variant - The appearance variant of the button.
|
|
126
|
+
* @attr size - The size of the button.
|
|
127
|
+
*
|
|
128
|
+
* @cssprop --m3e-split-button-extra-small-trailing-button-unselected-leading-space - Leading space for the trailing button (extra-small, unselected).
|
|
129
|
+
* @cssprop --m3e-split-button-extra-small-trailing-button-unselected-trailing-space - Trailing space for the trailing button (extra-small, unselected).
|
|
130
|
+
* @cssprop --m3e-split-button-small-trailing-button-unselected-leading-space - Leading space for the trailing button (small, unselected).
|
|
131
|
+
* @cssprop --m3e-split-button-small-trailing-button-unselected-trailing-space - Trailing space for the trailing button (small, unselected).
|
|
132
|
+
* @cssprop --m3e-split-button-medium-trailing-button-unselected-leading-space - Leading space for the trailing button (medium, unselected).
|
|
133
|
+
* @cssprop --m3e-split-button-medium-trailing-button-unselected-trailing-space - Trailing space for the trailing button (medium, unselected).
|
|
134
|
+
* @cssprop --m3e-split-button-large-trailing-button-unselected-leading-space - Leading space for the trailing button (large, unselected).
|
|
135
|
+
* @cssprop --m3e-split-button-large-trailing-button-unselected-trailing-space - Trailing space for the trailing button (large, unselected).
|
|
136
|
+
* @cssprop --m3e-split-button-extra-large-trailing-button-unselected-leading-space - Leading space for the trailing button (extra-large, unselected).
|
|
137
|
+
* @cssprop --m3e-split-button-extra-large-trailing-button-unselected-trailing-space - Trailing space for the trailing button (extra-large, unselected).
|
|
138
|
+
* @cssprop --m3e-split-button-extra-small-trailing-button-selected-leading-space - Leading space for the trailing button (extra-small, selected).
|
|
139
|
+
* @cssprop --m3e-split-button-extra-small-trailing-button-selected-trailing-space - Trailing space for the trailing button (extra-small, selected).
|
|
140
|
+
* @cssprop --m3e-split-button-small-trailing-button-selected-leading-space - Leading space for the trailing button (small, selected).
|
|
141
|
+
* @cssprop --m3e-split-button-small-trailing-button-selected-trailing-space - Trailing space for the trailing button (small, selected).
|
|
142
|
+
* @cssprop --m3e-split-button-medium-trailing-button-selected-leading-space - Leading space for the trailing button (medium, selected).
|
|
143
|
+
* @cssprop --m3e-split-button-medium-trailing-button-selected-trailing-space - Trailing space for the trailing button (medium, selected).
|
|
144
|
+
* @cssprop --m3e-split-button-large-trailing-button-selected-leading-space - Leading space for the trailing button (large, selected).
|
|
145
|
+
* @cssprop --m3e-split-button-large-trailing-button-selected-trailing-space - Trailing space for the trailing button (large, selected).
|
|
146
|
+
* @cssprop --m3e-split-button-extra-large-trailing-button-selected-leading-space - Leading space for the trailing button (extra-large, selected).
|
|
147
|
+
* @cssprop --m3e-split-button-extra-large-trailing-button-selected-trailing-space - Trailing space for the trailing button (extra-large, selected).
|
|
148
|
+
* @cssprop --m3e-split-button-extra-small-inner-corner-size - Inner corner size for the leading/trailing button (extra-small).
|
|
149
|
+
* @cssprop --m3e-split-button-small-inner-corner-size - Inner corner size for the leading/trailing button (small).
|
|
150
|
+
* @cssprop --m3e-split-button-medium-inner-corner-size - Inner corner size for the leading/trailing button (medium).
|
|
151
|
+
* @cssprop --m3e-split-button-large-inner-corner-size - Inner corner size for the leading/trailing button (large).
|
|
152
|
+
* @cssprop --m3e-split-button-extra-large-inner-corner-size - Inner corner size for the leading/trailing button (extra-large).
|
|
153
|
+
* @cssprop --m3e-split-button-extra-small-inner-corner-hover-size - Inner corner size on hover (extra-small).
|
|
154
|
+
* @cssprop --m3e-split-button-small-inner-corner-hover-size - Inner corner size on hover (small).
|
|
155
|
+
* @cssprop --m3e-split-button-medium-inner-corner-hover-size - Inner corner size on hover (medium).
|
|
156
|
+
* @cssprop --m3e-split-button-large-inner-corner-hover-size - Inner corner size on hover (large).
|
|
157
|
+
* @cssprop --m3e-split-button-extra-large-inner-corner-hover-size - Inner corner size on hover (extra-large).
|
|
158
|
+
* @cssprop --m3e-split-button-extra-small-inner-corner-pressed-size - Inner corner size on press (extra-small).
|
|
159
|
+
* @cssprop --m3e-split-button-small-inner-corner-pressed-size - Inner corner size on press (small).
|
|
160
|
+
* @cssprop --m3e-split-button-medium-inner-corner-pressed-size - Inner corner size on press (medium).
|
|
161
|
+
* @cssprop --m3e-split-button-large-inner-corner-pressed-size - Inner corner size on press (large).
|
|
162
|
+
* @cssprop --m3e-split-button-extra-large-inner-corner-pressed-size - Inner corner size on press (extra-large).
|
|
163
|
+
* @cssprop --m3e-split-button-extra-small-between-spacing - Spacing between leading and trailing buttons (extra-small).
|
|
164
|
+
* @cssprop --m3e-split-button-small-between-spacing - Spacing between leading and trailing buttons (small).
|
|
165
|
+
* @cssprop --m3e-split-button-medium-between-spacing - Spacing between leading and trailing buttons (medium).
|
|
166
|
+
* @cssprop --m3e-split-button-large-between-spacing - Spacing between leading and trailing buttons (large).
|
|
167
|
+
* @cssprop --m3e-split-button-extra-large-between-spacing - Spacing between leading and trailing buttons (extra-large).
|
|
168
|
+
*/
|
|
169
|
+
let M3eSplitButtonElement = class M3eSplitButtonElement extends Role(LitElement, "group") {
|
|
170
|
+
constructor() {
|
|
171
|
+
super(...arguments);
|
|
172
|
+
_M3eSplitButtonElement_instances.add(this);
|
|
173
|
+
/** @private */ _M3eSplitButtonElement_leadingButton.set(this, void 0);
|
|
174
|
+
/** @private */ _M3eSplitButtonElement_trailingButton.set(this, void 0);
|
|
175
|
+
/** @private */ _M3eSplitButtonElement_trailingButtonHover.set(this, false);
|
|
176
|
+
/** @private */ _M3eSplitButtonElement_pressedController.set(this, new PressedController(this, {
|
|
177
|
+
target: null,
|
|
178
|
+
capture: true,
|
|
179
|
+
isPressedKey: (key) => key === " " || key === "Enter",
|
|
180
|
+
callback: (pressed, _, target) => {
|
|
181
|
+
switch (target) {
|
|
182
|
+
case __classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f"):
|
|
183
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_instances, "m", _M3eSplitButtonElement_updateLeadingButtonShape).call(this, pressed);
|
|
184
|
+
break;
|
|
185
|
+
case __classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f"):
|
|
186
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_instances, "m", _M3eSplitButtonElement_updateTrailingButtonShape).call(this, pressed || __classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButtonHover, "f"));
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
}));
|
|
191
|
+
/** @private */ _M3eSplitButtonElement_hoverController.set(this, new HoverController(this, {
|
|
192
|
+
target: null,
|
|
193
|
+
callback: (hovering, target) => {
|
|
194
|
+
switch (target) {
|
|
195
|
+
case __classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f"):
|
|
196
|
+
if (!__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f")?.disabled && !__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f")?.disabledInteractive) {
|
|
197
|
+
__classPrivateFieldSet(this, _M3eSplitButtonElement_trailingButtonHover, hovering, "f");
|
|
198
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_instances, "m", _M3eSplitButtonElement_updateTrailingButtonShape).call(this, hovering);
|
|
199
|
+
}
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
}));
|
|
204
|
+
/**
|
|
205
|
+
* The appearance variant of the button.
|
|
206
|
+
* @default "filled"
|
|
207
|
+
*/
|
|
208
|
+
this.variant = "filled";
|
|
209
|
+
/**
|
|
210
|
+
* The size of the button.
|
|
211
|
+
* @default "small"
|
|
212
|
+
*/
|
|
213
|
+
this.size = "small";
|
|
214
|
+
}
|
|
215
|
+
/** @inheritdoc */
|
|
216
|
+
update(changedProperties) {
|
|
217
|
+
super.update(changedProperties);
|
|
218
|
+
if (changedProperties.has("variant")) {
|
|
219
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_instances, "m", _M3eSplitButtonElement_updateButtons).call(this);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/** @inheritdoc */
|
|
223
|
+
render() {
|
|
224
|
+
return html `<m3e-button-group class="base" role="none" variant="connected" size="${this.size}">
|
|
225
|
+
<slot name="leading-button" @slotchange="${__classPrivateFieldGet(this, _M3eSplitButtonElement_instances, "m", _M3eSplitButtonElement_handleLeadingSlotChange)}"></slot>
|
|
226
|
+
<slot name="trailing-button" @slotchange="${__classPrivateFieldGet(this, _M3eSplitButtonElement_instances, "m", _M3eSplitButtonElement_handleTrailingSlotChange)}"></slot>
|
|
227
|
+
</m3e-button-group>`;
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
_M3eSplitButtonElement_leadingButton = new WeakMap();
|
|
231
|
+
_M3eSplitButtonElement_trailingButton = new WeakMap();
|
|
232
|
+
_M3eSplitButtonElement_trailingButtonHover = new WeakMap();
|
|
233
|
+
_M3eSplitButtonElement_pressedController = new WeakMap();
|
|
234
|
+
_M3eSplitButtonElement_hoverController = new WeakMap();
|
|
235
|
+
_M3eSplitButtonElement_instances = new WeakSet();
|
|
236
|
+
_M3eSplitButtonElement_handleLeadingSlotChange = function _M3eSplitButtonElement_handleLeadingSlotChange(e) {
|
|
237
|
+
if (__classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f")) {
|
|
238
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_pressedController, "f").unobserve(__classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f"));
|
|
239
|
+
}
|
|
240
|
+
__classPrivateFieldSet(this, _M3eSplitButtonElement_leadingButton, e.target
|
|
241
|
+
.assignedElements({ flatten: true })
|
|
242
|
+
.find((x) => x instanceof M3eButtonElement), "f");
|
|
243
|
+
if (__classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f")) {
|
|
244
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_pressedController, "f").observe(__classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f"));
|
|
245
|
+
}
|
|
246
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_instances, "m", _M3eSplitButtonElement_updateButtons).call(this);
|
|
247
|
+
};
|
|
248
|
+
_M3eSplitButtonElement_handleTrailingSlotChange = function _M3eSplitButtonElement_handleTrailingSlotChange(e) {
|
|
249
|
+
if (__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f")) {
|
|
250
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_pressedController, "f").unobserve(__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f"));
|
|
251
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_hoverController, "f").unobserve(__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f"));
|
|
252
|
+
}
|
|
253
|
+
__classPrivateFieldSet(this, _M3eSplitButtonElement_trailingButton, e.target
|
|
254
|
+
.assignedElements({ flatten: true })
|
|
255
|
+
.find((x) => x instanceof M3eIconButtonElement), "f");
|
|
256
|
+
if (__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f")) {
|
|
257
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_pressedController, "f").observe(__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f"));
|
|
258
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_hoverController, "f").observe(__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f"));
|
|
259
|
+
}
|
|
260
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_instances, "m", _M3eSplitButtonElement_updateButtons).call(this);
|
|
261
|
+
};
|
|
262
|
+
_M3eSplitButtonElement_updateButtons = function _M3eSplitButtonElement_updateButtons() {
|
|
263
|
+
if (__classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f")) {
|
|
264
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f").variant = this.variant;
|
|
265
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f").size = this.size;
|
|
266
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f").shape = "rounded";
|
|
267
|
+
}
|
|
268
|
+
if (__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f")) {
|
|
269
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f").width = "default";
|
|
270
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f").shape = "rounded";
|
|
271
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f").setAttribute("variant", this.variant);
|
|
272
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f").size = this.size;
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
_M3eSplitButtonElement_updateLeadingButtonShape = function _M3eSplitButtonElement_updateLeadingButtonShape(update) {
|
|
276
|
+
if (update && __classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f")) {
|
|
277
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_instances, "m", _M3eSplitButtonElement_updateButtonShape).call(this, __classPrivateFieldGet(this, _M3eSplitButtonElement_leadingButton, "f"), "--_leading-button-shape");
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
this._base?.style.removeProperty("--_leading-button-shape");
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
_M3eSplitButtonElement_updateTrailingButtonShape = function _M3eSplitButtonElement_updateTrailingButtonShape(update) {
|
|
284
|
+
if (update && __classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f")) {
|
|
285
|
+
__classPrivateFieldGet(this, _M3eSplitButtonElement_instances, "m", _M3eSplitButtonElement_updateButtonShape).call(this, __classPrivateFieldGet(this, _M3eSplitButtonElement_trailingButton, "f"), "--_trailing-button-shape");
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
this._base?.style.removeProperty("--_trailing-button-shape");
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
_M3eSplitButtonElement_updateButtonShape = function _M3eSplitButtonElement_updateButtonShape(button, property) {
|
|
292
|
+
const adjustedShape = button.clientHeight / 2;
|
|
293
|
+
if (adjustedShape) {
|
|
294
|
+
this._base?.style.setProperty(property, `${adjustedShape}px`);
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
/** The styles of the element. */
|
|
298
|
+
M3eSplitButtonElement.styles = css `
|
|
299
|
+
:host {
|
|
300
|
+
display: inline-flex;
|
|
301
|
+
vertical-align: middle;
|
|
302
|
+
}
|
|
303
|
+
::slotted([slot="leading-button"]) {
|
|
304
|
+
flex: 1 1 auto;
|
|
305
|
+
min-width: 0;
|
|
306
|
+
--_button-start-shape-pressed-morph: var(--_leading-button-shape, ${DesignToken.shape.corner.full});
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
::slotted([slot="trailing-button"]:not([aria-expanded="true"])) {
|
|
310
|
+
--m3e-icon-button-extra-small-default-leading-space: var(
|
|
311
|
+
--m3e-split-button-extra-small-trailing-button-unselected-leading-space,
|
|
312
|
+
0.75rem
|
|
313
|
+
);
|
|
314
|
+
--m3e-icon-button-extra-small-default-trailing-space: var(
|
|
315
|
+
--m3e-split-button-extra-small-trailing-button-unselected-trailing-space,
|
|
316
|
+
0.875rem
|
|
317
|
+
);
|
|
318
|
+
--m3e-icon-button-small-default-leading-space: var(
|
|
319
|
+
--m3e-split-button-small-trailing-button-unselected-leading-space,
|
|
320
|
+
0.75rem
|
|
321
|
+
);
|
|
322
|
+
--m3e-icon-button-small-default-trailing-space: var(
|
|
323
|
+
--m3e-split-button-small-trailing-button-unselected-trailing-space,
|
|
324
|
+
0.875rem
|
|
325
|
+
);
|
|
326
|
+
--m3e-icon-button-medium-default-leading-space: var(
|
|
327
|
+
--m3e-split-button-medium-trailing-button-unselected-leading-space,
|
|
328
|
+
0.8125rem
|
|
329
|
+
);
|
|
330
|
+
--m3e-icon-button-medium-default-trailing-space: var(
|
|
331
|
+
--m3e-split-button-medium-trailing-button-unselected-trailing-space,
|
|
332
|
+
1.0625rem
|
|
333
|
+
);
|
|
334
|
+
--m3e-icon-button-large-default-leading-space: var(
|
|
335
|
+
--m3e-split-button-large-trailing-button-unselected-leading-space,
|
|
336
|
+
1.625rem
|
|
337
|
+
);
|
|
338
|
+
--m3e-icon-button-large-default-trailing-space: var(
|
|
339
|
+
--m3e-split-button-large-trailing-button-unselected-trailing-space,
|
|
340
|
+
2rem
|
|
341
|
+
);
|
|
342
|
+
--m3e-icon-button-extra-large-default-leading-space: var(
|
|
343
|
+
--m3e-split-button-extra-large-trailing-button-unselected-leading-space,
|
|
344
|
+
2.3125rem
|
|
345
|
+
);
|
|
346
|
+
--m3e-icon-button-extra-large-default-trailing-space: var(
|
|
347
|
+
--m3e-split-button-extra-large-trailing-button-unselected-trailing-space,
|
|
348
|
+
3.0625rem
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
::slotted([slot="trailing-button"][aria-expanded="true"]) {
|
|
353
|
+
--m3e-icon-button-extra-small-default-leading-space: var(
|
|
354
|
+
--m3e-split-button-extra-small-trailing-button-selected-leading-space,
|
|
355
|
+
0.8125rem
|
|
356
|
+
);
|
|
357
|
+
--m3e-icon-button-extra-small-default-trailing-space: var(
|
|
358
|
+
--m3e-split-button-extra-small-trailing-button-selected-trailing-space,
|
|
359
|
+
0.8125rem
|
|
360
|
+
);
|
|
361
|
+
--m3e-icon-button-small-default-leading-space: var(
|
|
362
|
+
--m3e-split-button-small-trailing-button-selected-leading-space,
|
|
363
|
+
0.8125rem
|
|
364
|
+
);
|
|
365
|
+
--m3e-icon-button-small-default-trailing-space: var(
|
|
366
|
+
--m3e-split-button-small-trailing-button-selected-trailing-space,
|
|
367
|
+
0.8125rem
|
|
368
|
+
);
|
|
369
|
+
--m3e-icon-button-medium-default-leading-space: var(
|
|
370
|
+
--m3e-split-button-medium-trailing-button-selected-leading-space,
|
|
371
|
+
0.9375rem
|
|
372
|
+
);
|
|
373
|
+
--m3e-icon-button-medium-default-trailing-space: var(
|
|
374
|
+
--m3e-split-button-medium-trailing-button-selected-trailing-space,
|
|
375
|
+
0.9375rem
|
|
376
|
+
);
|
|
377
|
+
--m3e-icon-button-large-default-leading-space: var(
|
|
378
|
+
--m3e-split-button-large-trailing-button-selected-leading-space,
|
|
379
|
+
1.8125rem
|
|
380
|
+
);
|
|
381
|
+
--m3e-icon-button-large-default-trailing-space: var(
|
|
382
|
+
--m3e-split-button-large-trailing-button-selected-trailing-space,
|
|
383
|
+
1.8125rem
|
|
384
|
+
);
|
|
385
|
+
--m3e-icon-button-extra-large-default-leading-space: var(
|
|
386
|
+
--m3e-split-button-extra-large-trailing-button-selected-leading-space,
|
|
387
|
+
2.6875rem
|
|
388
|
+
);
|
|
389
|
+
--m3e-icon-button-extra-large-default-trailing-space: var(
|
|
390
|
+
--m3e-split-button-extra-large-trailing-button-selected-trailing-space,
|
|
391
|
+
2.6875rem
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
::slotted([slot="leading-button"]:not(:hover)),
|
|
396
|
+
::slotted([slot="leading-button"]:disabled),
|
|
397
|
+
::slotted([slot="leading-button"][disabled-interactive]) {
|
|
398
|
+
--m3e-connected-button-group-extra-small-inner-shape: var(
|
|
399
|
+
--m3e-split-button-extra-small-inner-corner-size,
|
|
400
|
+
${DesignToken.shape.corner.extraSmall}
|
|
401
|
+
);
|
|
402
|
+
--m3e-connected-button-group-small-inner-shape: var(
|
|
403
|
+
--m3e-split-button-small-inner-corner-size,
|
|
404
|
+
${DesignToken.shape.corner.extraSmall}
|
|
405
|
+
);
|
|
406
|
+
--m3e-connected-button-group-medium-inner-shape: var(
|
|
407
|
+
--m3e-split-button-medium-inner-corner-size,
|
|
408
|
+
${DesignToken.shape.corner.extraSmall}
|
|
409
|
+
);
|
|
410
|
+
--m3e-connected-button-group-large-inner-shape: var(
|
|
411
|
+
--m3e-split-button-large-inner-corner-size,
|
|
412
|
+
${DesignToken.shape.corner.small}
|
|
413
|
+
);
|
|
414
|
+
--m3e-connected-button-group-extra-large-inner-shape: var(
|
|
415
|
+
--m3e-split-button-extra-large-inner-corner-size,
|
|
416
|
+
${DesignToken.shape.corner.medium}
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
::slotted([slot="leading-button"]:hover:not(:disabled):not([disabled-interactive])),
|
|
420
|
+
::slotted([slot="trailing-button"]:not([aria-expanded="true"]):hover:not(:disabled):not([disabled-interactive])) {
|
|
421
|
+
--m3e-connected-button-group-extra-small-inner-shape: var(
|
|
422
|
+
--m3e-split-button-extra-small-inner-corner-hover-size,
|
|
423
|
+
${DesignToken.shape.corner.small}
|
|
424
|
+
);
|
|
425
|
+
--m3e-connected-button-group-small-inner-shape: var(
|
|
426
|
+
--m3e-split-button-small-inner-corner-hover-size,
|
|
427
|
+
${DesignToken.shape.corner.medium}
|
|
428
|
+
);
|
|
429
|
+
--m3e-connected-button-group-medium-inner-shape: var(
|
|
430
|
+
--m3e-split-button-medium-inner-corner-hover-size,
|
|
431
|
+
${DesignToken.shape.corner.medium}
|
|
432
|
+
);
|
|
433
|
+
--m3e-connected-button-group-large-inner-shape: var(
|
|
434
|
+
--m3e-split-button-large-inner-corner-hover-size,
|
|
435
|
+
${DesignToken.shape.corner.largeIncreased}
|
|
436
|
+
);
|
|
437
|
+
--m3e-connected-button-group-extra-large-inner-shape: var(
|
|
438
|
+
--m3e-split-button-extra-large-inner-corner-hover-size,
|
|
439
|
+
${DesignToken.shape.corner.largeIncreased}
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
::slotted([slot="leading-button"]),
|
|
444
|
+
::slotted([slot="trailing-button"]) {
|
|
445
|
+
--m3e-connected-button-group-extra-small-inner-pressed-shape: var(
|
|
446
|
+
--m3e-split-button-extra-small-inner-corner-pressed-size,
|
|
447
|
+
${DesignToken.shape.corner.small}
|
|
448
|
+
);
|
|
449
|
+
--m3e-connected-button-group-small-inner-pressed-shape: var(
|
|
450
|
+
--m3e-split-button-small-inner-corner-pressed-size,
|
|
451
|
+
${DesignToken.shape.corner.medium}
|
|
452
|
+
);
|
|
453
|
+
--m3e-connected-button-group-medium-inner-pressed-shape: var(
|
|
454
|
+
--m3e-split-button-medium-inner-corner-pressed-size,
|
|
455
|
+
${DesignToken.shape.corner.medium}
|
|
456
|
+
);
|
|
457
|
+
--m3e-connected-button-group-large-inner-pressed-shape: var(
|
|
458
|
+
--m3e-split-button-large-inner-corner-pressed-size,
|
|
459
|
+
${DesignToken.shape.corner.largeIncreased}
|
|
460
|
+
);
|
|
461
|
+
--m3e-connected-button-group-extra-large-inner-pressed-shape: var(
|
|
462
|
+
--m3e-split-button-extra-large-inner-corner-pressed-size,
|
|
463
|
+
${DesignToken.shape.corner.largeIncreased}
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
::slotted([slot="trailing-button"]:not([aria-expanded="true"]):not(:hover)),
|
|
468
|
+
::slotted([slot="trailing-button"]:disabled),
|
|
469
|
+
::slotted([slot="trailing-button"][disabled-interactive]) {
|
|
470
|
+
--m3e-connected-button-group-extra-small-inner-shape: var(
|
|
471
|
+
--m3e-split-button-extra-small-inner-corner-size,
|
|
472
|
+
${DesignToken.shape.corner.extraSmall}
|
|
473
|
+
);
|
|
474
|
+
--m3e-connected-button-group-small-inner-shape: var(
|
|
475
|
+
--m3e-split-button-small-inner-corner-size,
|
|
476
|
+
${DesignToken.shape.corner.extraSmall}
|
|
477
|
+
);
|
|
478
|
+
--m3e-connected-button-group-medium-inner-shape: var(
|
|
479
|
+
--m3e-split-button-medium-inner-corner-size,
|
|
480
|
+
${DesignToken.shape.corner.extraSmall}
|
|
481
|
+
);
|
|
482
|
+
--m3e-connected-button-group-large-inner-shape: var(
|
|
483
|
+
--m3e-split-button-large-inner-corner-size,
|
|
484
|
+
${DesignToken.shape.corner.small}
|
|
485
|
+
);
|
|
486
|
+
--m3e-connected-button-group-extra-large-inner-shape: var(
|
|
487
|
+
--m3e-split-button-extra-large-inner-corner-size,
|
|
488
|
+
${DesignToken.shape.corner.medium}
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
::slotted([slot="trailing-button"][aria-expanded="true"]) {
|
|
493
|
+
--_icon-button-icon-transform: rotate(180deg);
|
|
494
|
+
--_button-rounded-start-shape: var(--_trailing-button-shape, ${DesignToken.shape.corner.full});
|
|
495
|
+
--_button-rounded-end-shape: var(--_trailing-button-shape, ${DesignToken.shape.corner.full});
|
|
496
|
+
}
|
|
497
|
+
::slotted([slot="trailing-button"]) {
|
|
498
|
+
--_button-end-shape-pressed-morph: var(--_trailing-button-shape, ${DesignToken.shape.corner.full});
|
|
499
|
+
}
|
|
500
|
+
.base {
|
|
501
|
+
--m3e-icon-button-extra-small-icon-size: calc(
|
|
502
|
+
var(--m3e-spit-button-extra-small-trailing-button-icon-size, 1.375rem) + ${DesignToken.density.calc(0)}
|
|
503
|
+
);
|
|
504
|
+
--m3e-button-extra-small-icon-size: calc(
|
|
505
|
+
var(--m3e-spit-button-extra-small-trailing-button-icon-size, 1.375rem) + ${DesignToken.density.calc(0)}
|
|
506
|
+
);
|
|
507
|
+
--m3e-icon-button-small-icon-size: calc(
|
|
508
|
+
var(--m3e-spit-button-small-trailing-button-icon-size, 1.375rem) + ${DesignToken.density.calc(-1)}
|
|
509
|
+
);
|
|
510
|
+
--m3e-button-small-icon-size: calc(
|
|
511
|
+
var(--m3e-spit-button-small-trailing-button-icon-size, 1.375rem) + ${DesignToken.density.calc(-1)}
|
|
512
|
+
);
|
|
513
|
+
--m3e-icon-button-medium-icon-size: calc(
|
|
514
|
+
var(--m3e-spit-button-medium-trailing-button-icon-size, 1.625rem) + ${DesignToken.density.calc(-2)}
|
|
515
|
+
);
|
|
516
|
+
--m3e-button-medium-icon-size: calc(
|
|
517
|
+
var(--m3e-spit-button-medium-trailing-button-icon-size, 1.625rem) + ${DesignToken.density.calc(-2)}
|
|
518
|
+
);
|
|
519
|
+
--m3e-icon-button-large-icon-size: calc(
|
|
520
|
+
var(--m3e-spit-button-large-trailing-button-icon-size, 2.375rem) + ${DesignToken.density.calc(-3)}
|
|
521
|
+
);
|
|
522
|
+
--m3e-button-large-icon-size: calc(
|
|
523
|
+
var(--m3e-spit-button-large-trailing-button-icon-size, 2.375rem) + ${DesignToken.density.calc(-3)}
|
|
524
|
+
);
|
|
525
|
+
--m3e-icon-button-extra-large-icon-size: calc(
|
|
526
|
+
var(--m3e-spit-button-extra-large-trailing-button-icon-size, 3.125rem) + ${DesignToken.density.calc(-3)}
|
|
527
|
+
);
|
|
528
|
+
--m3e-button-extra-large-icon-size: calc(
|
|
529
|
+
var(--m3e-spit-button-extra-large-trailing-button-icon-size, 3.125rem) + ${DesignToken.density.calc(-3)}
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
:host([size="extra-small"]) .base {
|
|
533
|
+
--m3e-connected-button-group-spacing: var(--m3e-split-button-extra-small-between-spacing, 0.125rem);
|
|
534
|
+
}
|
|
535
|
+
:host([size="small"]) .base {
|
|
536
|
+
--m3e-connected-button-group-spacing: var(--m3e-split-button-small-between-spacing, 0.125rem);
|
|
537
|
+
}
|
|
538
|
+
:host([size="medium"]).base {
|
|
539
|
+
--m3e-connected-button-group-spacing: var(--m3e-split-button-medium-between-spacing, 0.125rem);
|
|
540
|
+
}
|
|
541
|
+
:host([size="large"]) .base {
|
|
542
|
+
--m3e-connected-button-group-spacing: var(--m3e-split-button-large-between-spacing, 0.125rem);
|
|
543
|
+
}
|
|
544
|
+
:host([size="extra-large"]) .base {
|
|
545
|
+
--m3e-connected-button-group-spacing: var(--m3e-split-button-extra-large-between-spacing, 0.125rem);
|
|
546
|
+
}
|
|
547
|
+
`;
|
|
548
|
+
__decorate([
|
|
549
|
+
e(".base")
|
|
550
|
+
], M3eSplitButtonElement.prototype, "_base", void 0);
|
|
551
|
+
__decorate([
|
|
552
|
+
n({ reflect: true })
|
|
553
|
+
], M3eSplitButtonElement.prototype, "variant", void 0);
|
|
554
|
+
__decorate([
|
|
555
|
+
n({ reflect: true })
|
|
556
|
+
], M3eSplitButtonElement.prototype, "size", void 0);
|
|
557
|
+
M3eSplitButtonElement = __decorate([
|
|
558
|
+
t$1("m3e-split-button")
|
|
559
|
+
], M3eSplitButtonElement);
|
|
560
|
+
|
|
561
|
+
export { M3eSplitButtonElement };
|
|
562
|
+
//# sourceMappingURL=index.js.map
|