index12.js 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102
  1. import { aC as Xe, bg as ft, w as ge, c as le, K as Z, d as T, P as we, q as D, bo as ht, bp as gt, bq as mt, ak as $t, ap as yt, M as j, br as he, R as Fe, _ as te, e as me, p as xt, az as je, g as _t, m as St, r as tt, t as Ct, bs as at, a8 as Tt, o as wt, i as nt, n as Pt, b6 as Rt, h as De, u as It, bt as Et, ac as Bt, j as Lt, Q as xe, O as At, N as Dt } from "./index2.js";
  2. import { shallowRef as W, onBeforeUnmount as Me, defineComponent as ae, ref as Q, computed as H, createVNode as g, watchEffect as Ce, onMounted as Te, watch as ie, provide as kt, inject as Mt, toRefs as Nt } from "vue";
  3. import { u as Ot } from "./useRefs.js";
  4. import { e as ot, t as Wt, a as Ht, b as zt, h as Kt, f as Gt } from "./hasIn.js";
  5. import { i as Xt } from "./isMobile.js";
  6. import { u as Ve } from "./useMergedState.js";
  7. function Ft(e, t, a, i) {
  8. if (!Xe(e))
  9. return e;
  10. t = ot(t, e);
  11. for (var o = -1, l = t.length, n = l - 1, s = e; s != null && ++o < l; ) {
  12. var v = Wt(t[o]), d = a;
  13. if (v === "__proto__" || v === "constructor" || v === "prototype")
  14. return e;
  15. if (o != n) {
  16. var p = s[v];
  17. d = void 0, d === void 0 && (d = Xe(p) ? p : ft(t[o + 1]) ? [] : {});
  18. }
  19. Ht(s, v, d), s = s[v];
  20. }
  21. return e;
  22. }
  23. function jt(e, t, a) {
  24. for (var i = -1, o = t.length, l = {}; ++i < o; ) {
  25. var n = t[i], s = zt(e, n);
  26. a(s, n) && Ft(l, ot(n, e), s);
  27. }
  28. return l;
  29. }
  30. function Vt(e, t) {
  31. return jt(e, t, function(a, i) {
  32. return Kt(e, i);
  33. });
  34. }
  35. var it = Gt(function(e, t) {
  36. return e == null ? {} : Vt(e, t);
  37. });
  38. function Yt(e) {
  39. const t = W(), a = W(!1);
  40. function i() {
  41. for (var o = arguments.length, l = new Array(o), n = 0; n < o; n++)
  42. l[n] = arguments[n];
  43. a.value || (ge.cancel(t.value), t.value = ge(() => {
  44. e(...l);
  45. }));
  46. }
  47. return Me(() => {
  48. a.value = !0, ge.cancel(t.value);
  49. }), i;
  50. }
  51. function Ut(e) {
  52. const t = W([]), a = W(typeof e == "function" ? e() : e), i = Yt(() => {
  53. let l = a.value;
  54. t.value.forEach((n) => {
  55. l = n(l);
  56. }), t.value = [], a.value = l;
  57. });
  58. function o(l) {
  59. t.value.push(l), i();
  60. }
  61. return [a, o];
  62. }
  63. const qt = ae({
  64. compatConfig: {
  65. MODE: 3
  66. },
  67. name: "TabNode",
  68. props: {
  69. id: {
  70. type: String
  71. },
  72. prefixCls: {
  73. type: String
  74. },
  75. tab: {
  76. type: Object
  77. },
  78. active: {
  79. type: Boolean
  80. },
  81. closable: {
  82. type: Boolean
  83. },
  84. editable: {
  85. type: Object
  86. },
  87. onClick: {
  88. type: Function
  89. },
  90. onResize: {
  91. type: Function
  92. },
  93. renderWrapper: {
  94. type: Function
  95. },
  96. removeAriaLabel: {
  97. type: String
  98. },
  99. // onRemove: { type: Function as PropType<() => void> },
  100. onFocus: {
  101. type: Function
  102. }
  103. },
  104. emits: ["click", "resize", "remove", "focus"],
  105. setup(e, t) {
  106. let {
  107. expose: a,
  108. attrs: i
  109. } = t;
  110. const o = Q();
  111. function l(v) {
  112. var d;
  113. !((d = e.tab) === null || d === void 0) && d.disabled || e.onClick(v);
  114. }
  115. a({
  116. domRef: o
  117. });
  118. function n(v) {
  119. var d;
  120. v.preventDefault(), v.stopPropagation(), e.editable.onEdit("remove", {
  121. key: (d = e.tab) === null || d === void 0 ? void 0 : d.key,
  122. event: v
  123. });
  124. }
  125. const s = H(() => {
  126. var v;
  127. return e.editable && e.closable !== !1 && !(!((v = e.tab) === null || v === void 0) && v.disabled);
  128. });
  129. return () => {
  130. var v;
  131. const {
  132. prefixCls: d,
  133. id: p,
  134. active: S,
  135. tab: {
  136. key: h,
  137. tab: c,
  138. disabled: y,
  139. closeIcon: x
  140. },
  141. renderWrapper: w,
  142. removeAriaLabel: C,
  143. editable: k,
  144. onFocus: K
  145. } = e, M = `${d}-tab`, r = g("div", {
  146. key: h,
  147. ref: o,
  148. class: le(M, {
  149. [`${M}-with-remove`]: s.value,
  150. [`${M}-active`]: S,
  151. [`${M}-disabled`]: y
  152. }),
  153. style: i.style,
  154. onClick: l
  155. }, [g("div", {
  156. role: "tab",
  157. "aria-selected": S,
  158. id: p && `${p}-tab-${h}`,
  159. class: `${M}-btn`,
  160. "aria-controls": p && `${p}-panel-${h}`,
  161. "aria-disabled": y,
  162. tabindex: y ? null : 0,
  163. onClick: (m) => {
  164. m.stopPropagation(), l(m);
  165. },
  166. onKeydown: (m) => {
  167. [Z.SPACE, Z.ENTER].includes(m.which) && (m.preventDefault(), l(m));
  168. },
  169. onFocus: K
  170. }, [typeof c == "function" ? c() : c]), s.value && g("button", {
  171. type: "button",
  172. "aria-label": C || "remove",
  173. tabindex: 0,
  174. class: `${M}-remove`,
  175. onClick: (m) => {
  176. m.stopPropagation(), n(m);
  177. }
  178. }, [(x == null ? void 0 : x()) || ((v = k.removeIcon) === null || v === void 0 ? void 0 : v.call(k)) || "×"])]);
  179. return w ? w(r) : r;
  180. };
  181. }
  182. }), Ye = {
  183. width: 0,
  184. height: 0,
  185. left: 0,
  186. top: 0
  187. };
  188. function Zt(e, t) {
  189. const a = Q(/* @__PURE__ */ new Map());
  190. return Ce(() => {
  191. var i, o;
  192. const l = /* @__PURE__ */ new Map(), n = e.value, s = t.value.get((i = n[0]) === null || i === void 0 ? void 0 : i.key) || Ye, v = s.left + s.width;
  193. for (let d = 0; d < n.length; d += 1) {
  194. const {
  195. key: p
  196. } = n[d];
  197. let S = t.value.get(p);
  198. S || (S = t.value.get((o = n[d - 1]) === null || o === void 0 ? void 0 : o.key) || Ye);
  199. const h = l.get(p) || T({}, S);
  200. h.right = v - h.left - h.width, l.set(p, h);
  201. }
  202. a.value = new Map(l);
  203. }), a;
  204. }
  205. const lt = ae({
  206. compatConfig: {
  207. MODE: 3
  208. },
  209. name: "AddButton",
  210. inheritAttrs: !1,
  211. props: {
  212. prefixCls: String,
  213. editable: {
  214. type: Object
  215. },
  216. locale: {
  217. type: Object,
  218. default: void 0
  219. }
  220. },
  221. setup(e, t) {
  222. let {
  223. expose: a,
  224. attrs: i
  225. } = t;
  226. const o = Q();
  227. return a({
  228. domRef: o
  229. }), () => {
  230. const {
  231. prefixCls: l,
  232. editable: n,
  233. locale: s
  234. } = e;
  235. return !n || n.showAdd === !1 ? null : g("button", {
  236. ref: o,
  237. type: "button",
  238. class: `${l}-nav-add`,
  239. style: i.style,
  240. "aria-label": (s == null ? void 0 : s.addAriaLabel) || "Add tab",
  241. onClick: (v) => {
  242. n.onEdit("add", {
  243. event: v
  244. });
  245. }
  246. }, [n.addIcon ? n.addIcon() : "+"]);
  247. };
  248. }
  249. }), Qt = {
  250. prefixCls: {
  251. type: String
  252. },
  253. id: {
  254. type: String
  255. },
  256. tabs: {
  257. type: Object
  258. },
  259. rtl: {
  260. type: Boolean
  261. },
  262. tabBarGutter: {
  263. type: Number
  264. },
  265. activeKey: {
  266. type: [String, Number]
  267. },
  268. mobile: {
  269. type: Boolean
  270. },
  271. moreIcon: we.any,
  272. moreTransitionName: {
  273. type: String
  274. },
  275. editable: {
  276. type: Object
  277. },
  278. locale: {
  279. type: Object,
  280. default: void 0
  281. },
  282. removeAriaLabel: String,
  283. onTabClick: {
  284. type: Function
  285. },
  286. popupClassName: String,
  287. getPopupContainer: j()
  288. }, Jt = ae({
  289. compatConfig: {
  290. MODE: 3
  291. },
  292. name: "OperationNode",
  293. inheritAttrs: !1,
  294. props: Qt,
  295. emits: ["tabClick"],
  296. slots: Object,
  297. setup(e, t) {
  298. let {
  299. attrs: a,
  300. slots: i
  301. } = t;
  302. const [o, l] = D(!1), [n, s] = D(null), v = (c) => {
  303. const y = e.tabs.filter((C) => !C.disabled);
  304. let x = y.findIndex((C) => C.key === n.value) || 0;
  305. const w = y.length;
  306. for (let C = 0; C < w; C += 1) {
  307. x = (x + c + w) % w;
  308. const k = y[x];
  309. if (!k.disabled) {
  310. s(k.key);
  311. return;
  312. }
  313. }
  314. }, d = (c) => {
  315. const {
  316. which: y
  317. } = c;
  318. if (!o.value) {
  319. [Z.DOWN, Z.SPACE, Z.ENTER].includes(y) && (l(!0), c.preventDefault());
  320. return;
  321. }
  322. switch (y) {
  323. case Z.UP:
  324. v(-1), c.preventDefault();
  325. break;
  326. case Z.DOWN:
  327. v(1), c.preventDefault();
  328. break;
  329. case Z.ESC:
  330. l(!1);
  331. break;
  332. case Z.SPACE:
  333. case Z.ENTER:
  334. n.value !== null && e.onTabClick(n.value, c);
  335. break;
  336. }
  337. }, p = H(() => `${e.id}-more-popup`), S = H(() => n.value !== null ? `${p.value}-${n.value}` : null), h = (c, y) => {
  338. c.preventDefault(), c.stopPropagation(), e.editable.onEdit("remove", {
  339. key: y,
  340. event: c
  341. });
  342. };
  343. return Te(() => {
  344. ie(n, () => {
  345. const c = document.getElementById(S.value);
  346. c && c.scrollIntoView && c.scrollIntoView(!1);
  347. }, {
  348. flush: "post",
  349. immediate: !0
  350. });
  351. }), ie(o, () => {
  352. o.value || s(null);
  353. }), ht({}), () => {
  354. var c;
  355. const {
  356. prefixCls: y,
  357. id: x,
  358. tabs: w,
  359. locale: C,
  360. mobile: k,
  361. moreIcon: K = ((c = i.moreIcon) === null || c === void 0 ? void 0 : c.call(i)) || g(gt, null, null),
  362. moreTransitionName: M,
  363. editable: r,
  364. tabBarGutter: m,
  365. rtl: u,
  366. onTabClick: $,
  367. popupClassName: E
  368. } = e;
  369. if (!w.length) return null;
  370. const R = `${y}-dropdown`, G = C == null ? void 0 : C.dropdownAriaLabel, re = {
  371. [u ? "marginRight" : "marginLeft"]: m
  372. };
  373. w.length || (re.visibility = "hidden", re.order = 1);
  374. const se = le({
  375. [`${R}-rtl`]: u,
  376. [`${E}`]: !0
  377. }), ce = k ? null : g(mt, {
  378. prefixCls: R,
  379. trigger: ["hover"],
  380. visible: o.value,
  381. transitionName: M,
  382. onVisibleChange: l,
  383. overlayClassName: se,
  384. mouseEnterDelay: 0.1,
  385. mouseLeaveDelay: 0.1,
  386. getPopupContainer: e.getPopupContainer
  387. }, {
  388. overlay: () => g($t, {
  389. onClick: (I) => {
  390. let {
  391. key: J,
  392. domEvent: N
  393. } = I;
  394. $(J, N), l(!1);
  395. },
  396. id: p.value,
  397. tabindex: -1,
  398. role: "listbox",
  399. "aria-activedescendant": S.value,
  400. selectedKeys: [n.value],
  401. "aria-label": G !== void 0 ? G : "expanded dropdown"
  402. }, {
  403. default: () => [w.map((I) => {
  404. var J, N;
  405. const V = r && I.closable !== !1 && !I.disabled;
  406. return g(yt, {
  407. key: I.key,
  408. id: `${p.value}-${I.key}`,
  409. role: "option",
  410. "aria-controls": x && `${x}-panel-${I.key}`,
  411. disabled: I.disabled
  412. }, {
  413. default: () => [g("span", null, [typeof I.tab == "function" ? I.tab() : I.tab]), V && g("button", {
  414. type: "button",
  415. "aria-label": e.removeAriaLabel || "remove",
  416. tabindex: 0,
  417. class: `${R}-menu-item-remove`,
  418. onClick: (Y) => {
  419. Y.stopPropagation(), h(Y, I.key);
  420. }
  421. }, [((J = I.closeIcon) === null || J === void 0 ? void 0 : J.call(I)) || ((N = r.removeIcon) === null || N === void 0 ? void 0 : N.call(r)) || "×"])]
  422. });
  423. })]
  424. }),
  425. default: () => g("button", {
  426. type: "button",
  427. class: `${y}-nav-more`,
  428. style: re,
  429. tabindex: -1,
  430. "aria-hidden": "true",
  431. "aria-haspopup": "listbox",
  432. "aria-controls": p.value,
  433. id: `${x}-more`,
  434. "aria-expanded": o.value,
  435. onKeydown: d
  436. }, [K])
  437. });
  438. return g("div", {
  439. class: le(`${y}-nav-operations`, a.class),
  440. style: a.style
  441. }, [ce, g(lt, {
  442. prefixCls: y,
  443. locale: C,
  444. editable: r
  445. }, null)]);
  446. };
  447. }
  448. }), rt = Symbol("tabsContextKey"), st = (e) => {
  449. kt(rt, e);
  450. }, dt = () => Mt(rt, {
  451. tabs: Q([]),
  452. prefixCls: Q()
  453. });
  454. ae({
  455. compatConfig: {
  456. MODE: 3
  457. },
  458. name: "TabsContextProvider",
  459. inheritAttrs: !1,
  460. props: {
  461. tabs: {
  462. type: Object,
  463. default: void 0
  464. },
  465. prefixCls: {
  466. type: String,
  467. default: void 0
  468. }
  469. },
  470. setup(e, t) {
  471. let {
  472. slots: a
  473. } = t;
  474. return st(Nt(e)), () => {
  475. var i;
  476. return (i = a.default) === null || i === void 0 ? void 0 : i.call(a);
  477. };
  478. }
  479. });
  480. const ea = 0.1, Ue = 0.01, _e = 20, qe = Math.pow(0.995, _e);
  481. function ta(e, t) {
  482. const [a, i] = D(), [o, l] = D(0), [n, s] = D(0), [v, d] = D(), p = Q();
  483. function S(r) {
  484. const {
  485. screenX: m,
  486. screenY: u
  487. } = r.touches[0];
  488. i({
  489. x: m,
  490. y: u
  491. }), clearInterval(p.value);
  492. }
  493. function h(r) {
  494. if (!a.value) return;
  495. r.preventDefault();
  496. const {
  497. screenX: m,
  498. screenY: u
  499. } = r.touches[0], $ = m - a.value.x, E = u - a.value.y;
  500. t($, E), i({
  501. x: m,
  502. y: u
  503. });
  504. const R = Date.now();
  505. s(R - o.value), l(R), d({
  506. x: $,
  507. y: E
  508. });
  509. }
  510. function c() {
  511. if (!a.value) return;
  512. const r = v.value;
  513. if (i(null), d(null), r) {
  514. const m = r.x / n.value, u = r.y / n.value, $ = Math.abs(m), E = Math.abs(u);
  515. if (Math.max($, E) < ea) return;
  516. let R = m, G = u;
  517. p.value = setInterval(() => {
  518. if (Math.abs(R) < Ue && Math.abs(G) < Ue) {
  519. clearInterval(p.value);
  520. return;
  521. }
  522. R *= qe, G *= qe, t(R * _e, G * _e);
  523. }, _e);
  524. }
  525. }
  526. const y = Q();
  527. function x(r) {
  528. const {
  529. deltaX: m,
  530. deltaY: u
  531. } = r;
  532. let $ = 0;
  533. const E = Math.abs(m), R = Math.abs(u);
  534. E === R ? $ = y.value === "x" ? m : u : E > R ? ($ = m, y.value = "x") : ($ = u, y.value = "y"), t(-$, -$) && r.preventDefault();
  535. }
  536. const w = Q({
  537. onTouchStart: S,
  538. onTouchMove: h,
  539. onTouchEnd: c,
  540. onWheel: x
  541. });
  542. function C(r) {
  543. w.value.onTouchStart(r);
  544. }
  545. function k(r) {
  546. w.value.onTouchMove(r);
  547. }
  548. function K(r) {
  549. w.value.onTouchEnd(r);
  550. }
  551. function M(r) {
  552. w.value.onWheel(r);
  553. }
  554. Te(() => {
  555. var r, m;
  556. document.addEventListener("touchmove", k, {
  557. passive: !1
  558. }), document.addEventListener("touchend", K, {
  559. passive: !1
  560. }), (r = e.value) === null || r === void 0 || r.addEventListener("touchstart", C, {
  561. passive: !1
  562. }), (m = e.value) === null || m === void 0 || m.addEventListener("wheel", M, {
  563. passive: !1
  564. });
  565. }), Me(() => {
  566. document.removeEventListener("touchmove", k), document.removeEventListener("touchend", K);
  567. });
  568. }
  569. function Ze(e, t) {
  570. const a = Q(e);
  571. function i(o) {
  572. const l = typeof o == "function" ? o(a.value) : o;
  573. l !== a.value && t(l, a.value), a.value = l;
  574. }
  575. return [a, i];
  576. }
  577. const Qe = {
  578. width: 0,
  579. height: 0,
  580. left: 0,
  581. top: 0,
  582. right: 0
  583. }, aa = () => ({
  584. id: {
  585. type: String
  586. },
  587. tabPosition: {
  588. type: String
  589. },
  590. activeKey: {
  591. type: [String, Number]
  592. },
  593. rtl: {
  594. type: Boolean
  595. },
  596. animated: me(),
  597. editable: me(),
  598. moreIcon: we.any,
  599. moreTransitionName: {
  600. type: String
  601. },
  602. mobile: {
  603. type: Boolean
  604. },
  605. tabBarGutter: {
  606. type: Number
  607. },
  608. renderTabBar: {
  609. type: Function
  610. },
  611. locale: me(),
  612. popupClassName: String,
  613. getPopupContainer: j(),
  614. onTabClick: {
  615. type: Function
  616. },
  617. onTabScroll: {
  618. type: Function
  619. }
  620. }), na = (e, t) => {
  621. const {
  622. offsetWidth: a,
  623. offsetHeight: i,
  624. offsetTop: o,
  625. offsetLeft: l
  626. } = e, {
  627. width: n,
  628. height: s,
  629. x: v,
  630. y: d
  631. } = e.getBoundingClientRect();
  632. return Math.abs(n - a) < 1 ? [n, s, v - t.x, d - t.y] : [a, i, l, o];
  633. }, Je = ae({
  634. compatConfig: {
  635. MODE: 3
  636. },
  637. name: "TabNavList",
  638. inheritAttrs: !1,
  639. props: aa(),
  640. slots: Object,
  641. emits: ["tabClick", "tabScroll"],
  642. setup(e, t) {
  643. let {
  644. attrs: a,
  645. slots: i
  646. } = t;
  647. const {
  648. tabs: o,
  649. prefixCls: l
  650. } = dt(), n = W(), s = W(), v = W(), d = W(), [p, S] = Ot(), h = H(() => e.tabPosition === "top" || e.tabPosition === "bottom"), [c, y] = Ze(0, (f, b) => {
  651. h.value && e.onTabScroll && e.onTabScroll({
  652. direction: f > b ? "left" : "right"
  653. });
  654. }), [x, w] = Ze(0, (f, b) => {
  655. !h.value && e.onTabScroll && e.onTabScroll({
  656. direction: f > b ? "top" : "bottom"
  657. });
  658. }), [C, k] = D(0), [K, M] = D(0), [r, m] = D(null), [u, $] = D(null), [E, R] = D(0), [G, re] = D(0), [se, ce] = Ut(/* @__PURE__ */ new Map()), I = Zt(o, se), J = H(() => `${l.value}-nav-operations-hidden`), N = W(0), V = W(0);
  659. Ce(() => {
  660. h.value ? e.rtl ? (N.value = 0, V.value = Math.max(0, C.value - r.value)) : (N.value = Math.min(0, r.value - C.value), V.value = 0) : (N.value = Math.min(0, u.value - K.value), V.value = 0);
  661. });
  662. const Y = (f) => f < N.value ? N.value : f > V.value ? V.value : f, ue = W(), [z, ve] = D(), be = () => {
  663. ve(Date.now());
  664. }, pe = () => {
  665. clearTimeout(ue.value);
  666. }, $e = (f, b) => {
  667. f((_) => Y(_ + b));
  668. };
  669. ta(n, (f, b) => {
  670. if (h.value) {
  671. if (r.value >= C.value)
  672. return !1;
  673. $e(y, f);
  674. } else {
  675. if (u.value >= K.value)
  676. return !1;
  677. $e(w, b);
  678. }
  679. return pe(), be(), !0;
  680. }), ie(z, () => {
  681. pe(), z.value && (ue.value = setTimeout(() => {
  682. ve(0);
  683. }, 100));
  684. });
  685. const de = function() {
  686. let f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : e.activeKey;
  687. const b = I.value.get(f) || {
  688. width: 0,
  689. height: 0,
  690. left: 0,
  691. right: 0,
  692. top: 0
  693. };
  694. if (h.value) {
  695. let _ = c.value;
  696. e.rtl ? b.right < c.value ? _ = b.right : b.right + b.width > c.value + r.value && (_ = b.right + b.width - r.value) : b.left < -c.value ? _ = -b.left : b.left + b.width > -c.value + r.value && (_ = -(b.left + b.width - r.value)), w(0), y(Y(_));
  697. } else {
  698. let _ = x.value;
  699. b.top < -x.value ? _ = -b.top : b.top + b.height > -x.value + u.value && (_ = -(b.top + b.height - u.value)), y(0), w(Y(_));
  700. }
  701. }, Pe = W(0), Re = W(0);
  702. Ce(() => {
  703. let f, b, _, P, L, B;
  704. const U = I.value;
  705. ["top", "bottom"].includes(e.tabPosition) ? (f = "width", P = r.value, L = C.value, B = E.value, b = e.rtl ? "right" : "left", _ = Math.abs(c.value)) : (f = "height", P = u.value, L = C.value, B = G.value, b = "top", _ = -x.value);
  706. let O = P;
  707. L + B > P && L < P && (O = P - B);
  708. const F = o.value;
  709. if (!F.length)
  710. return [Pe.value, Re.value] = [0, 0];
  711. const q = F.length;
  712. let oe = q;
  713. for (let X = 0; X < q; X += 1) {
  714. const ee = U.get(F[X].key) || Qe;
  715. if (ee[b] + ee[f] > _ + O) {
  716. oe = X - 1;
  717. break;
  718. }
  719. }
  720. let A = 0;
  721. for (let X = q - 1; X >= 0; X -= 1)
  722. if ((U.get(F[X].key) || Qe)[b] < _) {
  723. A = X + 1;
  724. break;
  725. }
  726. return [Pe.value, Re.value] = [A, oe];
  727. });
  728. const Ne = () => {
  729. ce(() => {
  730. var f;
  731. const b = /* @__PURE__ */ new Map(), _ = (f = s.value) === null || f === void 0 ? void 0 : f.getBoundingClientRect();
  732. return o.value.forEach((P) => {
  733. let {
  734. key: L
  735. } = P;
  736. const B = S.value.get(L), U = (B == null ? void 0 : B.$el) || B;
  737. if (U) {
  738. const [O, F, q, oe] = na(U, _);
  739. b.set(L, {
  740. width: O,
  741. height: F,
  742. left: q,
  743. top: oe
  744. });
  745. }
  746. }), b;
  747. });
  748. };
  749. ie(() => o.value.map((f) => f.key).join("%%"), () => {
  750. Ne();
  751. }, {
  752. flush: "post"
  753. });
  754. const Ie = () => {
  755. var f, b, _, P, L;
  756. const B = ((f = n.value) === null || f === void 0 ? void 0 : f.offsetWidth) || 0, U = ((b = n.value) === null || b === void 0 ? void 0 : b.offsetHeight) || 0, O = ((_ = d.value) === null || _ === void 0 ? void 0 : _.$el) || {}, F = O.offsetWidth || 0, q = O.offsetHeight || 0;
  757. m(B), $(U), R(F), re(q);
  758. const oe = (((P = s.value) === null || P === void 0 ? void 0 : P.offsetWidth) || 0) - F, A = (((L = s.value) === null || L === void 0 ? void 0 : L.offsetHeight) || 0) - q;
  759. k(oe), M(A), Ne();
  760. }, Oe = H(() => [...o.value.slice(0, Pe.value), ...o.value.slice(Re.value + 1)]), [ut, vt] = D(), ne = H(() => I.value.get(e.activeKey)), We = W(), He = () => {
  761. ge.cancel(We.value);
  762. };
  763. ie([ne, h, () => e.rtl], () => {
  764. const f = {};
  765. ne.value && (h.value ? (e.rtl ? f.right = he(ne.value.right) : f.left = he(ne.value.left), f.width = he(ne.value.width)) : (f.top = he(ne.value.top), f.height = he(ne.value.height))), He(), We.value = ge(() => {
  766. vt(f);
  767. });
  768. }), ie([() => e.activeKey, ne, I, h], () => {
  769. de();
  770. }, {
  771. flush: "post"
  772. }), ie([() => e.rtl, () => e.tabBarGutter, () => e.activeKey, () => o.value], () => {
  773. Ie();
  774. }, {
  775. flush: "post"
  776. });
  777. const Ee = (f) => {
  778. let {
  779. position: b,
  780. prefixCls: _,
  781. extra: P
  782. } = f;
  783. if (!P) return null;
  784. const L = P == null ? void 0 : P({
  785. position: b
  786. });
  787. return L ? g("div", {
  788. class: `${_}-extra-content`
  789. }, [L]) : null;
  790. };
  791. return Me(() => {
  792. pe(), He();
  793. }), () => {
  794. const {
  795. id: f,
  796. animated: b,
  797. activeKey: _,
  798. rtl: P,
  799. editable: L,
  800. locale: B,
  801. tabPosition: U,
  802. tabBarGutter: O,
  803. onTabClick: F
  804. } = e, {
  805. class: q,
  806. style: oe
  807. } = a, A = l.value, X = !!Oe.value.length, ee = `${A}-nav-wrap`;
  808. let Be, Le, ze, Ke;
  809. h.value ? P ? (Le = c.value > 0, Be = c.value + r.value < C.value) : (Be = c.value < 0, Le = -c.value + r.value < C.value) : (ze = x.value < 0, Ke = -x.value + u.value < K.value);
  810. const ye = {};
  811. U === "top" || U === "bottom" ? ye[P ? "marginRight" : "marginLeft"] = typeof O == "number" ? `${O}px` : O : ye.marginTop = typeof O == "number" ? `${O}px` : O;
  812. const Ge = o.value.map((Ae, bt) => {
  813. const {
  814. key: fe
  815. } = Ae;
  816. return g(qt, {
  817. id: f,
  818. prefixCls: A,
  819. key: fe,
  820. tab: Ae,
  821. style: bt === 0 ? void 0 : ye,
  822. closable: Ae.closable,
  823. editable: L,
  824. active: fe === _,
  825. removeAriaLabel: B == null ? void 0 : B.removeAriaLabel,
  826. ref: p(fe),
  827. onClick: (pt) => {
  828. F(fe, pt);
  829. },
  830. onFocus: () => {
  831. de(fe), be(), n.value && (P || (n.value.scrollLeft = 0), n.value.scrollTop = 0);
  832. }
  833. }, i);
  834. });
  835. return g("div", {
  836. role: "tablist",
  837. class: le(`${A}-nav`, q),
  838. style: oe,
  839. onKeydown: () => {
  840. be();
  841. }
  842. }, [g(Ee, {
  843. position: "left",
  844. prefixCls: A,
  845. extra: i.leftExtra
  846. }, null), g(Fe, {
  847. onResize: Ie
  848. }, {
  849. default: () => [g("div", {
  850. class: le(ee, {
  851. [`${ee}-ping-left`]: Be,
  852. [`${ee}-ping-right`]: Le,
  853. [`${ee}-ping-top`]: ze,
  854. [`${ee}-ping-bottom`]: Ke
  855. }),
  856. ref: n
  857. }, [g(Fe, {
  858. onResize: Ie
  859. }, {
  860. default: () => [g("div", {
  861. ref: s,
  862. class: `${A}-nav-list`,
  863. style: {
  864. transform: `translate(${c.value}px, ${x.value}px)`,
  865. transition: z.value ? "none" : void 0
  866. }
  867. }, [Ge, g(lt, {
  868. ref: d,
  869. prefixCls: A,
  870. locale: B,
  871. editable: L,
  872. style: T(T({}, Ge.length === 0 ? void 0 : ye), {
  873. visibility: X ? "hidden" : null
  874. })
  875. }, null), g("div", {
  876. class: le(`${A}-ink-bar`, {
  877. [`${A}-ink-bar-animated`]: b.inkBar
  878. }),
  879. style: ut.value
  880. }, null)])]
  881. })])]
  882. }), g(Jt, te(te({}, e), {}, {
  883. removeAriaLabel: B == null ? void 0 : B.removeAriaLabel,
  884. ref: v,
  885. prefixCls: A,
  886. tabs: Oe.value,
  887. class: !X && J.value
  888. }), it(i, ["moreIcon"])), g(Ee, {
  889. position: "right",
  890. prefixCls: A,
  891. extra: i.rightExtra
  892. }, null), g(Ee, {
  893. position: "right",
  894. prefixCls: A,
  895. extra: i.tabBarExtraContent
  896. }, null)]);
  897. };
  898. }
  899. }), oa = ae({
  900. compatConfig: {
  901. MODE: 3
  902. },
  903. name: "TabPanelList",
  904. inheritAttrs: !1,
  905. props: {
  906. activeKey: {
  907. type: [String, Number]
  908. },
  909. id: {
  910. type: String
  911. },
  912. rtl: {
  913. type: Boolean
  914. },
  915. animated: {
  916. type: Object,
  917. default: void 0
  918. },
  919. tabPosition: {
  920. type: String
  921. },
  922. destroyInactiveTabPane: {
  923. type: Boolean
  924. }
  925. },
  926. setup(e) {
  927. const {
  928. tabs: t,
  929. prefixCls: a
  930. } = dt();
  931. return () => {
  932. const {
  933. id: i,
  934. activeKey: o,
  935. animated: l,
  936. tabPosition: n,
  937. rtl: s,
  938. destroyInactiveTabPane: v
  939. } = e, d = l.tabPane, p = a.value, S = t.value.findIndex((h) => h.key === o);
  940. return g("div", {
  941. class: `${p}-content-holder`
  942. }, [g("div", {
  943. class: [`${p}-content`, `${p}-content-${n}`, {
  944. [`${p}-content-animated`]: d
  945. }],
  946. style: S && d ? {
  947. [s ? "marginRight" : "marginLeft"]: `-${S}00%`
  948. } : null
  949. }, [t.value.map((h) => xt(h.node, {
  950. key: h.key,
  951. prefixCls: p,
  952. tabKey: h.key,
  953. id: i,
  954. animated: d,
  955. active: h.key === o,
  956. destroyInactiveTabPane: v
  957. }))])]);
  958. };
  959. }
  960. }), ia = (e) => {
  961. const {
  962. componentCls: t,
  963. motionDurationSlow: a
  964. } = e;
  965. return [
  966. {
  967. [t]: {
  968. [`${t}-switch`]: {
  969. "&-appear, &-enter": {
  970. transition: "none",
  971. "&-start": {
  972. opacity: 0
  973. },
  974. "&-active": {
  975. opacity: 1,
  976. transition: `opacity ${a}`
  977. }
  978. },
  979. "&-leave": {
  980. position: "absolute",
  981. transition: "none",
  982. inset: 0,
  983. "&-start": {
  984. opacity: 1
  985. },
  986. "&-active": {
  987. opacity: 0,
  988. transition: `opacity ${a}`
  989. }
  990. }
  991. }
  992. }
  993. },
  994. // Follow code may reuse in other components
  995. [je(e, "slide-up"), je(e, "slide-down")]
  996. ];
  997. }, la = (e) => {
  998. const {
  999. componentCls: t,
  1000. tabsCardHorizontalPadding: a,
  1001. tabsCardHeadBackground: i,
  1002. tabsCardGutter: o,
  1003. colorSplit: l
  1004. } = e;
  1005. return {
  1006. [`${t}-card`]: {
  1007. [`> ${t}-nav, > div > ${t}-nav`]: {
  1008. [`${t}-tab`]: {
  1009. margin: 0,
  1010. padding: a,
  1011. background: i,
  1012. border: `${e.lineWidth}px ${e.lineType} ${l}`,
  1013. transition: `all ${e.motionDurationSlow} ${e.motionEaseInOut}`
  1014. },
  1015. [`${t}-tab-active`]: {
  1016. color: e.colorPrimary,
  1017. background: e.colorBgContainer
  1018. },
  1019. [`${t}-ink-bar`]: {
  1020. visibility: "hidden"
  1021. }
  1022. },
  1023. // ========================== Top & Bottom ==========================
  1024. [`&${t}-top, &${t}-bottom`]: {
  1025. [`> ${t}-nav, > div > ${t}-nav`]: {
  1026. [`${t}-tab + ${t}-tab`]: {
  1027. marginLeft: {
  1028. _skip_check_: !0,
  1029. value: `${o}px`
  1030. }
  1031. }
  1032. }
  1033. },
  1034. [`&${t}-top`]: {
  1035. [`> ${t}-nav, > div > ${t}-nav`]: {
  1036. [`${t}-tab`]: {
  1037. borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`
  1038. },
  1039. [`${t}-tab-active`]: {
  1040. borderBottomColor: e.colorBgContainer
  1041. }
  1042. }
  1043. },
  1044. [`&${t}-bottom`]: {
  1045. [`> ${t}-nav, > div > ${t}-nav`]: {
  1046. [`${t}-tab`]: {
  1047. borderRadius: `0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`
  1048. },
  1049. [`${t}-tab-active`]: {
  1050. borderTopColor: e.colorBgContainer
  1051. }
  1052. }
  1053. },
  1054. // ========================== Left & Right ==========================
  1055. [`&${t}-left, &${t}-right`]: {
  1056. [`> ${t}-nav, > div > ${t}-nav`]: {
  1057. [`${t}-tab + ${t}-tab`]: {
  1058. marginTop: `${o}px`
  1059. }
  1060. }
  1061. },
  1062. [`&${t}-left`]: {
  1063. [`> ${t}-nav, > div > ${t}-nav`]: {
  1064. [`${t}-tab`]: {
  1065. borderRadius: {
  1066. _skip_check_: !0,
  1067. value: `${e.borderRadiusLG}px 0 0 ${e.borderRadiusLG}px`
  1068. }
  1069. },
  1070. [`${t}-tab-active`]: {
  1071. borderRightColor: {
  1072. _skip_check_: !0,
  1073. value: e.colorBgContainer
  1074. }
  1075. }
  1076. }
  1077. },
  1078. [`&${t}-right`]: {
  1079. [`> ${t}-nav, > div > ${t}-nav`]: {
  1080. [`${t}-tab`]: {
  1081. borderRadius: {
  1082. _skip_check_: !0,
  1083. value: `0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px 0`
  1084. }
  1085. },
  1086. [`${t}-tab-active`]: {
  1087. borderLeftColor: {
  1088. _skip_check_: !0,
  1089. value: e.colorBgContainer
  1090. }
  1091. }
  1092. }
  1093. }
  1094. }
  1095. };
  1096. }, ra = (e) => {
  1097. const {
  1098. componentCls: t,
  1099. tabsHoverColor: a,
  1100. dropdownEdgeChildVerticalPadding: i
  1101. } = e;
  1102. return {
  1103. [`${t}-dropdown`]: T(T({}, tt(e)), {
  1104. position: "absolute",
  1105. top: -9999,
  1106. left: {
  1107. _skip_check_: !0,
  1108. value: -9999
  1109. },
  1110. zIndex: e.zIndexPopup,
  1111. display: "block",
  1112. "&-hidden": {
  1113. display: "none"
  1114. },
  1115. [`${t}-dropdown-menu`]: {
  1116. maxHeight: e.tabsDropdownHeight,
  1117. margin: 0,
  1118. padding: `${i}px 0`,
  1119. overflowX: "hidden",
  1120. overflowY: "auto",
  1121. textAlign: {
  1122. _skip_check_: !0,
  1123. value: "left"
  1124. },
  1125. listStyleType: "none",
  1126. backgroundColor: e.colorBgContainer,
  1127. backgroundClip: "padding-box",
  1128. borderRadius: e.borderRadiusLG,
  1129. outline: "none",
  1130. boxShadow: e.boxShadowSecondary,
  1131. "&-item": T(T({}, Ct), {
  1132. display: "flex",
  1133. alignItems: "center",
  1134. minWidth: e.tabsDropdownWidth,
  1135. margin: 0,
  1136. padding: `${e.paddingXXS}px ${e.paddingSM}px`,
  1137. color: e.colorText,
  1138. fontWeight: "normal",
  1139. fontSize: e.fontSize,
  1140. lineHeight: e.lineHeight,
  1141. cursor: "pointer",
  1142. transition: `all ${e.motionDurationSlow}`,
  1143. "> span": {
  1144. flex: 1,
  1145. whiteSpace: "nowrap"
  1146. },
  1147. "&-remove": {
  1148. flex: "none",
  1149. marginLeft: {
  1150. _skip_check_: !0,
  1151. value: e.marginSM
  1152. },
  1153. color: e.colorTextDescription,
  1154. fontSize: e.fontSizeSM,
  1155. background: "transparent",
  1156. border: 0,
  1157. cursor: "pointer",
  1158. "&:hover": {
  1159. color: a
  1160. }
  1161. },
  1162. "&:hover": {
  1163. background: e.controlItemBgHover
  1164. },
  1165. "&-disabled": {
  1166. "&, &:hover": {
  1167. color: e.colorTextDisabled,
  1168. background: "transparent",
  1169. cursor: "not-allowed"
  1170. }
  1171. }
  1172. })
  1173. }
  1174. })
  1175. };
  1176. }, sa = (e) => {
  1177. const {
  1178. componentCls: t,
  1179. margin: a,
  1180. colorSplit: i
  1181. } = e;
  1182. return {
  1183. // ========================== Top & Bottom ==========================
  1184. [`${t}-top, ${t}-bottom`]: {
  1185. flexDirection: "column",
  1186. [`> ${t}-nav, > div > ${t}-nav`]: {
  1187. margin: `0 0 ${a}px 0`,
  1188. "&::before": {
  1189. position: "absolute",
  1190. right: {
  1191. _skip_check_: !0,
  1192. value: 0
  1193. },
  1194. left: {
  1195. _skip_check_: !0,
  1196. value: 0
  1197. },
  1198. borderBottom: `${e.lineWidth}px ${e.lineType} ${i}`,
  1199. content: "''"
  1200. },
  1201. [`${t}-ink-bar`]: {
  1202. height: e.lineWidthBold,
  1203. "&-animated": {
  1204. transition: `width ${e.motionDurationSlow}, left ${e.motionDurationSlow},
  1205. right ${e.motionDurationSlow}`
  1206. }
  1207. },
  1208. [`${t}-nav-wrap`]: {
  1209. "&::before, &::after": {
  1210. top: 0,
  1211. bottom: 0,
  1212. width: e.controlHeight
  1213. },
  1214. "&::before": {
  1215. left: {
  1216. _skip_check_: !0,
  1217. value: 0
  1218. },
  1219. boxShadow: e.boxShadowTabsOverflowLeft
  1220. },
  1221. "&::after": {
  1222. right: {
  1223. _skip_check_: !0,
  1224. value: 0
  1225. },
  1226. boxShadow: e.boxShadowTabsOverflowRight
  1227. },
  1228. [`&${t}-nav-wrap-ping-left::before`]: {
  1229. opacity: 1
  1230. },
  1231. [`&${t}-nav-wrap-ping-right::after`]: {
  1232. opacity: 1
  1233. }
  1234. }
  1235. }
  1236. },
  1237. [`${t}-top`]: {
  1238. [`> ${t}-nav,
  1239. > div > ${t}-nav`]: {
  1240. "&::before": {
  1241. bottom: 0
  1242. },
  1243. [`${t}-ink-bar`]: {
  1244. bottom: 0
  1245. }
  1246. }
  1247. },
  1248. [`${t}-bottom`]: {
  1249. [`> ${t}-nav, > div > ${t}-nav`]: {
  1250. order: 1,
  1251. marginTop: `${a}px`,
  1252. marginBottom: 0,
  1253. "&::before": {
  1254. top: 0
  1255. },
  1256. [`${t}-ink-bar`]: {
  1257. top: 0
  1258. }
  1259. },
  1260. [`> ${t}-content-holder, > div > ${t}-content-holder`]: {
  1261. order: 0
  1262. }
  1263. },
  1264. // ========================== Left & Right ==========================
  1265. [`${t}-left, ${t}-right`]: {
  1266. [`> ${t}-nav, > div > ${t}-nav`]: {
  1267. flexDirection: "column",
  1268. minWidth: e.controlHeight * 1.25,
  1269. // >>>>>>>>>>> Tab
  1270. [`${t}-tab`]: {
  1271. padding: `${e.paddingXS}px ${e.paddingLG}px`,
  1272. textAlign: "center"
  1273. },
  1274. [`${t}-tab + ${t}-tab`]: {
  1275. margin: `${e.margin}px 0 0 0`
  1276. },
  1277. // >>>>>>>>>>> Nav
  1278. [`${t}-nav-wrap`]: {
  1279. flexDirection: "column",
  1280. "&::before, &::after": {
  1281. right: {
  1282. _skip_check_: !0,
  1283. value: 0
  1284. },
  1285. left: {
  1286. _skip_check_: !0,
  1287. value: 0
  1288. },
  1289. height: e.controlHeight
  1290. },
  1291. "&::before": {
  1292. top: 0,
  1293. boxShadow: e.boxShadowTabsOverflowTop
  1294. },
  1295. "&::after": {
  1296. bottom: 0,
  1297. boxShadow: e.boxShadowTabsOverflowBottom
  1298. },
  1299. [`&${t}-nav-wrap-ping-top::before`]: {
  1300. opacity: 1
  1301. },
  1302. [`&${t}-nav-wrap-ping-bottom::after`]: {
  1303. opacity: 1
  1304. }
  1305. },
  1306. // >>>>>>>>>>> Ink Bar
  1307. [`${t}-ink-bar`]: {
  1308. width: e.lineWidthBold,
  1309. "&-animated": {
  1310. transition: `height ${e.motionDurationSlow}, top ${e.motionDurationSlow}`
  1311. }
  1312. },
  1313. [`${t}-nav-list, ${t}-nav-operations`]: {
  1314. flex: "1 0 auto",
  1315. flexDirection: "column"
  1316. }
  1317. }
  1318. },
  1319. [`${t}-left`]: {
  1320. [`> ${t}-nav, > div > ${t}-nav`]: {
  1321. [`${t}-ink-bar`]: {
  1322. right: {
  1323. _skip_check_: !0,
  1324. value: 0
  1325. }
  1326. }
  1327. },
  1328. [`> ${t}-content-holder, > div > ${t}-content-holder`]: {
  1329. marginLeft: {
  1330. _skip_check_: !0,
  1331. value: `-${e.lineWidth}px`
  1332. },
  1333. borderLeft: {
  1334. _skip_check_: !0,
  1335. value: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`
  1336. },
  1337. [`> ${t}-content > ${t}-tabpane`]: {
  1338. paddingLeft: {
  1339. _skip_check_: !0,
  1340. value: e.paddingLG
  1341. }
  1342. }
  1343. }
  1344. },
  1345. [`${t}-right`]: {
  1346. [`> ${t}-nav, > div > ${t}-nav`]: {
  1347. order: 1,
  1348. [`${t}-ink-bar`]: {
  1349. left: {
  1350. _skip_check_: !0,
  1351. value: 0
  1352. }
  1353. }
  1354. },
  1355. [`> ${t}-content-holder, > div > ${t}-content-holder`]: {
  1356. order: 0,
  1357. marginRight: {
  1358. _skip_check_: !0,
  1359. value: -e.lineWidth
  1360. },
  1361. borderRight: {
  1362. _skip_check_: !0,
  1363. value: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`
  1364. },
  1365. [`> ${t}-content > ${t}-tabpane`]: {
  1366. paddingRight: {
  1367. _skip_check_: !0,
  1368. value: e.paddingLG
  1369. }
  1370. }
  1371. }
  1372. }
  1373. };
  1374. }, da = (e) => {
  1375. const {
  1376. componentCls: t,
  1377. padding: a
  1378. } = e;
  1379. return {
  1380. [t]: {
  1381. "&-small": {
  1382. [`> ${t}-nav`]: {
  1383. [`${t}-tab`]: {
  1384. padding: `${e.paddingXS}px 0`,
  1385. fontSize: e.fontSize
  1386. }
  1387. }
  1388. },
  1389. "&-large": {
  1390. [`> ${t}-nav`]: {
  1391. [`${t}-tab`]: {
  1392. padding: `${a}px 0`,
  1393. fontSize: e.fontSizeLG
  1394. }
  1395. }
  1396. }
  1397. },
  1398. [`${t}-card`]: {
  1399. [`&${t}-small`]: {
  1400. [`> ${t}-nav`]: {
  1401. [`${t}-tab`]: {
  1402. padding: `${e.paddingXXS * 1.5}px ${a}px`
  1403. }
  1404. },
  1405. [`&${t}-bottom`]: {
  1406. [`> ${t}-nav ${t}-tab`]: {
  1407. borderRadius: `0 0 ${e.borderRadius}px ${e.borderRadius}px`
  1408. }
  1409. },
  1410. [`&${t}-top`]: {
  1411. [`> ${t}-nav ${t}-tab`]: {
  1412. borderRadius: `${e.borderRadius}px ${e.borderRadius}px 0 0`
  1413. }
  1414. },
  1415. [`&${t}-right`]: {
  1416. [`> ${t}-nav ${t}-tab`]: {
  1417. borderRadius: {
  1418. _skip_check_: !0,
  1419. value: `0 ${e.borderRadius}px ${e.borderRadius}px 0`
  1420. }
  1421. }
  1422. },
  1423. [`&${t}-left`]: {
  1424. [`> ${t}-nav ${t}-tab`]: {
  1425. borderRadius: {
  1426. _skip_check_: !0,
  1427. value: `${e.borderRadius}px 0 0 ${e.borderRadius}px`
  1428. }
  1429. }
  1430. }
  1431. },
  1432. [`&${t}-large`]: {
  1433. [`> ${t}-nav`]: {
  1434. [`${t}-tab`]: {
  1435. padding: `${e.paddingXS}px ${a}px ${e.paddingXXS * 1.5}px`
  1436. }
  1437. }
  1438. }
  1439. }
  1440. };
  1441. }, ca = (e) => {
  1442. const {
  1443. componentCls: t,
  1444. tabsActiveColor: a,
  1445. tabsHoverColor: i,
  1446. iconCls: o,
  1447. tabsHorizontalGutter: l
  1448. } = e, n = `${t}-tab`;
  1449. return {
  1450. [n]: {
  1451. position: "relative",
  1452. display: "inline-flex",
  1453. alignItems: "center",
  1454. padding: `${e.paddingSM}px 0`,
  1455. fontSize: `${e.fontSize}px`,
  1456. background: "transparent",
  1457. border: 0,
  1458. outline: "none",
  1459. cursor: "pointer",
  1460. "&-btn, &-remove": T({
  1461. "&:focus:not(:focus-visible), &:active": {
  1462. color: a
  1463. }
  1464. }, at(e)),
  1465. "&-btn": {
  1466. outline: "none",
  1467. transition: "all 0.3s"
  1468. },
  1469. "&-remove": {
  1470. flex: "none",
  1471. marginRight: {
  1472. _skip_check_: !0,
  1473. value: -e.marginXXS
  1474. },
  1475. marginLeft: {
  1476. _skip_check_: !0,
  1477. value: e.marginXS
  1478. },
  1479. color: e.colorTextDescription,
  1480. fontSize: e.fontSizeSM,
  1481. background: "transparent",
  1482. border: "none",
  1483. outline: "none",
  1484. cursor: "pointer",
  1485. transition: `all ${e.motionDurationSlow}`,
  1486. "&:hover": {
  1487. color: e.colorTextHeading
  1488. }
  1489. },
  1490. "&:hover": {
  1491. color: i
  1492. },
  1493. [`&${n}-active ${n}-btn`]: {
  1494. color: e.colorPrimary,
  1495. textShadow: e.tabsActiveTextShadow
  1496. },
  1497. [`&${n}-disabled`]: {
  1498. color: e.colorTextDisabled,
  1499. cursor: "not-allowed"
  1500. },
  1501. [`&${n}-disabled ${n}-btn, &${n}-disabled ${t}-remove`]: {
  1502. "&:focus, &:active": {
  1503. color: e.colorTextDisabled
  1504. }
  1505. },
  1506. [`& ${n}-remove ${o}`]: {
  1507. margin: 0
  1508. },
  1509. [o]: {
  1510. marginRight: {
  1511. _skip_check_: !0,
  1512. value: e.marginSM
  1513. }
  1514. }
  1515. },
  1516. [`${n} + ${n}`]: {
  1517. margin: {
  1518. _skip_check_: !0,
  1519. value: `0 0 0 ${l}px`
  1520. }
  1521. }
  1522. };
  1523. }, ua = (e) => {
  1524. const {
  1525. componentCls: t,
  1526. tabsHorizontalGutter: a,
  1527. iconCls: i,
  1528. tabsCardGutter: o
  1529. } = e;
  1530. return {
  1531. [`${t}-rtl`]: {
  1532. direction: "rtl",
  1533. [`${t}-nav`]: {
  1534. [`${t}-tab`]: {
  1535. margin: {
  1536. _skip_check_: !0,
  1537. value: `0 0 0 ${a}px`
  1538. },
  1539. [`${t}-tab:last-of-type`]: {
  1540. marginLeft: {
  1541. _skip_check_: !0,
  1542. value: 0
  1543. }
  1544. },
  1545. [i]: {
  1546. marginRight: {
  1547. _skip_check_: !0,
  1548. value: 0
  1549. },
  1550. marginLeft: {
  1551. _skip_check_: !0,
  1552. value: `${e.marginSM}px`
  1553. }
  1554. },
  1555. [`${t}-tab-remove`]: {
  1556. marginRight: {
  1557. _skip_check_: !0,
  1558. value: `${e.marginXS}px`
  1559. },
  1560. marginLeft: {
  1561. _skip_check_: !0,
  1562. value: `-${e.marginXXS}px`
  1563. },
  1564. [i]: {
  1565. margin: 0
  1566. }
  1567. }
  1568. }
  1569. },
  1570. [`&${t}-left`]: {
  1571. [`> ${t}-nav`]: {
  1572. order: 1
  1573. },
  1574. [`> ${t}-content-holder`]: {
  1575. order: 0
  1576. }
  1577. },
  1578. [`&${t}-right`]: {
  1579. [`> ${t}-nav`]: {
  1580. order: 0
  1581. },
  1582. [`> ${t}-content-holder`]: {
  1583. order: 1
  1584. }
  1585. },
  1586. // ====================== Card ======================
  1587. [`&${t}-card${t}-top, &${t}-card${t}-bottom`]: {
  1588. [`> ${t}-nav, > div > ${t}-nav`]: {
  1589. [`${t}-tab + ${t}-tab`]: {
  1590. marginRight: {
  1591. _skip_check_: !0,
  1592. value: `${o}px`
  1593. },
  1594. marginLeft: {
  1595. _skip_check_: !0,
  1596. value: 0
  1597. }
  1598. }
  1599. }
  1600. }
  1601. },
  1602. [`${t}-dropdown-rtl`]: {
  1603. direction: "rtl"
  1604. },
  1605. [`${t}-menu-item`]: {
  1606. [`${t}-dropdown-rtl`]: {
  1607. textAlign: {
  1608. _skip_check_: !0,
  1609. value: "right"
  1610. }
  1611. }
  1612. }
  1613. };
  1614. }, va = (e) => {
  1615. const {
  1616. componentCls: t,
  1617. tabsCardHorizontalPadding: a,
  1618. tabsCardHeight: i,
  1619. tabsCardGutter: o,
  1620. tabsHoverColor: l,
  1621. tabsActiveColor: n,
  1622. colorSplit: s
  1623. } = e;
  1624. return {
  1625. [t]: T(T(T(T({}, tt(e)), {
  1626. display: "flex",
  1627. // ========================== Navigation ==========================
  1628. [`> ${t}-nav, > div > ${t}-nav`]: {
  1629. position: "relative",
  1630. display: "flex",
  1631. flex: "none",
  1632. alignItems: "center",
  1633. [`${t}-nav-wrap`]: {
  1634. position: "relative",
  1635. display: "flex",
  1636. flex: "auto",
  1637. alignSelf: "stretch",
  1638. overflow: "hidden",
  1639. whiteSpace: "nowrap",
  1640. transform: "translate(0)",
  1641. // >>>>> Ping shadow
  1642. "&::before, &::after": {
  1643. position: "absolute",
  1644. zIndex: 1,
  1645. opacity: 0,
  1646. transition: `opacity ${e.motionDurationSlow}`,
  1647. content: "''",
  1648. pointerEvents: "none"
  1649. }
  1650. },
  1651. [`${t}-nav-list`]: {
  1652. position: "relative",
  1653. display: "flex",
  1654. transition: `opacity ${e.motionDurationSlow}`
  1655. },
  1656. // >>>>>>>> Operations
  1657. [`${t}-nav-operations`]: {
  1658. display: "flex",
  1659. alignSelf: "stretch"
  1660. },
  1661. [`${t}-nav-operations-hidden`]: {
  1662. position: "absolute",
  1663. visibility: "hidden",
  1664. pointerEvents: "none"
  1665. },
  1666. [`${t}-nav-more`]: {
  1667. position: "relative",
  1668. padding: a,
  1669. background: "transparent",
  1670. border: 0,
  1671. "&::after": {
  1672. position: "absolute",
  1673. right: {
  1674. _skip_check_: !0,
  1675. value: 0
  1676. },
  1677. bottom: 0,
  1678. left: {
  1679. _skip_check_: !0,
  1680. value: 0
  1681. },
  1682. height: e.controlHeightLG / 8,
  1683. transform: "translateY(100%)",
  1684. content: "''"
  1685. }
  1686. },
  1687. [`${t}-nav-add`]: T({
  1688. minWidth: `${i}px`,
  1689. marginLeft: {
  1690. _skip_check_: !0,
  1691. value: `${o}px`
  1692. },
  1693. padding: `0 ${e.paddingXS}px`,
  1694. background: "transparent",
  1695. border: `${e.lineWidth}px ${e.lineType} ${s}`,
  1696. borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,
  1697. outline: "none",
  1698. cursor: "pointer",
  1699. color: e.colorText,
  1700. transition: `all ${e.motionDurationSlow} ${e.motionEaseInOut}`,
  1701. "&:hover": {
  1702. color: l
  1703. },
  1704. "&:active, &:focus:not(:focus-visible)": {
  1705. color: n
  1706. }
  1707. }, at(e))
  1708. },
  1709. [`${t}-extra-content`]: {
  1710. flex: "none"
  1711. },
  1712. // ============================ InkBar ============================
  1713. [`${t}-ink-bar`]: {
  1714. position: "absolute",
  1715. background: e.colorPrimary,
  1716. pointerEvents: "none"
  1717. }
  1718. }), ca(e)), {
  1719. // =========================== TabPanes ===========================
  1720. [`${t}-content`]: {
  1721. position: "relative",
  1722. display: "flex",
  1723. width: "100%",
  1724. "&-animated": {
  1725. transition: "margin 0.3s"
  1726. }
  1727. },
  1728. [`${t}-content-holder`]: {
  1729. flex: "auto",
  1730. minWidth: 0,
  1731. minHeight: 0
  1732. },
  1733. [`${t}-tabpane`]: {
  1734. outline: "none",
  1735. flex: "none",
  1736. width: "100%"
  1737. }
  1738. }),
  1739. [`${t}-centered`]: {
  1740. [`> ${t}-nav, > div > ${t}-nav`]: {
  1741. [`${t}-nav-wrap`]: {
  1742. [`&:not([class*='${t}-nav-wrap-ping'])`]: {
  1743. justifyContent: "center"
  1744. }
  1745. }
  1746. }
  1747. }
  1748. };
  1749. }, ba = _t("Tabs", (e) => {
  1750. const t = e.controlHeightLG, a = St(e, {
  1751. tabsHoverColor: e.colorPrimaryHover,
  1752. tabsActiveColor: e.colorPrimaryActive,
  1753. tabsCardHorizontalPadding: `${(t - Math.round(e.fontSize * e.lineHeight)) / 2 - e.lineWidth}px ${e.padding}px`,
  1754. tabsCardHeight: t,
  1755. tabsCardGutter: e.marginXXS / 2,
  1756. tabsHorizontalGutter: 32,
  1757. tabsCardHeadBackground: e.colorFillAlter,
  1758. dropdownEdgeChildVerticalPadding: e.paddingXXS,
  1759. tabsActiveTextShadow: "0 0 0.25px currentcolor",
  1760. tabsDropdownHeight: 200,
  1761. tabsDropdownWidth: 120
  1762. });
  1763. return [da(a), ua(a), sa(a), ra(a), la(a), va(a), ia(a)];
  1764. }, (e) => ({
  1765. zIndexPopup: e.zIndexPopupBase + 50
  1766. }));
  1767. let et = 0;
  1768. const ct = () => ({
  1769. prefixCls: {
  1770. type: String
  1771. },
  1772. id: {
  1773. type: String
  1774. },
  1775. popupClassName: String,
  1776. getPopupContainer: j(),
  1777. activeKey: {
  1778. type: [String, Number]
  1779. },
  1780. defaultActiveKey: {
  1781. type: [String, Number]
  1782. },
  1783. direction: xe(),
  1784. animated: Dt([Boolean, Object]),
  1785. renderTabBar: j(),
  1786. tabBarGutter: {
  1787. type: Number
  1788. },
  1789. tabBarStyle: me(),
  1790. tabPosition: xe(),
  1791. destroyInactiveTabPane: At(),
  1792. hideAdd: Boolean,
  1793. type: xe(),
  1794. size: xe(),
  1795. centered: Boolean,
  1796. onEdit: j(),
  1797. onChange: j(),
  1798. onTabClick: j(),
  1799. onTabScroll: j(),
  1800. "onUpdate:activeKey": j(),
  1801. // Accessibility
  1802. locale: me(),
  1803. onPrevClick: j(),
  1804. onNextClick: j(),
  1805. tabBarExtraContent: we.any
  1806. });
  1807. function pa(e) {
  1808. return e.map((t) => {
  1809. if (Pt(t)) {
  1810. const a = T({}, t.props || {});
  1811. for (const [h, c] of Object.entries(a))
  1812. delete a[h], a[Rt(h)] = c;
  1813. const i = t.children || {}, o = t.key !== void 0 ? t.key : void 0, {
  1814. tab: l = i.tab,
  1815. disabled: n,
  1816. forceRender: s,
  1817. closable: v,
  1818. animated: d,
  1819. active: p,
  1820. destroyInactiveTabPane: S
  1821. } = a;
  1822. return T(T({
  1823. key: o
  1824. }, a), {
  1825. node: t,
  1826. closeIcon: i.closeIcon,
  1827. tab: l,
  1828. disabled: n === "" || n,
  1829. forceRender: s === "" || s,
  1830. closable: v === "" || v,
  1831. animated: d === "" || d,
  1832. active: p === "" || p,
  1833. destroyInactiveTabPane: S === "" || S
  1834. });
  1835. }
  1836. return null;
  1837. }).filter((t) => t);
  1838. }
  1839. const fa = ae({
  1840. compatConfig: {
  1841. MODE: 3
  1842. },
  1843. name: "InternalTabs",
  1844. inheritAttrs: !1,
  1845. props: T(T({}, nt(ct(), {
  1846. tabPosition: "top",
  1847. animated: {
  1848. inkBar: !0,
  1849. tabPane: !1
  1850. }
  1851. })), {
  1852. tabs: Lt()
  1853. }),
  1854. slots: Object,
  1855. // emits: ['tabClick', 'tabScroll', 'change', 'update:activeKey'],
  1856. setup(e, t) {
  1857. let {
  1858. attrs: a,
  1859. slots: i
  1860. } = t;
  1861. De(e.onPrevClick === void 0 && e.onNextClick === void 0, "Tabs", "`onPrevClick / @prevClick` and `onNextClick / @nextClick` has been removed. Please use `onTabScroll / @tabScroll` instead."), De(e.tabBarExtraContent === void 0, "Tabs", "`tabBarExtraContent` prop has been removed. Please use `rightExtra` slot instead."), De(i.tabBarExtraContent === void 0, "Tabs", "`tabBarExtraContent` slot is deprecated. Please use `rightExtra` slot instead.");
  1862. const {
  1863. prefixCls: o,
  1864. direction: l,
  1865. size: n,
  1866. rootPrefixCls: s,
  1867. getPopupContainer: v
  1868. } = It("tabs", e), [d, p] = ba(o), S = H(() => l.value === "rtl"), h = H(() => {
  1869. const {
  1870. animated: u,
  1871. tabPosition: $
  1872. } = e;
  1873. return u === !1 || ["left", "right"].includes($) ? {
  1874. inkBar: !1,
  1875. tabPane: !1
  1876. } : u === !0 ? {
  1877. inkBar: !0,
  1878. tabPane: !0
  1879. } : T({
  1880. inkBar: !0,
  1881. tabPane: !1
  1882. }, typeof u == "object" ? u : {});
  1883. }), [c, y] = D(!1);
  1884. Te(() => {
  1885. y(Xt());
  1886. });
  1887. const [x, w] = Ve(() => {
  1888. var u;
  1889. return (u = e.tabs[0]) === null || u === void 0 ? void 0 : u.key;
  1890. }, {
  1891. value: H(() => e.activeKey),
  1892. defaultValue: e.defaultActiveKey
  1893. }), [C, k] = D(() => e.tabs.findIndex((u) => u.key === x.value));
  1894. Ce(() => {
  1895. var u;
  1896. let $ = e.tabs.findIndex((E) => E.key === x.value);
  1897. $ === -1 && ($ = Math.max(0, Math.min(C.value, e.tabs.length - 1)), w((u = e.tabs[$]) === null || u === void 0 ? void 0 : u.key)), k($);
  1898. });
  1899. const [K, M] = Ve(null, {
  1900. value: H(() => e.id)
  1901. }), r = H(() => c.value && !["left", "right"].includes(e.tabPosition) ? "top" : e.tabPosition);
  1902. Te(() => {
  1903. e.id || (M(`rc-tabs-${process.env.NODE_ENV === "test" ? "test" : et}`), et += 1);
  1904. });
  1905. const m = (u, $) => {
  1906. var E, R;
  1907. (E = e.onTabClick) === null || E === void 0 || E.call(e, u, $);
  1908. const G = u !== x.value;
  1909. w(u), G && ((R = e.onChange) === null || R === void 0 || R.call(e, u));
  1910. };
  1911. return st({
  1912. tabs: H(() => e.tabs),
  1913. prefixCls: o
  1914. }), () => {
  1915. const {
  1916. id: u,
  1917. type: $,
  1918. tabBarGutter: E,
  1919. tabBarStyle: R,
  1920. locale: G,
  1921. destroyInactiveTabPane: re,
  1922. renderTabBar: se = i.renderTabBar,
  1923. onTabScroll: ce,
  1924. hideAdd: I,
  1925. centered: J
  1926. } = e, N = {
  1927. id: K.value,
  1928. activeKey: x.value,
  1929. animated: h.value,
  1930. tabPosition: r.value,
  1931. rtl: S.value,
  1932. mobile: c.value
  1933. };
  1934. let V;
  1935. $ === "editable-card" && (V = {
  1936. onEdit: (ve, be) => {
  1937. let {
  1938. key: pe,
  1939. event: $e
  1940. } = be;
  1941. var de;
  1942. (de = e.onEdit) === null || de === void 0 || de.call(e, ve === "add" ? $e : pe, ve);
  1943. },
  1944. removeIcon: () => g(Bt, null, null),
  1945. addIcon: i.addIcon ? i.addIcon : () => g(Et, null, null),
  1946. showAdd: I !== !0
  1947. });
  1948. let Y;
  1949. const ue = T(T({}, N), {
  1950. moreTransitionName: `${s.value}-slide-up`,
  1951. editable: V,
  1952. locale: G,
  1953. tabBarGutter: E,
  1954. onTabClick: m,
  1955. onTabScroll: ce,
  1956. style: R,
  1957. getPopupContainer: v.value,
  1958. popupClassName: le(e.popupClassName, p.value)
  1959. });
  1960. se ? Y = se(T(T({}, ue), {
  1961. DefaultTabBar: Je
  1962. })) : Y = g(Je, ue, it(i, ["moreIcon", "leftExtra", "rightExtra", "tabBarExtraContent"]));
  1963. const z = o.value;
  1964. return d(g("div", te(te({}, a), {}, {
  1965. id: u,
  1966. class: le(z, `${z}-${r.value}`, {
  1967. [p.value]: !0,
  1968. [`${z}-${n.value}`]: n.value,
  1969. [`${z}-card`]: ["card", "editable-card"].includes($),
  1970. [`${z}-editable-card`]: $ === "editable-card",
  1971. [`${z}-centered`]: J,
  1972. [`${z}-mobile`]: c.value,
  1973. [`${z}-editable`]: $ === "editable-card",
  1974. [`${z}-rtl`]: S.value
  1975. }, a.class)
  1976. }), [Y, g(oa, te(te({
  1977. destroyInactiveTabPane: re
  1978. }, N), {}, {
  1979. animated: h.value
  1980. }), null)]));
  1981. };
  1982. }
  1983. }), Se = ae({
  1984. compatConfig: {
  1985. MODE: 3
  1986. },
  1987. name: "ATabs",
  1988. inheritAttrs: !1,
  1989. props: nt(ct(), {
  1990. tabPosition: "top",
  1991. animated: {
  1992. inkBar: !0,
  1993. tabPane: !1
  1994. }
  1995. }),
  1996. slots: Object,
  1997. // emits: ['tabClick', 'tabScroll', 'change', 'update:activeKey'],
  1998. setup(e, t) {
  1999. let {
  2000. attrs: a,
  2001. slots: i,
  2002. emit: o
  2003. } = t;
  2004. const l = (n) => {
  2005. o("update:activeKey", n), o("change", n);
  2006. };
  2007. return () => {
  2008. var n;
  2009. const s = pa(Tt((n = i.default) === null || n === void 0 ? void 0 : n.call(i)));
  2010. return g(fa, te(te(te({}, wt(e, ["onUpdate:activeKey"])), a), {}, {
  2011. onChange: l,
  2012. tabs: s
  2013. }), i);
  2014. };
  2015. }
  2016. }), ha = () => ({
  2017. tab: we.any,
  2018. disabled: {
  2019. type: Boolean
  2020. },
  2021. forceRender: {
  2022. type: Boolean
  2023. },
  2024. closable: {
  2025. type: Boolean
  2026. },
  2027. animated: {
  2028. type: Boolean
  2029. },
  2030. active: {
  2031. type: Boolean
  2032. },
  2033. destroyInactiveTabPane: {
  2034. type: Boolean
  2035. },
  2036. // Pass by TabPaneList
  2037. prefixCls: {
  2038. type: String
  2039. },
  2040. tabKey: {
  2041. type: [String, Number]
  2042. },
  2043. id: {
  2044. type: String
  2045. }
  2046. // closeIcon: PropTypes.any,
  2047. }), ke = ae({
  2048. compatConfig: {
  2049. MODE: 3
  2050. },
  2051. name: "ATabPane",
  2052. inheritAttrs: !1,
  2053. __ANT_TAB_PANE: !0,
  2054. props: ha(),
  2055. slots: Object,
  2056. setup(e, t) {
  2057. let {
  2058. attrs: a,
  2059. slots: i
  2060. } = t;
  2061. const o = Q(e.forceRender);
  2062. ie([() => e.active, () => e.destroyInactiveTabPane], () => {
  2063. e.active ? o.value = !0 : e.destroyInactiveTabPane && (o.value = !1);
  2064. }, {
  2065. immediate: !0
  2066. });
  2067. const l = H(() => e.active ? {} : e.animated ? {
  2068. visibility: "hidden",
  2069. height: 0,
  2070. overflowY: "hidden"
  2071. } : {
  2072. display: "none"
  2073. });
  2074. return () => {
  2075. var n;
  2076. const {
  2077. prefixCls: s,
  2078. forceRender: v,
  2079. id: d,
  2080. active: p,
  2081. tabKey: S
  2082. } = e;
  2083. return g("div", {
  2084. id: d && `${d}-panel-${S}`,
  2085. role: "tabpanel",
  2086. tabindex: p ? 0 : -1,
  2087. "aria-labelledby": d && `${d}-tab-${S}`,
  2088. "aria-hidden": !p,
  2089. style: [l.value, a.style],
  2090. class: [`${s}-tabpane`, p && `${s}-tabpane-active`, a.class]
  2091. }, [(p || o.value || v) && ((n = i.default) === null || n === void 0 ? void 0 : n.call(i))]);
  2092. };
  2093. }
  2094. });
  2095. Se.TabPane = ke;
  2096. Se.install = function(e) {
  2097. return e.component(Se.name, Se), e.component(ke.name, ke), e;
  2098. };
  2099. export {
  2100. Se as T,
  2101. ke as _
  2102. };