@memobit/libs 3.11.2 → 3.11.3
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/components/Confetti/Confetti2.js +33 -33
- package/dist/components/ContextToast/ContextToast2.js +53 -57
- package/dist/components/ContextToast/useToast.js +12 -0
- package/dist/components/ControlPanel/ControlPanel2.js +41 -43
- package/dist/components/ControlPanel/ControlPanelContext.js +16 -21
- package/dist/components/ControlPanel/useControlPanel.js +11 -0
- package/dist/components/DataView/DataView.CardView.js +83 -109
- package/dist/components/DataView/DataView.MiniSort.js +1 -1
- package/dist/components/DataView/DataView.helpers.js +34 -0
- package/dist/components/DataView/DataView2.js +111 -108
- package/dist/components/Dropdown/Dropdown2.js +108 -106
- package/dist/components/InputEmail/InputEmail2.js +43 -43
- package/dist/components/InputEmail/validateEmail.js +7 -0
- package/dist/components/InputMask/InputMask2.js +40 -54
- package/dist/components/InputMask/InputMaskPresets.js +18 -0
- package/dist/components/Pagination/Pagination2.js +4 -4
- package/dist/components/Sidebar/Sidebar2.js +1 -1
- package/dist/components/Sidebar/SidebarContext.js +18 -23
- package/dist/components/Sidebar/useSidebar.js +11 -0
- package/dist/components/SuggestionsList/SuggestionsList2.js +27 -27
- package/dist/components/TimelineMarkers/TimelineMarkers2.js +31 -49
- package/dist/components/TimelineMarkers/calculateTimelineMarkers.js +28 -0
- package/dist/components/Toolbar/Toolbar2.js +6 -6
- package/dist/components/Tooltip/Tooltip2.js +35 -35
- package/dist/contexts/AuthContext/AuthContext.context.js +5 -0
- package/dist/contexts/AuthContext/AuthContext.js +5 -6
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useAppPersistence.js +20 -20
- package/dist/hooks/useAuth/useAuth.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +269 -262
- package/dist/version.js +1 -1
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import './Dropdown.css';
|
|
2
|
-
import { Icon as
|
|
2
|
+
import { Icon as D } from "../Icon/Icon2.js";
|
|
3
3
|
import { Button as ae } from "../Button/Button2.js";
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { InputText as
|
|
6
|
-
import { foldDiacritics as
|
|
4
|
+
import { Tooltip as je } from "../Tooltip/Tooltip2.js";
|
|
5
|
+
import { InputText as Ce } from "../InputText/InputText2.js";
|
|
6
|
+
import { foldDiacritics as pe } from "../../helpers/Search.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { useEffect as
|
|
8
|
+
import { useEffect as k, useId as _e, useRef as L, useState as O } from "react";
|
|
9
9
|
import { jsx as c, jsxs as g } from "react/jsx-runtime";
|
|
10
|
-
import { createPortal as
|
|
11
|
-
import { caretDown as
|
|
12
|
-
var
|
|
13
|
-
const [p, v] =
|
|
10
|
+
import { createPortal as ze } from "react-dom";
|
|
11
|
+
import { caretDown as Fe, clear as ue } from "@memobit/icons";
|
|
12
|
+
var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", disabled: x = !1, error: A, highlighted: me = !1, id: ge, label: J, maxVisibleSelectedLabels: ve = 1, multilineChips: be = !1, multiple: i = !1, name: N, onChange: u, onSearchChange: xe, options: m, placeholder: H = "Select an option", searchable: a = !0, searchValue: M, selectedCountDisplay: j = "inline", showChips: C = !1, sortSelectedFirst: Q = !1, success: _, usePortal: $ = !0, value: d, valueAsChip: Ne = !0 }) => {
|
|
13
|
+
const [p, v] = O(!1), [s, l] = O(M || ""), [f, X] = O(m), [S, y] = O(-1), [o, w] = O([]), [R, $e] = O({
|
|
14
14
|
top: 0,
|
|
15
15
|
bottom: 0,
|
|
16
16
|
left: 0,
|
|
17
17
|
width: 0,
|
|
18
18
|
maxHeight: 300
|
|
19
|
-
}), [z,
|
|
20
|
-
|
|
19
|
+
}), [z, ke] = O(!1), I = L(null), E = L([]), F = L(null), Le = L(null), Y = _e(), Z = ge ?? `dropdown-${Y}`, U = L(null), V = L(o);
|
|
20
|
+
k(() => {
|
|
21
|
+
V.current = o;
|
|
22
|
+
}), k(() => {
|
|
21
23
|
if (p && Q && i) {
|
|
22
|
-
const n = new Set(
|
|
24
|
+
const n = new Set(V.current.map((r) => r.value)), e = [], t = [];
|
|
23
25
|
m.forEach((r) => (n.has(r.value) ? e : t).push(r)), U.current = [...e, ...t];
|
|
24
26
|
} else p || (U.current = null);
|
|
25
27
|
}, [
|
|
@@ -27,24 +29,24 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
27
29
|
Q,
|
|
28
30
|
i,
|
|
29
31
|
m
|
|
30
|
-
]),
|
|
32
|
+
]), k(() => {
|
|
31
33
|
const n = U.current ?? m;
|
|
32
|
-
if (!
|
|
34
|
+
if (!a || !s) X(n);
|
|
33
35
|
else {
|
|
34
|
-
const e =
|
|
36
|
+
const e = pe(s), t = n.filter((r) => pe(r.label).includes(e));
|
|
35
37
|
X(t);
|
|
36
38
|
}
|
|
37
|
-
|
|
39
|
+
y(-1);
|
|
38
40
|
}, [
|
|
39
41
|
s,
|
|
40
42
|
m,
|
|
41
|
-
|
|
43
|
+
a,
|
|
42
44
|
p
|
|
43
45
|
]);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const n =
|
|
47
|
-
|
|
46
|
+
const ee = L(d);
|
|
47
|
+
k(() => {
|
|
48
|
+
const n = ee.current;
|
|
49
|
+
ee.current = d;
|
|
48
50
|
const e = !Object.is(n, d);
|
|
49
51
|
if (d == null) {
|
|
50
52
|
e && (w([]), l(""));
|
|
@@ -87,23 +89,23 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
87
89
|
d,
|
|
88
90
|
m,
|
|
89
91
|
i,
|
|
90
|
-
|
|
92
|
+
a,
|
|
91
93
|
h
|
|
92
|
-
]),
|
|
93
|
-
|
|
94
|
-
}, [M,
|
|
95
|
-
if (!p || !
|
|
94
|
+
]), k(() => {
|
|
95
|
+
a && M !== void 0 && l(M);
|
|
96
|
+
}, [M, a]), k(() => {
|
|
97
|
+
if (!p || !I.current) return;
|
|
96
98
|
const n = () => {
|
|
97
|
-
if (!
|
|
98
|
-
const t =
|
|
99
|
-
if (
|
|
100
|
-
const
|
|
101
|
-
|
|
99
|
+
if (!I.current) return;
|
|
100
|
+
const t = I.current.getBoundingClientRect(), r = window.visualViewport, T = r?.offsetTop ?? 0, Te = T + (r?.height ?? window.innerHeight), de = 300, Ae = 8, G = Te - t.bottom, le = t.top - T, fe = G < de && le > G;
|
|
101
|
+
if (ke(fe), $) {
|
|
102
|
+
const He = Math.max(0, (fe ? le : G) - Ae);
|
|
103
|
+
$e({
|
|
102
104
|
top: t.bottom,
|
|
103
105
|
bottom: window.innerHeight - t.top,
|
|
104
106
|
left: t.left,
|
|
105
107
|
width: t.width,
|
|
106
|
-
maxHeight: Math.min(
|
|
108
|
+
maxHeight: Math.min(de, He)
|
|
107
109
|
});
|
|
108
110
|
}
|
|
109
111
|
};
|
|
@@ -112,9 +114,9 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
112
114
|
return window.addEventListener("scroll", n, !0), window.addEventListener("resize", n), e?.addEventListener("resize", n), e?.addEventListener("scroll", n), () => {
|
|
113
115
|
window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", n), e?.removeEventListener("resize", n), e?.removeEventListener("scroll", n);
|
|
114
116
|
};
|
|
115
|
-
}, [p, $]),
|
|
117
|
+
}, [p, $]), k(() => {
|
|
116
118
|
const n = (e) => {
|
|
117
|
-
if (
|
|
119
|
+
if (I.current && !I.current.contains(e.target)) {
|
|
118
120
|
if ($ && p) {
|
|
119
121
|
const t = document.querySelector(".dropdown-menu--portal");
|
|
120
122
|
if (t && t.contains(e.target)) return;
|
|
@@ -128,7 +130,7 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
128
130
|
w([t]), l(t.label), v(!1), u && u(t, N);
|
|
129
131
|
return;
|
|
130
132
|
}
|
|
131
|
-
v(!1), !i && o.length > 0 ? l(o[0].label) : i &&
|
|
133
|
+
v(!1), !i && o.length > 0 ? l(o[0].label) : i && a && l("");
|
|
132
134
|
}
|
|
133
135
|
};
|
|
134
136
|
return document.addEventListener("mousedown", n), () => {
|
|
@@ -142,7 +144,7 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
142
144
|
N,
|
|
143
145
|
u,
|
|
144
146
|
m,
|
|
145
|
-
|
|
147
|
+
a,
|
|
146
148
|
o,
|
|
147
149
|
$
|
|
148
150
|
]);
|
|
@@ -151,7 +153,7 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
151
153
|
if (i) {
|
|
152
154
|
const e = o.some((r) => r.value === n.value);
|
|
153
155
|
let t;
|
|
154
|
-
e ? t = o.filter((r) => r.value !== n.value) : t = [...o, n], w(t),
|
|
156
|
+
e ? t = o.filter((r) => r.value !== n.value) : t = [...o, n], w(t), a && l(""), u && u(t, N);
|
|
155
157
|
} else
|
|
156
158
|
l(n.label), w([n]), v(!1), u && u(n, N);
|
|
157
159
|
}, P = () => {
|
|
@@ -171,18 +173,18 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
171
173
|
w(t), l(""), u && u(t, N);
|
|
172
174
|
} else
|
|
173
175
|
w([e]), l(e.label), v(!1), u && u(e, N);
|
|
174
|
-
},
|
|
176
|
+
}, ne = (n) => {
|
|
175
177
|
const e = o.filter((t) => t.value !== n.value);
|
|
176
|
-
w(e), u && (i ? u(e, N) : (u(null, N),
|
|
177
|
-
},
|
|
178
|
-
w([]), (!
|
|
179
|
-
},
|
|
180
|
-
l(n), p || v(!0),
|
|
181
|
-
},
|
|
182
|
-
x || (v(!0), !i &&
|
|
183
|
-
},
|
|
184
|
-
x || (v(!p), p || (
|
|
185
|
-
},
|
|
178
|
+
w(e), u && (i ? u(e, N) : (u(null, N), a || l("")));
|
|
179
|
+
}, Oe = () => {
|
|
180
|
+
w([]), (!a || !i) && l(""), v(!1), u && u(i ? [] : null, N);
|
|
181
|
+
}, Se = (n) => {
|
|
182
|
+
l(n), p || v(!0), xe?.(n);
|
|
183
|
+
}, te = () => {
|
|
184
|
+
x || (v(!0), !i && a && o.length > 0 && l(""), (i || a) && F.current?.focus());
|
|
185
|
+
}, ye = () => {
|
|
186
|
+
x || (v(!p), p || (y(-1), !i && a && o.length > 0 && l(""), (i || a) && F.current?.focus()));
|
|
187
|
+
}, Ie = (n) => {
|
|
186
188
|
if (!x) {
|
|
187
189
|
if (!p) {
|
|
188
190
|
(n.key === "ArrowDown" || n.key === "Enter") && (v(!0), n.preventDefault());
|
|
@@ -190,42 +192,42 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
190
192
|
}
|
|
191
193
|
switch (n.key) {
|
|
192
194
|
case "ArrowDown":
|
|
193
|
-
if (n.preventDefault(), h && s &&
|
|
194
|
-
|
|
195
|
-
const t = e < (h && s && !
|
|
196
|
-
return t <
|
|
195
|
+
if (n.preventDefault(), h && s && f.length === 0) return;
|
|
196
|
+
y((e) => {
|
|
197
|
+
const t = e < (h && s && !f.some((r) => r.label.toLowerCase() === s.toLowerCase()) ? f.length : f.length - 1) ? e + 1 : 0;
|
|
198
|
+
return t < f.length && E.current[t] && E.current[t]?.scrollIntoView({ block: "nearest" }), t;
|
|
197
199
|
});
|
|
198
200
|
break;
|
|
199
201
|
case "ArrowUp":
|
|
200
|
-
if (n.preventDefault(), h && s &&
|
|
201
|
-
|
|
202
|
-
const t = h && s && !
|
|
203
|
-
return r <
|
|
202
|
+
if (n.preventDefault(), h && s && f.length === 0) return;
|
|
203
|
+
y((e) => {
|
|
204
|
+
const t = h && s && !f.some((T) => T.label.toLowerCase() === s.toLowerCase()) ? f.length : f.length - 1, r = e > 0 ? e - 1 : t;
|
|
205
|
+
return r < f.length && E.current[r] && E.current[r]?.scrollIntoView({ block: "nearest" }), r;
|
|
204
206
|
});
|
|
205
207
|
break;
|
|
206
208
|
case "Enter":
|
|
207
|
-
n.preventDefault(),
|
|
209
|
+
n.preventDefault(), S >= 0 && S < f.length ? K(f[S]) : (h && s && S === f.length || h && s && f.length === 0) && P();
|
|
208
210
|
break;
|
|
209
211
|
case "Escape":
|
|
210
|
-
n.preventDefault(), v(!1), !i && o.length > 0 ? l(o[0].label) : i &&
|
|
212
|
+
n.preventDefault(), v(!1), !i && o.length > 0 ? l(o[0].label) : i && a && l("");
|
|
211
213
|
break;
|
|
212
214
|
case "Backspace":
|
|
213
|
-
i && s === "" && o.length > 0 && (n.preventDefault(),
|
|
215
|
+
i && s === "" && o.length > 0 && (n.preventDefault(), ne(o[o.length - 1]));
|
|
214
216
|
}
|
|
215
217
|
}
|
|
216
|
-
}, q = (n) => o.some((e) => e.value === n.value),
|
|
218
|
+
}, q = (n) => o.some((e) => e.value === n.value), Ee = () => {
|
|
217
219
|
if (o.length === 0) return "";
|
|
218
|
-
const n = Math.max(1,
|
|
220
|
+
const n = Math.max(1, ve);
|
|
219
221
|
if (o.length <= n) return o.map((r) => r.label).join(", ");
|
|
220
222
|
const e = o.slice(0, n).map((r) => r.label).join(", "), t = o.length - n;
|
|
221
223
|
return `${e} (+${t} ${t === 1 ? "other" : "others"})`;
|
|
222
|
-
},
|
|
224
|
+
}, De = () => i && C || a && p ? s : o.length > 0 ? i ? Ee() : o[0].label : "", Re = () => i && C ? o.length > 0 ? "" : H : p && a ? H : o.length > 0 ? "" : H, Be = () => !i || o.length === 0 || j === "none" ? null : j === "floating" ? /* @__PURE__ */ g("div", {
|
|
223
225
|
className: "dropdown-selected-count",
|
|
224
226
|
children: [o.length, " selected"]
|
|
225
|
-
}) : null,
|
|
227
|
+
}) : null, re = () => !!(h && s && s.trim() && !f.some((n) => n.label.toLowerCase() === s.toLowerCase() || n.value.toString() === s)), Me = () => {
|
|
226
228
|
if (!p || x) return null;
|
|
227
229
|
const n = /* @__PURE__ */ c("div", {
|
|
228
|
-
ref:
|
|
230
|
+
ref: Le,
|
|
229
231
|
className: `dropdown-menu ${$ ? "dropdown-menu--portal" : ""} ${z ? "dropdown-menu--upward" : ""}`,
|
|
230
232
|
style: $ ? {
|
|
231
233
|
position: "fixed",
|
|
@@ -236,15 +238,15 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
236
238
|
maxHeight: `${R.maxHeight}px`,
|
|
237
239
|
zIndex: 9999
|
|
238
240
|
} : void 0,
|
|
239
|
-
children:
|
|
241
|
+
children: f.length > 0 || re() ? /* @__PURE__ */ g("ul", {
|
|
240
242
|
className: "dropdown-options-list",
|
|
241
|
-
children: [
|
|
243
|
+
children: [f.map((e, t) => /* @__PURE__ */ g("li", {
|
|
242
244
|
ref: (r) => {
|
|
243
|
-
|
|
245
|
+
E.current[t] = r;
|
|
244
246
|
},
|
|
245
|
-
className: `dropdown-option ${e.className || ""} ${
|
|
247
|
+
className: `dropdown-option ${e.className || ""} ${S === t ? "focused" : ""} ${q(e) ? "selected" : ""} ${e.disabled ? "dropdown-option--disabled" : ""}`,
|
|
246
248
|
onClick: () => K(e),
|
|
247
|
-
onMouseEnter: () =>
|
|
249
|
+
onMouseEnter: () => y(t),
|
|
248
250
|
title: e.tooltip,
|
|
249
251
|
children: [i && /* @__PURE__ */ c("div", {
|
|
250
252
|
className: "dropdown-option-checkbox",
|
|
@@ -273,27 +275,27 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
273
275
|
className: "dropdown-option-prefix",
|
|
274
276
|
children: e.prefix
|
|
275
277
|
}),
|
|
276
|
-
e.icon && /* @__PURE__ */ c(
|
|
278
|
+
e.icon && /* @__PURE__ */ c(D, { name: e.icon }),
|
|
277
279
|
/* @__PURE__ */ c("span", { children: e.label }),
|
|
278
|
-
e.suffixIcon && /* @__PURE__ */ c(
|
|
280
|
+
e.suffixIcon && /* @__PURE__ */ c(D, { name: e.suffixIcon })
|
|
279
281
|
]
|
|
280
282
|
}), e.details && /* @__PURE__ */ c("span", {
|
|
281
283
|
className: "dropdown-option-details",
|
|
282
284
|
children: e.details
|
|
283
285
|
})]
|
|
284
286
|
})]
|
|
285
|
-
}, `dd-option-${Y}-${t}`)),
|
|
287
|
+
}, `dd-option-${Y}-${t}`)), re() && /* @__PURE__ */ c("li", {
|
|
286
288
|
ref: (e) => {
|
|
287
|
-
|
|
289
|
+
E.current[f.length] = e;
|
|
288
290
|
},
|
|
289
|
-
className: `dropdown-option dropdown-option--create ${
|
|
291
|
+
className: `dropdown-option dropdown-option--create ${S === f.length ? "focused" : ""}`,
|
|
290
292
|
onClick: P,
|
|
291
|
-
onMouseEnter: () =>
|
|
293
|
+
onMouseEnter: () => y(f.length),
|
|
292
294
|
children: /* @__PURE__ */ c("div", {
|
|
293
295
|
className: "dropdown-option-content",
|
|
294
296
|
children: /* @__PURE__ */ g("span", {
|
|
295
297
|
className: "dropdown-option-label",
|
|
296
|
-
children: [/* @__PURE__ */ c(
|
|
298
|
+
children: [/* @__PURE__ */ c(D, { name: "plus" }), /* @__PURE__ */ g("span", { children: [
|
|
297
299
|
"Create “",
|
|
298
300
|
s,
|
|
299
301
|
"”"
|
|
@@ -306,11 +308,11 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
306
308
|
children: "No options found"
|
|
307
309
|
})
|
|
308
310
|
});
|
|
309
|
-
return $ ?
|
|
310
|
-
}, b = !i && o.length === 1 ? o[0] : null, B =
|
|
311
|
+
return $ ? ze(n, document.body) : n;
|
|
312
|
+
}, b = !i && o.length === 1 ? o[0] : null, B = Ne && !p && !i && o.length > 0, oe = !!(b?.icon && !s && !B), ie = !!(b?.suffixIcon && !B), W = i && C, se = o.length > 0, ce = a || h;
|
|
311
313
|
return /* @__PURE__ */ g("div", {
|
|
312
|
-
className: `dropdown-container ${A ? "dropdown-error" : ""} ${_ ? "dropdown-success" : ""} ${
|
|
313
|
-
ref:
|
|
314
|
+
className: `dropdown-container ${A ? "dropdown-error" : ""} ${_ ? "dropdown-success" : ""} ${me ? "dropdown-highlighted" : ""} ${i ? "multiple" : ""} ${x ? "disabled" : ""} ${i ? `count-display-${j}` : ""} ${he}`,
|
|
315
|
+
ref: I,
|
|
314
316
|
children: [
|
|
315
317
|
J && /* @__PURE__ */ c("label", {
|
|
316
318
|
htmlFor: Z,
|
|
@@ -318,16 +320,16 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
318
320
|
children: J
|
|
319
321
|
}),
|
|
320
322
|
/* @__PURE__ */ g("div", {
|
|
321
|
-
className: `dropdown-input-container ${
|
|
323
|
+
className: `dropdown-input-container ${oe ? "dropdown-input-container--has-prefix-icon" : ""} ${ie ? "dropdown-input-container--has-suffix-icon" : ""} ${W ? "dropdown-input-container--chips" : ""} ${W && be ? "dropdown-input-container--chips-multiline" : ""} ${se ? "dropdown-input-container--clearable" : ""}`,
|
|
322
324
|
children: [
|
|
323
|
-
|
|
325
|
+
oe && b?.icon && /* @__PURE__ */ c("span", {
|
|
324
326
|
className: "dropdown-selected-icon dropdown-selected-icon--prefix",
|
|
325
|
-
children: /* @__PURE__ */ c(
|
|
327
|
+
children: /* @__PURE__ */ c(D, { name: b.icon })
|
|
326
328
|
}),
|
|
327
329
|
B && b && /* @__PURE__ */ g("span", {
|
|
328
330
|
className: "dropdown-value-chip",
|
|
329
|
-
onClick:
|
|
330
|
-
children: [b.icon && /* @__PURE__ */ c(
|
|
331
|
+
onClick: te,
|
|
332
|
+
children: [b.icon && /* @__PURE__ */ c(D, { name: b.icon }), /* @__PURE__ */ c("span", {
|
|
331
333
|
className: "dropdown-value-chip__label",
|
|
332
334
|
children: b.label
|
|
333
335
|
})]
|
|
@@ -337,63 +339,63 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
337
339
|
children: [/* @__PURE__ */ c("span", {
|
|
338
340
|
className: "dropdown-chip__label",
|
|
339
341
|
children: n.label
|
|
340
|
-
}), /* @__PURE__ */ c(
|
|
342
|
+
}), /* @__PURE__ */ c(je, {
|
|
341
343
|
title: "Remove",
|
|
342
344
|
children: /* @__PURE__ */ c("button", {
|
|
343
345
|
type: "button",
|
|
344
346
|
className: "dropdown-chip__remove",
|
|
345
347
|
disabled: x,
|
|
346
348
|
onClick: (e) => {
|
|
347
|
-
e.stopPropagation(),
|
|
349
|
+
e.stopPropagation(), ne(n);
|
|
348
350
|
},
|
|
349
|
-
children:
|
|
351
|
+
children: ue
|
|
350
352
|
})
|
|
351
353
|
})]
|
|
352
354
|
}, `dd-chip-${n.value}`)),
|
|
353
|
-
/* @__PURE__ */ c(
|
|
355
|
+
/* @__PURE__ */ c(Ce, {
|
|
354
356
|
ref: F,
|
|
355
357
|
id: Z,
|
|
356
|
-
placeholder: B ? "" :
|
|
357
|
-
value: B ? "" :
|
|
358
|
-
onChange:
|
|
359
|
-
onClick:
|
|
360
|
-
onKeyDown:
|
|
358
|
+
placeholder: B ? "" : Re(),
|
|
359
|
+
value: B ? "" : De(),
|
|
360
|
+
onChange: ce ? Se : void 0,
|
|
361
|
+
onClick: te,
|
|
362
|
+
onKeyDown: Ie,
|
|
361
363
|
autoComplete: "off",
|
|
362
|
-
autoFocus:
|
|
364
|
+
autoFocus: we,
|
|
363
365
|
disabled: x,
|
|
364
|
-
readOnly: !
|
|
366
|
+
readOnly: !ce
|
|
365
367
|
}),
|
|
366
368
|
/* @__PURE__ */ g("div", {
|
|
367
369
|
className: "dropdown-actions-buttons",
|
|
368
370
|
children: [
|
|
369
|
-
|
|
371
|
+
ie && b?.suffixIcon && /* @__PURE__ */ c("span", {
|
|
370
372
|
className: "dropdown-selected-icon dropdown-selected-icon--suffix",
|
|
371
|
-
children: /* @__PURE__ */ c(
|
|
373
|
+
children: /* @__PURE__ */ c(D, { name: b.suffixIcon })
|
|
372
374
|
}),
|
|
373
|
-
|
|
375
|
+
se && /* @__PURE__ */ c("span", {
|
|
374
376
|
className: "dropdown-action-button dropdown-clear-button",
|
|
375
377
|
children: /* @__PURE__ */ c(ae, {
|
|
376
378
|
variant: "plain",
|
|
377
|
-
onClick:
|
|
379
|
+
onClick: Oe,
|
|
378
380
|
disabled: x,
|
|
379
|
-
children:
|
|
381
|
+
children: ue
|
|
380
382
|
})
|
|
381
383
|
}),
|
|
382
384
|
/* @__PURE__ */ c("span", {
|
|
383
385
|
className: `dropdown-action-button dropdown-toggle-button ${p ? "open" : ""}`,
|
|
384
386
|
children: /* @__PURE__ */ c(ae, {
|
|
385
387
|
variant: "plain",
|
|
386
|
-
onClick:
|
|
388
|
+
onClick: ye,
|
|
387
389
|
disabled: x,
|
|
388
|
-
children:
|
|
390
|
+
children: Fe
|
|
389
391
|
})
|
|
390
392
|
})
|
|
391
393
|
]
|
|
392
394
|
}),
|
|
393
|
-
|
|
395
|
+
Be()
|
|
394
396
|
]
|
|
395
397
|
}),
|
|
396
|
-
|
|
398
|
+
Me(),
|
|
397
399
|
A && /* @__PURE__ */ c("span", {
|
|
398
400
|
className: "dropdown-error-message",
|
|
399
401
|
children: A
|
|
@@ -406,5 +408,5 @@ var Ze = ({ allowCustomValue: h = !1, autofocus: ue = !1, className: we = "", di
|
|
|
406
408
|
});
|
|
407
409
|
};
|
|
408
410
|
export {
|
|
409
|
-
|
|
411
|
+
Ve as Dropdown
|
|
410
412
|
};
|
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
import './InputEmail.css';
|
|
2
2
|
/* empty css */
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { validateEmail as z } from "./validateEmail.js";
|
|
4
|
+
import { forwardRef as A, useCallback as D, useEffect as G, useState as N } from "react";
|
|
5
|
+
import { jsx as m, jsxs as b } from "react/jsx-runtime";
|
|
6
|
+
var H = A(({ autoComplete: E = "on", autoFocus: I, disabled: x, error: C = "Please enter a valid email address", highlighted: $, id: o, label: c, maxLength: j, onBlur: y, onChange: B, onClick: T, onKeyDown: k, onKeyUp: v, onValidate: a, placeholder: w, readOnly: F = !1, required: i = !1, showValidation: p = !1, success: n, validateOn: r = "blur", value: t }, P) => {
|
|
7
|
+
const [h, u] = N(!0), [f, d] = N(!1), l = D((e) => i && (!e || e.trim() === "") ? !1 : !e || e.trim() === "" ? !0 : z(e), [i]);
|
|
7
8
|
G(() => {
|
|
8
|
-
if (
|
|
9
|
-
const e =
|
|
9
|
+
if (t !== void 0) {
|
|
10
|
+
const e = l(t);
|
|
10
11
|
u(e), a?.(e);
|
|
11
12
|
}
|
|
12
13
|
}, [
|
|
13
|
-
|
|
14
|
+
t,
|
|
14
15
|
a,
|
|
15
|
-
|
|
16
|
+
l
|
|
16
17
|
]);
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
u(
|
|
18
|
+
const R = (e) => {
|
|
19
|
+
if (B?.(e), r === "change" || r === "both") {
|
|
20
|
+
const s = l(e);
|
|
21
|
+
u(s), d(!0), a?.(s);
|
|
21
22
|
}
|
|
22
|
-
},
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
25
|
-
u(
|
|
23
|
+
}, S = (e) => {
|
|
24
|
+
if (d(!0), r === "blur" || r === "both") {
|
|
25
|
+
const s = l(e.target.value);
|
|
26
|
+
u(s), a?.(s);
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
},
|
|
28
|
+
y?.(e);
|
|
29
|
+
}, g = p && f && !h;
|
|
29
30
|
return /* @__PURE__ */ b("div", {
|
|
30
|
-
className: `input-email-wrapper${
|
|
31
|
+
className: `input-email-wrapper${$ ? " input-email-highlighted" : ""}`,
|
|
31
32
|
children: [
|
|
32
|
-
|
|
33
|
+
c && /* @__PURE__ */ b("label", {
|
|
33
34
|
htmlFor: o,
|
|
34
35
|
className: "input-email-label",
|
|
35
|
-
children: [
|
|
36
|
+
children: [c, i && /* @__PURE__ */ m("span", {
|
|
36
37
|
className: "input-email-required",
|
|
37
38
|
children: "*"
|
|
38
39
|
})]
|
|
39
40
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
autoComplete:
|
|
41
|
+
/* @__PURE__ */ m("input", {
|
|
42
|
+
autoComplete: E,
|
|
42
43
|
autoFocus: I,
|
|
43
|
-
disabled:
|
|
44
|
+
disabled: x,
|
|
44
45
|
type: "email",
|
|
45
|
-
className: `input-email${
|
|
46
|
+
className: `input-email${g ? " input-email--error" : ""}${n ? " input-email-success" : h && f && p ? " input-email--valid" : ""}`,
|
|
46
47
|
id: o,
|
|
47
|
-
maxLength:
|
|
48
|
-
placeholder:
|
|
49
|
-
ref:
|
|
50
|
-
value:
|
|
51
|
-
onBlur:
|
|
52
|
-
onChange: (e) =>
|
|
53
|
-
onClick:
|
|
54
|
-
onKeyDown:
|
|
55
|
-
onKeyUp:
|
|
56
|
-
readOnly:
|
|
57
|
-
required:
|
|
48
|
+
maxLength: j,
|
|
49
|
+
placeholder: w,
|
|
50
|
+
ref: P,
|
|
51
|
+
value: t,
|
|
52
|
+
onBlur: S,
|
|
53
|
+
onChange: (e) => R(e.target.value),
|
|
54
|
+
onClick: T,
|
|
55
|
+
onKeyDown: k,
|
|
56
|
+
onKeyUp: v,
|
|
57
|
+
readOnly: F,
|
|
58
|
+
required: i
|
|
58
59
|
}),
|
|
59
|
-
|
|
60
|
+
g && /* @__PURE__ */ m("span", {
|
|
60
61
|
className: "input-email-error-message",
|
|
61
|
-
children:
|
|
62
|
+
children: C
|
|
62
63
|
}),
|
|
63
|
-
|
|
64
|
+
n && /* @__PURE__ */ m("span", {
|
|
64
65
|
className: "input-email-success-message",
|
|
65
|
-
children:
|
|
66
|
+
children: n
|
|
66
67
|
})
|
|
67
68
|
]
|
|
68
69
|
});
|
|
69
70
|
});
|
|
70
|
-
|
|
71
|
+
H.displayName = "InputEmail";
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
-
M as validateEmail
|
|
73
|
+
H as InputEmail
|
|
74
74
|
};
|