@m3e/tooltip 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
@@ -7,6 +7,7 @@ import { LitElement, html, unsafeCSS, css } from 'lit';
7
7
  import { M3eAriaDescriber } from '@m3e/core/a11y';
8
8
  import { M3ePlatform } from '@m3e/core/platform';
9
9
  import { positionAnchor } from '@m3e/core/anchoring';
10
+ import { M3eDirectionality } from '@m3e/core/bidi';
10
11
  import { HtmlFor, AttachInternals, HoverController, LongPressController, isDisabledMixin, DesignToken } from '@m3e/core';
11
12
 
12
13
  /******************************************************************************
@@ -22,33 +23,30 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22
23
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
23
24
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
24
25
  PERFORMANCE OF THIS SOFTWARE.
25
- ***************************************************************************** */
26
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
27
-
28
-
29
- function __decorate(decorators, target, key, desc) {
30
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
31
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
32
- 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;
33
- return c > 3 && r && Object.defineProperty(target, key, r), r;
34
- }
35
-
36
- function __classPrivateFieldGet(receiver, state, kind, f) {
37
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
38
- 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");
39
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
40
- }
41
-
42
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
43
- if (kind === "m") throw new TypeError("Private method is not writable");
44
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
45
- 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");
46
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
47
- }
48
-
49
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
50
- var e = new Error(message);
51
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
26
+ ***************************************************************************** */
27
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
28
+
29
+ function __decorate(decorators, target, key, desc) {
30
+ var c = arguments.length,
31
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
32
+ d;
33
+ 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;
34
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
35
+ }
36
+ function __classPrivateFieldGet(receiver, state, kind, f) {
37
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
38
+ 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");
39
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
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
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
48
+ var e = new Error(message);
49
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
52
50
  };
53
51
 
54
52
  /**
@@ -56,39 +54,395 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
56
54
  * Copyright 2017 Google LLC
57
55
  * SPDX-License-Identifier: BSD-3-Clause
58
56
  */
59
- const t$1=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
57
+ const t$1 = t => (e, o) => {
58
+ void 0 !== o ? o.addInitializer(() => {
59
+ customElements.define(t, e);
60
+ }) : customElements.define(t, e);
61
+ };
60
62
 
61
63
  /**
62
64
  * @license
63
65
  * Copyright 2019 Google LLC
64
66
  * SPDX-License-Identifier: BSD-3-Clause
65
67
  */
66
- 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;
68
+ const t = globalThis,
69
+ e$3 = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
70
+ s = Symbol(),
71
+ o$2 = new WeakMap();
72
+ let n$2 = class n {
73
+ constructor(t, e, o) {
74
+ if (this._$cssResult$ = true, o !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
75
+ this.cssText = t, this.t = e;
76
+ }
77
+ get styleSheet() {
78
+ let t = this.o;
79
+ const s = this.t;
80
+ if (e$3 && void 0 === t) {
81
+ const e = void 0 !== s && 1 === s.length;
82
+ e && (t = o$2.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$2.set(s, t));
83
+ }
84
+ return t;
85
+ }
86
+ toString() {
87
+ return this.cssText;
88
+ }
89
+ };
90
+ const r$2 = t => new n$2("string" == typeof t ? t : t + "", void 0, s),
91
+ S = (s, o) => {
92
+ if (e$3) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
93
+ const o = document.createElement("style"),
94
+ n = t.litNonce;
95
+ void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
96
+ }
97
+ },
98
+ c$1 = e$3 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
99
+ let e = "";
100
+ for (const s of t.cssRules) e += s.cssText;
101
+ return r$2(e);
102
+ })(t) : t;
67
103
 
