index7.js 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457
  1. import { bk as We, M as $e, P as w, _ as c, a as y, U as he, b as Z, m as U, o as Se, bl as je, K as de, bm as Ve, bn as _e, g as Ge, I as Ke, bo as Xe, J as Ue, bp as Qe, a3 as ke, a6 as ae, j as qe, aJ as we, p as q, O as Je, bq as Ye, e as _, B as te, br as Te, bs as Ze, aE as eo, N as oo, Q as no, bt as to, bu as lo, bv as ao, bw as io, bx as ro, by as so, a7 as co } from "./index2.js";
  2. import { defineComponent as O, ref as X, computed as J, createVNode as s, Transition as Be, withDirectives as Pe, vShow as Fe, nextTick as uo, shallowRef as S, watch as Y, onBeforeUnmount as ie, watchEffect as fo, Fragment as mo, onMounted as go, render as ue, unref as po, isRef as vo } from "vue";
  3. import { p as Co } from "./pickAttrs.js";
  4. import { c as yo } from "./styleChecker.js";
  5. const bo = new $e("antFadeIn", {
  6. "0%": {
  7. opacity: 0
  8. },
  9. "100%": {
  10. opacity: 1
  11. }
  12. }), xo = new $e("antFadeOut", {
  13. "0%": {
  14. opacity: 1
  15. },
  16. "100%": {
  17. opacity: 0
  18. }
  19. }), $o = function(e) {
  20. let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
  21. const {
  22. antCls: t
  23. } = e, n = `${t}-fade`, l = o ? "&" : "";
  24. return [We(n, bo, xo, e.motionDurationMid, o), {
  25. [`
  26. ${l}${n}-enter,
  27. ${l}${n}-appear
  28. `]: {
  29. opacity: 0,
  30. animationTimingFunction: "linear"
  31. },
  32. [`${l}${n}-leave`]: {
  33. animationTimingFunction: "linear"
  34. }
  35. }];
  36. };
  37. function re() {
  38. return {
  39. keyboard: {
  40. type: Boolean,
  41. default: void 0
  42. },
  43. mask: {
  44. type: Boolean,
  45. default: void 0
  46. },
  47. afterClose: Function,
  48. closable: {
  49. type: Boolean,
  50. default: void 0
  51. },
  52. maskClosable: {
  53. type: Boolean,
  54. default: void 0
  55. },
  56. visible: {
  57. type: Boolean,
  58. default: void 0
  59. },
  60. destroyOnClose: {
  61. type: Boolean,
  62. default: void 0
  63. },
  64. mousePosition: w.shape({
  65. x: Number,
  66. y: Number
  67. }).loose,
  68. title: w.any,
  69. footer: w.any,
  70. transitionName: String,
  71. maskTransitionName: String,
  72. animation: w.any,
  73. maskAnimation: w.any,
  74. wrapStyle: {
  75. type: Object,
  76. default: void 0
  77. },
  78. bodyStyle: {
  79. type: Object,
  80. default: void 0
  81. },
  82. maskStyle: {
  83. type: Object,
  84. default: void 0
  85. },
  86. prefixCls: String,
  87. wrapClassName: String,
  88. rootClassName: String,
  89. width: [String, Number],
  90. height: [String, Number],
  91. zIndex: Number,
  92. bodyProps: w.any,
  93. maskProps: w.any,
  94. wrapProps: w.any,
  95. getContainer: w.any,
  96. dialogStyle: {
  97. type: Object,
  98. default: void 0
  99. },
  100. dialogClass: String,
  101. closeIcon: w.any,
  102. forceRender: {
  103. type: Boolean,
  104. default: void 0
  105. },
  106. getOpenCount: Function,
  107. // https://github.com/ant-design/ant-design/issues/19771
  108. // https://github.com/react-component/dialog/issues/95
  109. focusTriggerAfterClose: {
  110. type: Boolean,
  111. default: void 0
  112. },
  113. onClose: Function,
  114. modalRender: Function
  115. };
  116. }
  117. function fe(e, o, t) {
  118. let n = o;
  119. return !n && t && (n = `${e}-${t}`), n;
  120. }
  121. let me = -1;
  122. function ho() {
  123. return me += 1, me;
  124. }
  125. function ge(e, o) {
  126. let t = e[`page${o ? "Y" : "X"}Offset`];
  127. const n = `scroll${o ? "Top" : "Left"}`;
  128. if (typeof t != "number") {
  129. const l = e.document;
  130. t = l.documentElement[n], typeof t != "number" && (t = l.body[n]);
  131. }
  132. return t;
  133. }
  134. function So(e) {
  135. const o = e.getBoundingClientRect(), t = {
  136. left: o.left,
  137. top: o.top
  138. }, n = e.ownerDocument, l = n.defaultView || n.parentWindow;
  139. return t.left += ge(l), t.top += ge(l, !0), t;
  140. }
  141. const pe = {
  142. width: 0,
  143. height: 0,
  144. overflow: "hidden",
  145. outline: "none"
  146. }, wo = O({
  147. compatConfig: {
  148. MODE: 3
  149. },
  150. name: "DialogContent",
  151. inheritAttrs: !1,
  152. props: c(c({}, re()), {
  153. motionName: String,
  154. ariaId: String,
  155. onVisibleChanged: Function,
  156. onMousedown: Function,
  157. onMouseup: Function
  158. }),
  159. setup(e, o) {
  160. let {
  161. expose: t,
  162. slots: n,
  163. attrs: l
  164. } = o;
  165. const d = X(), g = X(), v = X();
  166. t({
  167. focus: () => {
  168. var a;
  169. (a = d.value) === null || a === void 0 || a.focus();
  170. },
  171. changeActive: (a) => {
  172. const {
  173. activeElement: r
  174. } = document;
  175. a && r === g.value ? d.value.focus() : !a && r === d.value && g.value.focus();
  176. }
  177. });
  178. const b = X(), f = J(() => {
  179. const {
  180. width: a,
  181. height: r
  182. } = e, p = {};
  183. return a !== void 0 && (p.width = typeof a == "number" ? `${a}px` : a), r !== void 0 && (p.height = typeof r == "number" ? `${r}px` : r), b.value && (p.transformOrigin = b.value), p;
  184. }), u = () => {
  185. uo(() => {
  186. if (v.value) {
  187. const a = So(v.value);
  188. b.value = e.mousePosition ? `${e.mousePosition.x - a.left}px ${e.mousePosition.y - a.top}px` : "";
  189. }
  190. });
  191. }, i = (a) => {
  192. e.onVisibleChanged(a);
  193. };
  194. return () => {
  195. var a, r, p, x;
  196. const {
  197. prefixCls: h,
  198. footer: m = (a = n.footer) === null || a === void 0 ? void 0 : a.call(n),
  199. title: $ = (r = n.title) === null || r === void 0 ? void 0 : r.call(n),
  200. ariaId: C,
  201. closable: T,
  202. closeIcon: B = (p = n.closeIcon) === null || p === void 0 ? void 0 : p.call(n),
  203. onClose: F,
  204. bodyStyle: I,
  205. bodyProps: N,
  206. onMousedown: z,
  207. onMouseup: A,
  208. visible: D,
  209. modalRender: L = n.modalRender,
  210. destroyOnClose: G,
  211. motionName: H
  212. } = e;
  213. let W;
  214. m && (W = s("div", {
  215. class: `${h}-footer`
  216. }, [m]));
  217. let j;
  218. $ && (j = s("div", {
  219. class: `${h}-header`
  220. }, [s("div", {
  221. class: `${h}-title`,
  222. id: C
  223. }, [$])]));
  224. let R;
  225. T && (R = s("button", {
  226. type: "button",
  227. onClick: F,
  228. "aria-label": "Close",
  229. class: `${h}-close`
  230. }, [B || s("span", {
  231. class: `${h}-close-x`
  232. }, null)]));
  233. const M = s("div", {
  234. class: `${h}-content`
  235. }, [R, j, s("div", y({
  236. class: `${h}-body`,
  237. style: I
  238. }, N), [(x = n.default) === null || x === void 0 ? void 0 : x.call(n)]), W]), ee = he(H);
  239. return s(Be, y(y({}, ee), {}, {
  240. onBeforeEnter: u,
  241. onAfterEnter: () => i(!0),
  242. onAfterLeave: () => i(!1)
  243. }), {
  244. default: () => [D || !G ? Pe(s("div", y(y({}, l), {}, {
  245. ref: v,
  246. key: "dialog-element",
  247. role: "document",
  248. style: [f.value, l.style],
  249. class: [h, l.class],
  250. onMousedown: z,
  251. onMouseup: A
  252. }), [s("div", {
  253. tabindex: 0,
  254. ref: d,
  255. style: pe,
  256. "aria-hidden": "true"
  257. }, null), L ? L({
  258. originVNode: M
  259. }) : M, s("div", {
  260. tabindex: 0,
  261. ref: g,
  262. style: pe,
  263. "aria-hidden": "true"
  264. }, null)]), [[Fe, D]]) : null]
  265. });
  266. };
  267. }
  268. }), To = O({
  269. compatConfig: {
  270. MODE: 3
  271. },
  272. name: "DialogMask",
  273. props: {
  274. prefixCls: String,
  275. visible: Boolean,
  276. motionName: String,
  277. maskProps: Object
  278. },
  279. setup(e, o) {
  280. return () => {
  281. const {
  282. prefixCls: t,
  283. visible: n,
  284. maskProps: l,
  285. motionName: d
  286. } = e, g = he(d);
  287. return s(Be, g, {
  288. default: () => [Pe(s("div", y({
  289. class: `${t}-mask`
  290. }, l), null), [[Fe, n]])]
  291. });
  292. };
  293. }
  294. }), ve = O({
  295. compatConfig: {
  296. MODE: 3
  297. },
  298. name: "VcDialog",
  299. inheritAttrs: !1,
  300. props: Z(c(c({}, re()), {
  301. getOpenCount: Function,
  302. scrollLocker: Object
  303. }), {
  304. mask: !0,
  305. visible: !1,
  306. keyboard: !0,
  307. closable: !0,
  308. maskClosable: !0,
  309. destroyOnClose: !1,
  310. prefixCls: "rc-dialog",
  311. getOpenCount: () => null,
  312. focusTriggerAfterClose: !0
  313. }),
  314. setup(e, o) {
  315. let {
  316. attrs: t,
  317. slots: n
  318. } = o;
  319. const l = S(), d = S(), g = S(), v = S(e.visible), b = S(`vcDialogTitle${ho()}`), f = (m) => {
  320. var $, C;
  321. if (m)
  322. je(d.value, document.activeElement) || (l.value = document.activeElement, ($ = g.value) === null || $ === void 0 || $.focus());
  323. else {
  324. const T = v.value;
  325. if (v.value = !1, e.mask && l.value && e.focusTriggerAfterClose) {
  326. try {
  327. l.value.focus({
  328. preventScroll: !0
  329. });
  330. } catch (B) {
  331. }
  332. l.value = null;
  333. }
  334. T && ((C = e.afterClose) === null || C === void 0 || C.call(e));
  335. }
  336. }, u = (m) => {
  337. var $;
  338. ($ = e.onClose) === null || $ === void 0 || $.call(e, m);
  339. }, i = S(!1), a = S(), r = () => {
  340. clearTimeout(a.value), i.value = !0;
  341. }, p = () => {
  342. a.value = setTimeout(() => {
  343. i.value = !1;
  344. });
  345. }, x = (m) => {
  346. if (!e.maskClosable) return null;
  347. i.value ? i.value = !1 : d.value === m.target && u(m);
  348. }, h = (m) => {
  349. if (e.keyboard && m.keyCode === de.ESC) {
  350. m.stopPropagation(), u(m);
  351. return;
  352. }
  353. e.visible && m.keyCode === de.TAB && g.value.changeActive(!m.shiftKey);
  354. };
  355. return Y(() => e.visible, () => {
  356. e.visible && (v.value = !0);
  357. }, {
  358. flush: "post"
  359. }), ie(() => {
  360. var m;
  361. clearTimeout(a.value), (m = e.scrollLocker) === null || m === void 0 || m.unLock();
  362. }), fo(() => {
  363. var m, $;
  364. (m = e.scrollLocker) === null || m === void 0 || m.unLock(), v.value && (($ = e.scrollLocker) === null || $ === void 0 || $.lock());
  365. }), () => {
  366. const {
  367. prefixCls: m,
  368. mask: $,
  369. visible: C,
  370. maskTransitionName: T,
  371. maskAnimation: B,
  372. zIndex: F,
  373. wrapClassName: I,
  374. rootClassName: N,
  375. wrapStyle: z,
  376. closable: A,
  377. maskProps: D,
  378. maskStyle: L,
  379. transitionName: G,
  380. animation: H,
  381. wrapProps: W,
  382. title: j = n.title
  383. } = e, {
  384. style: R,
  385. class: M
  386. } = t;
  387. return s("div", y({
  388. class: [`${m}-root`, N]
  389. }, Co(e, {
  390. data: !0
  391. })), [s(To, {
  392. prefixCls: m,
  393. visible: $ && C,
  394. motionName: fe(m, T, B),
  395. style: c({
  396. zIndex: F
  397. }, L),
  398. maskProps: D
  399. }, null), s("div", y({
  400. tabIndex: -1,
  401. onKeydown: h,
  402. class: U(`${m}-wrap`, I),
  403. ref: d,
  404. onClick: x,
  405. role: "dialog",
  406. "aria-labelledby": j ? b.value : null,
  407. style: c(c({
  408. zIndex: F
  409. }, z), {
  410. display: v.value ? null : "none"
  411. })
  412. }, W), [s(wo, y(y({}, Se(e, ["scrollLocker"])), {}, {
  413. style: R,
  414. class: M,
  415. onMousedown: r,
  416. onMouseup: p,
  417. ref: g,
  418. closable: A,
  419. ariaId: b.value,
  420. prefixCls: m,
  421. visible: C,
  422. onClose: u,
  423. onVisibleChanged: f,
  424. motionName: fe(m, G, H)
  425. }), n)])]);
  426. };
  427. }
  428. }), Bo = re(), Po = O({
  429. compatConfig: {
  430. MODE: 3
  431. },
  432. name: "DialogWrap",
  433. inheritAttrs: !1,
  434. props: Z(Bo, {
  435. visible: !1
  436. }),
  437. setup(e, o) {
  438. let {
  439. attrs: t,
  440. slots: n
  441. } = o;
  442. const l = X(e.visible);
  443. return Ve({}, {
  444. inTriggerContext: !1
  445. }), Y(() => e.visible, () => {
  446. e.visible && (l.value = !0);
  447. }, {
  448. flush: "post"
  449. }), () => {
  450. const {
  451. visible: d,
  452. getContainer: g,
  453. forceRender: v,
  454. destroyOnClose: b = !1,
  455. afterClose: f
  456. } = e;
  457. let u = c(c(c({}, e), t), {
  458. ref: "_component",
  459. key: "dialog"
  460. });
  461. return g === !1 ? s(ve, y(y({}, u), {}, {
  462. getOpenCount: () => 2
  463. }), n) : !v && b && !l.value ? null : s(_e, {
  464. autoLock: !0,
  465. visible: d,
  466. forceRender: v,
  467. getContainer: g
  468. }, {
  469. default: (i) => (u = c(c(c({}, u), i), {
  470. afterClose: () => {
  471. f == null || f(), l.value = !1;
  472. }
  473. }), s(ve, u, n))
  474. });
  475. };
  476. }
  477. });
  478. function Ce(e) {
  479. return {
  480. position: e,
  481. top: 0,
  482. insetInlineEnd: 0,
  483. bottom: 0,
  484. insetInlineStart: 0
  485. };
  486. }
  487. const Fo = (e) => {
  488. const {
  489. componentCls: o
  490. } = e;
  491. return [{
  492. [`${o}-root`]: {
  493. [`${o}${e.antCls}-zoom-enter, ${o}${e.antCls}-zoom-appear`]: {
  494. // reset scale avoid mousePosition bug
  495. transform: "none",
  496. opacity: 0,
  497. animationDuration: e.motionDurationSlow,
  498. // https://github.com/ant-design/ant-design/issues/11777
  499. userSelect: "none"
  500. },
  501. [`${o}${e.antCls}-zoom-leave ${o}-content`]: {
  502. pointerEvents: "none"
  503. },
  504. [`${o}-mask`]: c(c({}, Ce("fixed")), {
  505. zIndex: e.zIndexPopupBase,
  506. height: "100%",
  507. backgroundColor: e.colorBgMask,
  508. [`${o}-hidden`]: {
  509. display: "none"
  510. }
  511. }),
  512. [`${o}-wrap`]: c(c({}, Ce("fixed")), {
  513. overflow: "auto",
  514. outline: 0,
  515. WebkitOverflowScrolling: "touch"
  516. })
  517. }
  518. }, {
  519. [`${o}-root`]: $o(e)
  520. }];
  521. }, Io = (e) => {
  522. const {
  523. componentCls: o
  524. } = e;
  525. return [
  526. // ======================== Root =========================
  527. {
  528. [`${o}-root`]: {
  529. [`${o}-wrap`]: {
  530. zIndex: e.zIndexPopupBase,
  531. position: "fixed",
  532. inset: 0,
  533. overflow: "auto",
  534. outline: 0,
  535. WebkitOverflowScrolling: "touch"
  536. },
  537. [`${o}-wrap-rtl`]: {
  538. direction: "rtl"
  539. },
  540. [`${o}-centered`]: {
  541. textAlign: "center",
  542. "&::before": {
  543. display: "inline-block",
  544. width: 0,
  545. height: "100%",
  546. verticalAlign: "middle",
  547. content: '""'
  548. },
  549. [o]: {
  550. top: 0,
  551. display: "inline-block",
  552. paddingBottom: 0,
  553. textAlign: "start",
  554. verticalAlign: "middle"
  555. }
  556. },
  557. [`@media (max-width: ${e.screenSMMax})`]: {
  558. [o]: {
  559. maxWidth: "calc(100vw - 16px)",
  560. margin: `${e.marginXS} auto`
  561. },
  562. [`${o}-centered`]: {
  563. [o]: {
  564. flex: 1
  565. }
  566. }
  567. }
  568. }
  569. },
  570. // ======================== Modal ========================
  571. {
  572. [o]: c(c({}, Ue(e)), {
  573. pointerEvents: "none",
  574. position: "relative",
  575. top: 100,
  576. width: "auto",
  577. maxWidth: `calc(100vw - ${e.margin * 2}px)`,
  578. margin: "0 auto",
  579. paddingBottom: e.paddingLG,
  580. [`${o}-title`]: {
  581. margin: 0,
  582. color: e.modalHeadingColor,
  583. fontWeight: e.fontWeightStrong,
  584. fontSize: e.modalHeaderTitleFontSize,
  585. lineHeight: e.modalHeaderTitleLineHeight,
  586. wordWrap: "break-word"
  587. },
  588. [`${o}-content`]: {
  589. position: "relative",
  590. backgroundColor: e.modalContentBg,
  591. backgroundClip: "padding-box",
  592. border: 0,
  593. borderRadius: e.borderRadiusLG,
  594. boxShadow: e.boxShadowSecondary,
  595. pointerEvents: "auto",
  596. padding: `${e.paddingMD}px ${e.paddingContentHorizontalLG}px`
  597. },
  598. [`${o}-close`]: c({
  599. position: "absolute",
  600. top: (e.modalHeaderCloseSize - e.modalCloseBtnSize) / 2,
  601. insetInlineEnd: (e.modalHeaderCloseSize - e.modalCloseBtnSize) / 2,
  602. zIndex: e.zIndexPopupBase + 10,
  603. padding: 0,
  604. color: e.modalCloseColor,
  605. fontWeight: e.fontWeightStrong,
  606. lineHeight: 1,
  607. textDecoration: "none",
  608. background: "transparent",
  609. borderRadius: e.borderRadiusSM,
  610. width: e.modalConfirmIconSize,
  611. height: e.modalConfirmIconSize,
  612. border: 0,
  613. outline: 0,
  614. cursor: "pointer",
  615. transition: `color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,
  616. "&-x": {
  617. display: "block",
  618. fontSize: e.fontSizeLG,
  619. fontStyle: "normal",
  620. lineHeight: `${e.modalCloseBtnSize}px`,
  621. textAlign: "center",
  622. textTransform: "none",
  623. textRendering: "auto"
  624. },
  625. "&:hover": {
  626. color: e.modalIconHoverColor,
  627. backgroundColor: e.wireframe ? "transparent" : e.colorFillContent,
  628. textDecoration: "none"
  629. },
  630. "&:active": {
  631. backgroundColor: e.wireframe ? "transparent" : e.colorFillContentHover
  632. }
  633. }, Qe(e)),
  634. [`${o}-header`]: {
  635. color: e.colorText,
  636. background: e.modalHeaderBg,
  637. borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,
  638. marginBottom: e.marginXS
  639. },
  640. [`${o}-body`]: {
  641. fontSize: e.fontSize,
  642. lineHeight: e.lineHeight,
  643. wordWrap: "break-word"
  644. },
  645. [`${o}-footer`]: {
  646. textAlign: "end",
  647. background: e.modalFooterBg,
  648. marginTop: e.marginSM,
  649. [`${e.antCls}-btn + ${e.antCls}-btn:not(${e.antCls}-dropdown-trigger)`]: {
  650. marginBottom: 0,
  651. marginInlineStart: e.marginXS
  652. }
  653. },
  654. [`${o}-open`]: {
  655. overflow: "hidden"
  656. }
  657. })
  658. },
  659. // ======================== Pure =========================
  660. {
  661. [`${o}-pure-panel`]: {
  662. top: "auto",
  663. padding: 0,
  664. display: "flex",
  665. flexDirection: "column",
  666. [`${o}-content,
  667. ${o}-body,
  668. ${o}-confirm-body-wrapper`]: {
  669. display: "flex",
  670. flexDirection: "column",
  671. flex: "auto"
  672. },
  673. [`${o}-confirm-body`]: {
  674. marginBottom: "auto"
  675. }
  676. }
  677. }
  678. ];
  679. }, Mo = (e) => {
  680. const {
  681. componentCls: o
  682. } = e, t = `${o}-confirm`;
  683. return {
  684. [t]: {
  685. "&-rtl": {
  686. direction: "rtl"
  687. },
  688. [`${e.antCls}-modal-header`]: {
  689. display: "none"
  690. },
  691. [`${t}-body-wrapper`]: c({}, ke()),
  692. [`${t}-body`]: {
  693. display: "flex",
  694. flexWrap: "wrap",
  695. alignItems: "center",
  696. [`${t}-title`]: {
  697. flex: "0 0 100%",
  698. display: "block",
  699. // create BFC to avoid
  700. // https://user-images.githubusercontent.com/507615/37702510-ba844e06-2d2d-11e8-9b67-8e19be57f445.png
  701. overflow: "hidden",
  702. color: e.colorTextHeading,
  703. fontWeight: e.fontWeightStrong,
  704. fontSize: e.modalHeaderTitleFontSize,
  705. lineHeight: e.modalHeaderTitleLineHeight,
  706. [`+ ${t}-content`]: {
  707. marginBlockStart: e.marginXS,
  708. flexBasis: "100%",
  709. maxWidth: `calc(100% - ${e.modalConfirmIconSize + e.marginSM}px)`
  710. }
  711. },
  712. [`${t}-content`]: {
  713. color: e.colorText,
  714. fontSize: e.fontSize
  715. },
  716. [`> ${e.iconCls}`]: {
  717. flex: "none",
  718. marginInlineEnd: e.marginSM,
  719. fontSize: e.modalConfirmIconSize,
  720. [`+ ${t}-title`]: {
  721. flex: 1
  722. },
  723. // `content` after `icon` should set marginLeft
  724. [`+ ${t}-title + ${t}-content`]: {
  725. marginInlineStart: e.modalConfirmIconSize + e.marginSM
  726. }
  727. }
  728. },
  729. [`${t}-btns`]: {
  730. textAlign: "end",
  731. marginTop: e.marginSM,
  732. [`${e.antCls}-btn + ${e.antCls}-btn`]: {
  733. marginBottom: 0,
  734. marginInlineStart: e.marginXS
  735. }
  736. }
  737. },
  738. [`${t}-error ${t}-body > ${e.iconCls}`]: {
  739. color: e.colorError
  740. },
  741. [`${t}-warning ${t}-body > ${e.iconCls},
  742. ${t}-confirm ${t}-body > ${e.iconCls}`]: {
  743. color: e.colorWarning
  744. },
  745. [`${t}-info ${t}-body > ${e.iconCls}`]: {
  746. color: e.colorInfo
  747. },
  748. [`${t}-success ${t}-body > ${e.iconCls}`]: {
  749. color: e.colorSuccess
  750. },
  751. // https://github.com/ant-design/ant-design/issues/37329
  752. [`${o}-zoom-leave ${o}-btns`]: {
  753. pointerEvents: "none"
  754. }
  755. };
  756. }, Oo = (e) => {
  757. const {
  758. componentCls: o
  759. } = e;
  760. return {
  761. [`${o}-root`]: {
  762. [`${o}-wrap-rtl`]: {
  763. direction: "rtl",
  764. [`${o}-confirm-body`]: {
  765. direction: "rtl"
  766. }
  767. }
  768. }
  769. };
  770. }, No = (e) => {
  771. const {
  772. componentCls: o,
  773. antCls: t
  774. } = e, n = `${o}-confirm`;
  775. return {
  776. [o]: {
  777. [`${o}-content`]: {
  778. padding: 0
  779. },
  780. [`${o}-header`]: {
  781. padding: e.modalHeaderPadding,
  782. borderBottom: `${e.modalHeaderBorderWidth}px ${e.modalHeaderBorderStyle} ${e.modalHeaderBorderColorSplit}`,
  783. marginBottom: 0
  784. },
  785. [`${o}-body`]: {
  786. padding: e.modalBodyPadding
  787. },
  788. [`${o}-footer`]: {
  789. padding: `${e.modalFooterPaddingVertical}px ${e.modalFooterPaddingHorizontal}px`,
  790. borderTop: `${e.modalFooterBorderWidth}px ${e.modalFooterBorderStyle} ${e.modalFooterBorderColorSplit}`,
  791. borderRadius: `0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`,
  792. marginTop: 0
  793. }
  794. },
  795. [n]: {
  796. [`${t}-modal-body`]: {
  797. padding: `${e.padding * 2}px ${e.padding * 2}px ${e.paddingLG}px`
  798. },
  799. [`${n}-body`]: {
  800. [`> ${e.iconCls}`]: {
  801. marginInlineEnd: e.margin,
  802. // `content` after `icon` should set marginLeft
  803. [`+ ${n}-title + ${n}-content`]: {
  804. marginInlineStart: e.modalConfirmIconSize + e.margin
  805. }
  806. }
  807. },
  808. [`${n}-btns`]: {
  809. marginTop: e.marginLG
  810. }
  811. }
  812. };
  813. }, zo = Ge("Modal", (e) => {
  814. const o = e.padding, t = e.fontSizeHeading5, n = e.lineHeightHeading5, l = Ke(e, {
  815. modalBodyPadding: e.paddingLG,
  816. modalHeaderBg: e.colorBgElevated,
  817. modalHeaderPadding: `${o}px ${e.paddingLG}px`,
  818. modalHeaderBorderWidth: e.lineWidth,
  819. modalHeaderBorderStyle: e.lineType,
  820. modalHeaderTitleLineHeight: n,
  821. modalHeaderTitleFontSize: t,
  822. modalHeaderBorderColorSplit: e.colorSplit,
  823. modalHeaderCloseSize: n * t + o * 2,
  824. modalContentBg: e.colorBgElevated,
  825. modalHeadingColor: e.colorTextHeading,
  826. modalCloseColor: e.colorTextDescription,
  827. modalFooterBg: "transparent",
  828. modalFooterBorderColorSplit: e.colorSplit,
  829. modalFooterBorderStyle: e.lineType,
  830. modalFooterPaddingVertical: e.paddingXS,
  831. modalFooterPaddingHorizontal: e.padding,
  832. modalFooterBorderWidth: e.lineWidth,
  833. modalConfirmTitleFontSize: e.fontSizeLG,
  834. modalIconHoverColor: e.colorIconHover,
  835. modalConfirmIconSize: e.fontSize * e.lineHeight,
  836. modalCloseBtnSize: e.controlHeightLG * 0.55
  837. });
  838. return [Io(l), Mo(l), Oo(l), Fo(l), e.wireframe && No(l), Xe(l, "zoom")];
  839. });
  840. var Ho = function(e, o) {
  841. var t = {};
  842. for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && o.indexOf(n) < 0 && (t[n] = e[n]);
  843. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, n = Object.getOwnPropertySymbols(e); l < n.length; l++)
  844. o.indexOf(n[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[l]) && (t[n[l]] = e[n[l]]);
  845. return t;
  846. };
  847. let le;
  848. const Ao = (e) => {
  849. le = {
  850. x: e.pageX,
  851. y: e.pageY
  852. }, setTimeout(() => le = null, 100);
  853. };
  854. yo() && Ye(document.documentElement, "click", Ao, !0);
  855. const Ro = () => ({
  856. prefixCls: String,
  857. /** @deprecated Please use `open` instead. */
  858. visible: {
  859. type: Boolean,
  860. default: void 0
  861. },
  862. open: {
  863. type: Boolean,
  864. default: void 0
  865. },
  866. confirmLoading: {
  867. type: Boolean,
  868. default: void 0
  869. },
  870. title: w.any,
  871. closable: {
  872. type: Boolean,
  873. default: void 0
  874. },
  875. closeIcon: w.any,
  876. onOk: Function,
  877. onCancel: Function,
  878. "onUpdate:visible": Function,
  879. "onUpdate:open": Function,
  880. onChange: Function,
  881. afterClose: Function,
  882. centered: {
  883. type: Boolean,
  884. default: void 0
  885. },
  886. width: [String, Number],
  887. footer: w.any,
  888. okText: w.any,
  889. okType: String,
  890. cancelText: w.any,
  891. icon: w.any,
  892. maskClosable: {
  893. type: Boolean,
  894. default: void 0
  895. },
  896. forceRender: {
  897. type: Boolean,
  898. default: void 0
  899. },
  900. okButtonProps: _(),
  901. cancelButtonProps: _(),
  902. destroyOnClose: {
  903. type: Boolean,
  904. default: void 0
  905. },
  906. wrapClassName: String,
  907. maskTransitionName: String,
  908. transitionName: String,
  909. getContainer: {
  910. type: [String, Function, Boolean, Object],
  911. default: void 0
  912. },
  913. zIndex: Number,
  914. bodyStyle: _(),
  915. maskStyle: _(),
  916. mask: {
  917. type: Boolean,
  918. default: void 0
  919. },
  920. keyboard: {
  921. type: Boolean,
  922. default: void 0
  923. },
  924. wrapProps: Object,
  925. focusTriggerAfterClose: {
  926. type: Boolean,
  927. default: void 0
  928. },
  929. modalRender: Function,
  930. mousePosition: _()
  931. }), P = O({
  932. compatConfig: {
  933. MODE: 3
  934. },
  935. name: "AModal",
  936. inheritAttrs: !1,
  937. props: Z(Ro(), {
  938. width: 520,
  939. confirmLoading: !1,
  940. okType: "primary"
  941. }),
  942. setup(e, o) {
  943. let {
  944. emit: t,
  945. slots: n,
  946. attrs: l
  947. } = o;
  948. const [d] = ae("Modal"), {
  949. prefixCls: g,
  950. rootPrefixCls: v,
  951. direction: b,
  952. getPopupContainer: f
  953. } = qe("modal", e), [u, i] = zo(g);
  954. we(e.visible === void 0, "Modal", "`visible` will be removed in next major version, please use `open` instead.");
  955. const a = (x) => {
  956. t("update:visible", !1), t("update:open", !1), t("cancel", x), t("change", !1);
  957. }, r = (x) => {
  958. t("ok", x);
  959. }, p = () => {
  960. var x, h;
  961. const {
  962. okText: m = (x = n.okText) === null || x === void 0 ? void 0 : x.call(n),
  963. okType: $,
  964. cancelText: C = (h = n.cancelText) === null || h === void 0 ? void 0 : h.call(n),
  965. confirmLoading: T
  966. } = e;
  967. return s(mo, null, [s(te, y({
  968. onClick: a
  969. }, e.cancelButtonProps), {
  970. default: () => [C || d.value.cancelText]
  971. }), s(te, y(y({}, Te($)), {}, {
  972. loading: T,
  973. onClick: r
  974. }, e.okButtonProps), {
  975. default: () => [m || d.value.okText]
  976. })]);
  977. };
  978. return () => {
  979. var x, h;
  980. const {
  981. prefixCls: m,
  982. visible: $,
  983. open: C,
  984. wrapClassName: T,
  985. centered: B,
  986. getContainer: F,
  987. closeIcon: I = (x = n.closeIcon) === null || x === void 0 ? void 0 : x.call(n),
  988. focusTriggerAfterClose: N = !0
  989. } = e, z = Ho(e, ["prefixCls", "visible", "open", "wrapClassName", "centered", "getContainer", "closeIcon", "focusTriggerAfterClose"]), A = U(T, {
  990. [`${g.value}-centered`]: !!B,
  991. [`${g.value}-wrap-rtl`]: b.value === "rtl"
  992. });
  993. return u(s(Po, y(y(y({}, z), l), {}, {
  994. rootClassName: i.value,
  995. class: U(i.value, l.class),
  996. getContainer: F || (f == null ? void 0 : f.value),
  997. prefixCls: g.value,
  998. wrapClassName: A,
  999. visible: C != null ? C : $,
  1000. onClose: a,
  1001. focusTriggerAfterClose: N,
  1002. transitionName: q(v.value, "zoom", e.transitionName),
  1003. maskTransitionName: q(v.value, "fade", e.maskTransitionName),
  1004. mousePosition: (h = z.mousePosition) !== null && h !== void 0 ? h : le
  1005. }), c(c({}, n), {
  1006. footer: n.footer || p,
  1007. closeIcon: () => s("span", {
  1008. class: `${g.value}-close-x`
  1009. }, [I || s(Je, {
  1010. class: `${g.value}-close-icon`
  1011. }, null)])
  1012. })));
  1013. };
  1014. }
  1015. }), Eo = () => {
  1016. const e = S(!1);
  1017. return ie(() => {
  1018. e.value = !0;
  1019. }), e;
  1020. }, Do = {
  1021. type: {
  1022. type: String
  1023. },
  1024. actionFn: Function,
  1025. close: Function,
  1026. autofocus: Boolean,
  1027. prefixCls: String,
  1028. buttonProps: _(),
  1029. emitEvent: Boolean,
  1030. quitOnNullishReturnValue: Boolean
  1031. };
  1032. function ye(e) {
  1033. return !!(e && e.then);
  1034. }
  1035. const be = O({
  1036. compatConfig: {
  1037. MODE: 3
  1038. },
  1039. name: "ActionButton",
  1040. props: Do,
  1041. setup(e, o) {
  1042. let {
  1043. slots: t
  1044. } = o;
  1045. const n = S(!1), l = S(), d = S(!1);
  1046. let g;
  1047. const v = Eo();
  1048. go(() => {
  1049. e.autofocus && (g = setTimeout(() => {
  1050. var i, a;
  1051. return (a = (i = Ze(l.value)) === null || i === void 0 ? void 0 : i.focus) === null || a === void 0 ? void 0 : a.call(i);
  1052. }));
  1053. }), ie(() => {
  1054. clearTimeout(g);
  1055. });
  1056. const b = function() {
  1057. for (var i, a = arguments.length, r = new Array(a), p = 0; p < a; p++)
  1058. r[p] = arguments[p];
  1059. (i = e.close) === null || i === void 0 || i.call(e, ...r);
  1060. }, f = (i) => {
  1061. ye(i) && (d.value = !0, i.then(function() {
  1062. v.value || (d.value = !1), b(...arguments), n.value = !1;
  1063. }, (a) => (v.value || (d.value = !1), n.value = !1, Promise.reject(a))));
  1064. }, u = (i) => {
  1065. const {
  1066. actionFn: a
  1067. } = e;
  1068. if (n.value)
  1069. return;
  1070. if (n.value = !0, !a) {
  1071. b();
  1072. return;
  1073. }
  1074. let r;
  1075. if (e.emitEvent) {
  1076. if (r = a(i), e.quitOnNullishReturnValue && !ye(r)) {
  1077. n.value = !1, b(i);
  1078. return;
  1079. }
  1080. } else if (a.length)
  1081. r = a(e.close), n.value = !1;
  1082. else if (r = a(), !r) {
  1083. b();
  1084. return;
  1085. }
  1086. f(r);
  1087. };
  1088. return () => {
  1089. const {
  1090. type: i,
  1091. prefixCls: a,
  1092. buttonProps: r
  1093. } = e;
  1094. return s(te, y(y(y({}, Te(i)), {}, {
  1095. onClick: u,
  1096. loading: d.value,
  1097. prefixCls: a
  1098. }, r), {}, {
  1099. ref: l
  1100. }), t);
  1101. };
  1102. }
  1103. });
  1104. function V(e) {
  1105. return typeof e == "function" ? e() : e;
  1106. }
  1107. const Ie = O({
  1108. name: "ConfirmDialog",
  1109. inheritAttrs: !1,
  1110. 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"],
  1111. setup(e, o) {
  1112. let {
  1113. attrs: t
  1114. } = o;
  1115. const [n] = ae("Modal");
  1116. return process.env.NODE_ENV !== "production" && we(e.visible === void 0, "Modal", "`visible` is deprecated, please use `open` instead."), () => {
  1117. const {
  1118. icon: l,
  1119. onCancel: d,
  1120. onOk: g,
  1121. close: v,
  1122. okText: b,
  1123. closable: f = !1,
  1124. zIndex: u,
  1125. afterClose: i,
  1126. keyboard: a,
  1127. centered: r,
  1128. getContainer: p,
  1129. maskStyle: x,
  1130. okButtonProps: h,
  1131. cancelButtonProps: m,
  1132. okCancel: $,
  1133. width: C = 416,
  1134. mask: T = !0,
  1135. maskClosable: B = !1,
  1136. type: F,
  1137. open: I,
  1138. title: N,
  1139. content: z,
  1140. direction: A,
  1141. closeIcon: D,
  1142. modalRender: L,
  1143. focusTriggerAfterClose: G,
  1144. rootPrefixCls: H,
  1145. bodyStyle: W,
  1146. wrapClassName: j,
  1147. footer: R
  1148. } = e;
  1149. let M = l;
  1150. if (!l && l !== null)
  1151. switch (F) {
  1152. case "info":
  1153. M = s(to, null, null);
  1154. break;
  1155. case "success":
  1156. M = s(no, null, null);
  1157. break;
  1158. case "error":
  1159. M = s(oo, null, null);
  1160. break;
  1161. default:
  1162. M = s(eo, null, null);
  1163. }
  1164. const ee = e.okType || "primary", oe = e.prefixCls || "ant-modal", K = `${oe}-confirm`, Re = t.style || {}, se = $ != null ? $ : F === "confirm", ce = e.autoFocusButton === null ? !1 : e.autoFocusButton || "ok", k = `${oe}-confirm`, Ee = U(k, `${k}-${e.type}`, {
  1165. [`${k}-rtl`]: A === "rtl"
  1166. }, t.class), ne = n.value, De = se && s(be, {
  1167. actionFn: d,
  1168. close: v,
  1169. autofocus: ce === "cancel",
  1170. buttonProps: m,
  1171. prefixCls: `${H}-btn`
  1172. }, {
  1173. default: () => [V(e.cancelText) || ne.cancelText]
  1174. });
  1175. return s(P, {
  1176. prefixCls: oe,
  1177. class: Ee,
  1178. wrapClassName: U({
  1179. [`${k}-centered`]: !!r
  1180. }, j),
  1181. onCancel: (Le) => v == null ? void 0 : v({
  1182. triggerCancel: !0
  1183. }, Le),
  1184. open: I,
  1185. title: "",
  1186. footer: "",
  1187. transitionName: q(H, "zoom", e.transitionName),
  1188. maskTransitionName: q(H, "fade", e.maskTransitionName),
  1189. mask: T,
  1190. maskClosable: B,
  1191. maskStyle: x,
  1192. style: Re,
  1193. bodyStyle: W,
  1194. width: C,
  1195. zIndex: u,
  1196. afterClose: i,
  1197. keyboard: a,
  1198. centered: r,
  1199. getContainer: p,
  1200. closable: f,
  1201. closeIcon: D,
  1202. modalRender: L,
  1203. focusTriggerAfterClose: G
  1204. }, {
  1205. default: () => [s("div", {
  1206. class: `${K}-body-wrapper`
  1207. }, [s("div", {
  1208. class: `${K}-body`
  1209. }, [V(M), N === void 0 ? null : s("span", {
  1210. class: `${K}-title`
  1211. }, [V(N)]), s("div", {
  1212. class: `${K}-content`
  1213. }, [V(z)])]), R !== void 0 ? V(R) : s("div", {
  1214. class: `${K}-btns`
  1215. }, [De, s(be, {
  1216. type: ee,
  1217. actionFn: g,
  1218. close: v,
  1219. autofocus: ce === "ok",
  1220. buttonProps: h,
  1221. prefixCls: `${H}-btn`
  1222. }, {
  1223. default: () => [V(b) || (se ? ne.okText : ne.justOkText)]
  1224. })])])]
  1225. });
  1226. };
  1227. }
  1228. }), E = [], Q = (e) => {
  1229. const o = document.createDocumentFragment();
  1230. let t = c(c({}, Se(e, ["parentContext", "appContext"])), {
  1231. close: d,
  1232. open: !0
  1233. }), n = null;
  1234. function l() {
  1235. n && (ue(null, o), n = null);
  1236. for (var f = arguments.length, u = new Array(f), i = 0; i < f; i++)
  1237. u[i] = arguments[i];
  1238. const a = u.some((r) => r && r.triggerCancel);
  1239. e.onCancel && a && e.onCancel(() => {
  1240. }, ...u.slice(1));
  1241. for (let r = 0; r < E.length; r++)
  1242. if (E[r] === d) {
  1243. E.splice(r, 1);
  1244. break;
  1245. }
  1246. }
  1247. function d() {
  1248. for (var f = arguments.length, u = new Array(f), i = 0; i < f; i++)
  1249. u[i] = arguments[i];
  1250. t = c(c({}, t), {
  1251. open: !1,
  1252. afterClose: () => {
  1253. typeof e.afterClose == "function" && e.afterClose(), l.apply(this, u);
  1254. }
  1255. }), t.visible && delete t.visible, g(t);
  1256. }
  1257. function g(f) {
  1258. typeof f == "function" ? t = f(t) : t = c(c({}, t), f), n && lo(n, t, o);
  1259. }
  1260. const v = (f) => {
  1261. const u = io, i = u.prefixCls, a = f.prefixCls || `${i}-modal`, r = u.iconPrefixCls, p = ro();
  1262. return s(ao, y(y({}, u), {}, {
  1263. prefixCls: i
  1264. }), {
  1265. default: () => [s(Ie, y(y({}, f), {}, {
  1266. rootPrefixCls: i,
  1267. prefixCls: a,
  1268. iconPrefixCls: r,
  1269. locale: p,
  1270. cancelText: f.cancelText || p.cancelText
  1271. }), null)]
  1272. });
  1273. };
  1274. function b(f) {
  1275. const u = s(v, c({}, f));
  1276. return u.appContext = e.parentContext || e.appContext || u.appContext, ue(u, o), u;
  1277. }
  1278. return n = b(t), E.push(d), {
  1279. destroy: d,
  1280. update: g
  1281. };
  1282. };
  1283. function Me(e) {
  1284. return c(c({}, e), {
  1285. type: "warning"
  1286. });
  1287. }
  1288. function Oe(e) {
  1289. return c(c({}, e), {
  1290. type: "info"
  1291. });
  1292. }
  1293. function Ne(e) {
  1294. return c(c({}, e), {
  1295. type: "success"
  1296. });
  1297. }
  1298. function ze(e) {
  1299. return c(c({}, e), {
  1300. type: "error"
  1301. });
  1302. }
  1303. function He(e) {
  1304. return c(c({}, e), {
  1305. type: "confirm"
  1306. });
  1307. }
  1308. const Lo = () => ({
  1309. config: Object,
  1310. afterClose: Function,
  1311. destroyAction: Function,
  1312. open: Boolean
  1313. }), Wo = O({
  1314. name: "HookModal",
  1315. inheritAttrs: !1,
  1316. props: Z(Lo(), {
  1317. config: {
  1318. width: 520,
  1319. okType: "primary"
  1320. }
  1321. }),
  1322. setup(e, o) {
  1323. let {
  1324. expose: t
  1325. } = o;
  1326. var n;
  1327. const l = J(() => e.open), d = J(() => e.config), {
  1328. direction: g,
  1329. getPrefixCls: v
  1330. } = so(), b = v("modal"), f = v(), u = () => {
  1331. var p, x;
  1332. e == null || e.afterClose(), (x = (p = d.value).afterClose) === null || x === void 0 || x.call(p);
  1333. }, i = function() {
  1334. e.destroyAction(...arguments);
  1335. };
  1336. t({
  1337. destroy: i
  1338. });
  1339. const a = (n = d.value.okCancel) !== null && n !== void 0 ? n : d.value.type === "confirm", [r] = ae("Modal", co.Modal);
  1340. return () => s(Ie, y(y({
  1341. prefixCls: b,
  1342. rootPrefixCls: f
  1343. }, d.value), {}, {
  1344. close: i,
  1345. open: l.value,
  1346. afterClose: u,
  1347. okText: d.value.okText || (a ? r == null ? void 0 : r.value.okText : r == null ? void 0 : r.value.justOkText),
  1348. direction: d.value.direction || g.value,
  1349. cancelText: d.value.cancelText || (r == null ? void 0 : r.value.cancelText)
  1350. }), null);
  1351. }
  1352. });
  1353. let xe = 0;
  1354. const jo = O({
  1355. name: "ElementsHolder",
  1356. inheritAttrs: !1,
  1357. setup(e, o) {
  1358. let {
  1359. expose: t
  1360. } = o;
  1361. const n = S([]);
  1362. return t({
  1363. addModal: (d) => (n.value.push(d), n.value = n.value.slice(), () => {
  1364. n.value = n.value.filter((g) => g !== d);
  1365. })
  1366. }), () => n.value.map((d) => d());
  1367. }
  1368. });
  1369. function Vo() {
  1370. const e = S(null), o = S([]);
  1371. Y(o, () => {
  1372. o.value.length && ([...o.value].forEach((g) => {
  1373. g();
  1374. }), o.value = []);
  1375. }, {
  1376. immediate: !0
  1377. });
  1378. const t = (d) => function(v) {
  1379. var b;
  1380. xe += 1;
  1381. const f = S(!0), u = S(null), i = S(po(v)), a = S({});
  1382. Y(() => v, (C) => {
  1383. h(c(c({}, vo(C) ? C.value : C), a.value));
  1384. });
  1385. const r = function() {
  1386. f.value = !1;
  1387. for (var C = arguments.length, T = new Array(C), B = 0; B < C; B++)
  1388. T[B] = arguments[B];
  1389. const F = T.some((I) => I && I.triggerCancel);
  1390. i.value.onCancel && F && i.value.onCancel(() => {
  1391. }, ...T.slice(1));
  1392. };
  1393. let p;
  1394. const x = () => s(Wo, {
  1395. key: `modal-${xe}`,
  1396. config: d(i.value),
  1397. ref: u,
  1398. open: f.value,
  1399. destroyAction: r,
  1400. afterClose: () => {
  1401. p == null || p();
  1402. }
  1403. }, null);
  1404. p = (b = e.value) === null || b === void 0 ? void 0 : b.addModal(x), p && E.push(p);
  1405. const h = (C) => {
  1406. i.value = c(c({}, i.value), C);
  1407. };
  1408. return {
  1409. destroy: () => {
  1410. u.value ? r() : o.value = [...o.value, r];
  1411. },
  1412. update: (C) => {
  1413. a.value = C, u.value ? h(C) : o.value = [...o.value, () => h(C)];
  1414. }
  1415. };
  1416. }, n = J(() => ({
  1417. info: t(Oe),
  1418. success: t(Ne),
  1419. error: t(ze),
  1420. warning: t(Me),
  1421. confirm: t(He)
  1422. })), l = Symbol("modalHolderKey");
  1423. return [n.value, () => s(jo, {
  1424. key: l,
  1425. ref: e
  1426. }, null)];
  1427. }
  1428. function Ae(e) {
  1429. return Q(Me(e));
  1430. }
  1431. P.useModal = Vo;
  1432. P.info = function(o) {
  1433. return Q(Oe(o));
  1434. };
  1435. P.success = function(o) {
  1436. return Q(Ne(o));
  1437. };
  1438. P.error = function(o) {
  1439. return Q(ze(o));
  1440. };
  1441. P.warning = Ae;
  1442. P.warn = Ae;
  1443. P.confirm = function(o) {
  1444. return Q(He(o));
  1445. };
  1446. P.destroyAll = function() {
  1447. for (; E.length; ) {
  1448. const o = E.pop();
  1449. o && o();
  1450. }
  1451. };
  1452. P.install = function(e) {
  1453. return e.component(P.name, P), e;
  1454. };
  1455. export {
  1456. P as M
  1457. };