index16.js 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163
  1. import { d as s, _ as B, K as V, dL as ze, dM as Se, bW as Me, g as Ke, c as Te, aj as We, dN as Ue, dO as Fe, u as we, w as ae, bq as X, L as Ve, db as se, dP as Xe, o as W, R as qe, y as ce, dQ as Ee, dR as Qe, cx as Ge, dS as Je, dT as Ye } from "./index2.js";
  2. import { defineComponent as ie, shallowRef as Ze, onMounted as fe, createVNode as f, toRefs as et, reactive as Oe, watch as ue, ref as pe, createApp as tt, computed as oe, onBeforeUnmount as nt, nextTick as be, watchEffect as ot, Fragment as he, toRaw as it } from "vue";
  3. var lt = function(e, n) {
  4. var o = {};
  5. for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
  6. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
  7. n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]);
  8. return o;
  9. };
  10. const rt = {
  11. border: 0,
  12. background: "transparent",
  13. padding: 0,
  14. lineHeight: "inherit",
  15. display: "inline-block"
  16. }, ve = ie({
  17. compatConfig: {
  18. MODE: 3
  19. },
  20. name: "TransButton",
  21. inheritAttrs: !1,
  22. props: {
  23. noStyle: {
  24. type: Boolean,
  25. default: void 0
  26. },
  27. onClick: Function,
  28. disabled: {
  29. type: Boolean,
  30. default: void 0
  31. },
  32. autofocus: {
  33. type: Boolean,
  34. default: void 0
  35. }
  36. },
  37. setup(e, n) {
  38. let {
  39. slots: o,
  40. emit: t,
  41. attrs: i,
  42. expose: d
  43. } = n;
  44. const a = Ze(), l = (v) => {
  45. const {
  46. keyCode: S
  47. } = v;
  48. S === V.ENTER && v.preventDefault();
  49. }, m = (v) => {
  50. const {
  51. keyCode: S
  52. } = v;
  53. S === V.ENTER && t("click", v);
  54. }, C = (v) => {
  55. t("click", v);
  56. }, y = () => {
  57. a.value && a.value.focus();
  58. }, _ = () => {
  59. a.value && a.value.blur();
  60. };
  61. return fe(() => {
  62. e.autofocus && y();
  63. }), d({
  64. focus: y,
  65. blur: _
  66. }), () => {
  67. var v;
  68. const {
  69. noStyle: S,
  70. disabled: I
  71. } = e, N = lt(e, ["noStyle", "disabled"]);
  72. let $ = {};
  73. return S || ($ = s({}, rt)), I && ($.pointerEvents = "none"), f("div", B(B(B({
  74. role: "button",
  75. tabindex: 0,
  76. ref: a
  77. }, N), i), {}, {
  78. onClick: C,
  79. onKeydown: l,
  80. onKeyup: m,
  81. style: s(s({}, $), i.style || {})
  82. }), [(v = o.default) === null || v === void 0 ? void 0 : v.call(o)]);
  83. };
  84. }
  85. }), at = (e, n, o, t) => {
  86. const {
  87. sizeMarginHeadingVerticalEnd: i,
  88. fontWeightStrong: d
  89. } = t;
  90. return {
  91. marginBottom: i,
  92. color: o,
  93. fontWeight: d,
  94. fontSize: e,
  95. lineHeight: n
  96. };
  97. }, st = (e) => {
  98. const n = [1, 2, 3, 4, 5], o = {};
  99. return n.forEach((t) => {
  100. o[`
  101. h${t}&,
  102. div&-h${t},
  103. div&-h${t} > textarea,
  104. h${t}
  105. `] = at(e[`fontSizeHeading${t}`], e[`lineHeightHeading${t}`], e.colorTextHeading, e);
  106. }), o;
  107. }, ct = (e) => {
  108. const {
  109. componentCls: n
  110. } = e;
  111. return {
  112. "a&, a": s(s({}, Se(e)), {
  113. textDecoration: e.linkDecoration,
  114. "&:active, &:hover": {
  115. textDecoration: e.linkHoverDecoration
  116. },
  117. [`&[disabled], &${n}-disabled`]: {
  118. color: e.colorTextDisabled,
  119. cursor: "not-allowed",
  120. "&:active, &:hover": {
  121. color: e.colorTextDisabled
  122. },
  123. "&:active": {
  124. pointerEvents: "none"
  125. }
  126. }
  127. })
  128. };
  129. }, dt = () => ({
  130. code: {
  131. margin: "0 0.2em",
  132. paddingInline: "0.4em",
  133. paddingBlock: "0.2em 0.1em",
  134. fontSize: "85%",
  135. background: "rgba(150, 150, 150, 0.1)",
  136. border: "1px solid rgba(100, 100, 100, 0.2)",
  137. borderRadius: 3
  138. },
  139. kbd: {
  140. margin: "0 0.2em",
  141. paddingInline: "0.4em",
  142. paddingBlock: "0.15em 0.1em",
  143. fontSize: "90%",
  144. background: "rgba(150, 150, 150, 0.06)",
  145. border: "1px solid rgba(100, 100, 100, 0.2)",
  146. borderBottomWidth: 2,
  147. borderRadius: 3
  148. },
  149. mark: {
  150. padding: 0,
  151. // FIXME hardcode in v4
  152. backgroundColor: ze[2]
  153. },
  154. "u, ins": {
  155. textDecoration: "underline",
  156. textDecorationSkipInk: "auto"
  157. },
  158. "s, del": {
  159. textDecoration: "line-through"
  160. },
  161. strong: {
  162. fontWeight: 600
  163. },
  164. // list
  165. "ul, ol": {
  166. marginInline: 0,
  167. marginBlock: "0 1em",
  168. padding: 0,
  169. li: {
  170. marginInline: "20px 0",
  171. marginBlock: 0,
  172. paddingInline: "4px 0",
  173. paddingBlock: 0
  174. }
  175. },
  176. ul: {
  177. listStyleType: "circle",
  178. ul: {
  179. listStyleType: "disc"
  180. }
  181. },
  182. ol: {
  183. listStyleType: "decimal"
  184. },
  185. // pre & block
  186. "pre, blockquote": {
  187. margin: "1em 0"
  188. },
  189. pre: {
  190. padding: "0.4em 0.6em",
  191. whiteSpace: "pre-wrap",
  192. wordWrap: "break-word",
  193. background: "rgba(150, 150, 150, 0.1)",
  194. border: "1px solid rgba(100, 100, 100, 0.2)",
  195. borderRadius: 3,
  196. // Compatible for marked
  197. code: {
  198. display: "inline",
  199. margin: 0,
  200. padding: 0,
  201. fontSize: "inherit",
  202. fontFamily: "inherit",
  203. background: "transparent",
  204. border: 0
  205. }
  206. },
  207. blockquote: {
  208. paddingInline: "0.6em 0",
  209. paddingBlock: 0,
  210. borderInlineStart: "4px solid rgba(100, 100, 100, 0.2)",
  211. opacity: 0.85
  212. }
  213. }), ut = (e) => {
  214. const {
  215. componentCls: n
  216. } = e, t = Me(e).inputPaddingVertical + 1;
  217. return {
  218. "&-edit-content": {
  219. position: "relative",
  220. "div&": {
  221. insetInlineStart: -e.paddingSM,
  222. marginTop: -t,
  223. marginBottom: `calc(1em - ${t}px)`
  224. },
  225. [`${n}-edit-content-confirm`]: {
  226. position: "absolute",
  227. insetInlineEnd: e.marginXS + 2,
  228. insetBlockEnd: e.marginXS,
  229. color: e.colorTextDescription,
  230. // default style
  231. fontWeight: "normal",
  232. fontSize: e.fontSize,
  233. fontStyle: "normal",
  234. pointerEvents: "none"
  235. },
  236. textarea: {
  237. margin: "0!important",
  238. // Fix Editable Textarea flash in Firefox
  239. MozTransition: "none",
  240. height: "1em"
  241. }
  242. }
  243. };
  244. }, pt = (e) => ({
  245. "&-copy-success": {
  246. "\n &,\n &:hover,\n &:focus": {
  247. color: e.colorSuccess
  248. }
  249. }
  250. }), ft = () => ({
  251. "\n a&-ellipsis,\n span&-ellipsis\n ": {
  252. display: "inline-block",
  253. maxWidth: "100%"
  254. },
  255. "&-single-line": {
  256. whiteSpace: "nowrap"
  257. },
  258. "&-ellipsis-single-line": {
  259. overflow: "hidden",
  260. textOverflow: "ellipsis",
  261. // https://blog.csdn.net/iefreer/article/details/50421025
  262. "a&, span&": {
  263. verticalAlign: "bottom"
  264. }
  265. },
  266. "&-ellipsis-multiple-line": {
  267. display: "-webkit-box",
  268. overflow: "hidden",
  269. WebkitLineClamp: 3,
  270. WebkitBoxOrient: "vertical"
  271. }
  272. }), yt = (e) => {
  273. const {
  274. componentCls: n,
  275. sizeMarginHeadingVerticalStart: o
  276. } = e;
  277. return {
  278. [n]: s(s(s(s(s(s(s(s(s({
  279. color: e.colorText,
  280. wordBreak: "break-word",
  281. lineHeight: e.lineHeight,
  282. [`&${n}-secondary`]: {
  283. color: e.colorTextDescription
  284. },
  285. [`&${n}-success`]: {
  286. color: e.colorSuccess
  287. },
  288. [`&${n}-warning`]: {
  289. color: e.colorWarning
  290. },
  291. [`&${n}-danger`]: {
  292. color: e.colorError,
  293. "a&:active, a&:focus": {
  294. color: e.colorErrorActive
  295. },
  296. "a&:hover": {
  297. color: e.colorErrorHover
  298. }
  299. },
  300. [`&${n}-disabled`]: {
  301. color: e.colorTextDisabled,
  302. cursor: "not-allowed",
  303. userSelect: "none"
  304. },
  305. "\n div&,\n p\n ": {
  306. marginBottom: "1em"
  307. }
  308. }, st(e)), {
  309. [`
  310. & + h1${n},
  311. & + h2${n},
  312. & + h3${n},
  313. & + h4${n},
  314. & + h5${n}
  315. `]: {
  316. marginTop: o
  317. },
  318. "\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5": {
  319. "\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ": {
  320. marginTop: o
  321. }
  322. }
  323. }), dt()), ct(e)), {
  324. // Operation
  325. [`
  326. ${n}-expand,
  327. ${n}-edit,
  328. ${n}-copy
  329. `]: s(s({}, Se(e)), {
  330. marginInlineStart: e.marginXXS
  331. })
  332. }), ut(e)), pt(e)), ft()), {
  333. "&-rtl": {
  334. direction: "rtl"
  335. }
  336. })
  337. };
  338. }, ke = Ke("Typography", (e) => [yt(e)], {
  339. sizeMarginHeadingVerticalStart: "1.2em",
  340. sizeMarginHeadingVerticalEnd: "0.5em"
  341. }), gt = () => ({
  342. prefixCls: String,
  343. value: String,
  344. maxlength: Number,
  345. autoSize: {
  346. type: [Boolean, Object]
  347. },
  348. onSave: Function,
  349. onCancel: Function,
  350. onEnd: Function,
  351. onChange: Function,
  352. originContent: String,
  353. direction: String,
  354. component: String
  355. }), mt = ie({
  356. compatConfig: {
  357. MODE: 3
  358. },
  359. name: "Editable",
  360. inheritAttrs: !1,
  361. props: gt(),
  362. // emits: ['save', 'cancel', 'end', 'change'],
  363. setup(e, n) {
  364. let {
  365. emit: o,
  366. slots: t,
  367. attrs: i
  368. } = n;
  369. const {
  370. prefixCls: d
  371. } = et(e), a = Oe({
  372. current: e.value || "",
  373. lastKeyCode: void 0,
  374. inComposition: !1,
  375. cancelFlag: !1
  376. });
  377. ue(() => e.value, (g) => {
  378. a.current = g;
  379. });
  380. const l = pe();
  381. fe(() => {
  382. var g;
  383. if (l.value) {
  384. const u = (g = l.value) === null || g === void 0 ? void 0 : g.resizableTextArea, h = u == null ? void 0 : u.textArea;
  385. h.focus();
  386. const {
  387. length: b
  388. } = h.value;
  389. h.setSelectionRange(b, b);
  390. }
  391. });
  392. function m(g) {
  393. l.value = g;
  394. }
  395. function C(g) {
  396. let {
  397. target: {
  398. value: u
  399. }
  400. } = g;
  401. a.current = u.replace(/[\r\n]/g, ""), o("change", a.current);
  402. }
  403. function y() {
  404. a.inComposition = !0;
  405. }
  406. function _() {
  407. a.inComposition = !1;
  408. }
  409. function v(g) {
  410. const {
  411. keyCode: u
  412. } = g;
  413. u === V.ENTER && g.preventDefault(), !a.inComposition && (a.lastKeyCode = u);
  414. }
  415. function S(g) {
  416. const {
  417. keyCode: u,
  418. ctrlKey: h,
  419. altKey: b,
  420. metaKey: O,
  421. shiftKey: H
  422. } = g;
  423. a.lastKeyCode === u && !a.inComposition && !h && !b && !O && !H && (u === V.ENTER ? (N(), o("end")) : u === V.ESC && (a.current = e.originContent, o("cancel")));
  424. }
  425. function I() {
  426. N();
  427. }
  428. function N() {
  429. o("save", a.current.trim());
  430. }
  431. const [$, R] = ke(d);
  432. return () => {
  433. const g = Te({
  434. [`${d.value}`]: !0,
  435. [`${d.value}-edit-content`]: !0,
  436. [`${d.value}-rtl`]: e.direction === "rtl",
  437. [e.component ? `${d.value}-${e.component}` : ""]: !0
  438. }, i.class, R.value);
  439. return $(f("div", B(B({}, i), {}, {
  440. class: g
  441. }), [f(We, {
  442. ref: m,
  443. maxlength: e.maxlength,
  444. value: a.current,
  445. onChange: C,
  446. onKeydown: v,
  447. onKeyup: S,
  448. onCompositionstart: y,
  449. onCompositionend: _,
  450. onBlur: I,
  451. rows: 1,
  452. autoSize: e.autoSize === void 0 || e.autoSize
  453. }, null), t.enterIcon ? t.enterIcon({
  454. className: `${e.prefixCls}-edit-content-confirm`
  455. }) : f(Ue, {
  456. class: `${e.prefixCls}-edit-content-confirm`
  457. }, null)]));
  458. };
  459. }
  460. }), bt = 3, ht = 8;
  461. let w;
  462. const de = {
  463. padding: 0,
  464. margin: 0,
  465. display: "inline",
  466. lineHeight: "inherit"
  467. };
  468. function _e(e, n) {
  469. e.setAttribute("aria-hidden", "true");
  470. const o = window.getComputedStyle(n), t = Fe(o);
  471. e.setAttribute("style", t), e.style.position = "fixed", e.style.left = "0", e.style.height = "auto", e.style.minHeight = "auto", e.style.maxHeight = "auto", e.style.paddingTop = "0", e.style.paddingBottom = "0", e.style.borderTopWidth = "0", e.style.borderBottomWidth = "0", e.style.top = "-999999px", e.style.zIndex = "-1000", e.style.textOverflow = "clip", e.style.whiteSpace = "normal", e.style.webkitLineClamp = "none";
  472. }
  473. function vt(e) {
  474. const n = document.createElement("div");
  475. _e(n, e), n.appendChild(document.createTextNode("text")), document.body.appendChild(n);
  476. const o = n.getBoundingClientRect().height;
  477. return document.body.removeChild(n), o;
  478. }
  479. const xt = (e, n, o, t, i) => {
  480. w || (w = document.createElement("div"), w.setAttribute("aria-hidden", "true"), document.body.appendChild(w));
  481. const {
  482. rows: d,
  483. suffix: a = ""
  484. } = n, l = vt(e), m = Math.round(l * d * 100) / 100;
  485. _e(w, e);
  486. const C = tt({
  487. render() {
  488. return f("div", {
  489. style: de
  490. }, [f("span", {
  491. style: de
  492. }, [o, a]), f("span", {
  493. style: de
  494. }, [t])]);
  495. }
  496. });
  497. C.mount(w);
  498. function y() {
  499. return Math.round(w.getBoundingClientRect().height * 100) / 100 - 0.1 <= m;
  500. }
  501. if (y())
  502. return C.unmount(), {
  503. content: o,
  504. text: w.innerHTML,
  505. ellipsis: !1
  506. };
  507. const _ = Array.prototype.slice.apply(w.childNodes[0].childNodes[0].cloneNode(!0).childNodes).filter((u) => {
  508. let {
  509. nodeType: h,
  510. data: b
  511. } = u;
  512. return h !== ht && b !== "";
  513. }), v = Array.prototype.slice.apply(w.childNodes[0].childNodes[1].cloneNode(!0).childNodes);
  514. C.unmount();
  515. const S = [];
  516. w.innerHTML = "";
  517. const I = document.createElement("span");
  518. w.appendChild(I);
  519. const N = document.createTextNode(i + a);
  520. I.appendChild(N), v.forEach((u) => {
  521. w.appendChild(u);
  522. });
  523. function $(u) {
  524. I.insertBefore(u, N);
  525. }
  526. function R(u, h) {
  527. let b = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, O = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : h.length, H = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0;
  528. const A = Math.floor((b + O) / 2), le = h.slice(0, A);
  529. if (u.textContent = le, b >= O - 1)
  530. for (let L = O; L >= b; L -= 1) {
  531. const U = h.slice(0, L);
  532. if (u.textContent = U, y() || !U)
  533. return L === h.length ? {
  534. finished: !1,
  535. vNode: h
  536. } : {
  537. finished: !0,
  538. vNode: U
  539. };
  540. }
  541. return y() ? R(u, h, A, O, A) : R(u, h, b, A, H);
  542. }
  543. function g(u) {
  544. if (u.nodeType === bt) {
  545. const b = u.textContent || "", O = document.createTextNode(b);
  546. return $(O), R(O, b);
  547. }
  548. return {
  549. finished: !1,
  550. vNode: null
  551. };
  552. }
  553. return _.some((u) => {
  554. const {
  555. finished: h,
  556. vNode: b
  557. } = g(u);
  558. return b && S.push(b), h;
  559. }), {
  560. content: S,
  561. text: w.innerHTML,
  562. ellipsis: !0
  563. };
  564. };
  565. var Ct = function(e, n) {
  566. var o = {};
  567. for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
  568. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
  569. n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]);
  570. return o;
  571. };
  572. const St = () => ({
  573. prefixCls: String,
  574. direction: String,
  575. // Form Internal use
  576. component: String
  577. }), E = ie({
  578. name: "ATypography",
  579. inheritAttrs: !1,
  580. props: St(),
  581. setup(e, n) {
  582. let {
  583. slots: o,
  584. attrs: t
  585. } = n;
  586. const {
  587. prefixCls: i,
  588. direction: d
  589. } = we("typography", e), [a, l] = ke(i);
  590. return () => {
  591. var m;
  592. const C = s(s({}, e), t), {
  593. prefixCls: y,
  594. direction: _,
  595. component: v = "article"
  596. } = C, S = Ct(C, ["prefixCls", "direction", "component"]);
  597. return a(f(v, B(B({}, S), {}, {
  598. class: Te(i.value, {
  599. [`${i.value}-rtl`]: d.value === "rtl"
  600. }, t.class, l.value)
  601. }), {
  602. default: () => [(m = o.default) === null || m === void 0 ? void 0 : m.call(o)]
  603. }));
  604. };
  605. }
  606. }), Tt = () => {
  607. const e = document.getSelection();
  608. if (!e.rangeCount)
  609. return function() {
  610. };
  611. let n = document.activeElement;
  612. const o = [];
  613. for (let t = 0; t < e.rangeCount; t++)
  614. o.push(e.getRangeAt(t));
  615. switch (n.tagName.toUpperCase()) {
  616. case "INPUT":
  617. case "TEXTAREA":
  618. n.blur();
  619. break;
  620. default:
  621. n = null;
  622. break;
  623. }
  624. return e.removeAllRanges(), function() {
  625. e.type === "Caret" && e.removeAllRanges(), e.rangeCount || o.forEach(function(t) {
  626. e.addRange(t);
  627. }), n && n.focus();
  628. };
  629. }, xe = {
  630. "text/plain": "Text",
  631. "text/html": "Url",
  632. default: "Text"
  633. }, wt = "Copy to clipboard: #{key}, Enter";
  634. function Et(e) {
  635. const n = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
  636. return e.replace(/#{\s*key\s*}/g, n);
  637. }
  638. function Ot(e, n) {
  639. let o, t, i, d, a, l = !1;
  640. n || (n = {});
  641. const m = n.debug || !1;
  642. try {
  643. if (t = Tt(), i = document.createRange(), d = document.getSelection(), a = document.createElement("span"), a.textContent = e, a.style.all = "unset", a.style.position = "fixed", a.style.top = 0, a.style.clip = "rect(0, 0, 0, 0)", a.style.whiteSpace = "pre", a.style.webkitUserSelect = "text", a.style.MozUserSelect = "text", a.style.msUserSelect = "text", a.style.userSelect = "text", a.addEventListener("copy", function(y) {
  644. if (y.stopPropagation(), n.format)
  645. if (y.preventDefault(), typeof y.clipboardData == "undefined") {
  646. m && console.warn("unable to use e.clipboardData"), m && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
  647. const _ = xe[n.format] || xe.default;
  648. window.clipboardData.setData(_, e);
  649. } else
  650. y.clipboardData.clearData(), y.clipboardData.setData(n.format, e);
  651. n.onCopy && (y.preventDefault(), n.onCopy(y.clipboardData));
  652. }), document.body.appendChild(a), i.selectNodeContents(a), d.addRange(i), !document.execCommand("copy"))
  653. throw new Error("copy command was unsuccessful");
  654. l = !0;
  655. } catch (C) {
  656. m && console.error("unable to copy using execCommand: ", C), m && console.warn("trying IE specific stuff");
  657. try {
  658. window.clipboardData.setData(n.format || "text", e), n.onCopy && n.onCopy(window.clipboardData), l = !0;
  659. } catch (y) {
  660. m && console.error("unable to copy using clipboardData: ", y), m && console.error("falling back to prompt"), o = Et("message" in n ? n.message : wt), window.prompt(o, e);
  661. }
  662. } finally {
  663. d && (typeof d.removeRange == "function" ? d.removeRange(i) : d.removeAllRanges()), a && document.body.removeChild(a), t();
  664. }
  665. return l;
  666. }
  667. var kt = function(e, n) {
  668. var o = {};
  669. for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
  670. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
  671. n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]);
  672. return o;
  673. };
  674. const _t = Ee("webkitLineClamp"), Nt = Ee("textOverflow"), Ce = "...", q = () => ({
  675. editable: {
  676. type: [Boolean, Object],
  677. default: void 0
  678. },
  679. copyable: {
  680. type: [Boolean, Object],
  681. default: void 0
  682. },
  683. prefixCls: String,
  684. component: String,
  685. type: String,
  686. disabled: {
  687. type: Boolean,
  688. default: void 0
  689. },
  690. ellipsis: {
  691. type: [Boolean, Object],
  692. default: void 0
  693. },
  694. code: {
  695. type: Boolean,
  696. default: void 0
  697. },
  698. mark: {
  699. type: Boolean,
  700. default: void 0
  701. },
  702. underline: {
  703. type: Boolean,
  704. default: void 0
  705. },
  706. delete: {
  707. type: Boolean,
  708. default: void 0
  709. },
  710. strong: {
  711. type: Boolean,
  712. default: void 0
  713. },
  714. keyboard: {
  715. type: Boolean,
  716. default: void 0
  717. },
  718. content: String,
  719. "onUpdate:content": Function
  720. }), Q = ie({
  721. compatConfig: {
  722. MODE: 3
  723. },
  724. name: "TypographyBase",
  725. inheritAttrs: !1,
  726. props: q(),
  727. // emits: ['update:content'],
  728. setup(e, n) {
  729. let {
  730. slots: o,
  731. attrs: t,
  732. emit: i
  733. } = n;
  734. const {
  735. prefixCls: d,
  736. direction: a
  737. } = we("typography", e), l = Oe({
  738. copied: !1,
  739. ellipsisText: "",
  740. ellipsisContent: null,
  741. isEllipsis: !1,
  742. expanded: !1,
  743. clientRendered: !1,
  744. //locale
  745. expandStr: "",
  746. copyStr: "",
  747. copiedStr: "",
  748. editStr: "",
  749. copyId: void 0,
  750. rafId: void 0,
  751. prevProps: void 0,
  752. originContent: ""
  753. }), m = pe(), C = pe(), y = oe(() => {
  754. const r = e.ellipsis;
  755. return r ? s({
  756. rows: 1,
  757. expandable: !1
  758. }, typeof r == "object" ? r : null) : {};
  759. });
  760. fe(() => {
  761. l.clientRendered = !0, A();
  762. }), nt(() => {
  763. clearTimeout(l.copyId), ae.cancel(l.rafId);
  764. }), ue([() => y.value.rows, () => e.content], () => {
  765. be(() => {
  766. O();
  767. });
  768. }, {
  769. flush: "post",
  770. deep: !0
  771. }), ot(() => {
  772. e.content === void 0 && (X(!e.editable, "Typography", "When `editable` is enabled, please use `content` instead of children"), X(!e.ellipsis, "Typography", "When `ellipsis` is enabled, please use `content` instead of children"));
  773. });
  774. function _() {
  775. var r;
  776. return e.ellipsis || e.editable ? e.content : (r = se(m.value)) === null || r === void 0 ? void 0 : r.innerText;
  777. }
  778. function v(r) {
  779. const {
  780. onExpand: c
  781. } = y.value;
  782. l.expanded = !0, c == null || c(r);
  783. }
  784. function S(r) {
  785. r.preventDefault(), l.originContent = e.content, b(!0);
  786. }
  787. function I(r) {
  788. N(r), b(!1);
  789. }
  790. function N(r) {
  791. const {
  792. onChange: c
  793. } = g.value;
  794. r !== e.content && (i("update:content", r), c == null || c(r));
  795. }
  796. function $() {
  797. var r, c;
  798. (c = (r = g.value).onCancel) === null || c === void 0 || c.call(r), b(!1);
  799. }
  800. function R(r) {
  801. r.preventDefault(), r.stopPropagation();
  802. const {
  803. copyable: c
  804. } = e, p = s({}, typeof c == "object" ? c : null);
  805. p.text === void 0 && (p.text = _()), Ot(p.text || ""), l.copied = !0, be(() => {
  806. p.onCopy && p.onCopy(r), l.copyId = setTimeout(() => {
  807. l.copied = !1;
  808. }, 3e3);
  809. });
  810. }
  811. const g = oe(() => {
  812. const r = e.editable;
  813. return r ? s({}, typeof r == "object" ? r : null) : {
  814. editing: !1
  815. };
  816. }), [u, h] = Ve(!1, {
  817. value: oe(() => g.value.editing)
  818. });
  819. function b(r) {
  820. const {
  821. onStart: c
  822. } = g.value;
  823. r && c && c(), h(r);
  824. }
  825. ue(u, (r) => {
  826. var c;
  827. r || (c = C.value) === null || c === void 0 || c.focus();
  828. }, {
  829. flush: "post"
  830. });
  831. function O(r) {
  832. if (r) {
  833. const {
  834. width: c,
  835. height: p
  836. } = r;
  837. if (!c || !p) return;
  838. }
  839. ae.cancel(l.rafId), l.rafId = ae(() => {
  840. A();
  841. });
  842. }
  843. const H = oe(() => {
  844. const {
  845. rows: r,
  846. expandable: c,
  847. suffix: p,
  848. onEllipsis: x,
  849. tooltip: T
  850. } = y.value;
  851. return p || T || e.editable || e.copyable || c || x ? !1 : r === 1 ? Nt : _t;
  852. }), A = () => {
  853. const {
  854. ellipsisText: r,
  855. isEllipsis: c
  856. } = l, {
  857. rows: p,
  858. suffix: x,
  859. onEllipsis: T
  860. } = y.value;
  861. if (!p || p < 0 || !se(m.value) || l.expanded || e.content === void 0 || H.value) return;
  862. const {
  863. content: P,
  864. text: z,
  865. ellipsis: j
  866. } = xt(se(m.value), {
  867. rows: p,
  868. suffix: x
  869. }, e.content, ye(!0), Ce);
  870. (r !== z || l.isEllipsis !== j) && (l.ellipsisText = z, l.ellipsisContent = P, l.isEllipsis = j, c !== j && T && T(j));
  871. };
  872. function le(r, c) {
  873. let {
  874. mark: p,
  875. code: x,
  876. underline: T,
  877. delete: P,
  878. strong: z,
  879. keyboard: j
  880. } = r, F = c;
  881. function D(ee, k) {
  882. if (!ee) return;
  883. const te = /* @__PURE__ */ function() {
  884. return F;
  885. }();
  886. F = f(k, null, {
  887. default: () => [te]
  888. });
  889. }
  890. return D(z, "strong"), D(T, "u"), D(P, "del"), D(x, "code"), D(p, "mark"), D(j, "kbd"), F;
  891. }
  892. function L(r) {
  893. const {
  894. expandable: c,
  895. symbol: p
  896. } = y.value;
  897. if (!c || !r && (l.expanded || !l.isEllipsis)) return null;
  898. const x = (o.ellipsisSymbol ? o.ellipsisSymbol() : p) || l.expandStr;
  899. return f("a", {
  900. key: "expand",
  901. class: `${d.value}-expand`,
  902. onClick: v,
  903. "aria-label": l.expandStr
  904. }, [x]);
  905. }
  906. function U() {
  907. if (!e.editable) return;
  908. const {
  909. tooltip: r,
  910. triggerType: c = ["icon"]
  911. } = e.editable, p = o.editableIcon ? o.editableIcon() : f(Qe, {
  912. role: "button"
  913. }, null), x = o.editableTooltip ? o.editableTooltip() : l.editStr, T = typeof x == "string" ? x : "";
  914. return c.indexOf("icon") !== -1 ? f(ce, {
  915. key: "edit",
  916. title: r === !1 ? "" : x
  917. }, {
  918. default: () => [f(ve, {
  919. ref: C,
  920. class: `${d.value}-edit`,
  921. onClick: S,
  922. "aria-label": T
  923. }, {
  924. default: () => [p]
  925. })]
  926. }) : null;
  927. }
  928. function Ne() {
  929. if (!e.copyable) return;
  930. const {
  931. tooltip: r
  932. } = e.copyable, c = l.copied ? l.copiedStr : l.copyStr, p = o.copyableTooltip ? o.copyableTooltip({
  933. copied: l.copied
  934. }) : c, x = typeof p == "string" ? p : "", T = l.copied ? f(Ge, null, null) : f(Je, null, null), P = o.copyableIcon ? o.copyableIcon({
  935. copied: !!l.copied
  936. }) : T;
  937. return f(ce, {
  938. key: "copy",
  939. title: r === !1 ? "" : p
  940. }, {
  941. default: () => [f(ve, {
  942. class: [`${d.value}-copy`, {
  943. [`${d.value}-copy-success`]: l.copied
  944. }],
  945. onClick: R,
  946. "aria-label": x
  947. }, {
  948. default: () => [P]
  949. })]
  950. });
  951. }
  952. function Ie() {
  953. const {
  954. class: r,
  955. style: c
  956. } = t, {
  957. maxlength: p,
  958. autoSize: x,
  959. onEnd: T
  960. } = g.value;
  961. return f(mt, {
  962. class: r,
  963. style: c,
  964. prefixCls: d.value,
  965. value: e.content,
  966. originContent: l.originContent,
  967. maxlength: p,
  968. autoSize: x,
  969. onSave: I,
  970. onChange: N,
  971. onCancel: $,
  972. onEnd: T,
  973. direction: a.value,
  974. component: e.component
  975. }, {
  976. enterIcon: o.editableEnterIcon
  977. });
  978. }
  979. function ye(r) {
  980. return [L(r), U(), Ne()].filter((c) => c);
  981. }
  982. return () => {
  983. var r;
  984. const {
  985. triggerType: c = ["icon"]
  986. } = g.value, p = e.ellipsis || e.editable ? e.content !== void 0 ? e.content : (r = o.default) === null || r === void 0 ? void 0 : r.call(o) : o.default ? o.default() : e.content;
  987. return u.value ? Ie() : f(Xe, {
  988. componentName: "Text",
  989. children: (x) => {
  990. const T = s(s({}, e), t), {
  991. type: P,
  992. disabled: z,
  993. content: j,
  994. class: F,
  995. style: D
  996. } = T, ee = kt(T, ["type", "disabled", "content", "class", "style"]), {
  997. rows: k,
  998. suffix: te,
  999. tooltip: re
  1000. } = y.value, {
  1001. edit: $e,
  1002. copy: Pe,
  1003. copied: De,
  1004. expand: Be
  1005. } = x;
  1006. l.editStr = $e, l.copyStr = Pe, l.copiedStr = De, l.expandStr = Be;
  1007. const Re = W(ee, ["prefixCls", "editable", "copyable", "ellipsis", "mark", "code", "delete", "underline", "strong", "keyboard", "onUpdate:content"]), ne = H.value, Ae = k === 1 && ne, ge = k && k > 1 && ne;
  1008. let M = p, je;
  1009. if (k && l.isEllipsis && !l.expanded && !ne) {
  1010. const {
  1011. title: me
  1012. } = ee;
  1013. let K = me || "";
  1014. !me && (typeof p == "string" || typeof p == "number") && (K = String(p)), K = K == null ? void 0 : K.slice(String(l.ellipsisContent || "").length), M = f(he, null, [it(l.ellipsisContent), f("span", {
  1015. title: K,
  1016. "aria-hidden": "true"
  1017. }, [Ce]), te]);
  1018. } else
  1019. M = f(he, null, [p, te]);
  1020. M = le(e, M);
  1021. const He = re && k && l.isEllipsis && !l.expanded && !ne, Le = o.ellipsisTooltip ? o.ellipsisTooltip() : re;
  1022. return f(qe, {
  1023. onResize: O,
  1024. disabled: !k
  1025. }, {
  1026. default: () => [f(E, B({
  1027. ref: m,
  1028. class: [{
  1029. [`${d.value}-${P}`]: P,
  1030. [`${d.value}-disabled`]: z,
  1031. [`${d.value}-ellipsis`]: k,
  1032. [`${d.value}-single-line`]: k === 1 && !l.isEllipsis,
  1033. [`${d.value}-ellipsis-single-line`]: Ae,
  1034. [`${d.value}-ellipsis-multiple-line`]: ge
  1035. }, F],
  1036. style: s(s({}, D), {
  1037. WebkitLineClamp: ge ? k : void 0
  1038. }),
  1039. "aria-label": je,
  1040. direction: a.value,
  1041. onClick: c.indexOf("text") !== -1 ? S : () => {
  1042. }
  1043. }, Re), {
  1044. default: () => [He ? f(ce, {
  1045. title: re === !0 ? p : Le
  1046. }, {
  1047. default: () => [f("span", null, [M])]
  1048. }) : M, ye()]
  1049. })]
  1050. });
  1051. }
  1052. }, null);
  1053. };
  1054. }
  1055. });
  1056. var It = function(e, n) {
  1057. var o = {};
  1058. for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
  1059. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
  1060. n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]);
  1061. return o;
  1062. };
  1063. const $t = () => W(s(s({}, q()), {
  1064. ellipsis: {
  1065. type: Boolean,
  1066. default: void 0
  1067. }
  1068. }), ["component"]), G = (e, n) => {
  1069. let {
  1070. slots: o,
  1071. attrs: t
  1072. } = n;
  1073. const i = s(s({}, e), t), {
  1074. ellipsis: d,
  1075. rel: a
  1076. } = i, l = It(i, ["ellipsis", "rel"]);
  1077. X(typeof d != "object", "Typography.Link", "`ellipsis` only supports boolean value.");
  1078. const m = s(s({}, l), {
  1079. rel: a === void 0 && l.target === "_blank" ? "noopener noreferrer" : a,
  1080. ellipsis: !!d,
  1081. component: "a"
  1082. });
  1083. return delete m.navigate, f(Q, m, o);
  1084. };
  1085. G.displayName = "ATypographyLink";
  1086. G.inheritAttrs = !1;
  1087. G.props = $t();
  1088. const Pt = () => W(q(), ["component"]), J = (e, n) => {
  1089. let {
  1090. slots: o,
  1091. attrs: t
  1092. } = n;
  1093. const i = s(s(s({}, e), {
  1094. component: "div"
  1095. }), t);
  1096. return f(Q, i, o);
  1097. };
  1098. J.displayName = "ATypographyParagraph";
  1099. J.inheritAttrs = !1;
  1100. J.props = Pt();
  1101. const Dt = () => s(s({}, W(q(), ["component"])), {
  1102. ellipsis: {
  1103. type: [Boolean, Object],
  1104. default: void 0
  1105. }
  1106. }), Y = (e, n) => {
  1107. let {
  1108. slots: o,
  1109. attrs: t
  1110. } = n;
  1111. const {
  1112. ellipsis: i
  1113. } = e;
  1114. X(typeof i != "object" || !i || !("expandable" in i) && !("rows" in i), "Typography.Text", "`ellipsis` do not support `expandable` or `rows` props.");
  1115. const d = s(s(s({}, e), {
  1116. ellipsis: i && typeof i == "object" ? W(i, ["expandable", "rows"]) : i,
  1117. component: "span"
  1118. }), t);
  1119. return f(Q, d, o);
  1120. };
  1121. Y.displayName = "ATypographyText";
  1122. Y.inheritAttrs = !1;
  1123. Y.props = Dt();
  1124. var Bt = function(e, n) {
  1125. var o = {};
  1126. for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
  1127. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
  1128. n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]);
  1129. return o;
  1130. };
  1131. const Rt = Ye(1, 2, 3, 4, 5), At = () => s(s({}, W(q(), ["component", "strong"])), {
  1132. level: Number
  1133. }), Z = (e, n) => {
  1134. let {
  1135. slots: o,
  1136. attrs: t
  1137. } = n;
  1138. const {
  1139. level: i = 1
  1140. } = e, d = Bt(e, ["level"]);
  1141. let a;
  1142. Rt.includes(i) ? a = `h${i}` : (X(!1, "Typography", "Title only accept `1 | 2 | 3 | 4 | 5` as `level` value."), a = "h1");
  1143. const l = s(s(s({}, d), {
  1144. component: a
  1145. }), t);
  1146. return f(Q, l, o);
  1147. };
  1148. Z.displayName = "ATypographyTitle";
  1149. Z.inheritAttrs = !1;
  1150. Z.props = At();
  1151. E.Text = Y;
  1152. E.Title = Z;
  1153. E.Paragraph = J;
  1154. E.Link = G;
  1155. E.Base = Q;
  1156. E.install = function(e) {
  1157. return e.component(E.name, E), e.component(E.Text.displayName, Y), e.component(E.Title.displayName, Z), e.component(E.Paragraph.displayName, J), e.component(E.Link.displayName, G), e;
  1158. };
  1159. export {
  1160. J as P,
  1161. Z as T,
  1162. Y as a
  1163. };