68
104
  /**
69
105
  * @license
70
106
  * Copyright 2017 Google LLC
71
107
  * SPDX-License-Identifier: BSD-3-Clause
72
- */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");
108
+ */
109
+ const {
110
+ is: i,
111
+ defineProperty: e$2,
112
+ getOwnPropertyDescriptor: h,
113
+ getOwnPropertyNames: r$1,
114
+ getOwnPropertySymbols: o$1,
115
+ getPrototypeOf: n$1
116
+ } = Object,
117
+ a = globalThis,
118
+ c = a.trustedTypes,
119
+ l = c ? c.emptyScript : "",
120
+ p = a.reactiveElementPolyfillSupport,
121
+ d = (t, s) => t,
122
+ u = {
123
+ toAttribute(t, s) {
124
+ switch (s) {
125
+ case Boolean:
126
+ t = t ? l : null;
127
+ break;
128
+ case Object:
129
+ case Array:
130
+ t = null == t ? t : JSON.stringify(t);
131
+ }
132
+ return t;
133
+ },
134
+ fromAttribute(t, s) {
135
+ let i = t;
136
+ switch (s) {
137
+ case Boolean:
138
+ i = null !== t;
139
+ break;
140
+ case Number:
141
+ i = null === t ? null : Number(t);
142
+ break;
143
+ case Object:
144
+ case Array:
145
+ try {
146
+ i = JSON.parse(t);
147
+ } catch (t) {
148
+ i = null;
149
+ }
150
+ }
151
+ return i;
152
+ }
153
+ },
154
+ f = (t, s) => !i(t, s),
155
+ b = {
156
+ attribute: true,
157
+ type: String,
158
+ converter: u,
159
+ reflect: false,
160
+ useDefault: false,
161
+ hasChanged: f
162
+ };
163
+ Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap();
164
+ class y extends HTMLElement {
165
+ static addInitializer(t) {
166
+ this._$Ei(), (this.l ??= []).push(t);
167
+ }
168
+ static get observedAttributes() {
169
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
170
+ }
171
+ static createProperty(t, s = b) {
172
+ 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) {
173
+ const i = Symbol(),
174
+ h = this.getPropertyDescriptor(t, i, s);
175
+ void 0 !== h && e$2(this.prototype, t, h);
176
+ }
177
+ }
178
+ static getPropertyDescriptor(t, s, i) {
179
+ const {
180
+ get: e,
181
+ set: r
182
+ } = h(this.prototype, t) ?? {
183
+ get() {
184
+ return this[s];
185
+ },
186
+ set(t) {
187
+ this[s] = t;
188
+ }
189
+ };
190
+ return {
191
+ get: e,
192
+ set(s) {
193
+ const h = e?.call(this);
194
+ r?.call(this, s), this.requestUpdate(t, h, i);
195
+ },
196
+ configurable: true,
197
+ enumerable: true
198
+ };
199
+ }
200
+ static getPropertyOptions(t) {
201
+ return this.elementProperties.get(t) ?? b;
202
+ }
203
+ static _$Ei() {
204
+ if (this.hasOwnProperty(d("elementProperties"))) return;
205
+ const t = n$1(this);
206
+ t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
207
+ }
208
+ static finalize() {
209
+ if (this.hasOwnProperty(d("finalized"))) return;
210
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
211
+ const t = this.properties,
212
+ s = [...r$1(t), ...o$1(t)];
213
+ for (const i of s) this.createProperty(i, t[i]);
214
+ }
215
+ const t = this[Symbol.metadata];
216
+ if (null !== t) {
217
+ const s = litPropertyMetadata.get(t);
218
+ if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
219
+ }
220
+ this._$Eh = new Map();
221
+ for (const [t, s] of this.elementProperties) {
222
+ const i = this._$Eu(t, s);
223
+ void 0 !== i && this._$Eh.set(i, t);
224
+ }
225
+ this.elementStyles = this.finalizeStyles(this.styles);
226
+ }
227
+ static finalizeStyles(s) {
228
+ const i = [];
229
+ if (Array.isArray(s)) {
230
+ const e = new Set(s.flat(1 / 0).reverse());
231
+ for (const s of e) i.unshift(c$1(s));
232
+ } else void 0 !== s && i.push(c$1(s));
233
+ return i;
234
+ }
235
+ static _$Eu(t, s) {
236
+ const i = s.attribute;
237
+ return false === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
238
+ }
239
+ constructor() {
240
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
241
+ }
242
+ _$Ev() {
243
+ this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
244
+ }
245
+ addController(t) {
246
+ (this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
247
+ }
248
+ removeController(t) {
249
+ this._$EO?.delete(t);
250
+ }
251
+ _$E_() {
252
+ const t = new Map(),
253
+ s = this.constructor.elementProperties;
254
+ for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
255
+ t.size > 0 && (this._$Ep = t);
256
+ }
257
+ createRenderRoot() {
258
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
259
+ return S(t, this.constructor.elementStyles), t;
260
+ }
261
+ connectedCallback() {
262
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
263
+ }
264
+ enableUpdating(t) {}
265
+ disconnectedCallback() {
266
+ this._$EO?.forEach(t => t.hostDisconnected?.());
267
+ }
268
+ attributeChangedCallback(t, s, i) {
269
+ this._$AK(t, i);
270
+ }
271
+ _$ET(t, s) {
272
+ const i = this.constructor.elementProperties.get(t),
273
+ e = this.constructor._$Eu(t, i);
274
+ if (void 0 !== e && true === i.reflect) {
275
+ const h = (void 0 !== i.converter?.toAttribute ? i.converter : u).toAttribute(s, i.type);
276
+ this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
277
+ }
278
+ }
279
+ _$AK(t, s) {
280
+ const i = this.constructor,
281
+ e = i._$Eh.get(t);
282
+ if (void 0 !== e && this._$Em !== e) {
283
+ const t = i.getPropertyOptions(e),
284
+ h = "function" == typeof t.converter ? {
285
+ fromAttribute: t.converter
286
+ } : void 0 !== t.converter?.fromAttribute ? t.converter : u;
287
+ this._$Em = e;
288
+ const r = h.fromAttribute(s, t.type);
289
+ this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
290
+ }
291
+ }
292
+ requestUpdate(t, s, i) {
293
+ if (void 0 !== t) {
294
+ const e = this.constructor,
295
+ h = this[t];
296
+ 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;
297
+ this.C(t, s, i);
298
+ }
299
+ false === this.isUpdatePending && (this._$ES = this._$EP());
300
+ }
301
+ C(t, s, {
302
+ useDefault: i,
303
+ reflect: e,
304
+ wrapped: h
305
+ }, r) {
306
+ 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));
307
+ }
308
+ async _$EP() {
309
+ this.isUpdatePending = true;
310
+ try {
311
+ await this._$ES;
312
+ } catch (t) {
313
+ Promise.reject(t);
314
+ }
315
+ const t = this.scheduleUpdate();
316
+ return null != t && (await t), !this.isUpdatePending;
317
+ }
318
+ scheduleUpdate() {
319
+ return this.performUpdate();
320
+ }
321
+ performUpdate() {
322
+ if (!this.isUpdatePending) return;
323
+ if (!this.hasUpdated) {
324
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
325
+ for (const [t, s] of this._$Ep) this[t] = s;
326
+ this._$Ep = void 0;
327
+ }
328
+ const t = this.constructor.elementProperties;
329
+ if (t.size > 0) for (const [s, i] of t) {
330
+ const {
331
+ wrapped: t
332
+ } = i,
333
+ e = this[s];
334
+ true !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
335
+ }
336
+ }
337
+ let t = false;
338
+ const s = this._$AL;
339
+ try {
340
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
341
+ } catch (s) {
342
+ throw t = false, this._$EM(), s;
343
+ }
344
+ t && this._$AE(s);
345
+ }
346
+ willUpdate(t) {}
347
+ _$AE(t) {
348
+ this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
349
+ }
350
+ _$EM() {
351
+ this._$AL = new Map(), this.isUpdatePending = false;
352
+ }
353
+ get updateComplete() {
354
+ return this.getUpdateComplete();
355
+ }
356
+ getUpdateComplete() {
357
+ return this._$ES;
358
+ }
359
+ shouldUpdate(t) {
360
+ return true;
361
+ }
362
+ update(t) {
363
+ this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
364
+ }
365
+ updated(t) {}
366
+ firstUpdated(t) {}
367
+ }
368
+ y.elementStyles = [], y.shadowRootOptions = {
369
+ mode: "open"
370
+ }, y[d("elementProperties")] = new Map(), y[d("finalized")] = new Map(), p?.({
371
+ ReactiveElement: y
372
+ }), (a.reactiveElementVersions ??= []).push("2.1.1");
73
373
 
