| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700 |
- var eo = Object.defineProperty, oo = Object.defineProperties;
- var to = Object.getOwnPropertyDescriptors;
- var Ce = Object.getOwnPropertySymbols;
- var no = Object.prototype.hasOwnProperty, lo = Object.prototype.propertyIsEnumerable;
- var be = (e, o, t) => o in e ? eo(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, te = (e, o) => {
- for (var t in o || (o = {}))
- no.call(o, t) && be(e, t, o[t]);
- if (Ce)
- for (var t of Ce(o))
- lo.call(o, t) && be(e, t, o[t]);
- return e;
- }, ue = (e, o) => oo(e, to(o));
- import { defineComponent as K, ref as F, computed as Z, createVNode as u, Transition as Ie, withDirectives as Ae, vShow as ze, nextTick as Re, shallowRef as L, watch as _, onBeforeUnmount as Ne, watchEffect as Ee, Fragment as ao, render as he, unref as ve, isRef as De, toRefs as io, customRef as ro, getCurrentScope as so, onScopeDispose as co, useAttrs as uo, openBlock as fe, createBlock as xe, mergeProps as fo, createSlots as mo, withCtx as ie, createElementVNode as re, renderSlot as Se, normalizeStyle as po, resolveDynamicComponent as vo, toDisplayString as go, createElementBlock as yo, createCommentVNode as Co } from "vue";
- import bo from "./ModalHeader.js";
- import { cP as ho, aI as Le, P as z, _ as B, az as We, d as m, au as xo, c as le, o as ke, i as ce, cQ as So, K as $e, cR as $o, c3 as wo, g as Bo, m as To, bS as Po, r as Fo, cO as Oo, aH as Mo, aL as ge, u as Ho, bG as Ve, a3 as se, aQ as Io, B as we, cS as Ao, e as ne, cT as zo, a as Ro, bz as No, aP as Eo, aR as Do, cU as Lo, cV as Wo, cW as ko, cX as Vo, cY as _o, cZ as jo, aM as Go, n as Xo } from "./index2.js";
- import { A as Be } from "./ActionButton.js";
- const Yo = new Le("antFadeIn", {
- "0%": {
- opacity: 0
- },
- "100%": {
- opacity: 1
- }
- }), Ko = new Le("antFadeOut", {
- "0%": {
- opacity: 1
- },
- "100%": {
- opacity: 0
- }
- }), Uo = function(e) {
- let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
- const {
- antCls: t
- } = e, n = `${t}-fade`, l = o ? "&" : "";
- return [ho(n, Yo, Ko, e.motionDurationMid, o), {
- [`
- ${l}${n}-enter,
- ${l}${n}-appear
- `]: {
- opacity: 0,
- animationTimingFunction: "linear"
- },
- [`${l}${n}-leave`]: {
- animationTimingFunction: "linear"
- }
- }];
- };
- function ye() {
- return {
- keyboard: {
- type: Boolean,
- default: void 0
- },
- mask: {
- type: Boolean,
- default: void 0
- },
- afterClose: Function,
- closable: {
- type: Boolean,
- default: void 0
- },
- maskClosable: {
- type: Boolean,
- default: void 0
- },
- visible: {
- type: Boolean,
- default: void 0
- },
- destroyOnClose: {
- type: Boolean,
- default: void 0
- },
- mousePosition: z.shape({
- x: Number,
- y: Number
- }).loose,
- title: z.any,
- footer: z.any,
- transitionName: String,
- maskTransitionName: String,
- animation: z.any,
- maskAnimation: z.any,
- wrapStyle: {
- type: Object,
- default: void 0
- },
- bodyStyle: {
- type: Object,
- default: void 0
- },
- maskStyle: {
- type: Object,
- default: void 0
- },
- prefixCls: String,
- wrapClassName: String,
- rootClassName: String,
- width: [String, Number],
- height: [String, Number],
- zIndex: Number,
- bodyProps: z.any,
- maskProps: z.any,
- wrapProps: z.any,
- getContainer: z.any,
- dialogStyle: {
- type: Object,
- default: void 0
- },
- dialogClass: String,
- closeIcon: z.any,
- forceRender: {
- type: Boolean,
- default: void 0
- },
- getOpenCount: Function,
- // https://github.com/ant-design/ant-design/issues/19771
- // https://github.com/react-component/dialog/issues/95
- focusTriggerAfterClose: {
- type: Boolean,
- default: void 0
- },
- onClose: Function,
- modalRender: Function
- };
- }
- function Te(e, o, t) {
- let n = o;
- return !n && t && (n = `${e}-${t}`), n;
- }
- let Pe = -1;
- function Qo() {
- return Pe += 1, Pe;
- }
- function Fe(e, o) {
- let t = e[`page${o ? "Y" : "X"}Offset`];
- const n = `scroll${o ? "Top" : "Left"}`;
- if (typeof t != "number") {
- const l = e.document;
- t = l.documentElement[n], typeof t != "number" && (t = l.body[n]);
- }
- return t;
- }
- function Zo(e) {
- const o = e.getBoundingClientRect(), t = {
- left: o.left,
- top: o.top
- }, n = e.ownerDocument, l = n.defaultView || n.parentWindow;
- return t.left += Fe(l), t.top += Fe(l, !0), t;
- }
- const qo = {
- width: 0,
- height: 0,
- overflow: "hidden",
- outline: "none"
- }, Jo = {
- outline: "none"
- }, et = K({
- compatConfig: {
- MODE: 3
- },
- name: "DialogContent",
- inheritAttrs: !1,
- props: m(m({}, ye()), {
- motionName: String,
- ariaId: String,
- onVisibleChanged: Function,
- onMousedown: Function,
- onMouseup: Function
- }),
- setup(e, o) {
- let {
- expose: t,
- slots: n,
- attrs: l
- } = o;
- const a = F(), p = F(), v = F();
- t({
- focus: () => {
- var r;
- (r = a.value) === null || r === void 0 || r.focus({
- preventScroll: !0
- });
- },
- changeActive: (r) => {
- const {
- activeElement: i
- } = document;
- r && i === p.value ? a.value.focus({
- preventScroll: !0
- }) : !r && i === a.value && p.value.focus({
- preventScroll: !0
- });
- }
- });
- const x = F(), f = Z(() => {
- const {
- width: r,
- height: i
- } = e, y = {};
- return r !== void 0 && (y.width = typeof r == "number" ? `${r}px` : r), i !== void 0 && (y.height = typeof i == "number" ? `${i}px` : i), x.value && (y.transformOrigin = x.value), y;
- }), s = () => {
- Re(() => {
- if (v.value) {
- const r = Zo(v.value);
- x.value = e.mousePosition ? `${e.mousePosition.x - r.left}px ${e.mousePosition.y - r.top}px` : "";
- }
- });
- }, c = (r) => {
- e.onVisibleChanged(r);
- };
- return () => {
- var r, i, y, h;
- const {
- prefixCls: S,
- footer: d = (r = n.footer) === null || r === void 0 ? void 0 : r.call(n),
- title: g = (i = n.title) === null || i === void 0 ? void 0 : i.call(n),
- ariaId: b,
- closable: T,
- closeIcon: M = (y = n.closeIcon) === null || y === void 0 ? void 0 : y.call(n),
- onClose: H,
- bodyStyle: R,
- bodyProps: C,
- onMousedown: P,
- onMouseup: $,
- visible: I,
- modalRender: O = n.modalRender,
- destroyOnClose: N,
- motionName: E
- } = e;
- let X;
- d && (X = u("div", {
- class: `${S}-footer`
- }, [d]));
- let Y;
- g && (Y = u("div", {
- class: `${S}-header`
- }, [u("div", {
- class: `${S}-title`,
- id: b
- }, [g])]));
- let G;
- T && (G = u("button", {
- type: "button",
- onClick: H,
- "aria-label": "Close",
- class: `${S}-close`
- }, [M || u("span", {
- class: `${S}-close-x`
- }, null)]));
- const k = u("div", {
- class: `${S}-content`
- }, [G, Y, u("div", B({
- class: `${S}-body`,
- style: R
- }, C), [(h = n.default) === null || h === void 0 ? void 0 : h.call(n)]), X]), w = We(E);
- return u(Ie, B(B({}, w), {}, {
- onBeforeEnter: s,
- onAfterEnter: () => c(!0),
- onAfterLeave: () => c(!1)
- }), {
- default: () => [I || !N ? Ae(u("div", B(B({}, l), {}, {
- ref: v,
- key: "dialog-element",
- role: "document",
- style: [f.value, l.style],
- class: [S, l.class],
- onMousedown: P,
- onMouseup: $
- }), [u("div", {
- tabindex: 0,
- ref: a,
- style: Jo
- }, [O ? O({
- originVNode: k
- }) : k]), u("div", {
- tabindex: 0,
- ref: p,
- style: qo
- }, null)]), [[ze, I]]) : null]
- });
- };
- }
- }), ot = K({
- compatConfig: {
- MODE: 3
- },
- name: "DialogMask",
- props: {
- prefixCls: String,
- visible: Boolean,
- motionName: String,
- maskProps: Object
- },
- setup(e, o) {
- return () => {
- const {
- prefixCls: t,
- visible: n,
- maskProps: l,
- motionName: a
- } = e, p = We(a);
- return u(Ie, p, {
- default: () => [Ae(u("div", B({
- class: `${t}-mask`
- }, l), null), [[ze, n]])]
- });
- };
- }
- }), Oe = K({
- compatConfig: {
- MODE: 3
- },
- name: "VcDialog",
- inheritAttrs: !1,
- props: ce(m(m({}, ye()), {
- getOpenCount: Function,
- scrollLocker: Object
- }), {
- mask: !0,
- visible: !1,
- keyboard: !0,
- closable: !0,
- maskClosable: !0,
- destroyOnClose: !1,
- prefixCls: "rc-dialog",
- getOpenCount: () => null,
- focusTriggerAfterClose: !0
- }),
- setup(e, o) {
- let {
- attrs: t,
- slots: n
- } = o;
- const l = L(), a = L(), p = L(), v = L(e.visible), x = L(`vcDialogTitle${Qo()}`), f = (d) => {
- var g, b;
- if (d)
- So(a.value, document.activeElement) || (l.value = document.activeElement, (g = p.value) === null || g === void 0 || g.focus());
- else {
- const T = v.value;
- if (v.value = !1, e.mask && l.value && e.focusTriggerAfterClose) {
- try {
- l.value.focus({
- preventScroll: !0
- });
- } catch (M) {
- }
- l.value = null;
- }
- T && ((b = e.afterClose) === null || b === void 0 || b.call(e));
- }
- }, s = (d) => {
- var g;
- (g = e.onClose) === null || g === void 0 || g.call(e, d);
- }, c = L(!1), r = L(), i = () => {
- clearTimeout(r.value), c.value = !0;
- }, y = () => {
- r.value = setTimeout(() => {
- c.value = !1;
- });
- }, h = (d) => {
- if (!e.maskClosable) return null;
- c.value ? c.value = !1 : a.value === d.target && s(d);
- }, S = (d) => {
- if (e.keyboard && d.keyCode === $e.ESC) {
- d.stopPropagation(), s(d);
- return;
- }
- e.visible && d.keyCode === $e.TAB && p.value.changeActive(!d.shiftKey);
- };
- return _(() => e.visible, () => {
- e.visible && (v.value = !0);
- }, {
- flush: "post"
- }), Ne(() => {
- var d;
- clearTimeout(r.value), (d = e.scrollLocker) === null || d === void 0 || d.unLock();
- }), Ee(() => {
- var d, g;
- (d = e.scrollLocker) === null || d === void 0 || d.unLock(), v.value && ((g = e.scrollLocker) === null || g === void 0 || g.lock());
- }), () => {
- const {
- prefixCls: d,
- mask: g,
- visible: b,
- maskTransitionName: T,
- maskAnimation: M,
- zIndex: H,
- wrapClassName: R,
- rootClassName: C,
- wrapStyle: P,
- closable: $,
- maskProps: I,
- maskStyle: O,
- transitionName: N,
- animation: E,
- wrapProps: X,
- title: Y = n.title
- } = e, {
- style: G,
- class: k
- } = t;
- return u("div", B({
- class: [`${d}-root`, C]
- }, xo(e, {
- data: !0
- })), [u(ot, {
- prefixCls: d,
- visible: g && b,
- motionName: Te(d, T, M),
- style: m({
- zIndex: H
- }, O),
- maskProps: I
- }, null), u("div", B({
- tabIndex: -1,
- onKeydown: S,
- class: le(`${d}-wrap`, R),
- ref: a,
- onClick: h,
- role: "dialog",
- "aria-labelledby": Y ? x.value : null,
- style: m(m({
- zIndex: H
- }, P), {
- display: v.value ? null : "none"
- })
- }, X), [u(et, B(B({}, ke(e, ["scrollLocker"])), {}, {
- style: G,
- class: k,
- onMousedown: i,
- onMouseup: y,
- ref: p,
- closable: $,
- ariaId: x.value,
- prefixCls: d,
- visible: b,
- onClose: s,
- onVisibleChanged: f,
- motionName: Te(d, N, E)
- }), n)])]);
- };
- }
- }), tt = ye(), nt = K({
- compatConfig: {
- MODE: 3
- },
- name: "DialogWrap",
- inheritAttrs: !1,
- props: ce(tt, {
- visible: !1
- }),
- setup(e, o) {
- let {
- attrs: t,
- slots: n
- } = o;
- const l = F(e.visible);
- return $o({}, {
- inTriggerContext: !1
- }), _(() => e.visible, () => {
- e.visible && (l.value = !0);
- }, {
- flush: "post"
- }), () => {
- const {
- visible: a,
- getContainer: p,
- forceRender: v,
- destroyOnClose: x = !1,
- afterClose: f
- } = e;
- let s = m(m(m({}, e), t), {
- ref: "_component",
- key: "dialog"
- });
- return p === !1 ? u(Oe, B(B({}, s), {}, {
- getOpenCount: () => 2
- }), n) : !v && x && !l.value ? null : u(wo, {
- autoLock: !0,
- visible: a,
- forceRender: v,
- getContainer: p
- }, {
- default: (c) => (s = m(m(m({}, s), c), {
- afterClose: () => {
- f == null || f(), l.value = !1;
- }
- }), u(Oe, s, n))
- });
- };
- }
- });
- function Me(e) {
- return {
- position: e,
- top: 0,
- insetInlineEnd: 0,
- bottom: 0,
- insetInlineStart: 0
- };
- }
- const lt = (e) => {
- const {
- componentCls: o
- } = e;
- return [{
- [`${o}-root`]: {
- [`${o}${e.antCls}-zoom-enter, ${o}${e.antCls}-zoom-appear`]: {
- // reset scale avoid mousePosition bug
- transform: "none",
- opacity: 0,
- animationDuration: e.motionDurationSlow,
- // https://github.com/ant-design/ant-design/issues/11777
- userSelect: "none"
- },
- [`${o}${e.antCls}-zoom-leave ${o}-content`]: {
- pointerEvents: "none"
- },
- [`${o}-mask`]: m(m({}, Me("fixed")), {
- zIndex: e.zIndexPopupBase,
- height: "100%",
- backgroundColor: e.colorBgMask,
- [`${o}-hidden`]: {
- display: "none"
- }
- }),
- [`${o}-wrap`]: m(m({}, Me("fixed")), {
- overflow: "auto",
- outline: 0,
- WebkitOverflowScrolling: "touch"
- })
- }
- }, {
- [`${o}-root`]: Uo(e)
- }];
- }, at = (e) => {
- const {
- componentCls: o
- } = e;
- return [
- // ======================== Root =========================
- {
- [`${o}-root`]: {
- [`${o}-wrap`]: {
- zIndex: e.zIndexPopupBase,
- position: "fixed",
- inset: 0,
- overflow: "auto",
- outline: 0,
- WebkitOverflowScrolling: "touch"
- },
- [`${o}-wrap-rtl`]: {
- direction: "rtl"
- },
- [`${o}-centered`]: {
- textAlign: "center",
- "&::before": {
- display: "inline-block",
- width: 0,
- height: "100%",
- verticalAlign: "middle",
- content: '""'
- },
- [o]: {
- top: 0,
- display: "inline-block",
- paddingBottom: 0,
- textAlign: "start",
- verticalAlign: "middle"
- }
- },
- [`@media (max-width: ${e.screenSMMax})`]: {
- [o]: {
- maxWidth: "calc(100vw - 16px)",
- margin: `${e.marginXS} auto`
- },
- [`${o}-centered`]: {
- [o]: {
- flex: 1
- }
- }
- }
- }
- },
- // ======================== Modal ========================
- {
- [o]: m(m({}, Fo(e)), {
- pointerEvents: "none",
- position: "relative",
- top: 100,
- width: "auto",
- maxWidth: `calc(100vw - ${e.margin * 2}px)`,
- margin: "0 auto",
- paddingBottom: e.paddingLG,
- [`${o}-title`]: {
- margin: 0,
- color: e.modalHeadingColor,
- fontWeight: e.fontWeightStrong,
- fontSize: e.modalHeaderTitleFontSize,
- lineHeight: e.modalHeaderTitleLineHeight,
- wordWrap: "break-word"
- },
- [`${o}-content`]: {
- position: "relative",
- backgroundColor: e.modalContentBg,
- backgroundClip: "padding-box",
- border: 0,
- borderRadius: e.borderRadiusLG,
- boxShadow: e.boxShadowSecondary,
- pointerEvents: "auto",
- padding: `${e.paddingMD}px ${e.paddingContentHorizontalLG}px`
- },
- [`${o}-close`]: m({
- position: "absolute",
- top: (e.modalHeaderCloseSize - e.modalCloseBtnSize) / 2,
- insetInlineEnd: (e.modalHeaderCloseSize - e.modalCloseBtnSize) / 2,
- zIndex: e.zIndexPopupBase + 10,
- padding: 0,
- color: e.modalCloseColor,
- fontWeight: e.fontWeightStrong,
- lineHeight: 1,
- textDecoration: "none",
- background: "transparent",
- borderRadius: e.borderRadiusSM,
- width: e.modalConfirmIconSize,
- height: e.modalConfirmIconSize,
- border: 0,
- outline: 0,
- cursor: "pointer",
- transition: `color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,
- "&-x": {
- display: "block",
- fontSize: e.fontSizeLG,
- fontStyle: "normal",
- lineHeight: `${e.modalCloseBtnSize}px`,
- textAlign: "center",
- textTransform: "none",
- textRendering: "auto"
- },
- "&:hover": {
- color: e.modalIconHoverColor,
- backgroundColor: e.wireframe ? "transparent" : e.colorFillContent,
- textDecoration: "none"
- },
- "&:active": {
- backgroundColor: e.wireframe ? "transparent" : e.colorFillContentHover
- }
- }, Oo(e)),
- [`${o}-header`]: {
- color: e.colorText,
- background: e.modalHeaderBg,
- borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,
- marginBottom: e.marginXS
- },
- [`${o}-body`]: {
- fontSize: e.fontSize,
- lineHeight: e.lineHeight,
- wordWrap: "break-word"
- },
- [`${o}-footer`]: {
- textAlign: "end",
- background: e.modalFooterBg,
- marginTop: e.marginSM,
- [`${e.antCls}-btn + ${e.antCls}-btn:not(${e.antCls}-dropdown-trigger)`]: {
- marginBottom: 0,
- marginInlineStart: e.marginXS
- }
- },
- [`${o}-open`]: {
- overflow: "hidden"
- }
- })
- },
- // ======================== Pure =========================
- {
- [`${o}-pure-panel`]: {
- top: "auto",
- padding: 0,
- display: "flex",
- flexDirection: "column",
- [`${o}-content,
- ${o}-body,
- ${o}-confirm-body-wrapper`]: {
- display: "flex",
- flexDirection: "column",
- flex: "auto"
- },
- [`${o}-confirm-body`]: {
- marginBottom: "auto"
- }
- }
- }
- ];
- }, it = (e) => {
- const {
- componentCls: o
- } = e, t = `${o}-confirm`;
- return {
- [t]: {
- "&-rtl": {
- direction: "rtl"
- },
- [`${e.antCls}-modal-header`]: {
- display: "none"
- },
- [`${t}-body-wrapper`]: m({}, Mo()),
- [`${t}-body`]: {
- display: "flex",
- flexWrap: "wrap",
- alignItems: "center",
- [`${t}-title`]: {
- flex: "0 0 100%",
- display: "block",
- // create BFC to avoid
- // https://user-images.githubusercontent.com/507615/37702510-ba844e06-2d2d-11e8-9b67-8e19be57f445.png
- overflow: "hidden",
- color: e.colorTextHeading,
- fontWeight: e.fontWeightStrong,
- fontSize: e.modalHeaderTitleFontSize,
- lineHeight: e.modalHeaderTitleLineHeight,
- [`+ ${t}-content`]: {
- marginBlockStart: e.marginXS,
- flexBasis: "100%",
- maxWidth: `calc(100% - ${e.modalConfirmIconSize + e.marginSM}px)`
- }
- },
- [`${t}-content`]: {
- color: e.colorText,
- fontSize: e.fontSize
- },
- [`> ${e.iconCls}`]: {
- flex: "none",
- marginInlineEnd: e.marginSM,
- fontSize: e.modalConfirmIconSize,
- [`+ ${t}-title`]: {
- flex: 1
- },
- // `content` after `icon` should set marginLeft
- [`+ ${t}-title + ${t}-content`]: {
- marginInlineStart: e.modalConfirmIconSize + e.marginSM
- }
- }
- },
- [`${t}-btns`]: {
- textAlign: "end",
- marginTop: e.marginSM,
- [`${e.antCls}-btn + ${e.antCls}-btn`]: {
- marginBottom: 0,
- marginInlineStart: e.marginXS
- }
- }
- },
- [`${t}-error ${t}-body > ${e.iconCls}`]: {
- color: e.colorError
- },
- [`${t}-warning ${t}-body > ${e.iconCls},
- ${t}-confirm ${t}-body > ${e.iconCls}`]: {
- color: e.colorWarning
- },
- [`${t}-info ${t}-body > ${e.iconCls}`]: {
- color: e.colorInfo
- },
- [`${t}-success ${t}-body > ${e.iconCls}`]: {
- color: e.colorSuccess
- },
- // https://github.com/ant-design/ant-design/issues/37329
- [`${o}-zoom-leave ${o}-btns`]: {
- pointerEvents: "none"
- }
- };
- }, rt = (e) => {
- const {
- componentCls: o
- } = e;
- return {
- [`${o}-root`]: {
- [`${o}-wrap-rtl`]: {
- direction: "rtl",
- [`${o}-confirm-body`]: {
- direction: "rtl"
- }
- }
- }
- };
- }, st = (e) => {
- const {
- componentCls: o,
- antCls: t
- } = e, n = `${o}-confirm`;
- return {
- [o]: {
- [`${o}-content`]: {
- padding: 0
- },
- [`${o}-header`]: {
- padding: e.modalHeaderPadding,
- borderBottom: `${e.modalHeaderBorderWidth}px ${e.modalHeaderBorderStyle} ${e.modalHeaderBorderColorSplit}`,
- marginBottom: 0
- },
- [`${o}-body`]: {
- padding: e.modalBodyPadding
- },
- [`${o}-footer`]: {
- padding: `${e.modalFooterPaddingVertical}px ${e.modalFooterPaddingHorizontal}px`,
- borderTop: `${e.modalFooterBorderWidth}px ${e.modalFooterBorderStyle} ${e.modalFooterBorderColorSplit}`,
- borderRadius: `0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`,
- marginTop: 0
- }
- },
- [n]: {
- [`${t}-modal-body`]: {
- padding: `${e.padding * 2}px ${e.padding * 2}px ${e.paddingLG}px`
- },
- [`${n}-body`]: {
- [`> ${e.iconCls}`]: {
- marginInlineEnd: e.margin,
- // `content` after `icon` should set marginLeft
- [`+ ${n}-title + ${n}-content`]: {
- marginInlineStart: e.modalConfirmIconSize + e.margin
- }
- }
- },
- [`${n}-btns`]: {
- marginTop: e.marginLG
- }
- }
- };
- }, ct = Bo("Modal", (e) => {
- const o = e.padding, t = e.fontSizeHeading5, n = e.lineHeightHeading5, l = To(e, {
- modalBodyPadding: e.paddingLG,
- modalHeaderBg: e.colorBgElevated,
- modalHeaderPadding: `${o}px ${e.paddingLG}px`,
- modalHeaderBorderWidth: e.lineWidth,
- modalHeaderBorderStyle: e.lineType,
- modalHeaderTitleLineHeight: n,
- modalHeaderTitleFontSize: t,
- modalHeaderBorderColorSplit: e.colorSplit,
- modalHeaderCloseSize: n * t + o * 2,
- modalContentBg: e.colorBgElevated,
- modalHeadingColor: e.colorTextHeading,
- modalCloseColor: e.colorTextDescription,
- modalFooterBg: "transparent",
- modalFooterBorderColorSplit: e.colorSplit,
- modalFooterBorderStyle: e.lineType,
- modalFooterPaddingVertical: e.paddingXS,
- modalFooterPaddingHorizontal: e.padding,
- modalFooterBorderWidth: e.lineWidth,
- modalConfirmTitleFontSize: e.fontSizeLG,
- modalIconHoverColor: e.colorIconHover,
- modalConfirmIconSize: e.fontSize * e.lineHeight,
- modalCloseBtnSize: e.controlHeightLG * 0.55
- });
- return [at(l), it(l), rt(l), lt(l), e.wireframe && st(l), Po(l, "zoom")];
- });
- var dt = function(e, o) {
- var t = {};
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && o.indexOf(n) < 0 && (t[n] = e[n]);
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, n = Object.getOwnPropertySymbols(e); l < n.length; l++)
- o.indexOf(n[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[l]) && (t[n[l]] = e[n[l]]);
- return t;
- };
- let pe;
- const ut = (e) => {
- pe = {
- x: e.pageX,
- y: e.pageY
- }, setTimeout(() => pe = null, 100);
- };
- zo() && Ro(document.documentElement, "click", ut, !0);
- const ft = () => ({
- prefixCls: String,
- /** @deprecated Please use `open` instead. */
- visible: {
- type: Boolean,
- default: void 0
- },
- open: {
- type: Boolean,
- default: void 0
- },
- confirmLoading: {
- type: Boolean,
- default: void 0
- },
- title: z.any,
- closable: {
- type: Boolean,
- default: void 0
- },
- closeIcon: z.any,
- onOk: Function,
- onCancel: Function,
- "onUpdate:visible": Function,
- "onUpdate:open": Function,
- onChange: Function,
- afterClose: Function,
- centered: {
- type: Boolean,
- default: void 0
- },
- width: [String, Number],
- footer: z.any,
- okText: z.any,
- okType: String,
- cancelText: z.any,
- icon: z.any,
- maskClosable: {
- type: Boolean,
- default: void 0
- },
- forceRender: {
- type: Boolean,
- default: void 0
- },
- okButtonProps: ne(),
- cancelButtonProps: ne(),
- destroyOnClose: {
- type: Boolean,
- default: void 0
- },
- wrapClassName: String,
- maskTransitionName: String,
- transitionName: String,
- getContainer: {
- type: [String, Function, Boolean, Object],
- default: void 0
- },
- zIndex: Number,
- bodyStyle: ne(),
- maskStyle: ne(),
- mask: {
- type: Boolean,
- default: void 0
- },
- keyboard: {
- type: Boolean,
- default: void 0
- },
- wrapProps: Object,
- focusTriggerAfterClose: {
- type: Boolean,
- default: void 0
- },
- modalRender: Function,
- mousePosition: ne()
- }), W = K({
- compatConfig: {
- MODE: 3
- },
- name: "AModal",
- inheritAttrs: !1,
- props: ce(ft(), {
- width: 520,
- confirmLoading: !1,
- okType: "primary"
- }),
- setup(e, o) {
- let {
- emit: t,
- slots: n,
- attrs: l
- } = o;
- const [a] = ge("Modal"), {
- prefixCls: p,
- rootPrefixCls: v,
- direction: x,
- getPopupContainer: f
- } = Ho("modal", e), [s, c] = ct(p);
- Ve(e.visible === void 0, "Modal", "`visible` will be removed in next major version, please use `open` instead.");
- const r = (h) => {
- t("update:visible", !1), t("update:open", !1), t("cancel", h), t("change", !1);
- }, i = (h) => {
- t("ok", h);
- }, y = () => {
- var h, S;
- const {
- okText: d = (h = n.okText) === null || h === void 0 ? void 0 : h.call(n),
- okType: g,
- cancelText: b = (S = n.cancelText) === null || S === void 0 ? void 0 : S.call(n),
- confirmLoading: T
- } = e;
- return u(ao, null, [u(we, B({
- onClick: r
- }, e.cancelButtonProps), {
- default: () => [b || a.value.cancelText]
- }), u(we, B(B({}, Ao(g)), {}, {
- loading: T,
- onClick: i
- }, e.okButtonProps), {
- default: () => [d || a.value.okText]
- })]);
- };
- return () => {
- var h, S;
- const {
- prefixCls: d,
- visible: g,
- open: b,
- wrapClassName: T,
- centered: M,
- getContainer: H,
- closeIcon: R = (h = n.closeIcon) === null || h === void 0 ? void 0 : h.call(n),
- focusTriggerAfterClose: C = !0
- } = e, P = dt(e, ["prefixCls", "visible", "open", "wrapClassName", "centered", "getContainer", "closeIcon", "focusTriggerAfterClose"]), $ = le(T, {
- [`${p.value}-centered`]: !!M,
- [`${p.value}-wrap-rtl`]: x.value === "rtl"
- });
- return s(u(nt, B(B(B({}, P), l), {}, {
- rootClassName: c.value,
- class: le(c.value, l.class),
- getContainer: H || (f == null ? void 0 : f.value),
- prefixCls: p.value,
- wrapClassName: $,
- visible: b != null ? b : g,
- onClose: r,
- focusTriggerAfterClose: C,
- transitionName: se(v.value, "zoom", e.transitionName),
- maskTransitionName: se(v.value, "fade", e.maskTransitionName),
- mousePosition: (S = P.mousePosition) !== null && S !== void 0 ? S : pe
- }), m(m({}, n), {
- footer: n.footer || y,
- closeIcon: () => u("span", {
- class: `${p.value}-close-x`
- }, [R || u(Io, {
- class: `${p.value}-close-icon`
- }, null)])
- })));
- };
- }
- });
- function J(e) {
- return typeof e == "function" ? e() : e;
- }
- const _e = K({
- name: "ConfirmDialog",
- inheritAttrs: !1,
- props: ["icon", "onCancel", "onOk", "close", "closable", "zIndex", "afterClose", "visible", "open", "keyboard", "centered", "getContainer", "maskStyle", "okButtonProps", "cancelButtonProps", "okType", "prefixCls", "okCancel", "width", "mask", "maskClosable", "okText", "cancelText", "autoFocusButton", "transitionName", "maskTransitionName", "type", "title", "content", "direction", "rootPrefixCls", "bodyStyle", "closeIcon", "modalRender", "focusTriggerAfterClose", "wrapClassName", "confirmPrefixCls", "footer"],
- setup(e, o) {
- let {
- attrs: t
- } = o;
- const [n] = ge("Modal");
- return process.env.NODE_ENV !== "production" && Ve(e.visible === void 0, "Modal", "`visible` is deprecated, please use `open` instead."), () => {
- const {
- icon: l,
- onCancel: a,
- onOk: p,
- close: v,
- okText: x,
- closable: f = !1,
- zIndex: s,
- afterClose: c,
- keyboard: r,
- centered: i,
- getContainer: y,
- maskStyle: h,
- okButtonProps: S,
- cancelButtonProps: d,
- okCancel: g,
- width: b = 416,
- mask: T = !0,
- maskClosable: M = !1,
- type: H,
- open: R,
- title: C,
- content: P,
- direction: $,
- closeIcon: I,
- modalRender: O,
- focusTriggerAfterClose: N,
- rootPrefixCls: E,
- bodyStyle: X,
- wrapClassName: Y,
- footer: G
- } = e;
- let k = l;
- if (!l && l !== null)
- switch (H) {
- case "info":
- k = u(Lo, null, null);
- break;
- case "success":
- k = u(Do, null, null);
- break;
- case "error":
- k = u(Eo, null, null);
- break;
- default:
- k = u(No, null, null);
- }
- const w = e.okType || "primary", V = e.prefixCls || "ant-modal", D = `${V}-confirm`, j = t.style || {}, ee = g != null ? g : H === "confirm", oe = e.autoFocusButton === null ? !1 : e.autoFocusButton || "ok", U = `${V}-confirm`, q = le(U, `${U}-${e.type}`, {
- [`${U}-rtl`]: $ === "rtl"
- }, t.class), de = n.value, qe = ee && u(Be, {
- actionFn: a,
- close: v,
- autofocus: oe === "cancel",
- buttonProps: d,
- prefixCls: `${E}-btn`
- }, {
- default: () => [J(e.cancelText) || de.cancelText]
- });
- return u(W, {
- prefixCls: V,
- class: q,
- wrapClassName: le({
- [`${U}-centered`]: !!i
- }, Y),
- onCancel: (Je) => v == null ? void 0 : v({
- triggerCancel: !0
- }, Je),
- open: R,
- title: "",
- footer: "",
- transitionName: se(E, "zoom", e.transitionName),
- maskTransitionName: se(E, "fade", e.maskTransitionName),
- mask: T,
- maskClosable: M,
- maskStyle: h,
- style: j,
- bodyStyle: X,
- width: b,
- zIndex: s,
- afterClose: c,
- keyboard: r,
- centered: i,
- getContainer: y,
- closable: f,
- closeIcon: I,
- modalRender: O,
- focusTriggerAfterClose: N
- }, {
- default: () => [u("div", {
- class: `${D}-body-wrapper`
- }, [u("div", {
- class: `${D}-body`
- }, [J(k), C === void 0 ? null : u("span", {
- class: `${D}-title`
- }, [J(C)]), u("div", {
- class: `${D}-content`
- }, [J(P)])]), G !== void 0 ? J(G) : u("div", {
- class: `${D}-btns`
- }, [qe, u(Be, {
- type: w,
- actionFn: p,
- close: v,
- autofocus: oe === "ok",
- buttonProps: S,
- prefixCls: `${E}-btn`
- }, {
- default: () => [J(x) || (ee ? de.okText : de.justOkText)]
- })])])]
- });
- };
- }
- }), Q = [], ae = (e) => {
- const o = document.createDocumentFragment();
- let t = m(m({}, ke(e, ["parentContext", "appContext"])), {
- close: a,
- open: !0
- }), n = null;
- function l() {
- n && (he(null, o), n = null);
- for (var f = arguments.length, s = new Array(f), c = 0; c < f; c++)
- s[c] = arguments[c];
- const r = s.some((i) => i && i.triggerCancel);
- e.onCancel && r && e.onCancel(() => {
- }, ...s.slice(1));
- for (let i = 0; i < Q.length; i++)
- if (Q[i] === a) {
- Q.splice(i, 1);
- break;
- }
- }
- function a() {
- for (var f = arguments.length, s = new Array(f), c = 0; c < f; c++)
- s[c] = arguments[c];
- t = m(m({}, t), {
- open: !1,
- afterClose: () => {
- typeof e.afterClose == "function" && e.afterClose(), l.apply(this, s);
- }
- }), t.visible && delete t.visible, p(t);
- }
- function p(f) {
- typeof f == "function" ? t = f(t) : t = m(m({}, t), f), n && Wo(n, t, o);
- }
- const v = (f) => {
- const s = ko, c = s.prefixCls, r = f.prefixCls || `${c}-modal`, i = s.iconPrefixCls, y = _o();
- return u(Vo, B(B({}, s), {}, {
- prefixCls: c
- }), {
- default: () => [u(_e, B(B({}, f), {}, {
- rootPrefixCls: c,
- prefixCls: r,
- iconPrefixCls: i,
- locale: y,
- cancelText: f.cancelText || y.cancelText
- }), null)]
- });
- };
- function x(f) {
- const s = u(v, m({}, f));
- return s.appContext = e.parentContext || e.appContext || s.appContext, he(s, o), s;
- }
- return n = x(t), Q.push(a), {
- destroy: a,
- update: p
- };
- };
- function je(e) {
- return m(m({}, e), {
- type: "warning"
- });
- }
- function Ge(e) {
- return m(m({}, e), {
- type: "info"
- });
- }
- function Xe(e) {
- return m(m({}, e), {
- type: "success"
- });
- }
- function Ye(e) {
- return m(m({}, e), {
- type: "error"
- });
- }
- function Ke(e) {
- return m(m({}, e), {
- type: "confirm"
- });
- }
- const mt = () => ({
- config: Object,
- afterClose: Function,
- destroyAction: Function,
- open: Boolean
- }), pt = K({
- name: "HookModal",
- inheritAttrs: !1,
- props: ce(mt(), {
- config: {
- width: 520,
- okType: "primary"
- }
- }),
- setup(e, o) {
- let {
- expose: t
- } = o;
- var n;
- const l = Z(() => e.open), a = Z(() => e.config), {
- direction: p,
- getPrefixCls: v
- } = jo(), x = v("modal"), f = v(), s = () => {
- var y, h;
- e == null || e.afterClose(), (h = (y = a.value).afterClose) === null || h === void 0 || h.call(y);
- }, c = function() {
- e.destroyAction(...arguments);
- };
- t({
- destroy: c
- });
- const r = (n = a.value.okCancel) !== null && n !== void 0 ? n : a.value.type === "confirm", [i] = ge("Modal", Go.Modal);
- return () => u(_e, B(B({
- prefixCls: x,
- rootPrefixCls: f
- }, a.value), {}, {
- close: c,
- open: l.value,
- afterClose: s,
- okText: a.value.okText || (r ? i == null ? void 0 : i.value.okText : i == null ? void 0 : i.value.justOkText),
- direction: a.value.direction || p.value,
- cancelText: a.value.cancelText || (i == null ? void 0 : i.value.cancelText)
- }), null);
- }
- });
- let He = 0;
- const vt = K({
- name: "ElementsHolder",
- inheritAttrs: !1,
- setup(e, o) {
- let {
- expose: t
- } = o;
- const n = L([]);
- return t({
- addModal: (a) => (n.value.push(a), n.value = n.value.slice(), () => {
- n.value = n.value.filter((p) => p !== a);
- })
- }), () => n.value.map((a) => a());
- }
- });
- function gt() {
- const e = L(null), o = L([]);
- _(o, () => {
- o.value.length && ([...o.value].forEach((p) => {
- p();
- }), o.value = []);
- }, {
- immediate: !0
- });
- const t = (a) => function(v) {
- var x;
- He += 1;
- const f = L(!0), s = L(null), c = L(ve(v)), r = L({});
- _(() => v, (b) => {
- S(m(m({}, De(b) ? b.value : b), r.value));
- });
- const i = function() {
- f.value = !1;
- for (var b = arguments.length, T = new Array(b), M = 0; M < b; M++)
- T[M] = arguments[M];
- const H = T.some((R) => R && R.triggerCancel);
- c.value.onCancel && H && c.value.onCancel(() => {
- }, ...T.slice(1));
- };
- let y;
- const h = () => u(pt, {
- key: `modal-${He}`,
- config: a(c.value),
- ref: s,
- open: f.value,
- destroyAction: i,
- afterClose: () => {
- y == null || y();
- }
- }, null);
- y = (x = e.value) === null || x === void 0 ? void 0 : x.addModal(h), y && Q.push(y);
- const S = (b) => {
- c.value = m(m({}, c.value), b);
- };
- return {
- destroy: () => {
- s.value ? i() : o.value = [...o.value, i];
- },
- update: (b) => {
- r.value = b, s.value ? S(b) : o.value = [...o.value, () => S(b)];
- }
- };
- }, n = Z(() => ({
- info: t(Ge),
- success: t(Xe),
- error: t(Ye),
- warning: t(je),
- confirm: t(Ke)
- })), l = Symbol("modalHolderKey");
- return [n.value, () => u(vt, {
- key: l,
- ref: e
- }, null)];
- }
- function Ue(e) {
- return ae(je(e));
- }
- W.useModal = gt;
- W.info = function(o) {
- return ae(Ge(o));
- };
- W.success = function(o) {
- return ae(Xe(o));
- };
- W.error = function(o) {
- return ae(Ye(o));
- };
- W.warning = Ue;
- W.warn = Ue;
- W.confirm = function(o) {
- return ae(Ke(o));
- };
- W.destroyAll = function() {
- for (; Q.length; ) {
- const o = Q.pop();
- o && o();
- }
- };
- W.install = function(e) {
- return e.component(W.name, W), e;
- };
- function yt(e) {
- return so() ? (co(e), !0) : !1;
- }
- function A(e) {
- return typeof e == "function" ? e() : ve(e);
- }
- const Qe = typeof window != "undefined" && typeof document != "undefined";
- typeof WorkerGlobalScope != "undefined" && globalThis instanceof WorkerGlobalScope;
- const Ct = Object.prototype.toString, bt = (e) => Ct.call(e) === "[object Object]", ht = () => {
- };
- function xt(e, o = {}) {
- if (!De(e))
- return io(e);
- const t = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
- for (const n in e.value)
- t[n] = ro(() => ({
- get() {
- return e.value[n];
- },
- set(l) {
- var a;
- if ((a = A(o.replaceRef)) != null ? a : !0)
- if (Array.isArray(e.value)) {
- const v = [...e.value];
- v[n] = l, e.value = v;
- } else {
- const v = ue(te({}, e.value), { [n]: l });
- Object.setPrototypeOf(v, Object.getPrototypeOf(e.value)), e.value = v;
- }
- else
- e.value[n] = l;
- }
- }));
- return t;
- }
- const Ze = Qe ? window : void 0;
- function St(e) {
- var o;
- const t = A(e);
- return (o = t == null ? void 0 : t.$el) != null ? o : t;
- }
- function me(...e) {
- let o, t, n, l;
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([t, n, l] = e, o = Ze) : [o, t, n, l] = e, !o)
- return ht;
- Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
- const a = [], p = () => {
- a.forEach((s) => s()), a.length = 0;
- }, v = (s, c, r, i) => (s.addEventListener(c, r, i), () => s.removeEventListener(c, r, i)), x = _(
- () => [St(o), A(l)],
- ([s, c]) => {
- if (p(), !s)
- return;
- const r = bt(c) ? te({}, c) : c;
- a.push(
- ...t.flatMap((i) => n.map((y) => v(s, i, y, r)))
- );
- },
- { immediate: !0, flush: "post" }
- ), f = () => {
- x(), p();
- };
- return yt(f), f;
- }
- function $t(e, o = {}) {
- var t, n;
- const {
- pointerTypes: l,
- preventDefault: a,
- stopPropagation: p,
- exact: v,
- onMove: x,
- onEnd: f,
- onStart: s,
- initialValue: c,
- axis: r = "both",
- draggingElement: i = Ze,
- containerElement: y,
- handle: h = e,
- buttons: S = [0]
- } = o, d = F(
- (t = A(c)) != null ? t : { x: 0, y: 0 }
- ), g = F(), b = (C) => l ? l.includes(C.pointerType) : !0, T = (C) => {
- A(a) && C.preventDefault(), A(p) && C.stopPropagation();
- }, M = (C) => {
- var P;
- if (!A(S).includes(C.button) || A(o.disabled) || !b(C) || A(v) && C.target !== A(e))
- return;
- const $ = A(y), I = (P = $ == null ? void 0 : $.getBoundingClientRect) == null ? void 0 : P.call($), O = A(e).getBoundingClientRect(), N = {
- x: C.clientX - ($ ? O.left - I.left + $.scrollLeft : O.left),
- y: C.clientY - ($ ? O.top - I.top + $.scrollTop : O.top)
- };
- (s == null ? void 0 : s(N, C)) !== !1 && (g.value = N, T(C));
- }, H = (C) => {
- if (A(o.disabled) || !b(C) || !g.value)
- return;
- const P = A(y), $ = A(e).getBoundingClientRect();
- let { x: I, y: O } = d.value;
- (r === "x" || r === "both") && (I = C.clientX - g.value.x, P && (I = Math.min(Math.max(0, I), P.scrollWidth - $.width))), (r === "y" || r === "both") && (O = C.clientY - g.value.y, P && (O = Math.min(Math.max(0, O), P.scrollHeight - $.height))), d.value = {
- x: I,
- y: O
- }, x == null || x(d.value, C), T(C);
- }, R = (C) => {
- A(o.disabled) || !b(C) || g.value && (g.value = void 0, f == null || f(d.value, C), T(C));
- };
- if (Qe) {
- const C = { capture: (n = o.capture) != null ? n : !0 };
- me(h, "pointerdown", M, C), me(i, "pointermove", H, C), me(i, "pointerup", R, C);
- }
- return ue(te({}, xt(d)), {
- position: d,
- isDragging: Z(() => !!g.value),
- style: Z(
- () => `left:${d.value.x}px;top:${d.value.y}px;`
- )
- });
- }
- const wt = { class: "modalHeader" }, Bt = /* @__PURE__ */ Object.assign({ name: "SModal" }, {
- __name: "SModal",
- props: {
- centered: {
- type: Boolean,
- default: !0
- },
- maskClosable: {
- type: Boolean,
- default: !0
- },
- mask: {
- type: Boolean,
- default: !0
- },
- topStyle: {
- type: String,
- default: ""
- },
- closable: {
- type: Boolean,
- default: !0
- },
- destroyOnClose: {
- type: Boolean,
- default: !1
- },
- keyboardOpen: {
- type: Boolean,
- default: !0
- },
- title: {
- type: String,
- default: ""
- },
- value: {
- type: Boolean,
- default: !1
- },
- haveFooter: {
- type: Boolean,
- default: !0
- },
- width: {
- type: [String, Number],
- default: "60vw"
- },
- boxHeight: {
- type: [String, Number],
- default: 60
- },
- bodyStyle: {
- type: Object,
- default() {
- return {
- overflowX: "hidden",
- overflowY: "auto"
- };
- }
- },
- showFullScreen: {
- type: Boolean,
- default: !0
- }
- },
- emits: ["update:value", "handCancel", "afterClose"],
- setup(e, { emit: o }) {
- const t = e, n = o, l = uo(), a = F(), p = F(), v = (w) => {
- p.value = w, a.value = E.value ? null : w;
- }, { x, y: f, isDragging: s } = $t(a), c = F(0), r = F(0), i = F(!1), y = F(0), h = F(0), S = F(0), d = F(0), g = F({ left: 0, right: 0, top: 0, bottom: 0 }), b = Z(() => ({
- transform: `translate(${y.value}px, ${h.value}px)`
- }));
- _([x, f], () => {
- var w, V;
- if (!i.value) {
- c.value = x.value, r.value = f.value;
- const D = document.body.getBoundingClientRect(), j = (V = (w = a.value) == null ? void 0 : w.getBoundingClientRect()) != null ? V : { width: 0, height: 0 };
- g.value.right = D.width - j.width, g.value.bottom = D.height - j.height, S.value = y.value, d.value = h.value;
- }
- i.value = !0;
- }), _(s, () => {
- s.value || (i.value = !1);
- }), Ee(() => {
- i.value && (y.value = S.value + Math.min(Math.max(g.value.left, x.value), g.value.right) - c.value, h.value = d.value + Math.min(Math.max(g.value.top, f.value), g.value.bottom) - r.value);
- });
- const T = F(null), M = F(null), H = F(t.value), R = F(te({}, t.bodyStyle));
- let C = -1, P = null, $ = null;
- const I = () => {
- const w = T.value;
- if (!w) return;
- const V = a.value, D = M.value, j = w.scrollHeight || w.clientHeight;
- if (!j) return;
- const ee = (V == null ? void 0 : V.clientHeight) || 0, oe = (D == null ? void 0 : D.clientHeight) || 0, U = document.body.offsetHeight, q = j + ee + oe + 85 >= U ? U - ee - oe - 82 : j;
- q <= 0 || q === C || (C = q, R.value = Object.assign({ height: `${q}px` }, t.bodyStyle));
- }, O = () => {
- Re(() => {
- P || (P = requestAnimationFrame(() => {
- P = null, I();
- }));
- });
- };
- _(T, (w) => {
- $ && ($.disconnect(), $ = null), w && typeof ResizeObserver != "undefined" && ($ = new ResizeObserver(() => O()), $.observe(w)), O();
- });
- const N = F(t.width), E = F(), X = () => {
- N.value = "100vw", E.value = "s-full-modal", a.value = null, y.value = 0, h.value = 0;
- }, Y = () => {
- N.value = t.width, E.value = "", a.value = p.value;
- }, G = () => {
- n("update:value", !1), n("handCancel");
- }, k = () => {
- E.value = "", a.value = p.value, N.value = t.width, n("afterClose");
- };
- return _(
- () => t.value,
- (w) => {
- w ? (H.value = !0, O()) : H.value = !1;
- },
- { deep: !0 }
- ), _(
- () => H.value,
- (w) => {
- w && O();
- }
- ), _(
- () => t.value,
- () => {
- t.value && O();
- },
- { immediate: !0 }
- ), Ne(() => {
- $ && ($.disconnect(), $ = null), P && (cancelAnimationFrame(P), P = null);
- }), (w, V) => {
- const D = W;
- return fe(), xe(D, fo({
- open: H.value,
- "body-style": R.value,
- width: N.value,
- centered: e.centered,
- onCancel: G,
- afterClose: k,
- destroyOnClose: e.destroyOnClose,
- keyboard: e.keyboardOpen,
- style: e.topStyle,
- maskClosable: e.maskClosable,
- mask: e.mask,
- "wrap-class-name": "s-modal " + E.value
- }, ve(l)), mo({
- title: ie(() => [
- re("div", wt, [
- re("div", {
- ref: v,
- class: "draggableTitle"
- }, go(e.title), 513),
- u(bo, {
- width: N.value,
- showFullScreen: e.showFullScreen,
- onFullScreen: X,
- onReduction: Y
- }, null, 8, ["width", "showFullScreen"])
- ])
- ]),
- modalRender: ie(({ originVNode: j }) => [
- re("div", {
- style: po(b.value)
- }, [
- (fe(), xe(vo(j)))
- ], 4)
- ]),
- default: ie(() => [
- re("div", {
- ref_key: "bodySlot",
- ref: T
- }, [
- Se(w.$slots, "default", {}, void 0, !0)
- ], 512)
- ]),
- _: 2
- }, [
- e.haveFooter ? {
- name: "footer",
- fn: ie(() => [
- w.$slots.footer ? (fe(), yo("div", {
- key: 0,
- ref_key: "footerSlot",
- ref: M
- }, [
- Se(w.$slots, "footer", {}, void 0, !0)
- ], 512)) : Co("", !0)
- ]),
- key: "0"
- } : void 0
- ]), 1040, ["open", "body-style", "width", "centered", "destroyOnClose", "keyboard", "style", "maskClosable", "mask", "wrap-class-name"]);
- };
- }
- }), Ht = /* @__PURE__ */ Xo(Bt, [["__scopeId", "data-v-3cabda62"]]);
- export {
- Ht as default
- };
|