@hortiview/shared-components 0.0.11528 → 0.0.11587

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 (118) hide show
  1. package/README.md +17 -0
  2. package/dist/{BigLoadingSpinner-D7H28pr5.js → BigLoadingSpinner-iegTbDcD.js} +6 -6
  3. package/dist/GenericCard-6J558OgP.js +350 -0
  4. package/dist/{ListAreaService-YS_UUPh5.js → ListAreaService-DOwtdRa4.js} +18 -16
  5. package/dist/_MapCache-B75yWNNd.js +376 -0
  6. package/dist/_baseIsEqual-D0Dsajdb.js +317 -0
  7. package/dist/_getTag-BCf9b56Z.js +81 -0
  8. package/dist/animationframe-EMBh6XeO.js +54 -0
  9. package/dist/component-DsB0poTj.js +571 -0
  10. package/dist/component-neHBNHRu.js +114 -0
  11. package/dist/components/AlertBanner/AlertBanner.js +16 -15
  12. package/dist/components/BaseView/BaseView.js +5 -5
  13. package/dist/components/BasicHeading/BasicHeading.js +25 -24
  14. package/dist/components/BasicHeading/BasicHeading.test.js +9 -9
  15. package/dist/components/BlockView/BlockView.js +5 -5
  16. package/dist/components/ChipCard/ChipCard.js +1765 -14
  17. package/dist/components/ContextMenu/ContextMenu.d.ts +1 -1
  18. package/dist/components/ContextMenu/ContextMenu.js +28 -27
  19. package/dist/components/DeleteModal/DeleteModal.js +37 -34
  20. package/dist/components/Disclaimer/Disclaimer.js +11 -9
  21. package/dist/components/EmptyView/EmptyView.js +258 -19
  22. package/dist/components/Filter/Filter.js +58 -54
  23. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +13 -11
  24. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +1 -1
  25. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +5974 -6387
  26. package/dist/components/FormComponents/FormNumber/CustomTextField.d.ts +1 -1
  27. package/dist/components/FormComponents/FormNumber/CustomTextField.js +5 -5
  28. package/dist/components/FormComponents/FormNumber/FormNumber.d.ts +1 -1
  29. package/dist/components/FormComponents/FormNumber/FormNumber.js +1 -1
  30. package/dist/components/FormComponents/FormRadio/FormRadio.js +4 -4
  31. package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +1 -1
  32. package/dist/components/FormComponents/FormSelect/FormSelect.js +3 -3
  33. package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +6 -5
  34. package/dist/components/FormComponents/FormSlider/FormSlider.js +1155 -27
  35. package/dist/components/FormComponents/FormText/FormText.d.ts +1 -1
  36. package/dist/components/FormComponents/FormText/FormText.js +33 -32
  37. package/dist/components/FormComponents/FormToggle/FormToggle.d.ts +1 -1
  38. package/dist/components/FormComponents/FormToggle/FormToggle.js +17 -15
  39. package/dist/components/GenericTable/GenericTable.js +10486 -74
  40. package/dist/components/GenericTable/Mobile/GenericCard.js +4 -3
  41. package/dist/components/GenericTable/Mobile/GenericCard.test.js +1 -1
  42. package/dist/components/GenericTable/Mobile/GenericCardList.js +10 -8
  43. package/dist/components/HashTabView/HashTabView.js +1805 -72
  44. package/dist/components/HeaderFilter/HeaderFilter.d.ts +1 -1
  45. package/dist/components/HeaderFilter/HeaderFilter.js +4 -4
  46. package/dist/components/HealthCheckFailed/HealthCheckFailed.js +20 -17
  47. package/dist/components/Iconify/Iconify.d.ts +1 -2
  48. package/dist/components/Iconify/Iconify.js +42 -42
  49. package/dist/components/InfoGroup/InfoGroup.js +30 -28
  50. package/dist/components/ListArea/ListArea.js +29 -27
  51. package/dist/components/ListArea/ListArea.test.js +2 -2
  52. package/dist/components/ListArea/ListAreaService.js +7 -5
  53. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +2 -2
  54. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +1 -1
  55. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +506 -37
  56. package/dist/components/Modal/Modal.d.ts +1 -1
  57. package/dist/components/Modal/Modal.js +926 -9
  58. package/dist/components/ModulePadding/ModulePadding.d.ts +7 -0
  59. package/dist/components/ModulePadding/ModulePadding.js +28 -0
  60. package/dist/components/ModulePadding/ModulePadding.test.d.ts +1 -0
  61. package/dist/components/ModulePadding/ModulePadding.test.js +22 -0
  62. package/dist/components/OverflowTooltip/OverflowTooltip.js +6 -6
  63. package/dist/components/OverflowTooltip/OverflowTooltip.test.js +1 -1
  64. package/dist/components/SearchBar/SearchBar.js +7 -6
  65. package/dist/components/Select/Select.d.ts +1 -1
  66. package/dist/components/Select/Select.js +13 -13
  67. package/dist/floating-ui.dom-CeD8zknG.js +978 -0
  68. package/dist/get-7ACccM2X.js +114 -0
  69. package/dist/{get-BiqanC9_.js → get-DFv1gXfq.js} +1 -1
  70. package/dist/hooks/useHelperText.js +1 -1
  71. package/dist/identity-DLWZln-X.js +1763 -0
  72. package/dist/index.es-0lQcz8m1.js +444 -0
  73. package/dist/index.es-25EARqhH.js +2027 -0
  74. package/dist/index.es-3043KTnb.js +1066 -0
  75. package/dist/index.es-41ztjcFT.js +724 -0
  76. package/dist/index.es-6TJ1S8Jr.js +954 -0
  77. package/dist/index.es-8GOVkuo-.js +374 -0
  78. package/dist/index.es-B-_jXDuz.js +216 -0
  79. package/dist/index.es-BWgXLqXn.js +102 -0
  80. package/dist/index.es-BtjV0oNv.js +360 -0
  81. package/dist/index.es-BvrQnJ3j.js +509 -0
  82. package/dist/index.es-CF_xy2ns.js +674 -0
  83. package/dist/index.es-CL_Heu1n.js +54 -0
  84. package/dist/index.es-CiqbARoC.js +306 -0
  85. package/dist/index.es-D-CKRzIB.js +63 -0
  86. package/dist/index.es-D6N-XWHe.js +56 -0
  87. package/dist/index.es-DKDgy7Kt.js +45 -0
  88. package/dist/index.es-DntoATwO.js +159 -0
  89. package/dist/index.es-UHKFl8Da.js +7075 -0
  90. package/dist/index.es-d5xhUpJZ.js +3242 -0
  91. package/dist/index.es-da0cf7oE.js +569 -0
  92. package/dist/index.es-h2lMdt7G.js +107 -0
  93. package/dist/index.es-zr101OF5.js +4853 -0
  94. package/dist/{isArray-2zMxXFEr.js → isArray-DN9s620O.js} +3 -3
  95. package/dist/{isArray-C_5XvIlE.js → isArray-Dub1wGJM.js} +1 -1
  96. package/dist/isEmpty-B4GG2s-V.js +31 -0
  97. package/dist/isPlainObject-C273y67K.js +40 -0
  98. package/dist/isString-BW9UHONv.js +21 -0
  99. package/dist/keyboard-Bpt0aBqQ.js +107 -0
  100. package/dist/main.d.ts +1 -0
  101. package/dist/main.js +57 -55
  102. package/dist/orderBy-Bd48bw88.js +316 -0
  103. package/dist/react-tooltip.min-DSY6KDqS.js +431 -0
  104. package/dist/services/UtilService.js +2 -2
  105. package/dist/toString-CrgB_7Pe.js +54 -0
  106. package/dist/tslib.es6-BDCynO9F.js +162 -0
  107. package/dist/types/GenericTable.d.ts +1 -1
  108. package/dist/uniqueId-NU3-C36A.js +18 -0
  109. package/dist/util-DA21pZXj.js +78 -0
  110. package/package.json +1 -1
  111. package/dist/GenericCard-jlt8ZsHi.js +0 -80
  112. package/dist/_Map-Dtlps7IZ.js +0 -113
  113. package/dist/_overArg-_0pUmCsX.js +0 -14
  114. package/dist/get-P-5PYZOE.js +0 -426
  115. package/dist/isEmpty-BimaZd5G.js +0 -225
  116. package/dist/isString-BOHPtrlm.js +0 -44
  117. package/dist/orderBy-BVQIswlJ.js +0 -765
  118. package/dist/react-tooltip.min-Czs4RGD1.js +0 -1400
