index4.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. import { w as N, _ as v, $ as B, aU as F, o as M, bd as L, I as R, J as E, bc as G, M as W } from "./index2.js";
  2. import { ref as H, shallowRef as X, watchEffect as U } from "vue";
  3. function ae() {
  4. const e = (t) => {
  5. e.current = t;
  6. };
  7. return e;
  8. }
  9. function le(e, t) {
  10. if (!e) return [];
  11. const n = e.slice(), r = n.indexOf(t);
  12. return r >= 0 && n.splice(r, 1), n;
  13. }
  14. function se(e, t) {
  15. const n = (e || []).slice();
  16. return n.indexOf(t) === -1 && n.push(t), n;
  17. }
  18. function I(e) {
  19. return e.split("-");
  20. }
  21. function D(e, t) {
  22. return `${e}-${t}`;
  23. }
  24. function q(e) {
  25. return e && e.type && e.type.isTreeNode;
  26. }
  27. function ce(e, t) {
  28. const n = [], r = t[e];
  29. function o() {
  30. (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).forEach((f) => {
  31. let {
  32. key: d,
  33. children: u
  34. } = f;
  35. n.push(d), o(u);
  36. });
  37. }
  38. return o(r.children), n;
  39. }
  40. function J(e) {
  41. if (e.parent) {
  42. const t = I(e.pos);
  43. return Number(t[t.length - 1]) === e.parent.children.length - 1;
  44. }
  45. return !1;
  46. }
  47. function V(e) {
  48. const t = I(e.pos);
  49. return Number(t[t.length - 1]) === 0;
  50. }
  51. function de(e, t, n, r, o, i, f, d, u, s) {
  52. var l;
  53. const {
  54. clientX: a,
  55. clientY: c
  56. } = e, {
  57. top: h,
  58. height: p
  59. } = e.target.getBoundingClientRect(), g = ((s === "rtl" ? -1 : 1) * (((o == null ? void 0 : o.x) || 0) - a) - 12) / r;
  60. let y = d[n.eventKey];
  61. if (c < h + p / 2) {
  62. const k = f.findIndex((A) => A.key === y.key), O = k <= 0 ? 0 : k - 1, z = f[O].key;
  63. y = d[z];
  64. }
  65. const S = y.key, C = y, m = y.key;
  66. let $ = 0, P = 0;
  67. if (!u.has(S))
  68. for (let k = 0; k < g && J(y); k += 1)
  69. y = y.parent, P += 1;
  70. const x = t.eventData, w = y.node;
  71. let K = !0;
  72. return V(y) && y.level === 0 && c < h + p / 2 && i({
  73. dragNode: x,
  74. dropNode: w,
  75. dropPosition: -1
  76. }) && y.key === n.eventKey ? $ = -1 : (C.children || []).length && u.has(m) ? i({
  77. dragNode: x,
  78. dropNode: w,
  79. dropPosition: 0
  80. }) ? $ = 0 : K = !1 : P === 0 ? g > -1.5 ? i({
  81. dragNode: x,
  82. dropNode: w,
  83. dropPosition: 1
  84. }) ? $ = 1 : K = !1 : i({
  85. dragNode: x,
  86. dropNode: w,
  87. dropPosition: 0
  88. }) ? $ = 0 : i({
  89. dragNode: x,
  90. dropNode: w,
  91. dropPosition: 1
  92. }) ? $ = 1 : K = !1 : i({
  93. dragNode: x,
  94. dropNode: w,
  95. dropPosition: 1
  96. }) ? $ = 1 : K = !1, {
  97. dropPosition: $,
  98. dropLevelOffset: P,
  99. dropTargetKey: y.key,
  100. dropTargetPos: y.pos,
  101. dragOverNodeKey: m,
  102. dropContainerKey: $ === 0 ? null : ((l = y.parent) === null || l === void 0 ? void 0 : l.key) || null,
  103. dropAllowed: K
  104. };
  105. }
  106. function fe(e, t) {
  107. if (!e) return;
  108. const {
  109. multiple: n
  110. } = t;
  111. return n ? e.slice() : e.length ? [e[0]] : e;
  112. }
  113. function ue(e) {
  114. if (!e)
  115. return null;
  116. let t;
  117. if (Array.isArray(e))
  118. t = {
  119. checkedKeys: e,
  120. halfCheckedKeys: void 0
  121. };
  122. else if (typeof e == "object")
  123. t = {
  124. checkedKeys: e.checked || void 0,
  125. halfCheckedKeys: e.halfChecked || void 0
  126. };
  127. else
  128. return N(!1, "`checkedKeys` is not an array or an object"), null;
  129. return t;
  130. }
  131. function pe(e, t) {
  132. const n = /* @__PURE__ */ new Set();
  133. function r(o) {
  134. if (n.has(o)) return;
  135. const i = t[o];
  136. if (!i) return;
  137. n.add(o);
  138. const {
  139. parent: f,
  140. node: d
  141. } = i;
  142. d.disabled || f && r(f.key);
  143. }
  144. return (e || []).forEach((o) => {
  145. r(o);
  146. }), [...n];
  147. }
  148. var Y = function(e, t) {
  149. var n = {};
  150. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
  151. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
  152. t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
  153. return n;
  154. };
  155. function T(e, t) {
  156. return e != null ? e : t;
  157. }
  158. function j(e) {
  159. const {
  160. title: t,
  161. _title: n,
  162. key: r,
  163. children: o
  164. } = e || {}, i = t || "title";
  165. return {
  166. title: i,
  167. _title: n || [i],
  168. key: r || "key",
  169. children: o || "children"
  170. };
  171. }
  172. function he(e) {
  173. function t() {
  174. let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
  175. return B(n).map((o) => {
  176. var i, f, d, u;
  177. if (!q(o))
  178. return N(!o, "Tree/TreeNode can only accept TreeNode as children."), null;
  179. const s = o.children || {}, l = o.key, a = {};
  180. for (const [k, O] of Object.entries(o.props))
  181. a[F(k)] = O;
  182. const {
  183. isLeaf: c,
  184. checkable: h,
  185. selectable: p,
  186. disabled: b,
  187. disableCheckbox: g
  188. } = a, y = {
  189. isLeaf: c || c === "" || void 0,
  190. checkable: h || h === "" || void 0,
  191. selectable: p || p === "" || void 0,
  192. disabled: b || b === "" || void 0,
  193. disableCheckbox: g || g === "" || void 0
  194. }, S = v(v({}, a), y), {
  195. title: C = (i = s.title) === null || i === void 0 ? void 0 : i.call(s, S),
  196. icon: m = (f = s.icon) === null || f === void 0 ? void 0 : f.call(s, S),
  197. switcherIcon: $ = (d = s.switcherIcon) === null || d === void 0 ? void 0 : d.call(s, S)
  198. } = a, P = Y(a, ["title", "icon", "switcherIcon"]), x = (u = s.default) === null || u === void 0 ? void 0 : u.call(s), w = v(v(v({}, P), {
  199. title: C,
  200. icon: m,
  201. switcherIcon: $,
  202. key: l,
  203. isLeaf: c
  204. }), y), K = t(x);
  205. return K.length && (w.children = K), w;
  206. });
  207. }
  208. return t(e);
  209. }
  210. function ye(e, t, n) {
  211. const {
  212. _title: r,
  213. key: o,
  214. children: i
  215. } = j(n), f = new Set(t === !0 ? [] : t), d = [];
  216. function u(s) {
  217. let l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
  218. return s.map((a, c) => {
  219. const h = D(l ? l.pos : "0", c), p = T(a[o], h);
  220. let b;
  221. for (let y = 0; y < r.length; y += 1) {
  222. const S = r[y];
  223. if (a[S] !== void 0) {
  224. b = a[S];
  225. break;
  226. }
  227. }
  228. const g = v(v({}, M(a, [...r, o, i])), {
  229. title: b,
  230. key: p,
  231. parent: l,
  232. pos: h,
  233. children: null,
  234. data: a,
  235. isStart: [...l ? l.isStart : [], c === 0],
  236. isEnd: [...l ? l.isEnd : [], c === s.length - 1]
  237. });
  238. return d.push(g), t === !0 || f.has(p) ? g.children = u(a[i] || [], g) : g.children = [], g;
  239. });
  240. }
  241. return u(e), d;
  242. }
  243. function Q(e, t, n) {
  244. let r = {};
  245. typeof n == "object" ? r = n : r = {
  246. externalGetKey: n
  247. }, r = r || {};
  248. const {
  249. childrenPropName: o,
  250. externalGetKey: i,
  251. fieldNames: f
  252. } = r, {
  253. key: d,
  254. children: u
  255. } = j(f), s = o || u;
  256. let l;
  257. i ? typeof i == "string" ? l = (c) => c[i] : typeof i == "function" && (l = (c) => i(c)) : l = (c, h) => T(c[d], h);
  258. function a(c, h, p, b) {
  259. const g = c ? c[s] : e, y = c ? D(p.pos, h) : "0", S = c ? [...b, c] : [];
  260. if (c) {
  261. const C = l(c, y), m = {
  262. node: c,
  263. index: h,
  264. pos: y,
  265. key: C,
  266. parentPos: p.node ? p.pos : null,
  267. level: p.level + 1,
  268. nodes: S
  269. };
  270. t(m);
  271. }
  272. g && g.forEach((C, m) => {
  273. a(C, m, {
  274. node: c,
  275. pos: y,
  276. level: p ? p.level + 1 : -1
  277. }, S);
  278. });
  279. }
  280. a(null);
  281. }
  282. function ge(e) {
  283. let {
  284. initWrapper: t,
  285. processEntity: n,
  286. onProcessFinished: r,
  287. externalGetKey: o,
  288. childrenPropName: i,
  289. fieldNames: f
  290. } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, d = arguments.length > 2 ? arguments[2] : void 0;
  291. const u = o || d, s = {}, l = {};
  292. let a = {
  293. posEntities: s,
  294. keyEntities: l
  295. };
  296. return t && (a = t(a) || a), Q(e, (c) => {
  297. const {
  298. node: h,
  299. index: p,
  300. pos: b,
  301. key: g,
  302. parentPos: y,
  303. level: S,
  304. nodes: C
  305. } = c, m = {
  306. node: h,
  307. nodes: C,
  308. index: p,
  309. key: g,
  310. pos: b,
  311. level: S
  312. }, $ = T(g, b);
  313. s[b] = m, l[$] = m, m.parent = s[y], m.parent && (m.parent.children = m.parent.children || [], m.parent.children.push(m)), n && n(m, a);
  314. }, {
  315. externalGetKey: u,
  316. childrenPropName: i,
  317. fieldNames: f
  318. }), r && r(a), a;
  319. }
  320. function be(e, t) {
  321. let {
  322. expandedKeysSet: n,
  323. selectedKeysSet: r,
  324. loadedKeysSet: o,
  325. loadingKeysSet: i,
  326. checkedKeysSet: f,
  327. halfCheckedKeysSet: d,
  328. dragOverNodeKey: u,
  329. dropPosition: s,
  330. keyEntities: l
  331. } = t;
  332. const a = l[e];
  333. return {
  334. eventKey: e,
  335. expanded: n.has(e),
  336. selected: r.has(e),
  337. loaded: o.has(e),
  338. loading: i.has(e),
  339. checked: f.has(e),
  340. halfChecked: d.has(e),
  341. pos: String(a ? a.pos : ""),
  342. parent: a.parent,
  343. // [Legacy] Drag props
  344. // Since the interaction of drag is changed, the semantic of the props are
  345. // not accuracy, I think it should be finally removed
  346. dragOver: u === e && s === 0,
  347. dragOverGapTop: u === e && s === -1,
  348. dragOverGapBottom: u === e && s === 1
  349. };
  350. }
  351. function me(e) {
  352. const {
  353. data: t,
  354. expanded: n,
  355. selected: r,
  356. checked: o,
  357. loaded: i,
  358. loading: f,
  359. halfChecked: d,
  360. dragOver: u,
  361. dragOverGapTop: s,
  362. dragOverGapBottom: l,
  363. pos: a,
  364. active: c,
  365. eventKey: h
  366. } = e, p = v(v({
  367. dataRef: t
  368. }, t), {
  369. expanded: n,
  370. selected: r,
  371. checked: o,
  372. loaded: i,
  373. loading: f,
  374. halfChecked: d,
  375. dragOver: u,
  376. dragOverGapTop: s,
  377. dragOverGapBottom: l,
  378. pos: a,
  379. active: c,
  380. eventKey: h,
  381. key: h
  382. });
  383. return "props" in p || Object.defineProperty(p, "props", {
  384. get() {
  385. return N(!1, "Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."), e;
  386. }
  387. }), p;
  388. }
  389. function _(e, t) {
  390. const n = /* @__PURE__ */ new Set();
  391. return e.forEach((r) => {
  392. t.has(r) || n.add(r);
  393. }), n;
  394. }
  395. function Z(e) {
  396. const {
  397. disabled: t,
  398. disableCheckbox: n,
  399. checkable: r
  400. } = e || {};
  401. return !!(t || n) || r === !1;
  402. }
  403. function ee(e, t, n, r) {
  404. const o = new Set(e), i = /* @__PURE__ */ new Set();
  405. for (let d = 0; d <= n; d += 1)
  406. (t.get(d) || /* @__PURE__ */ new Set()).forEach((s) => {
  407. const {
  408. key: l,
  409. node: a,
  410. children: c = []
  411. } = s;
  412. o.has(l) && !r(a) && c.filter((h) => !r(h.node)).forEach((h) => {
  413. o.add(h.key);
  414. });
  415. });
  416. const f = /* @__PURE__ */ new Set();
  417. for (let d = n; d >= 0; d -= 1)
  418. (t.get(d) || /* @__PURE__ */ new Set()).forEach((s) => {
  419. const {
  420. parent: l,
  421. node: a
  422. } = s;
  423. if (r(a) || !s.parent || f.has(s.parent.key))
  424. return;
  425. if (r(s.parent.node)) {
  426. f.add(l.key);
  427. return;
  428. }
  429. let c = !0, h = !1;
  430. (l.children || []).filter((p) => !r(p.node)).forEach((p) => {
  431. let {
  432. key: b
  433. } = p;
  434. const g = o.has(b);
  435. c && !g && (c = !1), !h && (g || i.has(b)) && (h = !0);
  436. }), c && o.add(l.key), h && i.add(l.key), f.add(l.key);
  437. });
  438. return {
  439. checkedKeys: Array.from(o),
  440. halfCheckedKeys: Array.from(_(i, o))
  441. };
  442. }
  443. function te(e, t, n, r, o) {
  444. const i = new Set(e);
  445. let f = new Set(t);
  446. for (let u = 0; u <= r; u += 1)
  447. (n.get(u) || /* @__PURE__ */ new Set()).forEach((l) => {
  448. const {
  449. key: a,
  450. node: c,
  451. children: h = []
  452. } = l;
  453. !i.has(a) && !f.has(a) && !o(c) && h.filter((p) => !o(p.node)).forEach((p) => {
  454. i.delete(p.key);
  455. });
  456. });
  457. f = /* @__PURE__ */ new Set();
  458. const d = /* @__PURE__ */ new Set();
  459. for (let u = r; u >= 0; u -= 1)
  460. (n.get(u) || /* @__PURE__ */ new Set()).forEach((l) => {
  461. const {
  462. parent: a,
  463. node: c
  464. } = l;
  465. if (o(c) || !l.parent || d.has(l.parent.key))
  466. return;
  467. if (o(l.parent.node)) {
  468. d.add(a.key);
  469. return;
  470. }
  471. let h = !0, p = !1;
  472. (a.children || []).filter((b) => !o(b.node)).forEach((b) => {
  473. let {
  474. key: g
  475. } = b;
  476. const y = i.has(g);
  477. h && !y && (h = !1), !p && (y || f.has(g)) && (p = !0);
  478. }), h || i.delete(a.key), p && f.add(a.key), d.add(a.key);
  479. });
  480. return {
  481. checkedKeys: Array.from(i),
  482. halfCheckedKeys: Array.from(_(f, i))
  483. };
  484. }
  485. function ve(e, t, n, r, o, i) {
  486. const f = [];
  487. let d;
  488. d = Z;
  489. const u = new Set(e.filter((l) => {
  490. const a = !!n[l];
  491. return a || f.push(l), a;
  492. }));
  493. L(!f.length, `Tree missing follow keys: ${f.slice(0, 100).map((l) => `'${l}'`).join(", ")}`);
  494. let s;
  495. return t === !0 ? s = ee(u, o, r, d) : s = te(u, t.halfCheckedKeys, o, r, d), s;
  496. }
  497. function Se(e) {
  498. const t = H(0), n = X();
  499. return U(() => {
  500. const r = /* @__PURE__ */ new Map();
  501. let o = 0;
  502. const i = e.value || {};
  503. for (const f in i)
  504. if (Object.prototype.hasOwnProperty.call(i, f)) {
  505. const d = i[f], {
  506. level: u
  507. } = d;
  508. let s = r.get(u);
  509. s || (s = /* @__PURE__ */ new Set(), r.set(u, s)), s.add(d), o = Math.max(o, u);
  510. }
  511. t.value = o, n.value = r;
  512. }), {
  513. maxLevel: t,
  514. levelEntities: n
  515. };
  516. }
  517. const ne = new W("antCheckboxEffect", {
  518. "0%": {
  519. transform: "scale(1)",
  520. opacity: 0.5
  521. },
  522. "100%": {
  523. transform: "scale(1.6)",
  524. opacity: 0
  525. }
  526. }), re = (e) => {
  527. const {
  528. checkboxCls: t
  529. } = e, n = `${t}-wrapper`;
  530. return [
  531. // ===================== Basic =====================
  532. {
  533. // Group
  534. [`${t}-group`]: v(v({}, E(e)), {
  535. display: "inline-flex",
  536. flexWrap: "wrap",
  537. columnGap: e.marginXS,
  538. // Group > Grid
  539. [`> ${e.antCls}-row`]: {
  540. flex: 1
  541. }
  542. }),
  543. // Wrapper
  544. [n]: v(v({}, E(e)), {
  545. display: "inline-flex",
  546. alignItems: "baseline",
  547. cursor: "pointer",
  548. // Fix checkbox & radio in flex align #30260
  549. "&:after": {
  550. display: "inline-block",
  551. width: 0,
  552. overflow: "hidden",
  553. content: "'\\a0'"
  554. },
  555. // Checkbox near checkbox
  556. [`& + ${n}`]: {
  557. marginInlineStart: 0
  558. },
  559. [`&${n}-in-form-item`]: {
  560. 'input[type="checkbox"]': {
  561. width: 14,
  562. height: 14
  563. // FIXME: magic
  564. }
  565. }
  566. }),
  567. // Wrapper > Checkbox
  568. [t]: v(v({}, E(e)), {
  569. position: "relative",
  570. whiteSpace: "nowrap",
  571. lineHeight: 1,
  572. cursor: "pointer",
  573. // To make alignment right when `controlHeight` is changed
  574. // Ref: https://github.com/ant-design/ant-design/issues/41564
  575. alignSelf: "center",
  576. // Wrapper > Checkbox > input
  577. [`${t}-input`]: {
  578. position: "absolute",
  579. // Since baseline align will get additional space offset,
  580. // we need to move input to top to make it align with text.
  581. // Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
  582. inset: 0,
  583. zIndex: 1,
  584. cursor: "pointer",
  585. opacity: 0,
  586. margin: 0,
  587. [`&:focus-visible + ${t}-inner`]: v({}, G(e))
  588. },
  589. // Wrapper > Checkbox > inner
  590. [`${t}-inner`]: {
  591. boxSizing: "border-box",
  592. position: "relative",
  593. top: 0,
  594. insetInlineStart: 0,
  595. display: "block",
  596. width: e.checkboxSize,
  597. height: e.checkboxSize,
  598. direction: "ltr",
  599. backgroundColor: e.colorBgContainer,
  600. border: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,
  601. borderRadius: e.borderRadiusSM,
  602. borderCollapse: "separate",
  603. transition: `all ${e.motionDurationSlow}`,
  604. "&:after": {
  605. boxSizing: "border-box",
  606. position: "absolute",
  607. top: "50%",
  608. insetInlineStart: "21.5%",
  609. display: "table",
  610. width: e.checkboxSize / 14 * 5,
  611. height: e.checkboxSize / 14 * 8,
  612. border: `${e.lineWidthBold}px solid ${e.colorWhite}`,
  613. borderTop: 0,
  614. borderInlineStart: 0,
  615. transform: "rotate(45deg) scale(0) translate(-50%,-50%)",
  616. opacity: 0,
  617. content: '""',
  618. transition: `all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`
  619. }
  620. },
  621. // Wrapper > Checkbox + Text
  622. "& + span": {
  623. paddingInlineStart: e.paddingXS,
  624. paddingInlineEnd: e.paddingXS
  625. }
  626. })
  627. },
  628. // ================= Indeterminate =================
  629. {
  630. [t]: {
  631. "&-indeterminate": {
  632. // Wrapper > Checkbox > inner
  633. [`${t}-inner`]: {
  634. "&:after": {
  635. top: "50%",
  636. insetInlineStart: "50%",
  637. width: e.fontSizeLG / 2,
  638. height: e.fontSizeLG / 2,
  639. backgroundColor: e.colorPrimary,
  640. border: 0,
  641. transform: "translate(-50%, -50%) scale(1)",
  642. opacity: 1,
  643. content: '""'
  644. }
  645. }
  646. }
  647. }
  648. },
  649. // ===================== Hover =====================
  650. {
  651. // Wrapper
  652. [`${n}:hover ${t}:after`]: {
  653. visibility: "visible"
  654. },
  655. // Wrapper & Wrapper > Checkbox
  656. [`
  657. ${n}:not(${n}-disabled),
  658. ${t}:not(${t}-disabled)
  659. `]: {
  660. [`&:hover ${t}-inner`]: {
  661. borderColor: e.colorPrimary
  662. }
  663. },
  664. [`${n}:not(${n}-disabled)`]: {
  665. [`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]: {
  666. backgroundColor: e.colorPrimaryHover,
  667. borderColor: "transparent"
  668. },
  669. [`&:hover ${t}-checked:not(${t}-disabled):after`]: {
  670. borderColor: e.colorPrimaryHover
  671. }
  672. }
  673. },
  674. // ==================== Checked ====================
  675. {
  676. // Wrapper > Checkbox
  677. [`${t}-checked`]: {
  678. [`${t}-inner`]: {
  679. backgroundColor: e.colorPrimary,
  680. borderColor: e.colorPrimary,
  681. "&:after": {
  682. opacity: 1,
  683. transform: "rotate(45deg) scale(1) translate(-50%,-50%)",
  684. transition: `all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`
  685. }
  686. },
  687. // Checked Effect
  688. "&:after": {
  689. position: "absolute",
  690. top: 0,
  691. insetInlineStart: 0,
  692. width: "100%",
  693. height: "100%",
  694. borderRadius: e.borderRadiusSM,
  695. visibility: "hidden",
  696. border: `${e.lineWidthBold}px solid ${e.colorPrimary}`,
  697. animationName: ne,
  698. animationDuration: e.motionDurationSlow,
  699. animationTimingFunction: "ease-in-out",
  700. animationFillMode: "backwards",
  701. content: '""',
  702. transition: `all ${e.motionDurationSlow}`
  703. }
  704. },
  705. [`
  706. ${n}-checked:not(${n}-disabled),
  707. ${t}-checked:not(${t}-disabled)
  708. `]: {
  709. [`&:hover ${t}-inner`]: {
  710. backgroundColor: e.colorPrimaryHover,
  711. borderColor: "transparent"
  712. },
  713. [`&:hover ${t}:after`]: {
  714. borderColor: e.colorPrimaryHover
  715. }
  716. }
  717. },
  718. // ==================== Disable ====================
  719. {
  720. // Wrapper
  721. [`${n}-disabled`]: {
  722. cursor: "not-allowed"
  723. },
  724. // Wrapper > Checkbox
  725. [`${t}-disabled`]: {
  726. // Wrapper > Checkbox > input
  727. [`&, ${t}-input`]: {
  728. cursor: "not-allowed",
  729. // Disabled for native input to enable Tooltip event handler
  730. // ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-1365075901
  731. pointerEvents: "none"
  732. },
  733. // Wrapper > Checkbox > inner
  734. [`${t}-inner`]: {
  735. background: e.colorBgContainerDisabled,
  736. borderColor: e.colorBorder,
  737. "&:after": {
  738. borderColor: e.colorTextDisabled
  739. }
  740. },
  741. "&:after": {
  742. display: "none"
  743. },
  744. "& + span": {
  745. color: e.colorTextDisabled
  746. },
  747. [`&${t}-indeterminate ${t}-inner::after`]: {
  748. background: e.colorTextDisabled
  749. }
  750. }
  751. }
  752. ];
  753. };
  754. function $e(e, t) {
  755. const n = R(t, {
  756. checkboxCls: `.${e}`,
  757. checkboxSize: t.controlInteractiveSize
  758. });
  759. return [re(n)];
  760. }
  761. export {
  762. ve as a,
  763. he as b,
  764. ge as c,
  765. pe as d,
  766. ae as e,
  767. j as f,
  768. $e as g,
  769. be as h,
  770. me as i,
  771. T as j,
  772. ye as k,
  773. fe as l,
  774. le as m,
  775. ce as n,
  776. de as o,
  777. ue as p,
  778. se as q,
  779. I as r,
  780. Se as u
  781. };