@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/README.md +2 -1
- package/dist/index.js +577 -299
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +7 -84
- package/dist/index.min.js.map +1 -1
- package/dist/src/TooltipElement.d.ts.map +1 -1
- package/package.json +2 -16
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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)=>
|
|
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
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
*
|
|
191
|
-
* @default
|
|
530
|
+
* Whether the element is disabled.
|
|
531
|
+
* @default false
|
|
192
532
|
*/
|
|
193
|
-
|
|
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
|
|
201
|
-
* @default
|
|
535
|
+
* The position of the tooltip.
|
|
536
|
+
* @default "below"
|
|
202
537
|
*/
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
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
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
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
|