@ithinkdt/naive
Version:
iThinkDT Naive UI
1,718 lines • 144 kB
JavaScript
import { defineComponent as T, watchEffect as Kl, createVNode as t, Fragment as Se, isVNode as G, inject as R, useSlots as $e, ref as P, computed as S, reactive as J, markRaw as We, watch as O, useAttrs as Be, mergeProps as E, nextTick as de, shallowRef as ce, h as ne, defineAsyncComponent as U, createTextVNode as Q, resolveDirective as Ft, onUnmounted as hl, onMounted as ml, withDirectives as ge, resolveComponent as Xt, vShow as $t, shallowReactive as Ql, provide as Mt, Teleport as Jl, toRef as oe, isRef as gl, unref as He } from "vue";
import { watchDebounced as Gl, useElementHover as Xl, useEventListener as Yl, promiseTimeout as vl, useFullscreen as en, until as wl, toReactive as bl, useElementSize as Tt, useDebounceFn as tn, asyncComputed as Ot, throttledWatch as ln, syncRef as nn, refDebounced as an } from "@vueuse/core";
import { useClass as Ue, clone as rn, walkTree as Ae, debounce as on, useElementIntersectionRect as sn, measureText as un } from "@ithinkdt/common";
import { useTheme as Me, useI18n as K, usePageTab as dn, useAuth as Ht, useLogin as yl, getFirstPageModule as cn, Validators as fn, useFormModal as pn, $msg as et, lang as _e, Route as hn, $notice as mn, modals as Dt, i18n as Yt, DtLayoutView as gn, useCoreCtx as vn, useDict as wn, useDictMap as bn, useCurd as yn, $dialog as xn, useModal as _n } from "@ithinkdt/core";
import { NResult as kn, NFlex as ee, NButton as M, NEllipsis as xl, NScrollbar as ze, NMenu as _l, NDropdown as me, NAvatar as Ke, NIcon as B, NTooltip as W, NTag as Ie, NBreadcrumb as Cn, NBreadcrumbItem as Sn, NRadioButton as $n, NRadio as Mn, NRadioGroup as Tn, NCheckboxGroup as Dn, NCheckbox as Pt, NDataTable as Pn, gridProps as Nn, NForm as An, NGrid as In, NGi as nt, NFormItem as el, NTree as kl, NDynamicInput as Cl, NPopover as Sl, NSpin as $l, NConfigProvider as Ml, NGlobalStyle as Ln, NMessageProvider as Bn, NNotificationProvider as zn, NDialogProvider as qn, NLoadingBarProvider as En, useMessage as Fn, useDialog as On, useNotification as Hn, drawerContentProps as Vn, modalProps as jn, commonDark as Tl, commonLight as Dl, lightTheme as Rn, formProps as Un, cardProps as Zn, NCard as tl, NText as ll, NAvatarGroup as Wn, NH4 as Kn, NSelect as Qn, NInput as Jn, NSkeleton as Ne, NTreeSelect as Gn } from "ithinkdt-ui";
import { cB as H, fullWH as Nt, flexCenter as Pl, cE as k, CSS_MOUNT_ANCHOR_META_NAME as V, CSS_STYLE_PREFIX as D, fullWidth as Nl, flexAlignCenter as Qe, cM as j, flexGap as ve, c as F, fullHeight as nl, flexJustifySB as Xn, flexDirCol as ie } from "@ithinkdt/core/cssr";
import { RouterLink as Yn, useRouter as tt } from "vue-router";
import ea from "ithinkdt-ui/es/locales/common/zhCN";
import ta from "ithinkdt-ui/es/locales/date/zhCN";
import { nanoid as al } from "nanoid";
import { Sortable as Al } from "sortablejs/modular/sortable.core.esm.js";
function Ve(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !G(e);
}
const Fr = /* @__PURE__ */ T({
name: "DtError",
props: {
type: {
type: String,
default: "404"
},
path: {
type: String,
default: ""
}
},
setup(e) {
const n = `${D}-error`;
la(n);
const l = Me(), {
t: a
} = K(), {
title: s,
close: d
} = dn(), o = Ht(), i = () => {
o.token = void 0, setTimeout(h, 100);
}, {
logout: r
} = yl();
Kl(() => {
e.type === "404" && (s.value ??= e.type);
const c = e.type === "forbidden" || e.type === "timeout";
l.hasTopbar = !c, l.hasSidebar = !c, l.hasBreadcrumb = !c, l.hasFooter = !c;
});
function u() {
d();
}
const h = () => {
location.reload();
}, g = {
403: "403",
404: "404",
500: "500",
forbidden: "403",
timeout: "500"
};
return () => t("div", {
class: n
}, [t("div", {
class: `${n}__wrapper`
}, [t(kn, {
status: g[e.type],
title: a(`sys.error.${e.type}`)
}, {
default: () => t("span", {
class: `${n}__content`,
innerHTML: a(`sys.error.${e.type}-desc`)
}, null),
footer: () => {
let c, w, m, y;
return t(ee, {
class: `${n}__footer`,
vertical: !0,
align: "center",
size: 40
}, {
default: () => [e.type === "forbidden" ? t(Se, null, [t(M, {
class: `${n}__action`,
size: "large",
type: "primary",
onClick: i
}, Ve(c = a("sys.error.refreshAuth")) ? c : {
default: () => [c]
}), t(M, {
class: `${n}__action`,
size: "large",
type: "error",
onClick: r
}, Ve(w = a("sys.error.exitAccount")) ? w : {
default: () => [w]
})]) : e.type === "timeout" ? t(M, {
class: `${n}__action`,
type: "primary",
size: "large",
onClick: h
}, Ve(m = a("sys.error.refreshPage")) ? m : {
default: () => [m]
}) : t(M, {
class: `${n}__action`,
type: "primary",
size: "large",
onClick: u
}, Ve(y = a("sys.error.back")) ? y : {
default: () => [y]
})]
});
}
})])]);
}
});
let at;
function la(e) {
at || (at = H("error", {
...Nt,
...Pl
}, [k("wrapper", {
display: "inline-block",
textAlign: "center",
paddingBottom: "10vh"
}), k("footer", {
margin: "100px 0 0"
}), k("action", {
width: "240px"
})]), at.mount({
id: e,
anchorMetaName: V
}));
}
const Or = /* @__PURE__ */ T({
name: "DtLogo",
props: {
src: {
type: String,
required: !1,
default: void 0
},
name: {
type: String,
required: !1,
default: void 0
}
},
setup(e) {
const n = `${D}-logo`;
na(n);
const l = R("__INJECTED_AUTH__"), a = R("__INJECTED_THEME__"), s = $e(), d = P(), o = S(() => a.logoPlacement === "sidebar" && !a.isFixedSidebar);
Ue(d, `${n}--collapsed`, o);
const i = P(!0), r = () => e.src?.trim() ? t("img", {
src: e.src,
alt: "logo"
}, null) : s.default?.(), u = () => t("span", null, [e.name ?? l.app?.appName]);
return () => t("div", {
class: n,
ref: d
}, [t("div", {
class: `${n}__icon`
}, [t(r, null, null)]), t("div", {
class: [`${n}__name`, i.value && o.value ? `${n}__name--hidden` : ""],
onTransitionstart: () => i.value = !1,
onTransitionend: () => i.value = !0
}, [t(u, {
class: `${n}__name-content`
}, null)])]);
}
});
let rt;
function na(e) {
rt || (rt = H("logo", {
...Nl,
...Qe,
justifyContent: "center",
overflow: "hidden",
whiteSpace: "nowrap",
fontSize: "16px",
padding: "0 16px",
boxSizing: "border-box"
}, [k("icon", {
lineHeight: "0"
}), k("name", {
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
marginLeft: "12px",
color: "var(--dt-text-color1)",
fontSize: "22px",
fontWeight: "bold"
}), j("collapsed", [k("name", {
opacity: "0",
transform: "scaleX(0)"
}, [j("hidden", {
display: "none"
})])])]), rt.mount({
id: e,
anchorMetaName: V
}));
}
const Il = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 256 256"
}, [t("path", {
fill: "currentColor",
d: "M235.4 210a124.2 124.2 0 0 0-61.8-53.2a76 76 0 1 0-91.2 0A124.2 124.2 0 0 0 20.6 210a12 12 0 0 0 20.8 12a100 100 0 0 1 173.2 0a12.1 12.1 0 0 0 10.4 6a11.7 11.7 0 0 0 6-1.6a12 12 0 0 0 4.4-16.4ZM76 96a52 52 0 1 1 52 52a52 52 0 0 1-52-52Z"
}, null)]), Je = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "m17 18l-5-2.18L7 18V5h10m0-2H7a2 2 0 0 0-2 2v16l7-3l7 3V5a2 2 0 0 0-2-2Z"
}, null)]), Hr = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59L21 7Z"
}, null)]), aa = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2Z"
}, null)]), ra = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M11 16v-3h10v-2H11V8l-4 4l4 4m-8 4h2V4H3v16Z"
}, null)]), oa = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 1024 1024"
}, [t("path", {
fill: "currentColor",
d: "M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 0 0-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 0 0 0 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"
}, null)]), ia = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M13 8v3H3v2h10v3l4-4l-4-4m6 12h2V4h-2v16Z"
}, null)]), At = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6L6.4 19Z"
}, null)]), Vr = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10s10-4.486 10-10S17.493 2 11.953 2zM13 17h-2v-2h2v2zm0-4h-2V7h2v6z"
}, null)]), sa = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 -1 24 23"
}, [t("path", {
fill: "currentColor",
d: "M21 18v2H3v-2h18zM6.95 3.55v9.9L2 8.5l4.95-4.95zM21 11v2h-9v-2h9zm0-7v2h-9V4h9z"
}, null)]), ua = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 -1 24 23"
}, [t("path", {
fill: "currentColor",
d: "M21 18v2H3v-2h18zM17.05 3.55L22 8.5l-4.95 4.95v-9.9zM12 11v2H3v-2h9zm0-7v2H3V4h9z"
}, null)]), da = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("g", {
fill: "none",
stroke: "currentColor",
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": "1.5"
}, [t("path", {
d: "M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2S2 6.477 2 12Z"
}, null), t("path", {
d: "M13 2.05S16 6 16 12c0 6-3 9.95-3 9.95m-2 0S8 18 8 12c0-6 3-9.95 3-9.95M2.63 15.5h18.74m-18.74-7h18.74"
}, null)])]), ca = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M15.325 16.275q-.275-.325-.275-.738q0-.412.275-.687l1.85-1.85H10q-.425 0-.712-.288Q9 12.425 9 12t.288-.713Q9.575 11 10 11h7.175l-1.85-1.85q-.3-.3-.3-.712q0-.413.3-.713q.275-.3.688-.3q.412 0 .687.275l3.6 3.6q.15.15.213.325q.062.175.062.375t-.062.375q-.063.175-.213.325l-3.6 3.6q-.325.325-.712.287q-.388-.037-.663-.312ZM5 21q-.825 0-1.413-.587Q3 19.825 3 19V5q0-.825.587-1.413Q4.175 3 5 3h6q.425 0 .713.287Q12 3.575 12 4t-.287.712Q11.425 5 11 5H5v14h6q.425 0 .713.288q.287.287.287.712t-.287.712Q11.425 21 11 21Z"
}, null)]), fa = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8h5Z"
}, null)]), pa = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 15 15"
}, [t("path", {
fill: "currentColor",
"clip-rule": "evenodd",
"fill-rule": "evenodd",
d: "M12 13a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v3.5a.5.5 0 0 0 1 0V3h9v9H8.5a.5.5 0 0 0 0 1H12ZM9 6.5v3a.5.5 0 0 1-1 0V7.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 7H5.5a.5.5 0 0 1 0-1h3a.498.498 0 0 1 .5.497"
}, null)]), jr = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M19 10h1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1h1V9a7 7 0 1 1 14 0v1zM5 12v8h14v-8H5zm6 2h2v4h-2v-4zm6-4V9A5 5 0 0 0 7 9v1h10z"
}, null)]), rl = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M17.65 6.35A7.958 7.958 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35Z"
}, null)]), ha = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 32 32"
}, [t("path", {
fill: "none",
stroke: "currentColor",
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": "2",
d: "M4 12V4h8m8 0h8v8M4 20v8h8m16-8v8h-8"
}, null)]), ma = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 32 32"
}, [t("path", {
fill: "none",
stroke: "currentColor",
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": "2",
d: "M4 12h8V4m8 0v8h8M4 20h8v8m16-8h-8v8"
}, null)]), ga = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 48 48"
}, [t("path", {
fill: "none",
stroke: "currentColor",
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": "4",
d: "M30 6h12v12M18 6H6v12m24 24h12V30M18 42H6V30M42 6L29 19M19 29L6 42"
}, null)]), va = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 48 48"
}, [t("path", {
fill: "none",
stroke: "currentColor",
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": "4",
d: "M41 19H29V7M18 6H6v12m24 24h12V30M7 29h12v12M42 6L29 19M19 29L6 42"
}, null)]), wa = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M11 19q1.35 0 2.513-.538q1.162-.537 1.987-1.487q-3.15-.2-5.325-2.488Q8 12.2 8 9q0-.325.025-.638q.025-.312.075-.612q-1.4.775-2.25 2.162Q5 11.3 5 13q0 2.5 1.75 4.25T11 19Zm0 2q-3.35 0-5.675-2.325Q3 16.35 3 13q0-3.35 2.325-5.675Q7.65 5 11 5q.125 0 .25.012q.125.013.25.013q-.725.8-1.113 1.812Q10 7.85 10 9q0 2.5 1.75 4.25T16 15q.8 0 1.525-.2q.725-.2 1.375-.55q-.45 2.875-2.662 4.812Q14.025 21 11 21Zm2.8-10L17 2h2l3.2 9h-1.9l-.7-2h-3.2l-.7 2Zm3.05-3.35h2.3L18 4Z"
}, null)]), ba = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M12 21q-3.75 0-6.375-2.625T3 12q0-3.75 2.625-6.375T12 3q.35 0 .688.025q.337.025.662.075q-1.025.725-1.637 1.887Q11.1 6.15 11.1 7.5q0 2.25 1.575 3.825Q14.25 12.9 16.5 12.9q1.375 0 2.525-.613q1.15-.612 1.875-1.637q.05.325.075.662Q21 11.65 21 12q0 3.75-2.625 6.375T12 21Zm0-2q2.2 0 3.95-1.212q1.75-1.213 2.55-3.163q-.5.125-1 .2q-.5.075-1 .075q-3.075 0-5.238-2.162Q9.1 10.575 9.1 7.5q0-.5.075-1t.2-1q-1.95.8-3.162 2.55Q5 9.8 5 12q0 2.9 2.05 4.95Q9.1 19 12 19Zm-.25-6.75Z"
}, null)]), ya = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M12 15q1.25 0 2.125-.875T15 12q0-1.25-.875-2.125T12 9q-1.25 0-2.125.875T9 12q0 1.25.875 2.125T12 15Zm0 2q-2.075 0-3.537-1.463Q7 14.075 7 12t1.463-3.538Q9.925 7 12 7t3.538 1.462Q17 9.925 17 12q0 2.075-1.462 3.537Q14.075 17 12 17ZM1 13v-2h4v2Zm18 0v-2h4v2Zm-8-8V1h2v4Zm0 18v-4h2v4ZM6.35 7.75L3.875 5.275l1.4-1.4L7.75 6.35Zm12.375 12.375L16.25 17.65l1.4-1.4l2.475 2.475ZM17.65 7.75l-1.4-1.4l2.475-2.475l1.4 1.4ZM5.275 20.125l-1.4-1.4L6.35 16.25l1.4 1.4ZM12 12Z"
}, null)]), xa = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M16 7H4c-1.103 0-2 .897-2 2v10c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V9c0-1.103-.897-2-2-2zM4 19v-8h12V9l.002 10H4z"
}, null), t("path", {
fill: "currentColor",
d: "M22 5c0-1.103-.897-2-2-2H7c-1.103 0-2 .897-2 2h13.001c1.101 0 1.996.895 1.999 1.994L20.002 15H20v2c1.103 0 2-.897 2-2V8.007L22.001 8V6L22 5.99V5z"
}, null)]), Rr = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 48 48"
}, [t("g", {
fill: "none",
stroke: "currentColor",
"stroke-linecap": "round",
"stroke-width": "4"
}, [t("path", {
"stroke-linejoin": "round",
d: "M4 6h40v30H29l-5 5l-5-5H4V6Z"
}, null), t("path", {
d: "M23 21h2.003m7.998 0H35m-21.999 0H15"
}, null)])]), Ur = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z"
}, null)]), Zr = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2Z"
}, null)]), _a = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "m7 10l5 5l5-5H7Z"
}, null)]), ka = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5"
}, null)]), Ca = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
role: "img",
width: "1em",
height: "1em",
viewBox: "0 0 24 24"
}, [t("path", {
fill: "currentColor",
d: "M20 20.5c0 .8-.7 1.5-1.5 1.5H13c-.4 0-.7-.1-1-.4l-4-4.2l.7-.8c.2-.2.5-.3.8-.3h.2L12 18V9c0-.6.4-1 1-1s1 .4 1 1v4.5l1.2.1l3.9 2.2c.5.2.9.8.9 1.3v3.4M20 2H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h4v-2H4V4h16v8h-2v2h2c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2Z"
}, null)]), Ze = `${D}-side-menu`;
function Ge(e, n, l) {
return e.map(({
key: a,
type: s,
label: d,
_path: o,
path: i,
hidden: r,
icon: u = n,
children: h
}) => {
const g = J({
key: a,
label: d,
_type: s,
_path: o,
path: i,
show: !r,
icon: void 0,
_icon: u,
children: h?.length ? Ge(h, void 0, l) : h
});
return u && typeof u == "string" ? Promise.resolve(l(u)).then((c) => {
c ? g.icon = We(c) : console.debug(`[theme] not found icon: ${u}`);
}).catch((c) => {
console.debug(`[theme] load icon: ${u} failured`, c);
}) : g.icon = u, g;
});
}
const ot = Symbol(), it = Symbol();
function Ll(e, n = !1) {
return e[ot] || (e[it] = !e._path && e._type === "group" ? e.label : t(Yn, {
to: e._path ?? e.path
}, {
default: () => [e.label]
}), e[ot] = t(xl, {
class: `${Ze}__ellipsis`
}, {
default: () => e[it],
tooltip: () => e.label
})), n ? e[it] : e[ot];
}
const Wr = /* @__PURE__ */ T({
name: "DtSideMenu",
inheritAttrs: !1,
props: {
full: {
type: Boolean,
required: !1,
default: !0
}
},
setup(e) {
Sa(Ze);
const n = R("__INJECTED_AUTH__"), l = R("__INJECTED_THEME__"), a = P([]), s = P();
function d(r) {
de(() => {
r.at(-1) && s.value?.showOption(r.at(-1)?.key);
});
}
O([() => e.full, () => n.menus], ([r, u]) => {
r && (a.value = Ge(u, Je, l.menuIconLoader)), d(n.activedMenuPath);
}, {
immediate: !0
}), O(() => n.activedMenuPath, (r, u) => {
r[0] !== u?.[0] && (e.full || (a.value = Ge(r[0]?.children ?? [], Je, l.menuIconLoader)), d(r));
}, {
immediate: !0
});
function o(r) {
return Ll(r, !l.isFixedSidebar && !!r.icon);
}
const i = Be();
return () => t(ze, null, {
default: () => [t(_l, E(i, {
ref: s,
class: {
[Ze]: !0,
[`${Ze}--dark`]: l.isDark
},
accordion: l.accordionMenu,
options: a.value,
mode: "vertical",
collapsed: !l.isFixedSidebar,
collapsedWidth: 58,
renderLabel: o,
value: n.activedMenuPath.at(-1)?.key ?? null,
rootIndent: 16,
dropdownProps: {
showArrow: !0
}
}), null)]
});
}
});
let st;
function Sa(e) {
st || (st = H("side-menu", {
[`--${e}__submenu-bg`]: "rgba(0, 0, 0, 0.03)"
}, [
j("dark", {
[`--${e}__submenu-bg`]: "rgba(0, 0, 0, 0.15)"
})
// cE('icon', {
// ...fullWH,
// ...flexDirCol,
// ...flexAlignCenter,
// ...flexGap('4px'),
// }),
// cE('icon-wrapper', {
// lineHeight: '0',
// width: '24px',
// height: '24px',
// fontSize: '24px',
// }),
// cE('icon-name', {
// display: 'inline-block',
// width: '4em',
// fontSize: '12px',
// textAlign: 'center',
// lineHeight: '1em',
// transform: 'scale(calc(5 / 6))',
// // position: 'absolute',
// // bottom: '0',
// }),
// c('&.n-menu--collapsed', [
// c('.n-menu-item-content--selected::after', {
// background: 'unset',
// }),
// ]),
// c('& > div:first-child', {
// marginTop: '0',
// }),
// c('.n-submenu-children', {
// background: `var(--${cls}__submenu-bg)`,
// }),
// c('.n-menu-item-content::before', {
// transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
// left: '0',
// right: '0',
// top: '0',
// bottom: '0',
// borderRadius: '0',
// }),
// c('.n-menu-item-content--selected::after', {
// content: `''`,
// display: 'inline-block',
// position: 'absolute',
// right: '0',
// width: '2.5px',
// height: '100%',
// background: 'var(--dt-primary-color-hover)',
// }),
]), st.mount({
id: e,
anchorMetaName: V
}));
}
const Kr = /* @__PURE__ */ T({
name: "DtNavMenu",
props: {
full: {
type: Boolean,
required: !1,
default: !0
}
},
setup(e) {
const n = `${D}-nav-menu`;
$a(n);
const l = R("__INJECTED_AUTH__"), a = R("__INJECTED_THEME__"), s = ce([]), d = P();
return O([() => e.full, () => l.menus], ([o, i]) => {
if (!o)
for (const r of i)
r._path ??= cn(r.children ?? [])?.path;
s.value = Ge(i, Je, a.menuIconLoader);
}, {
immediate: !0
}), () => t(_l, {
class: n,
options: s.value,
mode: "horizontal",
renderLabel: Ll,
value: l.activedMenuPath[0]?.key ?? null,
rootIndent: 16,
ref: d,
childrenField: e.full ? "children" : "_children"
}, null);
}
});
let ut;
function $a(e) {
ut || (ut = H("nav-menu", {
lineHeight: "1",
...ve("4px")
}, [F("&.n-menu--horizontal", [F(".n-menu-item", {
marginTop: "1px"
}), F(".n-menu-item-content", {
padding: "0 18px"
})])]), ut.mount({
id: e,
anchorMetaName: V
}));
}
const Qr = /* @__PURE__ */ T({
name: "DtUser",
props: {
src: String,
dropMenus: {
type: Array,
requilred: !1,
default: void 0
}
},
setup(e, {
slots: n
}) {
const l = `${D}-user`;
Ma(l);
const a = R("__INJECTED_AUTH__"), s = R("__INJECTED_THEME__"), {
t: d
} = K(), o = S(() => a.user?.nickname?.slice(0, 1)), {
logout: i
} = yl(), r = fn.minmax(6, 20, d("sys.user.validatorPasswdLenth")), {
open: u
} = pn({
title: d("sys.user.changePasswdTitle"),
labelWidth: "8em",
submitText: d("sys.user.changePasswdButton"),
save: (c) => a.changePwd(c).then(() => {
et.success(d("sys.user.changePasswdSuccess"));
}),
items: ({
fi: c,
model: w
}) => [c("old", "input|6~20", {
label: d("sys.user.changePasswdForm1"),
props: {
type: "password",
showPasswordOn: "click"
},
span: 24,
required: !0,
rule: [r]
}), c("new", "input|6~20", {
label: d("sys.user.changePasswdForm2"),
props: {
type: "password",
showPasswordOn: "click"
},
span: 24,
required: !0,
rule: [r, {
message: d("sys.user.validatorPasswdNotEqualLast"),
trigger: "blur",
validator: (m) => {
if (m != null)
return m !== w.old;
}
}]
}), c("confirm", "input|6~20", {
label: d("sys.user.changePasswdForm3"),
props: {
type: "password",
showPasswordOn: "click"
},
span: 24,
required: !0,
rule: [r, {
message: d("sys.user.validatorPasswdNotEqualNew"),
trigger: "blur",
validator: (m) => {
if (m != null)
return m === w.new;
}
}]
})]
}), h = S(() => {
const c = [...e.dropMenus ?? []];
return s.showChangePwd && c.push(J({
key: "changepwd",
label: d("sys.user.changePasswdTitle"),
action: () => u()
})), s.logoutPlacement === "dropdown" && c.push(J({
key: "logout",
label: S(() => d("sys.login.logout")),
action: i
})), c;
}), g = (c, {
action: w
}) => {
w?.();
};
return P(!1), () => t("div", {
class: l
}, [t(me, {
options: h.value,
displayDirective: "if",
"show-arrow": !0,
onSelect: g
}, {
default: () => [t(M, {
class: `${l}__wrapper`,
quaternary: !0,
size: "large"
}, {
default: () => [t("div", {
class: `${l}__head`
}, [e.src ? t(Ke, {
class: `${l}__avator`,
round: !0,
size: 30,
src: e.src
}, null) : t(Ke, {
class: `${l}__avator`,
round: !0,
size: 30,
style: {
backgroundColor: o.value ? s.vars.primaryColor : void 0
}
}, {
default: () => [n.default?.() || o.value || t(B, {
color: s.vars.primaryColorHover
}, {
default: () => [t(Il, null, null)]
})]
}), s.usernamePlacement === "outlet" ? t("div", {
class: `${l}__name`
}, [a.user?.nickname]) : void 0])]
})]
}), s.logoutPlacement === "outlet" && a.logged ? t(W, null, {
default: () => d("sys.login.logout"),
trigger: () => t(M, {
class: `${l}__logout-btn`,
quaternary: !0,
circle: !0,
onClick: i
}, {
default: () => [t(ca, null, null)]
})
}) : void 0]);
}
});
let dt;
function Ma(e) {
dt || (dt = H("user", {
...Qe,
...ve("1em"),
cursor: "pointer",
marginRight: "16px"
}, [k("wrapper", {
padding: "0 12px"
}), k("head", {
...Qe,
...ve("10px")
}), k("name", {
color: "var(--dt-text-color1)"
}), k(" logout-btn", {
fontSize: "19px"
})]), dt.mount({
id: e,
anchorMetaName: V
}));
}
const Jr = /* @__PURE__ */ T({
name: "DtLanguage",
setup() {
const e = `${D}-language`;
Ta(e);
const {
t: n,
locale: l
} = K(), a = S(() => Object.values(_e).map((s) => ({
label: n("sys.lang", {
locale: s
}),
key: s
})));
return () => t(me, {
showArrow: !0,
displayDirective: "if",
options: a.value,
onSelect: (s) => l.value = s
}, {
default: () => [t(M, {
class: e,
quaternary: !0,
circle: !0,
size: "large"
}, {
default: () => [t(da, null, null)]
})]
});
}
});
let ct;
function Ta(e) {
ct || (ct = H("language", {
fontSize: "19px"
}), ct.mount({
id: e,
anchorMetaName: V
}));
}
const Gr = /* @__PURE__ */ T({
name: "DtCollpaseBtn",
inheritAttrs: !1,
props: {
size: {
type: String,
required: !1,
default: "medium"
}
},
setup(e) {
const n = `${D}-collpase-btn`;
Da(n);
const l = R("__INJECTED_THEME__"), {
t: a
} = K(), s = Be();
return () => t(W, {
delay: 666,
duration: 0,
placement: "right"
}, {
default: () => l.isFixedSidebar ? a("sys.collpase") : a("sys.expand"),
trigger: () => t(M, E({
class: [n, `${n}--${e.size}`],
text: !0,
onClick: () => l.isFixedSidebar = !l.isFixedSidebar
}, s), {
default: () => [t(B, null, {
default: () => [l.isFixedSidebar ? t(sa, null, null) : t(ua, null, null)]
})]
})
});
}
});
let ft;
function Da(e) {
ft || (ft = H("collpase-btn", {
fontSize: "19px",
backdropFilter: "blur(5px)"
}, [j("large", {
fontSize: "22px"
})]), ft.mount({
id: e,
anchorMetaName: V
}));
}
const ye = (e, n = 20) => t(B, {
size: n
}, {
default: () => [t(e, null, null)]
}), Xr = /* @__PURE__ */ T({
name: "DtTabs",
props: {
showBreadcrumb: Boolean
},
setup(e) {
const n = `${D}-page-tabs`;
Pa(n);
const l = tt(), a = R("__INJECTED_THEME__"), {
$t: s,
t: d
} = K(), o = J({
visible: !1,
x: 0,
y: 0
}), i = (x, N) => {
x.preventDefault(), x.stopPropagation(), r(N, x.clientX, x.clientY);
}, r = async (x, N, A) => {
o.visible && o.tab === x || (o.tab = x, o.visible && (o.visible = !1, await vl(130)), o.visible = !0, o.x = N, o.y = A);
}, u = async () => {
requestIdleCallback(() => {
o.visible = !1;
}, {
timeout: 30
});
}, h = S(() => !o.tab || o.tab !== a.currentPage), g = S(() => !o.tab), c = J([{
key: "reload",
label: s("sys.tab.reload"),
disabled: h,
icon: () => ye(rl)
}, {
type: "divider",
key: "d1"
}, {
key: "open",
label: s("sys.tab.openWindow"),
disabled: !1,
icon: () => ye(pa)
}, {
type: "divider",
key: "d1"
}, {
key: "closeAll",
label: s("sys.tab.closeAll"),
disabled: !1,
icon: () => ye(At)
}, {
key: "closeLeft",
label: s("sys.tab.closeLeft"),
disabled: g,
icon: () => ye(ra)
}, {
key: "closeRight",
label: s("sys.tab.closeRight"),
disabled: g,
icon: () => ye(ia)
}, {
key: "closeOther",
label: s("sys.tab.closeOther"),
disabled: g,
icon: () => ye(oa)
}]), w = (x) => {
switch (o.visible = !1, x) {
case "open": {
window.open(o.tab.href, "_blank");
break;
}
case "reload": {
a.reloadPage();
break;
}
case "close": {
a.closePage(o.tab);
break;
}
case "closeOther": {
a.closePages(a.pages.filter((N) => N !== o.tab));
break;
}
case "closeLeft": {
a.closePages(a.pages.slice(0, a.pages.indexOf(o.tab))), a.pages = a.pages.slice(a.pages.indexOf(o.tab));
break;
}
case "closeRight": {
a.closePages(a.pages.slice(a.pages.indexOf(o.tab) + 1));
break;
}
case "closeAll": {
a.closeAllPages();
break;
}
}
};
function m(x) {
if (!b.value?.children.length)
return;
const N = b.value.children[x];
y.value.scrollTo({
behavior: "smooth",
left: Math.max(0, b.value.offsetLeft + N.offsetLeft - y.value.clientWidth / 2 + N.clientWidth / 2 + 10)
});
}
const y = P(), b = P();
Gl(Xl(y), (x) => {
x || m(a.currentPageIndex);
}, {
debounce: 666
}), O(() => a.currentPageIndex, m, {
flush: "post"
}), Yl(y, "wheel", (x) => {
x.deltaMode === WheelEvent.DOM_DELTA_PIXEL && (x.preventDefault(), y.value.scrollBy({
left: x.deltaY
}));
}, {
passive: !1
});
const _ = t("div", {
class: `${n}__suffix`
}, [t(W, {
placement: "bottom",
delay: 333
}, {
default: () => a.fullTab ? d("sys.tab.exit") : d("sys.tab.full"),
trigger: () => t(M, {
text: !0,
onClick: () => a.fullTab = !a.fullTab
}, {
icon: () => t(B, null, {
default: () => [a.fullTab ? t(va, null, null) : t(ga, null, null)]
})
})
}), t(W, {
placement: "bottom",
delay: 333
}, {
default: () => d("sys.tab.reload"),
trigger: () => t(M, {
text: !0,
onClick: () => a.reloadPage()
}, {
icon: () => t(B, {
size: 20
}, {
default: () => [t(rl, null, null)]
})
})
}), t(W, {
placement: "bottom",
delay: 333
}, {
default: () => d("sys.tab.closeAll"),
trigger: () => t(M, {
text: !0,
onClick: () => w("closeAll")
}, {
icon: () => t(B, null, {
default: () => [t(At, null, null)]
})
})
})]), L = /* @__PURE__ */ T({
name: "DtTabItem",
props: {
current: Boolean,
showBreadcrumb: Boolean,
index: {
type: Number,
required: !0
},
tab: {
type: Object,
required: !0
}
},
setup(x) {
const N = R("__INJECTED_AUTH__"), A = R("__INJECTED_THEME__"), f = R("__INJECT_SLOTS__", {});
return () => t(Ie, {
class: [`${n}__tab ${x.current ? n + "__tab--curr" : ""}`],
type: x.current ? "primary" : "default",
closable: !0,
bordered: !1,
onClose: () => A.closePageByIndex(x.index),
onClick: () => l.push(x.tab.path),
onContextmenu: (p) => i(p, x.tab)
}, {
default: () => {
const p = x.tab.title ?? N.moduleMap[x.tab.moduleKey]?.label ?? x.tab.path;
return x.current && A.hasBreadcrumb && x.showBreadcrumb && f.breadcrumb ? t("span", {
style: "pointer-events: none"
}, [f.breadcrumb()]) : p;
},
icon: () => x.current ? t(B, {
size: 10
}, {
default: () => [t(aa, null, null)]
}) : void 0
});
}
});
return () => t("div", {
class: [n, {
[`${n}--dark`]: a.isDark
}],
ref: y
}, [t("div", {
class: `${n}__prefix`
}, null), t("div", {
class: `${n}__content`,
ref: b
}, [a.pages.map((x, N) => t(L, {
key: x.key,
index: N,
current: a.currentPageIndex === N,
tab: x,
showBreadcrumb: e.showBreadcrumb
}, null))]), _, t(me, {
placement: "bottom-start",
size: "small",
trigger: "manual",
show: o.visible,
x: o.x,
y: o.y,
options: c,
onClickoutside: u,
onSelect: w
}, null)]);
}
});
let pt;
function Pa(e) {
pt || (pt = H("page-tabs", {
...nl,
display: "flex",
overflow: "hidden"
}, [k("prefix", {
zIndex: "1",
flex: "0 0 16px",
position: "sticky",
left: "0",
backdropFilter: "blur(2px)",
pointerEvents: "none"
}), k("suffix", {
...ve("14px"),
width: "32px",
flexDirection: "row-reverse",
opacity: "0.8",
transition: "width 0.15s cubic-bezier(0.4, 0, 0.2, 1)",
overflow: "hidden",
padding: "3px 23px 0 0",
zIndex: "1",
flex: "0 0 auto",
position: "sticky",
right: "0",
backdropFilter: "blur(2px)"
}, [F("&:hover", {
width: "100px"
})]), k("content", {
...ve("10px"),
...nl,
flex: "1 0 auto",
alignItems: "center"
}), k("tab", {
cursor: "pointer",
padding: "4px 12px",
height: "33px",
"--n-close-margin": "0 0 0 8px !important",
"--n-close-icon-size": "12px !important",
"--n-font-size": "14px !important"
})]), pt.mount({
id: e,
anchorMetaName: V
}));
}
const Yr = /* @__PURE__ */ T({
name: "DtFullscreen",
inheritAttrs: !1,
setup() {
const e = `${D}-fullscreen`;
Na(e);
const {
t: n
} = K(), l = Be(), {
isFullscreen: a,
isSupported: s,
toggle: d
} = en(document.documentElement);
return () => t(W, {
delay: 333,
duration: 0,
placement: "bottom"
}, {
default: () => a.value ? n("sys.screen.exit") : n("sys.screen.full"),
trigger: () => t(M, E({
class: e,
quaternary: !0,
circle: !0,
size: "large",
disabled: !s.value,
onClick: d
}, l), {
default: () => [a.value ? t(ma, null, null) : t(ha, null, null)]
})
});
}
});
let ht;
function Na(e) {
ht || (ht = H("fullscreen", {
fontSize: "19px"
}), ht.mount({
id: e,
anchorMetaName: V
}));
}
const eo = /* @__PURE__ */ T({
name: "DtAppearence",
inheritAttrs: !1,
setup() {
const e = `${D}-appearence`;
Aa(e);
const {
t: n
} = K(), l = R("__INJECTED_THEME__"), a = Be();
function s() {
l.mode = l.mode === "light" ? "dark" : l.mode === "dark" ? "auto" : "light";
}
return () => t(W, {
delay: 333,
duration: 0,
placement: "bottom"
}, {
default: () => n("sys.appearence"),
trigger: () => t(M, E({
class: e,
quaternary: !0,
circle: !0,
size: "large"
}, a, {
onClick: s
}), {
default: () => [t(B, null, {
default: () => [l.mode === "light" ? t(ya, null, null) : l.mode === "dark" ? t(ba, null, null) : t(wa, null, null)]
})]
})
});
}
});
let mt;
function Aa(e) {
mt || (mt = H("appearence", {
fontSize: "19px"
}), mt.mount({
id: e,
anchorMetaName: V
}));
}
function Ia(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !G(e);
}
const to = /* @__PURE__ */ T({
name: "DtBreadcrumb",
props: {
prefix: {
type: Array,
default: () => []
}
},
setup(e) {
const n = `${D}-breadcrumb`;
La(n);
const l = R("__INJECTED_AUTH__"), a = R("__INJECTED_THEME__"), s = tt();
function d(i) {
i && s.push({
path: i
});
}
const o = ce(fa);
return O(() => l.activedModulePath, (i) => {
const r = i[0]?.icon;
r && Promise.resolve(a.menuIconLoader(r)).then((u) => {
u ? u.value = u : console.debug(`[theme] not found icon: ${r}`);
}).catch((u) => {
console.debug(`[theme] load icon: ${r} failured`, u);
});
}, {
immediate: !0
}), () => {
let i;
return t(Cn, {
class: n
}, Ia(i = [...e.prefix, ...l.activedModulePath].map((r, u, h) => t(Sn, {
key: r.key,
clickable: !!r.path,
onClick: () => {
u < h.length - 1 && d(r.path);
}
}, {
default: () => [r.dropdown?.length ? t(me, {
options: r.dropdown,
onSelect: (g, c) => {
c.action?.();
}
}, {
default: () => [t("span", null, [r._label ?? r.label, t(B, {
class: `${n}__dropdown-icon`
}, {
default: () => [t(_a, null, null)]
})])]
}) : t(Se, null, [u === 0 ? t(B, {
class: `${n}__prefix`
}, {
default: () => [o.value?.()]
}) : void 0, r._label ?? r.label])]
}))) ? i : {
default: () => [i]
});
};
}
});
let gt;
function La(e) {
gt || (gt = H("breadcrumb", [k("prefix", {
marginRight: "6px"
}), k("dropdown-icon", {
marginLeft: "4px"
})]), gt.mount({
id: e,
anchorMetaName: V
}));
}
const lo = /* @__PURE__ */ T({
name: "DtFooter",
props: {
content: {
type: String,
required: !0
}
},
setup(e) {
const n = `${D}-footer`;
return Ba(n), () => t("div", {
class: n
}, [ne("span", {
innerHTML: e.content
})]);
}
});
let vt;
function Ba(e) {
vt || (vt = H("footer", {
textAlign: "center",
lineHeight: "32px",
color: `var(--${D}-placeholder-color)`
}), vt.mount({
id: e,
anchorMetaName: V
}));
}
function za(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !G(e);
}
const no = /* @__PURE__ */ T({
name: "NRadios",
props: {
options: {
type: Array,
default: () => []
},
vertical: {
type: Boolean,
default: !1
},
type: {
type: String,
default: "radio"
},
default: {
type: [Boolean, String, Object],
default: !1
},
padding: {
type: String,
default: void 0
},
labelField: {
type: String,
default: "label"
},
valueField: {
type: String,
default: "value"
},
disabledField: {
type: String,
default: "disabled"
}
},
setup(e) {
const {
t: n
} = K(), {
vars: l
} = Me(), a = S(() => e.default === !1 ? "" : e.default === !0 ? n("form.all") : typeof e.default == "string" ? e.default : e.default?.[e.labelField] ?? n("form.all")), s = {
"--n-button-color-active": l.primaryColor,
"--n-button-text-color-active": l.baseColor
};
return () => {
const d = e.type === "button" ? $n : Mn, o = t(Se, null, [e.default ? (
// eslint-disable-next-line unicorn/no-null
t(d, {
value: typeof e.default == "object" ? e.default?.[e.valueField] : null
}, {
default: () => [a.value]
})
) : void 0, e.options?.map((i) => {
const r = typeof i[e.labelField] == "string" ? i[e.labelField] : i[e.labelField]?.();
return t(d, {
value: i[e.valueField],
disabled: i[e.disabledField],
style: e.padding ? {
paddingLeft: e.padding,
paddingRight: e.padding
} : {}
}, {
default: () => [i.tip ? t(W, null, {
default: () => i.tip,
trigger: () => r
}) : r]
});
})]);
return t(Tn, {
style: e.vertical ? {
...s,
padding: "6px 0 0"
} : s
}, {
default: () => [e.type === "button" ? o : t(ee, {
size: e.vertical ? void 0 : "small",
vertical: e.vertical
}, za(o) ? o : {
default: () => [o]
})]
});
};
}
}), ao = /* @__PURE__ */ T({
name: "NCheckboxs",
inheritAttrs: !1,
props: {
options: {
type: Array,
default: () => []
},
vertical: {
type: Boolean,
default: !1
},
default: {
type: [Boolean, String, Object],
default: !1
},
gap: {
type: [Number, String, Array],
default: void 0
},
value: {
type: Array,
default: void 0
},
labelPadding: {
type: String,
default: void 0
},
labelField: {
type: String,
default: "label"
},
valueField: {
type: String,
default: "value"
},
disabledField: {
type: String,
default: "disabled"
}
},
emits: {
"update:value": () => !0
},
setup(e, {
emit: n,
attrs: l
}) {
const {
t: a
} = K(), s = S(() => e.default ? e.default === !0 ? a("form.all") : typeof e.default == "string" ? e.default : e.default?.[e.labelField] ?? a("form.all") : ""), d = P([]);
O(() => e.value, (h) => d.value = h, {
immediate: !0
});
const o = (h) => {
n("update:value", h);
}, i = () => {
o(d.value?.length === e.options.length ? [] : e.options.map((h) => h[e.valueField]));
}, r = S(() => e.options.length > d.value?.length && d.value?.length > 0), u = S(() => ({
"--n-label-padding": e.labelPadding
}));
return () => {
const h = t(Dn, E(l, {
value: d.value,
onUpdateValue: o
}), {
default: () => [t(ee, {
size: e.gap ?? (e.vertical ? void 0 : "small"),
vertical: e.vertical,
style: !e.default && e.vertical ? {
padding: "6px 0 0"
} : {}
}, {
default: () => [e.options?.map((g) => t(Pt, {
value: g[e.valueField],
disabled: g[e.disabledField],
style: u.value
}, {
default: () => [g[e.labelField]]
}))]
})]
});
return e.default ? t(ee, {
size: e.gap ?? (e.vertical ? void 0 : "small"),
vertical: e.vertical,
style: e.vertical ? {
padding: "6px 0 0"
} : {}
}, {
default: () => [t("span", null, [t(Pt, {
indeterminate: r.value,
checked: d.value?.length > 0,
onUpdateChecked: i,
style: u.value
}, {
default: () => [s.value]
})]), h]
}) : h;
};
}
}), ro = U(() => import("./Pagin-WCv6rd-O.js").then((e) => e.DtPagin)), ol = U(() => import("./Files-CQIN_9fN.js").then((e) => e.NFiles)), oo = U(() => import("./IconSelect-Ct5B3ono.js").then((e) => e.DtIconSelect)), io = U(() => import("./UserDept-CFfjCJup.js").then((e) => e.DtUserDept)), qa = U(() => import("./lazy-upload-sQySwS92.js").then((e) => e.NUpload)), so = U(() => import("./lazy-upload-sQySwS92.js").then((e) => e.NUploadFileList)), uo = U(() => import("./lazy-upload-sQySwS92.js").then((e) => e.NUploadDragger)), Ea = U(() => import("./lazy-upload-sQySwS92.js").then((e) => e.NUploadTrigger)), co = U(() => import("./lazy-datetime-D2hi6r_b.js").then((e) => e.NDatePicker)), fo = U(() => import("./lazy-datetime-D2hi6r_b.js").then((e) => e.NTimePicker)), po = /* @__PURE__ */ T({
inheritAttrs: !1,
props: {
accept: {
type: String,
default: ""
}
},
emits: {
chose: () => !0
},
setup(e, {
emit: n
}) {
const l = $e(), a = Be();
function s({
file: d,
onFinish: o,
onError: i
}) {
if (e.accept && !d.name.endsWith(e.accept)) {
et.warning(`请选择类型为 '${e.accept}' 的文件`), i();
return;
}
n("chose", {
file: d.file || d
}), o();
}
return () => t(qa, {
abstract: !0,
accept: e.accept,
"custom-request": s
}, {
default: () => [t(Ea, {
abstract: !0
}, {
default: l.trigger || (({
handleClick: d
}) => t(M, E({
type: "primary",
ghost: !0,
...a
}, {
onClick: d
}), {
default: () => [Q("导 入")]
}))
})]
});
}
}), ho = /* @__PURE__ */ T({
name: "DtSelection",
props: {
mode: {
type: String,
required: !0
},
selection: {
type: [Number, Array],
required: !0
}
},
emits: {
"update:mode": () => !0,
clear: () => !0
},
setup(e, {
emit: n
}) {
return () => {
const l = Array.isArray(e.selection) ? e.selection.length : e.selection;
return e.mode !== "selection" && !l ? t("div", null, null) : t("div", null, [t(ee, {
align: "center",
"wrap-item": !1
}, {
default: () => [t("span", null, [Q("已选中 "), l, Q(" 条")]), t(M, {
text: !0,
type: "primary",
onClick: () => {
n("update:mode", e.mod