@hortiview/default-components 1.5.0 → 1.5.2

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.
Files changed (43) hide show
  1. package/dist/components/DefaultAllowedComponent/DefaultAllowedComponent.js +8 -48
  2. package/dist/components/DefaultFormNumber/DefaultFormNumber.js +12 -1514
  3. package/dist/components/DefaultFormSelect/DefaultFormSelect.js +9 -178
  4. package/dist/components/DefaultLoadingSpinner/DefaultLoadingSpinner.js +6 -6
  5. package/dist/components/GenericTable/GenericTable.js +12 -18746
  6. package/dist/components/HealthChecks/DataBaseHealthCheck.js +2 -2
  7. package/dist/components/HealthChecks/DefaultHealthCheck.js +4 -4
  8. package/dist/components/HealthChecks/IotServiceHealthCheck.js +5 -5
  9. package/dist/components/HealthChecks/PlatformHealthCheck.js +4 -4
  10. package/dist/components/ImpatienceLoadingSpinner/ImpatienceLoadingSpinner.js +9 -9
  11. package/dist/components/InternationalizationWrapper/InternationalizationWrapper.js +4 -4
  12. package/dist/components/OfflineView/OfflineView.js +9 -9
  13. package/dist/i18n.js +1696 -5
  14. package/dist/{i18nInstance-D_96ADqd.js → i18nInstance-CYqpK5II.js} +2 -2
  15. package/dist/useTranslation-DGtUf8nl.js +101 -0
  16. package/package.json +3 -3
  17. package/dist/Iconify-D3gVmKx3.js +0 -84
  18. package/dist/InfoCard-Ba-VFnki.js +0 -58
  19. package/dist/LoadingSpinner-CmwCv7BO.js +0 -503
  20. package/dist/OfflineView-CIwV08EQ-BClnJRzV.js +0 -46
  21. package/dist/assets/DefaultAllowedComponent.css +0 -1
  22. package/dist/assets/DefaultFormNumber.css +0 -1
  23. package/dist/assets/DefaultFormSelect.css +0 -1
  24. package/dist/assets/GenericTable.css +0 -1
  25. package/dist/assets/Iconify.css +0 -1
  26. package/dist/assets/InfoCard.css +0 -1
  27. package/dist/assets/LoadingSpinner.css +0 -1
  28. package/dist/assets/OfflineView-CIwV08EQ.css +0 -1
  29. package/dist/component-Bz_dtX1r-DqCAj-DR.js +0 -304
  30. package/dist/component-DEJuY56h-CYiwt7Ga.js +0 -571
  31. package/dist/correct-is-regexp-logic-Y0ToWEjF-pByZFQLo.js +0 -494
  32. package/dist/i18n-CCQpJsQK.js +0 -1707
  33. package/dist/index.es--C-VLspF-B3Cy1zrT.js +0 -845
  34. package/dist/index.es-B74L_Dje-mYAvKwSb.js +0 -2005
  35. package/dist/index.es-B8p8KCdj--cmqwwUJ.js +0 -360
  36. package/dist/index.es-BPv5dCFQ-BmH1Hq7_.js +0 -1044
  37. package/dist/index.es-BanVdXEd-BYOBCuJj.js +0 -79
  38. package/dist/index.es-SjZ_-d7U-HvaOH_Z0.js +0 -860
  39. package/dist/index.es-nwjKmW7--CUlbl1RR.js +0 -14375
  40. package/dist/isTypedArray-DziahYkI-Cw9ssvDH.js +0 -210
  41. package/dist/slicedToArray-ByMQIs5x-BsvSjTDl.js +0 -432
  42. package/dist/useHelperText-Cqx6ggnc.js +0 -392
  43. package/dist/useTranslation-BQQybhSd.js +0 -5042
