wafields 0.38.1 → 0.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/wafields.es.js
CHANGED
|
@@ -48228,68 +48228,77 @@ function nP({ entries: e, onRemove: t }) {
|
|
|
48228
48228
|
}
|
|
48229
48229
|
//#endregion
|
|
48230
48230
|
//#region src/common/inviteByEmails/InviteByEmails.tsx
|
|
48231
|
-
function rP({ onInvite: e }) {
|
|
48232
|
-
let [
|
|
48233
|
-
let e =
|
|
48231
|
+
function rP({ onInvite: e, disabled: t, unsentEmails: n, errorMessage: r, className: i = "" }) {
|
|
48232
|
+
let [a, o] = y(!1), [s, c] = y(""), [l, u] = y(""), [d, f] = y([]), [p, h] = y(""), [g, _] = y(""), [v, C] = y(!1), w = () => {
|
|
48233
|
+
let e = s.trim();
|
|
48234
48234
|
if (!Cn(e)) {
|
|
48235
|
-
|
|
48235
|
+
h("Invalid email address.");
|
|
48236
48236
|
return;
|
|
48237
48237
|
}
|
|
48238
|
-
if (
|
|
48239
|
-
|
|
48238
|
+
if (d.some((t) => t.email === e)) {
|
|
48239
|
+
h("Email already added.");
|
|
48240
48240
|
return;
|
|
48241
48241
|
}
|
|
48242
|
-
|
|
48242
|
+
f([...d, {
|
|
48243
48243
|
email: e,
|
|
48244
|
-
note:
|
|
48245
|
-
}]),
|
|
48246
|
-
},
|
|
48247
|
-
|
|
48248
|
-
},
|
|
48249
|
-
|
|
48244
|
+
note: l.trim()
|
|
48245
|
+
}]), c(""), u(""), h(""), _(`${e} added.`);
|
|
48246
|
+
}, T = () => {
|
|
48247
|
+
c(""), u(""), h(""), _("");
|
|
48248
|
+
}, E = () => {
|
|
48249
|
+
o(!1), T(), f([]), C(!1);
|
|
48250
48250
|
};
|
|
48251
|
-
return
|
|
48251
|
+
return m(() => {
|
|
48252
|
+
!v || t || (n.length === 0 && !r ? E() : C(!1));
|
|
48253
|
+
}, [
|
|
48254
|
+
t,
|
|
48255
|
+
n,
|
|
48256
|
+
r,
|
|
48257
|
+
v
|
|
48258
|
+
]), /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(oo, {
|
|
48252
48259
|
icon: {
|
|
48253
48260
|
Svg: MN,
|
|
48254
48261
|
className: "text-blue-500 fill-none"
|
|
48255
48262
|
},
|
|
48256
48263
|
label: "Invite Friends",
|
|
48257
|
-
onClick: () =>
|
|
48258
|
-
className: "
|
|
48264
|
+
onClick: () => o(!0),
|
|
48265
|
+
className: Ft("w-fit", i),
|
|
48259
48266
|
labelClassName: "text-blue-500 text-sm whitespace-nowrap"
|
|
48260
48267
|
}), /* @__PURE__ */ x(bo, {
|
|
48261
|
-
isOpen:
|
|
48262
|
-
onClose:
|
|
48268
|
+
isOpen: a,
|
|
48269
|
+
onClose: E,
|
|
48263
48270
|
title: "Invite Friends",
|
|
48264
48271
|
content: /* @__PURE__ */ S(ko, {
|
|
48265
48272
|
className: "gap-3 w-full",
|
|
48266
48273
|
children: [
|
|
48267
48274
|
/* @__PURE__ */ x(eP, {
|
|
48268
|
-
input:
|
|
48269
|
-
noteInput:
|
|
48270
|
-
error:
|
|
48271
|
-
addedNote:
|
|
48275
|
+
input: s,
|
|
48276
|
+
noteInput: l,
|
|
48277
|
+
error: p,
|
|
48278
|
+
addedNote: g,
|
|
48272
48279
|
onInputChange: (e) => {
|
|
48273
|
-
|
|
48280
|
+
c(e), h(""), _("");
|
|
48274
48281
|
},
|
|
48275
|
-
onNoteChange:
|
|
48276
|
-
onAdd:
|
|
48277
|
-
onClear:
|
|
48282
|
+
onNoteChange: u,
|
|
48283
|
+
onAdd: w,
|
|
48284
|
+
onClear: T
|
|
48278
48285
|
}),
|
|
48279
48286
|
/* @__PURE__ */ x(nP, {
|
|
48280
|
-
entries:
|
|
48287
|
+
entries: d,
|
|
48281
48288
|
onRemove: (e) => {
|
|
48282
|
-
|
|
48289
|
+
f(d.filter((t) => t.email !== e));
|
|
48283
48290
|
}
|
|
48284
48291
|
}),
|
|
48292
|
+
n.length > 0 && /* @__PURE__ */ x(kD, { label: `Failed to send to: ${n.join(", ")}` }),
|
|
48293
|
+
r && /* @__PURE__ */ x(kD, { label: r }),
|
|
48285
48294
|
/* @__PURE__ */ x(Lx, {}),
|
|
48286
48295
|
/* @__PURE__ */ x(Co, {
|
|
48287
48296
|
saveLabel: "Send Invitations",
|
|
48288
48297
|
onSave: () => {
|
|
48289
|
-
e(
|
|
48298
|
+
e(d), C(!0);
|
|
48290
48299
|
},
|
|
48291
|
-
onCancel:
|
|
48292
|
-
isSaveDisabled:
|
|
48300
|
+
onCancel: E,
|
|
48301
|
+
isSaveDisabled: d.length === 0 || t
|
|
48293
48302
|
})
|
|
48294
48303
|
]
|
|
48295
48304
|
})
|