SUserSelect.js 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320
  1. var Me = (e, n, t) => new Promise((o, a) => {
  2. var f = (r) => {
  3. try {
  4. l(t.next(r));
  5. } catch (u) {
  6. a(u);
  7. }
  8. }, d = (r) => {
  9. try {
  10. l(t.throw(r));
  11. } catch (u) {
  12. a(u);
  13. }
  14. }, l = (r) => r.done ? o(r.value) : Promise.resolve(r.value).then(f, d);
  15. l((t = t.apply(e, n)).next());
  16. });
  17. import { defineComponent as ee, ref as W, createVNode as b, shallowRef as Y, watch as de, computed as J, onMounted as Ge, Fragment as ye, nextTick as $e, onBeforeUpdate as ft, onBeforeUnmount as Ee, watchEffect as Be, getCurrentInstance as Ue, resolveComponent as we, resolveDirective as pt, withDirectives as vt, openBlock as ie, createElementBlock as se, withCtx as Q, createTextVNode as me, createElementVNode as N, toDisplayString as q, withModifiers as gt, renderList as Fe, normalizeClass as ht, createCommentVNode as mt } from "vue";
  18. import { g as bt, l as xt, a as yt } from "./common.js";
  19. import { g as $t, f as St, _ as p, J as Xe, I as Se, a3 as Ct, $ as Ke, P as te, A as wt, c as ae, m as G, a as D, o as k, be as Ve, j as ve, k as _t, l as Ye, N as Ze, bf as je, aY as It, B as Je, aD as zt, E as oe, b6 as be, aJ as Rt, b5 as Et, i as At, X as Pt, bg as Bt, bh as Ot, aN as Tt, bi as Ht } from "./index2.js";
  20. import { u as Qe, F as pe, N as We } from "./FormItemContext.js";
  21. import { B as qe, g as Oe, a as ue } from "./statusUtils.js";
  22. import { i as Nt } from "./isPlainObject.js";
  23. import { M as Mt } from "./index7.js";
  24. const Ft = (e) => ({
  25. // Firefox
  26. "&::-moz-placeholder": {
  27. opacity: 1
  28. },
  29. "&::placeholder": {
  30. color: e,
  31. userSelect: "none"
  32. // https://github.com/ant-design/ant-design/pull/32639
  33. },
  34. "&:placeholder-shown": {
  35. textOverflow: "ellipsis"
  36. }
  37. }), Te = (e) => ({
  38. borderColor: e.inputBorderHoverColor,
  39. borderInlineEndWidth: e.lineWidth
  40. }), Ae = (e) => ({
  41. borderColor: e.inputBorderHoverColor,
  42. boxShadow: `0 0 0 ${e.controlOutlineWidth}px ${e.controlOutline}`,
  43. borderInlineEndWidth: e.lineWidth,
  44. outline: 0
  45. }), Vt = (e) => ({
  46. color: e.colorTextDisabled,
  47. backgroundColor: e.colorBgContainerDisabled,
  48. borderColor: e.colorBorder,
  49. boxShadow: "none",
  50. cursor: "not-allowed",
  51. opacity: 1,
  52. "&:hover": p({}, Te(Se(e, {
  53. inputBorderHoverColor: e.colorBorder
  54. })))
  55. }), ke = (e) => {
  56. const {
  57. inputPaddingVerticalLG: n,
  58. fontSizeLG: t,
  59. lineHeightLG: o,
  60. borderRadiusLG: a,
  61. inputPaddingHorizontalLG: f
  62. } = e;
  63. return {
  64. padding: `${n}px ${f}px`,
  65. fontSize: t,
  66. lineHeight: o,
  67. borderRadius: a
  68. };
  69. }, et = (e) => ({
  70. padding: `${e.inputPaddingVerticalSM}px ${e.controlPaddingHorizontalSM - 1}px`,
  71. borderRadius: e.borderRadiusSM
  72. }), tt = (e, n) => {
  73. const {
  74. componentCls: t,
  75. colorError: o,
  76. colorWarning: a,
  77. colorErrorOutline: f,
  78. colorWarningOutline: d,
  79. colorErrorBorderHover: l,
  80. colorWarningBorderHover: r
  81. } = e;
  82. return {
  83. [`&-status-error:not(${n}-disabled):not(${n}-borderless)${n}`]: {
  84. borderColor: o,
  85. "&:hover": {
  86. borderColor: l
  87. },
  88. "&:focus, &-focused": p({}, Ae(Se(e, {
  89. inputBorderActiveColor: o,
  90. inputBorderHoverColor: o,
  91. controlOutline: f
  92. }))),
  93. [`${t}-prefix`]: {
  94. color: o
  95. }
  96. },
  97. [`&-status-warning:not(${n}-disabled):not(${n}-borderless)${n}`]: {
  98. borderColor: a,
  99. "&:hover": {
  100. borderColor: r
  101. },
  102. "&:focus, &-focused": p({}, Ae(Se(e, {
  103. inputBorderActiveColor: a,
  104. inputBorderHoverColor: a,
  105. controlOutline: d
  106. }))),
  107. [`${t}-prefix`]: {
  108. color: a
  109. }
  110. }
  111. };
  112. }, nt = (e) => p(p({
  113. position: "relative",
  114. display: "inline-block",
  115. width: "100%",
  116. minWidth: 0,
  117. padding: `${e.inputPaddingVertical}px ${e.inputPaddingHorizontal}px`,
  118. color: e.colorText,
  119. fontSize: e.fontSize,
  120. lineHeight: e.lineHeight,
  121. backgroundColor: e.colorBgContainer,
  122. backgroundImage: "none",
  123. borderWidth: e.lineWidth,
  124. borderStyle: e.lineType,
  125. borderColor: e.colorBorder,
  126. borderRadius: e.borderRadius,
  127. transition: `all ${e.motionDurationMid}`
  128. }, Ft(e.colorTextPlaceholder)), {
  129. "&:hover": p({}, Te(e)),
  130. "&:focus, &-focused": p({}, Ae(e)),
  131. "&-disabled, &[disabled]": p({}, Vt(e)),
  132. "&-borderless": {
  133. "&, &:hover, &:focus, &-focused, &-disabled, &[disabled]": {
  134. backgroundColor: "transparent",
  135. border: "none",
  136. boxShadow: "none"
  137. }
  138. },
  139. // Reset height for `textarea`s
  140. "textarea&": {
  141. maxWidth: "100%",
  142. height: "auto",
  143. minHeight: e.controlHeight,
  144. lineHeight: e.lineHeight,
  145. verticalAlign: "bottom",
  146. transition: `all ${e.motionDurationSlow}, height 0s`,
  147. resize: "vertical"
  148. },
  149. // Size
  150. "&-lg": p({}, ke(e)),
  151. "&-sm": p({}, et(e)),
  152. // RTL
  153. "&-rtl": {
  154. direction: "rtl"
  155. },
  156. "&-textarea-rtl": {
  157. direction: "rtl"
  158. }
  159. }), jt = (e) => {
  160. const {
  161. componentCls: n,
  162. antCls: t
  163. } = e;
  164. return {
  165. position: "relative",
  166. display: "table",
  167. width: "100%",
  168. borderCollapse: "separate",
  169. borderSpacing: 0,
  170. // Undo padding and float of grid classes
  171. "&[class*='col-']": {
  172. paddingInlineEnd: e.paddingXS,
  173. "&:last-child": {
  174. paddingInlineEnd: 0
  175. }
  176. },
  177. // Sizing options
  178. [`&-lg ${n}, &-lg > ${n}-group-addon`]: p({}, ke(e)),
  179. [`&-sm ${n}, &-sm > ${n}-group-addon`]: p({}, et(e)),
  180. [`> ${n}`]: {
  181. display: "table-cell",
  182. "&:not(:first-child):not(:last-child)": {
  183. borderRadius: 0
  184. }
  185. },
  186. [`${n}-group`]: {
  187. "&-addon, &-wrap": {
  188. display: "table-cell",
  189. width: 1,
  190. whiteSpace: "nowrap",
  191. verticalAlign: "middle",
  192. "&:not(:first-child):not(:last-child)": {
  193. borderRadius: 0
  194. }
  195. },
  196. "&-wrap > *": {
  197. display: "block !important"
  198. },
  199. "&-addon": {
  200. position: "relative",
  201. padding: `0 ${e.inputPaddingHorizontal}px`,
  202. color: e.colorText,
  203. fontWeight: "normal",
  204. fontSize: e.fontSize,
  205. textAlign: "center",
  206. backgroundColor: e.colorFillAlter,
  207. border: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,
  208. borderRadius: e.borderRadius,
  209. transition: `all ${e.motionDurationSlow}`,
  210. lineHeight: 1,
  211. // Reset Select's style in addon
  212. [`${t}-select`]: {
  213. margin: `-${e.inputPaddingVertical + 1}px -${e.inputPaddingHorizontal}px`,
  214. [`&${t}-select-single:not(${t}-select-customize-input)`]: {
  215. [`${t}-select-selector`]: {
  216. backgroundColor: "inherit",
  217. border: `${e.lineWidth}px ${e.lineType} transparent`,
  218. boxShadow: "none"
  219. }
  220. },
  221. "&-open, &-focused": {
  222. [`${t}-select-selector`]: {
  223. color: e.colorPrimary
  224. }
  225. }
  226. },
  227. // https://github.com/ant-design/ant-design/issues/31333
  228. [`${t}-cascader-picker`]: {
  229. margin: `-9px -${e.inputPaddingHorizontal}px`,
  230. backgroundColor: "transparent",
  231. [`${t}-cascader-input`]: {
  232. textAlign: "start",
  233. border: 0,
  234. boxShadow: "none"
  235. }
  236. }
  237. },
  238. "&-addon:first-child": {
  239. borderInlineEnd: 0
  240. },
  241. "&-addon:last-child": {
  242. borderInlineStart: 0
  243. }
  244. },
  245. [`${n}`]: {
  246. float: "inline-start",
  247. width: "100%",
  248. marginBottom: 0,
  249. textAlign: "inherit",
  250. "&:focus": {
  251. zIndex: 1,
  252. borderInlineEndWidth: 1
  253. },
  254. "&:hover": {
  255. zIndex: 1,
  256. borderInlineEndWidth: 1,
  257. [`${n}-search-with-button &`]: {
  258. zIndex: 0
  259. }
  260. }
  261. },
  262. // Reset rounded corners
  263. [`> ${n}:first-child, ${n}-group-addon:first-child`]: {
  264. borderStartEndRadius: 0,
  265. borderEndEndRadius: 0,
  266. // Reset Select's style in addon
  267. [`${t}-select ${t}-select-selector`]: {
  268. borderStartEndRadius: 0,
  269. borderEndEndRadius: 0
  270. }
  271. },
  272. [`> ${n}-affix-wrapper`]: {
  273. [`&:not(:first-child) ${n}`]: {
  274. borderStartStartRadius: 0,
  275. borderEndStartRadius: 0
  276. },
  277. [`&:not(:last-child) ${n}`]: {
  278. borderStartEndRadius: 0,
  279. borderEndEndRadius: 0
  280. }
  281. },
  282. [`> ${n}:last-child, ${n}-group-addon:last-child`]: {
  283. borderStartStartRadius: 0,
  284. borderEndStartRadius: 0,
  285. // Reset Select's style in addon
  286. [`${t}-select ${t}-select-selector`]: {
  287. borderStartStartRadius: 0,
  288. borderEndStartRadius: 0
  289. }
  290. },
  291. [`${n}-affix-wrapper`]: {
  292. "&:not(:last-child)": {
  293. borderStartEndRadius: 0,
  294. borderEndEndRadius: 0,
  295. [`${n}-search &`]: {
  296. borderStartStartRadius: e.borderRadius,
  297. borderEndStartRadius: e.borderRadius
  298. }
  299. },
  300. [`&:not(:first-child), ${n}-search &:not(:first-child)`]: {
  301. borderStartStartRadius: 0,
  302. borderEndStartRadius: 0
  303. }
  304. },
  305. [`&${n}-group-compact`]: p(p({
  306. display: "block"
  307. }, Ct()), {
  308. [`${n}-group-addon, ${n}-group-wrap, > ${n}`]: {
  309. "&:not(:first-child):not(:last-child)": {
  310. borderInlineEndWidth: e.lineWidth,
  311. "&:hover": {
  312. zIndex: 1
  313. },
  314. "&:focus": {
  315. zIndex: 1
  316. }
  317. }
  318. },
  319. "& > *": {
  320. display: "inline-block",
  321. float: "none",
  322. verticalAlign: "top",
  323. borderRadius: 0
  324. },
  325. [`& > ${n}-affix-wrapper`]: {
  326. display: "inline-flex"
  327. },
  328. [`& > ${t}-picker-range`]: {
  329. display: "inline-flex"
  330. },
  331. "& > *:not(:last-child)": {
  332. marginInlineEnd: -e.lineWidth,
  333. borderInlineEndWidth: e.lineWidth
  334. },
  335. // Undo float for .ant-input-group .ant-input
  336. [`${n}`]: {
  337. float: "none"
  338. },
  339. // reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker, Input
  340. [`& > ${t}-select > ${t}-select-selector,
  341. & > ${t}-select-auto-complete ${n},
  342. & > ${t}-cascader-picker ${n},
  343. & > ${n}-group-wrapper ${n}`]: {
  344. borderInlineEndWidth: e.lineWidth,
  345. borderRadius: 0,
  346. "&:hover": {
  347. zIndex: 1
  348. },
  349. "&:focus": {
  350. zIndex: 1
  351. }
  352. },
  353. [`& > ${t}-select-focused`]: {
  354. zIndex: 1
  355. },
  356. // update z-index for arrow icon
  357. [`& > ${t}-select > ${t}-select-arrow`]: {
  358. zIndex: 1
  359. // https://github.com/ant-design/ant-design/issues/20371
  360. },
  361. [`& > *:first-child,
  362. & > ${t}-select:first-child > ${t}-select-selector,
  363. & > ${t}-select-auto-complete:first-child ${n},
  364. & > ${t}-cascader-picker:first-child ${n}`]: {
  365. borderStartStartRadius: e.borderRadius,
  366. borderEndStartRadius: e.borderRadius
  367. },
  368. [`& > *:last-child,
  369. & > ${t}-select:last-child > ${t}-select-selector,
  370. & > ${t}-cascader-picker:last-child ${n},
  371. & > ${t}-cascader-picker-focused:last-child ${n}`]: {
  372. borderInlineEndWidth: e.lineWidth,
  373. borderStartEndRadius: e.borderRadius,
  374. borderEndEndRadius: e.borderRadius
  375. },
  376. // https://github.com/ant-design/ant-design/issues/12493
  377. [`& > ${t}-select-auto-complete ${n}`]: {
  378. verticalAlign: "top"
  379. },
  380. [`${n}-group-wrapper + ${n}-group-wrapper`]: {
  381. marginInlineStart: -e.lineWidth,
  382. [`${n}-affix-wrapper`]: {
  383. borderRadius: 0
  384. }
  385. },
  386. [`${n}-group-wrapper:not(:last-child)`]: {
  387. [`&${n}-search > ${n}-group`]: {
  388. [`& > ${n}-group-addon > ${n}-search-button`]: {
  389. borderRadius: 0
  390. },
  391. [`& > ${n}`]: {
  392. borderStartStartRadius: e.borderRadius,
  393. borderStartEndRadius: 0,
  394. borderEndEndRadius: 0,
  395. borderEndStartRadius: e.borderRadius
  396. }
  397. }
  398. }
  399. }),
  400. [`&&-sm ${t}-btn`]: {
  401. fontSize: e.fontSizeSM,
  402. height: e.controlHeightSM,
  403. lineHeight: "normal"
  404. },
  405. [`&&-lg ${t}-btn`]: {
  406. fontSize: e.fontSizeLG,
  407. height: e.controlHeightLG,
  408. lineHeight: "normal"
  409. },
  410. // Fix https://github.com/ant-design/ant-design/issues/5754
  411. [`&&-lg ${t}-select-single ${t}-select-selector`]: {
  412. height: `${e.controlHeightLG}px`,
  413. [`${t}-select-selection-item, ${t}-select-selection-placeholder`]: {
  414. // -2 is for the border size & override default
  415. lineHeight: `${e.controlHeightLG - 2}px`
  416. },
  417. [`${t}-select-selection-search-input`]: {
  418. height: `${e.controlHeightLG}px`
  419. }
  420. },
  421. [`&&-sm ${t}-select-single ${t}-select-selector`]: {
  422. height: `${e.controlHeightSM}px`,
  423. [`${t}-select-selection-item, ${t}-select-selection-placeholder`]: {
  424. // -2 is for the border size & override default
  425. lineHeight: `${e.controlHeightSM - 2}px`
  426. },
  427. [`${t}-select-selection-search-input`]: {
  428. height: `${e.controlHeightSM}px`
  429. }
  430. }
  431. };
  432. }, Wt = (e) => {
  433. const {
  434. componentCls: n,
  435. controlHeightSM: t,
  436. lineWidth: o
  437. } = e, f = (t - o * 2 - 16) / 2;
  438. return {
  439. [n]: p(p(p(p({}, Xe(e)), nt(e)), tt(e, n)), {
  440. '&[type="color"]': {
  441. height: e.controlHeight,
  442. [`&${n}-lg`]: {
  443. height: e.controlHeightLG
  444. },
  445. [`&${n}-sm`]: {
  446. height: t,
  447. paddingTop: f,
  448. paddingBottom: f
  449. }
  450. }
  451. })
  452. };
  453. }, Dt = (e) => {
  454. const {
  455. componentCls: n
  456. } = e;
  457. return {
  458. // ========================= Input =========================
  459. [`${n}-clear-icon`]: {
  460. margin: 0,
  461. color: e.colorTextQuaternary,
  462. fontSize: e.fontSizeIcon,
  463. verticalAlign: -1,
  464. // https://github.com/ant-design/ant-design/pull/18151
  465. // https://codesandbox.io/s/wizardly-sun-u10br
  466. cursor: "pointer",
  467. transition: `color ${e.motionDurationSlow}`,
  468. "&:hover": {
  469. color: e.colorTextTertiary
  470. },
  471. "&:active": {
  472. color: e.colorText
  473. },
  474. "&-hidden": {
  475. visibility: "hidden"
  476. },
  477. "&-has-suffix": {
  478. margin: `0 ${e.inputAffixPadding}px`
  479. }
  480. },
  481. // ======================= TextArea ========================
  482. "&-textarea-with-clear-btn": {
  483. padding: "0 !important",
  484. border: "0 !important",
  485. [`${n}-clear-icon`]: {
  486. position: "absolute",
  487. insetBlockStart: e.paddingXS,
  488. insetInlineEnd: e.paddingXS,
  489. zIndex: 1
  490. }
  491. }
  492. };
  493. }, Lt = (e) => {
  494. const {
  495. componentCls: n,
  496. inputAffixPadding: t,
  497. colorTextDescription: o,
  498. motionDurationSlow: a,
  499. colorIcon: f,
  500. colorIconHover: d,
  501. iconCls: l
  502. } = e;
  503. return {
  504. [`${n}-affix-wrapper`]: p(p(p(p(p({}, nt(e)), {
  505. display: "inline-flex",
  506. [`&:not(${n}-affix-wrapper-disabled):hover`]: p(p({}, Te(e)), {
  507. zIndex: 1,
  508. [`${n}-search-with-button &`]: {
  509. zIndex: 0
  510. }
  511. }),
  512. "&-focused, &:focus": {
  513. zIndex: 1
  514. },
  515. "&-disabled": {
  516. [`${n}[disabled]`]: {
  517. background: "transparent"
  518. }
  519. },
  520. [`> input${n}`]: {
  521. padding: 0,
  522. fontSize: "inherit",
  523. border: "none",
  524. borderRadius: 0,
  525. outline: "none",
  526. "&:focus": {
  527. boxShadow: "none !important"
  528. }
  529. },
  530. "&::before": {
  531. width: 0,
  532. visibility: "hidden",
  533. content: '"\\a0"'
  534. },
  535. [`${n}`]: {
  536. "&-prefix, &-suffix": {
  537. display: "flex",
  538. flex: "none",
  539. alignItems: "center",
  540. "> *:not(:last-child)": {
  541. marginInlineEnd: e.paddingXS
  542. }
  543. },
  544. "&-show-count-suffix": {
  545. color: o
  546. },
  547. "&-show-count-has-suffix": {
  548. marginInlineEnd: e.paddingXXS
  549. },
  550. "&-prefix": {
  551. marginInlineEnd: t
  552. },
  553. "&-suffix": {
  554. marginInlineStart: t
  555. }
  556. }
  557. }), Dt(e)), {
  558. // password
  559. [`${l}${n}-password-icon`]: {
  560. color: f,
  561. cursor: "pointer",
  562. transition: `all ${a}`,
  563. "&:hover": {
  564. color: d
  565. }
  566. }
  567. }), tt(e, `${n}-affix-wrapper`))
  568. };
  569. }, Gt = (e) => {
  570. const {
  571. componentCls: n,
  572. colorError: t,
  573. colorSuccess: o,
  574. borderRadiusLG: a,
  575. borderRadiusSM: f
  576. } = e;
  577. return {
  578. [`${n}-group`]: p(p(p({}, Xe(e)), jt(e)), {
  579. "&-rtl": {
  580. direction: "rtl"
  581. },
  582. "&-wrapper": {
  583. display: "inline-block",
  584. width: "100%",
  585. textAlign: "start",
  586. verticalAlign: "top",
  587. "&-rtl": {
  588. direction: "rtl"
  589. },
  590. // Size
  591. "&-lg": {
  592. [`${n}-group-addon`]: {
  593. borderRadius: a
  594. }
  595. },
  596. "&-sm": {
  597. [`${n}-group-addon`]: {
  598. borderRadius: f
  599. }
  600. },
  601. // Status
  602. "&-status-error": {
  603. [`${n}-group-addon`]: {
  604. color: t,
  605. borderColor: t
  606. }
  607. },
  608. "&-status-warning": {
  609. [`${n}-group-addon:last-child`]: {
  610. color: o,
  611. borderColor: o
  612. }
  613. }
  614. }
  615. })
  616. };
  617. }, Ut = (e) => {
  618. const {
  619. componentCls: n,
  620. antCls: t
  621. } = e, o = `${n}-search`;
  622. return {
  623. [o]: {
  624. [`${n}`]: {
  625. "&:hover, &:focus": {
  626. borderColor: e.colorPrimaryHover,
  627. [`+ ${n}-group-addon ${o}-button:not(${t}-btn-primary)`]: {
  628. borderInlineStartColor: e.colorPrimaryHover
  629. }
  630. }
  631. },
  632. [`${n}-affix-wrapper`]: {
  633. borderRadius: 0
  634. },
  635. // fix slight height diff in Firefox:
  636. // https://ant.design/components/auto-complete-cn/#components-auto-complete-demo-certain-category
  637. [`${n}-lg`]: {
  638. lineHeight: e.lineHeightLG - 2e-4
  639. },
  640. [`> ${n}-group`]: {
  641. [`> ${n}-group-addon:last-child`]: {
  642. insetInlineStart: -1,
  643. padding: 0,
  644. border: 0,
  645. [`${o}-button`]: {
  646. paddingTop: 0,
  647. paddingBottom: 0,
  648. borderStartStartRadius: 0,
  649. borderStartEndRadius: e.borderRadius,
  650. borderEndEndRadius: e.borderRadius,
  651. borderEndStartRadius: 0
  652. },
  653. [`${o}-button:not(${t}-btn-primary)`]: {
  654. color: e.colorTextDescription,
  655. "&:hover": {
  656. color: e.colorPrimaryHover
  657. },
  658. "&:active": {
  659. color: e.colorPrimaryActive
  660. },
  661. [`&${t}-btn-loading::before`]: {
  662. insetInlineStart: 0,
  663. insetInlineEnd: 0,
  664. insetBlockStart: 0,
  665. insetBlockEnd: 0
  666. }
  667. }
  668. }
  669. },
  670. [`${o}-button`]: {
  671. height: e.controlHeight,
  672. "&:hover, &:focus": {
  673. zIndex: 1
  674. }
  675. },
  676. [`&-large ${o}-button`]: {
  677. height: e.controlHeightLG
  678. },
  679. [`&-small ${o}-button`]: {
  680. height: e.controlHeightSM
  681. },
  682. "&-rtl": {
  683. direction: "rtl"
  684. },
  685. // ===================== Compact Item Customized Styles =====================
  686. [`&${n}-compact-item`]: {
  687. [`&:not(${n}-compact-last-item)`]: {
  688. [`${n}-group-addon`]: {
  689. [`${n}-search-button`]: {
  690. marginInlineEnd: -e.lineWidth,
  691. borderRadius: 0
  692. }
  693. }
  694. },
  695. [`&:not(${n}-compact-first-item)`]: {
  696. [`${n},${n}-affix-wrapper`]: {
  697. borderRadius: 0
  698. }
  699. },
  700. [`> ${n}-group-addon ${n}-search-button,
  701. > ${n},
  702. ${n}-affix-wrapper`]: {
  703. "&:hover,&:focus,&:active": {
  704. zIndex: 2
  705. }
  706. },
  707. [`> ${n}-affix-wrapper-focused`]: {
  708. zIndex: 2
  709. }
  710. }
  711. }
  712. };
  713. };
  714. function Xt(e) {
  715. return Se(e, {
  716. inputAffixPadding: e.paddingXXS,
  717. inputPaddingVertical: Math.max(Math.round((e.controlHeight - e.fontSize * e.lineHeight) / 2 * 10) / 10 - e.lineWidth, 3),
  718. inputPaddingVerticalLG: Math.ceil((e.controlHeightLG - e.fontSizeLG * e.lineHeightLG) / 2 * 10) / 10 - e.lineWidth,
  719. inputPaddingVerticalSM: Math.max(Math.round((e.controlHeightSM - e.fontSize * e.lineHeight) / 2 * 10) / 10 - e.lineWidth, 0),
  720. inputPaddingHorizontal: e.paddingSM - e.lineWidth,
  721. inputPaddingHorizontalSM: e.paddingXS - e.lineWidth,
  722. inputPaddingHorizontalLG: e.controlPaddingHorizontal - e.lineWidth,
  723. inputBorderHoverColor: e.colorPrimaryHover,
  724. inputBorderActiveColor: e.colorPrimaryHover
  725. });
  726. }
  727. const Kt = (e) => {
  728. const {
  729. componentCls: n,
  730. inputPaddingHorizontal: t,
  731. paddingLG: o
  732. } = e, a = `${n}-textarea`;
  733. return {
  734. [a]: {
  735. position: "relative",
  736. [`${a}-suffix`]: {
  737. position: "absolute",
  738. top: 0,
  739. insetInlineEnd: t,
  740. bottom: 0,
  741. zIndex: 1,
  742. display: "inline-flex",
  743. alignItems: "center",
  744. margin: "auto"
  745. },
  746. "&-status-error,\n &-status-warning,\n &-status-success,\n &-status-validating": {
  747. [`&${a}-has-feedback`]: {
  748. [`${n}`]: {
  749. paddingInlineEnd: o
  750. }
  751. }
  752. },
  753. "&-show-count": {
  754. // https://github.com/ant-design/ant-design/issues/33049
  755. [`> ${n}`]: {
  756. height: "100%"
  757. },
  758. "&::after": {
  759. color: e.colorTextDescription,
  760. whiteSpace: "nowrap",
  761. content: "attr(data-count)",
  762. pointerEvents: "none",
  763. float: "right"
  764. }
  765. },
  766. "&-rtl": {
  767. "&::after": {
  768. float: "left"
  769. }
  770. }
  771. }
  772. };
  773. }, He = $t("Input", (e) => {
  774. const n = Xt(e);
  775. return [
  776. Wt(n),
  777. Kt(n),
  778. Lt(n),
  779. Gt(n),
  780. Ut(n),
  781. // =====================================================
  782. // == Space Compact ==
  783. // =====================================================
  784. St(n)
  785. ];
  786. }), ce = (e) => e != null && (Array.isArray(e) ? Ke(e).length : !0);
  787. function Ne(e) {
  788. return ce(e.prefix) || ce(e.suffix) || ce(e.allowClear);
  789. }
  790. function xe(e) {
  791. return ce(e.addonBefore) || ce(e.addonAfter);
  792. }
  793. function Pe(e) {
  794. return typeof e == "undefined" || e === null ? "" : String(e);
  795. }
  796. function fe(e, n, t, o) {
  797. if (!t)
  798. return;
  799. const a = n;
  800. if (n.type === "click") {
  801. Object.defineProperty(a, "target", {
  802. writable: !0
  803. }), Object.defineProperty(a, "currentTarget", {
  804. writable: !0
  805. });
  806. const f = e.cloneNode(!0);
  807. a.target = f, a.currentTarget = f, f.value = "", t(a);
  808. return;
  809. }
  810. if (o !== void 0) {
  811. Object.defineProperty(a, "target", {
  812. writable: !0
  813. }), Object.defineProperty(a, "currentTarget", {
  814. writable: !0
  815. }), a.target = e, a.currentTarget = e, e.value = o, t(a);
  816. return;
  817. }
  818. t(a);
  819. }
  820. function ot(e, n) {
  821. if (!e) return;
  822. e.focus(n);
  823. const {
  824. cursor: t
  825. } = n || {};
  826. if (t) {
  827. const o = e.value.length;
  828. switch (t) {
  829. case "start":
  830. e.setSelectionRange(0, 0);
  831. break;
  832. case "end":
  833. e.setSelectionRange(o, o);
  834. break;
  835. default:
  836. e.setSelectionRange(0, o);
  837. }
  838. }
  839. }
  840. const Yt = () => ({
  841. addonBefore: te.any,
  842. addonAfter: te.any,
  843. prefix: te.any,
  844. suffix: te.any,
  845. clearIcon: te.any,
  846. affixWrapperClassName: String,
  847. groupClassName: String,
  848. wrapperClassName: String,
  849. inputClassName: String,
  850. allowClear: {
  851. type: Boolean,
  852. default: void 0
  853. }
  854. }), at = () => p(p({}, Yt()), {
  855. value: {
  856. type: [String, Number, Symbol],
  857. default: void 0
  858. },
  859. defaultValue: {
  860. type: [String, Number, Symbol],
  861. default: void 0
  862. },
  863. inputElement: te.any,
  864. prefixCls: String,
  865. disabled: {
  866. type: Boolean,
  867. default: void 0
  868. },
  869. focused: {
  870. type: Boolean,
  871. default: void 0
  872. },
  873. triggerFocus: Function,
  874. readonly: {
  875. type: Boolean,
  876. default: void 0
  877. },
  878. handleReset: Function,
  879. hidden: {
  880. type: Boolean,
  881. default: void 0
  882. }
  883. }), lt = () => p(p({}, at()), {
  884. id: String,
  885. placeholder: {
  886. type: [String, Number]
  887. },
  888. autocomplete: String,
  889. type: wt("text"),
  890. name: String,
  891. size: {
  892. type: String
  893. },
  894. autofocus: {
  895. type: Boolean,
  896. default: void 0
  897. },
  898. lazy: {
  899. type: Boolean,
  900. default: !0
  901. },
  902. maxlength: Number,
  903. loading: {
  904. type: Boolean,
  905. default: void 0
  906. },
  907. bordered: {
  908. type: Boolean,
  909. default: void 0
  910. },
  911. showCount: {
  912. type: [Boolean, Object]
  913. },
  914. htmlSize: Number,
  915. onPressEnter: Function,
  916. onKeydown: Function,
  917. onKeyup: Function,
  918. onFocus: Function,
  919. onBlur: Function,
  920. onChange: Function,
  921. onInput: Function,
  922. "onUpdate:value": Function,
  923. onCompositionstart: Function,
  924. onCompositionend: Function,
  925. valueModifiers: Object,
  926. hidden: {
  927. type: Boolean,
  928. default: void 0
  929. },
  930. status: String
  931. }), Zt = ee({
  932. name: "BaseInput",
  933. inheritAttrs: !1,
  934. props: at(),
  935. setup(e, n) {
  936. let {
  937. slots: t,
  938. attrs: o
  939. } = n;
  940. const a = W(), f = (l) => {
  941. var r;
  942. if (!((r = a.value) === null || r === void 0) && r.contains(l.target)) {
  943. const {
  944. triggerFocus: u
  945. } = e;
  946. u == null || u();
  947. }
  948. }, d = () => {
  949. var l;
  950. const {
  951. allowClear: r,
  952. value: u,
  953. disabled: v,
  954. readonly: h,
  955. handleReset: c,
  956. suffix: E = t.suffix,
  957. prefixCls: P
  958. } = e;
  959. if (!r)
  960. return null;
  961. const B = !v && !h && u, g = `${P}-clear-icon`, T = ((l = t.clearIcon) === null || l === void 0 ? void 0 : l.call(t)) || "*";
  962. return b("span", {
  963. onClick: c,
  964. onMousedown: (R) => R.preventDefault(),
  965. class: G({
  966. [`${g}-hidden`]: !B,
  967. [`${g}-has-suffix`]: !!E
  968. }, g),
  969. role: "button",
  970. tabindex: -1
  971. }, [T]);
  972. };
  973. return () => {
  974. var l, r;
  975. const {
  976. focused: u,
  977. value: v,
  978. disabled: h,
  979. allowClear: c,
  980. readonly: E,
  981. hidden: P,
  982. prefixCls: B,
  983. prefix: g = (l = t.prefix) === null || l === void 0 ? void 0 : l.call(t),
  984. suffix: T = (r = t.suffix) === null || r === void 0 ? void 0 : r.call(t),
  985. addonAfter: R = t.addonAfter,
  986. addonBefore: A = t.addonBefore,
  987. inputElement: M,
  988. affixWrapperClassName: x,
  989. wrapperClassName: y,
  990. groupClassName: i
  991. } = e;
  992. let _ = ae(M, {
  993. value: v,
  994. hidden: P
  995. });
  996. if (Ne({
  997. prefix: g,
  998. suffix: T,
  999. allowClear: c
  1000. })) {
  1001. const I = `${B}-affix-wrapper`, H = G(I, {
  1002. [`${I}-disabled`]: h,
  1003. [`${I}-focused`]: u,
  1004. [`${I}-readonly`]: E,
  1005. [`${I}-input-with-clear-btn`]: T && c && v
  1006. }, !xe({
  1007. addonAfter: R,
  1008. addonBefore: A
  1009. }) && o.class, x), $ = (T || c) && b("span", {
  1010. class: `${B}-suffix`
  1011. }, [d(), T]);
  1012. _ = b("span", {
  1013. class: H,
  1014. style: o.style,
  1015. hidden: !xe({
  1016. addonAfter: R,
  1017. addonBefore: A
  1018. }) && P,
  1019. onMousedown: f,
  1020. ref: a
  1021. }, [g && b("span", {
  1022. class: `${B}-prefix`
  1023. }, [g]), ae(M, {
  1024. style: null,
  1025. value: v,
  1026. hidden: null
  1027. }), $]);
  1028. }
  1029. if (xe({
  1030. addonAfter: R,
  1031. addonBefore: A
  1032. })) {
  1033. const I = `${B}-group`, H = `${I}-addon`, $ = G(`${B}-wrapper`, I, y), C = G(`${B}-group-wrapper`, o.class, i);
  1034. return b("span", {
  1035. class: C,
  1036. style: o.style,
  1037. hidden: P
  1038. }, [b("span", {
  1039. class: $
  1040. }, [A && b("span", {
  1041. class: H
  1042. }, [A]), ae(_, {
  1043. style: null,
  1044. hidden: null
  1045. }), R && b("span", {
  1046. class: H
  1047. }, [R])])]);
  1048. }
  1049. return _;
  1050. };
  1051. }
  1052. });
  1053. var Jt = function(e, n) {
  1054. var t = {};
  1055. for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
  1056. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
  1057. n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
  1058. return t;
  1059. };
  1060. const Qt = ee({
  1061. name: "VCInput",
  1062. inheritAttrs: !1,
  1063. props: lt(),
  1064. setup(e, n) {
  1065. let {
  1066. slots: t,
  1067. attrs: o,
  1068. expose: a,
  1069. emit: f
  1070. } = n;
  1071. const d = Y(e.value === void 0 ? e.defaultValue : e.value), l = Y(!1), r = Y(), u = Y();
  1072. de(() => e.value, () => {
  1073. d.value = e.value;
  1074. }), de(() => e.disabled, () => {
  1075. e.disabled && (l.value = !1);
  1076. });
  1077. const v = (i) => {
  1078. r.value && ot(r.value.input, i);
  1079. }, h = () => {
  1080. var i;
  1081. (i = r.value.input) === null || i === void 0 || i.blur();
  1082. }, c = (i, _, I) => {
  1083. var H;
  1084. (H = r.value.input) === null || H === void 0 || H.setSelectionRange(i, _, I);
  1085. }, E = () => {
  1086. var i;
  1087. (i = r.value.input) === null || i === void 0 || i.select();
  1088. };
  1089. a({
  1090. focus: v,
  1091. blur: h,
  1092. input: J(() => {
  1093. var i;
  1094. return (i = r.value.input) === null || i === void 0 ? void 0 : i.input;
  1095. }),
  1096. stateValue: d,
  1097. setSelectionRange: c,
  1098. select: E
  1099. });
  1100. const P = (i) => {
  1101. f("change", i);
  1102. }, B = (i, _) => {
  1103. d.value !== i && (e.value === void 0 ? d.value = i : $e(() => {
  1104. var I;
  1105. r.value.input.value !== d.value && ((I = u.value) === null || I === void 0 || I.$forceUpdate());
  1106. }), $e(() => {
  1107. _ && _();
  1108. }));
  1109. }, g = (i) => {
  1110. const {
  1111. value: _
  1112. } = i.target;
  1113. if (d.value === _) return;
  1114. const I = i.target.value;
  1115. fe(r.value.input, i, P), B(I);
  1116. }, T = (i) => {
  1117. i.keyCode === 13 && f("pressEnter", i), f("keydown", i);
  1118. }, R = (i) => {
  1119. l.value = !0, f("focus", i);
  1120. }, A = (i) => {
  1121. l.value = !1, f("blur", i);
  1122. }, M = (i) => {
  1123. fe(r.value.input, i, P), B("", () => {
  1124. v();
  1125. });
  1126. }, x = () => {
  1127. var i, _;
  1128. const {
  1129. addonBefore: I = t.addonBefore,
  1130. addonAfter: H = t.addonAfter,
  1131. disabled: $,
  1132. valueModifiers: C = {},
  1133. htmlSize: m,
  1134. autocomplete: z,
  1135. prefixCls: F,
  1136. inputClassName: V,
  1137. prefix: U = (i = t.prefix) === null || i === void 0 ? void 0 : i.call(t),
  1138. suffix: K = (_ = t.suffix) === null || _ === void 0 ? void 0 : _.call(t),
  1139. allowClear: s,
  1140. type: w = "text"
  1141. } = e, O = k(e, [
  1142. "prefixCls",
  1143. "onPressEnter",
  1144. "addonBefore",
  1145. "addonAfter",
  1146. "prefix",
  1147. "suffix",
  1148. "allowClear",
  1149. // Input elements must be either controlled or uncontrolled,
  1150. // specify either the value prop, or the defaultValue prop, but not both.
  1151. "defaultValue",
  1152. "size",
  1153. "bordered",
  1154. "htmlSize",
  1155. "lazy",
  1156. "showCount",
  1157. "valueModifiers",
  1158. "showCount",
  1159. "affixWrapperClassName",
  1160. "groupClassName",
  1161. "inputClassName",
  1162. "wrapperClassName"
  1163. ]), j = p(p(p({}, O), o), {
  1164. autocomplete: z,
  1165. onChange: g,
  1166. onInput: g,
  1167. onFocus: R,
  1168. onBlur: A,
  1169. onKeydown: T,
  1170. class: G(F, {
  1171. [`${F}-disabled`]: $
  1172. }, V, !xe({
  1173. addonAfter: H,
  1174. addonBefore: I
  1175. }) && !Ne({
  1176. prefix: U,
  1177. suffix: K,
  1178. allowClear: s
  1179. }) && o.class),
  1180. ref: r,
  1181. key: "ant-input",
  1182. size: m,
  1183. type: w,
  1184. lazy: e.lazy
  1185. });
  1186. return C.lazy && delete j.onInput, j.autofocus || delete j.autofocus, b(qe, k(j, ["size"]), null);
  1187. }, y = () => {
  1188. var i;
  1189. const {
  1190. maxlength: _,
  1191. suffix: I = (i = t.suffix) === null || i === void 0 ? void 0 : i.call(t),
  1192. showCount: H,
  1193. prefixCls: $
  1194. } = e, C = Number(_) > 0;
  1195. if (I || H) {
  1196. const m = [...Pe(d.value)].length, z = typeof H == "object" ? H.formatter({
  1197. count: m,
  1198. maxlength: _
  1199. }) : `${m}${C ? ` / ${_}` : ""}`;
  1200. return b(ye, null, [!!H && b("span", {
  1201. class: G(`${$}-show-count-suffix`, {
  1202. [`${$}-show-count-has-suffix`]: !!I
  1203. })
  1204. }, [z]), I]);
  1205. }
  1206. return null;
  1207. };
  1208. return Ge(() => {
  1209. process.env.NODE_ENV === "test" && e.autofocus && v();
  1210. }), () => {
  1211. const {
  1212. prefixCls: i,
  1213. disabled: _
  1214. } = e, I = Jt(e, ["prefixCls", "disabled"]);
  1215. return b(Zt, D(D(D({}, I), o), {}, {
  1216. ref: u,
  1217. prefixCls: i,
  1218. inputElement: x(),
  1219. handleReset: M,
  1220. value: Pe(d.value),
  1221. focused: l.value,
  1222. triggerFocus: v,
  1223. suffix: y(),
  1224. disabled: _
  1225. }), t);
  1226. };
  1227. }
  1228. }), Ce = () => k(lt(), ["wrapperClassName", "groupClassName", "inputClassName", "affixWrapperClassName"]), rt = () => p(p({}, k(Ce(), ["prefix", "addonBefore", "addonAfter", "suffix"])), {
  1229. rows: Number,
  1230. autosize: {
  1231. type: [Boolean, Object],
  1232. default: void 0
  1233. },
  1234. autoSize: {
  1235. type: [Boolean, Object],
  1236. default: void 0
  1237. },
  1238. onResize: {
  1239. type: Function
  1240. },
  1241. onCompositionstart: Ve(),
  1242. onCompositionend: Ve(),
  1243. valueModifiers: Object
  1244. });
  1245. var qt = function(e, n) {
  1246. var t = {};
  1247. for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
  1248. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
  1249. n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
  1250. return t;
  1251. };
  1252. const L = ee({
  1253. compatConfig: {
  1254. MODE: 3
  1255. },
  1256. name: "AInput",
  1257. inheritAttrs: !1,
  1258. props: Ce(),
  1259. setup(e, n) {
  1260. let {
  1261. slots: t,
  1262. attrs: o,
  1263. expose: a,
  1264. emit: f
  1265. } = n;
  1266. const d = W(), l = Qe(), r = pe.useInject(), u = J(() => Oe(r.status, e.status)), {
  1267. direction: v,
  1268. prefixCls: h,
  1269. size: c,
  1270. autocomplete: E
  1271. } = ve("input", e), {
  1272. compactSize: P,
  1273. compactItemClassnames: B
  1274. } = _t(h, v), g = J(() => P.value || c.value), [T, R] = He(h), A = Ye();
  1275. a({
  1276. focus: (m) => {
  1277. var z;
  1278. (z = d.value) === null || z === void 0 || z.focus(m);
  1279. },
  1280. blur: () => {
  1281. var m;
  1282. (m = d.value) === null || m === void 0 || m.blur();
  1283. },
  1284. input: d,
  1285. setSelectionRange: (m, z, F) => {
  1286. var V;
  1287. (V = d.value) === null || V === void 0 || V.setSelectionRange(m, z, F);
  1288. },
  1289. select: () => {
  1290. var m;
  1291. (m = d.value) === null || m === void 0 || m.select();
  1292. }
  1293. });
  1294. const _ = W([]), I = () => {
  1295. _.value.push(setTimeout(() => {
  1296. var m, z, F, V;
  1297. !((m = d.value) === null || m === void 0) && m.input && ((z = d.value) === null || z === void 0 ? void 0 : z.input.getAttribute("type")) === "password" && (!((F = d.value) === null || F === void 0) && F.input.hasAttribute("value")) && ((V = d.value) === null || V === void 0 || V.input.removeAttribute("value"));
  1298. }));
  1299. };
  1300. Ge(() => {
  1301. I();
  1302. }), ft(() => {
  1303. _.value.forEach((m) => clearTimeout(m));
  1304. }), Ee(() => {
  1305. _.value.forEach((m) => clearTimeout(m));
  1306. });
  1307. const H = (m) => {
  1308. I(), f("blur", m), l.onFieldBlur();
  1309. }, $ = (m) => {
  1310. I(), f("focus", m);
  1311. }, C = (m) => {
  1312. f("update:value", m.target.value), f("change", m), f("input", m), l.onFieldChange();
  1313. };
  1314. return () => {
  1315. var m, z, F, V, U, K;
  1316. const {
  1317. hasFeedback: s,
  1318. feedbackIcon: w
  1319. } = r, {
  1320. allowClear: O,
  1321. bordered: j = !0,
  1322. prefix: S = (m = t.prefix) === null || m === void 0 ? void 0 : m.call(t),
  1323. suffix: ne = (z = t.suffix) === null || z === void 0 ? void 0 : z.call(t),
  1324. addonAfter: ge = (F = t.addonAfter) === null || F === void 0 ? void 0 : F.call(t),
  1325. addonBefore: le = (V = t.addonBefore) === null || V === void 0 ? void 0 : V.call(t),
  1326. id: he = (U = l.id) === null || U === void 0 ? void 0 : U.value
  1327. } = e, re = qt(e, ["allowClear", "bordered", "prefix", "suffix", "addonAfter", "addonBefore", "id"]), dt = (s || ne) && b(ye, null, [ne, s && w]), X = h.value, ut = Ne({
  1328. prefix: S,
  1329. suffix: ne
  1330. }) || !!s, ct = t.clearIcon || (() => b(Ze, null, null));
  1331. return T(b(Qt, D(D(D({}, o), k(re, ["onUpdate:value", "onChange", "onInput"])), {}, {
  1332. onChange: C,
  1333. id: he,
  1334. disabled: (K = e.disabled) !== null && K !== void 0 ? K : A.value,
  1335. ref: d,
  1336. prefixCls: X,
  1337. autocomplete: E.value,
  1338. onBlur: H,
  1339. onFocus: $,
  1340. prefix: S,
  1341. suffix: dt,
  1342. allowClear: O,
  1343. addonAfter: ge && b(je, null, {
  1344. default: () => [b(We, null, {
  1345. default: () => [ge]
  1346. })]
  1347. }),
  1348. addonBefore: le && b(je, null, {
  1349. default: () => [b(We, null, {
  1350. default: () => [le]
  1351. })]
  1352. }),
  1353. class: [o.class, B.value],
  1354. inputClassName: G({
  1355. [`${X}-sm`]: g.value === "small",
  1356. [`${X}-lg`]: g.value === "large",
  1357. [`${X}-rtl`]: v.value === "rtl",
  1358. [`${X}-borderless`]: !j
  1359. }, !ut && ue(X, u.value), R.value),
  1360. affixWrapperClassName: G({
  1361. [`${X}-affix-wrapper-sm`]: g.value === "small",
  1362. [`${X}-affix-wrapper-lg`]: g.value === "large",
  1363. [`${X}-affix-wrapper-rtl`]: v.value === "rtl",
  1364. [`${X}-affix-wrapper-borderless`]: !j
  1365. }, ue(`${X}-affix-wrapper`, u.value, s), R.value),
  1366. wrapperClassName: G({
  1367. [`${X}-group-rtl`]: v.value === "rtl"
  1368. }, R.value),
  1369. groupClassName: G({
  1370. [`${X}-group-wrapper-sm`]: g.value === "small",
  1371. [`${X}-group-wrapper-lg`]: g.value === "large",
  1372. [`${X}-group-wrapper-rtl`]: v.value === "rtl"
  1373. }, ue(`${X}-group-wrapper`, u.value, s), R.value)
  1374. }), p(p({}, t), {
  1375. clearIcon: ct
  1376. })));
  1377. };
  1378. }
  1379. }), kt = ee({
  1380. compatConfig: {
  1381. MODE: 3
  1382. },
  1383. name: "AInputGroup",
  1384. inheritAttrs: !1,
  1385. props: {
  1386. prefixCls: String,
  1387. size: {
  1388. type: String
  1389. },
  1390. compact: {
  1391. type: Boolean,
  1392. default: void 0
  1393. }
  1394. },
  1395. setup(e, n) {
  1396. let {
  1397. slots: t,
  1398. attrs: o
  1399. } = n;
  1400. const {
  1401. prefixCls: a,
  1402. direction: f,
  1403. getPrefixCls: d
  1404. } = ve("input-group", e), l = pe.useInject();
  1405. pe.useProvide(l, {
  1406. isFormItemInput: !1
  1407. });
  1408. const r = J(() => d("input")), [u, v] = He(r), h = J(() => {
  1409. const c = a.value;
  1410. return {
  1411. [`${c}`]: !0,
  1412. [v.value]: !0,
  1413. [`${c}-lg`]: e.size === "large",
  1414. [`${c}-sm`]: e.size === "small",
  1415. [`${c}-compact`]: e.compact,
  1416. [`${c}-rtl`]: f.value === "rtl"
  1417. };
  1418. });
  1419. return () => {
  1420. var c;
  1421. return u(b("span", D(D({}, o), {}, {
  1422. class: G(h.value, o.class)
  1423. }), [(c = t.default) === null || c === void 0 ? void 0 : c.call(t)]));
  1424. };
  1425. }
  1426. });
  1427. var en = function(e, n) {
  1428. var t = {};
  1429. for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
  1430. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
  1431. n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
  1432. return t;
  1433. };
  1434. const it = ee({
  1435. compatConfig: {
  1436. MODE: 3
  1437. },
  1438. name: "AInputSearch",
  1439. inheritAttrs: !1,
  1440. props: p(p({}, Ce()), {
  1441. inputPrefixCls: String,
  1442. // 不能设置默认值 https://github.com/vueComponent/ant-design-vue/issues/1916
  1443. enterButton: te.any,
  1444. onSearch: {
  1445. type: Function
  1446. }
  1447. }),
  1448. setup(e, n) {
  1449. let {
  1450. slots: t,
  1451. attrs: o,
  1452. expose: a,
  1453. emit: f
  1454. } = n;
  1455. const d = Y(), l = Y(!1);
  1456. a({
  1457. focus: () => {
  1458. var x;
  1459. (x = d.value) === null || x === void 0 || x.focus();
  1460. },
  1461. blur: () => {
  1462. var x;
  1463. (x = d.value) === null || x === void 0 || x.blur();
  1464. }
  1465. });
  1466. const v = (x) => {
  1467. f("update:value", x.target.value), x && x.target && x.type === "click" && f("search", x.target.value, x), f("change", x);
  1468. }, h = (x) => {
  1469. var y;
  1470. document.activeElement === ((y = d.value) === null || y === void 0 ? void 0 : y.input) && x.preventDefault();
  1471. }, c = (x) => {
  1472. var y, i;
  1473. f("search", (i = (y = d.value) === null || y === void 0 ? void 0 : y.input) === null || i === void 0 ? void 0 : i.stateValue, x);
  1474. }, E = (x) => {
  1475. l.value || e.loading || c(x);
  1476. }, P = (x) => {
  1477. l.value = !0, f("compositionstart", x);
  1478. }, B = (x) => {
  1479. l.value = !1, f("compositionend", x);
  1480. }, {
  1481. prefixCls: g,
  1482. getPrefixCls: T,
  1483. direction: R,
  1484. size: A
  1485. } = ve("input-search", e), M = J(() => T("input", e.inputPrefixCls));
  1486. return () => {
  1487. var x, y, i, _;
  1488. const {
  1489. disabled: I,
  1490. loading: H,
  1491. addonAfter: $ = (x = t.addonAfter) === null || x === void 0 ? void 0 : x.call(t),
  1492. suffix: C = (y = t.suffix) === null || y === void 0 ? void 0 : y.call(t)
  1493. } = e, m = en(e, ["disabled", "loading", "addonAfter", "suffix"]);
  1494. let {
  1495. enterButton: z = (_ = (i = t.enterButton) === null || i === void 0 ? void 0 : i.call(t)) !== null && _ !== void 0 ? _ : !1
  1496. } = e;
  1497. z = z || z === "";
  1498. const F = typeof z == "boolean" ? b(It, null, null) : null, V = `${g.value}-button`, U = Array.isArray(z) ? z[0] : z;
  1499. let K;
  1500. const s = U.type && Nt(U.type) && U.type.__ANT_BUTTON;
  1501. if (s || U.tagName === "button")
  1502. K = ae(U, p({
  1503. onMousedown: h,
  1504. onClick: c,
  1505. key: "enterButton"
  1506. }, s ? {
  1507. class: V,
  1508. size: A.value
  1509. } : {}), !1);
  1510. else {
  1511. const O = F && !z;
  1512. K = b(Je, {
  1513. class: V,
  1514. type: z ? "primary" : void 0,
  1515. size: A.value,
  1516. disabled: I,
  1517. key: "enterButton",
  1518. onMousedown: h,
  1519. onClick: c,
  1520. loading: H,
  1521. icon: O ? F : null
  1522. }, {
  1523. default: () => [O ? null : F || z]
  1524. });
  1525. }
  1526. $ && (K = [K, $]);
  1527. const w = G(g.value, {
  1528. [`${g.value}-rtl`]: R.value === "rtl",
  1529. [`${g.value}-${A.value}`]: !!A.value,
  1530. [`${g.value}-with-button`]: !!z
  1531. }, o.class);
  1532. return b(L, D(D(D({
  1533. ref: d
  1534. }, k(m, ["onUpdate:value", "onSearch", "enterButton"])), o), {}, {
  1535. onPressEnter: E,
  1536. onCompositionstart: P,
  1537. onCompositionend: B,
  1538. size: A.value,
  1539. prefixCls: M.value,
  1540. addonAfter: K,
  1541. suffix: C,
  1542. onChange: v,
  1543. class: w,
  1544. disabled: I
  1545. }), t);
  1546. };
  1547. }
  1548. }), De = (e) => e != null && (Array.isArray(e) ? Ke(e).length : !0);
  1549. function tn(e) {
  1550. return De(e.addonBefore) || De(e.addonAfter);
  1551. }
  1552. const nn = ["text", "input"], on = ee({
  1553. compatConfig: {
  1554. MODE: 3
  1555. },
  1556. name: "ClearableLabeledInput",
  1557. inheritAttrs: !1,
  1558. props: {
  1559. prefixCls: String,
  1560. inputType: te.oneOf(zt("text", "input")),
  1561. value: oe(),
  1562. defaultValue: oe(),
  1563. allowClear: {
  1564. type: Boolean,
  1565. default: void 0
  1566. },
  1567. element: oe(),
  1568. handleReset: Function,
  1569. disabled: {
  1570. type: Boolean,
  1571. default: void 0
  1572. },
  1573. direction: {
  1574. type: String
  1575. },
  1576. size: {
  1577. type: String
  1578. },
  1579. suffix: oe(),
  1580. prefix: oe(),
  1581. addonBefore: oe(),
  1582. addonAfter: oe(),
  1583. readonly: {
  1584. type: Boolean,
  1585. default: void 0
  1586. },
  1587. focused: {
  1588. type: Boolean,
  1589. default: void 0
  1590. },
  1591. bordered: {
  1592. type: Boolean,
  1593. default: !0
  1594. },
  1595. triggerFocus: {
  1596. type: Function
  1597. },
  1598. hidden: Boolean,
  1599. status: String,
  1600. hashId: String
  1601. },
  1602. setup(e, n) {
  1603. let {
  1604. slots: t,
  1605. attrs: o
  1606. } = n;
  1607. const a = pe.useInject(), f = (l) => {
  1608. const {
  1609. value: r,
  1610. disabled: u,
  1611. readonly: v,
  1612. handleReset: h,
  1613. suffix: c = t.suffix
  1614. } = e, E = !u && !v && r, P = `${l}-clear-icon`;
  1615. return b(Ze, {
  1616. onClick: h,
  1617. onMousedown: (B) => B.preventDefault(),
  1618. class: G({
  1619. [`${P}-hidden`]: !E,
  1620. [`${P}-has-suffix`]: !!c
  1621. }, P),
  1622. role: "button"
  1623. }, null);
  1624. }, d = (l, r) => {
  1625. const {
  1626. value: u,
  1627. allowClear: v,
  1628. direction: h,
  1629. bordered: c,
  1630. hidden: E,
  1631. status: P,
  1632. addonAfter: B = t.addonAfter,
  1633. addonBefore: g = t.addonBefore,
  1634. hashId: T
  1635. } = e, {
  1636. status: R,
  1637. hasFeedback: A
  1638. } = a;
  1639. if (!v)
  1640. return ae(r, {
  1641. value: u,
  1642. disabled: e.disabled
  1643. });
  1644. const M = G(`${l}-affix-wrapper`, `${l}-affix-wrapper-textarea-with-clear-btn`, ue(`${l}-affix-wrapper`, Oe(R, P), A), {
  1645. [`${l}-affix-wrapper-rtl`]: h === "rtl",
  1646. [`${l}-affix-wrapper-borderless`]: !c,
  1647. // className will go to addon wrapper
  1648. [`${o.class}`]: !tn({
  1649. addonAfter: B,
  1650. addonBefore: g
  1651. }) && o.class
  1652. }, T);
  1653. return b("span", {
  1654. class: M,
  1655. style: o.style,
  1656. hidden: E
  1657. }, [ae(r, {
  1658. style: null,
  1659. value: u,
  1660. disabled: e.disabled
  1661. }), f(l)]);
  1662. };
  1663. return () => {
  1664. var l;
  1665. const {
  1666. prefixCls: r,
  1667. inputType: u,
  1668. element: v = (l = t.element) === null || l === void 0 ? void 0 : l.call(t)
  1669. } = e;
  1670. return u === nn[0] ? d(r, v) : null;
  1671. };
  1672. }
  1673. }), an = `
  1674. min-height:0 !important;
  1675. max-height:none !important;
  1676. height:0 !important;
  1677. visibility:hidden !important;
  1678. overflow:hidden !important;
  1679. position:absolute !important;
  1680. z-index:-1000 !important;
  1681. top:0 !important;
  1682. right:0 !important;
  1683. pointer-events: none !important;
  1684. `, ln = ["letter-spacing", "line-height", "padding-top", "padding-bottom", "font-family", "font-weight", "font-size", "font-variant", "text-rendering", "text-transform", "width", "text-indent", "padding-left", "padding-right", "border-width", "box-sizing", "word-break", "white-space"], _e = {};
  1685. let Z;
  1686. function rn(e) {
  1687. let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
  1688. const t = e.getAttribute("id") || e.getAttribute("data-reactid") || e.getAttribute("name");
  1689. if (n && _e[t])
  1690. return _e[t];
  1691. const o = window.getComputedStyle(e), a = o.getPropertyValue("box-sizing") || o.getPropertyValue("-moz-box-sizing") || o.getPropertyValue("-webkit-box-sizing"), f = parseFloat(o.getPropertyValue("padding-bottom")) + parseFloat(o.getPropertyValue("padding-top")), d = parseFloat(o.getPropertyValue("border-bottom-width")) + parseFloat(o.getPropertyValue("border-top-width")), r = {
  1692. sizingStyle: ln.map((u) => `${u}:${o.getPropertyValue(u)}`).join(";"),
  1693. paddingSize: f,
  1694. borderSize: d,
  1695. boxSizing: a
  1696. };
  1697. return n && t && (_e[t] = r), r;
  1698. }
  1699. function sn(e) {
  1700. let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
  1701. Z || (Z = document.createElement("textarea"), Z.setAttribute("tab-index", "-1"), Z.setAttribute("aria-hidden", "true"), document.body.appendChild(Z)), e.getAttribute("wrap") ? Z.setAttribute("wrap", e.getAttribute("wrap")) : Z.removeAttribute("wrap");
  1702. const {
  1703. paddingSize: a,
  1704. borderSize: f,
  1705. boxSizing: d,
  1706. sizingStyle: l
  1707. } = rn(e, n);
  1708. Z.setAttribute("style", `${l};${an}`), Z.value = e.value || e.placeholder || "";
  1709. let r, u, v, h = Z.scrollHeight;
  1710. if (d === "border-box" ? h += f : d === "content-box" && (h -= a), t !== null || o !== null) {
  1711. Z.value = " ";
  1712. const E = Z.scrollHeight - a;
  1713. t !== null && (r = E * t, d === "border-box" && (r = r + a + f), h = Math.max(r, h)), o !== null && (u = E * o, d === "border-box" && (u = u + a + f), v = h > u ? "" : "hidden", h = Math.min(u, h));
  1714. }
  1715. const c = {
  1716. height: `${h}px`,
  1717. overflowY: v,
  1718. resize: "none"
  1719. };
  1720. return r && (c.minHeight = `${r}px`), u && (c.maxHeight = `${u}px`), c;
  1721. }
  1722. const Ie = 0, ze = 1, Re = 2, dn = ee({
  1723. compatConfig: {
  1724. MODE: 3
  1725. },
  1726. name: "ResizableTextArea",
  1727. inheritAttrs: !1,
  1728. props: rt(),
  1729. setup(e, n) {
  1730. let {
  1731. attrs: t,
  1732. emit: o,
  1733. expose: a
  1734. } = n, f, d;
  1735. const l = W(), r = W({}), u = W(Re);
  1736. Ee(() => {
  1737. be.cancel(f), be.cancel(d);
  1738. });
  1739. const v = () => {
  1740. try {
  1741. if (l.value && document.activeElement === l.value.input) {
  1742. const y = l.value.getSelectionStart(), i = l.value.getSelectionEnd(), _ = l.value.getScrollTop();
  1743. l.value.setSelectionRange(y, i), l.value.setScrollTop(_);
  1744. }
  1745. } catch (y) {
  1746. }
  1747. }, h = W(), c = W();
  1748. Be(() => {
  1749. const y = e.autoSize || e.autosize;
  1750. y ? (h.value = y.minRows, c.value = y.maxRows) : (h.value = void 0, c.value = void 0);
  1751. });
  1752. const E = J(() => !!(e.autoSize || e.autosize)), P = () => {
  1753. u.value = Ie;
  1754. };
  1755. de([() => e.value, h, c, E], () => {
  1756. E.value && P();
  1757. }, {
  1758. immediate: !0
  1759. });
  1760. const B = W();
  1761. de([u, l], () => {
  1762. if (l.value)
  1763. if (u.value === Ie)
  1764. u.value = ze;
  1765. else if (u.value === ze) {
  1766. const y = sn(l.value.input, !1, h.value, c.value);
  1767. u.value = Re, B.value = y;
  1768. } else
  1769. v();
  1770. }, {
  1771. immediate: !0,
  1772. flush: "post"
  1773. });
  1774. const g = Ue(), T = W(), R = () => {
  1775. be.cancel(T.value);
  1776. }, A = (y) => {
  1777. u.value === Re && (o("resize", y), E.value && (R(), T.value = be(() => {
  1778. P();
  1779. })));
  1780. };
  1781. Ee(() => {
  1782. R();
  1783. }), a({
  1784. resizeTextarea: () => {
  1785. P();
  1786. },
  1787. textArea: J(() => {
  1788. var y;
  1789. return (y = l.value) === null || y === void 0 ? void 0 : y.input;
  1790. }),
  1791. instance: g
  1792. }), Rt(e.autosize === void 0, "Input.TextArea", "autosize is deprecated, please use autoSize instead.");
  1793. const x = () => {
  1794. const {
  1795. prefixCls: y,
  1796. disabled: i
  1797. } = e, _ = k(e, ["prefixCls", "onPressEnter", "autoSize", "autosize", "defaultValue", "allowClear", "type", "maxlength", "valueModifiers"]), I = G(y, t.class, {
  1798. [`${y}-disabled`]: i
  1799. }), H = E.value ? B.value : null, $ = [t.style, r.value, H], C = p(p(p({}, _), t), {
  1800. style: $,
  1801. class: I
  1802. });
  1803. return (u.value === Ie || u.value === ze) && $.push({
  1804. overflowX: "hidden",
  1805. overflowY: "hidden"
  1806. }), C.autofocus || delete C.autofocus, C.rows === 0 && delete C.rows, b(Et, {
  1807. onResize: A,
  1808. disabled: !E.value
  1809. }, {
  1810. default: () => [b(qe, D(D({}, C), {}, {
  1811. ref: l,
  1812. tag: "textarea"
  1813. }), null)]
  1814. });
  1815. };
  1816. return () => x();
  1817. }
  1818. });
  1819. function st(e, n) {
  1820. return [...e || ""].slice(0, n).join("");
  1821. }
  1822. function Le(e, n, t, o) {
  1823. let a = t;
  1824. return e ? a = st(t, o) : [...n || ""].length < t.length && [...t || ""].length > o && (a = n), a;
  1825. }
  1826. const un = ee({
  1827. compatConfig: {
  1828. MODE: 3
  1829. },
  1830. name: "ATextarea",
  1831. inheritAttrs: !1,
  1832. props: rt(),
  1833. setup(e, n) {
  1834. let {
  1835. attrs: t,
  1836. expose: o,
  1837. emit: a
  1838. } = n;
  1839. var f;
  1840. const d = Qe(), l = pe.useInject(), r = J(() => Oe(l.status, e.status)), u = Y((f = e.value) !== null && f !== void 0 ? f : e.defaultValue), v = Y(), h = Y(""), {
  1841. prefixCls: c,
  1842. size: E,
  1843. direction: P
  1844. } = ve("input", e), [B, g] = He(c), T = Ye(), R = J(() => e.showCount === "" || e.showCount || !1), A = J(() => Number(e.maxlength) > 0), M = Y(!1), x = Y(), y = Y(0), i = (s) => {
  1845. M.value = !0, x.value = h.value, y.value = s.currentTarget.selectionStart, a("compositionstart", s);
  1846. }, _ = (s) => {
  1847. var w;
  1848. M.value = !1;
  1849. let O = s.currentTarget.value;
  1850. if (A.value) {
  1851. const j = y.value >= e.maxlength + 1 || y.value === ((w = x.value) === null || w === void 0 ? void 0 : w.length);
  1852. O = Le(j, x.value, O, e.maxlength);
  1853. }
  1854. O !== h.value && (C(O), fe(s.currentTarget, s, F, O)), a("compositionend", s);
  1855. }, I = Ue();
  1856. de(() => e.value, () => {
  1857. var s;
  1858. "value" in I.vnode.props, u.value = (s = e.value) !== null && s !== void 0 ? s : "";
  1859. });
  1860. const H = (s) => {
  1861. var w;
  1862. ot((w = v.value) === null || w === void 0 ? void 0 : w.textArea, s);
  1863. }, $ = () => {
  1864. var s, w;
  1865. (w = (s = v.value) === null || s === void 0 ? void 0 : s.textArea) === null || w === void 0 || w.blur();
  1866. }, C = (s, w) => {
  1867. u.value !== s && (e.value === void 0 ? u.value = s : $e(() => {
  1868. var O, j, S;
  1869. v.value.textArea.value !== h.value && ((S = (O = v.value) === null || O === void 0 ? void 0 : (j = O.instance).update) === null || S === void 0 || S.call(j));
  1870. }), $e(() => {
  1871. w && w();
  1872. }));
  1873. }, m = (s) => {
  1874. s.keyCode === 13 && a("pressEnter", s), a("keydown", s);
  1875. }, z = (s) => {
  1876. const {
  1877. onBlur: w
  1878. } = e;
  1879. w == null || w(s), d.onFieldBlur();
  1880. }, F = (s) => {
  1881. a("update:value", s.target.value), a("change", s), a("input", s), d.onFieldChange();
  1882. }, V = (s) => {
  1883. fe(v.value.textArea, s, F), C("", () => {
  1884. H();
  1885. });
  1886. }, U = (s) => {
  1887. let w = s.target.value;
  1888. if (u.value !== w) {
  1889. if (A.value) {
  1890. const O = s.target, j = O.selectionStart >= e.maxlength + 1 || O.selectionStart === w.length || !O.selectionStart;
  1891. w = Le(j, h.value, w, e.maxlength);
  1892. }
  1893. fe(s.currentTarget, s, F, w), C(w);
  1894. }
  1895. }, K = () => {
  1896. var s, w;
  1897. const {
  1898. class: O
  1899. } = t, {
  1900. bordered: j = !0
  1901. } = e, S = p(p(p({}, k(e, ["allowClear"])), t), {
  1902. class: [{
  1903. [`${c.value}-borderless`]: !j,
  1904. [`${O}`]: O && !R.value,
  1905. [`${c.value}-sm`]: E.value === "small",
  1906. [`${c.value}-lg`]: E.value === "large"
  1907. }, ue(c.value, r.value), g.value],
  1908. disabled: T.value,
  1909. showCount: null,
  1910. prefixCls: c.value,
  1911. onInput: U,
  1912. onChange: U,
  1913. onBlur: z,
  1914. onKeydown: m,
  1915. onCompositionstart: i,
  1916. onCompositionend: _
  1917. });
  1918. return !((s = e.valueModifiers) === null || s === void 0) && s.lazy && delete S.onInput, b(dn, D(D({}, S), {}, {
  1919. id: (w = S == null ? void 0 : S.id) !== null && w !== void 0 ? w : d.id.value,
  1920. ref: v,
  1921. maxlength: e.maxlength,
  1922. lazy: e.lazy
  1923. }), null);
  1924. };
  1925. return o({
  1926. focus: H,
  1927. blur: $,
  1928. resizableTextArea: v
  1929. }), Be(() => {
  1930. let s = Pe(u.value);
  1931. !M.value && A.value && (e.value === null || e.value === void 0) && (s = st(s, e.maxlength)), h.value = s;
  1932. }), () => {
  1933. var s;
  1934. const {
  1935. maxlength: w,
  1936. bordered: O = !0,
  1937. hidden: j
  1938. } = e, {
  1939. style: S,
  1940. class: ne
  1941. } = t, ge = p(p(p({}, e), t), {
  1942. prefixCls: c.value,
  1943. inputType: "text",
  1944. handleReset: V,
  1945. direction: P.value,
  1946. bordered: O,
  1947. style: R.value ? void 0 : S,
  1948. hashId: g.value,
  1949. disabled: (s = e.disabled) !== null && s !== void 0 ? s : T.value
  1950. });
  1951. let le = b(on, D(D({}, ge), {}, {
  1952. value: h.value,
  1953. status: e.status
  1954. }), {
  1955. element: K
  1956. });
  1957. if (R.value || l.hasFeedback) {
  1958. const he = [...h.value].length;
  1959. let re = "";
  1960. typeof R.value == "object" ? re = R.value.formatter({
  1961. value: h.value,
  1962. count: he,
  1963. maxlength: w
  1964. }) : re = `${he}${A.value ? ` / ${w}` : ""}`, le = b("div", {
  1965. hidden: j,
  1966. class: G(`${c.value}-textarea`, {
  1967. [`${c.value}-textarea-rtl`]: P.value === "rtl",
  1968. [`${c.value}-textarea-show-count`]: R.value,
  1969. [`${c.value}-textarea-in-form-item`]: l.isFormItemInput
  1970. }, `${c.value}-textarea-show-count`, ne, g.value),
  1971. style: S,
  1972. "data-count": typeof re != "object" ? re : void 0
  1973. }, [le, l.hasFeedback && b("span", {
  1974. class: `${c.value}-textarea-suffix`
  1975. }, [l.feedbackIcon])]);
  1976. }
  1977. return B(le);
  1978. };
  1979. }
  1980. });
  1981. var cn = function(e, n) {
  1982. var t = {};
  1983. for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
  1984. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
  1985. n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
  1986. return t;
  1987. };
  1988. const fn = {
  1989. click: "onClick",
  1990. hover: "onMouseover"
  1991. }, pn = (e) => e ? b(Pt, null, null) : b(Bt, null, null), vn = ee({
  1992. compatConfig: {
  1993. MODE: 3
  1994. },
  1995. name: "AInputPassword",
  1996. inheritAttrs: !1,
  1997. props: p(p({}, Ce()), {
  1998. prefixCls: String,
  1999. inputPrefixCls: String,
  2000. action: {
  2001. type: String,
  2002. default: "click"
  2003. },
  2004. visibilityToggle: {
  2005. type: Boolean,
  2006. default: !0
  2007. },
  2008. visible: {
  2009. type: Boolean,
  2010. default: void 0
  2011. },
  2012. "onUpdate:visible": Function,
  2013. iconRender: Function
  2014. }),
  2015. setup(e, n) {
  2016. let {
  2017. slots: t,
  2018. attrs: o,
  2019. expose: a,
  2020. emit: f
  2021. } = n;
  2022. const d = Y(!1), l = () => {
  2023. const {
  2024. disabled: g
  2025. } = e;
  2026. g || (d.value = !d.value, f("update:visible", d.value));
  2027. };
  2028. Be(() => {
  2029. e.visible !== void 0 && (d.value = !!e.visible);
  2030. });
  2031. const r = Y();
  2032. a({
  2033. focus: () => {
  2034. var g;
  2035. (g = r.value) === null || g === void 0 || g.focus();
  2036. },
  2037. blur: () => {
  2038. var g;
  2039. (g = r.value) === null || g === void 0 || g.blur();
  2040. }
  2041. });
  2042. const h = (g) => {
  2043. const {
  2044. action: T,
  2045. iconRender: R = t.iconRender || pn
  2046. } = e, A = fn[T] || "", M = R(d.value), x = {
  2047. [A]: l,
  2048. class: `${g}-icon`,
  2049. key: "passwordIcon",
  2050. onMousedown: (y) => {
  2051. y.preventDefault();
  2052. },
  2053. onMouseup: (y) => {
  2054. y.preventDefault();
  2055. }
  2056. };
  2057. return ae(At(M) ? M : b("span", null, [M]), x);
  2058. }, {
  2059. prefixCls: c,
  2060. getPrefixCls: E
  2061. } = ve("input-password", e), P = J(() => E("input", e.inputPrefixCls)), B = () => {
  2062. const {
  2063. size: g,
  2064. visibilityToggle: T
  2065. } = e, R = cn(e, ["size", "visibilityToggle"]), A = T && h(c.value), M = G(c.value, o.class, {
  2066. [`${c.value}-${g}`]: !!g
  2067. }), x = p(p(p({}, k(R, ["suffix", "iconRender", "action"])), o), {
  2068. type: d.value ? "text" : "password",
  2069. class: M,
  2070. prefixCls: P.value,
  2071. suffix: A
  2072. });
  2073. return g && (x.size = g), b(L, D({
  2074. ref: r
  2075. }, x), t);
  2076. };
  2077. return () => B();
  2078. }
  2079. });
  2080. L.Group = kt;
  2081. L.Search = it;
  2082. L.TextArea = un;
  2083. L.Password = vn;
  2084. L.install = function(e) {
  2085. return e.component(L.name, L), e.component(L.Group.name, L.Group), e.component(L.Search.name, L.Search), e.component(L.TextArea.name, L.TextArea), e.component(L.Password.name, L.Password), e;
  2086. };
  2087. const gn = { class: "s-user-select-common" }, hn = { class: "modal-container" }, mn = { class: "side" }, bn = { class: "main" }, xn = { class: "filter" }, yn = { class: "list-wrap" }, $n = { class: "item left-wrap" }, Sn = { class: "head" }, Cn = { class: "sub-title" }, wn = { class: "right" }, _n = /* @__PURE__ */ N("a", { href: "javascript:;" }, "节点全选", -1), In = ["onClick"], zn = { class: "icon" }, Rn = { class: "cont" }, En = { class: "name" }, An = { class: "job" }, Pn = {
  2088. key: 0,
  2089. class: "not-more"
  2090. }, Bn = { class: "item right-wrap" }, On = { class: "head" }, Tn = /* @__PURE__ */ N("div", { class: "sub-title" }, "本次已选", -1), Hn = { class: "icon" }, Nn = { class: "cont" }, Mn = { class: "name" }, Fn = { class: "job" }, Vn = ["onClick"], Yn = {
  2091. __name: "SUserSelect",
  2092. props: {
  2093. modelValue: {
  2094. type: [String, Array],
  2095. default() {
  2096. return "";
  2097. }
  2098. },
  2099. placeholder: {
  2100. type: String,
  2101. default: "请选择"
  2102. },
  2103. // 弹窗标题
  2104. title: {
  2105. type: String,
  2106. default: "选择用户"
  2107. }
  2108. },
  2109. emits: ["change:modelValue"],
  2110. setup(e, { emit: n }) {
  2111. const t = n, o = e, a = W(""), f = W(""), d = W(""), l = W(!1), r = W(!1), u = W({}), v = W([]), h = W(1), c = W(0), E = W(!1);
  2112. let P = null;
  2113. de(() => o.modelValue, ($) => {
  2114. $ && (a.value = $);
  2115. }, { immediate: !0 });
  2116. const B = () => {
  2117. r.value = !0;
  2118. }, g = () => {
  2119. r.value = !1, A();
  2120. }, T = () => {
  2121. E.value = !E.value, E.value ? R() : A();
  2122. }, R = () => {
  2123. v.value.forEach(($) => $.selected = !0), a.value = v.value.map(($) => $.name).join(",");
  2124. }, A = () => {
  2125. E.value = !1, v.value.forEach(($) => $.selected = !1), a.value = "";
  2126. }, M = () => {
  2127. r.value = !1, t("change:modelValue", v.value.filter(($) => $.selected));
  2128. }, x = ($, C) => {
  2129. u.value = C.node, h.value = 1, c.value = 0, v.value = [], l.value = !0, y($);
  2130. }, y = ($) => Me(this, null, function* () {
  2131. const C = {
  2132. pageNum: h.value,
  2133. pageSize: 20,
  2134. searchValue: d.value,
  2135. unitid: $.join(","),
  2136. containsChild: !0
  2137. };
  2138. l.value = !0;
  2139. const m = yield bt(C);
  2140. v.value = v.value.concat(m.list), c.value = m.pages, P = setTimeout(() => {
  2141. l.value = !1, clearTimeout(P);
  2142. }, 200);
  2143. }), i = ($) => {
  2144. $.selected = !$.selected, a.value = v.value.filter((C) => C.selected).map((C) => C.name).join(",");
  2145. }, _ = ({ target: { offsetHeight: $, scrollHeight: C, scrollTop: m } }) => {
  2146. l.value || $ + m >= C - 20 && h.value <= c.value && (h.value++, y([u.value.id]));
  2147. }, I = ($) => xt($), H = ($) => yt($);
  2148. return ($, C) => {
  2149. const m = it, z = Je, F = we("s-tree"), V = we("DownOutlined"), U = Ot, K = Tt, s = Ht, w = we("CloseCircleOutlined"), O = Mt, j = pt("removeAriaHidden");
  2150. return vt((ie(), se("div", gn, [
  2151. b(m, {
  2152. value: a.value,
  2153. "onUpdate:value": C[0] || (C[0] = (S) => a.value = S),
  2154. readonly: "",
  2155. placeholder: e.placeholder,
  2156. onSearch: B
  2157. }, null, 8, ["value", "placeholder"]),
  2158. b(O, {
  2159. wrapClassName: "s-user-select-modal",
  2160. open: r.value,
  2161. "onUpdate:open": C[4] || (C[4] = (S) => r.value = S),
  2162. title: e.title,
  2163. onOk: M,
  2164. keyboard: !1,
  2165. maskClosable: !1,
  2166. width: "1000px"
  2167. }, {
  2168. footer: Q(() => [
  2169. b(z, {
  2170. key: "back",
  2171. onClick: g
  2172. }, {
  2173. default: Q(() => [
  2174. me("取消")
  2175. ]),
  2176. _: 1
  2177. }),
  2178. b(z, {
  2179. key: "submit",
  2180. type: "primary",
  2181. loading: l.value,
  2182. onClick: M
  2183. }, {
  2184. default: Q(() => [
  2185. me("确认")
  2186. ]),
  2187. _: 1
  2188. }, 8, ["loading"])
  2189. ]),
  2190. default: Q(() => [
  2191. N("div", hn, [
  2192. N("div", mn, [
  2193. b(F, {
  2194. levelOneChildren: I,
  2195. levelTwoChildren: H,
  2196. "onSelect:modelValue": x,
  2197. select: f.value,
  2198. "onUpdate:select": C[1] || (C[1] = (S) => f.value = S),
  2199. height: 470
  2200. }, null, 8, ["select"])
  2201. ]),
  2202. N("div", bn, [
  2203. N("div", xn, [
  2204. b(m, {
  2205. value: d.value,
  2206. "onUpdate:value": C[2] || (C[2] = (S) => d.value = S),
  2207. placeholder: $.$l("请输入", "components.placeInput"),
  2208. style: { width: "340px" },
  2209. onSearch: B
  2210. }, null, 8, ["value", "placeholder"])
  2211. ]),
  2212. N("div", yn, [
  2213. N("div", $n, [
  2214. N("div", Sn, [
  2215. N("div", Cn, q(u.value.title || u.value.name), 1),
  2216. N("div", wn, [
  2217. b(z, {
  2218. type: "link",
  2219. onClick: T
  2220. }, {
  2221. default: Q(() => [
  2222. me(q(E.value ? "反选" : "全选"), 1)
  2223. ]),
  2224. _: 1
  2225. }),
  2226. b(s, null, {
  2227. overlay: Q(() => [
  2228. b(K, null, {
  2229. default: Q(() => [
  2230. b(U, null, {
  2231. default: Q(() => [
  2232. _n
  2233. ]),
  2234. _: 1
  2235. })
  2236. ]),
  2237. _: 1
  2238. })
  2239. ]),
  2240. default: Q(() => [
  2241. N("a", {
  2242. class: "ant-dropdown-link",
  2243. onClick: C[3] || (C[3] = gt(() => {
  2244. }, ["prevent"]))
  2245. }, [
  2246. b(V)
  2247. ])
  2248. ]),
  2249. _: 1
  2250. })
  2251. ])
  2252. ]),
  2253. N("div", {
  2254. class: "user-list",
  2255. onScroll: _
  2256. }, [
  2257. (ie(!0), se(ye, null, Fe(v.value, (S) => (ie(), se("div", {
  2258. class: ht(["item", { select: !!S.selected }]),
  2259. key: S.id,
  2260. onClick: (ne) => i(S)
  2261. }, [
  2262. N("div", zn, q(S.name && S.name.slice(0, 1)), 1),
  2263. N("div", Rn, [
  2264. N("div", En, q(S.name) + " (" + q(S.nameOrCount) + ")", 1),
  2265. N("div", An, q(S.deptName), 1)
  2266. ])
  2267. ], 10, In))), 128)),
  2268. h.value >= c.value ? (ie(), se("div", Pn, "没有更多了")) : mt("", !0)
  2269. ], 32)
  2270. ]),
  2271. N("div", Bn, [
  2272. N("div", On, [
  2273. Tn,
  2274. b(z, {
  2275. type: "link",
  2276. onClick: A
  2277. }, {
  2278. default: Q(() => [
  2279. me("清除")
  2280. ]),
  2281. _: 1
  2282. })
  2283. ]),
  2284. N("div", {
  2285. class: "user-list select-list",
  2286. onScroll: _
  2287. }, [
  2288. (ie(!0), se(ye, null, Fe(v.value.filter((S) => S.selected), (S) => (ie(), se("div", {
  2289. class: "item",
  2290. key: S.id
  2291. }, [
  2292. N("div", Hn, q(S.name && S.name.slice(0, 1)), 1),
  2293. N("div", Nn, [
  2294. N("div", Mn, q(S.name) + " (" + q(S.nameOrCount) + ")", 1),
  2295. N("div", Fn, q(S.deptName), 1)
  2296. ]),
  2297. N("div", {
  2298. class: "icon no-bg",
  2299. onClick: (ne) => i(S)
  2300. }, [
  2301. b(w)
  2302. ], 8, Vn)
  2303. ]))), 128))
  2304. ], 32)
  2305. ])
  2306. ])
  2307. ])
  2308. ])
  2309. ]),
  2310. _: 1
  2311. }, 8, ["open", "title"])
  2312. ])), [
  2313. [j]
  2314. ]);
  2315. };
  2316. }
  2317. };
  2318. export {
  2319. Yn as default
  2320. };