74
374
  /**
75
375
  * @license
76
376
  * Copyright 2017 Google LLC
77
377
  * SPDX-License-Identifier: BSD-3-Clause
78
- */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)}
378
+ */
379
+ const o = {
380
+ attribute: true,
381
+ type: String,
382
+ converter: u,
383
+ reflect: false,
384
+ hasChanged: f
385
+ },
386
+ r = (t = o, e, r) => {
387
+ const {
388
+ kind: n,
389
+ metadata: i
390
+ } = r;
391
+ let s = globalThis.litPropertyMetadata.get(i);
392
+ 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) {
393
+ const {
394
+ name: o
395
+ } = r;
396
+ return {
397
+ set(r) {
398
+ const n = e.get.call(this);
399
+ e.set.call(this, r), this.requestUpdate(o, n, t);
400
+ },
401
+ init(e) {
402
+ return void 0 !== e && this.C(o, void 0, t, e), e;
403
+ }
404
+ };
405
+ }
406
+ if ("setter" === n) {
407
+ const {
408
+ name: o
409
+ } = r;
410
+ return function (r) {
411
+ const n = this[o];
412
+ e.call(this, r), this.requestUpdate(o, n, t);
413
+ };
414
+ }
415
+ throw Error("Unsupported decorator location: " + n);
416
+ };
417
+ function n(t) {
418
+ return (e, o) => "object" == typeof o ? r(t, e, o) : ((t, e, o) => {
419
+ const r = e.hasOwnProperty(o);
420
+ return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
421
+ })(t, e, o);
422
+ }
79
423
 
80
424
  /**
81
425
  * @license
82
426
  * Copyright 2017 Google LLC
83
427
  * SPDX-License-Identifier: BSD-3-Clause
84
428
  */
85
- const e$1=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
429
+ const e$1 = (e, t, c) => (c.configurable = true, c.enumerable = true, Reflect.decorate && "object" != typeof t && Object.defineProperty(e, t, c), c);
86
430
 
87
431
  /**
88
432
  * @license
89
433
  * Copyright 2017 Google LLC
90
434
  * SPDX-License-Identifier: BSD-3-Clause
91
- */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)}})}}
435
+ */
436
+ function e(e, r) {
437
+ return (n, s, i) => {
438
+ const o = t => t.renderRoot?.querySelector(e) ?? null;
439
+ return e$1(n, s, {
440
+ get() {
441
+ return o(this);
442
+ }
443
+ });
444
+ };
445
+ }
92
446
 
93
447
  var _M3eTooltipElement_instances, _M3eTooltipElement_message, _M3eTooltipElement_for, _M3eTooltipElement_anchorCleanup, _M3eTooltipElement_clickHandler, _M3eTooltipElement_hoverController, _M3eTooltipElement_longPressController, _M3eTooltipElement_handleSlotChange, _M3eTooltipElement_handleToggle, _M3eTooltipElement_disableNativeGesturesIfNecessary;