@@ -1,15 +1,932 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { Modal as l } from "@element-public/react-components";
3
- import '../../assets/Modal.css';const m = "_modal_a4n3a_1", d = {
4
- modal: m
5
- }, e = (a) => /* @__PURE__ */ o(
6
- l,
1
+ import { jsx as ct } from "react/jsx-runtime";
2
+ import { _ as dt, c as R, P as s } from "../../identity-DLWZln-X.js";
3
+ import d, { forwardRef as ut, useRef as Q, useImperativeHandle as mt, useState as X, useEffect as h, useCallback as V, useMemo as Z } from "react";
4
+ import { I as ft } from "../../index.es-0lQcz8m1.js";
5
+ import { i as pt, c as O, a as ht } from "../../index.es-da0cf7oE.js";
6
+ import { b as et, c as tt, d as Et } from "../../tslib.es6-BDCynO9F.js";
7
+ import { M as gt, a as _t } from "../../component-neHBNHRu.js";
8
+ import { M as Ct, c as St, m as vt } from "../../component-DsB0poTj.js";
9
+ import { A as yt } from "../../animationframe-EMBh6XeO.js";
10
+ import '../../assets/Modal.css';/**
11
+ * @license
12
+ * Copyright 2016 Google Inc.
13
+ *
14
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ * of this software and associated documentation files (the "Software"), to deal
16
+ * in the Software without restriction, including without limitation the rights
17
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ * copies of the Software, and to permit persons to whom the Software is
19
+ * furnished to do so, subject to the following conditions:
20
+ *
21
+ * The above copyright notice and this permission notice shall be included in
22
+ * all copies or substantial portions of the Software.
23
+ *
24
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30
+ * THE SOFTWARE.
31
+ */
32
+ function Ot(i, e, t) {
33
+ return e(i, { initialFocusEl: t });
34
+ }
35
+ function Tt(i) {
36
+ return i ? i.scrollHeight > i.offsetHeight : !1;
37
+ }
38
+ function At(i) {
39
+ return i ? i.scrollTop === 0 : !1;
40
+ }
41
+ function bt(i) {
42
+ return i ? Math.ceil(i.scrollHeight - i.scrollTop) === i.clientHeight : !1;
43
+ }
44
+ function Dt(i) {
45
+ var e = /* @__PURE__ */ new Set();
46
+ return [].forEach.call(i, function(t) {
47
+ return e.add(t.offsetTop);
48
+ }), e.size > 1;
49
+ }
50
+ /**
51
+ * @license
52
+ * Copyright 2020 Google Inc.
53
+ *
54
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
55
+ * of this software and associated documentation files (the "Software"), to deal
56
+ * in the Software without restriction, including without limitation the rights
57
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
58
+ * copies of the Software, and to permit persons to whom the Software is
59
+ * furnished to do so, subject to the following conditions:
60
+ *
61
+ * The above copyright notice and this permission notice shall be included in
62
+ * all copies or substantial portions of the Software.
63
+ *
64
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
67
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
68
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
69
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
70
+ * THE SOFTWARE.
71
+ */
72
+ var W = "mdc-dom-focus-sentinel", It = (
73
+ /** @class */
74
+ function() {
75
+ function i(e, t) {
76
+ t === void 0 && (t = {}), this.root = e, this.options = t, this.elFocusedBeforeTrapFocus = null;
77
+ }
78
+ return i.prototype.trapFocus = function() {
79
+ var e = this.getFocusableElements(this.root);
80
+ if (e.length === 0)
81
+ throw new Error("FocusTrap: Element must have at least one focusable child.");
82
+ this.elFocusedBeforeTrapFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null, this.wrapTabFocus(this.root), this.options.skipInitialFocus || this.focusInitialElement(e, this.options.initialFocusEl);
83
+ }, i.prototype.releaseFocus = function() {
84
+ [].slice.call(this.root.querySelectorAll("." + W)).forEach(function(e) {
85
+ e.parentElement.removeChild(e);
86
+ }), !this.options.skipRestoreFocus && this.elFocusedBeforeTrapFocus && this.elFocusedBeforeTrapFocus.focus();
87
+ }, i.prototype.wrapTabFocus = function(e) {
88
+ var t = this, n = this.createSentinel(), o = this.createSentinel();
89
+ n.addEventListener("focus", function() {
90
+ var a = t.getFocusableElements(e);
91
+ a.length > 0 && a[a.length - 1].focus();
92
+ }), o.addEventListener("focus", function() {
93
+ var a = t.getFocusableElements(e);
94
+ a.length > 0 && a[0].focus();
95
+ }), e.insertBefore(n, e.children[0]), e.appendChild(o);
96
+ }, i.prototype.focusInitialElement = function(e, t) {
97
+ var n = 0;
98
+ t && (n = Math.max(e.indexOf(t), 0)), e[n].focus();
99
+ }, i.prototype.getFocusableElements = function(e) {
100
+ var t = [].slice.call(e.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button"));
101
+ return t.filter(function(n) {
102
+ var o = n.getAttribute("aria-disabled") === "true" || n.getAttribute("disabled") != null || n.getAttribute("hidden") != null || n.getAttribute("aria-hidden") === "true", a = n.tabIndex >= 0 && n.getBoundingClientRect().width > 0 && !n.classList.contains(W) && !o, f = !1;
103
+ if (a) {
104
+ var E = getComputedStyle(n);
105
+ f = E.display === "none" || E.visibility === "hidden";
106
+ }
107
+ return a && !f;
108
+ });
109
+ }, i.prototype.createSentinel = function() {
110
+ var e = document.createElement("div");
111
+ return e.setAttribute("tabindex", "0"), e.setAttribute("aria-hidden", "true"), e.classList.add(W), e;
112
+ }, i;
113
+ }()
114
+ );
115
+ /**
116
+ * @license
117
+ * Copyright 2016 Google Inc.
118
+ *
119
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
120
+ * of this software and associated documentation files (the "Software"), to deal
121
+ * in the Software without restriction, including without limitation the rights
122
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
123
+ * copies of the Software, and to permit persons to whom the Software is
124
+ * furnished to do so, subject to the following conditions:
125
+ *
126
+ * The above copyright notice and this permission notice shall be included in
127
+ * all copies or substantial portions of the Software.
128
+ *
129
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
130
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
131
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
132
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
133
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
134
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
135
+ * THE SOFTWARE.
136
+ */
137
+ var r = {
138
+ CLOSING: "mdc-dialog--closing",
139
+ OPEN: "mdc-dialog--open",
140
+ OPENING: "mdc-dialog--opening",
141
+ SCROLLABLE: "mdc-dialog--scrollable",
142
+ SCROLL_LOCK: "mdc-dialog-scroll-lock",
143
+ STACKED: "mdc-dialog--stacked",
144
+ FULLSCREEN: "mdc-dialog--fullscreen",
145
+ // Class for showing a scroll divider on full-screen dialog header element.
146
+ // Should only be displayed on scrollable content, when the dialog content is
147
+ // scrolled "underneath" the header.
148
+ SCROLL_DIVIDER_HEADER: "mdc-dialog-scroll-divider-header",
149
+ // Class for showing a scroll divider on a full-screen dialog footer element.
150
+ // Should only be displayed on scrolalble content, when the dialog content is
151
+ // obscured "underneath" the footer.
152
+ SCROLL_DIVIDER_FOOTER: "mdc-dialog-scroll-divider-footer",
153
+ // The "surface scrim" is a scrim covering only the surface of a dialog. This
154
+ // is used in situations where a confirmation dialog is shown over an already
155
+ // opened full-screen dialog. On larger screen-sizes, the full-screen dialog
156
+ // is sized as a modal and so in these situations we display a "surface scrim"
157
+ // to prevent a "double scrim" (where the scrim from the secondary
158
+ // confirmation dialog would overlap with the scrim from the full-screen
159
+ // dialog).
160
+ SURFACE_SCRIM_SHOWN: "mdc-dialog__surface-scrim--shown",
161
+ // "Showing" animating class for the surface-scrim.
162
+ SURFACE_SCRIM_SHOWING: "mdc-dialog__surface-scrim--showing",
163
+ // "Hiding" animating class for the surface-scrim.
164
+ SURFACE_SCRIM_HIDING: "mdc-dialog__surface-scrim--hiding",
165
+ // Class to hide a dialog's scrim (used in conjunction with a surface-scrim).
166
+ // Note that we only hide the original scrim rather than removing it entirely
167
+ // to prevent interactions with the content behind this scrim, and to capture
168
+ // scrim clicks.
169
+ SCRIM_HIDDEN: "mdc-dialog__scrim--hidden"
170
+ }, C = {
171
+ ACTION_ATTRIBUTE: "data-mdc-dialog-action",
172
+ BUTTON_DEFAULT_ATTRIBUTE: "data-mdc-dialog-button-default",
173
+ BUTTON_SELECTOR: ".mdc-dialog__button",
174
+ CLOSED_EVENT: "MDCDialog:closed",
175
+ CLOSE_ACTION: "close",
176
+ CLOSING_EVENT: "MDCDialog:closing",
177
+ CONTAINER_SELECTOR: ".mdc-dialog__container",
178
+ CONTENT_SELECTOR: ".mdc-dialog__content",
179
+ DESTROY_ACTION: "destroy",
180
+ INITIAL_FOCUS_ATTRIBUTE: "data-mdc-dialog-initial-focus",
181
+ OPENED_EVENT: "MDCDialog:opened",
182
+ OPENING_EVENT: "MDCDialog:opening",
183
+ SCRIM_SELECTOR: ".mdc-dialog__scrim",
184
+ SUPPRESS_DEFAULT_PRESS_SELECTOR: [
185
+ "textarea",
186
+ ".mdc-menu .mdc-list-item",
187
+ ".mdc-menu .mdc-deprecated-list-item"
188
+ ].join(", "),
189
+ SURFACE_SELECTOR: ".mdc-dialog__surface"
190
+ }, z = {
191
+ DIALOG_ANIMATION_CLOSE_TIME_MS: 75,
192
+ DIALOG_ANIMATION_OPEN_TIME_MS: 150
193
+ };
194
+ /**
195
+ * @license
196
+ * Copyright 2017 Google Inc.
197
+ *
198
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
199
+ * of this software and associated documentation files (the "Software"), to deal
200
+ * in the Software without restriction, including without limitation the rights
201
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
202
+ * copies of the Software, and to permit persons to whom the Software is
203
+ * furnished to do so, subject to the following conditions:
204
+ *
205
+ * The above copyright notice and this permission notice shall be included in
206
+ * all copies or substantial portions of the Software.
207
+ *
208
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
209
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
210
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
211
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
212
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
213
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
214
+ * THE SOFTWARE.
215
+ */
216
+ var B;
217
+ (function(i) {
218
+ i.POLL_SCROLL_POS = "poll_scroll_position", i.POLL_LAYOUT_CHANGE = "poll_layout_change";
219
+ })(B || (B = {}));
220
+ var nt = (
221
+ /** @class */
222
+ function(i) {
223
+ et(e, i);
224
+ function e(t) {
225
+ var n = i.call(this, tt(tt({}, e.defaultAdapter), t)) || this;
226
+ return n.dialogOpen = !1, n.isFullscreen = !1, n.animationFrame = 0, n.animationTimer = 0, n.escapeKeyAction = C.CLOSE_ACTION, n.scrimClickAction = C.CLOSE_ACTION, n.autoStackButtons = !0, n.areButtonsStacked = !1, n.suppressDefaultPressSelector = C.SUPPRESS_DEFAULT_PRESS_SELECTOR, n.animFrame = new yt(), n.contentScrollHandler = function() {
227
+ n.handleScrollEvent();
228
+ }, n.windowResizeHandler = function() {
229
+ n.layout();
230
+ }, n.windowOrientationChangeHandler = function() {
231
+ n.layout();
232
+ }, n;
233
+ }
234
+ return Object.defineProperty(e, "cssClasses", {
235
+ get: function() {
236
+ return r;
237
+ },
238
+ enumerable: !1,
239
+ configurable: !0
240
+ }), Object.defineProperty(e, "strings", {
241
+ get: function() {
242
+ return C;
243
+ },
244
+ enumerable: !1,
245
+ configurable: !0
246
+ }), Object.defineProperty(e, "numbers", {
247
+ get: function() {
248
+ return z;
249
+ },
250
+ enumerable: !1,
251
+ configurable: !0
252
+ }), Object.defineProperty(e, "defaultAdapter", {
253
+ get: function() {
254
+ return {
255
+ addBodyClass: function() {
256
+ },
257
+ addClass: function() {
258
+ },
259
+ areButtonsStacked: function() {
260
+ return !1;
261
+ },
262
+ clickDefaultButton: function() {
263
+ },
264
+ eventTargetMatches: function() {
265
+ return !1;
266
+ },
267
+ getActionFromEvent: function() {
268
+ return "";
269
+ },
270
+ getInitialFocusEl: function() {
271
+ return null;
272
+ },
273
+ hasClass: function() {
274
+ return !1;
275
+ },
276
+ isContentScrollable: function() {
277
+ return !1;
278
+ },
279
+ notifyClosed: function() {
280
+ },
281
+ notifyClosing: function() {
282
+ },
283
+ notifyOpened: function() {
284
+ },
285
+ notifyOpening: function() {
286
+ },
287
+ releaseFocus: function() {
288
+ },
289
+ removeBodyClass: function() {
290
+ },
291
+ removeClass: function() {
292
+ },
293
+ reverseButtons: function() {
294
+ },
295
+ trapFocus: function() {
296
+ },
297
+ registerContentEventHandler: function() {
298
+ },
299
+ deregisterContentEventHandler: function() {
300
+ },
301
+ isScrollableContentAtTop: function() {
302
+ return !1;
303
+ },
304
+ isScrollableContentAtBottom: function() {
305
+ return !1;
306
+ },
307
+ registerWindowEventHandler: function() {
308
+ },
309
+ deregisterWindowEventHandler: function() {
310
+ }
311
+ };
312
+ },
313
+ enumerable: !1,
314
+ configurable: !0
315
+ }), e.prototype.init = function() {
316
+ this.adapter.hasClass(r.STACKED) && this.setAutoStackButtons(!1), this.isFullscreen = this.adapter.hasClass(r.FULLSCREEN);
317
+ }, e.prototype.destroy = function() {
318
+ this.dialogOpen && this.close(C.DESTROY_ACTION), this.animationTimer && (clearTimeout(this.animationTimer), this.handleAnimationTimerEnd()), this.isFullscreen && this.adapter.deregisterContentEventHandler("scroll", this.contentScrollHandler), this.animFrame.cancelAll(), this.adapter.deregisterWindowEventHandler("resize", this.windowResizeHandler), this.adapter.deregisterWindowEventHandler("orientationchange", this.windowOrientationChangeHandler);
319
+ }, e.prototype.open = function(t) {
320
+ var n = this;
321
+ this.dialogOpen = !0, this.adapter.notifyOpening(), this.adapter.addClass(r.OPENING), this.isFullscreen && this.adapter.registerContentEventHandler("scroll", this.contentScrollHandler), t && t.isAboveFullscreenDialog && this.adapter.addClass(r.SCRIM_HIDDEN), this.adapter.registerWindowEventHandler("resize", this.windowResizeHandler), this.adapter.registerWindowEventHandler("orientationchange", this.windowOrientationChangeHandler), this.runNextAnimationFrame(function() {
322
+ n.adapter.addClass(r.OPEN), n.adapter.addBodyClass(r.SCROLL_LOCK), n.layout(), n.animationTimer = setTimeout(function() {
323
+ n.handleAnimationTimerEnd(), n.adapter.trapFocus(n.adapter.getInitialFocusEl()), n.adapter.notifyOpened();
324
+ }, z.DIALOG_ANIMATION_OPEN_TIME_MS);
325
+ });
326
+ }, e.prototype.close = function(t) {
327
+ var n = this;
328
+ t === void 0 && (t = ""), this.dialogOpen && (this.dialogOpen = !1, this.adapter.notifyClosing(t), this.adapter.addClass(r.CLOSING), this.adapter.removeClass(r.OPEN), this.adapter.removeBodyClass(r.SCROLL_LOCK), this.isFullscreen && this.adapter.deregisterContentEventHandler("scroll", this.contentScrollHandler), this.adapter.deregisterWindowEventHandler("resize", this.windowResizeHandler), this.adapter.deregisterWindowEventHandler("orientationchange", this.windowOrientationChangeHandler), cancelAnimationFrame(this.animationFrame), this.animationFrame = 0, clearTimeout(this.animationTimer), this.animationTimer = setTimeout(function() {
329
+ n.adapter.releaseFocus(), n.handleAnimationTimerEnd(), n.adapter.notifyClosed(t);
330
+ }, z.DIALOG_ANIMATION_CLOSE_TIME_MS));
331
+ }, e.prototype.showSurfaceScrim = function() {
332
+ var t = this;
333
+ this.adapter.addClass(r.SURFACE_SCRIM_SHOWING), this.runNextAnimationFrame(function() {
334
+ t.adapter.addClass(r.SURFACE_SCRIM_SHOWN);
335
+ });
336
+ }, e.prototype.hideSurfaceScrim = function() {
337
+ this.adapter.removeClass(r.SURFACE_SCRIM_SHOWN), this.adapter.addClass(r.SURFACE_SCRIM_HIDING);
338
+ }, e.prototype.handleSurfaceScrimTransitionEnd = function() {
339
+ this.adapter.removeClass(r.SURFACE_SCRIM_HIDING), this.adapter.removeClass(r.SURFACE_SCRIM_SHOWING);
340
+ }, e.prototype.isOpen = function() {
341
+ return this.dialogOpen;
342
+ }, e.prototype.getEscapeKeyAction = function() {
343
+ return this.escapeKeyAction;
344
+ }, e.prototype.setEscapeKeyAction = function(t) {
345
+ this.escapeKeyAction = t;
346
+ }, e.prototype.getScrimClickAction = function() {
347
+ return this.scrimClickAction;
348
+ }, e.prototype.setScrimClickAction = function(t) {
349
+ this.scrimClickAction = t;
350
+ }, e.prototype.getAutoStackButtons = function() {
351
+ return this.autoStackButtons;
352
+ }, e.prototype.setAutoStackButtons = function(t) {
353
+ this.autoStackButtons = t;
354
+ }, e.prototype.getSuppressDefaultPressSelector = function() {
355
+ return this.suppressDefaultPressSelector;
356
+ }, e.prototype.setSuppressDefaultPressSelector = function(t) {
357
+ this.suppressDefaultPressSelector = t;
358
+ }, e.prototype.layout = function() {
359
+ var t = this;
360
+ this.animFrame.request(B.POLL_LAYOUT_CHANGE, function() {
361
+ t.layoutInternal();
362
+ });
363
+ }, e.prototype.handleClick = function(t) {
364
+ var n = this.adapter.eventTargetMatches(t.target, C.SCRIM_SELECTOR);
365
+ if (n && this.scrimClickAction !== "")
366
+ this.close(this.scrimClickAction);
367
+ else {
368
+ var o = this.adapter.getActionFromEvent(t);
369
+ o && this.close(o);
370
+ }
371
+ }, e.prototype.handleKeydown = function(t) {
372
+ var n = t.key === "Enter" || t.keyCode === 13;
373
+ if (n) {
374
+ var o = this.adapter.getActionFromEvent(t);
375
+ if (!o) {
376
+ var a = t.composedPath ? t.composedPath()[0] : t.target, f = this.suppressDefaultPressSelector ? !this.adapter.eventTargetMatches(a, this.suppressDefaultPressSelector) : !0;
377
+ n && f && this.adapter.clickDefaultButton();
378
+ }
379
+ }
380
+ }, e.prototype.handleDocumentKeydown = function(t) {
381
+ var n = t.key === "Escape" || t.keyCode === 27;
382
+ n && this.escapeKeyAction !== "" && this.close(this.escapeKeyAction);
383
+ }, e.prototype.handleScrollEvent = function() {
384
+ var t = this;
385
+ this.animFrame.request(B.POLL_SCROLL_POS, function() {
386
+ t.toggleScrollDividerHeader(), t.toggleScrollDividerFooter();
387
+ });
388
+ }, e.prototype.layoutInternal = function() {
389
+ this.autoStackButtons && this.detectStackedButtons(), this.toggleScrollableClasses();
390
+ }, e.prototype.handleAnimationTimerEnd = function() {
391
+ this.animationTimer = 0, this.adapter.removeClass(r.OPENING), this.adapter.removeClass(r.CLOSING);
392
+ }, e.prototype.runNextAnimationFrame = function(t) {
393
+ var n = this;
394
+ cancelAnimationFrame(this.animationFrame), this.animationFrame = requestAnimationFrame(function() {
395
+ n.animationFrame = 0, clearTimeout(n.animationTimer), n.animationTimer = setTimeout(t, 0);
396
+ });
397
+ }, e.prototype.detectStackedButtons = function() {
398
+ this.adapter.removeClass(r.STACKED);
399
+ var t = this.adapter.areButtonsStacked();
400
+ t && this.adapter.addClass(r.STACKED), t !== this.areButtonsStacked && (this.adapter.reverseButtons(), this.areButtonsStacked = t);
401
+ }, e.prototype.toggleScrollableClasses = function() {
402
+ this.adapter.removeClass(r.SCROLLABLE), this.adapter.isContentScrollable() && (this.adapter.addClass(r.SCROLLABLE), this.isFullscreen && (this.toggleScrollDividerHeader(), this.toggleScrollDividerFooter()));
403
+ }, e.prototype.toggleScrollDividerHeader = function() {
404
+ this.adapter.isScrollableContentAtTop() ? this.adapter.hasClass(r.SCROLL_DIVIDER_HEADER) && this.adapter.removeClass(r.SCROLL_DIVIDER_HEADER) : this.adapter.addClass(r.SCROLL_DIVIDER_HEADER);
405
+ }, e.prototype.toggleScrollDividerFooter = function() {
406
+ this.adapter.isScrollableContentAtBottom() ? this.adapter.hasClass(r.SCROLL_DIVIDER_FOOTER) && this.adapter.removeClass(r.SCROLL_DIVIDER_FOOTER) : this.adapter.addClass(r.SCROLL_DIVIDER_FOOTER);
407
+ }, e;
408
+ }(gt)
409
+ );
410
+ /**
411
+ * @license
412
+ * Copyright 2017 Google Inc.
413
+ *
414
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
415
+ * of this software and associated documentation files (the "Software"), to deal
416
+ * in the Software without restriction, including without limitation the rights
417
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
418
+ * copies of the Software, and to permit persons to whom the Software is
419
+ * furnished to do so, subject to the following conditions:
420
+ *
421
+ * The above copyright notice and this permission notice shall be included in
422
+ * all copies or substantial portions of the Software.
423
+ *
424
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
425
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
426
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
427
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
428
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
429
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
430
+ * THE SOFTWARE.
431
+ */
432
+ var u = nt.strings, Nt = (
433
+ /** @class */
434
+ function(i) {
435
+ et(e, i);
436
+ function e() {
437
+ return i !== null && i.apply(this, arguments) || this;
438
+ }
439
+ return Object.defineProperty(e.prototype, "isOpen", {
440
+ get: function() {
441
+ return this.foundation.isOpen();
442
+ },
443
+ enumerable: !1,
444
+ configurable: !0
445
+ }), Object.defineProperty(e.prototype, "escapeKeyAction", {
446
+ get: function() {
447
+ return this.foundation.getEscapeKeyAction();
448
+ },
449
+ set: function(t) {
450
+ this.foundation.setEscapeKeyAction(t);
451
+ },
452
+ enumerable: !1,
453
+ configurable: !0
454
+ }), Object.defineProperty(e.prototype, "scrimClickAction", {
455
+ get: function() {
456
+ return this.foundation.getScrimClickAction();
457
+ },
458
+ set: function(t) {
459
+ this.foundation.setScrimClickAction(t);
460
+ },
461
+ enumerable: !1,
462
+ configurable: !0
463
+ }), Object.defineProperty(e.prototype, "autoStackButtons", {
464
+ get: function() {
465
+ return this.foundation.getAutoStackButtons();
466
+ },
467
+ set: function(t) {
468
+ this.foundation.setAutoStackButtons(t);
469
+ },
470
+ enumerable: !1,
471
+ configurable: !0
472
+ }), e.attachTo = function(t) {
473
+ return new e(t);
474
+ }, e.prototype.initialize = function(t) {
475
+ var n, o;
476
+ t === void 0 && (t = function(g, _) {
477
+ return new It(g, _);
478
+ });
479
+ var a = this.root.querySelector(u.CONTAINER_SELECTOR);
480
+ if (!a)
481
+ throw new Error("Dialog component requires a " + u.CONTAINER_SELECTOR + " container element");
482
+ this.container = a, this.content = this.root.querySelector(u.CONTENT_SELECTOR), this.buttons = [].slice.call(this.root.querySelectorAll(u.BUTTON_SELECTOR)), this.defaultButton = this.root.querySelector("[" + u.BUTTON_DEFAULT_ATTRIBUTE + "]"), this.focusTrapFactory = t, this.buttonRipples = [];
483
+ try {
484
+ for (var f = Et(this.buttons), E = f.next(); !E.done; E = f.next()) {
485
+ var T = E.value;
486
+ this.buttonRipples.push(new Ct(T));
487
+ }
488
+ } catch (g) {
489
+ n = { error: g };
490
+ } finally {
491
+ try {
492
+ E && !E.done && (o = f.return) && o.call(f);
493
+ } finally {
494
+ if (n) throw n.error;
495
+ }
496
+ }
497
+ }, e.prototype.initialSyncWithDOM = function() {
498
+ var t = this;
499
+ this.focusTrap = Ot(this.container, this.focusTrapFactory, this.getInitialFocusEl() || void 0), this.handleClick = this.foundation.handleClick.bind(this.foundation), this.handleKeydown = this.foundation.handleKeydown.bind(this.foundation), this.handleDocumentKeydown = this.foundation.handleDocumentKeydown.bind(this.foundation), this.handleOpening = function() {
500
+ document.addEventListener("keydown", t.handleDocumentKeydown);
501
+ }, this.handleClosing = function() {
502
+ document.removeEventListener("keydown", t.handleDocumentKeydown);
503
+ }, this.listen("click", this.handleClick), this.listen("keydown", this.handleKeydown), this.listen(u.OPENING_EVENT, this.handleOpening), this.listen(u.CLOSING_EVENT, this.handleClosing);
504
+ }, e.prototype.destroy = function() {
505
+ this.unlisten("click", this.handleClick), this.unlisten("keydown", this.handleKeydown), this.unlisten(u.OPENING_EVENT, this.handleOpening), this.unlisten(u.CLOSING_EVENT, this.handleClosing), this.handleClosing(), this.buttonRipples.forEach(function(t) {
506
+ t.destroy();
507
+ }), i.prototype.destroy.call(this);
508
+ }, e.prototype.layout = function() {
509
+ this.foundation.layout();
510
+ }, e.prototype.open = function() {
511
+ this.foundation.open();
512
+ }, e.prototype.close = function(t) {
513
+ t === void 0 && (t = ""), this.foundation.close(t);
514
+ }, e.prototype.getDefaultFoundation = function() {
515
+ var t = this, n = {
516
+ addBodyClass: function(o) {
517
+ return document.body.classList.add(o);
518
+ },
519
+ addClass: function(o) {
520
+ return t.root.classList.add(o);
521
+ },
522
+ areButtonsStacked: function() {
523
+ return Dt(t.buttons);
524
+ },
525
+ clickDefaultButton: function() {
526
+ t.defaultButton && t.defaultButton.click();
527
+ },
528
+ eventTargetMatches: function(o, a) {
529
+ return o ? vt(o, a) : !1;
530
+ },
531
+ getActionFromEvent: function(o) {
532
+ if (!o.target)
533
+ return "";
534
+ var a = St(o.target, "[" + u.ACTION_ATTRIBUTE + "]");
535
+ return a && a.getAttribute(u.ACTION_ATTRIBUTE);
536
+ },
537
+ getInitialFocusEl: function() {
538
+ return t.getInitialFocusEl();
539
+ },
540
+ hasClass: function(o) {
541
+ return t.root.classList.contains(o);
542
+ },
543
+ isContentScrollable: function() {
544
+ return Tt(t.content);
545
+ },
546
+ notifyClosed: function(o) {
547
+ return t.emit(u.CLOSED_EVENT, o ? { action: o } : {});
548
+ },
549
+ notifyClosing: function(o) {
550
+ return t.emit(u.CLOSING_EVENT, o ? { action: o } : {});
551
+ },
552
+ notifyOpened: function() {
553
+ return t.emit(u.OPENED_EVENT, {});
554
+ },
555
+ notifyOpening: function() {
556
+ return t.emit(u.OPENING_EVENT, {});
557
+ },
558
+ releaseFocus: function() {
559
+ t.focusTrap.releaseFocus();
560
+ },
561
+ removeBodyClass: function(o) {
562
+ return document.body.classList.remove(o);
563
+ },
564
+ removeClass: function(o) {
565
+ return t.root.classList.remove(o);
566
+ },
567
+ reverseButtons: function() {
568
+ t.buttons.reverse(), t.buttons.forEach(function(o) {
569
+ o.parentElement.appendChild(o);
570
+ });
571
+ },
572
+ trapFocus: function() {
573
+ t.focusTrap.trapFocus();
574
+ },
575
+ registerContentEventHandler: function(o, a) {
576
+ t.content instanceof HTMLElement && t.content.addEventListener(o, a);
577
+ },
578
+ deregisterContentEventHandler: function(o, a) {
579
+ t.content instanceof HTMLElement && t.content.removeEventListener(o, a);
580
+ },
581
+ isScrollableContentAtTop: function() {
582
+ return At(t.content);
583
+ },
584
+ isScrollableContentAtBottom: function() {
585
+ return bt(t.content);
586
+ },
587
+ registerWindowEventHandler: function(o, a) {
588
+ window.addEventListener(o, a);
589
+ },
590
+ deregisterWindowEventHandler: function(o, a) {
591
+ window.removeEventListener(o, a);
592
+ }
593
+ };
594
+ return new nt(n);
595
+ }, e.prototype.getInitialFocusEl = function() {
596
+ return this.root.querySelector("[" + u.INITIAL_FOCUS_ATTRIBUTE + "]");
597
+ }, e;
598
+ }(_t)
599
+ );
600
+ const Lt = {
601
+ /**
602
+ * An action button that will not automatically trigger a dismiss or accept. It is meant to be used only in certain circumstances where more control of the modal is required such as validating forms. If primaryButton is sent with actionButton, actionButton will be ignored.
603
+ *
604
+ * Defaults to **null**.
605
+ */
606
+ actionButton: s.node,
607
+ /**
608
+ * Button for any navigating to the previous page in a Directional modal.
609
+ *
610
+ * Defaults to **null**.
611
+ */
612
+ backButton: s.node,
613
+ /**
614
+ * The custom modal label badge to be rendered.
615
+ *
616
+ * Defaults to **undefined**.
617
+ */
618
+ badge: s.node,
619
+ /**
620
+ * Accepts any valid markup. Optionally, `content` may be used instead. If `content` and `children` are both set, `content` will take priority.
621
+ *
622
+ * Defaults to **null**.
623
+ */
624
+ children: s.node,
625
+ /**
626
+ * Primary content of the dialog. Accepts any valid markup. Optionally, `children` may be used instead. If content and `children` are both set, content will take priority.
627
+ *
628
+ * Defaults to **null**.
629
+ */
630
+ content: s.node,
631
+ /**
632
+ * Button that is the default action, triggered by pressing the Enter key.
633
+ *
634
+ * Defaults to **'primary'**.
635
+ */
636
+ defaultButton: s.oneOf(["close", "primary", "action", "footerSupplemental"]),
637
+ /**
638
+ * Button to cancel or close the modal.
639
+ *
640
+ * Defaults to **null**.
641
+ */
642
+ dismissiveButton: s.node,
643
+ /**
644
+ * Button to be displayed in left corner of the modal footer. Should be a text button.
645
+ *
646
+ * Defaults to **null**.
647
+ */
648
+ footerSupplemental: s.node,
649
+ /**
650
+ * Content to be displayed in right corner of the modal header. Should be a text button or a group of up to 3 icon buttons.
651
+ *
652
+ * Defaults to **null**.
653
+ */
654
+ headerActions: s.node,
655
+ /**
656
+ * If true, the close icon in the upper left corner will not be rendered.
657
+ *
658
+ * Defaults to **false**.
659
+ */
660
+ hideCloseIcon: s.bool,
661
+ /**
662
+ * A slot for StepperIndicator.
663
+ *
664
+ * Defaults to **null**.
665
+ */
666
+ indicator: s.node,
667
+ /**
668
+ * Button to initially focus on after the dialog has opened. If left null, the initial focus will be on the first focusable element in the modal. As an alternative you can add `data-mdc-dialog-initial-focus` to any element within the modal to make that element the initial focus. If it is a directional modal, the initial focus will be on the nextButton.
669
+ *
670
+ * Defaults to **null**.
671
+ */
672
+ initialFocus: s.oneOf(["null", "primary", "action", "footerSupplemental"]),
673
+ /**
674
+ * If true, the buttons in the footer will be full width and stacked on mobile.
675
+ *
676
+ * Defaults to **false**.
677
+ */
678
+ mobileStackedButtons: s.bool,
679
+ /**
680
+ * String to determine the size of the modal.
681
+ *
682
+ * Defaults to **'max'**.
683
+ */
684
+ modalSize: s.oneOf(["fullscreen", "max", "xlarge", "large", "medium", "small", "dialog"]),
685
+ /**
686
+ * Button for navigating to the next page in a Directional modal or closing on the last page.
687
+ *
688
+ * Defaults to **null**.
689
+ */
690
+ nextButton: s.node,
691
+ /**
692
+ * Set to true if the modal will not have any actions. Should be used sparingly and the modal should be closed programmatically. For example, can be used to stop the user from interacting or navigating away while a payment is processing.
693
+ *
694
+ * Defaults to **null**.
695
+ */
696
+ noActions: s.bool,
697
+ /**
698
+ * Fired when the Dialog begins its closing animation. Where event.detail.action is the action which closed the dialog (close or accept).
699
+ *
700
+ * Defaults to **null**.
701
+ */
702
+ onClose: s.func,
703
+ /**
704
+ * Fired when the Dialog finishes its closing animation. Where event.detail.action is the action which closed the dialog (close or accept).
705
+ *
706
+ * Defaults to **null**.
707
+ */
708
+ onClosed: s.func,
709
+ /**
710
+ * Fired when the Dialog begins its opening animation.
711
+ *
712
+ * Defaults to **null**.
713
+ */
714
+ onOpen: s.func,
715
+ /**
716
+ * Fired when the Dialog finishes its opening animation.
717
+ *
718
+ * Defaults to **null**.
719
+ */
720
+ onOpened: s.func,
721
+ /**
722
+ * If true, the Modal will be visible on screen.
723
+ *
724
+ * Defaults to **false**.
725
+ */
726
+ open: s.bool,
727
+ /**
728
+ * Prevents the user from closing the dialog by hitting escape or clicking the scrim. Use caution when using this as the modal should always have a way for the user to close it.
729
+ *
730
+ * Defaults to **false**.
731
+ */
732
+ preventClose: s.bool,
733
+ /**
734
+ * Prevents the default behavior which adds an event listener for the Enter key to the Primary button. Any onEnter/submission behavior will need to be added by the developer (including closing the Modal).
735
+ *
736
+ * Defaults to **false**.
737
+ */
738
+ preventPrimaryAccept: s.bool,
739
+ /**
740
+ * Button for the primary action of the modal.
741
+ *
742
+ * Defaults to **null**.
743
+ */
744
+ primaryButton: s.node,
745
+ /**
746
+ * DOM selector to provide a target to return focus. Accepts any valid _query_ (see mdn docs for Element.querySelector). If omitted focus will return to the last focused element upon closing.
747
+ *
748
+ * Defaults to **null**.
749
+ */
750
+ returnFocusSelector: s.string,
751
+ /**
752
+ * If true, wrapping will be disabled and a scrollable area will be created.
753
+ *
754
+ * Defaults to **false**.
755
+ */
756
+ scrollable: s.bool,
757
+ /**
758
+ * String for the modal title.
759
+ *
760
+ * Defaults to **null**.
761
+ */
762
+ title: s.string
763
+ }, Ft = {
764
+ actionButton: null,
765
+ backButton: null,
766
+ badge: void 0,
767
+ children: null,
768
+ content: null,
769
+ defaultButton: "primary",
770
+ dismissiveButton: null,
771
+ footerSupplemental: null,
772
+ headerActions: null,
773
+ hideCloseIcon: !1,
774
+ indicator: null,
775
+ initialFocus: null,
776
+ mobileStackedButtons: !1,
777
+ modalSize: "max",
778
+ nextButton: null,
779
+ noActions: null,
780
+ open: !1,
781
+ preventClose: !1,
782
+ preventPrimaryAccept: !1,
783
+ primaryButton: null,
784
+ returnFocusSelector: null,
785
+ scrollable: !1,
786
+ title: null
787
+ }, w = /* @__PURE__ */ ut((i, e) => {
788
+ const {
789
+ actionButton: t,
790
+ actionIcons: n,
791
+ badge: o,
792
+ backButton: a,
793
+ children: f,
794
+ className: E,
795
+ content: T,
796
+ defaultButton: g,
797
+ dismissiveButton: _,
798
+ footerSupplemental: A,
799
+ headerActions: q,
800
+ hideCloseIcon: M,
801
+ indicator: ot,
802
+ initialFocus: S,
803
+ mobileStackedButtons: k,
804
+ modalSize: p,
805
+ nextButton: v,
806
+ noActions: y,
807
+ onClose: H,
808
+ onClosed: P,
809
+ onOpen: b,
810
+ onOpened: D,
811
+ open: j,
812
+ preventClose: U,
813
+ preventPrimaryAccept: Y,
814
+ primaryButton: c,
815
+ returnFocusSelector: x,
816
+ scrollable: $,
817
+ title: J,
818
+ ...it
819
+ } = i, I = Q(), l = Q();
820
+ mt(e, () => I.current, []);
821
+ const [K, at] = X(), [G, rt] = X(() => v || a);
822
+ h(() => {
823
+ rt(v || a);
824
+ }, [v, a]);
825
+ const N = V(() => {
826
+ at(window.innerWidth <= 600);
827
+ }, []);
828
+ h(() => (N(), window.addEventListener("resize", N), () => {
829
+ window.removeEventListener("resize", N);
830
+ }), [N]), h(() => (l.current = Nt.attachTo(I.current), () => {
831
+ l.current.destroy();
832
+ }), [l, I]), h(() => {
833
+ l.current.foundation.setAutoStackButtons(k);
834
+ }, [k]), h(() => {
835
+ y && (l.current.foundation.adapter.trapFocus = () => {
836
+ });
837
+ }, [y]), h(() => {
838
+ l.current.scrimClickAction = U ? "" : "close", l.current.escapeKeyAction = U ? "" : "close";
839
+ }, [U]);
840
+ const L = V((m) => {
841
+ H && H(m);
842
+ }, [H]), F = V((m) => {
843
+ x && pt(x), P && P(m);
844
+ }, [x, P]);
845
+ h(() => (l.current.unlisten("MDCDialog: opening", b), l.current.listen("MDCDialog: opening", b), () => {
846
+ l.current.unlisten("MDCDialog: opening", b);
847
+ }), [l, b]), h(() => (l.current.unlisten("MDCDialog:opened", D), l.current.listen("MDCDialog:opened", D), () => {
848
+ l.current.unlisten("MDCDialog:opened", D);
849
+ }), [l, D]), h(() => (l.current.unlisten("MDCDialog:closing", L), l.current.listen("MDCDialog:closing", L), () => {
850
+ l.current.unlisten("MDCDialog:closing", L);
851
+ }), [l, L]), h(() => (l.current.unlisten("MDCDialog:closed", F), l.current.listen("MDCDialog:closed", F), () => {
852
+ l.current.unlisten("MDCDialog:closed", F);
853
+ }), [l, F]), h(() => {
854
+ j ? l.current.open() : l.current.close();
855
+ }, [l, j]);
856
+ const st = Z(() => () => {
857
+ const m = {
858
+ className: "lmnt-modal__button mdc-dialog__button",
859
+ elevation: t?.props.elevation !== "default" ? t?.props.elevation : "flat",
860
+ variant: t?.props.variant || "filled"
861
+ };
862
+ return g === "action" && (m["data-mdc-dialog-button-default"] = !0), S === "action" && (m["data-mdc-dialog-initial-focus"] = !0), m;
863
+ }, [t?.props.elevation, t?.props.variant, g, S]), lt = Z(() => () => {
864
+ const m = {
865
+ className: "lmnt-modal__button mdc-dialog__button",
866
+ "data-mdc-dialog-action": Y ? "" : "accept",
867
+ elevation: c?.props.elevation !== "default" ? c?.props.elevation : "flat",
868
+ variant: c?.props.variant || "filled"
869
+ };
870
+ return g === "primary" && (m["data-mdc-dialog-button-default"] = !0), S === "primary" && (m["data-mdc-dialog-initial-focus"] = !0), m;
871
+ }, [Y, g, S, c?.props.elevation, c?.props.variant]);
872
+ return /* @__PURE__ */ d.createElement("aside", dt({
873
+ ref: I,
874
+ className: R("lmnt", "lmnt-modal", "mdc-dialog", $ && "lmnt-modal--scrollable mdc-dialog--scrollable", E),
875
+ role: "alertdialog"
876
+ }, it), /* @__PURE__ */ d.createElement("div", {
877
+ className: R("lmnt-modal__container", "mdc-dialog__container", p === "fullscreen" && "mdc-dialog--fullscreen", p === "max" && "lmnt-modal__max", p === "xlarge" && "lmnt-modal__xl", p === "large" && "lmnt-modal__lg", p === "medium" && "lmnt-modal__md", p === "small" && "lmnt-modal__sm", (p === "mobile" || K) && "lmnt-modal__mobile", p === "dialog" && "lmnt-modal__dialog", y && "lmnt-modal-no-actions")
878
+ }, /* @__PURE__ */ d.createElement("div", {
879
+ className: "lmnt-modal__surface mdc-dialog__surface"
880
+ }, /* @__PURE__ */ d.createElement("header", {
881
+ className: R("lmnt-modal__title", "mdc-dialog__title", (p === "dialog" || M) && "lmnt-modal_title-hide-close-icon", n && "lmnt-modal_title-actionsIcons", $ && "lmnt-modal__title-scrollable", (M || p === "dialog" || y) && "lmnt-modal--no-close-icon")
882
+ }, !M && p !== "dialog" && !y && /* @__PURE__ */ d.createElement(ft, {
883
+ className: "mdc-icon-button material-icons mdc-dialog__close",
884
+ "data-mdc-dialog-action": "close",
885
+ icon: "clear"
886
+ }), J && /* @__PURE__ */ d.createElement("div", null, J), q && /* @__PURE__ */ d.createElement("div", {
887
+ className: "lmnt-dialog__title-actions"
888
+ }, q), o && /* @__PURE__ */ d.createElement("div", {
889
+ className: "lmnt-badge--modal",
890
+ style: {
891
+ marginLeft: "0"
892
+ }
893
+ }, o)), (T || f) && /* @__PURE__ */ d.createElement("section", {
894
+ className: "lmnt-modal__content mdc-dialog__content"
895
+ }, T || f), ot, (t || a || _ || v || c || A) && /* @__PURE__ */ d.createElement("footer", {
896
+ className: R("lmnt-modal__actions", "mdc-dialog__actions", K && "lmnt-dialog__actions__mobile", A && "lmnt-modal__actions--supplemental-btn", K && k && "lmnt-modal_actions-mobile-stacked")
897
+ }, !G && A && /* @__PURE__ */ d.createElement("div", {
898
+ className: "lmnt-dialog__actions__supplemental"
899
+ }, O(A, () => {
900
+ const m = {};
901
+ return g === "footerSupplemental" && (m["data-mdc-dialog-button-default"] = !0), S === "footerSupplemental" && (m["data-mdc-dialog-initial-focus"] = !0), m;
902
+ })), !G && (t || _ || c) && /* @__PURE__ */ d.createElement("div", {
903
+ className: "lmnt-dialog__actions__right-align lmnt-modal_actions_button"
904
+ }, _ && O(_, {
905
+ variant: "text",
906
+ className: "lmnt-modal__button mdc-dialog__button",
907
+ "data-mdc-dialog-action": "close"
908
+ }), t && !c && O(t, st), c && O(c, lt)), G && /* @__PURE__ */ d.createElement("div", {
909
+ className: "lmnt-modal_actions_button lmnt-dialog__actions__directional"
910
+ }, /* @__PURE__ */ d.createElement("div", null, ht(a, "lmnt-modal__button")), /* @__PURE__ */ d.createElement("div", null, O(v, {
911
+ className: "lmnt-modal__button",
912
+ "data-mdc-dialog-initial-focus": !0
913
+ })))))), /* @__PURE__ */ d.createElement("div", {
914
+ className: "mdc-dialog__scrim"
915
+ }));
916
+ });
917
+ w.displayName = "Modal";
918
+ w.propTypes = Lt;
919
+ w.defaultProps = Ft;
920
+ const Rt = "_modal_a4n3a_1", Bt = {
921
+ modal: Rt
922
+ }, Vt = (i) => /* @__PURE__ */ ct(
923
+ w,
7
924
  {
8
- ...a,
925
+ ...i,
9
926
  "data-testid": "modal",
10
- className: `${a.className ?? ""} ${a.modalSize === "fullscreen" ? d.modal : ""}`
927
+ className: `${i.className ?? ""} ${i.modalSize === "fullscreen" ? Bt.modal : ""}`
11
928
  }
12
929
  );
13
930
  export {
14
- e as Modal
931
+ Vt as Modal
15
932
  };