@m3e/radio-group 1.0.6 → 1.1.0

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/dist/index.js CHANGED
@@ -6,6 +6,7 @@
6
6
  import { LitElement, html, css } from 'lit';
7
7
  import { Labelled, Dirty, Touched, Checked, KeyboardClick, Focusable, FormAssociated, Disabled, AttachInternals, Role, HoverController, PressedController, formValue, DesignToken, RequiredConstraintValidation, Required, ConstraintValidation, updateLabels } from '@m3e/core';
8
8
  import { selectionManager, SelectionManager } from '@m3e/core/a11y';
9
+ import { M3eDirectionality } from '@m3e/core/bidi';
9
10
 
10
11
  /******************************************************************************
11
12
  Copyright (c) Microsoft Corporation.
@@ -20,26 +21,30 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
20
21
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
21
22
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
23
  PERFORMANCE OF THIS SOFTWARE.
23
- ***************************************************************************** */
24
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
25
-
26
-
27
- function __decorate(decorators, target, key, desc) {
28
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
29
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
30
- 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;
31
- return c > 3 && r && Object.defineProperty(target, key, r), r;
32
- }
33
-
34
- function __classPrivateFieldGet(receiver, state, kind, f) {
35
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
36
- 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");
37
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
38
- }
39
-
40
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
41
- var e = new Error(message);
42
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
24
+ ***************************************************************************** */
25
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
26
+
27
+ function __decorate(decorators, target, key, desc) {
28
+ var c = arguments.length,
29
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
30
+ d;
31
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);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
+ function __classPrivateFieldGet(receiver, state, kind, f) {
35
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
36
+ 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");
37
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
38
+ }
39
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
40
+ if (kind === "m") throw new TypeError("Private method is not writable");
41
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
42
+ 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");
43
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
44
+ }
45
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
46
+ var e = new Error(message);
47
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
43
48
  };
44
49
 
45
50
  /**
@@ -47,39 +52,395 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
47
52
  * Copyright 2017 Google LLC
48
53
  * SPDX-License-Identifier: BSD-3-Clause
49
54
  */
50
- const t$1=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
55
+ const t$1 = t => (e, o) => {
56
+ void 0 !== o ? o.addInitializer(() => {
57
+ customElements.define(t, e);
58
+ }) : customElements.define(t, e);
59
+ };
51
60
 
52
61
  /**
53
62
  * @license
54
63
  * Copyright 2019 Google LLC
55
64
  * SPDX-License-Identifier: BSD-3-Clause
56
65
  */
57
- 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
+ const t = globalThis,
67
+ e$3 = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
68
+ s = Symbol(),
69
+ o$2 = new WeakMap();
70
+ let n$2 = class n {
71
+ constructor(t, e, o) {
72
+ if (this._$cssResult$ = true, o !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
73
+ this.cssText = t, this.t = e;
74
+ }
75
+ get styleSheet() {
76
+ let t = this.o;
77
+ const s = this.t;
78
+ if (e$3 && void 0 === t) {
79
+ const e = void 0 !== s && 1 === s.length;
80
+ e && (t = o$2.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$2.set(s, t));
81
+ }
82
+ return t;
83
+ }
84
+ toString() {
85
+ return this.cssText;
86
+ }
87
+ };
88
+ const r$2 = t => new n$2("string" == typeof t ? t : t + "", void 0, s),
89
+ S = (s, o) => {
90
+ if (e$3) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
91
+ const o = document.createElement("style"),
92
+ n = t.litNonce;
93
+ void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
94
+ }
95
+ },
96
+ c$1 = e$3 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
97
+ let e = "";
98
+ for (const s of t.cssRules) e += s.cssText;
99
+ return r$2(e);
100
+ })(t) : t;
58
101
 