94
448
  var M3eTooltipElement_1;
@@ -138,153 +492,154 @@ const TOOLTIP_HIDE_DELAY = 200;
138
492
  * @cssprop --m3e-tooltip-supporting-text-tracking - Letter spacing of supporting text.
139
493
  */
140
494
  let M3eTooltipElement = M3eTooltipElement_1 = class M3eTooltipElement extends HtmlFor(AttachInternals(LitElement)) {
141
- constructor() {
142
- super(...arguments);
143
- _M3eTooltipElement_instances.add(this);
144
- /** @private */ _M3eTooltipElement_message.set(this, void 0);
145
- /** @private */ _M3eTooltipElement_for.set(this, null);
146
- /** @private */ _M3eTooltipElement_anchorCleanup.set(this, void 0);
147
- /** @private */ _M3eTooltipElement_clickHandler.set(this, () => this.hide());
148
- /** @private */
149
- _M3eTooltipElement_hoverController.set(this, new HoverController(this, {
150
- target: null,
151
- endDelay: TOOLTIP_HIDE_DELAY,
152
- callback: (hovering) => {
153
- if (hovering) {
154
- this.show();
155
- }
156
- else {
157
- this.hide();
158
- }
159
- },
160
- }));
161
- /** @private */
162
- _M3eTooltipElement_longPressController.set(this, new LongPressController(this, {
163
- target: null,
164
- callback: (pressed) => {
165
- if (pressed) {
166
- this.show();
167
- }
168
- else {
169
- this.hide();
170
- }
171
- },
172
- }));
173
- /**
174
- * Whether the element is disabled.
175
- * @default false
176
- */
177
- this.disabled = false;
178
- /**
179
- * The position of the tooltip.
180
- * @default "below"
181
- */
182
- this.position = "below";
183
- /**
184
- * The mode in which to handle touch gestures.
185
- * @default "auto"
186
- */
187
- this.touchGestures = "auto";
188
- }
495
+ constructor() {
496
+ super(...arguments);
497
+ _M3eTooltipElement_instances.add(this);
498
+ /** @private */
499
+ _M3eTooltipElement_message.set(this, void 0);
500
+ /** @private */
501
+ _M3eTooltipElement_for.set(this, null);
502
+ /** @private */
503
+ _M3eTooltipElement_anchorCleanup.set(this, void 0);
504
+ /** @private */
505
+ _M3eTooltipElement_clickHandler.set(this, () => this.hide());
506
+ /** @private */
507
+ _M3eTooltipElement_hoverController.set(this, new HoverController(this, {
508
+ target: null,
509
+ endDelay: TOOLTIP_HIDE_DELAY,
510
+ callback: hovering => {
511
+ if (hovering) {
512
+ this.show();
513
+ } else {
514
+ this.hide();
515
+ }
516
+ }
517
+ }));
518
+ /** @private */
519
+ _M3eTooltipElement_longPressController.set(this, new LongPressController(this, {
520
+ target: null,
521
+ callback: pressed => {
522
+ if (pressed) {
523
+ this.show();
524
+ } else {
525
+ this.hide();
526
+ }
527
+ }
528
+ }));
189
529
  /**
190
- * The amount of time, in milliseconds, before showing the tooltip.
191
- * @default 0
530
+ * Whether the element is disabled.
531
+ * @default false
192
532
  */
193
- get showDelay() {
194
- return __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").startDelay;
195
- }
196
- set showDelay(value) {
197
- __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").startDelay = value;
198
- }
533
+ this.disabled = false;
199
534
  /**
200
- * The amount of time, in milliseconds, before hiding the tooltip.
201
- * @default 200
535
+ * The position of the tooltip.
536
+ * @default "below"
202
537
  */
203
- get hideDelay() {
204
- return __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").endDelay;
205
- }
206
- set hideDelay(value) {
207
- __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").endDelay = value;
208
- }
209
- /** @inheritdoc */
210
- attach(control) {
211
- super.attach(control);
212
- if (__classPrivateFieldGet(this, _M3eTooltipElement_message, "f")) {
213
- M3eAriaDescriber.describe(control, __classPrivateFieldGet(this, _M3eTooltipElement_message, "f"));
214
- }
215
- if (M3ePlatform.iOS || M3ePlatform.Android) {
216
- __classPrivateFieldGet(this, _M3eTooltipElement_longPressController, "f").observe(control);
217
- __classPrivateFieldGet(this, _M3eTooltipElement_instances, "m", _M3eTooltipElement_disableNativeGesturesIfNecessary).call(this);
218
- }
219
- else {
220
- __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").observe(control);
221
- }
222
- control.addEventListener("click", __classPrivateFieldGet(this, _M3eTooltipElement_clickHandler, "f"));
223
- }
224
- /** @inheritdoc */
225
- detach() {
226
- if (this.control) {
227
- if (__classPrivateFieldGet(this, _M3eTooltipElement_message, "f")) {
228
- M3eAriaDescriber.removeDescription(this.control, __classPrivateFieldGet(this, _M3eTooltipElement_message, "f"));
229
- }
230
- __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").unobserve(this.control);
231
- __classPrivateFieldGet(this, _M3eTooltipElement_longPressController, "f").observe(this.control);
232
- this.control.removeEventListener("click", __classPrivateFieldGet(this, _M3eTooltipElement_clickHandler, "f"));
233
- this.hide();
234
- }
235
- super.detach();
236
- }
237
- /** @inheritdoc */
238
- connectedCallback() {
239
- super.connectedCallback();
240
- this.ariaHidden = "true";
538
+ this.position = "below";
539
+ /**
540
+ * The mode in which to handle touch gestures.
541
+ * @default "auto"
542
+ */
543
+ this.touchGestures = "auto";
544
+ }
545
+ /**
546
+ * The amount of time, in milliseconds, before showing the tooltip.
547
+ * @default 0
548
+ */
549
+ get showDelay() {
550
+ return __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").startDelay;
551
+ }
552
+ set showDelay(value) {
553
+ __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").startDelay = value;
554
+ }
555
+ /**
556
+ * The amount of time, in milliseconds, before hiding the tooltip.
557
+ * @default 200
558
+ */
559
+ get hideDelay() {
560
+ return __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").endDelay;
561
+ }
562
+ set hideDelay(value) {
563
+ __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").endDelay = value;
564
+ }
565
+ /** @inheritdoc */
566
+ attach(control) {
567
+ super.attach(control);
568
+ if (__classPrivateFieldGet(this, _M3eTooltipElement_message, "f")) {
569
+ M3eAriaDescriber.describe(control, __classPrivateFieldGet(this, _M3eTooltipElement_message, "f"));
241
570
  }
242
- /** @inheritdoc */
243
- update(changedProperties) {
244
- super.update(changedProperties);
245
- if (changedProperties.has("disabled") && this.disabled) {
246
- this.hide();
247
- }
571
+ if (M3ePlatform.iOS || M3ePlatform.Android) {
572
+ __classPrivateFieldGet(this, _M3eTooltipElement_longPressController, "f").observe(control);
573
+ __classPrivateFieldGet(this, _M3eTooltipElement_instances, "m", _M3eTooltipElement_disableNativeGesturesIfNecessary).call(this);
574
+ } else {
575
+ __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").observe(control);
248
576
  }
249
- /** @inheritdoc */
250
- render() {
251
- return html `<div class="base" popover="manual" @toggle="${__classPrivateFieldGet(this, _M3eTooltipElement_instances, "m", _M3eTooltipElement_handleToggle)}">
252
- <slot @slotchange="${__classPrivateFieldGet(this, _M3eTooltipElement_instances, "m", _M3eTooltipElement_handleSlotChange)}"></slot>
253
- </div>`;
577
+ control.addEventListener("click", __classPrivateFieldGet(this, _M3eTooltipElement_clickHandler, "f"));
578
+ }
579
+ /** @inheritdoc */
580
+ detach() {
581
+ if (this.control) {
582
+ if (__classPrivateFieldGet(this, _M3eTooltipElement_message, "f")) {
583
+ M3eAriaDescriber.removeDescription(this.control, __classPrivateFieldGet(this, _M3eTooltipElement_message, "f"));
584
+ }
585
+ __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").unobserve(this.control);
586
+ __classPrivateFieldGet(this, _M3eTooltipElement_longPressController, "f").observe(this.control);
587
+ this.control.removeEventListener("click", __classPrivateFieldGet(this, _M3eTooltipElement_clickHandler, "f"));
588
+ this.hide();
254
589
  }
255
- /**
256
- * Manually shows the tooltip.
257
- * @returns {Promise<void>} A `Promise` that resolves when the tooltip is shown.
258
- */
259
- async show() {
260
- if (!this.control || this.disabled || (isDisabledMixin(this.control) && this.control.disabled))
261
- return;
262
- M3eTooltipElement_1.__openTooltips.filter((x) => x !== this).forEach((x) => x.hide());
263
- this._base.showPopover();
264
- __classPrivateFieldSet(this, _M3eTooltipElement_anchorCleanup, await positionAnchor(this._base, this.control, {
265
- position: this.position === "above"
266
- ? "top"
267
- : this.position === "below"
268
- ? "bottom"
269
- : this.position === "before"
270
- ? "left"
271
- : "right",
272
- inline: true,
273
- flip: true,
274
- shift: true,
275
- offset: TOOLTIP_OFFSET,
276
- }), "f");
277
- if (!M3eTooltipElement_1.__openTooltips.includes(this)) {
278
- M3eTooltipElement_1.__openTooltips.push(this);
279
- }
590
+ super.detach();
591
+ }
592
+ /** @inheritdoc */
593
+ connectedCallback() {
594
+ super.connectedCallback();
595
+ this.ariaHidden = "true";
596
+ }
597
+ /** @inheritdoc */
598
+ update(changedProperties) {
599
+ super.update(changedProperties);
600
+ if (changedProperties.has("disabled") && this.disabled) {
601
+ this.hide();
280
602
  }
281
- /** Manually hides the tooltip. */
282
- hide() {
283
- this._base.hidePopover();
284
- __classPrivateFieldGet(this, _M3eTooltipElement_anchorCleanup, "f")?.call(this);
285
- __classPrivateFieldSet(this, _M3eTooltipElement_anchorCleanup, undefined, "f");
286
- __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").clearDelays();
603
+ }
604
+ /** @inheritdoc */
605
+ render() {
606
+ return html`<div class="base" popover="manual" @toggle="${__classPrivateFieldGet(this, _M3eTooltipElement_instances, "m", _M3eTooltipElement_handleToggle)}"><slot @slotchange="${__classPrivateFieldGet(this, _M3eTooltipElement_instances, "m", _M3eTooltipElement_handleSlotChange)}"></slot></div>`;
607
+ }
608
+ /**
609
+ * Manually shows the tooltip.
610
+ * @returns {Promise<void>} A `Promise` that resolves when the tooltip is shown.
611
+ */
612
+ async show() {
613
+ if (!this.control || this.disabled || isDisabledMixin(this.control) && this.control.disabled) return;
614
+ M3eTooltipElement_1.__openTooltips.filter(x => x !== this).forEach(x => x.hide());
615
+ this._base.showPopover();
616
+ __classPrivateFieldSet(this, _M3eTooltipElement_anchorCleanup, await positionAnchor(this._base, this.control, {
617
+ position: this.position === "above" ? "top" : this.position === "below" ? "bottom" : this.position === "before" ? M3eDirectionality.current === "ltr" ? "left" : "right" : M3eDirectionality.current === "ltr" ? "right" : "left",
618
+ inline: true,
619
+ flip: true,
620
+ shift: true,
621
+ offset: TOOLTIP_OFFSET
622
+ }, (x, y) => {
623
+ if (M3eDirectionality.current === "rtl") {
624
+ this._base.style.right = `${window.innerWidth - x - this._base.clientWidth}px`;
625
+ this._base.style.left = "";
626
+ } else {
627
+ this._base.style.left = `${x}px`;
628
+ this._base.style.right = "";
629
+ }
630
+ this._base.style.top = `${y}px`;
631
+ }), "f");
632
+ if (!M3eTooltipElement_1.__openTooltips.includes(this)) {
633
+ M3eTooltipElement_1.__openTooltips.push(this);
287
634
  }
635
+ }
636
+ /** Manually hides the tooltip. */
637
+ hide() {
638
+ this._base.hidePopover();
639
+ __classPrivateFieldGet(this, _M3eTooltipElement_anchorCleanup, "f")?.call(this);
640
+ __classPrivateFieldSet(this, _M3eTooltipElement_anchorCleanup, undefined, "f");
641
+ __classPrivateFieldGet(this, _M3eTooltipElement_hoverController, "f").clearDelays();
642
+ }
288
643
  };
289
644
  _M3eTooltipElement_message = new WeakMap();
290
645
  _M3eTooltipElement_for = new WeakMap();
@@ -294,142 +649,65 @@ _M3eTooltipElement_hoverController = new WeakMap();
294
649
  _M3eTooltipElement_longPressController = new WeakMap();
295
650
  _M3eTooltipElement_instances = new WeakSet();
296
651
  _M3eTooltipElement_handleSlotChange = function _M3eTooltipElement_handleSlotChange() {
297
- if (this.isConnected && this.control) {
298
- if (__classPrivateFieldGet(this, _M3eTooltipElement_message, "f")) {
299
- M3eAriaDescriber.removeDescription(this.control, __classPrivateFieldGet(this, _M3eTooltipElement_message, "f"));
300
- }
301
- __classPrivateFieldSet(this, _M3eTooltipElement_message, this.textContent, "f");
302
- if (__classPrivateFieldGet(this, _M3eTooltipElement_message, "f")) {
303
- M3eAriaDescriber.describe(this.control, __classPrivateFieldGet(this, _M3eTooltipElement_message, "f"));
304
- }
652
+ if (this.isConnected && this.control) {
653
+ if (__classPrivateFieldGet(this, _M3eTooltipElement_message, "f")) {
654
+ M3eAriaDescriber.removeDescription(this.control, __classPrivateFieldGet(this, _M3eTooltipElement_message, "f"));
655
+ }
656
+ __classPrivateFieldSet(this, _M3eTooltipElement_message, this.textContent, "f");
657
+ if (__classPrivateFieldGet(this, _M3eTooltipElement_message, "f")) {
658
+ M3eAriaDescriber.describe(this.control, __classPrivateFieldGet(this, _M3eTooltipElement_message, "f"));
305
659
  }
660
+ }
306
661
  };
307
662
  _M3eTooltipElement_handleToggle = function _M3eTooltipElement_handleToggle(e) {
308
- if (e.newState === "open") {
309
- const multiline = this._base.getBoundingClientRect().height > parseFloat(getComputedStyle(this._base).minHeight);
310
- this.classList.toggle("-multiline", multiline);
311
- }
663
+ if (e.newState === "open") {
664
+ const multiline = this._base.getBoundingClientRect().height > parseFloat(getComputedStyle(this._base).minHeight);
665
+ this.classList.toggle("-multiline", multiline);
666
+ }
312
667
  };
313
668
  _M3eTooltipElement_disableNativeGesturesIfNecessary = function _M3eTooltipElement_disableNativeGesturesIfNecessary() {
314
- if (this.touchGestures !== "off" && __classPrivateFieldGet(this, _M3eTooltipElement_for, "f")) {
315
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
316
- const style = __classPrivateFieldGet(this, _M3eTooltipElement_for, "f").style;
317
- // If gestures are set to `auto`, we don't disable text selection on inputs and
318
- // textareas, because it prevents the user from typing into them on iOS Safari.
319
- if (this.touchGestures === "on" || (__classPrivateFieldGet(this, _M3eTooltipElement_for, "f").nodeName !== "INPUT" && __classPrivateFieldGet(this, _M3eTooltipElement_for, "f").nodeName !== "TEXTAREA")) {
320
- style.userSelect = style.msUserSelect = style.webkitUserSelect = style.MozUserSelect = "none";
321
- }
322
- // If we have `auto` gestures and the element uses native HTML dragging,
323
- // we don't set `-webkit-user-drag` because it prevents the native behavior.
324
- if (this.touchGestures === "on" || !__classPrivateFieldGet(this, _M3eTooltipElement_for, "f").draggable) {
325
- style.webkitUserDrag = "none";
326
- }
327
- style.touchAction = "none";
328
- style.webkitTapHighlightColor = "transparent";
669
+ if (this.touchGestures !== "off" && __classPrivateFieldGet(this, _M3eTooltipElement_for, "f")) {
670
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
671
+ const style = __classPrivateFieldGet(this, _M3eTooltipElement_for, "f").style;
672
+ // If gestures are set to `auto`, we don't disable text selection on inputs and
673
+ // textareas, because it prevents the user from typing into them on iOS Safari.
674
+ if (this.touchGestures === "on" || __classPrivateFieldGet(this, _M3eTooltipElement_for, "f").nodeName !== "INPUT" && __classPrivateFieldGet(this, _M3eTooltipElement_for, "f").nodeName !== "TEXTAREA") {
675
+ style.userSelect = style.msUserSelect = style.webkitUserSelect = style.MozUserSelect = "none";
676
+ }
677
+ // If we have `auto` gestures and the element uses native HTML dragging,
678
+ // we don't set `-webkit-user-drag` because it prevents the native behavior.
679
+ if (this.touchGestures === "on" || !__classPrivateFieldGet(this, _M3eTooltipElement_for, "f").draggable) {
680
+ style.webkitUserDrag = "none";
329
681
  }
682
+ style.touchAction = "none";
683
+ style.webkitTapHighlightColor = "transparent";
684
+ }
330
685
  };
331
686
  /** The styles of the element. */
332
- M3eTooltipElement.styles = css `
333
- :host {
334
- display: contents;
335
- }
336
- .base {
337
- position: absolute;
338
- pointer-events: none;
339
- margin: unset;
340
- border: unset;
341
- word-break: normal;
342
- overflow-wrap: anywhere;
343
- padding: var(--m3e-tooltip-padding, 0.25rem 0.5rem);
344
- min-width: var(--m3e-tooltip-min-width, 2.5rem);
345
- max-width: var(--m3e-tooltip-max-width, 12.5rem);
346
- min-height: var(--m3e-tooltip-min-height, 1.5rem);
347
- max-height: var(--m3e-tooltip-max-height, 40vh);
348
- box-sizing: border-box;
349
- overflow: hidden;
350
- text-align: center;
351
- border-radius: var(--m3e-tooltip-shape, ${DesignToken.shape.corner.extraSmall});
352
- background-color: var(--m3e-tooltip-container-color, ${DesignToken.color.inverseSurface});
353
- color: var(--m3e-tooltip-supporting-text-color, ${DesignToken.color.inverseOnSurface});
354
- font-size: var(--m3e-tooltip-supporting-text-font-size, ${DesignToken.typescale.standard.body.small.fontSize});
355
- font-weight: var(
356
- --m3e-tooltip-supporting-text-font-weight,
357
- ${DesignToken.typescale.standard.body.small.fontWeight}
358
- );
359
- line-height: var(
360
- --m3e-tooltip-supporting-text-line-height,
361
- ${DesignToken.typescale.standard.body.small.lineHeight}
362
- );
363
- letter-spacing: var(
364
- --m3e-tooltip-supporting-text-tracking,
365
- ${DesignToken.typescale.standard.body.small.tracking}
366
- );
367
- visibility: hidden;
368
- opacity: 0;
369
- transform: scale(0.8);
370
- transition: ${unsafeCSS(`opacity ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard},
371
- transform ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard},
372
- overlay ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard} allow-discrete,
373
- visibility ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard} allow-discrete`)};
374
- }
375
- :host(.-multiline) .base {
376
- text-align: start;
377
- }
378
- .base::backdrop {
379
- background-color: transparent;
380
- }
381
- .base:not(:popover-open) {
382
- visibility: hidden;
383
- opacity: 0;
384
- transform: scale(0.8);
385
- }
386
- .base:popover-open {
387
- visibility: visible;
388
- opacity: 1;
389
- transform: scale(1);
390
- }
391
- @starting-style {
392
- .base:popover-open {
393
- opacity: 0;
394
- transform: scale(0.8);
395
- }
396
- }
397
- @media (prefers-reduced-motion) {
398
- .base {
399
- transition: none;
400
- }
401
- }
402
- @media (forced-colors: active) {
403
- .base {
404
- background-color: Canvas;
405
- color: CanvasText;
406
- box-sizing: border-box;
407
- border: 1px solid CanvasText;
408
- }
409
- }
410
- `;
411
- /** @private */ M3eTooltipElement.__openTooltips = new Array();
412
- __decorate([
413
- e(".base")
414
- ], M3eTooltipElement.prototype, "_base", void 0);
415
- __decorate([
416
- n({ type: Boolean, reflect: true })
417
- ], M3eTooltipElement.prototype, "disabled", void 0);
418
- __decorate([
419
- n()
420
- ], M3eTooltipElement.prototype, "position", void 0);
421
- __decorate([
422
- n({ attribute: "show-delay", type: Number })
423
- ], M3eTooltipElement.prototype, "showDelay", null);
424
- __decorate([
425
- n({ attribute: "hide-delay", type: Number })
426
- ], M3eTooltipElement.prototype, "hideDelay", null);
427
- __decorate([
428
- n({ attribute: "touch-gestures" })
429
- ], M3eTooltipElement.prototype, "touchGestures", void 0);
430
- M3eTooltipElement = M3eTooltipElement_1 = __decorate([
431
- t$1("m3e-tooltip")
432
- ], M3eTooltipElement);
687
+ M3eTooltipElement.styles = css`:host { display: contents; } .base { position: absolute; pointer-events: none; margin: unset; border: unset; word-break: normal; overflow-wrap: anywhere; padding: var(--m3e-tooltip-padding, 0.25rem 0.5rem); min-width: var(--m3e-tooltip-min-width, 2.5rem); max-width: var(--m3e-tooltip-max-width, 12.5rem); min-height: var(--m3e-tooltip-min-height, 1.5rem); max-height: var(--m3e-tooltip-max-height, 40vh); box-sizing: border-box; overflow: hidden; text-align: center; border-radius: var(--m3e-tooltip-shape, ${DesignToken.shape.corner.extraSmall}); background-color: var(--m3e-tooltip-container-color, ${DesignToken.color.inverseSurface}); color: var(--m3e-tooltip-supporting-text-color, ${DesignToken.color.inverseOnSurface}); font-size: var(--m3e-tooltip-supporting-text-font-size, ${DesignToken.typescale.standard.body.small.fontSize}); font-weight: var( --m3e-tooltip-supporting-text-font-weight, ${DesignToken.typescale.standard.body.small.fontWeight} ); line-height: var( --m3e-tooltip-supporting-text-line-height, ${DesignToken.typescale.standard.body.small.lineHeight} ); letter-spacing: var( --m3e-tooltip-supporting-text-tracking, ${DesignToken.typescale.standard.body.small.tracking} ); visibility: hidden; opacity: 0; transform: scale(0.8); transition: ${unsafeCSS(`opacity ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard},
688
+ transform ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard},
689
+ overlay ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard} allow-discrete,
690
+ visibility ${DesignToken.motion.duration.short3} ${DesignToken.motion.easing.standard} allow-discrete`)}; } :host(.-multiline) .base { text-align: start; } .base::backdrop { background-color: transparent; } .base:not(:popover-open) { visibility: hidden; opacity: 0; transform: scale(0.8); } .base:popover-open { visibility: visible; opacity: 1; transform: scale(1); } @starting-style { .base:popover-open { opacity: 0; transform: scale(0.8); } } @media (prefers-reduced-motion) { .base { transition: none; } } @media (forced-colors: active) { .base { background-color: Canvas; color: CanvasText; box-sizing: border-box; border: 1px solid CanvasText; } }`;
691
+ /** @private */
692
+ M3eTooltipElement.__openTooltips = new Array();
693
+ __decorate([e(".base")], M3eTooltipElement.prototype, "_base", void 0);
694
+ __decorate([n({
695
+ type: Boolean,
696
+ reflect: true
697
+ })], M3eTooltipElement.prototype, "disabled", void 0);
698
+ __decorate([n()], M3eTooltipElement.prototype, "position", void 0);
699
+ __decorate([n({
700
+ attribute: "show-delay",
701
+ type: Number
702
+ })], M3eTooltipElement.prototype, "showDelay", null);
703
+ __decorate([n({
704
+ attribute: "hide-delay",
705
+ type: Number
706
+ })], M3eTooltipElement.prototype, "hideDelay", null);
707
+ __decorate([n({
708
+ attribute: "touch-gestures"
709
+ })], M3eTooltipElement.prototype, "touchGestures", void 0);
710
+ M3eTooltipElement = M3eTooltipElement_1 = __decorate([t$1("m3e-tooltip")], M3eTooltipElement);
433
711
 
434
712
  export { M3eTooltipElement };
435
713
  //# sourceMappingURL=index.js.map