@boxyhq/react-ui
Advanced tools
Comparing version 3.3.30 to 3.3.31
@@ -1,47 +0,11 @@ | ||
import { j as e, S as g, c as z, a as ie } from "./index-75d1f91f.js"; | ||
import { useState as v, useEffect as V } from "react"; | ||
import { I as L, S as oe, C as re, B as A, s as I, L as de, T as me, E as le, a as ue, b as he } from "./index-2280ef17.js"; | ||
var O = /* @__PURE__ */ ((n) => (n["azure-scim-v2"] = "Azure SCIM v2.0", n["onelogin-scim-v2"] = "OneLogin SCIM v2.0", n["okta-scim-v2"] = "Okta SCIM v2.0", n["jumpcloud-scim-v2"] = "JumpCloud v2.0", n["generic-scim-v2"] = "Generic SCIM v2.0", n.google = "Google", n))(O || {}); | ||
const fe = "_heading_h67it_3", be = "_fieldContainer_h67it_17", ge = "_formAction_h67it_22", P = { | ||
import { j as e, S as g, c as $, a as ce } from "./index-75d1f91f.js"; | ||
import { useState as j, useEffect as O } from "react"; | ||
import { I as L, S as ue, a as le, C as oe, B as A, s as I, L as re, T as me, E as ie, b as de, c as he } from "./index-5d53df07.js"; | ||
var R = /* @__PURE__ */ ((n) => (n["azure-scim-v2"] = "Azure SCIM v2.0", n["onelogin-scim-v2"] = "OneLogin SCIM v2.0", n["okta-scim-v2"] = "Okta SCIM v2.0", n["jumpcloud-scim-v2"] = "JumpCloud v2.0", n["generic-scim-v2"] = "Generic SCIM v2.0", n.google = "Google", n))(R || {}); | ||
const fe = "_heading_h67it_3", ge = "_fieldContainer_h67it_17", be = "_formAction_h67it_22", P = { | ||
"sr-only": "_sr-only_h67it_1", | ||
heading: fe, | ||
fieldContainer: be, | ||
formAction: ge | ||
}, Ce = "_label_1odz8_9", _e = "_div_1odz8_17", xe = "_select_1odz8_49", ye = "_focus_1odz8_77", $ = { | ||
"sr-only": "_sr-only_1odz8_1", | ||
label: Ce, | ||
div: _e, | ||
"div--disabled": "_div--disabled_1odz8_43", | ||
select: xe, | ||
focus: ye | ||
}; | ||
function je(n) { | ||
var j; | ||
function c() { | ||
return n.id ? n.id : n.label.replace(/ /g, ""); | ||
} | ||
function y() { | ||
return $.div + (n.disabled ? ` ${$["div--disabled"]}` : ""); | ||
} | ||
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx("label", { htmlFor: c(), className: $.label, children: n.label }), | ||
/* @__PURE__ */ e.jsx(g, { y: 2 }), | ||
/* @__PURE__ */ e.jsxs("div", { className: y(), children: [ | ||
/* @__PURE__ */ e.jsx( | ||
"select", | ||
{ | ||
id: c(), | ||
name: n.name, | ||
className: $.select, | ||
disabled: n.disabled ?? !1, | ||
value: n.selectedValue, | ||
onChange: (h) => n.handleChange(h), | ||
children: (j = n.options) == null ? void 0 : j.map((h) => /* @__PURE__ */ e.jsx("option", { value: h.value, children: h.text }, h.value)) | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx("span", { className: $.focus }) | ||
] }) | ||
] }); | ||
} | ||
const ke = { | ||
fieldContainer: ge, | ||
formAction: be | ||
}, Ce = { | ||
name: "", | ||
@@ -56,8 +20,8 @@ tenant: "", | ||
}; | ||
function ve(n) { | ||
var d, i; | ||
const [c, y] = v(() => ke), [j, h] = v(() => !1), [D, w] = v(() => !1); | ||
function xe(n) { | ||
var d, c; | ||
const [i, k] = j(() => Ce), [w, F] = j(() => !1), [D, v] = j(() => !1); | ||
function E() { | ||
var t; | ||
return (t = Object.entries(O)) == null ? void 0 : t.map( | ||
return (t = Object.entries(R)) == null ? void 0 : t.map( | ||
([a, o]) => ({ | ||
@@ -72,28 +36,28 @@ value: a, | ||
const a = (o = t == null ? void 0 : t.target) == null ? void 0 : o.value; | ||
h(a === "google"), y({ | ||
...c, | ||
F(a === "google"), k({ | ||
...i, | ||
type: a | ||
}); | ||
} | ||
function C() { | ||
var t, a, o, N, k; | ||
function b() { | ||
var t, a, o, _, y; | ||
return { | ||
fieldContainer: z( | ||
fieldContainer: $( | ||
(t = n.classNames) == null ? void 0 : t.fieldContainer, | ||
P.fieldContainer | ||
), | ||
label: z((a = n.classNames) == null ? void 0 : a.label, P.label), | ||
label: $((a = n.classNames) == null ? void 0 : a.label, P.label), | ||
inputField: { | ||
label: (o = n.classNames) == null ? void 0 : o.label, | ||
input: (N = n.classNames) == null ? void 0 : N.input, | ||
container: (k = n.classNames) == null ? void 0 : k.fieldContainer | ||
input: (_ = n.classNames) == null ? void 0 : _.input, | ||
container: (y = n.classNames) == null ? void 0 : y.fieldContainer | ||
} | ||
}; | ||
} | ||
function _() { | ||
function C() { | ||
return n.displayHeader !== void 0 ? n.displayHeader : !0; | ||
} | ||
function F(t) { | ||
function N(t) { | ||
return { | ||
...c, | ||
...i, | ||
...t | ||
@@ -104,4 +68,4 @@ }; | ||
const a = t.target, o = a.type === "checkbox" ? a.checked : a.value; | ||
y( | ||
F({ | ||
k( | ||
N({ | ||
[a.id]: o | ||
@@ -113,5 +77,5 @@ }) | ||
t.preventDefault(); | ||
async function a(o, N) { | ||
w(!0); | ||
const k = await I(N, { | ||
async function a(o, _) { | ||
v(!0); | ||
const y = await I(_, { | ||
method: "POST", | ||
@@ -123,8 +87,8 @@ headers: { | ||
}); | ||
w(!1), k && ("error" in k && k.error ? typeof n.errorCallback == "function" && n.errorCallback(k.error.message) : "data" in k && typeof n.successCallback == "function" && n.successCallback({ | ||
v(!1), y && ("error" in y && y.error ? typeof n.errorCallback == "function" && n.errorCallback(y.error.message) : "data" in y && typeof n.successCallback == "function" && n.successCallback({ | ||
operation: "CREATE", | ||
connection: k.data | ||
connection: y.data | ||
})); | ||
} | ||
a(c, n.urls.post); | ||
a(i, n.urls.post); | ||
} | ||
@@ -137,12 +101,12 @@ function s(t) { | ||
} | ||
return V(() => { | ||
y( | ||
F({ | ||
tenant: n.tenant ?? c.tenant, | ||
product: n.product ?? c.product, | ||
webhook_url: n.defaultWebhookEndpoint ?? c.webhook_url | ||
return O(() => { | ||
k( | ||
N({ | ||
tenant: n.tenant ?? i.tenant, | ||
product: n.product ?? i.product, | ||
webhook_url: n.defaultWebhookEndpoint ?? i.webhook_url | ||
}) | ||
); | ||
}, [n.tenant, n.product, n.defaultWebhookEndpoint]), /* @__PURE__ */ e.jsxs("div", { children: [ | ||
_() ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("h2", { className: P.heading, children: "Create Directory" }) }) : null, | ||
C() ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("h2", { className: P.heading, children: "Create Directory" }) }) : null, | ||
/* @__PURE__ */ e.jsxs("form", { onSubmit: (t) => r(t), children: [ | ||
@@ -156,6 +120,6 @@ s("name") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
name: "name", | ||
value: c.name, | ||
value: i.name, | ||
handleInputChange: u, | ||
required: !0, | ||
classNames: C().inputField | ||
classNames: b().inputField | ||
} | ||
@@ -165,5 +129,5 @@ ), | ||
] }), | ||
s("type") ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: C().fieldContainer, children: [ | ||
s("type") ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: b().fieldContainer, children: [ | ||
/* @__PURE__ */ e.jsx( | ||
je, | ||
ue, | ||
{ | ||
@@ -174,3 +138,3 @@ label: "Directory provider", | ||
options: E(), | ||
selectedValue: c.type, | ||
selectedValue: i.type, | ||
handleChange: l | ||
@@ -181,3 +145,3 @@ } | ||
] }) }), | ||
j ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
w ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx( | ||
@@ -190,6 +154,6 @@ L, | ||
title: "Please enter a valid domain (e.g: boxyhq.com)", | ||
value: c.google_domain || "", | ||
value: i.google_domain || "", | ||
handleInputChange: u, | ||
pattern: "^[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)*.[a-zA-Z]{2,}$", | ||
classNames: C().inputField | ||
classNames: b().inputField | ||
} | ||
@@ -206,6 +170,6 @@ ), | ||
name: "tenant", | ||
value: c.tenant, | ||
value: i.tenant, | ||
handleInputChange: u, | ||
required: !0, | ||
classNames: C().inputField | ||
classNames: b().inputField | ||
} | ||
@@ -222,6 +186,6 @@ ), | ||
name: "product", | ||
value: c.product, | ||
value: i.product, | ||
handleInputChange: u, | ||
required: !0, | ||
classNames: C().inputField | ||
classNames: b().inputField | ||
} | ||
@@ -239,5 +203,5 @@ ), | ||
name: "webhook_url", | ||
value: c.webhook_url, | ||
value: i.webhook_url, | ||
handleInputChange: u, | ||
classNames: C().inputField | ||
classNames: b().inputField | ||
} | ||
@@ -249,3 +213,3 @@ ), | ||
/* @__PURE__ */ e.jsx( | ||
oe, | ||
le, | ||
{ | ||
@@ -255,5 +219,5 @@ label: "Webhook secret", | ||
name: "webhook_secret", | ||
value: c.webhook_secret, | ||
value: i.webhook_secret, | ||
handleChange: u, | ||
classNames: C().inputField, | ||
classNames: b().inputField, | ||
required: !1, | ||
@@ -267,3 +231,3 @@ readOnly: !1 | ||
/* @__PURE__ */ e.jsx( | ||
re, | ||
oe, | ||
{ | ||
@@ -273,3 +237,3 @@ label: "Enable Webhook events logging", | ||
name: "log_webhook_events", | ||
checked: c.log_webhook_events, | ||
checked: i.log_webhook_events, | ||
handleChange: u | ||
@@ -296,3 +260,3 @@ } | ||
name: "Create Directory", | ||
classNames: (i = (d = n.classNames) == null ? void 0 : d.button) == null ? void 0 : i.ctoa, | ||
classNames: (c = (d = n.classNames) == null ? void 0 : d.button) == null ? void 0 : c.ctoa, | ||
isLoading: D | ||
@@ -305,33 +269,33 @@ } | ||
} | ||
const Ne = "_tableContainer_1t86z_1", we = { | ||
tableContainer: Ne | ||
}, Fe = { | ||
const ye = "_tableContainer_1t86z_1", je = { | ||
tableContainer: ye | ||
}, _e = { | ||
directoryListData: [] | ||
}; | ||
function De(n) { | ||
const [c, y] = v( | ||
() => Fe.directoryListData | ||
function ke(n) { | ||
const [i, k] = j( | ||
() => _e.directoryListData | ||
); | ||
function j() { | ||
function w() { | ||
var s; | ||
return (s = Object.entries(O)) == null ? void 0 : s.map( | ||
([d, i]) => ({ | ||
return (s = Object.entries(R)) == null ? void 0 : s.map( | ||
([d, c]) => ({ | ||
value: d, | ||
text: i | ||
text: c | ||
}) | ||
); | ||
} | ||
const [h, D] = v( | ||
const [F, D] = j( | ||
() => !0 | ||
), [w, E] = v(() => !1), [l, C] = v(() => ""); | ||
function _() { | ||
), [v, E] = j(() => !1), [l, b] = j(() => ""); | ||
function C() { | ||
var s; | ||
return { | ||
tableContainer: z( | ||
tableContainer: $( | ||
(s = n.classNames) == null ? void 0 : s.tableContainer, | ||
we.tableContainer | ||
je.tableContainer | ||
) | ||
}; | ||
} | ||
function F() { | ||
function N() { | ||
return [ | ||
@@ -351,4 +315,4 @@ { | ||
variantSelector(d) { | ||
let i; | ||
return d.deactivated && (i = "warning"), d.deactivated || (i = "success"), i; | ||
let c; | ||
return d.deactivated && (c = "warning"), d.deactivated || (c = "success"), c; | ||
} | ||
@@ -360,13 +324,13 @@ } | ||
let s = n.urls.get; | ||
const [d, i] = s.split("?"), t = new URLSearchParams(i); | ||
const [d, c] = s.split("?"), t = new URLSearchParams(c); | ||
return n.tenant && t.set("tenant", n.tenant), n.product && t.set("product", n.product), t.toString() ? `${d}?${t}` : s; | ||
} | ||
return V(() => { | ||
return O(() => { | ||
async function s(d) { | ||
const i = await I(d); | ||
if (D(!1), i) { | ||
if ("error" in i && i.error) | ||
E(!0), C(i.error.message), typeof n.errorCallback == "function" && n.errorCallback(i.error.message); | ||
else if ("data" in i) { | ||
const t = i.data.map( | ||
const c = await I(d); | ||
if (D(!1), c) { | ||
if ("error" in c && c.error) | ||
E(!0), b(c.error.message), typeof n.errorCallback == "function" && n.errorCallback(c.error.message); | ||
else if ("data" in c) { | ||
const t = c.data.map( | ||
(a) => { | ||
@@ -380,3 +344,3 @@ var o; | ||
product: a.product, | ||
type: (o = j().find(({ value: N }) => N === a.type)) == null ? void 0 : o.text, | ||
type: (o = w().find(({ value: _ }) => _ === a.type)) == null ? void 0 : o.text, | ||
status: a.deactivated ? "Inactive" : "Active" | ||
@@ -386,3 +350,3 @@ }; | ||
); | ||
y(t), typeof n.handleListFetchComplete == "function" && n.handleListFetchComplete(i.data); | ||
k(t), typeof n.handleListFetchComplete == "function" && n.handleListFetchComplete(c.data); | ||
} | ||
@@ -392,22 +356,22 @@ } | ||
s(r()); | ||
}, [r()]), /* @__PURE__ */ e.jsx(de, { isBusy: h, children: c.length > 0 ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("div", { className: _().tableContainer, children: /* @__PURE__ */ e.jsx( | ||
}, [r()]), /* @__PURE__ */ e.jsx(re, { isBusy: F, children: i.length > 0 ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("div", { className: C().tableContainer, children: /* @__PURE__ */ e.jsx( | ||
me, | ||
{ | ||
cols: u(), | ||
data: c, | ||
actions: F() | ||
data: i, | ||
actions: N() | ||
} | ||
) }) }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: w ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(le, { variant: "error", title: l }) }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: n.children }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(le, { title: "No directories found." }) }) }) }) }); | ||
) }) }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: v ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(ie, { variant: "error", title: l }) }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: n.children }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(ie, { title: "No directories found." }) }) }) }) }); | ||
} | ||
const Ee = "_container_r3olf_1", Te = { | ||
container: Ee | ||
const ve = "_container_r3olf_1", Ne = { | ||
container: ve | ||
}; | ||
function Le(n) { | ||
var _, F, u; | ||
const [c, y] = v(() => !1); | ||
function j() { | ||
function we(n) { | ||
var C, N, u; | ||
const [i, k] = j(() => !1); | ||
function w() { | ||
var r; | ||
return (r = n.connection) != null && r.deactivated ? "Inactive" : "Active"; | ||
} | ||
function h() { | ||
function F() { | ||
var r; | ||
@@ -417,10 +381,10 @@ return (r = n.connection) != null && r.deactivated ? "activate" : "deactivate"; | ||
function D() { | ||
y(!0); | ||
k(!0); | ||
} | ||
function w() { | ||
y(!1); | ||
function v() { | ||
k(!1); | ||
} | ||
function E() { | ||
var r; | ||
C(!((r = n.connection) != null && r.deactivated)); | ||
b(!((r = n.connection) != null && r.deactivated)); | ||
} | ||
@@ -430,9 +394,9 @@ function l() { | ||
return { | ||
container: z( | ||
container: $( | ||
(r = n.classNames) == null ? void 0 : r.container, | ||
Te.container | ||
Ne.container | ||
) | ||
}; | ||
} | ||
function C(r) { | ||
function b(r) { | ||
async function s() { | ||
@@ -443,3 +407,3 @@ var t; | ||
deactivated: r | ||
}, i = await I(n.urls.patch, { | ||
}, c = await I(n.urls.patch, { | ||
method: "PATCH", | ||
@@ -451,3 +415,3 @@ headers: { | ||
}); | ||
y(!1), i && "error" in i && i.error ? typeof n.errorCallback == "function" && n.errorCallback(i.error.message) : typeof n.successCallback == "function" && n.successCallback({ | ||
k(!1), c && "error" in c && c.error ? typeof n.errorCallback == "function" && n.errorCallback(c.error.message) : typeof n.successCallback == "function" && n.successCallback({ | ||
operation: "UPDATE" | ||
@@ -459,17 +423,17 @@ }); | ||
return /* @__PURE__ */ e.jsx(e.Fragment, { children: n.connection !== void 0 || n.connection !== null ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: l().container, children: [ | ||
c ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
ue, | ||
i ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
de, | ||
{ | ||
ctoaVariant: (_ = n.connection) != null && _.deactivated ? "primary" : "destructive", | ||
classNames: (F = n.classNames) == null ? void 0 : F.confirmationPrompt, | ||
cancelCallback: w, | ||
ctoaVariant: (C = n.connection) != null && C.deactivated ? "primary" : "destructive", | ||
classNames: (N = n.classNames) == null ? void 0 : N.confirmationPrompt, | ||
cancelCallback: v, | ||
confirmationCallback: E, | ||
promptMessage: `Do you want to ${h()} the connection?` | ||
promptMessage: `Do you want to ${F()} the connection?` | ||
} | ||
) }) : null, | ||
c ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
i ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
he, | ||
{ | ||
label: j(), | ||
disabled: c, | ||
label: w(), | ||
disabled: i, | ||
checked: !((u = n.connection) != null && u.deactivated), | ||
@@ -481,12 +445,12 @@ handleChange: D | ||
} | ||
const Se = "_headingContainer_1gntt_2", Ae = "_heading_1gntt_2", Ie = "_section_1gntt_27", Pe = "_info_1gntt_39", $e = "_sectionHeading_1gntt_43", ze = "_sectionPara_1gntt_48", He = "_formAction_1gntt_52", S = { | ||
const Fe = "_headingContainer_1gntt_2", De = "_heading_1gntt_2", Ee = "_section_1gntt_27", Te = "_info_1gntt_39", Le = "_sectionHeading_1gntt_43", Se = "_sectionPara_1gntt_48", Ae = "_formAction_1gntt_52", S = { | ||
"sr-only": "_sr-only_1gntt_1", | ||
headingContainer: Se, | ||
heading: Ae, | ||
section: Ie, | ||
info: Pe, | ||
sectionHeading: $e, | ||
sectionPara: ze, | ||
formAction: He | ||
}, Ve = { | ||
headingContainer: Fe, | ||
heading: De, | ||
section: Ee, | ||
info: Te, | ||
sectionHeading: Le, | ||
sectionPara: Se, | ||
formAction: Ae | ||
}, Ie = { | ||
name: "", | ||
@@ -498,20 +462,20 @@ log_webhook_events: !1, | ||
}; | ||
function Oe(n) { | ||
var a, o, N, k, R, U, M, q, W, B, J, Z, G, Y, K, Q, X, p, ee, ne, te, ae, se, ce; | ||
const [c, y] = v(() => !1); | ||
function j() { | ||
y(!c); | ||
function Pe(n) { | ||
var a, o, _, y, U, V, M, z, q, W, B, J, Z, G, Y, K, Q, X, p, ee, ne, te, ae, se; | ||
const [i, k] = j(() => !1); | ||
function w() { | ||
k(!i); | ||
} | ||
const [h, D] = v(() => !1), [w, E] = v(() => !0), [l, C] = v( | ||
() => Ve | ||
const [F, D] = j(() => !1), [v, E] = j(() => !0), [l, b] = j( | ||
() => Ie | ||
); | ||
function _() { | ||
var x, f, b, m; | ||
function C() { | ||
var x, h, f, m; | ||
return { | ||
inputField: { | ||
label: (x = n.classNames) == null ? void 0 : x.label, | ||
input: (f = n.classNames) == null ? void 0 : f.input, | ||
container: (b = n.classNames) == null ? void 0 : b.fieldContainer | ||
input: (h = n.classNames) == null ? void 0 : h.input, | ||
container: (f = n.classNames) == null ? void 0 : f.fieldContainer | ||
}, | ||
section: z( | ||
section: $( | ||
(m = n.classNames) == null ? void 0 : m.section, | ||
@@ -522,16 +486,16 @@ S.section | ||
} | ||
function F(x, f) { | ||
function N(x, h) { | ||
return { | ||
...l, | ||
[x]: f | ||
[x]: h | ||
}; | ||
} | ||
function u(x) { | ||
const f = x.target, b = f.id, m = f.type === "checkbox" ? f.checked : f.value; | ||
C(F(b, m)); | ||
const h = x.target, f = h.id, m = h.type === "checkbox" ? h.checked : h.value; | ||
b(N(f, m)); | ||
} | ||
function r(x) { | ||
x.preventDefault(), D(!0); | ||
async function f(b) { | ||
const m = await I(b, { | ||
async function h(f) { | ||
const m = await I(f, { | ||
method: "PATCH", | ||
@@ -548,10 +512,10 @@ headers: { | ||
} | ||
f(n.urls.patch); | ||
h(n.urls.patch); | ||
} | ||
function s() { | ||
async function x(f) { | ||
const b = await I(f, { | ||
async function x(h) { | ||
const f = await I(h, { | ||
method: "DELETE" | ||
}); | ||
b && "error" in b && b.error ? typeof n.errorCallback == "function" && n.errorCallback(b.error.message) : typeof n.successCallback == "function" && n.successCallback({ | ||
f && "error" in f && f.error ? typeof n.errorCallback == "function" && n.errorCallback(f.error.message) : typeof n.successCallback == "function" && n.successCallback({ | ||
operation: "DELETE" | ||
@@ -563,6 +527,6 @@ }); | ||
function d(x) { | ||
var f; | ||
return !!((f = n.excludeFields) != null && f.includes(x)); | ||
var h; | ||
return !!((h = n.excludeFields) != null && h.includes(x)); | ||
} | ||
function i() { | ||
function c() { | ||
return n.displayHeader !== void 0 ? n.displayHeader : !0; | ||
@@ -573,11 +537,11 @@ } | ||
} | ||
return V(() => { | ||
async function x(f) { | ||
const b = await I(f); | ||
if (E(!1), b) { | ||
if ("error" in b && b.error) | ||
typeof n.errorCallback == "function" && n.errorCallback(b.error.message); | ||
else if ("data" in b) { | ||
const m = b.data; | ||
C({ | ||
return O(() => { | ||
async function x(h) { | ||
const f = await I(h); | ||
if (E(!1), f) { | ||
if ("error" in f && f.error) | ||
typeof n.errorCallback == "function" && n.errorCallback(f.error.message); | ||
else if ("data" in f) { | ||
const m = f.data; | ||
b({ | ||
...m, | ||
@@ -595,7 +559,7 @@ name: m.name, | ||
x(t()); | ||
}, [t()]), /* @__PURE__ */ e.jsxs(de, { isBusy: w, children: [ | ||
}, [t()]), /* @__PURE__ */ e.jsxs(re, { isBusy: v, children: [ | ||
/* @__PURE__ */ e.jsxs("div", { className: S.headingContainer, children: [ | ||
i() ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("h2", { className: S.heading, children: "Update Directory" }) }) : null, | ||
c() ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("h2", { className: S.heading, children: "Update Directory" }) }) : null, | ||
/* @__PURE__ */ e.jsx( | ||
Le, | ||
we, | ||
{ | ||
@@ -609,4 +573,4 @@ connection: l, | ||
button: { | ||
ctoa: `${(N = (o = (a = n.classNames) == null ? void 0 : a.confirmationPrompt) == null ? void 0 : o.button) == null ? void 0 : N.ctoa} ${l != null && l.deactivated ? (R = (k = n.classNames) == null ? void 0 : k.button) == null ? void 0 : R.ctoa : (M = (U = n.classNames) == null ? void 0 : U.button) == null ? void 0 : M.destructive}`.trim(), | ||
cancel: (B = (W = (q = n.classNames) == null ? void 0 : q.confirmationPrompt) == null ? void 0 : W.button) == null ? void 0 : B.cancel | ||
ctoa: `${(_ = (o = (a = n.classNames) == null ? void 0 : a.confirmationPrompt) == null ? void 0 : o.button) == null ? void 0 : _.ctoa} ${l != null && l.deactivated ? (U = (y = n.classNames) == null ? void 0 : y.button) == null ? void 0 : U.ctoa : (M = (V = n.classNames) == null ? void 0 : V.button) == null ? void 0 : M.destructive}`.trim(), | ||
cancel: (W = (q = (z = n.classNames) == null ? void 0 : z.confirmationPrompt) == null ? void 0 : q.button) == null ? void 0 : W.cancel | ||
} | ||
@@ -630,3 +594,3 @@ } | ||
required: !0, | ||
classNames: _().inputField | ||
classNames: C().inputField | ||
} | ||
@@ -638,8 +602,8 @@ ), | ||
/* @__PURE__ */ e.jsx( | ||
ie, | ||
ce, | ||
{ | ||
label: "SCIM Endpoint", | ||
text: (J = l.scim) == null ? void 0 : J.endpoint, | ||
text: (B = l.scim) == null ? void 0 : B.endpoint, | ||
copyDoneCallback: n.successCallback, | ||
classNames: _().inputField | ||
classNames: C().inputField | ||
} | ||
@@ -651,8 +615,8 @@ ), | ||
/* @__PURE__ */ e.jsx( | ||
ie, | ||
ce, | ||
{ | ||
label: "SCIM Token", | ||
text: (Z = l.scim) == null ? void 0 : Z.secret, | ||
text: (J = l.scim) == null ? void 0 : J.secret, | ||
copyDoneCallback: n.successCallback, | ||
classNames: _().inputField | ||
classNames: C().inputField | ||
} | ||
@@ -670,3 +634,3 @@ ), | ||
handleInputChange: u, | ||
classNames: _().inputField | ||
classNames: C().inputField | ||
} | ||
@@ -685,3 +649,3 @@ ), | ||
handleInputChange: u, | ||
classNames: _().inputField | ||
classNames: C().inputField | ||
} | ||
@@ -693,7 +657,7 @@ ), | ||
/* @__PURE__ */ e.jsx( | ||
oe, | ||
le, | ||
{ | ||
label: "Webhook secret", | ||
id: "webhook_secret", | ||
classNames: _().inputField, | ||
classNames: C().inputField, | ||
handleChange: u, | ||
@@ -710,3 +674,3 @@ value: l.webhook_secret, | ||
/* @__PURE__ */ e.jsx( | ||
re, | ||
oe, | ||
{ | ||
@@ -738,4 +702,4 @@ label: "Enable Webhook events logging", | ||
variant: "primary", | ||
classNames: (Y = (G = n.classNames) == null ? void 0 : G.button) == null ? void 0 : Y.ctoa, | ||
isLoading: h | ||
classNames: (G = (Z = n.classNames) == null ? void 0 : Z.button) == null ? void 0 : G.ctoa, | ||
isLoading: F | ||
} | ||
@@ -745,3 +709,3 @@ ) | ||
] }), | ||
/* @__PURE__ */ e.jsxs("section", { className: _().section, children: [ | ||
/* @__PURE__ */ e.jsxs("section", { className: C().section, children: [ | ||
/* @__PURE__ */ e.jsxs("div", { className: S.info, children: [ | ||
@@ -751,3 +715,3 @@ /* @__PURE__ */ e.jsx("h6", { className: S.sectionHeading, children: "Delete this directory connection" }), | ||
] }), | ||
c ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
i ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
A, | ||
@@ -758,8 +722,8 @@ { | ||
type: "button", | ||
handleClick: j, | ||
classNames: (Q = (K = n.classNames) == null ? void 0 : K.button) == null ? void 0 : Q.destructive | ||
handleClick: w, | ||
classNames: (K = (Y = n.classNames) == null ? void 0 : Y.button) == null ? void 0 : K.destructive | ||
} | ||
) }), | ||
c ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
ue, | ||
i ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
de, | ||
{ | ||
@@ -770,7 +734,7 @@ ctoaVariant: "destructive", | ||
button: { | ||
ctoa: `${(p = (X = n.classNames) == null ? void 0 : X.button) == null ? void 0 : p.destructive} ${(te = (ne = (ee = n.classNames) == null ? void 0 : ee.confirmationPrompt) == null ? void 0 : ne.button) == null ? void 0 : te.ctoa}`.trim(), | ||
cancel: (ce = (se = (ae = n.classNames) == null ? void 0 : ae.confirmationPrompt) == null ? void 0 : se.button) == null ? void 0 : ce.cancel | ||
ctoa: `${(X = (Q = n.classNames) == null ? void 0 : Q.button) == null ? void 0 : X.destructive} ${(ne = (ee = (p = n.classNames) == null ? void 0 : p.confirmationPrompt) == null ? void 0 : ee.button) == null ? void 0 : ne.ctoa}`.trim(), | ||
cancel: (se = (ae = (te = n.classNames) == null ? void 0 : te.confirmationPrompt) == null ? void 0 : ae.button) == null ? void 0 : se.cancel | ||
} | ||
}, | ||
cancelCallback: j, | ||
cancelCallback: w, | ||
confirmationCallback: s | ||
@@ -782,7 +746,7 @@ } | ||
} | ||
const Re = "_header_z5rjx_1", Ue = "_h5_z5rjx_8", Me = "_ctoa_z5rjx_15", qe = "_listView_z5rjx_20", T = { | ||
header: Re, | ||
h5: Ue, | ||
ctoa: Me, | ||
listView: qe | ||
const $e = "_header_z5rjx_1", He = "_h5_z5rjx_8", Oe = "_ctoa_z5rjx_15", Re = "_listView_z5rjx_20", T = { | ||
header: $e, | ||
h5: He, | ||
ctoa: Oe, | ||
listView: Re | ||
}, H = { | ||
@@ -793,11 +757,11 @@ directoryListData: [], | ||
}; | ||
function Ze(n) { | ||
var r, s, d, i, t; | ||
const [c, y] = v( | ||
function ze(n) { | ||
var r, s, d, c, t; | ||
const [i, k] = j( | ||
() => H.directoryListData | ||
), [j, h] = v(() => H.view); | ||
), [w, F] = j(() => H.view); | ||
function D(a) { | ||
y(a); | ||
k(a); | ||
} | ||
const [w, E] = v( | ||
const [v, E] = j( | ||
() => H.directoryToEdit | ||
@@ -807,23 +771,23 @@ ); | ||
let a = n.urls.get; | ||
const [o, N] = a.split("?"), k = new URLSearchParams(N); | ||
return k.toString() ? `${o}/${w.id}?${k}` : `${o}/${w.id}`; | ||
const [o, _] = a.split("?"), y = new URLSearchParams(_); | ||
return y.toString() ? `${o}/${v.id}?${y}` : `${o}/${v.id}`; | ||
} | ||
function C() { | ||
h("CREATE"); | ||
function b() { | ||
F("CREATE"); | ||
} | ||
function _(a, o) { | ||
h("EDIT"), E(o); | ||
function C(a, o) { | ||
F("EDIT"), E(o); | ||
} | ||
function F() { | ||
h("LIST"); | ||
function N() { | ||
F("LIST"); | ||
} | ||
function u(a) { | ||
const { connection: o, operation: N } = a; | ||
const { connection: o, operation: _ } = a; | ||
typeof n.successCallback == "function" && n.successCallback({ | ||
operation: N, | ||
operation: _, | ||
connection: o | ||
}), N !== "COPY" && F(); | ||
}), _ !== "COPY" && N(); | ||
} | ||
return /* @__PURE__ */ e.jsxs("div", { children: [ | ||
j === "LIST" ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: T.listview, children: [ | ||
w === "LIST" ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: T.listview, children: [ | ||
/* @__PURE__ */ e.jsxs("div", { className: T.header, children: [ | ||
@@ -835,3 +799,3 @@ /* @__PURE__ */ e.jsx("h5", { className: T.h5, children: n.title || "Manage Dsync Connections" }), | ||
name: "Add Connection", | ||
handleClick: C, | ||
handleClick: b, | ||
classNames: (s = (r = n.classNames) == null ? void 0 : r.button) == null ? void 0 : s.ctoa | ||
@@ -843,3 +807,3 @@ } | ||
/* @__PURE__ */ e.jsx( | ||
De, | ||
ke, | ||
{ | ||
@@ -850,3 +814,3 @@ ...(d = n.componentProps) == null ? void 0 : d.directoryList, | ||
}, | ||
handleActionClick: _, | ||
handleActionClick: C, | ||
handleListFetchComplete: D, | ||
@@ -858,16 +822,16 @@ tenant: n.tenant, | ||
] }) }) : null, | ||
j === "EDIT" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
w === "EDIT" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx("div", { className: T.header, children: /* @__PURE__ */ e.jsx("h5", { className: T.h5, children: "Edit Dsync Connection" }) }), | ||
/* @__PURE__ */ e.jsx( | ||
Oe, | ||
Pe, | ||
{ | ||
...(i = n.componentProps) == null ? void 0 : i.editDirectory, | ||
...(c = n.componentProps) == null ? void 0 : c.editDirectory, | ||
classNames: n.classNames, | ||
successCallback: u, | ||
errorCallback: n.errorCallback, | ||
cancelCallback: F, | ||
cancelCallback: N, | ||
displayHeader: !1, | ||
urls: { | ||
patch: `${n.urls.patch}/${w.id}`, | ||
delete: `${n.urls.delete}/${w.id}`, | ||
patch: `${n.urls.patch}/${v.id}`, | ||
delete: `${n.urls.delete}/${v.id}`, | ||
get: l() | ||
@@ -878,7 +842,7 @@ } | ||
] }) : null, | ||
j === "CREATE" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
w === "CREATE" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx("div", { className: T.header, children: /* @__PURE__ */ e.jsx("h5", { className: T.h5, children: "Create Dsync Connection" }) }), | ||
/* @__PURE__ */ e.jsx(g, { y: 5 }), | ||
/* @__PURE__ */ e.jsx( | ||
ve, | ||
xe, | ||
{ | ||
@@ -889,3 +853,3 @@ ...(t = n.componentProps) == null ? void 0 : t.createDirectory, | ||
errorCallback: n.errorCallback, | ||
cancelCallback: F, | ||
cancelCallback: N, | ||
displayHeader: !1, | ||
@@ -903,7 +867,7 @@ urls: { | ||
export { | ||
ve as CreateDirectory, | ||
Ze as DirectoriesWrapper, | ||
De as DirectoryList, | ||
Oe as EditDirectory | ||
xe as CreateDirectory, | ||
ze as DirectoriesWrapper, | ||
ke as DirectoryList, | ||
Pe as EditDirectory | ||
}; | ||
//# sourceMappingURL=dsync.js.map |
@@ -9,2 +9,6 @@ interface SelectProps { | ||
}>; | ||
classNames?: { | ||
select?: string; | ||
label?: string; | ||
}; | ||
disabled?: boolean; | ||
@@ -11,0 +15,0 @@ selectedValue: string; |
@@ -46,2 +46,3 @@ import { ConfirmationPromptProps, TableCol, TableProps } from '../../shared/types'; | ||
input?: string; | ||
select?: string; | ||
textarea?: string; | ||
@@ -57,3 +58,5 @@ radioContainer?: string; | ||
displayHeader?: boolean; | ||
defaults?: Partial<SSOConnection & Pick<SAMLSSOConnection, 'forceAuthn'>>; | ||
defaults?: Partial<Omit<SSOConnection, 'tenant'> & Pick<SAMLSSOConnection, 'forceAuthn'> & { | ||
tenant: string[] | string; | ||
}>; | ||
} | ||
@@ -73,2 +76,3 @@ export interface CreateSSOConnectionProps extends Omit<CreateConnectionProps, 'variant' | 'excludeFields' | 'displayHeader' | 'readOnlyFields'> { | ||
}; | ||
defaults?: ConnectionsWrapperProp['defaults']; | ||
} | ||
@@ -297,2 +301,3 @@ type FormObjValues = string | boolean | string[] | undefined; | ||
input?: string; | ||
select?: string; | ||
textarea?: string; | ||
@@ -299,0 +304,0 @@ confirmationPrompt?: ConfirmationPromptProps['classNames']; |
{ | ||
"name": "@boxyhq/react-ui", | ||
"description": "React UI components from BoxyHQ", | ||
"version": "3.3.30", | ||
"version": "3.3.31", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1031328
6561