59
102
  /**
60
103
  * @license
61
104
  * Copyright 2017 Google LLC
62
105
  * SPDX-License-Identifier: BSD-3-Clause
63
- */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");
106
+ */
107
+ const {
108
+ is: i,
109
+ defineProperty: e$2,
110
+ getOwnPropertyDescriptor: h,
111
+ getOwnPropertyNames: r$1,
112
+ getOwnPropertySymbols: o$1,
113
+ getPrototypeOf: n$1
114
+ } = Object,
115
+ a = globalThis,
116
+ c = a.trustedTypes,
117
+ l = c ? c.emptyScript : "",
118
+ p = a.reactiveElementPolyfillSupport,
119
+ d = (t, s) => t,
120
+ u = {
121
+ toAttribute(t, s) {
122
+ switch (s) {
123
+ case Boolean:
124
+ t = t ? l : null;
125
+ break;
126
+ case Object:
127
+ case Array:
128
+ t = null == t ? t : JSON.stringify(t);
129
+ }
130
+ return t;
131
+ },
132
+ fromAttribute(t, s) {
133
+ let i = t;
134
+ switch (s) {
135
+ case Boolean:
136
+ i = null !== t;
137
+ break;
138
+ case Number:
139
+ i = null === t ? null : Number(t);
140
+ break;
141
+ case Object:
142
+ case Array:
143
+ try {
144
+ i = JSON.parse(t);
145
+ } catch (t) {
146
+ i = null;
147
+ }
148
+ }
149
+ return i;
150
+ }
151
+ },
152
+ f = (t, s) => !i(t, s),
153
+ b = {
154
+ attribute: true,
155
+ type: String,
156
+ converter: u,
157
+ reflect: false,
158
+ useDefault: false,
159
+ hasChanged: f
160
+ };
161
+ Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap();
162
+ class y extends HTMLElement {
163
+ static addInitializer(t) {
164
+ this._$Ei(), (this.l ??= []).push(t);
165
+ }
166
+ static get observedAttributes() {
167
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
168
+ }
169
+ static createProperty(t, s = b) {
170
+ 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) {
171
+ const i = Symbol(),
172
+ h = this.getPropertyDescriptor(t, i, s);
173
+ void 0 !== h && e$2(this.prototype, t, h);
174
+ }
175
+ }
176
+ static getPropertyDescriptor(t, s, i) {
177
+ const {
178
+ get: e,
179
+ set: r
180
+ } = h(this.prototype, t) ?? {
181
+ get() {
182
+ return this[s];
183
+ },
184
+ set(t) {
185
+ this[s] = t;
186
+ }
187
+ };
188
+ return {
189
+ get: e,
190
+ set(s) {
191
+ const h = e?.call(this);
192
+ r?.call(this, s), this.requestUpdate(t, h, i);
193
+ },
194
+ configurable: true,
195
+ enumerable: true
196
+ };
197
+ }
198
+ static getPropertyOptions(t) {
199
+ return this.elementProperties.get(t) ?? b;
200
+ }
201
+ static _$Ei() {
202
+ if (this.hasOwnProperty(d("elementProperties"))) return;
203
+ const t = n$1(this);
204
+ t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
205
+ }
206
+ static finalize() {
207
+ if (this.hasOwnProperty(d("finalized"))) return;
208
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
209
+ const t = this.properties,
210
+ s = [...r$1(t), ...o$1(t)];
211
+ for (const i of s) this.createProperty(i, t[i]);
212
+ }
213
+ const t = this[Symbol.metadata];
214
+ if (null !== t) {
215
+ const s = litPropertyMetadata.get(t);
216
+ if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
217
+ }
218
+ this._$Eh = new Map();
219
+ for (const [t, s] of this.elementProperties) {
220
+ const i = this._$Eu(t, s);
221
+ void 0 !== i && this._$Eh.set(i, t);
222
+ }
223
+ this.elementStyles = this.finalizeStyles(this.styles);
224
+ }
225
+ static finalizeStyles(s) {
226
+ const i = [];
227
+ if (Array.isArray(s)) {
228
+ const e = new Set(s.flat(1 / 0).reverse());
229
+ for (const s of e) i.unshift(c$1(s));
230
+ } else void 0 !== s && i.push(c$1(s));
231
+ return i;
232
+ }
233
+ static _$Eu(t, s) {
234
+ const i = s.attribute;
235
+ return false === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
236
+ }
237
+ constructor() {
238
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
239
+ }
240
+ _$Ev() {
241
+ this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
242
+ }
243
+ addController(t) {
244
+ (this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
245
+ }
246
+ removeController(t) {
247
+ this._$EO?.delete(t);
248
+ }
249
+ _$E_() {
250
+ const t = new Map(),
251
+ s = this.constructor.elementProperties;
252
+ for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
253
+ t.size > 0 && (this._$Ep = t);
254
+ }
255
+ createRenderRoot() {
256
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
257
+ return S(t, this.constructor.elementStyles), t;
258
+ }
259
+ connectedCallback() {
260
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
261
+ }
262
+ enableUpdating(t) {}
263
+ disconnectedCallback() {
264
+ this._$EO?.forEach(t => t.hostDisconnected?.());
265
+ }
266
+ attributeChangedCallback(t, s, i) {
267
+ this._$AK(t, i);
268
+ }
269
+ _$ET(t, s) {
270
+ const i = this.constructor.elementProperties.get(t),
271
+ e = this.constructor._$Eu(t, i);
272
+ if (void 0 !== e && true === i.reflect) {
273
+ const h = (void 0 !== i.converter?.toAttribute ? i.converter : u).toAttribute(s, i.type);
274
+ this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
275
+ }
276
+ }
277
+ _$AK(t, s) {
278
+ const i = this.constructor,
279
+ e = i._$Eh.get(t);
280
+ if (void 0 !== e && this._$Em !== e) {
281
+ const t = i.getPropertyOptions(e),
282
+ h = "function" == typeof t.converter ? {
283
+ fromAttribute: t.converter
284
+ } : void 0 !== t.converter?.fromAttribute ? t.converter : u;
285
+ this._$Em = e;
286
+ const r = h.fromAttribute(s, t.type);
287
+ this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
288
+ }
289
+ }
290
+ requestUpdate(t, s, i) {
291
+ if (void 0 !== t) {
292
+ const e = this.constructor,
293
+ h = this[t];
294
+ 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;
295
+ this.C(t, s, i);
296
+ }
297
+ false === this.isUpdatePending && (this._$ES = this._$EP());
298
+ }
299
+ C(t, s, {
300
+ useDefault: i,
301
+ reflect: e,
302
+ wrapped: h
303
+ }, r) {
304
+ 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));
305
+ }
306
+ async _$EP() {
307
+ this.isUpdatePending = true;
308
+ try {
309
+ await this._$ES;
310
+ } catch (t) {
311
+ Promise.reject(t);
312
+ }
313
+ const t = this.scheduleUpdate();
314
+ return null != t && (await t), !this.isUpdatePending;
315
+ }
316
+ scheduleUpdate() {
317
+ return this.performUpdate();
318
+ }
319
+ performUpdate() {
320
+ if (!this.isUpdatePending) return;
321
+ if (!this.hasUpdated) {
322
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
323
+ for (const [t, s] of this._$Ep) this[t] = s;
324
+ this._$Ep = void 0;
325
+ }
326
+ const t = this.constructor.elementProperties;
327
+ if (t.size > 0) for (const [s, i] of t) {
328
+ const {
329
+ wrapped: t
330
+ } = i,
331
+ e = this[s];
332
+ true !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
333
+ }
334
+ }
335
+ let t = false;
336
+ const s = this._$AL;
337
+ try {
338
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
339
+ } catch (s) {
340
+ throw t = false, this._$EM(), s;
341
+ }
342
+ t && this._$AE(s);
343
+ }
344
+ willUpdate(t) {}
345
+ _$AE(t) {
346
+ this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
347
+ }
348
+ _$EM() {
349
+ this._$AL = new Map(), this.isUpdatePending = false;
350
+ }
351
+ get updateComplete() {
352
+ return this.getUpdateComplete();
353
+ }
354
+ getUpdateComplete() {
355
+ return this._$ES;
356
+ }
357
+ shouldUpdate(t) {
358
+ return true;
359
+ }
360
+ update(t) {
361
+ this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
362
+ }
363
+ updated(t) {}
364
+ firstUpdated(t) {}
365
+ }
366
+ y.elementStyles = [], y.shadowRootOptions = {
367
+ mode: "open"
368
+ }, y[d("elementProperties")] = new Map(), y[d("finalized")] = new Map(), p?.({
369
+ ReactiveElement: y
370
+ }), (a.reactiveElementVersions ??= []).push("2.1.1");
64
371
 
