@boxyhq/react-ui
Advanced tools
Comparing version 3.3.27 to 3.3.28
@@ -1,3 +0,3 @@ | ||
import { j as e, S as C, c as z, a as ie } from "./index-7ce2e0e7.js"; | ||
import { useState as k, useEffect as V } from "react"; | ||
import { j as e, S as g, c as z, a as ie } from "./index-7ce2e0e7.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-f0c3818a.js"; | ||
@@ -10,26 +10,26 @@ 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 || {}); | ||
formAction: ge | ||
}, Ce = "_label_1odz8_9", xe = "_div_1odz8_17", _e = "_select_1odz8_49", je = "_focus_1odz8_77", $ = { | ||
}, 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: xe, | ||
div: _e, | ||
"div--disabled": "_div--disabled_1odz8_43", | ||
select: _e, | ||
focus: je | ||
select: xe, | ||
focus: ye | ||
}; | ||
function ye(n) { | ||
var y; | ||
function s() { | ||
function je(n) { | ||
var j; | ||
function c() { | ||
return n.id ? n.id : n.label.replace(/ /g, ""); | ||
} | ||
function j() { | ||
function y() { | ||
return $.div + (n.disabled ? ` ${$["div--disabled"]}` : ""); | ||
} | ||
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx("label", { htmlFor: s(), className: $.label, children: n.label }), | ||
/* @__PURE__ */ e.jsx(C, { y: 2 }), | ||
/* @__PURE__ */ e.jsxs("div", { className: j(), 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: s(), | ||
id: c(), | ||
name: n.name, | ||
@@ -40,3 +40,3 @@ className: $.select, | ||
onChange: (h) => n.handleChange(h), | ||
children: (y = n.options) == null ? void 0 : y.map((h) => /* @__PURE__ */ e.jsx("option", { value: h.value, children: h.text }, h.value)) | ||
children: (j = n.options) == null ? void 0 : j.map((h) => /* @__PURE__ */ e.jsx("option", { value: h.value, children: h.text }, h.value)) | ||
} | ||
@@ -60,9 +60,9 @@ ), | ||
var d, i; | ||
const [s, j] = k(() => ke), [y, h] = k(() => !1), [F, v] = k(() => !1); | ||
function D() { | ||
const [c, y] = v(() => ke), [j, h] = v(() => !1), [D, w] = v(() => !1); | ||
function E() { | ||
var t; | ||
return (t = Object.entries(O)) == null ? void 0 : t.map( | ||
([a, u]) => ({ | ||
([a, o]) => ({ | ||
value: a, | ||
text: u | ||
text: o | ||
}) | ||
@@ -72,11 +72,11 @@ ); | ||
function l(t) { | ||
var u; | ||
const a = (u = t == null ? void 0 : t.target) == null ? void 0 : u.value; | ||
h(a === "google"), j({ | ||
...s, | ||
var o; | ||
const a = (o = t == null ? void 0 : t.target) == null ? void 0 : o.value; | ||
h(a === "google"), y({ | ||
...c, | ||
type: a | ||
}); | ||
} | ||
function x() { | ||
var t, a, u, E, w; | ||
function C() { | ||
var t, a, o, N, k; | ||
return { | ||
@@ -89,30 +89,30 @@ fieldContainer: z( | ||
inputField: { | ||
label: (u = n.classNames) == null ? void 0 : u.label, | ||
input: (E = n.classNames) == null ? void 0 : E.input, | ||
container: (w = n.classNames) == null ? void 0 : w.fieldContainer | ||
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 | ||
} | ||
}; | ||
} | ||
function f() { | ||
function _() { | ||
return n.displayHeader !== void 0 ? n.displayHeader : !0; | ||
} | ||
function N(t) { | ||
function F(t) { | ||
return { | ||
...s, | ||
...c, | ||
...t | ||
}; | ||
} | ||
function r(t) { | ||
const a = t.target, u = a.type === "checkbox" ? a.checked : a.value; | ||
j( | ||
N({ | ||
[a.id]: u | ||
function u(t) { | ||
const a = t.target, o = a.type === "checkbox" ? a.checked : a.value; | ||
y( | ||
F({ | ||
[a.id]: o | ||
}) | ||
); | ||
} | ||
function o(t) { | ||
function r(t) { | ||
t.preventDefault(); | ||
async function a(u, E) { | ||
v(!0); | ||
const w = await I(E, { | ||
async function a(o, N) { | ||
w(!0); | ||
const k = await I(N, { | ||
method: "POST", | ||
@@ -122,12 +122,12 @@ headers: { | ||
}, | ||
body: JSON.stringify(u) | ||
body: JSON.stringify(o) | ||
}); | ||
v(!1), w && ("error" in w && w.error ? typeof n.errorCallback == "function" && n.errorCallback(w.error.message) : "data" in w && typeof n.successCallback == "function" && n.successCallback({ | ||
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({ | ||
operation: "CREATE", | ||
connection: w.data | ||
connection: k.data | ||
})); | ||
} | ||
a(s, n.urls.post); | ||
a(c, n.urls.post); | ||
} | ||
function c(t) { | ||
function s(t) { | ||
var a; | ||
@@ -139,13 +139,13 @@ return !!((a = n.excludeFields) != null && a.includes( | ||
return V(() => { | ||
j( | ||
N({ | ||
tenant: n.tenant ?? s.tenant, | ||
product: n.product ?? s.product, | ||
webhook_url: n.defaultWebhookEndpoint ?? s.webhook_url | ||
y( | ||
F({ | ||
tenant: n.tenant ?? c.tenant, | ||
product: n.product ?? c.product, | ||
webhook_url: n.defaultWebhookEndpoint ?? c.webhook_url | ||
}) | ||
); | ||
}, [n.tenant, n.product, n.defaultWebhookEndpoint]), /* @__PURE__ */ e.jsxs("div", { children: [ | ||
f() ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("h2", { className: P.heading, children: "Create Directory" }) }) : null, | ||
/* @__PURE__ */ e.jsxs("form", { onSubmit: (t) => o(t), children: [ | ||
c("name") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
_() ? /* @__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: [ | ||
s("name") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx( | ||
@@ -157,13 +157,13 @@ L, | ||
name: "name", | ||
value: s.name, | ||
handleInputChange: r, | ||
value: c.name, | ||
handleInputChange: u, | ||
required: !0, | ||
classNames: x().inputField | ||
classNames: C().inputField | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
c("type") ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: x().fieldContainer, children: [ | ||
s("type") ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: C().fieldContainer, children: [ | ||
/* @__PURE__ */ e.jsx( | ||
ye, | ||
je, | ||
{ | ||
@@ -173,10 +173,10 @@ label: "Directory provider", | ||
id: "type", | ||
options: D(), | ||
selectedValue: s.type, | ||
options: E(), | ||
selectedValue: c.type, | ||
handleChange: l | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }) }), | ||
y ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
j ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx( | ||
@@ -189,11 +189,11 @@ L, | ||
title: "Please enter a valid domain (e.g: boxyhq.com)", | ||
value: s.google_domain || "", | ||
handleInputChange: r, | ||
value: c.google_domain || "", | ||
handleInputChange: u, | ||
pattern: "^[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)*.[a-zA-Z]{2,}$", | ||
classNames: x().inputField | ||
classNames: C().inputField | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }) : null, | ||
c("tenant") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
s("tenant") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx( | ||
@@ -205,11 +205,11 @@ L, | ||
name: "tenant", | ||
value: s.tenant, | ||
handleInputChange: r, | ||
value: c.tenant, | ||
handleInputChange: u, | ||
required: !0, | ||
classNames: x().inputField | ||
classNames: C().inputField | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
c("product") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
s("product") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx( | ||
@@ -221,11 +221,11 @@ L, | ||
name: "product", | ||
value: s.product, | ||
handleInputChange: r, | ||
value: c.product, | ||
handleInputChange: u, | ||
required: !0, | ||
classNames: x().inputField | ||
classNames: C().inputField | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
c("webhook_url") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
s("webhook_url") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx( | ||
@@ -238,10 +238,10 @@ L, | ||
name: "webhook_url", | ||
value: s.webhook_url, | ||
handleInputChange: r, | ||
classNames: x().inputField | ||
value: c.webhook_url, | ||
handleInputChange: u, | ||
classNames: C().inputField | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
c("webhook_secret") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
s("webhook_secret") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
/* @__PURE__ */ e.jsx( | ||
@@ -253,5 +253,5 @@ oe, | ||
name: "webhook_secret", | ||
value: s.webhook_secret, | ||
handleChange: r, | ||
classNames: x().inputField, | ||
value: c.webhook_secret, | ||
handleChange: u, | ||
classNames: C().inputField, | ||
required: !1, | ||
@@ -261,5 +261,5 @@ readOnly: !1 | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
c("log_webhook_events") ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: P.checkboxFieldsDiv, children: [ | ||
s("log_webhook_events") ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: P.checkboxFieldsDiv, children: [ | ||
/* @__PURE__ */ e.jsx( | ||
@@ -271,7 +271,7 @@ re, | ||
name: "log_webhook_events", | ||
checked: s.log_webhook_events, | ||
handleChange: r | ||
checked: c.log_webhook_events, | ||
handleChange: u | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }) }), | ||
@@ -295,3 +295,3 @@ /* @__PURE__ */ e.jsxs("div", { className: P.formAction, children: [ | ||
classNames: (i = (d = n.classNames) == null ? void 0 : d.button) == null ? void 0 : i.ctoa, | ||
isLoading: F | ||
isLoading: D | ||
} | ||
@@ -309,8 +309,8 @@ ) | ||
function De(n) { | ||
const [s, j] = k( | ||
const [c, y] = v( | ||
() => Fe.directoryListData | ||
); | ||
function y() { | ||
var c; | ||
return (c = Object.entries(O)) == null ? void 0 : c.map( | ||
function j() { | ||
var s; | ||
return (s = Object.entries(O)) == null ? void 0 : s.map( | ||
([d, i]) => ({ | ||
@@ -322,10 +322,10 @@ value: d, | ||
} | ||
const [h, F] = k( | ||
const [h, D] = v( | ||
() => !0 | ||
), [v, D] = k(() => !1), [l, x] = k(() => ""); | ||
function f() { | ||
var c; | ||
), [w, E] = v(() => !1), [l, C] = v(() => ""); | ||
function _() { | ||
var s; | ||
return { | ||
tableContainer: z( | ||
(c = n.classNames) == null ? void 0 : c.tableContainer, | ||
(s = n.classNames) == null ? void 0 : s.tableContainer, | ||
we.tableContainer | ||
@@ -335,3 +335,3 @@ ) | ||
} | ||
function N() { | ||
function F() { | ||
return [ | ||
@@ -341,8 +341,8 @@ { | ||
label: "Edit", | ||
handleClick: (c) => n.handleActionClick("edit", c) | ||
handleClick: (s) => n.handleActionClick("edit", s) | ||
} | ||
]; | ||
} | ||
function r() { | ||
return (n.cols || ["name", "tenant", "product", "type", "status", "actions"]).map((c) => c === "status" ? { | ||
function u() { | ||
return (n.cols || ["name", "tenant", "product", "type", "status", "actions"]).map((s) => s === "status" ? { | ||
name: "status", | ||
@@ -356,17 +356,19 @@ badge: { | ||
} | ||
} : c); | ||
} : s); | ||
} | ||
function o() { | ||
return n.urls.get; | ||
function r() { | ||
let s = n.urls.get; | ||
const [d, i] = s.split("?"), t = new URLSearchParams(i); | ||
return n.tenant && t.set("tenant", n.tenant), n.product && t.set("product", n.product), t.toString() ? `${d}?${t}` : s; | ||
} | ||
return V(() => { | ||
async function c(d) { | ||
async function s(d) { | ||
const i = await I(d); | ||
if (F(!1), i) { | ||
if (D(!1), i) { | ||
if ("error" in i && i.error) | ||
D(!0), x(i.error.message), typeof n.errorCallback == "function" && n.errorCallback(i.error.message); | ||
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( | ||
(a) => { | ||
var u; | ||
var o; | ||
return { | ||
@@ -378,3 +380,3 @@ ...a, | ||
product: a.product, | ||
type: (u = y().find(({ value: E }) => E === a.type)) == null ? void 0 : u.text, | ||
type: (o = j().find(({ value: N }) => N === a.type)) == null ? void 0 : o.text, | ||
status: a.deactivated ? "Inactive" : "Active" | ||
@@ -384,15 +386,15 @@ }; | ||
); | ||
j(t), typeof n.handleListFetchComplete == "function" && n.handleListFetchComplete(i.data); | ||
y(t), typeof n.handleListFetchComplete == "function" && n.handleListFetchComplete(i.data); | ||
} | ||
} | ||
} | ||
c(o()); | ||
}, [o()]), /* @__PURE__ */ e.jsx(de, { isBusy: h, children: s.length > 0 ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("div", { className: f().tableContainer, children: /* @__PURE__ */ e.jsx( | ||
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( | ||
me, | ||
{ | ||
cols: r(), | ||
data: s, | ||
actions: N() | ||
cols: u(), | ||
data: c, | ||
actions: F() | ||
} | ||
) }) }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: v ? /* @__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: 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." }) }) }) }) }); | ||
} | ||
@@ -403,27 +405,27 @@ const Ee = "_container_r3olf_1", Te = { | ||
function Le(n) { | ||
var f, N, r; | ||
const [s, j] = k(() => !1); | ||
function y() { | ||
var o; | ||
return (o = n.connection) != null && o.deactivated ? "Inactive" : "Active"; | ||
var _, F, u; | ||
const [c, y] = v(() => !1); | ||
function j() { | ||
var r; | ||
return (r = n.connection) != null && r.deactivated ? "Inactive" : "Active"; | ||
} | ||
function h() { | ||
var o; | ||
return (o = n.connection) != null && o.deactivated ? "activate" : "deactivate"; | ||
var r; | ||
return (r = n.connection) != null && r.deactivated ? "activate" : "deactivate"; | ||
} | ||
function F() { | ||
j(!0); | ||
function D() { | ||
y(!0); | ||
} | ||
function v() { | ||
j(!1); | ||
function w() { | ||
y(!1); | ||
} | ||
function D() { | ||
var o; | ||
x(!((o = n.connection) != null && o.deactivated)); | ||
function E() { | ||
var r; | ||
C(!((r = n.connection) != null && r.deactivated)); | ||
} | ||
function l() { | ||
var o; | ||
var r; | ||
return { | ||
container: z( | ||
(o = n.classNames) == null ? void 0 : o.container, | ||
(r = n.classNames) == null ? void 0 : r.container, | ||
Te.container | ||
@@ -433,8 +435,8 @@ ) | ||
} | ||
function x(o) { | ||
async function c() { | ||
function C(r) { | ||
async function s() { | ||
var t; | ||
const d = { | ||
directoryId: (t = n.connection) == null ? void 0 : t.id, | ||
deactivated: o | ||
deactivated: r | ||
}, i = await I(n.urls.patch, { | ||
@@ -447,26 +449,26 @@ method: "PATCH", | ||
}); | ||
j(!1), i && "error" in i && i.error ? typeof n.errorCallback == "function" && n.errorCallback(i.error.message) : typeof n.successCallback == "function" && n.successCallback({ | ||
y(!1), i && "error" in i && i.error ? typeof n.errorCallback == "function" && n.errorCallback(i.error.message) : typeof n.successCallback == "function" && n.successCallback({ | ||
operation: "UPDATE" | ||
}); | ||
} | ||
c(); | ||
s(); | ||
} | ||
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: [ | ||
s ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
c ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
ue, | ||
{ | ||
ctoaVariant: (f = n.connection) != null && f.deactivated ? "primary" : "destructive", | ||
classNames: (N = n.classNames) == null ? void 0 : N.confirmationPrompt, | ||
cancelCallback: v, | ||
confirmationCallback: D, | ||
ctoaVariant: (_ = n.connection) != null && _.deactivated ? "primary" : "destructive", | ||
classNames: (F = n.classNames) == null ? void 0 : F.confirmationPrompt, | ||
cancelCallback: w, | ||
confirmationCallback: E, | ||
promptMessage: `Do you want to ${h()} the connection?` | ||
} | ||
) }) : null, | ||
s ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
c ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
he, | ||
{ | ||
label: y(), | ||
disabled: s, | ||
checked: !((r = n.connection) != null && r.deactivated), | ||
handleChange: F | ||
label: j(), | ||
disabled: c, | ||
checked: !((u = n.connection) != null && u.deactivated), | ||
handleChange: D | ||
} | ||
@@ -493,17 +495,17 @@ ) }) | ||
function Oe(n) { | ||
var a, u, E, w, M, R, U, W, q, B, J, Z, G, Y, K, Q, X, p, ee, ne, te, ae, se, ce; | ||
const [s, j] = k(() => !1); | ||
function y() { | ||
j(!s); | ||
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); | ||
} | ||
const [h, F] = k(() => !1), [v, D] = k(() => !0), [l, x] = k( | ||
const [h, D] = v(() => !1), [w, E] = v(() => !0), [l, C] = v( | ||
() => Ve | ||
); | ||
function f() { | ||
var _, b, g, m; | ||
function _() { | ||
var x, f, b, m; | ||
return { | ||
inputField: { | ||
label: (_ = n.classNames) == null ? void 0 : _.label, | ||
input: (b = n.classNames) == null ? void 0 : b.input, | ||
container: (g = n.classNames) == null ? void 0 : g.fieldContainer | ||
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 | ||
}, | ||
@@ -516,16 +518,16 @@ section: z( | ||
} | ||
function N(_, b) { | ||
function F(x, f) { | ||
return { | ||
...l, | ||
[_]: b | ||
[x]: f | ||
}; | ||
} | ||
function r(_) { | ||
const b = _.target, g = b.id, m = b.type === "checkbox" ? b.checked : b.value; | ||
x(N(g, m)); | ||
function u(x) { | ||
const f = x.target, b = f.id, m = f.type === "checkbox" ? f.checked : f.value; | ||
C(F(b, m)); | ||
} | ||
function o(_) { | ||
_.preventDefault(), F(!0); | ||
async function b(g) { | ||
const m = await I(g, { | ||
function r(x) { | ||
x.preventDefault(), D(!0); | ||
async function f(b) { | ||
const m = await I(b, { | ||
method: "PATCH", | ||
@@ -537,3 +539,3 @@ headers: { | ||
}); | ||
F(!1), m && ("error" in m && m.error ? typeof n.errorCallback == "function" && n.errorCallback(m.error.message) : "data" in m && typeof n.successCallback == "function" && n.successCallback({ | ||
D(!1), m && ("error" in m && m.error ? typeof n.errorCallback == "function" && n.errorCallback(m.error.message) : "data" in m && typeof n.successCallback == "function" && n.successCallback({ | ||
operation: "UPDATE", | ||
@@ -543,18 +545,18 @@ connection: m.data | ||
} | ||
b(n.urls.patch); | ||
f(n.urls.patch); | ||
} | ||
function c() { | ||
async function _(b) { | ||
const g = await I(b, { | ||
function s() { | ||
async function x(f) { | ||
const b = await I(f, { | ||
method: "DELETE" | ||
}); | ||
g && "error" in g && g.error ? typeof n.errorCallback == "function" && n.errorCallback(g.error.message) : typeof n.successCallback == "function" && n.successCallback({ | ||
b && "error" in b && b.error ? typeof n.errorCallback == "function" && n.errorCallback(b.error.message) : typeof n.successCallback == "function" && n.successCallback({ | ||
operation: "DELETE" | ||
}); | ||
} | ||
_(n.urls.delete); | ||
x(n.urls.delete); | ||
} | ||
function d(_) { | ||
var b; | ||
return !!((b = n.excludeFields) != null && b.includes(_)); | ||
function d(x) { | ||
var f; | ||
return !!((f = n.excludeFields) != null && f.includes(x)); | ||
} | ||
@@ -568,10 +570,10 @@ function i() { | ||
return V(() => { | ||
async function _(b) { | ||
const g = await I(b); | ||
if (D(!1), g) { | ||
if ("error" in g && g.error) | ||
typeof n.errorCallback == "function" && n.errorCallback(g.error.message); | ||
else if ("data" in g) { | ||
const m = g.data; | ||
x({ | ||
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({ | ||
...m, | ||
@@ -588,4 +590,4 @@ name: m.name, | ||
} | ||
_(t()); | ||
}, [t()]), /* @__PURE__ */ e.jsxs(de, { isBusy: v, children: [ | ||
x(t()); | ||
}, [t()]), /* @__PURE__ */ e.jsxs(de, { isBusy: w, children: [ | ||
/* @__PURE__ */ e.jsxs("div", { className: S.headingContainer, children: [ | ||
@@ -603,4 +605,4 @@ i() ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("h2", { className: S.heading, children: "Update Directory" }) }) : null, | ||
button: { | ||
ctoa: `${(E = (u = (a = n.classNames) == null ? void 0 : a.confirmationPrompt) == null ? void 0 : u.button) == null ? void 0 : E.ctoa} ${l != null && l.deactivated ? (M = (w = n.classNames) == null ? void 0 : w.button) == null ? void 0 : M.ctoa : (U = (R = n.classNames) == null ? void 0 : R.button) == null ? void 0 : U.destructive}`.trim(), | ||
cancel: (B = (q = (W = n.classNames) == null ? void 0 : W.confirmationPrompt) == null ? void 0 : q.button) == null ? void 0 : B.cancel | ||
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 | ||
} | ||
@@ -614,3 +616,3 @@ } | ||
] }), | ||
/* @__PURE__ */ e.jsxs("form", { onSubmit: (_) => o(_), children: [ | ||
/* @__PURE__ */ e.jsxs("form", { onSubmit: (x) => r(x), children: [ | ||
d("name") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
@@ -623,8 +625,8 @@ /* @__PURE__ */ e.jsx( | ||
value: l.name, | ||
handleInputChange: r, | ||
handleInputChange: u, | ||
required: !0, | ||
classNames: f().inputField | ||
classNames: _().inputField | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
@@ -638,6 +640,6 @@ d("scim_endpoint") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
copyDoneCallback: n.successCallback, | ||
classNames: f().inputField | ||
classNames: _().inputField | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
@@ -651,6 +653,6 @@ d("scim_token") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
copyDoneCallback: n.successCallback, | ||
classNames: f().inputField | ||
classNames: _().inputField | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
@@ -664,7 +666,7 @@ (l == null ? void 0 : l.type) === "google" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
value: l.google_domain, | ||
handleInputChange: r, | ||
classNames: f().inputField | ||
handleInputChange: u, | ||
classNames: _().inputField | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }) : null, | ||
@@ -679,7 +681,7 @@ d("webhook_url") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
value: l.webhook_url, | ||
handleInputChange: r, | ||
classNames: f().inputField | ||
handleInputChange: u, | ||
classNames: _().inputField | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
@@ -692,4 +694,4 @@ d("webhook_secret") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
id: "webhook_secret", | ||
classNames: f().inputField, | ||
handleChange: r, | ||
classNames: _().inputField, | ||
handleChange: u, | ||
value: l.webhook_secret, | ||
@@ -701,3 +703,3 @@ copyDoneCallback: n.successCallback, | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
@@ -712,6 +714,6 @@ d("log_webhook_events") ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
checked: l == null ? void 0 : l.log_webhook_events, | ||
handleChange: r | ||
handleChange: u | ||
} | ||
), | ||
/* @__PURE__ */ e.jsx(C, { y: 6 }) | ||
/* @__PURE__ */ e.jsx(g, { y: 6 }) | ||
] }), | ||
@@ -740,3 +742,3 @@ /* @__PURE__ */ e.jsxs("div", { className: S.formAction, children: [ | ||
] }), | ||
/* @__PURE__ */ e.jsxs("section", { className: f().section, children: [ | ||
/* @__PURE__ */ e.jsxs("section", { className: _().section, children: [ | ||
/* @__PURE__ */ e.jsxs("div", { className: S.info, children: [ | ||
@@ -746,3 +748,3 @@ /* @__PURE__ */ e.jsx("h6", { className: S.sectionHeading, children: "Delete this directory connection" }), | ||
] }), | ||
s ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
c ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
A, | ||
@@ -753,7 +755,7 @@ { | ||
type: "button", | ||
handleClick: y, | ||
handleClick: j, | ||
classNames: (Q = (K = n.classNames) == null ? void 0 : K.button) == null ? void 0 : Q.destructive | ||
} | ||
) }), | ||
s ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
c ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx( | ||
ue, | ||
@@ -769,4 +771,4 @@ { | ||
}, | ||
cancelCallback: y, | ||
confirmationCallback: c | ||
cancelCallback: j, | ||
confirmationCallback: s | ||
} | ||
@@ -777,7 +779,7 @@ ) }) : null | ||
} | ||
const Me = "_header_z5rjx_1", Re = "_h5_z5rjx_8", Ue = "_ctoa_z5rjx_15", We = "_listView_z5rjx_20", T = { | ||
header: Me, | ||
h5: Re, | ||
ctoa: Ue, | ||
listView: We | ||
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 | ||
}, H = { | ||
@@ -789,30 +791,35 @@ directoryListData: [], | ||
function Ze(n) { | ||
var r, o, c, d, i; | ||
const [s, j] = k( | ||
var r, s, d, i, t; | ||
const [c, y] = v( | ||
() => H.directoryListData | ||
), [y, h] = k(() => H.view); | ||
function F(t) { | ||
j(t); | ||
), [j, h] = v(() => H.view); | ||
function D(a) { | ||
y(a); | ||
} | ||
const [v, D] = k( | ||
const [w, E] = v( | ||
() => H.directoryToEdit | ||
); | ||
function l() { | ||
let a = n.urls.get; | ||
const [o, N] = a.split("?"), k = new URLSearchParams(N); | ||
return k.toString() ? `${o}/${w.id}?${k}` : `${o}/${w.id}`; | ||
} | ||
function C() { | ||
h("CREATE"); | ||
} | ||
function x(t, a) { | ||
h("EDIT"), D(a); | ||
function _(a, o) { | ||
h("EDIT"), E(o); | ||
} | ||
function f() { | ||
function F() { | ||
h("LIST"); | ||
} | ||
function N(t) { | ||
const { connection: a, operation: u } = t; | ||
function u(a) { | ||
const { connection: o, operation: N } = a; | ||
typeof n.successCallback == "function" && n.successCallback({ | ||
operation: u, | ||
connection: a | ||
}), u !== "COPY" && f(); | ||
operation: N, | ||
connection: o | ||
}), N !== "COPY" && F(); | ||
} | ||
return /* @__PURE__ */ e.jsxs("div", { children: [ | ||
y === "LIST" ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: T.listview, children: [ | ||
j === "LIST" ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: T.listview, children: [ | ||
/* @__PURE__ */ e.jsxs("div", { className: T.header, children: [ | ||
@@ -824,21 +831,23 @@ /* @__PURE__ */ e.jsx("h5", { className: T.h5, children: n.title || "Manage Dsync Connections" }), | ||
name: "Add Connection", | ||
handleClick: l, | ||
classNames: (o = (r = n.classNames) == null ? void 0 : r.button) == null ? void 0 : o.ctoa | ||
handleClick: C, | ||
classNames: (s = (r = n.classNames) == null ? void 0 : r.button) == null ? void 0 : s.ctoa | ||
} | ||
) }) | ||
] }), | ||
/* @__PURE__ */ e.jsx(C, { y: 8 }), | ||
/* @__PURE__ */ e.jsx(g, { y: 8 }), | ||
/* @__PURE__ */ e.jsx( | ||
De, | ||
{ | ||
...(c = n.componentProps) == null ? void 0 : c.directoryList, | ||
...(d = n.componentProps) == null ? void 0 : d.directoryList, | ||
urls: { | ||
get: n.urls.get | ||
}, | ||
handleActionClick: x, | ||
handleListFetchComplete: F | ||
handleActionClick: _, | ||
handleListFetchComplete: D, | ||
tenant: n.tenant, | ||
product: n.product | ||
} | ||
) | ||
] }) }) : null, | ||
y === "EDIT" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
j === "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" }) }), | ||
@@ -848,12 +857,12 @@ /* @__PURE__ */ e.jsx( | ||
{ | ||
...(d = n.componentProps) == null ? void 0 : d.editDirectory, | ||
...(i = n.componentProps) == null ? void 0 : i.editDirectory, | ||
classNames: n.classNames, | ||
successCallback: N, | ||
successCallback: u, | ||
errorCallback: n.errorCallback, | ||
cancelCallback: f, | ||
cancelCallback: F, | ||
displayHeader: !1, | ||
urls: { | ||
patch: `${n.urls.patch}/${v.id}`, | ||
delete: `${n.urls.delete}/${v.id}`, | ||
get: `${n.urls.get}/${v.id}` | ||
patch: `${n.urls.patch}/${w.id}`, | ||
delete: `${n.urls.delete}/${w.id}`, | ||
get: l() | ||
} | ||
@@ -863,13 +872,13 @@ } | ||
] }) : null, | ||
y === "CREATE" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [ | ||
j === "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(C, { y: 5 }), | ||
/* @__PURE__ */ e.jsx(g, { y: 5 }), | ||
/* @__PURE__ */ e.jsx( | ||
ve, | ||
{ | ||
...(i = n.componentProps) == null ? void 0 : i.createDirectory, | ||
...(t = n.componentProps) == null ? void 0 : t.createDirectory, | ||
classNames: n.classNames, | ||
successCallback: N, | ||
successCallback: u, | ||
errorCallback: n.errorCallback, | ||
cancelCallback: f, | ||
cancelCallback: F, | ||
displayHeader: !1, | ||
@@ -876,0 +885,0 @@ urls: { |
@@ -52,2 +52,4 @@ import { ConfirmationPromptProps, TableCol } from '../shared/types'; | ||
}; | ||
tenant?: string; | ||
product?: string; | ||
} | ||
@@ -54,0 +56,0 @@ export interface EditDirectoryProps { |
@@ -21,2 +21,4 @@ import { ConfirmationPromptProps, TableCol, TableProps } from '../../shared/types'; | ||
tableProps?: TableProps; | ||
tenant?: string; | ||
product?: string; | ||
} | ||
@@ -23,0 +25,0 @@ export interface CreateConnectionProps { |
{ | ||
"name": "@boxyhq/react-ui", | ||
"description": "React UI components from BoxyHQ", | ||
"version": "3.3.27", | ||
"version": "3.3.28", | ||
"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
997570
6363