@hortiview/default-components 1.4.4 → 1.5.1

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