@dndbuilder.com/react
Version:
Drag and drop builder for React
64 lines (63 loc) • 3.37 kB
JavaScript
import { jsx as o, jsxs as j, Fragment as I } from "react/jsx-runtime";
import M from "../../../../components/shared/custom-dot.js";
import g from "../../../../components/shared/custom-left-arrow.js";
import B from "../../../../components/shared/custom-right-arrow.js";
import { SliderPresets as F } from "../../types/index.js";
import { classNames as R } from "../../../../../../../utils.js";
import W from "../../../../../../../_virtual/index16.js";
const Q = ({ settings: t, meta: r }) => {
var n, l, a, i, d, c, p, m, u, h, w, k;
const s = (r == null ? void 0 : r.locale) || "en";
return /* @__PURE__ */ o(
W,
{
dots: (n = t.showDots) == null ? void 0 : n.desktop,
arrows: (l = t.showArrows) == null ? void 0 : l.desktop,
infinite: (a = t.infinite) == null ? void 0 : a.desktop,
slidesToShow: 1,
slidesToScroll: 1,
autoplay: (i = t.autoPlay) == null ? void 0 : i.desktop,
autoplaySpeed: ((d = t.autoplaySpeed) == null ? void 0 : d.desktop) ?? 3e3,
pauseOnHover: (c = t.pauseOnHover) == null ? void 0 : c.desktop,
nextArrow: /* @__PURE__ */ o(B, { classes: "text-white" }),
prevArrow: /* @__PURE__ */ o(g, { classes: "text-white" }),
customPaging: () => /* @__PURE__ */ o(M, {}),
className: R(
((p = t.preset) == null ? void 0 : p.desktop) ?? F.Preset1,
((u = (m = t.navigation) == null ? void 0 : m.arrowPlacement) == null ? void 0 : u.desktop) === "outside" && "arrows-outside",
((w = (h = t.navigation) == null ? void 0 : h.dotPlacement) == null ? void 0 : w.desktop) === "outside" && "dots-outside"
),
children: (k = t.slides) == null ? void 0 : k.map((e, D) => {
var x, N, S, y, P, A, T, _, H, O, C, L;
const f = (x = e.title) == null ? void 0 : x[s], v = (N = e.description) == null ? void 0 : N[s], b = (y = (S = e.button) == null ? void 0 : S.text) == null ? void 0 : y[s];
return /* @__PURE__ */ j("div", { className: `slide-item slide-item-${e.id}`, children: [
/* @__PURE__ */ j("div", { className: "slide-content", children: [
f && /* @__PURE__ */ o("div", { className: "title", dangerouslySetInnerHTML: { __html: f } }),
v && /* @__PURE__ */ o(
"div",
{
className: "description",
dangerouslySetInnerHTML: { __html: v }
}
),
((P = e.button) == null ? void 0 : P.text) && /* @__PURE__ */ o(I, { children: (T = (A = e.button) == null ? void 0 : A.link) != null && T.url ? /* @__PURE__ */ o(
"a",
{
className: "btn",
href: (H = (_ = e.button) == null ? void 0 : _.link) == null ? void 0 : H.url,
rel: (O = e.button) != null && O.link.nofollow ? "nofollow" : void 0,
target: (C = e.button) != null && C.link.newWindow ? "_blank" : void 0,
children: /* @__PURE__ */ o("span", { children: b })
}
) : /* @__PURE__ */ o("button", { className: "btn", children: /* @__PURE__ */ o("span", { children: b }) }) })
] }),
((L = e.showBgOverlay) == null ? void 0 : L.desktop) && /* @__PURE__ */ o("div", { className: "overlay" })
] }, D);
})
}
);
};
export {
Q as default
};
//# sourceMappingURL=preset-one.js.map