| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916 |
- import { d as B, P as c, f as j, j as Se, a4 as ke, c as G, _ as P, o as fe, K as xe, i as pe, aU as $e, g as Oe, m as Pe, u as De, h as ne, aV as oe, a5 as ae, S as re, aW as _e, b as Ne, aX as K, at as Ie } from "./index2.js";
- import { defineComponent as q, shallowRef as O, onMounted as me, nextTick as W, watch as E, onUnmounted as ve, createVNode as u, Transition as le, withDirectives as ie, vShow as se, ref as Me, computed as I, inject as Te, provide as je } from "vue";
- const ye = () => ({
- prefixCls: String,
- width: c.oneOfType([c.string, c.number]),
- height: c.oneOfType([c.string, c.number]),
- style: {
- type: Object,
- default: void 0
- },
- class: String,
- rootClassName: String,
- rootStyle: j(),
- placement: {
- type: String
- },
- wrapperClassName: String,
- level: {
- type: [String, Array]
- },
- levelMove: {
- type: [Number, Function, Array]
- },
- duration: String,
- ease: String,
- showMask: {
- type: Boolean,
- default: void 0
- },
- maskClosable: {
- type: Boolean,
- default: void 0
- },
- maskStyle: {
- type: Object,
- default: void 0
- },
- afterVisibleChange: Function,
- keyboard: {
- type: Boolean,
- default: void 0
- },
- contentWrapperStyle: Se(),
- autofocus: {
- type: Boolean,
- default: void 0
- },
- open: {
- type: Boolean,
- default: void 0
- },
- // Motion
- motion: ke(),
- maskMotion: j()
- }), Be = () => B(B({}, ye()), {
- forceRender: {
- type: Boolean,
- default: void 0
- },
- getContainer: c.oneOfType([c.string, c.func, c.object, c.looseBool])
- }), Ee = () => B(B({}, ye()), {
- getContainer: Function,
- getOpenCount: Function,
- scrollLocker: c.any,
- inline: Boolean
- });
- function Ve(e) {
- return Array.isArray(e) ? e : [e];
- }
- const Ae = {
- transition: "transitionend",
- WebkitTransition: "webkitTransitionEnd",
- MozTransition: "transitionend",
- OTransition: "oTransitionEnd otransitionend"
- };
- Object.keys(Ae).filter((e) => {
- if (typeof document == "undefined")
- return !1;
- const o = document.getElementsByTagName("html")[0];
- return e in (o ? o.style : {});
- })[0];
- const Fe = !(typeof window != "undefined" && window.document && window.document.createElement);
- var ze = function(e, o) {
- var l = {};
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (l[t] = e[t]);
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
- o.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (l[t[i]] = e[t[i]]);
- return l;
- };
- const de = q({
- compatConfig: {
- MODE: 3
- },
- inheritAttrs: !1,
- props: Ee(),
- emits: ["close", "handleClick", "change"],
- setup(e, o) {
- let {
- emit: l,
- slots: t
- } = o;
- const i = O(), S = O(), D = O(), b = O(), w = O();
- let m = [];
- `${Number((Date.now() + Math.random()).toString().replace(".", Math.round(Math.random() * 9).toString())).toString(16)}`, me(() => {
- W(() => {
- var a;
- const {
- open: d,
- getContainer: f,
- showMask: k,
- autofocus: v
- } = e, p = f == null ? void 0 : f();
- _(e), d && (p && (p.parentNode, document.body), W(() => {
- v && h();
- }), k && ((a = e.scrollLocker) === null || a === void 0 || a.lock()));
- });
- }), E(() => e.level, () => {
- _(e);
- }, {
- flush: "post"
- }), E(() => e.open, () => {
- const {
- open: a,
- getContainer: d,
- scrollLocker: f,
- showMask: k,
- autofocus: v
- } = e, p = d == null ? void 0 : d();
- p && (p.parentNode, document.body), a ? (v && h(), k && (f == null || f.lock())) : f == null || f.unLock();
- }, {
- flush: "post"
- }), ve(() => {
- var a;
- const {
- open: d
- } = e;
- d && (document.body.style.touchAction = ""), (a = e.scrollLocker) === null || a === void 0 || a.unLock();
- }), E(() => e.placement, (a) => {
- a && (w.value = null);
- });
- const h = () => {
- var a, d;
- (d = (a = S.value) === null || a === void 0 ? void 0 : a.focus) === null || d === void 0 || d.call(a);
- }, y = (a) => {
- l("close", a);
- }, g = (a) => {
- a.keyCode === xe.ESC && (a.stopPropagation(), y(a));
- }, C = () => {
- const {
- open: a,
- afterVisibleChange: d
- } = e;
- d && d(!!a);
- }, _ = (a) => {
- let {
- level: d,
- getContainer: f
- } = a;
- if (Fe)
- return;
- const k = f == null ? void 0 : f(), v = k ? k.parentNode : null;
- m = [], d === "all" ? (v ? Array.prototype.slice.call(v.children) : []).forEach((x) => {
- x.nodeName !== "SCRIPT" && x.nodeName !== "STYLE" && x.nodeName !== "LINK" && x !== k && m.push(x);
- }) : d && Ve(d).forEach((p) => {
- document.querySelectorAll(p).forEach((x) => {
- m.push(x);
- });
- });
- }, M = (a) => {
- l("handleClick", a);
- }, N = O(!1);
- return E(S, () => {
- W(() => {
- N.value = !0;
- });
- }), () => {
- var a, d;
- const {
- width: f,
- height: k,
- open: v,
- prefixCls: p,
- placement: x,
- level: V,
- levelMove: A,
- ease: J,
- duration: Q,
- getContainer: Z,
- onChange: ee,
- afterVisibleChange: te,
- showMask: F,
- maskClosable: L,
- maskStyle: H,
- keyboard: R,
- getOpenCount: n,
- scrollLocker: r,
- contentWrapperStyle: s,
- style: $,
- class: T,
- rootClassName: U,
- rootStyle: X,
- maskMotion: he,
- motion: Y,
- inline: ge
- } = e, be = ze(e, ["width", "height", "open", "prefixCls", "placement", "level", "levelMove", "ease", "duration", "getContainer", "onChange", "afterVisibleChange", "showMask", "maskClosable", "maskStyle", "keyboard", "getOpenCount", "scrollLocker", "contentWrapperStyle", "style", "class", "rootClassName", "rootStyle", "maskMotion", "motion", "inline"]), z = v && N.value, we = G(p, {
- [`${p}-${x}`]: !0,
- [`${p}-open`]: z,
- [`${p}-inline`]: ge,
- "no-mask": !F,
- [U]: !0
- }), Ce = typeof Y == "function" ? Y(x) : Y;
- return u("div", P(P({}, fe(be, ["autofocus"])), {}, {
- tabindex: -1,
- class: we,
- style: X,
- ref: S,
- onKeydown: z && R ? g : void 0
- }), [u(le, he, {
- default: () => [F && ie(u("div", {
- class: `${p}-mask`,
- onClick: L ? y : void 0,
- style: H,
- ref: D
- }, null), [[se, z]])]
- }), u(le, P(P({}, Ce), {}, {
- onAfterEnter: C,
- onAfterLeave: C
- }), {
- default: () => [ie(u("div", {
- class: `${p}-content-wrapper`,
- style: [s],
- ref: i
- }, [u("div", {
- class: [`${p}-content`, T],
- style: $,
- ref: w
- }, [(a = t.default) === null || a === void 0 ? void 0 : a.call(t)]), t.handler ? u("div", {
- onClick: M,
- ref: b
- }, [(d = t.handler) === null || d === void 0 ? void 0 : d.call(t)]) : null]), [[se, z]])]
- })]);
- };
- }
- });
- var ce = function(e, o) {
- var l = {};
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (l[t] = e[t]);
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
- o.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (l[t[i]] = e[t[i]]);
- return l;
- };
- const We = q({
- compatConfig: {
- MODE: 3
- },
- inheritAttrs: !1,
- props: pe(Be(), {
- prefixCls: "drawer",
- placement: "left",
- getContainer: "body",
- level: "all",
- duration: ".3s",
- ease: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
- afterVisibleChange: () => {
- },
- showMask: !0,
- maskClosable: !0,
- maskStyle: {},
- wrapperClassName: "",
- keyboard: !0,
- forceRender: !1,
- autofocus: !0
- }),
- emits: ["handleClick", "close"],
- setup(e, o) {
- let {
- emit: l,
- slots: t
- } = o;
- const i = Me(null), S = (b) => {
- l("handleClick", b);
- }, D = (b) => {
- l("close", b);
- };
- return () => {
- const {
- getContainer: b,
- wrapperClassName: w,
- rootClassName: m,
- rootStyle: h,
- forceRender: y
- } = e, g = ce(e, ["getContainer", "wrapperClassName", "rootClassName", "rootStyle", "forceRender"]);
- let C = null;
- if (!b)
- return u(de, P(P({}, g), {}, {
- rootClassName: m,
- rootStyle: h,
- open: e.open,
- onClose: D,
- onHandleClick: S,
- inline: !0
- }), t);
- const _ = !!t.handler || y;
- return (_ || e.open || i.value) && (C = u($e, {
- autoLock: !0,
- visible: e.open,
- forceRender: _,
- getContainer: b,
- wrapperClassName: w
- }, {
- default: (M) => {
- var {
- visible: N,
- afterClose: a
- } = M, d = ce(M, ["visible", "afterClose"]);
- return u(de, P(P(P({
- ref: i
- }, g), d), {}, {
- rootClassName: m,
- rootStyle: h,
- open: N !== void 0 ? N : e.open,
- afterVisibleChange: a !== void 0 ? a : e.afterVisibleChange,
- onClose: D,
- onHandleClick: S
- }), t);
- }
- })), C;
- };
- }
- }), Le = (e) => {
- const {
- componentCls: o,
- motionDurationSlow: l
- } = e, t = {
- "&-enter, &-appear, &-leave": {
- "&-start": {
- transition: "none"
- },
- "&-active": {
- transition: `all ${l}`
- }
- }
- };
- return {
- [o]: {
- // ======================== Mask ========================
- [`${o}-mask-motion`]: {
- "&-enter, &-appear, &-leave": {
- "&-active": {
- transition: `all ${l}`
- }
- },
- "&-enter, &-appear": {
- opacity: 0,
- "&-active": {
- opacity: 1
- }
- },
- "&-leave": {
- opacity: 1,
- "&-active": {
- opacity: 0
- }
- }
- },
- // ======================= Panel ========================
- [`${o}-panel-motion`]: {
- // Left
- "&-left": [t, {
- "&-enter, &-appear": {
- "&-start": {
- transform: "translateX(-100%) !important"
- },
- "&-active": {
- transform: "translateX(0)"
- }
- },
- "&-leave": {
- transform: "translateX(0)",
- "&-active": {
- transform: "translateX(-100%)"
- }
- }
- }],
- // Right
- "&-right": [t, {
- "&-enter, &-appear": {
- "&-start": {
- transform: "translateX(100%) !important"
- },
- "&-active": {
- transform: "translateX(0)"
- }
- },
- "&-leave": {
- transform: "translateX(0)",
- "&-active": {
- transform: "translateX(100%)"
- }
- }
- }],
- // Top
- "&-top": [t, {
- "&-enter, &-appear": {
- "&-start": {
- transform: "translateY(-100%) !important"
- },
- "&-active": {
- transform: "translateY(0)"
- }
- },
- "&-leave": {
- transform: "translateY(0)",
- "&-active": {
- transform: "translateY(-100%)"
- }
- }
- }],
- // Bottom
- "&-bottom": [t, {
- "&-enter, &-appear": {
- "&-start": {
- transform: "translateY(100%) !important"
- },
- "&-active": {
- transform: "translateY(0)"
- }
- },
- "&-leave": {
- transform: "translateY(0)",
- "&-active": {
- transform: "translateY(100%)"
- }
- }
- }]
- }
- }
- };
- }, He = (e) => {
- const {
- componentCls: o,
- zIndexPopup: l,
- colorBgMask: t,
- colorBgElevated: i,
- motionDurationSlow: S,
- motionDurationMid: D,
- padding: b,
- paddingLG: w,
- fontSizeLG: m,
- lineHeightLG: h,
- lineWidth: y,
- lineType: g,
- colorSplit: C,
- marginSM: _,
- colorIcon: M,
- colorIconHover: N,
- colorText: a,
- fontWeightStrong: d,
- drawerFooterPaddingVertical: f,
- drawerFooterPaddingHorizontal: k
- } = e, v = `${o}-content-wrapper`;
- return {
- [o]: {
- position: "fixed",
- inset: 0,
- zIndex: l,
- pointerEvents: "none",
- "&-pure": {
- position: "relative",
- background: i,
- [`&${o}-left`]: {
- boxShadow: e.boxShadowDrawerLeft
- },
- [`&${o}-right`]: {
- boxShadow: e.boxShadowDrawerRight
- },
- [`&${o}-top`]: {
- boxShadow: e.boxShadowDrawerUp
- },
- [`&${o}-bottom`]: {
- boxShadow: e.boxShadowDrawerDown
- }
- },
- "&-inline": {
- position: "absolute"
- },
- // ====================== Mask ======================
- [`${o}-mask`]: {
- position: "absolute",
- inset: 0,
- zIndex: l,
- background: t,
- pointerEvents: "auto"
- },
- // ==================== Content =====================
- [v]: {
- position: "absolute",
- zIndex: l,
- transition: `all ${S}`,
- "&-hidden": {
- display: "none"
- }
- },
- // Placement
- [`&-left > ${v}`]: {
- top: 0,
- bottom: 0,
- left: {
- _skip_check_: !0,
- value: 0
- },
- boxShadow: e.boxShadowDrawerLeft
- },
- [`&-right > ${v}`]: {
- top: 0,
- right: {
- _skip_check_: !0,
- value: 0
- },
- bottom: 0,
- boxShadow: e.boxShadowDrawerRight
- },
- [`&-top > ${v}`]: {
- top: 0,
- insetInline: 0,
- boxShadow: e.boxShadowDrawerUp
- },
- [`&-bottom > ${v}`]: {
- bottom: 0,
- insetInline: 0,
- boxShadow: e.boxShadowDrawerDown
- },
- [`${o}-content`]: {
- width: "100%",
- height: "100%",
- overflow: "auto",
- background: i,
- pointerEvents: "auto"
- },
- // ===================== Panel ======================
- [`${o}-wrapper-body`]: {
- display: "flex",
- flexDirection: "column",
- width: "100%",
- height: "100%"
- },
- // Header
- [`${o}-header`]: {
- display: "flex",
- flex: 0,
- alignItems: "center",
- padding: `${b}px ${w}px`,
- fontSize: m,
- lineHeight: h,
- borderBottom: `${y}px ${g} ${C}`,
- "&-title": {
- display: "flex",
- flex: 1,
- alignItems: "center",
- minWidth: 0,
- minHeight: 0
- }
- },
- [`${o}-extra`]: {
- flex: "none"
- },
- [`${o}-close`]: {
- display: "inline-block",
- marginInlineEnd: _,
- color: M,
- fontWeight: d,
- fontSize: m,
- fontStyle: "normal",
- lineHeight: 1,
- textAlign: "center",
- textTransform: "none",
- textDecoration: "none",
- background: "transparent",
- border: 0,
- outline: 0,
- cursor: "pointer",
- transition: `color ${D}`,
- textRendering: "auto",
- "&:focus, &:hover": {
- color: N,
- textDecoration: "none"
- }
- },
- [`${o}-title`]: {
- flex: 1,
- margin: 0,
- color: a,
- fontWeight: e.fontWeightStrong,
- fontSize: m,
- lineHeight: h
- },
- // Body
- [`${o}-body`]: {
- flex: 1,
- minWidth: 0,
- minHeight: 0,
- padding: w,
- overflow: "auto"
- },
- // Footer
- [`${o}-footer`]: {
- flexShrink: 0,
- padding: `${f}px ${k}px`,
- borderTop: `${y}px ${g} ${C}`
- },
- // ====================== RTL =======================
- "&-rtl": {
- direction: "rtl"
- }
- }
- };
- }, Re = Oe("Drawer", (e) => {
- const o = Pe(e, {
- drawerFooterPaddingVertical: e.paddingXS,
- drawerFooterPaddingHorizontal: e.padding
- });
- return [He(o), Le(o)];
- }, (e) => ({
- zIndexPopup: e.zIndexPopupBase
- }));
- var Ue = function(e, o) {
- var l = {};
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (l[t] = e[t]);
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
- o.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (l[t[i]] = e[t[i]]);
- return l;
- };
- const Xe = ["top", "right", "bottom", "left"], ue = {
- distance: 180
- }, Ye = () => ({
- autofocus: {
- type: Boolean,
- default: void 0
- },
- closable: {
- type: Boolean,
- default: void 0
- },
- closeIcon: c.any,
- destroyOnClose: {
- type: Boolean,
- default: void 0
- },
- forceRender: {
- type: Boolean,
- default: void 0
- },
- getContainer: {
- type: [String, Function, Boolean, Object],
- default: void 0
- },
- maskClosable: {
- type: Boolean,
- default: void 0
- },
- mask: {
- type: Boolean,
- default: void 0
- },
- maskStyle: j(),
- rootClassName: String,
- rootStyle: j(),
- size: {
- type: String
- },
- drawerStyle: j(),
- headerStyle: j(),
- bodyStyle: j(),
- contentWrapperStyle: {
- type: Object,
- default: void 0
- },
- title: c.any,
- /** @deprecated Please use `open` instead */
- visible: {
- type: Boolean,
- default: void 0
- },
- open: {
- type: Boolean,
- default: void 0
- },
- width: c.oneOfType([c.string, c.number]),
- height: c.oneOfType([c.string, c.number]),
- zIndex: Number,
- prefixCls: String,
- push: c.oneOfType([c.looseBool, {
- type: Object
- }]),
- placement: c.oneOf(Xe),
- keyboard: {
- type: Boolean,
- default: void 0
- },
- extra: c.any,
- footer: c.any,
- footerStyle: j(),
- level: c.any,
- levelMove: {
- type: [Number, Array, Function]
- },
- handle: c.any,
- /** @deprecated Use `@afterVisibleChange` instead */
- afterVisibleChange: Function,
- /** @deprecated Please use `@afterOpenChange` instead */
- onAfterVisibleChange: Function,
- onAfterOpenChange: Function,
- /** @deprecated Please use `onUpdate:open` instead */
- "onUpdate:visible": Function,
- "onUpdate:open": Function,
- onClose: Function
- }), Ke = q({
- compatConfig: {
- MODE: 3
- },
- name: "ADrawer",
- inheritAttrs: !1,
- props: pe(Ye(), {
- closable: !0,
- placement: "right",
- maskClosable: !0,
- mask: !0,
- level: null,
- keyboard: !0,
- push: ue
- }),
- slots: Object,
- // emits: ['update:visible', 'close', 'afterVisibleChange'],
- setup(e, o) {
- let {
- emit: l,
- slots: t,
- attrs: i
- } = o;
- const S = O(!1), D = O(!1), b = O(null), w = O(!1), m = O(!1), h = I(() => {
- var n;
- return (n = e.open) !== null && n !== void 0 ? n : e.visible;
- });
- E(h, () => {
- h.value ? w.value = !0 : m.value = !1;
- }, {
- immediate: !0
- }), E([h, w], () => {
- h.value && w.value && (m.value = !0);
- }, {
- immediate: !0
- });
- const y = Te("parentDrawerOpts", null), {
- prefixCls: g,
- getPopupContainer: C,
- direction: _
- } = De("drawer", e), [M, N] = Re(g), a = I(() => (
- // 有可能为 false,所以不能直接判断
- e.getContainer === void 0 && (C != null && C.value) ? () => C.value(document.body) : e.getContainer
- ));
- ne(!e.afterVisibleChange, "Drawer", "`afterVisibleChange` prop is deprecated, please use `@afterVisibleChange` event instead"), process.env.NODE_ENV !== "production" && [["visible", "open"], ["onUpdate:visible", "onUpdate:open"], ["onAfterVisibleChange", "onAfterOpenChange"]].forEach((n) => {
- let [r, s] = n;
- ne(!e[r], "Drawer", `\`${r}\` is deprecated, please use \`${s}\` instead.`);
- }), je("parentDrawerOpts", {
- setPush: () => {
- S.value = !0;
- },
- setPull: () => {
- S.value = !1, W(() => {
- k();
- });
- }
- }), me(() => {
- h.value && y && y.setPush();
- }), ve(() => {
- y && y.setPull();
- }), E(m, () => {
- y && (m.value ? y.setPush() : y.setPull());
- }, {
- flush: "post"
- });
- const k = () => {
- var n, r;
- (r = (n = b.value) === null || n === void 0 ? void 0 : n.domFocus) === null || r === void 0 || r.call(n);
- }, v = (n) => {
- l("update:visible", !1), l("update:open", !1), l("close", n);
- }, p = (n) => {
- var r;
- n || (D.value === !1 && (D.value = !0), e.destroyOnClose && (w.value = !1)), (r = e.afterVisibleChange) === null || r === void 0 || r.call(e, n), l("afterVisibleChange", n), l("afterOpenChange", n);
- }, x = I(() => {
- const {
- push: n,
- placement: r
- } = e;
- let s;
- return typeof n == "boolean" ? s = n ? ue.distance : 0 : s = n.distance, s = parseFloat(String(s || 0)), r === "left" || r === "right" ? `translateX(${r === "left" ? s : -s}px)` : r === "top" || r === "bottom" ? `translateY(${r === "top" ? s : -s}px)` : null;
- }), V = I(() => {
- var n;
- return (n = e.width) !== null && n !== void 0 ? n : e.size === "large" ? 736 : 378;
- }), A = I(() => {
- var n;
- return (n = e.height) !== null && n !== void 0 ? n : e.size === "large" ? 736 : 378;
- }), J = I(() => {
- const {
- mask: n,
- placement: r
- } = e;
- if (!m.value && !n)
- return {};
- const s = {};
- return r === "left" || r === "right" ? s.width = oe(V.value) ? `${V.value}px` : V.value : s.height = oe(A.value) ? `${A.value}px` : A.value, s;
- }), Q = I(() => {
- const {
- zIndex: n,
- contentWrapperStyle: r
- } = e, s = J.value;
- return [{
- zIndex: n,
- transform: S.value ? x.value : void 0
- }, B({}, r), s];
- }), Z = (n) => {
- const {
- closable: r,
- headerStyle: s
- } = e, $ = K(t, e, "extra"), T = K(t, e, "title");
- return !T && !r ? null : u("div", {
- class: G(`${n}-header`, {
- [`${n}-header-close-only`]: r && !T && !$
- }),
- style: s
- }, [u("div", {
- class: `${n}-header-title`
- }, [ee(n), T && u("div", {
- class: `${n}-title`
- }, [T])]), $ && u("div", {
- class: `${n}-extra`
- }, [$])]);
- }, ee = (n) => {
- var r;
- const {
- closable: s
- } = e, $ = t.closeIcon ? (r = t.closeIcon) === null || r === void 0 ? void 0 : r.call(t) : e.closeIcon;
- return s && u("button", {
- key: "closer",
- onClick: v,
- "aria-label": "Close",
- class: `${n}-close`
- }, [$ === void 0 ? u(Ie, null, null) : $]);
- }, te = (n) => {
- var r;
- if (D.value && !e.forceRender && !w.value)
- return null;
- const {
- bodyStyle: s,
- drawerStyle: $
- } = e;
- return u("div", {
- class: `${n}-wrapper-body`,
- style: $
- }, [Z(n), u("div", {
- key: "body",
- class: `${n}-body`,
- style: s
- }, [(r = t.default) === null || r === void 0 ? void 0 : r.call(t)]), F(n)]);
- }, F = (n) => {
- const r = K(t, e, "footer");
- if (!r)
- return null;
- const s = `${n}-footer`;
- return u("div", {
- class: s,
- style: e.footerStyle
- }, [r]);
- }, L = I(() => G({
- "no-mask": !e.mask,
- [`${g.value}-rtl`]: _.value === "rtl"
- }, e.rootClassName, N.value)), H = I(() => ae(re(g.value, "mask-motion"))), R = (n) => ae(re(g.value, `panel-motion-${n}`));
- return () => {
- const {
- width: n,
- height: r,
- placement: s,
- mask: $,
- forceRender: T
- } = e, U = Ue(e, ["width", "height", "placement", "mask", "forceRender"]), X = B(B(B({}, i), fe(U, ["size", "closeIcon", "closable", "destroyOnClose", "drawerStyle", "headerStyle", "bodyStyle", "title", "push", "onAfterVisibleChange", "onClose", "onUpdate:visible", "onUpdate:open", "visible"])), {
- forceRender: T,
- onClose: v,
- afterVisibleChange: p,
- handler: !1,
- prefixCls: g.value,
- open: m.value,
- showMask: $,
- placement: s,
- ref: b
- });
- return M(u(_e, null, {
- default: () => [u(We, P(P({}, X), {}, {
- maskMotion: H.value,
- motion: R,
- width: V.value,
- height: A.value,
- getContainer: a.value,
- rootClassName: L.value,
- rootStyle: e.rootStyle,
- contentWrapperStyle: Q.value
- }), {
- handler: e.handle ? () => e.handle : t.handle,
- default: () => te(g.value)
- })]
- }));
- };
- }
- }), Je = Ne(Ke);
- export {
- Je as _
- };
|