index12.js 53 KB

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