65
372
  /**
66
373
  * @license
67
374
  * Copyright 2017 Google LLC
68
375
  * SPDX-License-Identifier: BSD-3-Clause
69
- */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)}
376
+ */
377
+ const o = {
378
+ attribute: true,
379
+ type: String,
380
+ converter: u,
381
+ reflect: false,
382
+ hasChanged: f
383
+ },
384
+ r = (t = o, e, r) => {
385
+ const {
386
+ kind: n,
387
+ metadata: i
388
+ } = r;
389
+ let s = globalThis.litPropertyMetadata.get(i);
390
+ 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) {
391
+ const {
392
+ name: o
393
+ } = r;
394
+ return {
395
+ set(r) {
396
+ const n = e.get.call(this);
397
+ e.set.call(this, r), this.requestUpdate(o, n, t);
398
+ },
399
+ init(e) {
400
+ return void 0 !== e && this.C(o, void 0, t, e), e;
401
+ }
402
+ };
403
+ }
404
+ if ("setter" === n) {
405
+ const {
406
+ name: o
407
+ } = r;
408
+ return function (r) {
409
+ const n = this[o];
410
+ e.call(this, r), this.requestUpdate(o, n, t);
411
+ };
412
+ }
413
+ throw Error("Unsupported decorator location: " + n);
414
+ };
415
+ function n(t) {
416
+ return (e, o) => "object" == typeof o ? r(t, e, o) : ((t, e, o) => {
417
+ const r = e.hasOwnProperty(o);
418
+ return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
419
+ })(t, e, o);
420
+ }
70
421
 
71
422
  /**
72
423
  * @license
73
424
  * Copyright 2017 Google LLC
74
425
  * SPDX-License-Identifier: BSD-3-Clause
75
426
  */
76
- const e$1=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
427
+ const e$1 = (e, t, c) => (c.configurable = true, c.enumerable = true, Reflect.decorate && "object" != typeof t && Object.defineProperty(e, t, c), c);
77
428
 
78
429
  /**
79
430
  * @license
80
431
  * Copyright 2017 Google LLC
81
432
  * SPDX-License-Identifier: BSD-3-Clause
82
- */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)}})}}
433
+ */
434
+ function e(e, r) {
435
+ return (n, s, i) => {
436
+ const o = t => t.renderRoot?.querySelector(e) ?? null;
437
+ return e$1(n, s, {
438
+ get() {
439
+ return o(this);
440
+ }
441
+ });
442
+ };
443
+ }
83
444
 
84
445
  var _M3eRadioElement_instances, _M3eRadioElement_clickHandler, _M3eRadioElement_hoverController, _M3eRadioElement_pressedController, _M3eRadioElement_renderIcon, _M3eRadioElement_handleClick, _M3eRadioElement_notifySelectionChange;
85
446
  /**
@@ -136,223 +497,118 @@ var _M3eRadioElement_instances, _M3eRadioElement_clickHandler, _M3eRadioElement_
136
497
  * @cssprop --m3e-radio-error-icon-color - Fallback icon color used when the radio is invalid and touched.
137
498
  */