@@ -1,571 +0,0 @@
1
- import { k as T, l as v } from "./useTranslation-BQQybhSd.js";
2
- import { a as E, f as S } from "./component-Bz_dtX1r-DqCAj-DR.js";
3
- /**
4
- * @license
5
- * Copyright 2018 Google Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in
15
- * all copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- * THE SOFTWARE.
24
- */
25
- function I(n, i) {
26
- if (n.closest)
27
- return n.closest(i);
28
- for (var t = n; t; ) {
29
- if (h(t, i))
30
- return t;
31
- t = t.parentElement;
32
- }
33
- return null;
34
- }
35
- function h(n, i) {
36
- var t = n.matches || n.webkitMatchesSelector || n.msMatchesSelector;
37
- return t.call(n, i);
38
- }
39
- function R(n) {
40
- var i = n;
41
- if (i.offsetParent !== null)
42
- return i.scrollWidth;
43
- var t = i.cloneNode(!0);
44
- t.style.setProperty("position", "absolute"), t.style.setProperty("transform", "translate(-9999px, -9999px)"), document.documentElement.appendChild(t);
45
- var e = t.scrollWidth;
46
- return document.documentElement.removeChild(t), e;
47
- }
48
- const N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49
- __proto__: null,
50
- closest: I,
51
- estimateScrollWidth: R,
52
- matches: h
53
- }, Symbol.toStringTag, { value: "Module" }));
54
- var l;
55
- function D(n, i) {
56
- i === void 0 && (i = !1);
57
- var t = n.CSS, e = l;
58
- if (typeof l == "boolean" && !i)
59
- return l;
60
- var a = t && typeof t.supports == "function";
61
- if (!a)
62
- return !1;
63
- var r = t.supports("--css-vars", "yes"), o = t.supports("(--css-vars: yes)") && t.supports("color", "#00000000");
64
- return e = r || o, i || (l = e), e;
65
- }
66
- function H(n, i, t) {
67
- if (!n)
68
- return { x: 0, y: 0 };
69
- var e = i.x, a = i.y, r = e + t.left, o = a + t.top, s, u;
70
- if (n.type === "touchstart") {
71
- var c = n;
72
- s = c.changedTouches[0].pageX - r, u = c.changedTouches[0].pageY - o;
73
- } else {
74
- var d = n;
75
- s = d.pageX - r, u = d.pageY - o;
76
- }
77
- return { x: s, y: u };
78
- }
79
- /**
80
- * @license
81
- * Copyright 2019 Google Inc.
82
- *
83
- * Permission is hereby granted, free of charge, to any person obtaining a copy
84
- * of this software and associated documentation files (the "Software"), to deal
85
- * in the Software without restriction, including without limitation the rights
86
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
87
- * copies of the Software, and to permit persons to whom the Software is
88
- * furnished to do so, subject to the following conditions:
89
- *
90
- * The above copyright notice and this permission notice shall be included in
91
- * all copies or substantial portions of the Software.
92
- *
93
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
94
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
95
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
96
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
97
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
98
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
99
- * THE SOFTWARE.
100
- */
101
- function p(n) {
102
- return n === void 0 && (n = window), w(n) ? { passive: !0 } : !1;
103
- }
104
- function w(n) {
105
- n === void 0 && (n = window);
106
- var i = !1;
107
- try {
108
- var t = {
109
- // This function will be called when the browser
110
- // attempts to access the passive property.
111
- get passive() {
112
- return i = !0, !1;
113
- }
114
- }, e = function() {
115
- };
116
- n.document.addEventListener("test", e, t), n.document.removeEventListener("test", e, t);
117
- } catch {
118
- i = !1;
119
- }
120
- return i;
121
- }
122
- /**
123
- * @license
124
- * Copyright 2016 Google Inc.
125
- *
126
- * Permission is hereby granted, free of charge, to any person obtaining a copy
127
- * of this software and associated documentation files (the "Software"), to deal
128
- * in the Software without restriction, including without limitation the rights
129
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
130
- * copies of the Software, and to permit persons to whom the Software is
131
- * furnished to do so, subject to the following conditions:
132
- *
133
- * The above copyright notice and this permission notice shall be included in
134
- * all copies or substantial portions of the Software.
135
- *
136
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
137
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
138
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
139
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
140
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
141
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
142
- * THE SOFTWARE.
143
- */
144
- var O = {
145
- // Ripple is a special case where the "root" component is really a "mixin" of sorts,
146
- // given that it's an 'upgrade' to an existing component. That being said it is the root
147
- // CSS class that all other CSS classes derive from.
148
- BG_FOCUSED: "mdc-ripple-upgraded--background-focused",
149
- FG_ACTIVATION: "mdc-ripple-upgraded--foreground-activation",
150
- FG_DEACTIVATION: "mdc-ripple-upgraded--foreground-deactivation",
151
- ROOT: "mdc-ripple-upgraded",
152
- UNBOUNDED: "mdc-ripple-upgraded--unbounded"
153
- }, F = {
154
- VAR_FG_SCALE: "--mdc-ripple-fg-scale",
155
- VAR_FG_SIZE: "--mdc-ripple-fg-size",
156
- VAR_FG_TRANSLATE_END: "--mdc-ripple-fg-translate-end",
157
- VAR_FG_TRANSLATE_START: "--mdc-ripple-fg-translate-start",
158
- VAR_LEFT: "--mdc-ripple-left",
159
- VAR_TOP: "--mdc-ripple-top"
160
- }, y = {
161
- DEACTIVATION_TIMEOUT_MS: 225,
162
- FG_DEACTIVATION_MS: 150,
163
- INITIAL_ORIGIN_SCALE: 0.6,
164
- PADDING: 10,
165
- TAP_DELAY_MS: 300
166
- // Delay between touch and simulated mouse events on touch devices
167
- };
168
- /**
169
- * @license
170
- * Copyright 2016 Google Inc.
171
- *
172
- * Permission is hereby granted, free of charge, to any person obtaining a copy
173
- * of this software and associated documentation files (the "Software"), to deal
174
- * in the Software without restriction, including without limitation the rights
175
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
176
- * copies of the Software, and to permit persons to whom the Software is
177
- * furnished to do so, subject to the following conditions:
178
- *
179
- * The above copyright notice and this permission notice shall be included in
180
- * all copies or substantial portions of the Software.
181
- *
182
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
183
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
184
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
185
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
186
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
187
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
188
- * THE SOFTWARE.
189
- */
190
- var b = [
191
- "touchstart",
192
- "pointerdown",
193
- "mousedown",
194
- "keydown"
195
- ], C = [
196
- "touchend",
197
- "pointerup",
198
- "mouseup",
199
- "contextmenu"
200
- ], f = [], V = (
201
- /** @class */
202
- function(n) {
203
- T(i, n);
204
- function i(t) {
205
- var e = n.call(this, v(v({}, i.defaultAdapter), t)) || this;
206
- return e.activationAnimationHasEnded_ = !1, e.activationTimer_ = 0, e.fgDeactivationRemovalTimer_ = 0, e.fgScale_ = "0", e.frame_ = { width: 0, height: 0 }, e.initialSize_ = 0, e.layoutFrame_ = 0, e.maxRadius_ = 0, e.unboundedCoords_ = { left: 0, top: 0 }, e.activationState_ = e.defaultActivationState_(), e.activationTimerCallback_ = function() {
207
- e.activationAnimationHasEnded_ = !0, e.runDeactivationUXLogicIfReady_();
208
- }, e.activateHandler_ = function(a) {
209
- return e.activate_(a);
210
- }, e.deactivateHandler_ = function() {
211
- return e.deactivate_();
212
- }, e.focusHandler_ = function() {
213
- return e.handleFocus();
214
- }, e.blurHandler_ = function() {
215
- return e.handleBlur();
216
- }, e.resizeHandler_ = function() {
217
- return e.layout();
218
- }, e;
219
- }
220
- return Object.defineProperty(i, "cssClasses", {
221
- get: function() {
222
- return O;
223
- },
224
- enumerable: !1,
225
- configurable: !0
226
- }), Object.defineProperty(i, "strings", {
227
- get: function() {
228
- return F;
229
- },
230
- enumerable: !1,
231
- configurable: !0
232
- }), Object.defineProperty(i, "numbers", {
233
- get: function() {
234
- return y;
235
- },
236
- enumerable: !1,
237
- configurable: !0
238
- }), Object.defineProperty(i, "defaultAdapter", {
239
- get: function() {
240
- return {
241
- addClass: function() {
242
- },
243
- browserSupportsCssVars: function() {
244
- return !0;
245
- },
246
- computeBoundingRect: function() {
247
- return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 };
248
- },
249
- containsEventTarget: function() {
250
- return !0;
251
- },
252
- deregisterDocumentInteractionHandler: function() {
253
- },
254
- deregisterInteractionHandler: function() {
255
- },
256
- deregisterResizeHandler: function() {
257
- },
258
- getWindowPageOffset: function() {
259
- return { x: 0, y: 0 };
260
- },
261
- isSurfaceActive: function() {
262
- return !0;
263
- },
264
- isSurfaceDisabled: function() {
265
- return !0;
266
- },
267
- isUnbounded: function() {
268
- return !0;
269
- },
270
- registerDocumentInteractionHandler: function() {
271
- },
272
- registerInteractionHandler: function() {
273
- },
274
- registerResizeHandler: function() {
275
- },
276
- removeClass: function() {
277
- },
278
- updateCssVariable: function() {
279
- }
280
- };
281
- },
282
- enumerable: !1,
283
- configurable: !0
284
- }), i.prototype.init = function() {
285
- var t = this, e = this.supportsPressRipple_();
286
- if (this.registerRootHandlers_(e), e) {
287
- var a = i.cssClasses, r = a.ROOT, o = a.UNBOUNDED;
288
- requestAnimationFrame(function() {
289
- t.adapter.addClass(r), t.adapter.isUnbounded() && (t.adapter.addClass(o), t.layoutInternal_());
290
- });
291
- }
292
- }, i.prototype.destroy = function() {
293
- var t = this;
294
- if (this.supportsPressRipple_()) {
295
- this.activationTimer_ && (clearTimeout(this.activationTimer_), this.activationTimer_ = 0, this.adapter.removeClass(i.cssClasses.FG_ACTIVATION)), this.fgDeactivationRemovalTimer_ && (clearTimeout(this.fgDeactivationRemovalTimer_), this.fgDeactivationRemovalTimer_ = 0, this.adapter.removeClass(i.cssClasses.FG_DEACTIVATION));
296
- var e = i.cssClasses, a = e.ROOT, r = e.UNBOUNDED;
297
- requestAnimationFrame(function() {
298
- t.adapter.removeClass(a), t.adapter.removeClass(r), t.removeCssVars_();
299
- });
300
- }
301
- this.deregisterRootHandlers_(), this.deregisterDeactivationHandlers_();
302
- }, i.prototype.activate = function(t) {
303
- this.activate_(t);
304
- }, i.prototype.deactivate = function() {
305
- this.deactivate_();
306
- }, i.prototype.layout = function() {
307
- var t = this;
308
- this.layoutFrame_ && cancelAnimationFrame(this.layoutFrame_), this.layoutFrame_ = requestAnimationFrame(function() {
309
- t.layoutInternal_(), t.layoutFrame_ = 0;
310
- });
311
- }, i.prototype.setUnbounded = function(t) {
312
- var e = i.cssClasses.UNBOUNDED;
313
- t ? this.adapter.addClass(e) : this.adapter.removeClass(e);
314
- }, i.prototype.handleFocus = function() {
315
- var t = this;
316
- requestAnimationFrame(function() {
317
- return t.adapter.addClass(i.cssClasses.BG_FOCUSED);
318
- });
319
- }, i.prototype.handleBlur = function() {
320
- var t = this;
321
- requestAnimationFrame(function() {
322
- return t.adapter.removeClass(i.cssClasses.BG_FOCUSED);
323
- });
324
- }, i.prototype.supportsPressRipple_ = function() {
325
- return this.adapter.browserSupportsCssVars();
326
- }, i.prototype.defaultActivationState_ = function() {
327
- return {
328
- activationEvent: void 0,
329
- hasDeactivationUXRun: !1,
330
- isActivated: !1,
331
- isProgrammatic: !1,
332
- wasActivatedByPointer: !1,
333
- wasElementMadeActive: !1
334
- };
335
- }, i.prototype.registerRootHandlers_ = function(t) {
336
- var e = this;
337
- t && (b.forEach(function(a) {
338
- e.adapter.registerInteractionHandler(a, e.activateHandler_);
339
- }), this.adapter.isUnbounded() && this.adapter.registerResizeHandler(this.resizeHandler_)), this.adapter.registerInteractionHandler("focus", this.focusHandler_), this.adapter.registerInteractionHandler("blur", this.blurHandler_);
340
- }, i.prototype.registerDeactivationHandlers_ = function(t) {
341
- var e = this;
342
- t.type === "keydown" ? this.adapter.registerInteractionHandler("keyup", this.deactivateHandler_) : C.forEach(function(a) {
343
- e.adapter.registerDocumentInteractionHandler(a, e.deactivateHandler_);
344
- });
345
- }, i.prototype.deregisterRootHandlers_ = function() {
346
- var t = this;
347
- b.forEach(function(e) {
348
- t.adapter.deregisterInteractionHandler(e, t.activateHandler_);
349
- }), this.adapter.deregisterInteractionHandler("focus", this.focusHandler_), this.adapter.deregisterInteractionHandler("blur", this.blurHandler_), this.adapter.isUnbounded() && this.adapter.deregisterResizeHandler(this.resizeHandler_);
350
- }, i.prototype.deregisterDeactivationHandlers_ = function() {
351
- var t = this;
352
- this.adapter.deregisterInteractionHandler("keyup", this.deactivateHandler_), C.forEach(function(e) {
353
- t.adapter.deregisterDocumentInteractionHandler(e, t.deactivateHandler_);
354
- });
355
- }, i.prototype.removeCssVars_ = function() {
356
- var t = this, e = i.strings, a = Object.keys(e);
357
- a.forEach(function(r) {
358
- r.indexOf("VAR_") === 0 && t.adapter.updateCssVariable(e[r], null);
359
- });
360
- }, i.prototype.activate_ = function(t) {
361
- var e = this;
362
- if (!this.adapter.isSurfaceDisabled()) {
363
- var a = this.activationState_;
364
- if (!a.isActivated) {
365
- var r = this.previousActivationEvent_, o = r && t !== void 0 && r.type !== t.type;
366
- if (!o) {
367
- a.isActivated = !0, a.isProgrammatic = t === void 0, a.activationEvent = t, a.wasActivatedByPointer = a.isProgrammatic ? !1 : t !== void 0 && (t.type === "mousedown" || t.type === "touchstart" || t.type === "pointerdown");
368
- var s = t !== void 0 && f.length > 0 && f.some(function(u) {
369
- return e.adapter.containsEventTarget(u);
370
- });
371
- if (s) {
372
- this.resetActivationState_();
373
- return;
374
- }
375
- t !== void 0 && (f.push(t.target), this.registerDeactivationHandlers_(t)), a.wasElementMadeActive = this.checkElementMadeActive_(t), a.wasElementMadeActive && this.animateActivation_(), requestAnimationFrame(function() {
376
- f = [], !a.wasElementMadeActive && t !== void 0 && (t.key === " " || t.keyCode === 32) && (a.wasElementMadeActive = e.checkElementMadeActive_(t), a.wasElementMadeActive && e.animateActivation_()), a.wasElementMadeActive || (e.activationState_ = e.defaultActivationState_());
377
- });
378
- }
379
- }
380
- }
381
- }, i.prototype.checkElementMadeActive_ = function(t) {
382
- return t !== void 0 && t.type === "keydown" ? this.adapter.isSurfaceActive() : !0;
383
- }, i.prototype.animateActivation_ = function() {
384
- var t = this, e = i.strings, a = e.VAR_FG_TRANSLATE_START, r = e.VAR_FG_TRANSLATE_END, o = i.cssClasses, s = o.FG_DEACTIVATION, u = o.FG_ACTIVATION, c = i.numbers.DEACTIVATION_TIMEOUT_MS;
385
- this.layoutInternal_();
386
- var d = "", _ = "";
387
- if (!this.adapter.isUnbounded()) {
388
- var m = this.getFgTranslationCoordinates_(), g = m.startPoint, A = m.endPoint;
389
- d = g.x + "px, " + g.y + "px", _ = A.x + "px, " + A.y + "px";
390
- }
391
- this.adapter.updateCssVariable(a, d), this.adapter.updateCssVariable(r, _), clearTimeout(this.activationTimer_), clearTimeout(this.fgDeactivationRemovalTimer_), this.rmBoundedActivationClasses_(), this.adapter.removeClass(s), this.adapter.computeBoundingRect(), this.adapter.addClass(u), this.activationTimer_ = setTimeout(function() {
392
- return t.activationTimerCallback_();
393
- }, c);
394
- }, i.prototype.getFgTranslationCoordinates_ = function() {
395
- var t = this.activationState_, e = t.activationEvent, a = t.wasActivatedByPointer, r;
396
- a ? r = H(e, this.adapter.getWindowPageOffset(), this.adapter.computeBoundingRect()) : r = {
397
- x: this.frame_.width / 2,
398
- y: this.frame_.height / 2
399
- }, r = {
400
- x: r.x - this.initialSize_ / 2,
401
- y: r.y - this.initialSize_ / 2
402
- };
403
- var o = {
404
- x: this.frame_.width / 2 - this.initialSize_ / 2,
405
- y: this.frame_.height / 2 - this.initialSize_ / 2
406
- };
407
- return { startPoint: r, endPoint: o };
408
- }, i.prototype.runDeactivationUXLogicIfReady_ = function() {
409
- var t = this, e = i.cssClasses.FG_DEACTIVATION, a = this.activationState_, r = a.hasDeactivationUXRun, o = a.isActivated, s = r || !o;
410
- s && this.activationAnimationHasEnded_ && (this.rmBoundedActivationClasses_(), this.adapter.addClass(e), this.fgDeactivationRemovalTimer_ = setTimeout(function() {
411
- t.adapter.removeClass(e);
412
- }, y.FG_DEACTIVATION_MS));
413
- }, i.prototype.rmBoundedActivationClasses_ = function() {
414
- var t = i.cssClasses.FG_ACTIVATION;
415
- this.adapter.removeClass(t), this.activationAnimationHasEnded_ = !1, this.adapter.computeBoundingRect();
416
- }, i.prototype.resetActivationState_ = function() {
417
- var t = this;
418
- this.previousActivationEvent_ = this.activationState_.activationEvent, this.activationState_ = this.defaultActivationState_(), setTimeout(function() {
419
- return t.previousActivationEvent_ = void 0;
420
- }, i.numbers.TAP_DELAY_MS);
421
- }, i.prototype.deactivate_ = function() {
422
- var t = this, e = this.activationState_;
423
- if (e.isActivated) {
424
- var a = v({}, e);
425
- e.isProgrammatic ? (requestAnimationFrame(function() {
426
- return t.animateDeactivation_(a);
427
- }), this.resetActivationState_()) : (this.deregisterDeactivationHandlers_(), requestAnimationFrame(function() {
428
- t.activationState_.hasDeactivationUXRun = !0, t.animateDeactivation_(a), t.resetActivationState_();
429
- }));
430
- }
431
- }, i.prototype.animateDeactivation_ = function(t) {
432
- var e = t.wasActivatedByPointer, a = t.wasElementMadeActive;
433
- (e || a) && this.runDeactivationUXLogicIfReady_();
434
- }, i.prototype.layoutInternal_ = function() {
435
- var t = this;
436
- this.frame_ = this.adapter.computeBoundingRect();
437
- var e = Math.max(this.frame_.height, this.frame_.width), a = function() {
438
- var o = Math.sqrt(Math.pow(t.frame_.width, 2) + Math.pow(t.frame_.height, 2));
439
- return o + i.numbers.PADDING;
440
- };
441
- this.maxRadius_ = this.adapter.isUnbounded() ? e : a();
442
- var r = Math.floor(e * i.numbers.INITIAL_ORIGIN_SCALE);
443
- this.adapter.isUnbounded() && r % 2 !== 0 ? this.initialSize_ = r - 1 : this.initialSize_ = r, this.fgScale_ = "" + this.maxRadius_ / this.initialSize_, this.updateLayoutCssVars_();
444
- }, i.prototype.updateLayoutCssVars_ = function() {
445
- var t = i.strings, e = t.VAR_FG_SIZE, a = t.VAR_LEFT, r = t.VAR_TOP, o = t.VAR_FG_SCALE;
446
- this.adapter.updateCssVariable(e, this.initialSize_ + "px"), this.adapter.updateCssVariable(o, this.fgScale_), this.adapter.isUnbounded() && (this.unboundedCoords_ = {
447
- left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2),
448
- top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2)
449
- }, this.adapter.updateCssVariable(a, this.unboundedCoords_.left + "px"), this.adapter.updateCssVariable(r, this.unboundedCoords_.top + "px"));
450
- }, i;
451
- }(E)
452
- );
453
- /**
454
- * @license
455
- * Copyright 2016 Google Inc.
456
- *
457
- * Permission is hereby granted, free of charge, to any person obtaining a copy
458
- * of this software and associated documentation files (the "Software"), to deal
459
- * in the Software without restriction, including without limitation the rights
460
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
461
- * copies of the Software, and to permit persons to whom the Software is
462
- * furnished to do so, subject to the following conditions:
463
- *
464
- * The above copyright notice and this permission notice shall be included in
465
- * all copies or substantial portions of the Software.
466
- *
467
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
468
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
469
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
470
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
471
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
472
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
473
- * THE SOFTWARE.
474
- */
475
- var M = (
476
- /** @class */
477
- function(n) {
478
- T(i, n);
479
- function i() {
480
- var t = n !== null && n.apply(this, arguments) || this;
481
- return t.disabled = !1, t;
482
- }
483
- return i.attachTo = function(t, e) {
484
- e === void 0 && (e = { isUnbounded: void 0 });
485
- var a = new i(t);
486
- return e.isUnbounded !== void 0 && (a.unbounded = e.isUnbounded), a;
487
- }, i.createAdapter = function(t) {
488
- return {
489
- addClass: function(e) {
490
- return t.root.classList.add(e);
491
- },
492
- browserSupportsCssVars: function() {
493
- return D(window);
494
- },
495
- computeBoundingRect: function() {
496
- return t.root.getBoundingClientRect();
497
- },
498
- containsEventTarget: function(e) {
499
- return t.root.contains(e);
500
- },
501
- deregisterDocumentInteractionHandler: function(e, a) {
502
- return document.documentElement.removeEventListener(e, a, p());
503
- },
504
- deregisterInteractionHandler: function(e, a) {
505
- return t.root.removeEventListener(e, a, p());
506
- },
507
- deregisterResizeHandler: function(e) {
508
- return window.removeEventListener("resize", e);
509
- },
510
- getWindowPageOffset: function() {
511
- return { x: window.pageXOffset, y: window.pageYOffset };
512
- },
513
- isSurfaceActive: function() {
514
- return h(t.root, ":active");
515
- },
516
- isSurfaceDisabled: function() {
517
- return !!t.disabled;
518
- },
519
- isUnbounded: function() {
520
- return !!t.unbounded;
521
- },
522
- registerDocumentInteractionHandler: function(e, a) {
523
- return document.documentElement.addEventListener(e, a, p());
524
- },
525
- registerInteractionHandler: function(e, a) {
526
- return t.root.addEventListener(e, a, p());
527
- },
528
- registerResizeHandler: function(e) {
529
- return window.addEventListener("resize", e);
530
- },
531
- removeClass: function(e) {
532
- return t.root.classList.remove(e);
533
- },
534
- updateCssVariable: function(e, a) {
535
- return t.root.style.setProperty(e, a);
536
- }
537
- };
538
- }, Object.defineProperty(i.prototype, "unbounded", {
539
- get: function() {
540
- return !!this.unbounded_;
541
- },
542
- set: function(t) {
543
- this.unbounded_ = !!t, this.setUnbounded_();
544
- },
545
- enumerable: !1,
546
- configurable: !0
547
- }), i.prototype.activate = function() {
548
- this.foundation.activate();
549
- }, i.prototype.deactivate = function() {
550
- this.foundation.deactivate();
551
- }, i.prototype.layout = function() {
552
- this.foundation.layout();
553
- }, i.prototype.getDefaultFoundation = function() {
554
- return new V(i.createAdapter(this));
555
- }, i.prototype.initialSyncWithDOM = function() {
556
- var t = this.root;
557
- this.unbounded = "mdcRippleIsUnbounded" in t.dataset;
558
- }, i.prototype.setUnbounded_ = function() {
559
- this.foundation.setUnbounded(!!this.unbounded_);
560
- }, i;
561
- }(S)
562
- );
563
- export {
564
- R as D,
565
- N as M,
566
- V as O,
567
- M as U,
568
- h as _,
569
- I as b,
570
- p
571
- };