@ithinkdt/naive
Version:
iThinkDT Naive UI
1,728 lines • 143 kB
JavaScript
import { defineComponent as T, watchEffect as Kl, createVNode as t, Fragment as Se, isVNode as ee, inject as R, useSlots as $e, ref as A, computed as S, reactive as Q, markRaw as We, watch as H, useAttrs as Le, mergeProps as F, nextTick as de, shallowRef as ce, h as ne, defineAsyncComponent as U, createTextVNode as Z, resolveDirective as qt, onUnmounted as hl, onMounted as ml, withDirectives as ge, resolveComponent as Xt, vShow as St, shallowReactive as Ql, provide as $t, Teleport as Jl, toRef as oe, isRef as gl, unref as Oe } 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 Mt, useDebounceFn as tn, asyncComputed as Ht, throttledWatch as ln, syncRef as nn, refDebounced as an } from "@vueuse/core";
import { useClass as Ue, clone as rn, walkTree as Ne, debounce as on, useElementIntersectionRect as sn, measureText as un } from "@ithinkdt/common";
import { useTheme as Me, useI18n as J, usePageTab as dn, useAuth as Ot, useLogin as yl, getFirstPageModule as cn, Validators as fn, useFormModal as pn, $msg as Ye, lang as _e, Route as hn, $notice as mn, modals as Tt, 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 Y, NButton as M, NEllipsis as xl, NScrollbar as ze, NMenu as _l, NDropdown as me, NAvatar as Dt, NIcon as L, NTooltip as K, NTag as Ie, NBreadcrumb as Cn, NBreadcrumbItem as Sn, NRadioButton as $n, NRadio as Mn, NRadioGroup as Tn, NCheckboxGroup as Dn, NCheckbox as At, NDataTable as An, gridProps as Pn, NForm as Nn, NGrid as In, NGi as lt, NFormItem as el, NTree as kl, NDynamicInput as Cl, NPopover as Sl, NSpin as $l, NConfigProvider as Ml, NGlobalStyle as Bn, NMessageProvider as Ln, NNotificationProvider as zn, NDialogProvider as En, NLoadingBarProvider as Fn, useMessage as qn, useDialog as Hn, useNotification as On, 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 Pe, NTreeSelect as Gn } from "ithinkdt-ui";
import { cB as O, fullWH as Pt, flexCenter as Al, cE as k, CSS_MOUNT_ANCHOR_META_NAME as V, CSS_STYLE_PREFIX as D, fullWidth as Pl, flexAlignCenter as Ke, cM as j, flexGap as ve, c as q, fullHeight as nl, flexJustifySB as Xn, flexDirCol as ie } from "@ithinkdt/core/cssr";
import { RouterLink as Yn, useRouter as et } 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 Nl } from "sortablejs/modular/sortable.core.esm.js";
function Ve(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ee(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: r
} = J(), {
title: s,
close: d
} = dn(), a = Ot(), i = () => {
a.token = void 0, setTimeout(p, 100);
}, {
logout: o
} = yl();
Kl(() => {
e.type === "404" && (s.value ??= e.type);
const h = e.type === "forbidden" || e.type === "timeout";
l.hasTopbar = !h, l.hasSidebar = !h, l.hasBreadcrumb = !h, l.hasFooter = !h;
});
function u() {
d();
}
const p = () => {
location.reload();
}, m = {
403: "403",
404: "404",
500: "500",
forbidden: "403",
timeout: "500"
};
return () => t("div", {
class: n
}, [t("div", {
class: `${n}__wrapper`
}, [t(kn, {
status: m[e.type],
title: r(`sys.error.${e.type}`)
}, {
default: () => t("span", {
class: `${n}__content`,
innerHTML: r(`sys.error.${e.type}-desc`)
}, null),
footer: () => {
let h, v, g, y;
return t(Y, {
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(h = r("sys.error.refreshAuth")) ? h : {
default: () => [h]
}), t(M, {
class: `${n}__action`,
size: "large",
type: "error",
onClick: o
}, Ve(v = r("sys.error.exitAccount")) ? v : {
default: () => [v]
})]) : e.type === "timeout" ? t(M, {
class: `${n}__action`,
type: "primary",
size: "large",
onClick: p
}, Ve(g = r("sys.error.refreshPage")) ? g : {
default: () => [g]
}) : t(M, {
class: `${n}__action`,
type: "primary",
size: "large",
onClick: u
}, Ve(y = r("sys.error.back")) ? y : {
default: () => [y]
})]
});
}
})])]);
}
});
let nt;
function la(e) {
nt || (nt = O("error", {
...Pt,
...Al
}, [k("wrapper", {
display: "inline-block",
textAlign: "center",
paddingBottom: "10vh"
}), k("footer", {
margin: "100px 0 0"
}), k("action", {
width: "240px"
})]), nt.mount({
id: e,
anchorMetaName: V
}));
}
const qr = /* @__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__"), r = R("__INJECTED_THEME__"), s = $e(), d = A(), a = S(() => r.logoPlacement === "sidebar" && !r.isFixedSidebar);
Ue(d, `${n}--collapsed`, a);
const i = A(!0), o = () => 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(o, null, null)]), t("div", {
class: [`${n}__name`, i.value && a.value ? `${n}__name--hidden` : ""],
onTransitionstart: () => i.value = !1,
onTransitionend: () => i.value = !0
}, [t(u, {
class: `${n}__name-content`
}, null)])]);
}
});
let at;
function na(e) {
at || (at = O("logo", {
...Pl,
...Ke,
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"
})])])]), at.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)]), Qe = () => 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)]), Nt = () => 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)]), Or = () => 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)]), 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: "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)]), 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 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)])]), 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 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)]), 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: "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 Je(e, n, l) {
return e.map(({
key: r,
type: s,
label: d,
_path: a,
path: i,
hidden: o,
icon: u = n,
children: p
}) => {
const m = Q({
key: r,
label: d,
_type: s,
_path: a,
path: i,
show: !o,
icon: void 0,
_icon: u,
children: p?.length ? Je(p, void 0, l) : p
});
return u && typeof u == "string" ? Promise.resolve(l(u)).then((h) => {
h ? m.icon = We(h) : console.debug(`[theme] not found icon: ${u}`);
}).catch((h) => {
console.debug(`[theme] load icon: ${u} failured`, h);
}) : m.icon = u, m;
});
}
const rt = Symbol(), ot = Symbol();
function Bl(e, n = !1) {
return e[rt] || (e[ot] = !e._path && e._type === "group" ? e.label : t(Yn, {
to: e._path ?? e.path
}, {
default: () => [e.label]
}), e[rt] = t(xl, {
class: `${Ze}__ellipsis`
}, {
default: () => e[ot],
tooltip: () => e.label
})), n ? e[ot] : e[rt];
}
const Zr = /* @__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__"), r = A([]), s = A();
function d(o) {
de(() => {
o.at(-1) && s.value?.showOption(o.at(-1)?.key);
});
}
H([() => e.full, () => n.menus], ([o, u]) => {
o && (r.value = Je(u, Qe, l.menuIconLoader)), d(n.activedMenuPath);
}, {
immediate: !0
}), H(() => n.activedMenuPath, (o, u) => {
o[0] !== u?.[0] && (e.full || (r.value = Je(o[0]?.children ?? [], Qe, l.menuIconLoader)), d(o));
}, {
immediate: !0
});
function a(o) {
return Bl(o, !l.isFixedSidebar && !!o.icon);
}
const i = Le();
return () => t(ze, null, {
default: () => [t(_l, F(i, {
ref: s,
class: {
[Ze]: !0,
[`${Ze}--dark`]: l.isDark
},
accordion: l.accordionMenu,
options: r.value,
mode: "vertical",
collapsed: !l.isFixedSidebar,
collapsedWidth: 58,
renderLabel: a,
value: n.activedMenuPath.at(-1)?.key ?? null,
rootIndent: 16,
dropdownProps: {
showArrow: !0
}
}), null)]
});
}
});
let it;
function Sa(e) {
it || (it = O("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)',
// }),
]), it.mount({
id: e,
anchorMetaName: V
}));
}
const Wr = /* @__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__"), r = R("__INJECTED_THEME__"), s = ce([]), d = A();
return H([() => e.full, () => l.menus], ([a, i]) => {
if (!a)
for (const o of i)
o._path ??= cn(o.children ?? [])?.path;
s.value = Je(i, Qe, r.menuIconLoader);
}, {
immediate: !0
}), () => t(_l, {
class: n,
options: s.value,
mode: "horizontal",
renderLabel: Bl,
value: l.activedMenuPath[0]?.key ?? null,
rootIndent: 16,
ref: d,
childrenField: e.full ? "children" : "_children"
}, null);
}
});
let st;
function $a(e) {
st || (st = O("nav-menu", {
lineHeight: "1",
...ve("4px")
}, [q("&.n-menu--horizontal", [q(".n-menu-item", {
marginTop: "1px"
}), q(".n-menu-item-content", {
padding: "0 18px"
})])]), st.mount({
id: e,
anchorMetaName: V
}));
}
const Kr = /* @__PURE__ */ T({
name: "DtUser",
props: {
dropMenus: {
type: Array,
requilred: !1,
default: void 0
}
},
setup(e) {
const n = `${D}-user`;
Ma(n);
const l = R("__INJECTED_AUTH__"), r = R("__INJECTED_THEME__"), {
t: s
} = J(), d = S(() => l.user?.nickname?.slice(0, 1)), {
logout: a
} = yl(), i = fn.minmax(6, 20, "密码长度为6-20位"), {
open: o
} = pn({
title: "修改密码",
labelWidth: "8em",
submitText: "修 改",
save: (m) => l.changePwd(m).then(() => {
Ye.success("已修改密码");
}),
items: ({
fi: m,
model: h
}) => [m("old", "input|6~20", {
label: "原密码",
props: {
type: "password",
showPasswordOn: "click"
},
span: 24,
required: !0,
rule: [i]
}), m("new", "input|6~20", {
label: "新密码",
props: {
type: "password",
showPasswordOn: "click"
},
span: 24,
required: !0,
rule: [i, {
message: "新密码不能与原密码相同",
trigger: "blur",
validator: (v) => {
if (v != null)
return v !== h.old;
}
}]
}), m("confirm", "input|6~20", {
label: "确认密码",
props: {
type: "password",
showPasswordOn: "click"
},
span: 24,
required: !0,
rule: [i, {
message: "与新密码不一致",
trigger: "blur",
validator: (v) => {
if (v != null)
return v === h.new;
}
}]
})]
}), u = S(() => {
const m = [...e.dropMenus ?? []];
return r.showChangePwd && m.push(Q({
key: "changepwd",
label: "修改密码",
action: () => o()
})), r.logoutPlacement === "dropdown" && m.push(Q({
key: "logout",
label: S(() => s("sys.login.logout")),
action: a
})), m;
}), p = (m, {
action: h
}) => {
h?.();
};
return A(!1), () => t("div", {
class: n
}, [t(me, {
options: u.value,
displayDirective: "if",
"show-arrow": !0,
onSelect: p
}, {
default: () => [t(M, {
class: `${n}__wrapper`,
quaternary: !0,
size: "large"
}, {
default: () => [t("div", {
class: `${n}__head`
}, [t(Dt, {
class: `${n}__avator`,
round: !0,
size: 30,
style: {
backgroundColor: d.value ? r.vars.primaryColor : void 0
}
}, {
default: () => [d.value || t(L, {
color: r.vars.primaryColorHover
}, {
default: () => [t(Il, null, null)]
})]
}), r.usernamePlacement === "outlet" ? t("div", {
class: `${n}__name`
}, [l.user?.nickname]) : void 0])]
})]
}), r.logoutPlacement === "outlet" && l.logged ? t(K, null, {
default: () => s("sys.login.logout"),
trigger: () => t(M, {
class: `${n}__logout-btn`,
quaternary: !0,
circle: !0,
onClick: a
}, {
default: () => [t(ca, null, null)]
})
}) : void 0]);
}
});
let ut;
function Ma(e) {
ut || (ut = O("user", {
...Ke,
...ve("1em"),
cursor: "pointer",
marginRight: "16px"
}, [k("wrapper", {
padding: "0 12px"
}), k("head", {
...Ke,
...ve("10px")
}), k("name", {
color: "var(--dt-text-color1)"
}), k(" logout-btn", {
fontSize: "19px"
})]), ut.mount({
id: e,
anchorMetaName: V
}));
}
const Qr = /* @__PURE__ */ T({
name: "DtLanguage",
setup() {
const e = `${D}-language`;
Ta(e);
const {
t: n,
locale: l
} = J(), r = S(() => Object.values(_e).map((s) => ({
label: n("sys.lang", {
locale: s
}),
key: s
})));
return () => t(me, {
showArrow: !0,
displayDirective: "if",
options: r.value,
onSelect: (s) => l.value = s
}, {
default: () => [t(M, {
class: e,
quaternary: !0,
circle: !0,
size: "large"
}, {
default: () => [t(da, null, null)]
})]
});
}
});
let dt;
function Ta(e) {
dt || (dt = O("language", {
fontSize: "19px"
}), dt.mount({
id: e,
anchorMetaName: V
}));
}
const Jr = /* @__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: r
} = J(), s = Le();
return () => t(K, {
delay: 666,
duration: 0,
placement: "right"
}, {
default: () => l.isFixedSidebar ? r("sys.collpase") : r("sys.expand"),
trigger: () => t(M, F({
class: [n, `${n}--${e.size}`],
text: !0,
onClick: () => l.isFixedSidebar = !l.isFixedSidebar
}, s), {
default: () => [t(L, null, {
default: () => [l.isFixedSidebar ? t(sa, null, null) : t(ua, null, null)]
})]
})
});
}
});
let ct;
function Da(e) {
ct || (ct = O("collpase-btn", {
fontSize: "19px",
backdropFilter: "blur(5px)"
}, [j("large", {
fontSize: "22px"
})]), ct.mount({
id: e,
anchorMetaName: V
}));
}
const ye = (e, n = 20) => t(L, {
size: n
}, {
default: () => [t(e, null, null)]
}), Gr = /* @__PURE__ */ T({
name: "DtTabs",
props: {
showBreadcrumb: Boolean
},
setup(e) {
const n = `${D}-page-tabs`;
Aa(n);
const l = et(), r = R("__INJECTED_THEME__"), {
$t: s,
t: d
} = J(), a = Q({
visible: !1,
x: 0,
y: 0
}), i = (x, P) => {
x.preventDefault(), x.stopPropagation(), o(P, x.clientX, x.clientY);
}, o = async (x, P, N) => {
a.visible && a.tab === x || (a.tab = x, a.visible && (a.visible = !1, await vl(130)), a.visible = !0, a.x = P, a.y = N);
}, u = async () => {
requestIdleCallback(() => {
a.visible = !1;
}, {
timeout: 30
});
}, p = S(() => !a.tab || a.tab !== r.currentPage), m = S(() => !a.tab), h = Q([{
key: "reload",
label: s("sys.tab.reload"),
disabled: p,
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(Nt)
}, {
key: "closeLeft",
label: s("sys.tab.closeLeft"),
disabled: m,
icon: () => ye(ra)
}, {
key: "closeRight",
label: s("sys.tab.closeRight"),
disabled: m,
icon: () => ye(ia)
}, {
key: "closeOther",
label: s("sys.tab.closeOther"),
disabled: m,
icon: () => ye(oa)
}]), v = (x) => {
switch (a.visible = !1, x) {
case "open": {
window.open(a.tab.href, "_blank");
break;
}
case "reload": {
r.reloadPage();
break;
}
case "close": {
r.closePage(a.tab);
break;
}
case "closeOther": {
r.closePages(r.pages.filter((P) => P !== a.tab));
break;
}
case "closeLeft": {
r.closePages(r.pages.slice(0, r.pages.indexOf(a.tab))), r.pages = r.pages.slice(r.pages.indexOf(a.tab));
break;
}
case "closeRight": {
r.closePages(r.pages.slice(r.pages.indexOf(a.tab) + 1));
break;
}
case "closeAll": {
r.closeAllPages();
break;
}
}
};
function g(x) {
if (!b.value?.children.length)
return;
const P = b.value.children[x];
y.value.scrollTo({
behavior: "smooth",
left: Math.max(0, b.value.offsetLeft + P.offsetLeft - y.value.clientWidth / 2 + P.clientWidth / 2 + 10)
});
}
const y = A(), b = A();
Gl(Xl(y), (x) => {
x || g(r.currentPageIndex);
}, {
debounce: 666
}), H(() => r.currentPageIndex, g, {
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(K, {
placement: "bottom",
delay: 333
}, {
default: () => r.fullTab ? d("sys.tab.exit") : d("sys.tab.full"),
trigger: () => t(M, {
text: !0,
onClick: () => r.fullTab = !r.fullTab
}, {
icon: () => t(L, null, {
default: () => [r.fullTab ? t(va, null, null) : t(ga, null, null)]
})
})
}), t(K, {
placement: "bottom",
delay: 333
}, {
default: () => d("sys.tab.reload"),
trigger: () => t(M, {
text: !0,
onClick: () => r.reloadPage()
}, {
icon: () => t(L, {
size: 20
}, {
default: () => [t(rl, null, null)]
})
})
}), t(K, {
placement: "bottom",
delay: 333
}, {
default: () => d("sys.tab.closeAll"),
trigger: () => t(M, {
text: !0,
onClick: () => v("closeAll")
}, {
icon: () => t(L, null, {
default: () => [t(Nt, null, null)]
})
})
})]), B = /* @__PURE__ */ T({
name: "DtTabItem",
props: {
current: Boolean,
showBreadcrumb: Boolean,
index: {
type: Number,
required: !0
},
tab: {
type: Object,
required: !0
}
},
setup(x) {
const P = R("__INJECTED_AUTH__"), N = R("__INJECTED_THEME__"), c = R("__INJECT_SLOTS__", {});
return () => t(Ie, {
class: [`${n}__tab ${x.current ? n + "__tab--curr" : ""}`],
type: x.current ? "primary" : "default",
closable: !0,
bordered: !1,
onClose: () => N.closePageByIndex(x.index),
onClick: () => l.push(x.tab.path),
onContextmenu: (f) => i(f, x.tab)
}, {
default: () => {
const f = x.tab.title ?? P.moduleMap[x.tab.moduleKey]?.label ?? x.tab.path;
return x.current && N.hasBreadcrumb && x.showBreadcrumb && c.breadcrumb ? t("span", {
style: "pointer-events: none"
}, [c.breadcrumb()]) : f;
},
icon: () => x.current ? t(L, {
size: 10
}, {
default: () => [t(aa, null, null)]
}) : void 0
});
}
});
return () => t("div", {
class: [n, {
[`${n}--dark`]: r.isDark
}],
ref: y
}, [t("div", {
class: `${n}__prefix`
}, null), t("div", {
class: `${n}__content`,
ref: b
}, [r.pages.map((x, P) => t(B, {
key: x.key,
index: P,
current: r.currentPageIndex === P,
tab: x,
showBreadcrumb: e.showBreadcrumb
}, null))]), _, t(me, {
placement: "bottom-start",
size: "small",
trigger: "manual",
show: a.visible,
x: a.x,
y: a.y,
options: h,
onClickoutside: u,
onSelect: v
}, null)]);
}
});
let ft;
function Aa(e) {
ft || (ft = O("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)"
}, [q("&: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"
})]), ft.mount({
id: e,
anchorMetaName: V
}));
}
const Xr = /* @__PURE__ */ T({
name: "DtFullscreen",
inheritAttrs: !1,
setup() {
const e = `${D}-fullscreen`;
Pa(e);
const {
t: n
} = J(), l = Le(), {
isFullscreen: r,
isSupported: s,
toggle: d
} = en(document.documentElement);
return () => t(K, {
delay: 333,
duration: 0,
placement: "bottom"
}, {
default: () => r.value ? n("sys.screen.exit") : n("sys.screen.full"),
trigger: () => t(M, F({
class: e,
quaternary: !0,
circle: !0,
size: "large",
disabled: !s.value,
onClick: d
}, l), {
default: () => [r.value ? t(ma, null, null) : t(ha, null, null)]
})
});
}
});
let pt;
function Pa(e) {
pt || (pt = O("fullscreen", {
fontSize: "19px"
}), pt.mount({
id: e,
anchorMetaName: V
}));
}
const Yr = /* @__PURE__ */ T({
name: "DtAppearence",
inheritAttrs: !1,
setup() {
const e = `${D}-appearence`;
Na(e);
const {
t: n
} = J(), l = R("__INJECTED_THEME__"), r = Le();
function s() {
l.mode = l.mode === "light" ? "dark" : l.mode === "dark" ? "auto" : "light";
}
return () => t(K, {
delay: 333,
duration: 0,
placement: "bottom"
}, {
default: () => n("sys.appearence"),
trigger: () => t(M, F({
class: e,
quaternary: !0,
circle: !0,
size: "large"
}, r, {
onClick: s
}), {
default: () => [t(L, null, {
default: () => [l.mode === "light" ? t(ya, null, null) : l.mode === "dark" ? t(ba, null, null) : t(wa, null, null)]
})]
})
});
}
});
let ht;
function Na(e) {
ht || (ht = O("appearence", {
fontSize: "19px"
}), ht.mount({
id: e,
anchorMetaName: V
}));
}
function Ia(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ee(e);
}
const eo = /* @__PURE__ */ T({
name: "DtBreadcrumb",
props: {
prefix: {
type: Array,
default: () => []
}
},
setup(e) {
const n = `${D}-breadcrumb`;
Ba(n);
const l = R("__INJECTED_AUTH__"), r = R("__INJECTED_THEME__"), s = et();
function d(i) {
i && s.push({
path: i
});
}
const a = ce(fa);
return H(() => l.activedModulePath, (i) => {
const o = i[0]?.icon;
o && Promise.resolve(r.menuIconLoader(o)).then((u) => {
u ? u.value = u : console.debug(`[theme] not found icon: ${o}`);
}).catch((u) => {
console.debug(`[theme] load icon: ${o} failured`, u);
});
}, {
immediate: !0
}), () => {
let i;
return t(Cn, {
class: n
}, Ia(i = [...e.prefix, ...l.activedModulePath].map((o, u, p) => t(Sn, {
key: o.key,
clickable: !!o.path,
onClick: () => {
u < p.length - 1 && d(o.path);
}
}, {
default: () => [o.dropdown?.length ? t(me, {
options: o.dropdown,
onSelect: (m, h) => {
h.action?.();
}
}, {
default: () => [t("span", null, [o._label ?? o.label, t(L, {
class: `${n}__dropdown-icon`
}, {
default: () => [t(_a, null, null)]
})])]
}) : t(Se, null, [u === 0 ? t(L, {
class: `${n}__prefix`
}, {
default: () => [a.value?.()]
}) : void 0, o._label ?? o.label])]
}))) ? i : {
default: () => [i]
});
};
}
});
let mt;
function Ba(e) {
mt || (mt = O("breadcrumb", [k("prefix", {
marginRight: "6px"
}), k("dropdown-icon", {
marginLeft: "4px"
})]), mt.mount({
id: e,
anchorMetaName: V
}));
}
const to = /* @__PURE__ */ T({
name: "DtFooter",
props: {
content: {
type: String,
required: !0
}
},
setup(e) {
const n = `${D}-footer`;
return La(n), () => t("div", {
class: n
}, [ne("span", {
innerHTML: e.content
})]);
}
});
let gt;
function La(e) {
gt || (gt = O("footer", {
textAlign: "center",
lineHeight: "32px",
color: `var(--${D}-placeholder-color)`
}), gt.mount({
id: e,
anchorMetaName: V
}));
}
function za(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ee(e);
}
const lo = /* @__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
} = J(), {
vars: l
} = Me(), r = 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, a = 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: () => [r.value]
})
) : void 0, e.options?.map((i) => {
const o = 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(K, null, {
default: () => i.tip,
trigger: () => o
}) : o]
});
})]);
return t(Tn, {
style: e.vertical ? {
...s,
padding: "6px 0 0"
} : s
}, {
default: () => [e.type === "button" ? a : t(Y, {
size: e.vertical ? void 0 : "small",
vertical: e.vertical
}, za(a) ? a : {
default: () => [a]
})]
});
};
}
}), no = /* @__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: r
} = J(), s = S(() => e.default ? e.default === !0 ? r("form.all") : typeof e.default == "string" ? e.default : e.default?.[e.labelField] ?? r("form.all") : ""), d = A([]);
H(() => e.value, (p) => d.value = p, {
immediate: !0
});
const a = (p) => {
n("update:value", p);
}, i = () => {
a(d.value?.length === e.options.length ? [] : e.options.map((p) => p[e.valueField]));
}, o = S(() => e.options.length > d.value?.length && d.value?.length > 0), u = S(() => ({
"--n-label-padding": e.labelPadding
}));
return () => {
const p = t(Dn, F(l, {
value: d.value,
onUpdateValue: a
}), {
default: () => [t(Y, {
size: e.gap ?? (e.vertical ? void 0 : "small"),
vertical: e.vertical,
style: !e.default && e.vertical ? {
padding: "6px 0 0"
} : {}
}, {
default: () => [e.options?.map((m) => t(At, {
value: m[e.valueField],
disabled: m[e.disabledField],
style: u.value
}, {
default: () => [m[e.labelField]]
}))]
})]
});
return e.default ? t(Y, {
size: e.gap ?? (e.vertical ? void 0 : "small"),
vertical: e.vertical,
style: e.vertical ? {
padding: "6px 0 0"
} : {}
}, {
default: () => [t("span", null, [t(At, {
indeterminate: o.value,
checked: d.value?.length > 0,
onUpdateChecked: i,
style: u.value
}, {
default: () => [s.value]
})]), p]
}) : p;
};
}
}), ao = U(() => import("./Pagin-EhPlc6cR.js").then((e) => e.DtPagin)), ol = U(() => import("./Files-A5dPR7CP.js").then((e) => e.NFiles)), ro = U(() => import("./IconSelect-CuJROwOK.js").then((e) => e.DtIconSelect)), oo = U(() => import("./UserDept-_Qybtp1a.js").then((e) => e.DtUserDept)), Ea = U(() => import("./lazy-upload-sQySwS92.js").then((e) => e.NUpload)), io = U(() => import("./lazy-upload-sQySwS92.js").then((e) => e.NUploadFileList)), so = U(() => import("./lazy-upload-sQySwS92.js").then((e) => e.NUploadDragger)), Fa = U(() => import("./lazy-upload-sQySwS92.js").then((e) => e.NUploadTrigger)), uo = U(() => import("./lazy-datetime-D2hi6r_b.js").then((e) => e.NDatePicker)), co = U(() => import("./lazy-datetime-D2hi6r_b.js").then((e) => e.NTimePicker)), fo = /* @__PURE__ */ T({
inheritAttrs: !1,
props: {
accept: {
type: String,
default: ""
}
},
emits: {
chose: () => !0
},
setup(e, {
emit: n
}) {
const l = $e(), r = Le();
function s({
file: d,
onFinish: a,
onError: i
}) {
if (e.accept && !d.name.endsWith(e.accept)) {
Ye.warning(`请选择类型为 '${e.accept}' 的文件`), i();
return;
}
n("chose", {
file: d.file || d
}), a();
}
return () => t(Ea, {
abstract: !0,
accept: e.accept,
"custom-request": s
}, {
default: () => [t(Fa, {
abstract: !0
}, {
default: l.trigger || (({
handleClick: d
}) => t(M, F({
type: "primary",
ghost: !0,
...r
}, {
onClick: d
}), {
default: () => [Z("导 入")]
}))
})]
});
}
}), po = /* @__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(Y, {
align: "center",
"wrap-item": !1
}, {
default: () => [t("span", null, [Z("已选中 "), l, Z(" 条")]), t(M, {
text: !0,
type: "primary",
onClick: () => {
n("update:mode", e.mode === "all" ? "selection" : "all");
}
}, {
default: () => [e.mode === "all" ? "查看" : "返回"]
}), t(M, {
text: !0,
onClick: () => {
n("clear"), n("update:mode", "all");
}
}, {
default: () => [Z("清除")]
})]
})]);
};
}
}), Ll = () => t("svg", {
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
ro