hplx-feature-library 1.0.60 → 1.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Attachments/Attachments.d.ts +25 -0
- package/dist/Attachments/components/AttachmentPreviewPopup.d.ts +2 -0
- package/dist/Attachments/components/ImagePreview.d.ts +4 -0
- package/dist/Attachments/components/VideoPreview.d.ts +4 -0
- package/dist/Attachments/components/attachments-header.d.ts +11 -0
- package/dist/Attachments/components/compare-mode-bar.d.ts +3 -0
- package/dist/Attachments/components/document-canvas/KonvaDrawingCanvas.d.ts +7 -0
- package/dist/Attachments/components/document-canvas/document-color-options.d.ts +2 -0
- package/dist/Attachments/components/document-canvas/document-pen-tool.d.ts +2 -0
- package/dist/Attachments/components/document-canvas/document-tool-shape.d.ts +2 -0
- package/dist/Attachments/components/document-canvas/index.d.ts +7 -0
- package/dist/Attachments/components/document-compare/document-compare-header.d.ts +7 -0
- package/dist/Attachments/components/document-compare/document-compare-images.d.ts +5 -0
- package/dist/Attachments/components/document-compare/index.d.ts +2 -0
- package/dist/Attachments/components/document-container.d.ts +10 -0
- package/dist/Attachments/components/document-image-view.d.ts +7 -0
- package/dist/Attachments/components/document-preview/document-image-pane.d.ts +8 -0
- package/dist/Attachments/components/document-preview/index.d.ts +2 -0
- package/dist/Attachments/components/document-preview/preview-side-pane.d.ts +10 -0
- package/dist/Attachments/components/document-view/document-view-grid.d.ts +10 -0
- package/dist/Attachments/components/document-view/documet-view-date.d.ts +10 -0
- package/dist/Attachments/components/drag-drop-container.d.ts +9 -0
- package/dist/Attachments/components/drag-drop-overlay.d.ts +6 -0
- package/dist/Attachments/components/edit-document-modal.d.ts +9 -0
- package/dist/Attachments/components/more-dropdown.d.ts +10 -0
- package/dist/Attachments/constants/index.d.ts +15 -0
- package/dist/Attachments/context/index.d.ts +3 -0
- package/dist/Attachments/hooks/useAttachmentContext.d.ts +2 -0
- package/dist/Attachments/hooks/useCompareContext.d.ts +2 -0
- package/dist/Attachments/hooks/useDragAndDrop.d.ts +16 -0
- package/dist/Attachments/hooks/useDropdownPosition.d.ts +15 -0
- package/dist/Attachments/index.d.ts +1 -0
- package/dist/Attachments/index.js +24966 -0
- package/dist/Attachments/store/document-store.d.ts +19 -0
- package/dist/Attachments/store/pen-tools.store.d.ts +14 -0
- package/dist/Attachments/utils/fileValidation.d.ts +15 -0
- package/dist/Attachments/utils/index.d.ts +4 -0
- package/dist/CameraCapture/index.d.ts +7 -0
- package/dist/CameraCapture/utils/index.d.ts +2 -0
- package/dist/CustomDropdown-D9OCNP2e.js +1351 -0
- package/dist/CustomDropdown-DC-Kvy1B.cjs +40 -0
- package/dist/PediatricsCalculator/index.js +52 -51
- package/dist/common/components/CustomLoader/index.d.ts +2 -0
- package/dist/common/components/HxSvgIcons/index.d.ts +9 -0
- package/dist/common/components/ReusableModal/ReusableModal.d.ts +13 -0
- package/dist/common/hooks/useInfiniteScroll.d.ts +7 -0
- package/dist/constants/AttachmentConstants/index.js +35 -0
- package/dist/hplx-feature-library.css +1 -1
- package/dist/index-B1oZkAWG.cjs +84 -0
- package/dist/index-BCqhiZf4.js +6672 -0
- package/dist/index.js +1 -1
- package/dist/types/AttachmentTypes/index.js +9 -0
- package/dist/types/AttachmentsTypes.d.ts +119 -0
- package/package.json +30 -6
- package/dist/CustomDropdown-C_Z0fEsd.cjs +0 -124
- package/dist/CustomDropdown-Di-tVTdd.js +0 -10640
|
@@ -0,0 +1,1351 @@
|
|
|
1
|
+
import { r as $e, a as rt, g as at, j as C, P as Ce, Y as we, b as lt, M as st } from "./index-BCqhiZf4.js";
|
|
2
|
+
import Be, { useEffect as fe, useCallback as ue, useState as be, useRef as re, useMemo as it } from "react";
|
|
3
|
+
import ut from "react-dom";
|
|
4
|
+
var ae = { exports: {} }, V = {}, le = { exports: {} }, q = {}, se = { exports: {} }, Te;
|
|
5
|
+
function ze() {
|
|
6
|
+
return Te || (Te = 1, function(f, o) {
|
|
7
|
+
Object.defineProperty(o, "__esModule", {
|
|
8
|
+
value: !0
|
|
9
|
+
}), o.default = i;
|
|
10
|
+
/*!
|
|
11
|
+
* Adapted from jQuery UI core
|
|
12
|
+
*
|
|
13
|
+
* http://jqueryui.com
|
|
14
|
+
*
|
|
15
|
+
* Copyright 2014 jQuery Foundation and other contributors
|
|
16
|
+
* Released under the MIT license.
|
|
17
|
+
* http://jquery.org/license
|
|
18
|
+
*
|
|
19
|
+
* http://api.jqueryui.com/category/ui-core/
|
|
20
|
+
*/
|
|
21
|
+
var d = "none", a = "contents", s = /^(input|select|textarea|button|object|iframe)$/;
|
|
22
|
+
function p(n, u) {
|
|
23
|
+
return u.getPropertyValue("overflow") !== "visible" || // if 'overflow: visible' set, check if there is actually any overflow
|
|
24
|
+
n.scrollWidth <= 0 && n.scrollHeight <= 0;
|
|
25
|
+
}
|
|
26
|
+
function g(n) {
|
|
27
|
+
var u = n.offsetWidth <= 0 && n.offsetHeight <= 0;
|
|
28
|
+
if (u && !n.innerHTML) return !0;
|
|
29
|
+
try {
|
|
30
|
+
var c = window.getComputedStyle(n), y = c.getPropertyValue("display");
|
|
31
|
+
return u ? y !== a && p(n, c) : y === d;
|
|
32
|
+
} catch {
|
|
33
|
+
return console.warn("Failed to inspect element style"), !1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function e(n) {
|
|
37
|
+
for (var u = n, c = n.getRootNode && n.getRootNode(); u && u !== document.body; ) {
|
|
38
|
+
if (c && u === c && (u = c.host.parentNode), g(u)) return !1;
|
|
39
|
+
u = u.parentNode;
|
|
40
|
+
}
|
|
41
|
+
return !0;
|
|
42
|
+
}
|
|
43
|
+
function O(n, u) {
|
|
44
|
+
var c = n.nodeName.toLowerCase(), y = s.test(c) && !n.disabled || c === "a" && n.href || u;
|
|
45
|
+
return y && e(n);
|
|
46
|
+
}
|
|
47
|
+
function h(n) {
|
|
48
|
+
var u = n.getAttribute("tabindex");
|
|
49
|
+
u === null && (u = void 0);
|
|
50
|
+
var c = isNaN(u);
|
|
51
|
+
return (c || u >= 0) && O(n, !c);
|
|
52
|
+
}
|
|
53
|
+
function i(n) {
|
|
54
|
+
var u = [].slice.call(n.querySelectorAll("*"), 0).reduce(function(c, y) {
|
|
55
|
+
return c.concat(y.shadowRoot ? i(y.shadowRoot) : [y]);
|
|
56
|
+
}, []);
|
|
57
|
+
return u.filter(h);
|
|
58
|
+
}
|
|
59
|
+
f.exports = o.default;
|
|
60
|
+
}(se, se.exports)), se.exports;
|
|
61
|
+
}
|
|
62
|
+
var De;
|
|
63
|
+
function ft() {
|
|
64
|
+
if (De) return q;
|
|
65
|
+
De = 1, Object.defineProperty(q, "__esModule", {
|
|
66
|
+
value: !0
|
|
67
|
+
}), q.resetState = g, q.log = e, q.handleBlur = O, q.handleFocus = h, q.markForFocusLater = i, q.returnFocus = n, q.popWithoutFocus = u, q.setupScopedFocus = c, q.teardownScopedFocus = y;
|
|
68
|
+
var f = ze(), o = d(f);
|
|
69
|
+
function d(E) {
|
|
70
|
+
return E && E.__esModule ? E : { default: E };
|
|
71
|
+
}
|
|
72
|
+
var a = [], s = null, p = !1;
|
|
73
|
+
function g() {
|
|
74
|
+
a = [];
|
|
75
|
+
}
|
|
76
|
+
function e() {
|
|
77
|
+
process.env.NODE_ENV !== "production" && (console.log("focusManager ----------"), a.forEach(function(E) {
|
|
78
|
+
var M = E || {};
|
|
79
|
+
console.log(M.nodeName, M.className, M.id);
|
|
80
|
+
}), console.log("end focusManager ----------"));
|
|
81
|
+
}
|
|
82
|
+
function O() {
|
|
83
|
+
p = !0;
|
|
84
|
+
}
|
|
85
|
+
function h() {
|
|
86
|
+
if (p) {
|
|
87
|
+
if (p = !1, !s)
|
|
88
|
+
return;
|
|
89
|
+
setTimeout(function() {
|
|
90
|
+
if (!s.contains(document.activeElement)) {
|
|
91
|
+
var E = (0, o.default)(s)[0] || s;
|
|
92
|
+
E.focus();
|
|
93
|
+
}
|
|
94
|
+
}, 0);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function i() {
|
|
98
|
+
a.push(document.activeElement);
|
|
99
|
+
}
|
|
100
|
+
function n() {
|
|
101
|
+
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, M = null;
|
|
102
|
+
try {
|
|
103
|
+
a.length !== 0 && (M = a.pop(), M.focus({ preventScroll: E }));
|
|
104
|
+
return;
|
|
105
|
+
} catch {
|
|
106
|
+
console.warn(["You tried to return focus to", M, "but it is not in the DOM anymore"].join(" "));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function u() {
|
|
110
|
+
a.length > 0 && a.pop();
|
|
111
|
+
}
|
|
112
|
+
function c(E) {
|
|
113
|
+
s = E, window.addEventListener ? (window.addEventListener("blur", O, !1), document.addEventListener("focus", h, !0)) : (window.attachEvent("onBlur", O), document.attachEvent("onFocus", h));
|
|
114
|
+
}
|
|
115
|
+
function y() {
|
|
116
|
+
s = null, window.addEventListener ? (window.removeEventListener("blur", O), document.removeEventListener("focus", h)) : (window.detachEvent("onBlur", O), document.detachEvent("onFocus", h));
|
|
117
|
+
}
|
|
118
|
+
return q;
|
|
119
|
+
}
|
|
120
|
+
var ie = { exports: {} }, Pe;
|
|
121
|
+
function ct() {
|
|
122
|
+
return Pe || (Pe = 1, function(f, o) {
|
|
123
|
+
Object.defineProperty(o, "__esModule", {
|
|
124
|
+
value: !0
|
|
125
|
+
}), o.default = g;
|
|
126
|
+
var d = ze(), a = s(d);
|
|
127
|
+
function s(e) {
|
|
128
|
+
return e && e.__esModule ? e : { default: e };
|
|
129
|
+
}
|
|
130
|
+
function p() {
|
|
131
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
|
|
132
|
+
return e.activeElement.shadowRoot ? p(e.activeElement.shadowRoot) : e.activeElement;
|
|
133
|
+
}
|
|
134
|
+
function g(e, O) {
|
|
135
|
+
var h = (0, a.default)(e);
|
|
136
|
+
if (!h.length) {
|
|
137
|
+
O.preventDefault();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
var i = void 0, n = O.shiftKey, u = h[0], c = h[h.length - 1], y = p();
|
|
141
|
+
if (e === y) {
|
|
142
|
+
if (!n) return;
|
|
143
|
+
i = c;
|
|
144
|
+
}
|
|
145
|
+
if (c === y && !n && (i = u), u === y && n && (i = c), i) {
|
|
146
|
+
O.preventDefault(), i.focus();
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
var E = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent), M = E != null && E[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null;
|
|
150
|
+
if (M) {
|
|
151
|
+
var T = h.indexOf(y);
|
|
152
|
+
if (T > -1 && (T += n ? -1 : 1), i = h[T], typeof i > "u") {
|
|
153
|
+
O.preventDefault(), i = n ? c : u, i.focus();
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
O.preventDefault(), i.focus();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
f.exports = o.default;
|
|
160
|
+
}(ie, ie.exports)), ie.exports;
|
|
161
|
+
}
|
|
162
|
+
var k = {}, ge, Ae;
|
|
163
|
+
function dt() {
|
|
164
|
+
if (Ae) return ge;
|
|
165
|
+
Ae = 1;
|
|
166
|
+
var f = process.env.NODE_ENV !== "production", o = function() {
|
|
167
|
+
};
|
|
168
|
+
if (f) {
|
|
169
|
+
var d = function(s, p) {
|
|
170
|
+
var g = arguments.length;
|
|
171
|
+
p = new Array(g > 1 ? g - 1 : 0);
|
|
172
|
+
for (var e = 1; e < g; e++)
|
|
173
|
+
p[e - 1] = arguments[e];
|
|
174
|
+
var O = 0, h = "Warning: " + s.replace(/%s/g, function() {
|
|
175
|
+
return p[O++];
|
|
176
|
+
});
|
|
177
|
+
typeof console < "u" && console.error(h);
|
|
178
|
+
try {
|
|
179
|
+
throw new Error(h);
|
|
180
|
+
} catch {
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
o = function(a, s, p) {
|
|
184
|
+
var g = arguments.length;
|
|
185
|
+
p = new Array(g > 2 ? g - 2 : 0);
|
|
186
|
+
for (var e = 2; e < g; e++)
|
|
187
|
+
p[e - 2] = arguments[e];
|
|
188
|
+
if (s === void 0)
|
|
189
|
+
throw new Error(
|
|
190
|
+
"`warning(condition, format, ...args)` requires a warning message argument"
|
|
191
|
+
);
|
|
192
|
+
a || d.apply(null, [s].concat(p));
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
return ge = o, ge;
|
|
196
|
+
}
|
|
197
|
+
var $ = {}, Oe = { exports: {} };
|
|
198
|
+
/*!
|
|
199
|
+
Copyright (c) 2015 Jed Watson.
|
|
200
|
+
Based on code that is Copyright 2013-2015, Facebook, Inc.
|
|
201
|
+
All rights reserved.
|
|
202
|
+
*/
|
|
203
|
+
var Le;
|
|
204
|
+
function pt() {
|
|
205
|
+
return Le || (Le = 1, function(f) {
|
|
206
|
+
(function() {
|
|
207
|
+
var o = !!(typeof window < "u" && window.document && window.document.createElement), d = {
|
|
208
|
+
canUseDOM: o,
|
|
209
|
+
canUseWorkers: typeof Worker < "u",
|
|
210
|
+
canUseEventListeners: o && !!(window.addEventListener || window.attachEvent),
|
|
211
|
+
canUseViewport: o && !!window.screen
|
|
212
|
+
};
|
|
213
|
+
f.exports ? f.exports = d : window.ExecutionEnvironment = d;
|
|
214
|
+
})();
|
|
215
|
+
}(Oe)), Oe.exports;
|
|
216
|
+
}
|
|
217
|
+
var Fe;
|
|
218
|
+
function xe() {
|
|
219
|
+
if (Fe) return $;
|
|
220
|
+
Fe = 1, Object.defineProperty($, "__esModule", {
|
|
221
|
+
value: !0
|
|
222
|
+
}), $.canUseDOM = $.SafeNodeList = $.SafeHTMLCollection = void 0;
|
|
223
|
+
var f = pt(), o = d(f);
|
|
224
|
+
function d(p) {
|
|
225
|
+
return p && p.__esModule ? p : { default: p };
|
|
226
|
+
}
|
|
227
|
+
var a = o.default, s = a.canUseDOM ? window.HTMLElement : {};
|
|
228
|
+
return $.SafeHTMLCollection = a.canUseDOM ? window.HTMLCollection : {}, $.SafeNodeList = a.canUseDOM ? window.NodeList : {}, $.canUseDOM = a.canUseDOM, $.default = s, $;
|
|
229
|
+
}
|
|
230
|
+
var qe;
|
|
231
|
+
function Ve() {
|
|
232
|
+
if (qe) return k;
|
|
233
|
+
qe = 1, Object.defineProperty(k, "__esModule", {
|
|
234
|
+
value: !0
|
|
235
|
+
}), k.resetState = p, k.log = g, k.assertNodeList = e, k.setElement = O, k.validateElement = h, k.hide = i, k.show = n, k.documentNotReadyOrSSRTesting = u;
|
|
236
|
+
var f = dt(), o = a(f), d = xe();
|
|
237
|
+
function a(c) {
|
|
238
|
+
return c && c.__esModule ? c : { default: c };
|
|
239
|
+
}
|
|
240
|
+
var s = null;
|
|
241
|
+
function p() {
|
|
242
|
+
s && (s.removeAttribute ? s.removeAttribute("aria-hidden") : s.length != null ? s.forEach(function(c) {
|
|
243
|
+
return c.removeAttribute("aria-hidden");
|
|
244
|
+
}) : document.querySelectorAll(s).forEach(function(c) {
|
|
245
|
+
return c.removeAttribute("aria-hidden");
|
|
246
|
+
})), s = null;
|
|
247
|
+
}
|
|
248
|
+
function g() {
|
|
249
|
+
if (process.env.NODE_ENV !== "production") {
|
|
250
|
+
var c = s || {};
|
|
251
|
+
console.log("ariaAppHider ----------"), console.log(c.nodeName, c.className, c.id), console.log("end ariaAppHider ----------");
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function e(c, y) {
|
|
255
|
+
if (!c || !c.length)
|
|
256
|
+
throw new Error("react-modal: No elements were found for selector " + y + ".");
|
|
257
|
+
}
|
|
258
|
+
function O(c) {
|
|
259
|
+
var y = c;
|
|
260
|
+
if (typeof y == "string" && d.canUseDOM) {
|
|
261
|
+
var E = document.querySelectorAll(y);
|
|
262
|
+
e(E, y), y = E;
|
|
263
|
+
}
|
|
264
|
+
return s = y || s, s;
|
|
265
|
+
}
|
|
266
|
+
function h(c) {
|
|
267
|
+
var y = c || s;
|
|
268
|
+
return y ? Array.isArray(y) || y instanceof HTMLCollection || y instanceof NodeList ? y : [y] : ((0, o.default)(!1, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" ")), []);
|
|
269
|
+
}
|
|
270
|
+
function i(c) {
|
|
271
|
+
var y = !0, E = !1, M = void 0;
|
|
272
|
+
try {
|
|
273
|
+
for (var T = h(c)[Symbol.iterator](), A; !(y = (A = T.next()).done); y = !0) {
|
|
274
|
+
var W = A.value;
|
|
275
|
+
W.setAttribute("aria-hidden", "true");
|
|
276
|
+
}
|
|
277
|
+
} catch (H) {
|
|
278
|
+
E = !0, M = H;
|
|
279
|
+
} finally {
|
|
280
|
+
try {
|
|
281
|
+
!y && T.return && T.return();
|
|
282
|
+
} finally {
|
|
283
|
+
if (E)
|
|
284
|
+
throw M;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
function n(c) {
|
|
289
|
+
var y = !0, E = !1, M = void 0;
|
|
290
|
+
try {
|
|
291
|
+
for (var T = h(c)[Symbol.iterator](), A; !(y = (A = T.next()).done); y = !0) {
|
|
292
|
+
var W = A.value;
|
|
293
|
+
W.removeAttribute("aria-hidden");
|
|
294
|
+
}
|
|
295
|
+
} catch (H) {
|
|
296
|
+
E = !0, M = H;
|
|
297
|
+
} finally {
|
|
298
|
+
try {
|
|
299
|
+
!y && T.return && T.return();
|
|
300
|
+
} finally {
|
|
301
|
+
if (E)
|
|
302
|
+
throw M;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function u() {
|
|
307
|
+
s = null;
|
|
308
|
+
}
|
|
309
|
+
return k;
|
|
310
|
+
}
|
|
311
|
+
var Z = {}, We;
|
|
312
|
+
function ht() {
|
|
313
|
+
if (We) return Z;
|
|
314
|
+
We = 1, Object.defineProperty(Z, "__esModule", {
|
|
315
|
+
value: !0
|
|
316
|
+
}), Z.resetState = a, Z.log = s;
|
|
317
|
+
var f = {}, o = {};
|
|
318
|
+
function d(h, i) {
|
|
319
|
+
h.classList.remove(i);
|
|
320
|
+
}
|
|
321
|
+
function a() {
|
|
322
|
+
var h = document.getElementsByTagName("html")[0];
|
|
323
|
+
for (var i in f)
|
|
324
|
+
d(h, f[i]);
|
|
325
|
+
var n = document.body;
|
|
326
|
+
for (var u in o)
|
|
327
|
+
d(n, o[u]);
|
|
328
|
+
f = {}, o = {};
|
|
329
|
+
}
|
|
330
|
+
function s() {
|
|
331
|
+
if (process.env.NODE_ENV !== "production") {
|
|
332
|
+
var h = document.getElementsByTagName("html")[0].className, i = `Show tracked classes:
|
|
333
|
+
|
|
334
|
+
`;
|
|
335
|
+
i += "<html /> (" + h + `):
|
|
336
|
+
`;
|
|
337
|
+
for (var n in f)
|
|
338
|
+
i += " " + n + " " + f[n] + `
|
|
339
|
+
`;
|
|
340
|
+
h = document.body.className, i += `
|
|
341
|
+
|
|
342
|
+
doc.body (` + h + `):
|
|
343
|
+
`;
|
|
344
|
+
for (var u in o)
|
|
345
|
+
i += " " + u + " " + o[u] + `
|
|
346
|
+
`;
|
|
347
|
+
i += `
|
|
348
|
+
`, console.log(i);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
var p = function(i, n) {
|
|
352
|
+
return i[n] || (i[n] = 0), i[n] += 1, n;
|
|
353
|
+
}, g = function(i, n) {
|
|
354
|
+
return i[n] && (i[n] -= 1), n;
|
|
355
|
+
}, e = function(i, n, u) {
|
|
356
|
+
u.forEach(function(c) {
|
|
357
|
+
p(n, c), i.add(c);
|
|
358
|
+
});
|
|
359
|
+
}, O = function(i, n, u) {
|
|
360
|
+
u.forEach(function(c) {
|
|
361
|
+
g(n, c), n[c] === 0 && i.remove(c);
|
|
362
|
+
});
|
|
363
|
+
};
|
|
364
|
+
return Z.add = function(i, n) {
|
|
365
|
+
return e(i.classList, i.nodeName.toLowerCase() == "html" ? f : o, n.split(" "));
|
|
366
|
+
}, Z.remove = function(i, n) {
|
|
367
|
+
return O(i.classList, i.nodeName.toLowerCase() == "html" ? f : o, n.split(" "));
|
|
368
|
+
}, Z;
|
|
369
|
+
}
|
|
370
|
+
var J = {}, He;
|
|
371
|
+
function Ge() {
|
|
372
|
+
if (He) return J;
|
|
373
|
+
He = 1, Object.defineProperty(J, "__esModule", {
|
|
374
|
+
value: !0
|
|
375
|
+
}), J.log = a, J.resetState = s;
|
|
376
|
+
function f(p, g) {
|
|
377
|
+
if (!(p instanceof g))
|
|
378
|
+
throw new TypeError("Cannot call a class as a function");
|
|
379
|
+
}
|
|
380
|
+
var o = function p() {
|
|
381
|
+
var g = this;
|
|
382
|
+
f(this, p), this.register = function(e) {
|
|
383
|
+
if (g.openInstances.indexOf(e) !== -1) {
|
|
384
|
+
process.env.NODE_ENV !== "production" && console.warn("React-Modal: Cannot register modal instance that's already open");
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
g.openInstances.push(e), g.emit("register");
|
|
388
|
+
}, this.deregister = function(e) {
|
|
389
|
+
var O = g.openInstances.indexOf(e);
|
|
390
|
+
if (O === -1) {
|
|
391
|
+
process.env.NODE_ENV !== "production" && console.warn("React-Modal: Unable to deregister " + e + " as it was never registered");
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
g.openInstances.splice(O, 1), g.emit("deregister");
|
|
395
|
+
}, this.subscribe = function(e) {
|
|
396
|
+
g.subscribers.push(e);
|
|
397
|
+
}, this.emit = function(e) {
|
|
398
|
+
g.subscribers.forEach(function(O) {
|
|
399
|
+
return O(
|
|
400
|
+
e,
|
|
401
|
+
// shallow copy to avoid accidental mutation
|
|
402
|
+
g.openInstances.slice()
|
|
403
|
+
);
|
|
404
|
+
});
|
|
405
|
+
}, this.openInstances = [], this.subscribers = [];
|
|
406
|
+
}, d = new o();
|
|
407
|
+
function a() {
|
|
408
|
+
console.log("portalOpenInstances ----------"), console.log(d.openInstances.length), d.openInstances.forEach(function(p) {
|
|
409
|
+
return console.log(p);
|
|
410
|
+
}), console.log("end portalOpenInstances ----------");
|
|
411
|
+
}
|
|
412
|
+
function s() {
|
|
413
|
+
d = new o();
|
|
414
|
+
}
|
|
415
|
+
return J.default = d, J;
|
|
416
|
+
}
|
|
417
|
+
var te = {}, ke;
|
|
418
|
+
function mt() {
|
|
419
|
+
if (ke) return te;
|
|
420
|
+
ke = 1, Object.defineProperty(te, "__esModule", {
|
|
421
|
+
value: !0
|
|
422
|
+
}), te.resetState = g, te.log = e;
|
|
423
|
+
var f = Ge(), o = d(f);
|
|
424
|
+
function d(i) {
|
|
425
|
+
return i && i.__esModule ? i : { default: i };
|
|
426
|
+
}
|
|
427
|
+
var a = void 0, s = void 0, p = [];
|
|
428
|
+
function g() {
|
|
429
|
+
for (var i = [a, s], n = 0; n < i.length; n++) {
|
|
430
|
+
var u = i[n];
|
|
431
|
+
u && u.parentNode && u.parentNode.removeChild(u);
|
|
432
|
+
}
|
|
433
|
+
a = s = null, p = [];
|
|
434
|
+
}
|
|
435
|
+
function e() {
|
|
436
|
+
console.log("bodyTrap ----------"), console.log(p.length);
|
|
437
|
+
for (var i = [a, s], n = 0; n < i.length; n++) {
|
|
438
|
+
var u = i[n], c = u || {};
|
|
439
|
+
console.log(c.nodeName, c.className, c.id);
|
|
440
|
+
}
|
|
441
|
+
console.log("edn bodyTrap ----------");
|
|
442
|
+
}
|
|
443
|
+
function O() {
|
|
444
|
+
if (p.length === 0) {
|
|
445
|
+
process.env.NODE_ENV !== "production" && console.warn("React-Modal: Open instances > 0 expected");
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
p[p.length - 1].focusContent();
|
|
449
|
+
}
|
|
450
|
+
function h(i, n) {
|
|
451
|
+
!a && !s && (a = document.createElement("div"), a.setAttribute("data-react-modal-body-trap", ""), a.style.position = "absolute", a.style.opacity = "0", a.setAttribute("tabindex", "0"), a.addEventListener("focus", O), s = a.cloneNode(), s.addEventListener("focus", O)), p = n, p.length > 0 ? (document.body.firstChild !== a && document.body.insertBefore(a, document.body.firstChild), document.body.lastChild !== s && document.body.appendChild(s)) : (a.parentElement && a.parentElement.removeChild(a), s.parentElement && s.parentElement.removeChild(s));
|
|
452
|
+
}
|
|
453
|
+
return o.default.subscribe(h), te;
|
|
454
|
+
}
|
|
455
|
+
var Ue;
|
|
456
|
+
function vt() {
|
|
457
|
+
return Ue || (Ue = 1, function(f, o) {
|
|
458
|
+
Object.defineProperty(o, "__esModule", {
|
|
459
|
+
value: !0
|
|
460
|
+
});
|
|
461
|
+
var d = Object.assign || function(l) {
|
|
462
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
463
|
+
var x = arguments[r];
|
|
464
|
+
for (var t in x)
|
|
465
|
+
Object.prototype.hasOwnProperty.call(x, t) && (l[t] = x[t]);
|
|
466
|
+
}
|
|
467
|
+
return l;
|
|
468
|
+
}, a = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
|
|
469
|
+
return typeof l;
|
|
470
|
+
} : function(l) {
|
|
471
|
+
return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
|
|
472
|
+
}, s = /* @__PURE__ */ function() {
|
|
473
|
+
function l(r, x) {
|
|
474
|
+
for (var t = 0; t < x.length; t++) {
|
|
475
|
+
var m = x[t];
|
|
476
|
+
m.enumerable = m.enumerable || !1, m.configurable = !0, "value" in m && (m.writable = !0), Object.defineProperty(r, m.key, m);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
return function(r, x, t) {
|
|
480
|
+
return x && l(r.prototype, x), t && l(r, t), r;
|
|
481
|
+
};
|
|
482
|
+
}(), p = Be, g = /* @__PURE__ */ $e(), e = z(g), O = ft(), h = H(O), i = ct(), n = z(i), u = Ve(), c = H(u), y = ht(), E = H(y), M = xe(), T = z(M), A = Ge(), W = z(A);
|
|
483
|
+
mt();
|
|
484
|
+
function H(l) {
|
|
485
|
+
if (l && l.__esModule)
|
|
486
|
+
return l;
|
|
487
|
+
var r = {};
|
|
488
|
+
if (l != null)
|
|
489
|
+
for (var x in l)
|
|
490
|
+
Object.prototype.hasOwnProperty.call(l, x) && (r[x] = l[x]);
|
|
491
|
+
return r.default = l, r;
|
|
492
|
+
}
|
|
493
|
+
function z(l) {
|
|
494
|
+
return l && l.__esModule ? l : { default: l };
|
|
495
|
+
}
|
|
496
|
+
function L(l, r) {
|
|
497
|
+
if (!(l instanceof r))
|
|
498
|
+
throw new TypeError("Cannot call a class as a function");
|
|
499
|
+
}
|
|
500
|
+
function F(l, r) {
|
|
501
|
+
if (!l)
|
|
502
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
503
|
+
return r && (typeof r == "object" || typeof r == "function") ? r : l;
|
|
504
|
+
}
|
|
505
|
+
function G(l, r) {
|
|
506
|
+
if (typeof r != "function" && r !== null)
|
|
507
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof r);
|
|
508
|
+
l.prototype = Object.create(r && r.prototype, { constructor: { value: l, enumerable: !1, writable: !0, configurable: !0 } }), r && (Object.setPrototypeOf ? Object.setPrototypeOf(l, r) : l.__proto__ = r);
|
|
509
|
+
}
|
|
510
|
+
var U = {
|
|
511
|
+
overlay: "ReactModal__Overlay",
|
|
512
|
+
content: "ReactModal__Content"
|
|
513
|
+
}, j = function(r) {
|
|
514
|
+
return r.code === "Tab" || r.keyCode === 9;
|
|
515
|
+
}, b = function(r) {
|
|
516
|
+
return r.code === "Escape" || r.keyCode === 27;
|
|
517
|
+
}, v = 0, _ = function(l) {
|
|
518
|
+
G(r, l);
|
|
519
|
+
function r(x) {
|
|
520
|
+
L(this, r);
|
|
521
|
+
var t = F(this, (r.__proto__ || Object.getPrototypeOf(r)).call(this, x));
|
|
522
|
+
return t.setOverlayRef = function(m) {
|
|
523
|
+
t.overlay = m, t.props.overlayRef && t.props.overlayRef(m);
|
|
524
|
+
}, t.setContentRef = function(m) {
|
|
525
|
+
t.content = m, t.props.contentRef && t.props.contentRef(m);
|
|
526
|
+
}, t.afterClose = function() {
|
|
527
|
+
var m = t.props, w = m.appElement, S = m.ariaHideApp, R = m.htmlOpenClassName, P = m.bodyOpenClassName, B = m.parentSelector, K = B && B().ownerDocument || document;
|
|
528
|
+
P && E.remove(K.body, P), R && E.remove(K.getElementsByTagName("html")[0], R), S && v > 0 && (v -= 1, v === 0 && c.show(w)), t.props.shouldFocusAfterRender && (t.props.shouldReturnFocusAfterClose ? (h.returnFocus(t.props.preventScroll), h.teardownScopedFocus()) : h.popWithoutFocus()), t.props.onAfterClose && t.props.onAfterClose(), W.default.deregister(t);
|
|
529
|
+
}, t.open = function() {
|
|
530
|
+
t.beforeOpen(), t.state.afterOpen && t.state.beforeClose ? (clearTimeout(t.closeTimer), t.setState({ beforeClose: !1 })) : (t.props.shouldFocusAfterRender && (h.setupScopedFocus(t.node), h.markForFocusLater()), t.setState({ isOpen: !0 }, function() {
|
|
531
|
+
t.openAnimationFrame = requestAnimationFrame(function() {
|
|
532
|
+
t.setState({ afterOpen: !0 }), t.props.isOpen && t.props.onAfterOpen && t.props.onAfterOpen({
|
|
533
|
+
overlayEl: t.overlay,
|
|
534
|
+
contentEl: t.content
|
|
535
|
+
});
|
|
536
|
+
});
|
|
537
|
+
}));
|
|
538
|
+
}, t.close = function() {
|
|
539
|
+
t.props.closeTimeoutMS > 0 ? t.closeWithTimeout() : t.closeWithoutTimeout();
|
|
540
|
+
}, t.focusContent = function() {
|
|
541
|
+
return t.content && !t.contentHasFocus() && t.content.focus({ preventScroll: !0 });
|
|
542
|
+
}, t.closeWithTimeout = function() {
|
|
543
|
+
var m = Date.now() + t.props.closeTimeoutMS;
|
|
544
|
+
t.setState({ beforeClose: !0, closesAt: m }, function() {
|
|
545
|
+
t.closeTimer = setTimeout(t.closeWithoutTimeout, t.state.closesAt - Date.now());
|
|
546
|
+
});
|
|
547
|
+
}, t.closeWithoutTimeout = function() {
|
|
548
|
+
t.setState({
|
|
549
|
+
beforeClose: !1,
|
|
550
|
+
isOpen: !1,
|
|
551
|
+
afterOpen: !1,
|
|
552
|
+
closesAt: null
|
|
553
|
+
}, t.afterClose);
|
|
554
|
+
}, t.handleKeyDown = function(m) {
|
|
555
|
+
j(m) && (0, n.default)(t.content, m), t.props.shouldCloseOnEsc && b(m) && (m.stopPropagation(), t.requestClose(m));
|
|
556
|
+
}, t.handleOverlayOnClick = function(m) {
|
|
557
|
+
t.shouldClose === null && (t.shouldClose = !0), t.shouldClose && t.props.shouldCloseOnOverlayClick && (t.ownerHandlesClose() ? t.requestClose(m) : t.focusContent()), t.shouldClose = null;
|
|
558
|
+
}, t.handleContentOnMouseUp = function() {
|
|
559
|
+
t.shouldClose = !1;
|
|
560
|
+
}, t.handleOverlayOnMouseDown = function(m) {
|
|
561
|
+
!t.props.shouldCloseOnOverlayClick && m.target == t.overlay && m.preventDefault();
|
|
562
|
+
}, t.handleContentOnClick = function() {
|
|
563
|
+
t.shouldClose = !1;
|
|
564
|
+
}, t.handleContentOnMouseDown = function() {
|
|
565
|
+
t.shouldClose = !1;
|
|
566
|
+
}, t.requestClose = function(m) {
|
|
567
|
+
return t.ownerHandlesClose() && t.props.onRequestClose(m);
|
|
568
|
+
}, t.ownerHandlesClose = function() {
|
|
569
|
+
return t.props.onRequestClose;
|
|
570
|
+
}, t.shouldBeClosed = function() {
|
|
571
|
+
return !t.state.isOpen && !t.state.beforeClose;
|
|
572
|
+
}, t.contentHasFocus = function() {
|
|
573
|
+
return document.activeElement === t.content || t.content.contains(document.activeElement);
|
|
574
|
+
}, t.buildClassName = function(m, w) {
|
|
575
|
+
var S = (typeof w > "u" ? "undefined" : a(w)) === "object" ? w : {
|
|
576
|
+
base: U[m],
|
|
577
|
+
afterOpen: U[m] + "--after-open",
|
|
578
|
+
beforeClose: U[m] + "--before-close"
|
|
579
|
+
}, R = S.base;
|
|
580
|
+
return t.state.afterOpen && (R = R + " " + S.afterOpen), t.state.beforeClose && (R = R + " " + S.beforeClose), typeof w == "string" && w ? R + " " + w : R;
|
|
581
|
+
}, t.attributesFromObject = function(m, w) {
|
|
582
|
+
return Object.keys(w).reduce(function(S, R) {
|
|
583
|
+
return S[m + "-" + R] = w[R], S;
|
|
584
|
+
}, {});
|
|
585
|
+
}, t.state = {
|
|
586
|
+
afterOpen: !1,
|
|
587
|
+
beforeClose: !1
|
|
588
|
+
}, t.shouldClose = null, t.moveFromContentToOverlay = null, t;
|
|
589
|
+
}
|
|
590
|
+
return s(r, [{
|
|
591
|
+
key: "componentDidMount",
|
|
592
|
+
value: function() {
|
|
593
|
+
this.props.isOpen && this.open();
|
|
594
|
+
}
|
|
595
|
+
}, {
|
|
596
|
+
key: "componentDidUpdate",
|
|
597
|
+
value: function(t, m) {
|
|
598
|
+
process.env.NODE_ENV !== "production" && (t.bodyOpenClassName !== this.props.bodyOpenClassName && console.warn('React-Modal: "bodyOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.'), t.htmlOpenClassName !== this.props.htmlOpenClassName && console.warn('React-Modal: "htmlOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.')), this.props.isOpen && !t.isOpen ? this.open() : !this.props.isOpen && t.isOpen && this.close(), this.props.shouldFocusAfterRender && this.state.isOpen && !m.isOpen && this.focusContent();
|
|
599
|
+
}
|
|
600
|
+
}, {
|
|
601
|
+
key: "componentWillUnmount",
|
|
602
|
+
value: function() {
|
|
603
|
+
this.state.isOpen && this.afterClose(), clearTimeout(this.closeTimer), cancelAnimationFrame(this.openAnimationFrame);
|
|
604
|
+
}
|
|
605
|
+
}, {
|
|
606
|
+
key: "beforeOpen",
|
|
607
|
+
value: function() {
|
|
608
|
+
var t = this.props, m = t.appElement, w = t.ariaHideApp, S = t.htmlOpenClassName, R = t.bodyOpenClassName, P = t.parentSelector, B = P && P().ownerDocument || document;
|
|
609
|
+
R && E.add(B.body, R), S && E.add(B.getElementsByTagName("html")[0], S), w && (v += 1, c.hide(m)), W.default.register(this);
|
|
610
|
+
}
|
|
611
|
+
// Don't steal focus from inner elements
|
|
612
|
+
}, {
|
|
613
|
+
key: "render",
|
|
614
|
+
value: function() {
|
|
615
|
+
var t = this.props, m = t.id, w = t.className, S = t.overlayClassName, R = t.defaultStyles, P = t.children, B = w ? {} : R.content, K = S ? {} : R.overlay;
|
|
616
|
+
if (this.shouldBeClosed())
|
|
617
|
+
return null;
|
|
618
|
+
var ne = {
|
|
619
|
+
ref: this.setOverlayRef,
|
|
620
|
+
className: this.buildClassName("overlay", S),
|
|
621
|
+
style: d({}, K, this.props.style.overlay),
|
|
622
|
+
onClick: this.handleOverlayOnClick,
|
|
623
|
+
onMouseDown: this.handleOverlayOnMouseDown
|
|
624
|
+
}, ce = d({
|
|
625
|
+
id: m,
|
|
626
|
+
ref: this.setContentRef,
|
|
627
|
+
style: d({}, B, this.props.style.content),
|
|
628
|
+
className: this.buildClassName("content", w),
|
|
629
|
+
tabIndex: "-1",
|
|
630
|
+
onKeyDown: this.handleKeyDown,
|
|
631
|
+
onMouseDown: this.handleContentOnMouseDown,
|
|
632
|
+
onMouseUp: this.handleContentOnMouseUp,
|
|
633
|
+
onClick: this.handleContentOnClick,
|
|
634
|
+
role: this.props.role,
|
|
635
|
+
"aria-label": this.props.contentLabel
|
|
636
|
+
}, this.attributesFromObject("aria", d({ modal: !0 }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
|
|
637
|
+
"data-testid": this.props.testId
|
|
638
|
+
}), de = this.props.contentElement(ce, P);
|
|
639
|
+
return this.props.overlayElement(ne, de);
|
|
640
|
+
}
|
|
641
|
+
}]), r;
|
|
642
|
+
}(p.Component);
|
|
643
|
+
_.defaultProps = {
|
|
644
|
+
style: {
|
|
645
|
+
overlay: {},
|
|
646
|
+
content: {}
|
|
647
|
+
},
|
|
648
|
+
defaultStyles: {}
|
|
649
|
+
}, _.propTypes = {
|
|
650
|
+
isOpen: e.default.bool.isRequired,
|
|
651
|
+
defaultStyles: e.default.shape({
|
|
652
|
+
content: e.default.object,
|
|
653
|
+
overlay: e.default.object
|
|
654
|
+
}),
|
|
655
|
+
style: e.default.shape({
|
|
656
|
+
content: e.default.object,
|
|
657
|
+
overlay: e.default.object
|
|
658
|
+
}),
|
|
659
|
+
className: e.default.oneOfType([e.default.string, e.default.object]),
|
|
660
|
+
overlayClassName: e.default.oneOfType([e.default.string, e.default.object]),
|
|
661
|
+
parentSelector: e.default.func,
|
|
662
|
+
bodyOpenClassName: e.default.string,
|
|
663
|
+
htmlOpenClassName: e.default.string,
|
|
664
|
+
ariaHideApp: e.default.bool,
|
|
665
|
+
appElement: e.default.oneOfType([e.default.instanceOf(T.default), e.default.instanceOf(M.SafeHTMLCollection), e.default.instanceOf(M.SafeNodeList), e.default.arrayOf(e.default.instanceOf(T.default))]),
|
|
666
|
+
onAfterOpen: e.default.func,
|
|
667
|
+
onAfterClose: e.default.func,
|
|
668
|
+
onRequestClose: e.default.func,
|
|
669
|
+
closeTimeoutMS: e.default.number,
|
|
670
|
+
shouldFocusAfterRender: e.default.bool,
|
|
671
|
+
shouldCloseOnOverlayClick: e.default.bool,
|
|
672
|
+
shouldReturnFocusAfterClose: e.default.bool,
|
|
673
|
+
preventScroll: e.default.bool,
|
|
674
|
+
role: e.default.string,
|
|
675
|
+
contentLabel: e.default.string,
|
|
676
|
+
aria: e.default.object,
|
|
677
|
+
data: e.default.object,
|
|
678
|
+
children: e.default.node,
|
|
679
|
+
shouldCloseOnEsc: e.default.bool,
|
|
680
|
+
overlayRef: e.default.func,
|
|
681
|
+
contentRef: e.default.func,
|
|
682
|
+
id: e.default.string,
|
|
683
|
+
overlayElement: e.default.func,
|
|
684
|
+
contentElement: e.default.func,
|
|
685
|
+
testId: e.default.string
|
|
686
|
+
}, o.default = _, f.exports = o.default;
|
|
687
|
+
}(le, le.exports)), le.exports;
|
|
688
|
+
}
|
|
689
|
+
function Ke() {
|
|
690
|
+
var f = this.constructor.getDerivedStateFromProps(this.props, this.state);
|
|
691
|
+
f != null && this.setState(f);
|
|
692
|
+
}
|
|
693
|
+
function Ye(f) {
|
|
694
|
+
function o(d) {
|
|
695
|
+
var a = this.constructor.getDerivedStateFromProps(f, d);
|
|
696
|
+
return a ?? null;
|
|
697
|
+
}
|
|
698
|
+
this.setState(o.bind(this));
|
|
699
|
+
}
|
|
700
|
+
function Ze(f, o) {
|
|
701
|
+
try {
|
|
702
|
+
var d = this.props, a = this.state;
|
|
703
|
+
this.props = f, this.state = o, this.__reactInternalSnapshotFlag = !0, this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
|
|
704
|
+
d,
|
|
705
|
+
a
|
|
706
|
+
);
|
|
707
|
+
} finally {
|
|
708
|
+
this.props = d, this.state = a;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
Ke.__suppressDeprecationWarning = !0;
|
|
712
|
+
Ye.__suppressDeprecationWarning = !0;
|
|
713
|
+
Ze.__suppressDeprecationWarning = !0;
|
|
714
|
+
function yt(f) {
|
|
715
|
+
var o = f.prototype;
|
|
716
|
+
if (!o || !o.isReactComponent)
|
|
717
|
+
throw new Error("Can only polyfill class components");
|
|
718
|
+
if (typeof f.getDerivedStateFromProps != "function" && typeof o.getSnapshotBeforeUpdate != "function")
|
|
719
|
+
return f;
|
|
720
|
+
var d = null, a = null, s = null;
|
|
721
|
+
if (typeof o.componentWillMount == "function" ? d = "componentWillMount" : typeof o.UNSAFE_componentWillMount == "function" && (d = "UNSAFE_componentWillMount"), typeof o.componentWillReceiveProps == "function" ? a = "componentWillReceiveProps" : typeof o.UNSAFE_componentWillReceiveProps == "function" && (a = "UNSAFE_componentWillReceiveProps"), typeof o.componentWillUpdate == "function" ? s = "componentWillUpdate" : typeof o.UNSAFE_componentWillUpdate == "function" && (s = "UNSAFE_componentWillUpdate"), d !== null || a !== null || s !== null) {
|
|
722
|
+
var p = f.displayName || f.name, g = typeof f.getDerivedStateFromProps == "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
|
|
723
|
+
throw Error(
|
|
724
|
+
`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
725
|
+
|
|
726
|
+
` + p + " uses " + g + " but also contains the following legacy lifecycles:" + (d !== null ? `
|
|
727
|
+
` + d : "") + (a !== null ? `
|
|
728
|
+
` + a : "") + (s !== null ? `
|
|
729
|
+
` + s : "") + `
|
|
730
|
+
|
|
731
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
732
|
+
https://fb.me/react-async-component-lifecycle-hooks`
|
|
733
|
+
);
|
|
734
|
+
}
|
|
735
|
+
if (typeof f.getDerivedStateFromProps == "function" && (o.componentWillMount = Ke, o.componentWillReceiveProps = Ye), typeof o.getSnapshotBeforeUpdate == "function") {
|
|
736
|
+
if (typeof o.componentDidUpdate != "function")
|
|
737
|
+
throw new Error(
|
|
738
|
+
"Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype"
|
|
739
|
+
);
|
|
740
|
+
o.componentWillUpdate = Ze;
|
|
741
|
+
var e = o.componentDidUpdate;
|
|
742
|
+
o.componentDidUpdate = function(h, i, n) {
|
|
743
|
+
var u = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : n;
|
|
744
|
+
e.call(this, h, i, u);
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
return f;
|
|
748
|
+
}
|
|
749
|
+
const bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
750
|
+
__proto__: null,
|
|
751
|
+
polyfill: yt
|
|
752
|
+
}, Symbol.toStringTag, { value: "Module" })), gt = /* @__PURE__ */ rt(bt);
|
|
753
|
+
var je;
|
|
754
|
+
function Ot() {
|
|
755
|
+
if (je) return V;
|
|
756
|
+
je = 1, Object.defineProperty(V, "__esModule", {
|
|
757
|
+
value: !0
|
|
758
|
+
}), V.bodyOpenClassName = V.portalClassName = void 0;
|
|
759
|
+
var f = Object.assign || function(b) {
|
|
760
|
+
for (var v = 1; v < arguments.length; v++) {
|
|
761
|
+
var _ = arguments[v];
|
|
762
|
+
for (var l in _)
|
|
763
|
+
Object.prototype.hasOwnProperty.call(_, l) && (b[l] = _[l]);
|
|
764
|
+
}
|
|
765
|
+
return b;
|
|
766
|
+
}, o = /* @__PURE__ */ function() {
|
|
767
|
+
function b(v, _) {
|
|
768
|
+
for (var l = 0; l < _.length; l++) {
|
|
769
|
+
var r = _[l];
|
|
770
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(v, r.key, r);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return function(v, _, l) {
|
|
774
|
+
return _ && b(v.prototype, _), l && b(v, l), v;
|
|
775
|
+
};
|
|
776
|
+
}(), d = Be, a = M(d), s = ut, p = M(s), g = /* @__PURE__ */ $e(), e = M(g), O = vt(), h = M(O), i = Ve(), n = E(i), u = xe(), c = M(u), y = gt;
|
|
777
|
+
function E(b) {
|
|
778
|
+
if (b && b.__esModule)
|
|
779
|
+
return b;
|
|
780
|
+
var v = {};
|
|
781
|
+
if (b != null)
|
|
782
|
+
for (var _ in b)
|
|
783
|
+
Object.prototype.hasOwnProperty.call(b, _) && (v[_] = b[_]);
|
|
784
|
+
return v.default = b, v;
|
|
785
|
+
}
|
|
786
|
+
function M(b) {
|
|
787
|
+
return b && b.__esModule ? b : { default: b };
|
|
788
|
+
}
|
|
789
|
+
function T(b, v) {
|
|
790
|
+
if (!(b instanceof v))
|
|
791
|
+
throw new TypeError("Cannot call a class as a function");
|
|
792
|
+
}
|
|
793
|
+
function A(b, v) {
|
|
794
|
+
if (!b)
|
|
795
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
796
|
+
return v && (typeof v == "object" || typeof v == "function") ? v : b;
|
|
797
|
+
}
|
|
798
|
+
function W(b, v) {
|
|
799
|
+
if (typeof v != "function" && v !== null)
|
|
800
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof v);
|
|
801
|
+
b.prototype = Object.create(v && v.prototype, { constructor: { value: b, enumerable: !1, writable: !0, configurable: !0 } }), v && (Object.setPrototypeOf ? Object.setPrototypeOf(b, v) : b.__proto__ = v);
|
|
802
|
+
}
|
|
803
|
+
var H = V.portalClassName = "ReactModalPortal", z = V.bodyOpenClassName = "ReactModal__Body--open", L = u.canUseDOM && p.default.createPortal !== void 0, F = function(v) {
|
|
804
|
+
return document.createElement(v);
|
|
805
|
+
}, G = function() {
|
|
806
|
+
return L ? p.default.createPortal : p.default.unstable_renderSubtreeIntoContainer;
|
|
807
|
+
};
|
|
808
|
+
function U(b) {
|
|
809
|
+
return b();
|
|
810
|
+
}
|
|
811
|
+
var j = function(b) {
|
|
812
|
+
W(v, b);
|
|
813
|
+
function v() {
|
|
814
|
+
var _, l, r, x;
|
|
815
|
+
T(this, v);
|
|
816
|
+
for (var t = arguments.length, m = Array(t), w = 0; w < t; w++)
|
|
817
|
+
m[w] = arguments[w];
|
|
818
|
+
return x = (l = (r = A(this, (_ = v.__proto__ || Object.getPrototypeOf(v)).call.apply(_, [this].concat(m))), r), r.removePortal = function() {
|
|
819
|
+
!L && p.default.unmountComponentAtNode(r.node);
|
|
820
|
+
var S = U(r.props.parentSelector);
|
|
821
|
+
S && S.contains(r.node) ? S.removeChild(r.node) : console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.');
|
|
822
|
+
}, r.portalRef = function(S) {
|
|
823
|
+
r.portal = S;
|
|
824
|
+
}, r.renderPortal = function(S) {
|
|
825
|
+
var R = G(), P = R(r, a.default.createElement(h.default, f({ defaultStyles: v.defaultStyles }, S)), r.node);
|
|
826
|
+
r.portalRef(P);
|
|
827
|
+
}, l), A(r, x);
|
|
828
|
+
}
|
|
829
|
+
return o(v, [{
|
|
830
|
+
key: "componentDidMount",
|
|
831
|
+
value: function() {
|
|
832
|
+
if (u.canUseDOM) {
|
|
833
|
+
L || (this.node = F("div")), this.node.className = this.props.portalClassName;
|
|
834
|
+
var l = U(this.props.parentSelector);
|
|
835
|
+
l.appendChild(this.node), !L && this.renderPortal(this.props);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}, {
|
|
839
|
+
key: "getSnapshotBeforeUpdate",
|
|
840
|
+
value: function(l) {
|
|
841
|
+
var r = U(l.parentSelector), x = U(this.props.parentSelector);
|
|
842
|
+
return { prevParent: r, nextParent: x };
|
|
843
|
+
}
|
|
844
|
+
}, {
|
|
845
|
+
key: "componentDidUpdate",
|
|
846
|
+
value: function(l, r, x) {
|
|
847
|
+
if (u.canUseDOM) {
|
|
848
|
+
var t = this.props, m = t.isOpen, w = t.portalClassName;
|
|
849
|
+
l.portalClassName !== w && (this.node.className = w);
|
|
850
|
+
var S = x.prevParent, R = x.nextParent;
|
|
851
|
+
R !== S && (S.removeChild(this.node), R.appendChild(this.node)), !(!l.isOpen && !m) && !L && this.renderPortal(this.props);
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}, {
|
|
855
|
+
key: "componentWillUnmount",
|
|
856
|
+
value: function() {
|
|
857
|
+
if (!(!u.canUseDOM || !this.node || !this.portal)) {
|
|
858
|
+
var l = this.portal.state, r = Date.now(), x = l.isOpen && this.props.closeTimeoutMS && (l.closesAt || r + this.props.closeTimeoutMS);
|
|
859
|
+
x ? (l.beforeClose || this.portal.closeWithTimeout(), setTimeout(this.removePortal, x - r)) : this.removePortal();
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}, {
|
|
863
|
+
key: "render",
|
|
864
|
+
value: function() {
|
|
865
|
+
if (!u.canUseDOM || !L)
|
|
866
|
+
return null;
|
|
867
|
+
!this.node && L && (this.node = F("div"));
|
|
868
|
+
var l = G();
|
|
869
|
+
return l(a.default.createElement(h.default, f({
|
|
870
|
+
ref: this.portalRef,
|
|
871
|
+
defaultStyles: v.defaultStyles
|
|
872
|
+
}, this.props)), this.node);
|
|
873
|
+
}
|
|
874
|
+
}], [{
|
|
875
|
+
key: "setAppElement",
|
|
876
|
+
value: function(l) {
|
|
877
|
+
n.setElement(l);
|
|
878
|
+
}
|
|
879
|
+
/* eslint-disable react/no-unused-prop-types */
|
|
880
|
+
/* eslint-enable react/no-unused-prop-types */
|
|
881
|
+
}]), v;
|
|
882
|
+
}(d.Component);
|
|
883
|
+
return j.propTypes = {
|
|
884
|
+
isOpen: e.default.bool.isRequired,
|
|
885
|
+
style: e.default.shape({
|
|
886
|
+
content: e.default.object,
|
|
887
|
+
overlay: e.default.object
|
|
888
|
+
}),
|
|
889
|
+
portalClassName: e.default.string,
|
|
890
|
+
bodyOpenClassName: e.default.string,
|
|
891
|
+
htmlOpenClassName: e.default.string,
|
|
892
|
+
className: e.default.oneOfType([e.default.string, e.default.shape({
|
|
893
|
+
base: e.default.string.isRequired,
|
|
894
|
+
afterOpen: e.default.string.isRequired,
|
|
895
|
+
beforeClose: e.default.string.isRequired
|
|
896
|
+
})]),
|
|
897
|
+
overlayClassName: e.default.oneOfType([e.default.string, e.default.shape({
|
|
898
|
+
base: e.default.string.isRequired,
|
|
899
|
+
afterOpen: e.default.string.isRequired,
|
|
900
|
+
beforeClose: e.default.string.isRequired
|
|
901
|
+
})]),
|
|
902
|
+
appElement: e.default.oneOfType([e.default.instanceOf(c.default), e.default.instanceOf(u.SafeHTMLCollection), e.default.instanceOf(u.SafeNodeList), e.default.arrayOf(e.default.instanceOf(c.default))]),
|
|
903
|
+
onAfterOpen: e.default.func,
|
|
904
|
+
onRequestClose: e.default.func,
|
|
905
|
+
closeTimeoutMS: e.default.number,
|
|
906
|
+
ariaHideApp: e.default.bool,
|
|
907
|
+
shouldFocusAfterRender: e.default.bool,
|
|
908
|
+
shouldCloseOnOverlayClick: e.default.bool,
|
|
909
|
+
shouldReturnFocusAfterClose: e.default.bool,
|
|
910
|
+
preventScroll: e.default.bool,
|
|
911
|
+
parentSelector: e.default.func,
|
|
912
|
+
aria: e.default.object,
|
|
913
|
+
data: e.default.object,
|
|
914
|
+
role: e.default.string,
|
|
915
|
+
contentLabel: e.default.string,
|
|
916
|
+
shouldCloseOnEsc: e.default.bool,
|
|
917
|
+
overlayRef: e.default.func,
|
|
918
|
+
contentRef: e.default.func,
|
|
919
|
+
id: e.default.string,
|
|
920
|
+
overlayElement: e.default.func,
|
|
921
|
+
contentElement: e.default.func
|
|
922
|
+
}, j.defaultProps = {
|
|
923
|
+
isOpen: !1,
|
|
924
|
+
portalClassName: H,
|
|
925
|
+
bodyOpenClassName: z,
|
|
926
|
+
role: "dialog",
|
|
927
|
+
ariaHideApp: !0,
|
|
928
|
+
closeTimeoutMS: 0,
|
|
929
|
+
shouldFocusAfterRender: !0,
|
|
930
|
+
shouldCloseOnEsc: !0,
|
|
931
|
+
shouldCloseOnOverlayClick: !0,
|
|
932
|
+
shouldReturnFocusAfterClose: !0,
|
|
933
|
+
preventScroll: !1,
|
|
934
|
+
parentSelector: function() {
|
|
935
|
+
return document.body;
|
|
936
|
+
},
|
|
937
|
+
overlayElement: function(v, _) {
|
|
938
|
+
return a.default.createElement(
|
|
939
|
+
"div",
|
|
940
|
+
v,
|
|
941
|
+
_
|
|
942
|
+
);
|
|
943
|
+
},
|
|
944
|
+
contentElement: function(v, _) {
|
|
945
|
+
return a.default.createElement(
|
|
946
|
+
"div",
|
|
947
|
+
v,
|
|
948
|
+
_
|
|
949
|
+
);
|
|
950
|
+
}
|
|
951
|
+
}, j.defaultStyles = {
|
|
952
|
+
overlay: {
|
|
953
|
+
position: "fixed",
|
|
954
|
+
top: 0,
|
|
955
|
+
left: 0,
|
|
956
|
+
right: 0,
|
|
957
|
+
bottom: 0,
|
|
958
|
+
backgroundColor: "rgba(255, 255, 255, 0.75)"
|
|
959
|
+
},
|
|
960
|
+
content: {
|
|
961
|
+
position: "absolute",
|
|
962
|
+
top: "40px",
|
|
963
|
+
left: "40px",
|
|
964
|
+
right: "40px",
|
|
965
|
+
bottom: "40px",
|
|
966
|
+
border: "1px solid #ccc",
|
|
967
|
+
background: "#fff",
|
|
968
|
+
overflow: "auto",
|
|
969
|
+
WebkitOverflowScrolling: "touch",
|
|
970
|
+
borderRadius: "4px",
|
|
971
|
+
outline: "none",
|
|
972
|
+
padding: "20px"
|
|
973
|
+
}
|
|
974
|
+
}, (0, y.polyfill)(j), process.env.NODE_ENV !== "production" && (j.setCreateHTMLElement = function(b) {
|
|
975
|
+
return F = b;
|
|
976
|
+
}), V.default = j, V;
|
|
977
|
+
}
|
|
978
|
+
var Ie;
|
|
979
|
+
function Ct() {
|
|
980
|
+
return Ie || (Ie = 1, function(f, o) {
|
|
981
|
+
Object.defineProperty(o, "__esModule", {
|
|
982
|
+
value: !0
|
|
983
|
+
});
|
|
984
|
+
var d = Ot(), a = s(d);
|
|
985
|
+
function s(p) {
|
|
986
|
+
return p && p.__esModule ? p : { default: p };
|
|
987
|
+
}
|
|
988
|
+
o.default = a.default, f.exports = o.default;
|
|
989
|
+
}(ae, ae.exports)), ae.exports;
|
|
990
|
+
}
|
|
991
|
+
var wt = Ct();
|
|
992
|
+
const xt = /* @__PURE__ */ at(wt), Dt = (f) => {
|
|
993
|
+
const {
|
|
994
|
+
openState: o,
|
|
995
|
+
closePopupCallback: d,
|
|
996
|
+
headingIconFile: a,
|
|
997
|
+
headingText: s,
|
|
998
|
+
subHeadingText: p,
|
|
999
|
+
positiveButtonText: g,
|
|
1000
|
+
negativeButtonText: e,
|
|
1001
|
+
classNamePositiveBtn: O,
|
|
1002
|
+
classNameNegativeBtn: h,
|
|
1003
|
+
positiveActionCallback: i,
|
|
1004
|
+
negativeActionCallback: n
|
|
1005
|
+
} = f;
|
|
1006
|
+
return /* @__PURE__ */ C.jsxs(
|
|
1007
|
+
xt,
|
|
1008
|
+
{
|
|
1009
|
+
isOpen: o,
|
|
1010
|
+
onRequestClose: d,
|
|
1011
|
+
shouldCloseOnOverlayClick: !1,
|
|
1012
|
+
style: {
|
|
1013
|
+
overlay: {
|
|
1014
|
+
backgroundColor: "rgba(52, 64, 84, 0.5)",
|
|
1015
|
+
position: "fixed",
|
|
1016
|
+
alignContent: "center",
|
|
1017
|
+
justifyContent: "center",
|
|
1018
|
+
zIndex: 1030,
|
|
1019
|
+
display: o ? "block" : "none"
|
|
1020
|
+
},
|
|
1021
|
+
content: {
|
|
1022
|
+
zIndex: 1030,
|
|
1023
|
+
padding: "24px",
|
|
1024
|
+
maxWidth: "750px",
|
|
1025
|
+
maxHeight: "600px",
|
|
1026
|
+
width: "400px",
|
|
1027
|
+
height: "fit-content",
|
|
1028
|
+
margin: "auto",
|
|
1029
|
+
borderRadius: "12px",
|
|
1030
|
+
overflow: "unset",
|
|
1031
|
+
display: o ? "block" : "none"
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
children: [
|
|
1035
|
+
a == "warning" && /* @__PURE__ */ C.jsx("div", { className: "hfl-hx_warning hfl-mb-4 hfl-flex hfl-h-12 hfl-w-12 hfl-items-center hfl-justify-center hfl-rounded-full hfl-border-8 hfl-border-Warning-50 hfl-bg-Warning-100 hfl-text-Warning-600", children: /* @__PURE__ */ C.jsx("i", { className: "hx_warning hfl-text-5" }) }),
|
|
1036
|
+
/* @__PURE__ */ C.jsx(Ce, { variant: "Medium", type: "Text xl", className: "hfl-mt-5 hfl-text-Gray-900", children: s }),
|
|
1037
|
+
p && /* @__PURE__ */ C.jsx(Ce, { variant: "Regular", type: "Text sm", className: "hfl-mt-1 hfl-text-Gray-500 ", children: p }),
|
|
1038
|
+
/* @__PURE__ */ C.jsxs("div", { className: "hfl-mt-4 hfl-flex hfl-items-center hfl-justify-center hfl-gap-4", children: [
|
|
1039
|
+
e && /* @__PURE__ */ C.jsx(
|
|
1040
|
+
we,
|
|
1041
|
+
{
|
|
1042
|
+
size: "md",
|
|
1043
|
+
textField: e,
|
|
1044
|
+
hierarchy: "Primary",
|
|
1045
|
+
className: h || "",
|
|
1046
|
+
onClick: n,
|
|
1047
|
+
"data-qa": "negative-action"
|
|
1048
|
+
}
|
|
1049
|
+
),
|
|
1050
|
+
g && /* @__PURE__ */ C.jsx(
|
|
1051
|
+
we,
|
|
1052
|
+
{
|
|
1053
|
+
size: "md",
|
|
1054
|
+
textField: g,
|
|
1055
|
+
hierarchy: "Secondary",
|
|
1056
|
+
className: O || "",
|
|
1057
|
+
onClick: i,
|
|
1058
|
+
"data-qa": "positive-action"
|
|
1059
|
+
}
|
|
1060
|
+
)
|
|
1061
|
+
] })
|
|
1062
|
+
]
|
|
1063
|
+
}
|
|
1064
|
+
);
|
|
1065
|
+
}, _t = (f, o) => {
|
|
1066
|
+
fe(() => {
|
|
1067
|
+
const d = (a) => {
|
|
1068
|
+
f.current && !f.current.contains(a.target) && o();
|
|
1069
|
+
};
|
|
1070
|
+
return document.addEventListener("mousedown", d), () => {
|
|
1071
|
+
document.removeEventListener("mousedown", d);
|
|
1072
|
+
};
|
|
1073
|
+
}, [f, o]);
|
|
1074
|
+
}, Et = (f, o) => {
|
|
1075
|
+
const d = ue(
|
|
1076
|
+
(a) => {
|
|
1077
|
+
f.current && !f.current.contains(a.target) && o();
|
|
1078
|
+
},
|
|
1079
|
+
[f, o]
|
|
1080
|
+
);
|
|
1081
|
+
fe(() => (document.addEventListener("mouseup", d), () => {
|
|
1082
|
+
document.removeEventListener("mouseup", d);
|
|
1083
|
+
}), [d]);
|
|
1084
|
+
};
|
|
1085
|
+
function Nt(f) {
|
|
1086
|
+
const { options: o, selectedOption: d, onChangeHandler: a } = f;
|
|
1087
|
+
return /* @__PURE__ */ C.jsx("div", { className: "hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1", children: o?.map((s) => /* @__PURE__ */ C.jsx("div", { className: "hfl-bg-White hfl-rounded-lg", children: /* @__PURE__ */ C.jsx(
|
|
1088
|
+
we,
|
|
1089
|
+
{
|
|
1090
|
+
onClick: () => a && a(s),
|
|
1091
|
+
hierarchy: d?.label === s.label ? "Primary" : "Secondary-Grey",
|
|
1092
|
+
size: "sm",
|
|
1093
|
+
textField: s.label,
|
|
1094
|
+
className: d?.label === s.label ? "hfl-bg-Blue-600" : ""
|
|
1095
|
+
}
|
|
1096
|
+
) }, s.label)) });
|
|
1097
|
+
}
|
|
1098
|
+
const St = "data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.480062%200.819173C0.650418%200.648817%200.92662%200.648817%201.09698%200.819173L4.71454%204.43674L8.3321%200.819173C8.50246%200.648817%208.77866%200.648817%208.94902%200.819173C9.11937%200.98953%209.11937%201.26573%208.94902%201.43609L5.023%205.36211C4.85264%205.53246%204.57644%205.53246%204.40608%205.36211L0.480062%201.43609C0.309706%201.26573%200.309706%200.98953%200.480062%200.819173Z'%20fill='%23667085'/%3e%3c/svg%3e";
|
|
1099
|
+
function Pt(f) {
|
|
1100
|
+
const {
|
|
1101
|
+
label: o,
|
|
1102
|
+
labelClassName: d,
|
|
1103
|
+
hideDropdownIcon: a,
|
|
1104
|
+
showClearOption: s,
|
|
1105
|
+
isRequiredField: p,
|
|
1106
|
+
btnClassName: g,
|
|
1107
|
+
placeholder: e,
|
|
1108
|
+
options: O,
|
|
1109
|
+
selectedOption: h,
|
|
1110
|
+
onChangeHandler: i,
|
|
1111
|
+
inputValue: n,
|
|
1112
|
+
inputChangeHandler: u,
|
|
1113
|
+
onInputFocusOutEvent: c,
|
|
1114
|
+
inputClassName: y,
|
|
1115
|
+
isSearchable: E,
|
|
1116
|
+
inputType: M,
|
|
1117
|
+
showInput: T,
|
|
1118
|
+
inputSuffix: A,
|
|
1119
|
+
selectedLabel: W,
|
|
1120
|
+
suffixPadding: H,
|
|
1121
|
+
disableInputAutoSize: z,
|
|
1122
|
+
selectedOptions: L,
|
|
1123
|
+
isMulti: F,
|
|
1124
|
+
dropDownItemClickHandler: G,
|
|
1125
|
+
showToggle: U,
|
|
1126
|
+
toggleChangeHandler: j,
|
|
1127
|
+
selectedToggleOption: b,
|
|
1128
|
+
toggleOptionsList: v,
|
|
1129
|
+
border: _,
|
|
1130
|
+
height: l,
|
|
1131
|
+
disabled: r,
|
|
1132
|
+
fieldColor: x,
|
|
1133
|
+
errorMsg: t,
|
|
1134
|
+
showErrorMsg: m,
|
|
1135
|
+
placeholderStyle: w,
|
|
1136
|
+
onInputKeyDown: S,
|
|
1137
|
+
showEmptyDropdownPopup: R = !0,
|
|
1138
|
+
isDropdownFixed: P = !1,
|
|
1139
|
+
dropdownClassName: B = "",
|
|
1140
|
+
wrapperClass: K = "",
|
|
1141
|
+
maxInputLength: ne,
|
|
1142
|
+
alternateListBgStyle: ce,
|
|
1143
|
+
showLabelTooltip: de = !1,
|
|
1144
|
+
labelToolTipContent: Je = "",
|
|
1145
|
+
inputContainerClasses: _e = "",
|
|
1146
|
+
onInputFocus: pe
|
|
1147
|
+
} = f, [Y, Q] = be(!1), [X, Qe] = be(null), oe = re(null), he = re(null), Ee = re(null), me = re([]), Xe = it(() => O?.filter((N) => N ? N.label.toLowerCase().includes((n ?? "").toLowerCase()) : void 0), [n, O]), [et, ve] = be(!1), tt = () => {
|
|
1148
|
+
Q(!1), F && u && u(""), Qe(null);
|
|
1149
|
+
}, Ne = ue(
|
|
1150
|
+
(N) => {
|
|
1151
|
+
N.stopPropagation(), r || Q((D) => !D);
|
|
1152
|
+
},
|
|
1153
|
+
[r]
|
|
1154
|
+
), Se = (n?.length || 0) + 2 + Number(H || 0);
|
|
1155
|
+
Et(oe, tt), fe(() => {
|
|
1156
|
+
X !== null && me.current[X] && me.current[X].scrollIntoView({ block: "nearest" });
|
|
1157
|
+
}, [X]);
|
|
1158
|
+
const ee = ue(() => {
|
|
1159
|
+
if (P && Y) {
|
|
1160
|
+
const N = T ? he.current : Ee.current, D = oe.current;
|
|
1161
|
+
if (N && D) {
|
|
1162
|
+
const I = N.getBoundingClientRect();
|
|
1163
|
+
D.style.position = "fixed", D.style.top = `${window.scrollY ? I.bottom + window.scrollY : I.bottom}px`, D.style.left = `${I.left}px`, D.style.width = `${I.width}px`;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
}, [P, Y, T]);
|
|
1167
|
+
fe(() => {
|
|
1168
|
+
if (P)
|
|
1169
|
+
return Y ? (ee(), window.addEventListener("scroll", ee, !0)) : window.removeEventListener("scroll", ee, !0), () => {
|
|
1170
|
+
window.removeEventListener("scroll", ee, !0);
|
|
1171
|
+
};
|
|
1172
|
+
}, [P, ee, Y]), _t(oe, () => {
|
|
1173
|
+
et && c && c();
|
|
1174
|
+
});
|
|
1175
|
+
const Me = (N) => {
|
|
1176
|
+
if (F && G) {
|
|
1177
|
+
const D = L?.some((I) => I.value === N.value);
|
|
1178
|
+
G(!!D, N);
|
|
1179
|
+
}
|
|
1180
|
+
}, nt = ue(
|
|
1181
|
+
async (N) => {
|
|
1182
|
+
N.stopPropagation(), Y || Q(!0), pe && await pe();
|
|
1183
|
+
},
|
|
1184
|
+
[pe, Y]
|
|
1185
|
+
);
|
|
1186
|
+
return /* @__PURE__ */ C.jsxs("div", { className: `hfl-relative hfl-inline-block hfl-text-left ${K || ""}`, children: [
|
|
1187
|
+
!!o && /* @__PURE__ */ C.jsxs("div", { className: "hfl-text-Gray-700 hfl-mb-1 hfl-flex", children: [
|
|
1188
|
+
/* @__PURE__ */ C.jsx(Ce, { type: "Text sm", variant: "Medium", className: d || "", children: `${o}` }),
|
|
1189
|
+
p && /* @__PURE__ */ C.jsx("span", { className: "hfl-ml-1 hfl-text-Error-600", children: "*" }),
|
|
1190
|
+
de && /* @__PURE__ */ C.jsx(lt, { variant: "Right", text: Je, theme: "dark", children: /* @__PURE__ */ C.jsx("i", { className: "hx_info-filled" }) })
|
|
1191
|
+
] }),
|
|
1192
|
+
T ? /* @__PURE__ */ C.jsxs(C.Fragment, { children: [
|
|
1193
|
+
/* @__PURE__ */ C.jsxs(
|
|
1194
|
+
"div",
|
|
1195
|
+
{
|
|
1196
|
+
className: `hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${_e || ""} ${_ || "hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${t ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${l || "hfl-h-10"} ${r ? "!hfl-bg-Gray-50 !hfl-pointer-events-none" : x || "hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,
|
|
1197
|
+
onClick: r ? () => {
|
|
1198
|
+
} : Ne,
|
|
1199
|
+
children: [
|
|
1200
|
+
L?.map((N, D) => /* @__PURE__ */ C.jsxs(
|
|
1201
|
+
"div",
|
|
1202
|
+
{
|
|
1203
|
+
className: "hfl-flex hfl-items-center hfl-bg-Blue-100 hfl-mr-2 hfl-py-1 hfl-px-2 hfl-rounded-sm hfl-font-inter-0 hfl-text-nowrap",
|
|
1204
|
+
children: [
|
|
1205
|
+
/* @__PURE__ */ C.jsx("span", { className: "hfl-pointer-events-none", children: N.label }),
|
|
1206
|
+
/* @__PURE__ */ C.jsx(
|
|
1207
|
+
"span",
|
|
1208
|
+
{
|
|
1209
|
+
onClick: (I) => {
|
|
1210
|
+
I.stopPropagation(), Me(N);
|
|
1211
|
+
},
|
|
1212
|
+
className: "hx_close hfl-text-Gray-500 hfl-my-0 hfl-text-[14px] hfl-ml-[1px] hfl-cursor-pointer"
|
|
1213
|
+
}
|
|
1214
|
+
)
|
|
1215
|
+
]
|
|
1216
|
+
},
|
|
1217
|
+
`${N.label}-${D}`
|
|
1218
|
+
)),
|
|
1219
|
+
Object.keys(w || {}).length > 0 && /* @__PURE__ */ C.jsx("style", { children: `
|
|
1220
|
+
input.input-placeholder::placeholder {
|
|
1221
|
+
font-family: ${w?.fontFamily};
|
|
1222
|
+
font-weight: ${w?.fontWeight};
|
|
1223
|
+
line-height: ${w?.lineHeight};
|
|
1224
|
+
font-size: ${w?.fontSize};
|
|
1225
|
+
color: ${w?.color};
|
|
1226
|
+
}
|
|
1227
|
+
` }),
|
|
1228
|
+
/* @__PURE__ */ C.jsx(
|
|
1229
|
+
"input",
|
|
1230
|
+
{
|
|
1231
|
+
ref: he,
|
|
1232
|
+
style: z ? {} : { width: `${Number(n?.length) > 4 ? (n?.length || 0) + 5 : 12}ch` },
|
|
1233
|
+
type: M,
|
|
1234
|
+
placeholder: e,
|
|
1235
|
+
value: n,
|
|
1236
|
+
className: `input-placeholder hfl-flex-1 hfl-pl-2 hfl-placeholder hfl-py-1 focus-visible:hfl-outline-0 focus-visible:hfl-outline-none hfl-border-0 focus:hfl-border-0 ${r ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : x || "hfl-bg-White"} ${y || ""}`,
|
|
1237
|
+
onChange: (N) => {
|
|
1238
|
+
u && u(N.target.value), ve(!0);
|
|
1239
|
+
},
|
|
1240
|
+
onClick: nt,
|
|
1241
|
+
onKeyDown: (N) => S && S(N, Q, he),
|
|
1242
|
+
maxLength: ne ?? ne,
|
|
1243
|
+
...f.inputProps || {}
|
|
1244
|
+
}
|
|
1245
|
+
),
|
|
1246
|
+
!a && !s && /* @__PURE__ */ C.jsx("i", { className: "hx_down hfl-mx-2" }),
|
|
1247
|
+
s && /* @__PURE__ */ C.jsx(
|
|
1248
|
+
"i",
|
|
1249
|
+
{
|
|
1250
|
+
className: `${n ? "hx_close hfl-cursor-pointer" : "hx_down"} hfl-mx-2`,
|
|
1251
|
+
onClick: () => {
|
|
1252
|
+
(h?.value || n) && (u && u(""), ve(!0));
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
),
|
|
1256
|
+
A ? /* @__PURE__ */ C.jsx(
|
|
1257
|
+
"span",
|
|
1258
|
+
{
|
|
1259
|
+
style: { left: `${Se < 2 ? "3" : Se}ch` },
|
|
1260
|
+
className: "hfl-absolute hfl-top-1/2 hfl--translate-y-1/2 hfl-pointer-events-none",
|
|
1261
|
+
children: A
|
|
1262
|
+
}
|
|
1263
|
+
) : null
|
|
1264
|
+
]
|
|
1265
|
+
}
|
|
1266
|
+
),
|
|
1267
|
+
m && /* @__PURE__ */ C.jsx("span", { className: "hfl-text-0 hfl-text-Error-600", children: t })
|
|
1268
|
+
] }) : /* @__PURE__ */ C.jsxs(
|
|
1269
|
+
"button",
|
|
1270
|
+
{
|
|
1271
|
+
ref: Ee,
|
|
1272
|
+
onClick: Ne,
|
|
1273
|
+
className: `hfl-w-full hfl-bg-White hfl-py-[6px] hfl-px-4 hfl-rounded-lg hfl-inline-flex hfl-justify-between hfl-items-center ${g || ""} ${_ || "hfl-border-1"} ${t ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${l || "hfl-h-[40px]"} ${r ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : ""}`,
|
|
1274
|
+
style: W || h?.label ? {} : w ? {
|
|
1275
|
+
fontFamily: w?.fontFamily,
|
|
1276
|
+
fontSize: w?.fontSize,
|
|
1277
|
+
fontWeight: w?.fontWeight,
|
|
1278
|
+
lineHeight: w?.lineHeight,
|
|
1279
|
+
color: w?.color
|
|
1280
|
+
} : {},
|
|
1281
|
+
children: [
|
|
1282
|
+
/* @__PURE__ */ C.jsx("span", { className: "hfl-pr-4", children: W || h?.label || e || "Select an option" }),
|
|
1283
|
+
/* @__PURE__ */ C.jsx("img", { src: St, alt: "down arrow" })
|
|
1284
|
+
]
|
|
1285
|
+
}
|
|
1286
|
+
),
|
|
1287
|
+
O && O?.length >= 0 && /* @__PURE__ */ C.jsxs(
|
|
1288
|
+
"ul",
|
|
1289
|
+
{
|
|
1290
|
+
ref: oe,
|
|
1291
|
+
className: `custom-dropdown-menu ${Y ? "hfl-visible" : "hfl-invisible"} hfl-absolute hfl-z-50 hfl-grid hfl-gap-1 hfl-mt-3 hfl-w-full hfl-rounded-lg hfl-shadow-lg hfl-bg-White hfl-font-inter-0 hfl-p-1 hfl-px-2 ${F ? "hfl-min-w-[20em]" : "hfl-min-w-[16em]"} hfl-max-h-[330px] hfl-overflow-y-scroll ${B}`,
|
|
1292
|
+
role: "menu",
|
|
1293
|
+
"aria-orientation": "vertical",
|
|
1294
|
+
"aria-labelledby": "options-menu",
|
|
1295
|
+
children: [
|
|
1296
|
+
U ? /* @__PURE__ */ C.jsx(
|
|
1297
|
+
Nt,
|
|
1298
|
+
{
|
|
1299
|
+
onChangeHandler: j,
|
|
1300
|
+
selectedOption: b,
|
|
1301
|
+
options: v
|
|
1302
|
+
}
|
|
1303
|
+
) : !1,
|
|
1304
|
+
(E ? Xe : O)?.map((N, D) => {
|
|
1305
|
+
const I = F ? !!L?.some((ye) => ye.value === N?.value) : !1, Re = h?.value === N?.value, ot = X === D;
|
|
1306
|
+
return N ? /* @__PURE__ */ C.jsx(
|
|
1307
|
+
"li",
|
|
1308
|
+
{
|
|
1309
|
+
onClick: () => {
|
|
1310
|
+
F ? Me(N) : (i && i(N), Q(!1), ve(!1));
|
|
1311
|
+
},
|
|
1312
|
+
className: `hfl-text-1 hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item ${ce ? "odd:hfl-bg-Gray-100" : ""} ${Re ? "hfl-bg-Blue-50 hfl-text-Blue-500" : ""}`,
|
|
1313
|
+
role: "menuitem",
|
|
1314
|
+
"aria-selected": Re,
|
|
1315
|
+
tabIndex: ot ? 0 : -1,
|
|
1316
|
+
ref: (ye) => {
|
|
1317
|
+
me.current[D] = ye;
|
|
1318
|
+
},
|
|
1319
|
+
children: F ? /* @__PURE__ */ C.jsx(
|
|
1320
|
+
st,
|
|
1321
|
+
{
|
|
1322
|
+
size: "sm",
|
|
1323
|
+
disabled: !1,
|
|
1324
|
+
text: /* @__PURE__ */ C.jsx("span", { children: N.label }),
|
|
1325
|
+
secondaryText: "",
|
|
1326
|
+
id: `${N.label}-${D}`,
|
|
1327
|
+
isMarked: I
|
|
1328
|
+
}
|
|
1329
|
+
) : N.label
|
|
1330
|
+
},
|
|
1331
|
+
`${N.label}-${D}`
|
|
1332
|
+
) : null;
|
|
1333
|
+
}),
|
|
1334
|
+
O?.length === 0 && R && /* @__PURE__ */ C.jsx(
|
|
1335
|
+
"li",
|
|
1336
|
+
{
|
|
1337
|
+
className: "hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item",
|
|
1338
|
+
children: "No items found, please change the search criteria"
|
|
1339
|
+
}
|
|
1340
|
+
)
|
|
1341
|
+
]
|
|
1342
|
+
}
|
|
1343
|
+
)
|
|
1344
|
+
] });
|
|
1345
|
+
}
|
|
1346
|
+
export {
|
|
1347
|
+
Dt as A,
|
|
1348
|
+
Pt as C,
|
|
1349
|
+
xt as M,
|
|
1350
|
+
Nt as T
|
|
1351
|
+
};
|