index12.js 53 KB

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