138
499
  let M3eRadioElement = class M3eRadioElement extends Labelled(Dirty(Touched(Checked(KeyboardClick(Focusable(FormAssociated(Disabled(AttachInternals(Role(LitElement, "radio"), true))))))))) {
139
- constructor() {
140
- super(...arguments);
141
- _M3eRadioElement_instances.add(this);
142
- /** @private */ _M3eRadioElement_clickHandler.set(this, (e) => __classPrivateFieldGet(this, _M3eRadioElement_instances, "m", _M3eRadioElement_handleClick).call(this, e));
143
- /** @private */ _M3eRadioElement_hoverController.set(this, new HoverController(this, {
144
- target: null,
145
- callback: (hovering) => {
146
- if (this.disabled)
147
- return;
148
- if (hovering) {
149
- this._stateLayer?.show("hover");
150
- }
151
- else {
152
- this._stateLayer?.hide("hover");
153
- }
154
- },
155
- }));
156
- /** @private */ _M3eRadioElement_pressedController.set(this, new PressedController(this, {
157
- target: null,
158
- minPressedDuration: 150,
159
- callback: (pressed) => {
160
- if (this.disabled)
161
- return;
162
- if (pressed) {
163
- this._ripple?.show(0, 0, true);
164
- }
165
- else {
166
- this._ripple?.hide();
167
- }
168
- },
169
- }));
170
- /**
171
- * A string representing the value of the radio.
172
- * @default "on"
173
- */
174
- this.value = "on";
175
- }
176
- /** @inheritdoc @internal */
177
- get [(_M3eRadioElement_clickHandler = new WeakMap(), _M3eRadioElement_hoverController = new WeakMap(), _M3eRadioElement_pressedController = new WeakMap(), _M3eRadioElement_instances = new WeakSet(), formValue)]() {
178
- return this.checked ? this.value : null;
179
- }
180
- /** @inheritdoc */
181
- connectedCallback() {
182
- super.connectedCallback();
183
- this.addEventListener("click", __classPrivateFieldGet(this, _M3eRadioElement_clickHandler, "f"));
184
- for (const label of this.labels) {
185
- __classPrivateFieldGet(this, _M3eRadioElement_hoverController, "f").observe(label);
186
- __classPrivateFieldGet(this, _M3eRadioElement_pressedController, "f").observe(label);
500
+ constructor() {
501
+ super(...arguments);
502
+ _M3eRadioElement_instances.add(this);
503
+ /** @private */
504
+ _M3eRadioElement_clickHandler.set(this, e => __classPrivateFieldGet(this, _M3eRadioElement_instances, "m", _M3eRadioElement_handleClick).call(this, e));
505
+ /** @private */
506
+ _M3eRadioElement_hoverController.set(this, new HoverController(this, {
507
+ target: null,
508
+ callback: hovering => {
509
+ if (this.disabled) return;
510
+ if (hovering) {
511
+ this._stateLayer?.show("hover");
512
+ } else {
513
+ this._stateLayer?.hide("hover");
187
514
  }
188
- }
189
- /** @inheritdoc */
190
- disconnectedCallback() {
191
- super.disconnectedCallback();
192
- this.removeEventListener("click", __classPrivateFieldGet(this, _M3eRadioElement_clickHandler, "f"));
193
- for (const label of this.labels) {
194
- __classPrivateFieldGet(this, _M3eRadioElement_hoverController, "f").unobserve(label);
195
- __classPrivateFieldGet(this, _M3eRadioElement_pressedController, "f").unobserve(label);
196
- }
197
- }
198
- /** @inheritdoc */
199
- update(changedProperties) {
200
- super.update(changedProperties);
201
- if (changedProperties.has("checked")) {
202
- __classPrivateFieldGet(this, _M3eRadioElement_instances, "m", _M3eRadioElement_notifySelectionChange).call(this);
515
+ }
516
+ }));
517
+ /** @private */
518
+ _M3eRadioElement_pressedController.set(this, new PressedController(this, {
519
+ target: null,
520
+ minPressedDuration: 150,
521
+ callback: pressed => {
522
+ if (this.disabled) return;
523
+ if (pressed) {
524
+ this._ripple?.show(0, 0, true);
525
+ } else {
526
+ this._ripple?.hide();
203
527
  }
528
+ }
529
+ }));
530
+ /**
531
+ * A string representing the value of the radio.
532
+ * @default "on"
533
+ */
534
+ this.value = "on";
535
+ }
536
+ /** @inheritdoc @internal */
537
+ get [(_M3eRadioElement_clickHandler = new WeakMap(), _M3eRadioElement_hoverController = new WeakMap(), _M3eRadioElement_pressedController = new WeakMap(), _M3eRadioElement_instances = new WeakSet(), formValue)]() {
538
+ return this.checked ? this.value : null;
539
+ }
540
+ /** @inheritdoc */
541
+ connectedCallback() {
542
+ super.connectedCallback();
543
+ this.addEventListener("click", __classPrivateFieldGet(this, _M3eRadioElement_clickHandler, "f"));
544
+ for (const label of this.labels) {
545
+ __classPrivateFieldGet(this, _M3eRadioElement_hoverController, "f").observe(label);
546
+ __classPrivateFieldGet(this, _M3eRadioElement_pressedController, "f").observe(label);
204
547
  }
205
- /** @inheritdoc */
206
- firstUpdated(_changedProperties) {
207
- super.firstUpdated(_changedProperties);
208
- [this._focusRing, this._stateLayer, this._ripple].forEach((x) => x?.attach(this));
548
+ }
549
+ /** @inheritdoc */
550
+ disconnectedCallback() {
551
+ super.disconnectedCallback();
552
+ this.removeEventListener("click", __classPrivateFieldGet(this, _M3eRadioElement_clickHandler, "f"));
553
+ for (const label of this.labels) {
554
+ __classPrivateFieldGet(this, _M3eRadioElement_hoverController, "f").unobserve(label);
555
+ __classPrivateFieldGet(this, _M3eRadioElement_pressedController, "f").unobserve(label);
209
556
  }
210
- /** @inheritdoc */
211
- render() {
212
- return html `<div class="base">
213
- <m3e-state-layer class="state-layer" ?disabled="${this.disabled}"></m3e-state-layer>
214
- <m3e-focus-ring class="focus-ring" ?disabled="${this.disabled}"></m3e-focus-ring>
215
- <m3e-ripple class="ripple" centered ?disabled="${this.disabled}"></m3e-ripple>
216
- <div class="touch" aria-hidden="true"></div>
217
- <div class="wrapper" aria-hidden="true">${__classPrivateFieldGet(this, _M3eRadioElement_instances, "m", _M3eRadioElement_renderIcon).call(this)}</div>
218
- </div>`;
557
+ }
558
+ /** @inheritdoc */
559
+ update(changedProperties) {
560
+ super.update(changedProperties);
561
+ if (changedProperties.has("checked")) {
562
+ __classPrivateFieldGet(this, _M3eRadioElement_instances, "m", _M3eRadioElement_notifySelectionChange).call(this);
219
563
  }
564
+ }
565
+ /** @inheritdoc */
566
+ firstUpdated(_changedProperties) {
567
+ super.firstUpdated(_changedProperties);
568
+ [this._focusRing, this._stateLayer, this._ripple].forEach(x => x?.attach(this));
569
+ }
570
+ /** @inheritdoc */
571
+ render() {
572
+ return html`<div class="base"><m3e-state-layer class="state-layer" ?disabled="${this.disabled}"></m3e-state-layer><m3e-focus-ring class="focus-ring" ?disabled="${this.disabled}"></m3e-focus-ring><m3e-ripple class="ripple" centered ?disabled="${this.disabled}"></m3e-ripple><div class="touch" aria-hidden="true"></div><div class="wrapper" aria-hidden="true">${__classPrivateFieldGet(this, _M3eRadioElement_instances, "m", _M3eRadioElement_renderIcon).call(this)}</div></div>`;
573
+ }
220
574
  };
221
575
  _M3eRadioElement_renderIcon = function _M3eRadioElement_renderIcon() {
222
- return html `<svg viewBox="0 0 20 20">
223
- <mask id="cutout2">
224
- <rect width="100%" height="100%" fill="white"></rect>
225
- <circle cx="10" cy="10" r="8" fill="black"></circle>
226
- </mask>
227
- <circle class="outer circle" cx="10" cy="10" r="10" mask="url(#cutout2)"></circle>
228
- <circle class="inner circle" cx="10" cy="10" r="5"></circle>
229
- </svg>`;
576
+ return html`<svg viewBox="0 0 20 20"><mask id="cutout2"><rect width="100%" height="100%" fill="white"></rect><circle cx="10" cy="10" r="8" fill="black"></circle></mask><circle class="outer circle" cx="10" cy="10" r="10" mask="url(#cutout2)"></circle><circle class="inner circle" cx="10" cy="10" r="5"></circle></svg>`;
230
577
  };
231
578
  _M3eRadioElement_handleClick = function _M3eRadioElement_handleClick(e) {
232
- if (e.defaultPrevented || this.checked || this.disabled)
233
- return;
234
- this.checked = true;
235
- if (this.dispatchEvent(new Event("input", { bubbles: true, composed: true, cancelable: true }))) {
236
- __classPrivateFieldGet(this, _M3eRadioElement_instances, "m", _M3eRadioElement_notifySelectionChange).call(this);
237
- this.dispatchEvent(new Event("change", { bubbles: true }));
238
- }
239
- else {
240
- this.checked = false;
241
- }
579
+ if (e.defaultPrevented || this.checked || this.disabled) return;
580
+ this.checked = true;
581
+ if (this.dispatchEvent(new Event("input", {
582
+ bubbles: true,
583
+ composed: true,
584
+ cancelable: true
585
+ }))) {
586
+ __classPrivateFieldGet(this, _M3eRadioElement_instances, "m", _M3eRadioElement_notifySelectionChange).call(this);
587
+ this.dispatchEvent(new Event("change", {
588
+ bubbles: true
589
+ }));
590
+ } else {
591
+ this.checked = false;
592
+ }
242
593
  };
243
594
  _M3eRadioElement_notifySelectionChange = function _M3eRadioElement_notifySelectionChange() {
244
- const group = this.closest("m3e-radio-group");
245
- if (group) {
246
- group[selectionManager].notifySelectionChange(this);
247
- }
248
- else if (this.name && this.checked) {
249
- // Uncheck any sibling radios of the same name which are also checked.
250
- [
251
- ...(this.getRootNode()?.querySelectorAll(`m3e-radio[name="${this.name}"]`) ??
252
- []),
253
- ]
254
- .filter((x) => x !== this && x.checked)
255
- .forEach((x) => (x.checked = false));
256
- }
595
+ const group = this.closest("m3e-radio-group");
596
+ if (group) {
597
+ group[selectionManager].notifySelectionChange(this);
598
+ } else if (this.name && this.checked) {
599
+ // Uncheck any sibling radios of the same name which are also checked.
600
+ [...(this.getRootNode()?.querySelectorAll(`m3e-radio[name="${this.name}"]`) ?? [])].filter(x => x !== this && x.checked).forEach(x => x.checked = false);
601
+ }
257
602
  };
258
603
  /** The styles of the element. */
259
- M3eRadioElement.styles = css `
260
- :host {
261
- display: inline-block;
262
- outline: none;
263
- width: fit-content;
264
- height: fit-content;
265
- vertical-align: middle;
266
- user-select: none;
267
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
268
- }
269
- :host(:not([aria-disabled="true"])) {
270
- cursor: pointer;
271
- }
272
- .base {
273
- box-sizing: border-box;
274
- vertical-align: middle;
275
- display: inline-flex;
276
- align-items: center;
277
- justify-content: center;
278
- position: relative;
279
- border-radius: 50%;
280
- width: calc(var(--m3e-radio-container-size, 2.5rem) + ${DesignToken.density.calc(-3)});
281
- height: calc(var(--m3e-radio-container-size, 2.5rem) + ${DesignToken.density.calc(-3)});
282
- }
283
- .touch {
284
- position: absolute;
285
- height: 3rem;
286
- width: 3rem;
287
- margin: auto;
288
- }
289
- .wrapper {
290
- box-sizing: border-box;
291
- pointer-events: none;
292
- width: var(--m3e-radio-icon-size, 1.25rem);
293
- height: var(--m3e-radio-icon-size, 1.25rem);
294
- }
295
- .circle {
296
- fill: currentColor;
297
- }
298
- :host(:not([checked])) .circle.inner {
299
- opacity: 0;
300
- }
301
- :host(:not([checked])) .base {
302
- --m3e-state-layer-hover-color: var(--m3e-radio-unselected-hover-color, ${DesignToken.color.onSurface});
303
- --m3e-state-layer-focus-color: var(--m3e-radio-unselected-focus-color, ${DesignToken.color.onSurface});
304
- --m3e-ripple-color: var(--m3e-radio-unselected-ripple-color, ${DesignToken.color.onSurface});
305
- color: var(--m3e-radio-unselected-icon-color, ${DesignToken.color.onSurfaceVariant});
306
- }
307
- :host([checked]) .base {
308
- --m3e-state-layer-hover-color: var(--m3e-radio-selected-hover-color, ${DesignToken.color.primary});
309
- --m3e-state-layer-focus-color: var(--m3e-radio-selected-focus-color, ${DesignToken.color.primary});
310
- --m3e-ripple-color: var(--m3e-radio-selected-ripple-color, ${DesignToken.color.primary});
311
- color: var(--m3e-radio-selected-icon-color, ${DesignToken.color.primary});
312
- }
313
- :host([aria-disabled="true"]) .base {
314
- color: color-mix(in srgb, var(--m3e-radio-disabled-icon-color, ${DesignToken.color.onSurface}) 38%, transparent);
315
- }
316
- :host(.-touched.-invalid) .base {
317
- --m3e-state-layer-hover-color: var(--m3e-radio-error-hover-color, ${DesignToken.color.error});
318
- --m3e-state-layer-focus-color: var(--m3e-radio-error-focus-color, ${DesignToken.color.error});
319
- --m3e-ripple-color: var(--m3e-radio-error-ripple-color, ${DesignToken.color.error});
320
- color: var(--m3e-radio-error-icon-color, ${DesignToken.color.error});
321
- }
322
- @media (forced-colors: active) {
323
- :host(:not([checked])) .base,
324
- :host([checked]) .base {
325
- --m3e-state-layer-hover-color: var(--_radio-forced-color, CanvasText);
326
- --m3e-state-layer-focus-color: var(--_radio-forced-color, CanvasText);
327
- --m3e-ripple-color: var(--_radio-forced-color, CanvasText);
328
- color: var(--_radio-forced-color, CanvasText);
329
- }
330
- :host([aria-disabled="true"]) .base {
331
- color: GrayText;
332
- }
333
- :host(.-touched.-invalid) .base {
334
- --_radio-forced-color: Highlight;
335
- color: Highlight;
336
- }
337
- }
338
- `;
339
- __decorate([
340
- e(".focus-ring")
341
- ], M3eRadioElement.prototype, "_focusRing", void 0);
342
- __decorate([
343
- e(".state-layer")
344
- ], M3eRadioElement.prototype, "_stateLayer", void 0);
345
- __decorate([
346
- e(".ripple")
347
- ], M3eRadioElement.prototype, "_ripple", void 0);
348
- __decorate([
349
- n()
350
- ], M3eRadioElement.prototype, "value", void 0);
351
- M3eRadioElement = __decorate([
352
- t$1("m3e-radio")
353
- ], M3eRadioElement);
604
+ M3eRadioElement.styles = css`:host { display: inline-block; outline: none; width: fit-content; height: fit-content; vertical-align: middle; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } :host(:not([aria-disabled="true"])) { cursor: pointer; } .base { box-sizing: border-box; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; position: relative; border-radius: 50%; width: calc(var(--m3e-radio-container-size, 2.5rem) + ${DesignToken.density.calc(-3)}); height: calc(var(--m3e-radio-container-size, 2.5rem) + ${DesignToken.density.calc(-3)}); } .touch { position: absolute; height: 3rem; width: 3rem; margin: auto; } .wrapper { box-sizing: border-box; pointer-events: none; width: var(--m3e-radio-icon-size, 1.25rem); height: var(--m3e-radio-icon-size, 1.25rem); } .circle { fill: currentColor; } :host(:not([checked])) .circle.inner { opacity: 0; } :host(:not([checked])) .base { --m3e-state-layer-hover-color: var(--m3e-radio-unselected-hover-color, ${DesignToken.color.onSurface}); --m3e-state-layer-focus-color: var(--m3e-radio-unselected-focus-color, ${DesignToken.color.onSurface}); --m3e-ripple-color: var(--m3e-radio-unselected-ripple-color, ${DesignToken.color.onSurface}); color: var(--m3e-radio-unselected-icon-color, ${DesignToken.color.onSurfaceVariant}); } :host([checked]) .base { --m3e-state-layer-hover-color: var(--m3e-radio-selected-hover-color, ${DesignToken.color.primary}); --m3e-state-layer-focus-color: var(--m3e-radio-selected-focus-color, ${DesignToken.color.primary}); --m3e-ripple-color: var(--m3e-radio-selected-ripple-color, ${DesignToken.color.primary}); color: var(--m3e-radio-selected-icon-color, ${DesignToken.color.primary}); } :host([aria-disabled="true"]) .base { color: color-mix(in srgb, var(--m3e-radio-disabled-icon-color, ${DesignToken.color.onSurface}) 38%, transparent); } :host(.-touched.-invalid) .base { --m3e-state-layer-hover-color: var(--m3e-radio-error-hover-color, ${DesignToken.color.error}); --m3e-state-layer-focus-color: var(--m3e-radio-error-focus-color, ${DesignToken.color.error}); --m3e-ripple-color: var(--m3e-radio-error-ripple-color, ${DesignToken.color.error}); color: var(--m3e-radio-error-icon-color, ${DesignToken.color.error}); } @media (forced-colors: active) { :host(:not([checked])) .base, :host([checked]) .base { --m3e-state-layer-hover-color: var(--_radio-forced-color, CanvasText); --m3e-state-layer-focus-color: var(--_radio-forced-color, CanvasText); --m3e-ripple-color: var(--_radio-forced-color, CanvasText); color: var(--_radio-forced-color, CanvasText); } :host([aria-disabled="true"]) .base { color: GrayText; } :host(.-touched.-invalid) .base { --_radio-forced-color: Highlight; color: Highlight; } }`;
605
+ __decorate([e(".focus-ring")], M3eRadioElement.prototype, "_focusRing", void 0);
606
+ __decorate([e(".state-layer")], M3eRadioElement.prototype, "_stateLayer", void 0);
607
+ __decorate([e(".ripple")], M3eRadioElement.prototype, "_ripple", void 0);
608
+ __decorate([n()], M3eRadioElement.prototype, "value", void 0);
609
+ M3eRadioElement = __decorate([t$1("m3e-radio")], M3eRadioElement);
354
610
 
355
- var _M3eRadioGroupElement_instances, _M3eRadioGroupElement_focusOutHandler, _M3eRadioGroupElement_handleSlotChange, _M3eRadioGroupElement_handleKeyDown, _M3eRadioGroupElement_handleChange, _a;
611
+ var _M3eRadioGroupElement_instances, _M3eRadioGroupElement_directionalitySubscription, _M3eRadioGroupElement_focusOutHandler, _M3eRadioGroupElement_handleSlotChange, _M3eRadioGroupElement_handleKeyDown, _M3eRadioGroupElement_handleChange, _a;
356
612
  /**
357
613
  * A container for a set of radio buttons.
358
614
  *
@@ -387,117 +643,115 @@ var _M3eRadioGroupElement_instances, _M3eRadioGroupElement_focusOutHandler, _M3e
387
643
  * @fires change - Emitted when the checked state of a radio button changes.
388
644
  */
389
645
  let M3eRadioGroupElement = class M3eRadioGroupElement extends Labelled(RequiredConstraintValidation(Dirty(Touched(Required(ConstraintValidation(FormAssociated(Disabled(AttachInternals(Role(LitElement, "radiogroup")))))))))) {
390
- constructor() {
391
- super(...arguments);
392
- _M3eRadioGroupElement_instances.add(this);
393
- /** @private */ _M3eRadioGroupElement_focusOutHandler.set(this, () => __classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleChange).call(this));
394
- /** @internal */
395
- this[_a] = new SelectionManager().withWrap().onActiveItemChange(() => {
396
- this[selectionManager].activeItem?.click();
646
+ constructor() {
647
+ super(...arguments);
648
+ _M3eRadioGroupElement_instances.add(this);
649
+ /** @private */
650
+ _M3eRadioGroupElement_directionalitySubscription.set(this, void 0);
651
+ /** @private */
652
+ _M3eRadioGroupElement_focusOutHandler.set(this, () => __classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleChange).call(this));
653
+ /** @internal */
654
+ this[_a] = new SelectionManager().withWrap().withDirectionality(M3eDirectionality.current).onActiveItemChange(() => {
655
+ this[selectionManager].activeItem?.click();
656
+ });
657
+ }
658
+ /** The list of attributes corresponding to the registered properties. */
659
+ static get observedAttributes() {
660
+ return [...super.observedAttributes, "aria-invalid"];
661
+ }
662
+ /** The radios in the group. */
663
+ get radios() {
664
+ return this[selectionManager]?.items ?? [];
665
+ }
666
+ /** The selected radio. */
667
+ get selected() {
668
+ return this[selectionManager]?.selectedItems[0] ?? null;
669
+ }
670
+ /** The selected value of the radio group. */
671
+ get value() {
672
+ return this.selected?.value ?? null;
673
+ }
674
+ /** @inheritdoc */
675
+ markAsTouched() {
676
+ super.markAsTouched();
677
+ this.radios.forEach(x => x.markAsTouched());
678
+ }
679
+ /** @inheritdoc */
680
+ markAsUntouched() {
681
+ super.markAsUntouched();
682
+ this.radios.forEach(x => x.markAsUntouched());
683
+ }
684
+ /** @inheritdoc */
685
+ markAsDirty() {
686
+ super.markAsDirty();
687
+ this.radios.forEach(x => x.markAsDirty());
688
+ }
689
+ /** @inheritdoc */
690
+ markAsPristine() {
691
+ super.markAsPristine();
692
+ this.radios.forEach(x => x.markAsPristine());
693
+ }
694
+ /** Synchronizes property values when attributes change. */
695
+ attributeChangedCallback(name, oldValue, newValue) {
696
+ super.attributeChangedCallback(name, oldValue, newValue);
697
+ switch (name) {
698
+ case "name":
699
+ this.radios.forEach(x => x.name = this.name);
700
+ break;
701
+ case "aria-invalid":
702
+ this.radios.forEach(x => {
703
+ x.classList.toggle("-invalid", newValue === "true");
704
+ x[updateLabels]?.();
397
705
  });
706
+ break;
398
707
  }
399
- /** The list of attributes corresponding to the registered properties. */
400
- static get observedAttributes() {
401
- return [...super.observedAttributes, "aria-invalid"];
402
- }
403
- /** The radios in the group. */
404
- get radios() {
405
- return this[selectionManager]?.items ?? [];
406
- }
407
- /** The selected radio. */
408
- get selected() {
409
- return this[selectionManager]?.selectedItems[0] ?? null;
410
- }
411
- /** The selected value of the radio group. */
412
- get value() {
413
- return this.selected?.value ?? null;
414
- }
415
- /** @inheritdoc */
416
- markAsTouched() {
417
- super.markAsTouched();
418
- this.radios.forEach((x) => x.markAsTouched());
419
- }
420
- /** @inheritdoc */
421
- markAsUntouched() {
422
- super.markAsUntouched();
423
- this.radios.forEach((x) => x.markAsUntouched());
424
- }
425
- /** @inheritdoc */
426
- markAsDirty() {
427
- super.markAsDirty();
428
- this.radios.forEach((x) => x.markAsDirty());
429
- }
430
- /** @inheritdoc */
431
- markAsPristine() {
432
- super.markAsPristine();
433
- this.radios.forEach((x) => x.markAsPristine());
434
- }
435
- /** Synchronizes property values when attributes change. */
436
- attributeChangedCallback(name, oldValue, newValue) {
437
- super.attributeChangedCallback(name, oldValue, newValue);
438
- switch (name) {
439
- case "name":
440
- this.radios.forEach((x) => (x.name = this.name));
441
- break;
442
- case "aria-invalid":
443
- this.radios.forEach((x) => {
444
- x.classList.toggle("-invalid", newValue === "true");
445
- x[updateLabels]?.();
446
- });
447
- break;
448
- }
449
- }
450
- /** @inheritdoc */
451
- connectedCallback() {
452
- super.connectedCallback();
453
- this.addEventListener("focusout", __classPrivateFieldGet(this, _M3eRadioGroupElement_focusOutHandler, "f"));
454
- }
455
- /** @inheritdoc */
456
- disconnectedCallback() {
457
- super.disconnectedCallback();
458
- this.removeEventListener("focusout", __classPrivateFieldGet(this, _M3eRadioGroupElement_focusOutHandler, "f"));
459
- }
460
- /** @inheritdoc */
461
- update(changedProperties) {
462
- super.update(changedProperties);
463
- if (changedProperties.has("disabled")) {
464
- this.ariaDisabled = null;
465
- }
466
- if (changedProperties.has("disabled") && (changedProperties.get("disabled") !== undefined || this.disabled)) {
467
- this[selectionManager].disabled = this.disabled;
468
- }
708
+ }
709
+ /** @inheritdoc */
710
+ connectedCallback() {
711
+ super.connectedCallback();
712
+ this.addEventListener("focusout", __classPrivateFieldGet(this, _M3eRadioGroupElement_focusOutHandler, "f"));
713
+ __classPrivateFieldSet(this, _M3eRadioGroupElement_directionalitySubscription, M3eDirectionality.observe(() => this[selectionManager].directionality = M3eDirectionality.current), "f");
714
+ }
715
+ /** @inheritdoc */
716
+ disconnectedCallback() {
717
+ super.disconnectedCallback();
718
+ this.removeEventListener("focusout", __classPrivateFieldGet(this, _M3eRadioGroupElement_focusOutHandler, "f"));
719
+ __classPrivateFieldGet(this, _M3eRadioGroupElement_directionalitySubscription, "f")?.call(this);
720
+ }
721
+ /** @inheritdoc */
722
+ update(changedProperties) {
723
+ super.update(changedProperties);
724
+ if (changedProperties.has("disabled")) {
725
+ this.ariaDisabled = null;
469
726
  }
470
- /** @inheritdoc */
471
- render() {
472
- return html `<slot
473
- @slotchange="${__classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleSlotChange)}"
474
- @keydown="${__classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleKeyDown)}"
475
- @change="${__classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleChange)}"
476
- ></slot>`;
727
+ if (changedProperties.has("disabled") && (changedProperties.get("disabled") !== undefined || this.disabled)) {
728
+ this[selectionManager].disabled = this.disabled;
477
729
  }
730
+ }
731
+ /** @inheritdoc */
732
+ render() {
733
+ return html`<slot @slotchange="${__classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleSlotChange)}" @keydown="${__classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleKeyDown)}" @change="${__classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleChange)}"></slot>`;
734
+ }
478
735
  };
736
+ _M3eRadioGroupElement_directionalitySubscription = new WeakMap();
479
737
  _M3eRadioGroupElement_focusOutHandler = new WeakMap();
480
738
  _M3eRadioGroupElement_instances = new WeakSet();
481
739
  _a = selectionManager;
482
740
  _M3eRadioGroupElement_handleSlotChange = function _M3eRadioGroupElement_handleSlotChange() {
483
- const { added } = this[selectionManager].setItems([...this.querySelectorAll("m3e-radio")]);
484
- added.forEach((x) => (x.name = x.name || this.name));
741
+ const {
742
+ added
743
+ } = this[selectionManager].setItems([...this.querySelectorAll("m3e-radio")]);
744
+ added.forEach(x => x.name = x.name || this.name);
485
745
  };
486
746
  _M3eRadioGroupElement_handleKeyDown = function _M3eRadioGroupElement_handleKeyDown(e) {
487
- this[selectionManager].onKeyDown(e);
747
+ this[selectionManager].onKeyDown(e);
488
748
  };
489
749
  _M3eRadioGroupElement_handleChange = function _M3eRadioGroupElement_handleChange() {
490
- this.checkValidity();
750
+ this.checkValidity();
491
751
  };
492
752
  /** The styles of the element. */
493
- M3eRadioGroupElement.styles = css `
494
- :host {
495
- display: inline;
496
- }
497
- `;
498
- M3eRadioGroupElement = __decorate([
499
- t$1("m3e-radio-group")
500
- ], M3eRadioGroupElement);
753
+ M3eRadioGroupElement.styles = css`:host { display: inline-flex; }`;
754
+ M3eRadioGroupElement = __decorate([t$1("m3e-radio-group")], M3eRadioGroupElement);
501
755
 
502
756
  export { M3eRadioElement, M3eRadioGroupElement };
503
757
  //# sourceMappingURL=index.js.map