uikit/dist/remote-ui-app-header.js
Mohamadzadeh 9709e96ea1
All checks were successful
Build and Deploy Next.js + Nginx Docker Image / build-and-deploy (push) Successful in 51s
Build and Deploy Next.js + Nginx Docker Image / deploy (push) Successful in 7s
remote-ui-segmented-selector
2026-10-19 17:27:38 +03:30

111 lines
3.1 KiB
JavaScript

import { jsx as A } from "react/jsx-runtime";
import d, { useRef as m, useEffect as x } from "react";
import { D as S } from "./chunks/constants-Dh2mKRrr.js";
const l = /* @__PURE__ */ new Map();
function R(t, e) {
const o = `${t}:${e}`;
return l.has(o) || l.set(
o,
import(
/* webpackIgnore: true */
/* @vite-ignore */
e
).catch((i) => {
throw l.delete(o), i;
})
), l.get(o);
}
function b({
componentName: t,
tagName: e,
defaultRemoteUrl: o,
normalizeProps: i
}) {
return function(p) {
const c = m(null), n = m(null), f = m(null);
return f.current = i ? i(p) : p, x(() => {
let g = !0;
return R(t, o).then(() => {
if (!g || !c.current) return;
const a = document.createElement(e);
a.componentProps = f.current, c.current.appendChild(a), n.current = a;
}).catch((a) => {
console.error(
`[uikit/remote/ui] Failed to load ${t}:`,
a
);
}), () => {
g = !1, n.current && (n.current.remove(), n.current = null);
};
}, [t, o, e]), x(() => {
n.current && (n.current.componentProps = f.current);
}), /* @__PURE__ */ A(
"span",
{
ref: c,
style: {
display: "contents"
}
}
);
};
}
const E = Symbol.for("uikit.remote.app-header.slot");
function s(t) {
function e() {
return null;
}
return e[E] = t, e;
}
const y = s("brandSection"), H = s("logo"), L = s("brand"), C = s("title"), P = s("description"), T = s("bi"), w = s("extra");
function u(t) {
var e;
if (!(t == null || typeof t == "boolean")) {
if (typeof t == "string" || typeof t == "number")
return String(t);
if (Array.isArray(t))
return t.map(u).filter(Boolean).join("");
if (d.isValidElement(t))
return u((e = t.props) == null ? void 0 : e.children);
}
}
function B(t) {
const e = {
showBi: !1,
showExtra: !1
};
function o(i) {
d.Children.forEach(i, (r) => {
var c, n;
if (!d.isValidElement(r)) return;
const p = (c = r.type) == null ? void 0 : c[E];
p === "logo" ? (e.logoSrc = r.props.src, e.logoAlt = r.props.alt, e.logoOptimize = r.props.optimize === !0) : p === "title" ? e.title = u(r.props.children) : p === "description" ? e.description = u(r.props.children) : p === "bi" ? (e.showBi = !0, e.biLogoSrc = r.props.logoSrc || r.props.src, e.biLogoAlt = r.props.alt, e.biText = r.props.text) : p === "extra" && (e.showExtra = !0, e.extraLogoSrc = r.props.logoSrc || r.props.src, e.extraLogoAlt = r.props.alt, e.extraText = r.props.text ?? u(r.props.children)), (n = r.props) != null && n.children && o(r.props.children);
});
}
return o(t), e;
}
const D = b({
componentName: "AppHeader",
tagName: "uikit-app-header",
defaultRemoteUrl: S.AppHeader,
normalizeProps: ({ children: t, ...e }) => t == null ? e : {
...e,
...B(t)
}
});
function O(t) {
return /* @__PURE__ */ A(D, { ...t });
}
const $ = Object.assign(O, {
BrandSection: y,
Logo: H,
Brand: L,
Title: C,
Description: P,
Extra: w,
Bi: T
});
export {
$ as AppHeader
};