import { P as s, _ as d, aV as zn, a as q, m as pe, c as Qe, aW as Nn, K as I, b as Vn, i as Ln, aX as Hn, N as An, n as Wn, S as Kn, O as _n, aY as jn, aZ as Xn, J as Fe, a_ as Un, a$ as Gn, b0 as Yn, b1 as qn, t as Pe, b2 as je, b3 as Xe, I as Z, b4 as Je, g as Qn, f as Jn } from "./index2.js"; import { defineComponent as ce, computed as N, ref as se, createVNode as p, isVNode as Zn, cloneVNode as kn, inject as De, provide as Ee, shallowRef as W, watchEffect as Ze, onMounted as re, watch as ae, createTextVNode as Te, Fragment as ge, onBeforeUnmount as Oe, isRef as eo, reactive as Ue, toRefs as no } from "vue"; import { B as oo } from "./statusUtils.js"; import { p as ke } from "./pickAttrs.js"; import { e as en } from "./index4.js"; function to(e, n) { if (!n || !n.length) return null; let o = !1; function t(l, m) { let [v, ...x] = m; if (!v) return [l]; const b = l.split(v); return o = o || b.length > 1, b.reduce((u, C) => [...u, ...t(C, x)], []).filter((u) => u); } const i = t(e, n); return o ? i : null; } var io = function(e, n) { var o = {}; for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++) n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]); return o; }; const lo = (e) => { const n = e === !0 ? 0 : 1; return { bottomLeft: { points: ["tl", "bl"], offset: [0, 4], overflow: { adjustX: n, adjustY: 1 } }, bottomRight: { points: ["tr", "br"], offset: [0, 4], overflow: { adjustX: n, adjustY: 1 } }, topLeft: { points: ["bl", "tl"], offset: [0, -4], overflow: { adjustX: n, adjustY: 1 } }, topRight: { points: ["br", "tr"], offset: [0, -4], overflow: { adjustX: n, adjustY: 1 } } }; }, ao = ce({ name: "SelectTrigger", inheritAttrs: !1, props: { dropdownAlign: Object, visible: { type: Boolean, default: void 0 }, disabled: { type: Boolean, default: void 0 }, dropdownClassName: String, dropdownStyle: s.object, placement: String, empty: { type: Boolean, default: void 0 }, prefixCls: String, popupClassName: String, animation: String, transitionName: String, getPopupContainer: Function, dropdownRender: Function, containerWidth: Number, dropdownMatchSelectWidth: s.oneOfType([Number, Boolean]).def(!0), popupElement: s.any, direction: String, getTriggerDOMNode: Function, onPopupVisibleChange: Function, onPopupMouseEnter: Function, onPopupFocusin: Function, onPopupFocusout: Function }, setup(e, n) { let { slots: o, attrs: t, expose: i } = n; const l = N(() => { const { dropdownMatchSelectWidth: v } = e; return lo(v); }), m = se(); return i({ getPopupElement: () => m.value }), () => { const v = d(d({}, e), t), { empty: x = !1 } = v, b = io(v, ["empty"]), { visible: u, dropdownAlign: C, prefixCls: M, popupElement: $, dropdownClassName: g, dropdownStyle: h, direction: w = "ltr", placement: c, dropdownMatchSelectWidth: f, containerWidth: P, dropdownRender: S, animation: E, transitionName: T, getPopupContainer: y, getTriggerDOMNode: X, onPopupVisibleChange: D, onPopupMouseEnter: V, onPopupFocusin: R, onPopupFocusout: Y } = b, L = `${M}-dropdown`; let U = $; S && (U = S({ menuNode: $, props: e })); const F = E ? `${L}-${E}` : T, B = d({ minWidth: `${P}px` }, h); return typeof f == "number" ? B.width = `${f}px` : f && (B.width = `${P}px`), p(zn, q(q({}, e), {}, { showAction: D ? ["click"] : [], hideAction: D ? ["click"] : [], popupPlacement: c || (w === "rtl" ? "bottomRight" : "bottomLeft"), builtinPlacements: l.value, prefixCls: L, popupTransitionName: F, popupAlign: C, popupVisible: u, getPopupContainer: y, popupClassName: pe(g, { [`${L}-empty`]: x }), popupStyle: B, getTriggerDOMNode: X, onPopupVisibleChange: D }), { default: o.default, popup: () => p("div", { ref: m, onMouseenter: V, onFocusin: R, onFocusout: Y }, [U]) }); }; } }), ue = (e, n) => { let { slots: o } = n; var t; const { class: i, customizeIcon: l, customizeIconProps: m, onMousedown: v, onClick: x } = e; let b; return typeof l == "function" ? b = l(m) : b = Zn(l) ? kn(l) : l, p("span", { class: i, onMousedown: (u) => { u.preventDefault(), v && v(u); }, style: { userSelect: "none", WebkitUserSelect: "none" }, unselectable: "on", onClick: x, "aria-hidden": !0 }, [b !== void 0 ? b : p("span", { class: i.split(/\s+/).map((u) => `${u}-icon`) }, [(t = o.default) === null || t === void 0 ? void 0 : t.call(o)])]); }; ue.inheritAttrs = !1; ue.displayName = "TransBtn"; ue.props = { class: String, customizeIcon: s.any, customizeIconProps: s.any, onMousedown: Function, onClick: Function }; const ro = { inputRef: s.any, prefixCls: String, id: String, inputElement: s.VueNode, disabled: { type: Boolean, default: void 0 }, autofocus: { type: Boolean, default: void 0 }, autocomplete: String, editable: { type: Boolean, default: void 0 }, activeDescendantId: String, value: String, open: { type: Boolean, default: void 0 }, tabindex: s.oneOfType([s.number, s.string]), /** Pass accessibility props to input */ attrs: s.object, onKeydown: { type: Function }, onMousedown: { type: Function }, onChange: { type: Function }, onPaste: { type: Function }, onCompositionstart: { type: Function }, onCompositionend: { type: Function }, onFocus: { type: Function }, onBlur: { type: Function } }, nn = ce({ compatConfig: { MODE: 3 }, name: "SelectInput", inheritAttrs: !1, props: ro, setup(e) { let n = null; const o = De("VCSelectContainerEvent"); return () => { var t; const { prefixCls: i, id: l, inputElement: m, disabled: v, tabindex: x, autofocus: b, autocomplete: u, editable: C, activeDescendantId: M, value: $, onKeydown: g, onMousedown: h, onChange: w, onPaste: c, onCompositionstart: f, onCompositionend: P, onFocus: S, onBlur: E, open: T, inputRef: y, attrs: X } = e; let D = m || p(oo, null, null); const V = D.props || {}, { onKeydown: R, onInput: Y, onFocus: L, onBlur: U, onMousedown: F, onCompositionstart: B, onCompositionend: oe, style: te } = V; return D = Qe(D, d(d(d(d(d({ type: "search" }, V), { id: l, ref: y, disabled: v, tabindex: x, lazy: !1, autocomplete: u || "off", autofocus: b, class: pe(`${i}-selection-search-input`, (t = D == null ? void 0 : D.props) === null || t === void 0 ? void 0 : t.class), role: "combobox", "aria-expanded": T, "aria-haspopup": "listbox", "aria-owns": `${l}_list`, "aria-autocomplete": "list", "aria-controls": `${l}_list`, "aria-activedescendant": M }), X), { value: C ? $ : "", readonly: !C, unselectable: C ? null : "on", style: d(d({}, te), { opacity: C ? null : 0 }), onKeydown: (O) => { g(O), R && R(O); }, onMousedown: (O) => { h(O), F && F(O); }, onInput: (O) => { w(O), Y && Y(O); }, onCompositionstart(O) { f(O), B && B(O); }, onCompositionend(O) { P(O), oe && oe(O); }, onPaste: c, onFocus: function() { clearTimeout(n), L && L(arguments.length <= 0 ? void 0 : arguments[0]), S && S(arguments.length <= 0 ? void 0 : arguments[0]), o == null || o.focus(arguments.length <= 0 ? void 0 : arguments[0]); }, onBlur: function() { for (var O = arguments.length, J = new Array(O), ie = 0; ie < O; ie++) J[ie] = arguments[ie]; n = setTimeout(() => { U && U(J[0]), E && E(J[0]), o == null || o.blur(J[0]); }, 100); } }), D.type === "textarea" ? {} : { type: "search" }), !0, !0), D; }; } }), on = Symbol("TreeSelectLegacyContextPropsKey"); function Yo(e) { return Ee(on, e); } function Me() { return De(on, {}); } const so = { id: String, prefixCls: String, values: s.array, open: { type: Boolean, default: void 0 }, searchValue: String, inputRef: s.any, placeholder: s.any, disabled: { type: Boolean, default: void 0 }, mode: String, showSearch: { type: Boolean, default: void 0 }, autofocus: { type: Boolean, default: void 0 }, autocomplete: String, activeDescendantId: String, tabindex: s.oneOfType([s.number, s.string]), compositionStatus: Boolean, removeIcon: s.any, choiceTransitionName: String, maxTagCount: s.oneOfType([s.number, s.string]), maxTagTextLength: Number, maxTagPlaceholder: s.any.def(() => (e) => `+ ${e.length} ...`), tagRender: Function, onToggleOpen: { type: Function }, onRemove: Function, onInputChange: Function, onInputPaste: Function, onInputKeyDown: Function, onInputMouseDown: Function, onInputCompositionStart: Function, onInputCompositionEnd: Function }, Ge = (e) => { e.preventDefault(), e.stopPropagation(); }, uo = ce({ name: "MultipleSelectSelector", inheritAttrs: !1, props: so, setup(e) { const n = W(), o = W(0), t = W(!1), i = Me(), l = N(() => `${e.prefixCls}-selection`), m = N(() => e.open || e.mode === "tags" ? e.searchValue : ""), v = N(() => e.mode === "tags" || e.showSearch && (e.open || t.value)), x = se(""); Ze(() => { x.value = m.value; }), re(() => { ae(x, () => { o.value = n.value.scrollWidth; }, { flush: "post", immediate: !0 }); }); function b(g, h, w, c, f) { return p("span", { class: pe(`${l.value}-item`, { [`${l.value}-item-disabled`]: w }), title: typeof g == "string" || typeof g == "number" ? g.toString() : void 0 }, [p("span", { class: `${l.value}-item-content` }, [h]), c && p(ue, { class: `${l.value}-item-remove`, onMousedown: Ge, onClick: f, customizeIcon: e.removeIcon }, { default: () => [Te("×")] })]); } function u(g, h, w, c, f, P) { var S; const E = (y) => { Ge(y), e.onToggleOpen(!open); }; let T = P; return i.keyEntities && (T = ((S = i.keyEntities[g]) === null || S === void 0 ? void 0 : S.node) || {}), p("span", { key: g, onMousedown: E }, [e.tagRender({ label: h, value: g, disabled: w, closable: c, onClose: f, option: T })]); } function C(g) { const { disabled: h, label: w, value: c, option: f } = g, P = !e.disabled && !h; let S = w; if (typeof e.maxTagTextLength == "number" && (typeof w == "string" || typeof w == "number")) { const T = String(S); T.length > e.maxTagTextLength && (S = `${T.slice(0, e.maxTagTextLength)}...`); } const E = (T) => { var y; T && T.stopPropagation(), (y = e.onRemove) === null || y === void 0 || y.call(e, g); }; return typeof e.tagRender == "function" ? u(c, S, h, P, E, f) : b(w, S, h, P, E); } function M(g) { const { maxTagPlaceholder: h = (c) => `+ ${c.length} ...` } = e, w = typeof h == "function" ? h(g) : h; return b(w, w, !1); } const $ = (g) => { const h = g.target.composing; x.value = g.target.value, h || e.onInputChange(g); }; return () => { const { id: g, prefixCls: h, values: w, open: c, inputRef: f, placeholder: P, disabled: S, autofocus: E, autocomplete: T, activeDescendantId: y, tabindex: X, compositionStatus: D, onInputPaste: V, onInputKeyDown: R, onInputMouseDown: Y, onInputCompositionStart: L, onInputCompositionEnd: U } = e, F = p("div", { class: `${l.value}-search`, style: { width: o.value + "px" }, key: "input" }, [p(nn, { inputRef: f, open: c, prefixCls: h, id: g, inputElement: null, disabled: S, autofocus: E, autocomplete: T, editable: v.value, activeDescendantId: y, value: x.value, onKeydown: R, onMousedown: Y, onChange: $, onPaste: V, onCompositionstart: L, onCompositionend: U, tabindex: X, attrs: ke(e, !0), onFocus: () => t.value = !0, onBlur: () => t.value = !1 }, null), p("span", { ref: n, class: `${l.value}-search-mirror`, "aria-hidden": !0 }, [x.value, Te(" ")])]), B = p(Nn, { prefixCls: `${l.value}-overflow`, data: w, renderItem: C, renderRest: M, suffix: F, itemKey: "key", maxCount: e.maxTagCount, key: "overflow" }, null); return p(ge, null, [B, !w.length && !m.value && !D && p("span", { class: `${l.value}-placeholder` }, [P])]); }; } }), co = { inputElement: s.any, id: String, prefixCls: String, values: s.array, open: { type: Boolean, default: void 0 }, searchValue: String, inputRef: s.any, placeholder: s.any, compositionStatus: { type: Boolean, default: void 0 }, disabled: { type: Boolean, default: void 0 }, mode: String, showSearch: { type: Boolean, default: void 0 }, autofocus: { type: Boolean, default: void 0 }, autocomplete: String, activeDescendantId: String, tabindex: s.oneOfType([s.number, s.string]), activeValue: String, backfill: { type: Boolean, default: void 0 }, optionLabelRender: Function, onInputChange: Function, onInputPaste: Function, onInputKeyDown: Function, onInputMouseDown: Function, onInputCompositionStart: Function, onInputCompositionEnd: Function }, Re = ce({ name: "SingleSelector", setup(e) { const n = W(!1), o = N(() => e.mode === "combobox"), t = N(() => o.value || e.showSearch), i = N(() => { let u = e.searchValue || ""; return o.value && e.activeValue && !n.value && (u = e.activeValue), u; }), l = Me(); ae([o, () => e.activeValue], () => { o.value && (n.value = !1); }, { immediate: !0 }); const m = N(() => e.mode !== "combobox" && !e.open && !e.showSearch ? !1 : !!i.value || e.compositionStatus), v = N(() => { const u = e.values[0]; return u && (typeof u.label == "string" || typeof u.label == "number") ? u.label.toString() : void 0; }), x = () => { if (e.values[0]) return null; const u = m.value ? { visibility: "hidden" } : void 0; return p("span", { class: `${e.prefixCls}-selection-placeholder`, style: u }, [e.placeholder]); }, b = (u) => { u.target.composing || (n.value = !0, e.onInputChange(u)); }; return () => { var u, C, M, $; const { inputElement: g, prefixCls: h, id: w, values: c, inputRef: f, disabled: P, autofocus: S, autocomplete: E, activeDescendantId: T, open: y, tabindex: X, optionLabelRender: D, onInputKeyDown: V, onInputMouseDown: R, onInputPaste: Y, onInputCompositionStart: L, onInputCompositionEnd: U } = e, F = c[0]; let B = null; if (F && l.customSlots) { const oe = (u = F.key) !== null && u !== void 0 ? u : F.value, te = ((C = l.keyEntities[oe]) === null || C === void 0 ? void 0 : C.node) || {}; B = l.customSlots[(M = te.slots) === null || M === void 0 ? void 0 : M.title] || l.customSlots.title || F.label, typeof B == "function" && (B = B(te)); } else B = D && F ? D(F.option) : F == null ? void 0 : F.label; return p(ge, null, [p("span", { class: `${h}-selection-search` }, [p(nn, { inputRef: f, prefixCls: h, id: w, open: y, inputElement: g, disabled: P, autofocus: S, autocomplete: E, editable: t.value, activeDescendantId: T, value: i.value, onKeydown: V, onMousedown: R, onChange: b, onPaste: Y, onCompositionstart: L, onCompositionend: U, tabindex: X, attrs: ke(e, !0) }, null)]), !o.value && F && !m.value && p("span", { class: `${h}-selection-item`, title: v.value }, [p(ge, { key: ($ = F.key) !== null && $ !== void 0 ? $ : F.value }, [B])]), x()]); }; } }); Re.props = co; Re.inheritAttrs = !1; function po(e) { return ![ // System function button I.ESC, I.SHIFT, I.BACKSPACE, I.TAB, I.WIN_KEY, I.ALT, I.META, I.WIN_KEY_RIGHT, I.CTRL, I.SEMICOLON, I.EQUALS, I.CAPS_LOCK, I.CONTEXT_MENU, // F1-F12 I.F1, I.F2, I.F3, I.F4, I.F5, I.F6, I.F7, I.F8, I.F9, I.F10, I.F11, I.F12 ].includes(e); } function tn() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250, n = null, o; Oe(() => { clearTimeout(o); }); function t(i) { (i || n === null) && (n = i), clearTimeout(o), o = setTimeout(() => { n = null; }, e); } return [() => n, t]; } const mo = ce({ name: "Selector", inheritAttrs: !1, props: { id: String, prefixCls: String, showSearch: { type: Boolean, default: void 0 }, open: { type: Boolean, default: void 0 }, /** Display in the Selector value, it's not same as `value` prop */ values: s.array, multiple: { type: Boolean, default: void 0 }, mode: String, searchValue: String, activeValue: String, inputElement: s.any, autofocus: { type: Boolean, default: void 0 }, activeDescendantId: String, tabindex: s.oneOfType([s.number, s.string]), disabled: { type: Boolean, default: void 0 }, placeholder: s.any, removeIcon: s.any, // Tags maxTagCount: s.oneOfType([s.number, s.string]), maxTagTextLength: Number, maxTagPlaceholder: s.any, tagRender: Function, optionLabelRender: Function, /** Check if `tokenSeparators` contains `\n` or `\r\n` */ tokenWithEnter: { type: Boolean, default: void 0 }, // Motion choiceTransitionName: String, onToggleOpen: { type: Function }, /** `onSearch` returns go next step boolean to check if need do toggle open */ onSearch: Function, onSearchSubmit: Function, onRemove: Function, onInputKeyDown: { type: Function }, /** * @private get real dom for trigger align. * This may be removed after React provides replacement of `findDOMNode` */ domRef: Function }, setup(e, n) { let { expose: o } = n; const t = en(), i = se(!1), [l, m] = tn(0), v = (c) => { const { which: f } = c; (f === I.UP || f === I.DOWN) && c.preventDefault(), e.onInputKeyDown && e.onInputKeyDown(c), f === I.ENTER && e.mode === "tags" && !i.value && !e.open && e.onSearchSubmit(c.target.value), po(f) && e.onToggleOpen(!0); }, x = () => { m(!0); }; let b = null; const u = (c) => { e.onSearch(c, !0, i.value) !== !1 && e.onToggleOpen(!0); }, C = () => { i.value = !0; }, M = (c) => { i.value = !1, e.mode !== "combobox" && u(c.target.value); }, $ = (c) => { let { target: { value: f } } = c; if (e.tokenWithEnter && b && /[\r\n]/.test(b)) { const P = b.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " "); f = f.replace(P, b); } b = null, u(f); }, g = (c) => { const { clipboardData: f } = c; b = f.getData("text"); }, h = (c) => { let { target: f } = c; f !== t.current && (document.body.style.msTouchAction !== void 0 ? setTimeout(() => { t.current.focus(); }) : t.current.focus()); }, w = (c) => { const f = l(); c.target !== t.current && !f && c.preventDefault(), (e.mode !== "combobox" && (!e.showSearch || !f) || !e.open) && (e.open && e.onSearch("", !0, !1), e.onToggleOpen()); }; return o({ focus: () => { t.current.focus(); }, blur: () => { t.current.blur(); } }), () => { const { prefixCls: c, domRef: f, mode: P } = e, S = { inputRef: t, onInputKeyDown: v, onInputMouseDown: x, onInputChange: $, onInputPaste: g, compositionStatus: i.value, onInputCompositionStart: C, onInputCompositionEnd: M }, E = P === "multiple" || P === "tags" ? p(uo, q(q({}, e), S), null) : p(Re, q(q({}, e), S), null); return p("div", { ref: f, class: `${c}-selector`, onClick: h, onMousedown: w }, [E]); }; } }); function fo(e, n, o) { function t(i) { var l, m, v; let x = i.target; x.shadowRoot && i.composed && (x = i.composedPath()[0] || x); const b = [(l = e[0]) === null || l === void 0 ? void 0 : l.value, (v = (m = e[1]) === null || m === void 0 ? void 0 : m.value) === null || v === void 0 ? void 0 : v.getPopupElement()]; n.value && b.every((u) => u && !u.contains(x) && u !== x) && o(!1); } re(() => { window.addEventListener("mousedown", t); }), Oe(() => { window.removeEventListener("mousedown", t); }); } function go() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10; const n = W(!1); let o; const t = () => { clearTimeout(o); }; return re(() => { t(); }), [n, (l, m) => { t(), o = setTimeout(() => { n.value = l, m && m(); }, e); }, t]; } const ln = Symbol("BaseSelectContextKey"); function ho(e) { return Ee(ln, e); } function qo() { return De(ln, {}); } const vo = () => { if (typeof navigator == "undefined" || typeof window == "undefined") return !1; const e = navigator.userAgent || navigator.vendor || window.opera; return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e == null ? void 0 : e.substring(0, 4)); }; function bo(e) { if (!eo(e)) return Ue(e); const n = new Proxy({}, { get(o, t, i) { return Reflect.get(e.value, t, i); }, set(o, t, i) { return e.value[t] = i, !0; }, deleteProperty(o, t) { return Reflect.deleteProperty(e.value, t); }, has(o, t) { return Reflect.has(e.value, t); }, ownKeys() { return Object.keys(e.value); }, getOwnPropertyDescriptor() { return { enumerable: !0, configurable: !0 }; } }); return Ue(n); } var So = function(e, n) { var o = {}; for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++) n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]); return o; }; const yo = ["value", "onChange", "removeIcon", "placeholder", "autofocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabindex", "OptionList", "notFoundContent"], wo = () => ({ prefixCls: String, id: String, omitDomProps: Array, // >>> Value displayValues: Array, onDisplayValuesChange: Function, // >>> Active /** Current dropdown list active item string value */ activeValue: String, /** Link search input with target element */ activeDescendantId: String, onActiveValueChange: Function, // >>> Search searchValue: String, /** Trigger onSearch, return false to prevent trigger open event */ onSearch: Function, /** Trigger when search text match the `tokenSeparators`. Will provide split content */ onSearchSplit: Function, maxLength: Number, OptionList: s.any, /** Tell if provided `options` is empty */ emptyOptions: Boolean }), Io = () => ({ showSearch: { type: Boolean, default: void 0 }, tagRender: { type: Function }, optionLabelRender: { type: Function }, direction: { type: String }, // MISC tabindex: Number, autofocus: Boolean, notFoundContent: s.any, placeholder: s.any, onClear: Function, choiceTransitionName: String, // >>> Mode mode: String, // >>> Status disabled: { type: Boolean, default: void 0 }, loading: { type: Boolean, default: void 0 }, // >>> Open open: { type: Boolean, default: void 0 }, defaultOpen: { type: Boolean, default: void 0 }, onDropdownVisibleChange: { type: Function }, // >>> Customize Input /** @private Internal usage. Do not use in your production. */ getInputElement: { type: Function }, /** @private Internal usage. Do not use in your production. */ getRawInputElement: { type: Function }, // >>> Selector maxTagTextLength: Number, maxTagCount: { type: [String, Number] }, maxTagPlaceholder: s.any, // >>> Search tokenSeparators: { type: Array }, // >>> Icons allowClear: { type: Boolean, default: void 0 }, showArrow: { type: Boolean, default: void 0 }, inputIcon: s.any, /** Clear all icon */ clearIcon: s.any, /** Selector remove icon */ removeIcon: s.any, // >>> Dropdown animation: String, transitionName: String, dropdownStyle: { type: Object }, dropdownClassName: String, dropdownMatchSelectWidth: { type: [Boolean, Number], default: void 0 }, dropdownRender: { type: Function }, dropdownAlign: Object, placement: { type: String }, getPopupContainer: { type: Function }, // >>> Focus showAction: { type: Array }, onBlur: { type: Function }, onFocus: { type: Function }, // >>> Rest Events onKeyup: Function, onKeydown: Function, onMousedown: Function, onPopupScroll: Function, onInputKeyDown: Function, onMouseenter: Function, onMouseleave: Function, onClick: Function }), xo = () => d(d({}, wo()), Io()); function Co(e) { return e === "tags" || e === "multiple"; } const Qo = ce({ compatConfig: { MODE: 3 }, name: "BaseSelect", inheritAttrs: !1, props: Vn(xo(), { showAction: [], notFoundContent: "Not Found" }), setup(e, n) { let { attrs: o, expose: t, slots: i } = n; const l = N(() => Co(e.mode)), m = N(() => e.showSearch !== void 0 ? e.showSearch : l.value || e.mode === "combobox"), v = W(!1); re(() => { v.value = vo(); }); const x = Me(), b = W(null), u = en(), C = W(null), M = W(null), $ = W(null), g = se(!1), [h, w, c] = go(); t({ focus: () => { var a; (a = M.value) === null || a === void 0 || a.focus(); }, blur: () => { var a; (a = M.value) === null || a === void 0 || a.blur(); }, scrollTo: (a) => { var r; return (r = $.value) === null || r === void 0 ? void 0 : r.scrollTo(a); } }); const S = N(() => { var a; if (e.mode !== "combobox") return e.searchValue; const r = (a = e.displayValues[0]) === null || a === void 0 ? void 0 : a.value; return typeof r == "string" || typeof r == "number" ? String(r) : ""; }), E = e.open !== void 0 ? e.open : e.defaultOpen, T = W(E), y = W(E), X = (a) => { T.value = e.open !== void 0 ? e.open : a, y.value = T.value; }; ae(() => e.open, () => { X(e.open); }); const D = N(() => !e.notFoundContent && e.emptyOptions); Ze(() => { y.value = T.value, (e.disabled || D.value && y.value && e.mode === "combobox") && (y.value = !1); }); const V = N(() => D.value ? !1 : y.value), R = (a) => { const r = a !== void 0 ? a : !y.value; y.value !== r && !e.disabled && (X(r), e.onDropdownVisibleChange && e.onDropdownVisibleChange(r)); }, Y = N(() => (e.tokenSeparators || []).some((a) => [` `, `\r `].includes(a))), L = (a, r, z) => { var H, _; let A = !0, j = a; (H = e.onActiveValueChange) === null || H === void 0 || H.call(e, null); const K = z ? null : to(a, e.tokenSeparators); return e.mode !== "combobox" && K && (j = "", (_ = e.onSearchSplit) === null || _ === void 0 || _.call(e, K), R(!1), A = !1), e.onSearch && S.value !== j && e.onSearch(j, { source: r ? "typing" : "effect" }), A; }, U = (a) => { var r; !a || !a.trim() || (r = e.onSearch) === null || r === void 0 || r.call(e, a, { source: "submit" }); }; ae(y, () => { !y.value && !l.value && e.mode !== "combobox" && L("", !1, !1); }, { immediate: !0, flush: "post" }), ae(() => e.disabled, () => { T.value && e.disabled && X(!1), e.disabled && !g.value && w(!1); }, { immediate: !0 }); const [F, B] = tn(), oe = function(a) { var r; const z = F(), { which: H } = a; if (H === I.ENTER && (e.mode !== "combobox" && a.preventDefault(), y.value || R(!0)), B(!!S.value), H === I.BACKSPACE && !z && l.value && !S.value && e.displayValues.length) { const K = [...e.displayValues]; let k = null; for (let G = K.length - 1; G >= 0; G -= 1) { const ee = K[G]; if (!ee.disabled) { K.splice(G, 1), k = ee; break; } } k && e.onDisplayValuesChange(K, { type: "remove", values: [k] }); } for (var _ = arguments.length, A = new Array(_ > 1 ? _ - 1 : 0), j = 1; j < _; j++) A[j - 1] = arguments[j]; y.value && $.value && $.value.onKeydown(a, ...A), (r = e.onKeydown) === null || r === void 0 || r.call(e, a, ...A); }, te = function(a) { for (var r = arguments.length, z = new Array(r > 1 ? r - 1 : 0), H = 1; H < r; H++) z[H - 1] = arguments[H]; y.value && $.value && $.value.onKeyup(a, ...z), e.onKeyup && e.onKeyup(a, ...z); }, O = (a) => { const r = e.displayValues.filter((z) => z !== a); e.onDisplayValuesChange(r, { type: "remove", values: [a] }); }, J = W(!1), ie = function() { w(!0), e.disabled || (e.onFocus && !J.value && e.onFocus(...arguments), e.showAction && e.showAction.includes("focus") && R(!0)), J.value = !0; }, he = se(!1), rn = function() { if (he.value || (g.value = !0, w(!1, () => { J.value = !1, g.value = !1, R(!1); }), e.disabled)) return; const a = S.value; a && (e.mode === "tags" ? e.onSearch(a, { source: "submit" }) : e.mode === "multiple" && e.onSearch("", { source: "blur" })), e.onBlur && e.onBlur(...arguments); }, sn = () => { he.value = !0; }, un = () => { he.value = !1; }; Ee("VCSelectContainerEvent", { focus: ie, blur: rn }); const Q = []; re(() => { Q.forEach((a) => clearTimeout(a)), Q.splice(0, Q.length); }), Oe(() => { Q.forEach((a) => clearTimeout(a)), Q.splice(0, Q.length); }); const cn = function(a) { var r, z; const { target: H } = a, _ = (r = C.value) === null || r === void 0 ? void 0 : r.getPopupElement(); if (_ && _.contains(H)) { const k = setTimeout(() => { var G; const ee = Q.indexOf(k); ee !== -1 && Q.splice(ee, 1), c(), !v.value && !_.contains(document.activeElement) && ((G = M.value) === null || G === void 0 || G.focus()); }); Q.push(k); } for (var A = arguments.length, j = new Array(A > 1 ? A - 1 : 0), K = 1; K < A; K++) j[K - 1] = arguments[K]; (z = e.onMousedown) === null || z === void 0 || z.call(e, a, ...j); }, ve = W(null), dn = () => { }; return re(() => { ae(V, () => { var a; if (V.value) { const r = Math.ceil((a = b.value) === null || a === void 0 ? void 0 : a.offsetWidth); ve.value !== r && !Number.isNaN(r) && (ve.value = r); } }, { immediate: !0, flush: "post" }); }), fo([b, C], V, R), ho(bo(d(d({}, no(e)), { open: y, triggerOpen: V, showSearch: m, multiple: l, toggleOpen: R }))), () => { const a = d(d({}, e), o), { prefixCls: r, id: z, open: H, defaultOpen: _, mode: A, // Search related showSearch: j, searchValue: K, onSearch: k, // Icons allowClear: G, clearIcon: ee, showArrow: Be, inputIcon: pn, // Others disabled: be, loading: me, getInputElement: ze, getPopupContainer: mn, placement: fn, // Dropdown animation: gn, transitionName: hn, dropdownStyle: vn, dropdownClassName: bn, dropdownMatchSelectWidth: Sn, dropdownRender: yn, dropdownAlign: wn, showAction: Bo, direction: In, // Tags tokenSeparators: zo, tagRender: xn, optionLabelRender: Cn, // Events onPopupScroll: No, onDropdownVisibleChange: Vo, onFocus: Lo, onBlur: Ho, onKeyup: Ao, onKeydown: Wo, onMousedown: Ko, onClear: Se, omitDomProps: ye, getRawInputElement: Ne, displayValues: fe, onDisplayValuesChange: $n, emptyOptions: Pn, activeDescendantId: Tn, activeValue: Fn, OptionList: Dn } = a, En = So(a, ["prefixCls", "id", "open", "defaultOpen", "mode", "showSearch", "searchValue", "onSearch", "allowClear", "clearIcon", "showArrow", "inputIcon", "disabled", "loading", "getInputElement", "getPopupContainer", "placement", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "showAction", "direction", "tokenSeparators", "tagRender", "optionLabelRender", "onPopupScroll", "onDropdownVisibleChange", "onFocus", "onBlur", "onKeyup", "onKeydown", "onMousedown", "onClear", "omitDomProps", "getRawInputElement", "displayValues", "onDisplayValuesChange", "emptyOptions", "activeDescendantId", "activeValue", "OptionList"]), Ve = A === "combobox" && ze && ze() || null, de = typeof Ne == "function" && Ne(), we = d({}, En); let Le; de && (Le = (ne) => { R(ne); }), yo.forEach((ne) => { delete we[ne]; }), ye == null || ye.forEach((ne) => { delete we[ne]; }); const He = Be !== void 0 ? Be : me || !l.value && A !== "combobox"; let Ae; He && (Ae = p(ue, { class: pe(`${r}-arrow`, { [`${r}-arrow-loading`]: me }), customizeIcon: pn, customizeIconProps: { loading: me, searchValue: S.value, open: y.value, focused: h.value, showSearch: m.value } }, null)); let We; const On = () => { Se == null || Se(), $n([], { type: "clear", values: fe }), L("", !1, !1); }; !be && G && (fe.length || S.value) && (We = p(ue, { class: `${r}-clear`, onMousedown: On, customizeIcon: ee }, { default: () => [Te("×")] })); const Mn = p(Dn, { ref: $ }, d(d({}, x.customSlots), { option: i.option })), Rn = pe(r, o.class, { [`${r}-focused`]: h.value, [`${r}-multiple`]: l.value, [`${r}-single`]: !l.value, [`${r}-allow-clear`]: G, [`${r}-show-arrow`]: He, [`${r}-disabled`]: be, [`${r}-loading`]: me, [`${r}-open`]: y.value, [`${r}-customize-input`]: Ve, [`${r}-show-search`]: m.value }), Ke = p(ao, { ref: C, disabled: be, prefixCls: r, visible: V.value, popupElement: Mn, containerWidth: ve.value, animation: gn, transitionName: hn, dropdownStyle: vn, dropdownClassName: bn, direction: In, dropdownMatchSelectWidth: Sn, dropdownRender: yn, dropdownAlign: wn, placement: fn, getPopupContainer: mn, empty: Pn, getTriggerDOMNode: () => u.current, onPopupVisibleChange: Le, onPopupMouseEnter: dn, onPopupFocusin: sn, onPopupFocusout: un }, { default: () => de ? Ln(de) && Qe(de, { ref: u }, !1, !0) : p(mo, q(q({}, e), {}, { domRef: u, prefixCls: r, inputElement: Ve, ref: M, id: z, showSearch: m.value, mode: A, activeDescendantId: Tn, tagRender: xn, optionLabelRender: Cn, values: fe, open: y.value, onToggleOpen: R, activeValue: Fn, searchValue: S.value, onSearch: L, onSearchSubmit: U, onRemove: O, tokenWithEnter: Y.value }), null) }); let Ie; return de ? Ie = Ke : Ie = p("div", q(q({}, we), {}, { class: Rn, ref: b, onMousedown: cn, onKeydown: oe, onKeyup: te }), [h.value && !y.value && p("span", { style: { width: 0, height: 0, position: "absolute", overflow: "hidden", opacity: 0 }, "aria-live": "polite" }, [`${fe.map((ne) => { let { label: _e, value: Bn } = ne; return ["number", "string"].includes(typeof _e) ? _e : Bn; }).join(", ")}`]), Ke, Ae, We]), Ie; }; } }); let Ye = 0; const $o = process.env.NODE_ENV !== "test" && Hn(); function Po() { let e; return $o ? (e = Ye, Ye += 1) : e = "TEST_OR_SSR", e; } function Jo() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : se(""); const n = `rc_select_${Po()}`; return e.value || n; } function Zo(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const { loading: o, multiple: t, prefixCls: i, hasFeedback: l, feedbackIcon: m, showArrow: v } = e, x = e.suffixIcon || n.suffixIcon && n.suffixIcon(), b = e.clearIcon || n.clearIcon && n.clearIcon(), u = e.menuItemSelectedIcon || n.menuItemSelectedIcon && n.menuItemSelectedIcon(), C = e.removeIcon || n.removeIcon && n.removeIcon(), M = b != null ? b : p(An, null, null), $ = (c) => p(ge, null, [v !== !1 && c, l && m]); let g = null; if (x !== void 0) g = $(x); else if (o) g = $(p(Wn, { spin: !0 }, null)); else { const c = `${i}-suffix`; g = (f) => { let { open: P, showSearch: S } = f; return $(P && S ? p(jn, { class: c }, null) : p(Xn, { class: c }, null)); }; } let h = null; u !== void 0 ? h = u : t ? h = p(Kn, null, null) : h = null; let w = null; return C !== void 0 ? w = C : w = p(_n, null, null), { clearIcon: M, suffixIcon: g, itemIcon: h, removeIcon: w }; } const qe = (e) => { const { controlPaddingHorizontal: n } = e; return { position: "relative", display: "block", minHeight: e.controlHeight, padding: `${(e.controlHeight - e.fontSize * e.lineHeight) / 2}px ${n}px`, color: e.colorText, fontWeight: "normal", fontSize: e.fontSize, lineHeight: e.lineHeight, boxSizing: "border-box" }; }, To = (e) => { const { antCls: n, componentCls: o } = e, t = `${o}-item`; return [ { [`${o}-dropdown`]: d(d({}, Fe(e)), { position: "absolute", top: -9999, zIndex: e.zIndexPopup, boxSizing: "border-box", padding: e.paddingXXS, overflow: "hidden", fontSize: e.fontSize, // Fix select render lag of long text in chrome // https://github.com/ant-design/ant-design/issues/11456 // https://github.com/ant-design/ant-design/issues/11843 fontVariant: "initial", backgroundColor: e.colorBgElevated, borderRadius: e.borderRadiusLG, outline: "none", boxShadow: e.boxShadowSecondary, [` &${n}-slide-up-enter${n}-slide-up-enter-active${o}-dropdown-placement-bottomLeft, &${n}-slide-up-appear${n}-slide-up-appear-active${o}-dropdown-placement-bottomLeft `]: { animationName: Un }, [` &${n}-slide-up-enter${n}-slide-up-enter-active${o}-dropdown-placement-topLeft, &${n}-slide-up-appear${n}-slide-up-appear-active${o}-dropdown-placement-topLeft `]: { animationName: Gn }, [`&${n}-slide-up-leave${n}-slide-up-leave-active${o}-dropdown-placement-bottomLeft`]: { animationName: Yn }, [`&${n}-slide-up-leave${n}-slide-up-leave-active${o}-dropdown-placement-topLeft`]: { animationName: qn }, "&-hidden": { display: "none" }, "&-empty": { color: e.colorTextDisabled }, // ========================= Options ========================= [`${t}-empty`]: d(d({}, qe(e)), { color: e.colorTextDisabled }), [`${t}`]: d(d({}, qe(e)), { cursor: "pointer", transition: `background ${e.motionDurationSlow} ease`, borderRadius: e.borderRadiusSM, // =========== Group ============ "&-group": { color: e.colorTextDescription, fontSize: e.fontSizeSM, cursor: "default" }, // =========== Option =========== "&-option": { display: "flex", "&-content": d({ flex: "auto" }, Pe), "&-state": { flex: "none" }, [`&-active:not(${t}-option-disabled)`]: { backgroundColor: e.controlItemBgHover }, [`&-selected:not(${t}-option-disabled)`]: { color: e.colorText, fontWeight: e.fontWeightStrong, backgroundColor: e.controlItemBgActive, [`${t}-option-state`]: { color: e.colorPrimary } }, "&-disabled": { [`&${t}-option-selected`]: { backgroundColor: e.colorBgContainerDisabled }, color: e.colorTextDisabled, cursor: "not-allowed" }, "&-grouped": { paddingInlineStart: e.controlPaddingHorizontal * 2 } } }), // =========================== RTL =========================== "&-rtl": { direction: "rtl" } }) }, // Follow code may reuse in other components je(e, "slide-up"), je(e, "slide-down"), Xe(e, "move-up"), Xe(e, "move-down") ]; }, le = 2; function an(e) { let { controlHeightSM: n, controlHeight: o, lineWidth: t } = e; const i = (o - n) / 2 - t, l = Math.ceil(i / 2); return [i, l]; } function xe(e, n) { const { componentCls: o, iconCls: t } = e, i = `${o}-selection-overflow`, l = e.controlHeightSM, [m] = an(e), v = n ? `${o}-${n}` : ""; return { [`${o}-multiple${v}`]: { fontSize: e.fontSize, /** * Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome * may update to redesign with its align logic. */ // =========================== Overflow =========================== [i]: { position: "relative", display: "flex", flex: "auto", flexWrap: "wrap", maxWidth: "100%", "&-item": { flex: "none", alignSelf: "center", maxWidth: "100%", display: "inline-flex" } }, // ========================= Selector ========================= [`${o}-selector`]: { display: "flex", flexWrap: "wrap", alignItems: "center", // Multiple is little different that horizontal is follow the vertical padding: `${m - le}px ${le * 2}px`, borderRadius: e.borderRadius, [`${o}-show-search&`]: { cursor: "text" }, [`${o}-disabled&`]: { background: e.colorBgContainerDisabled, cursor: "not-allowed" }, "&:after": { display: "inline-block", width: 0, margin: `${le}px 0`, lineHeight: `${l}px`, content: '"\\a0"' } }, [` &${o}-show-arrow ${o}-selector, &${o}-allow-clear ${o}-selector `]: { paddingInlineEnd: e.fontSizeIcon + e.controlPaddingHorizontal }, // ======================== Selections ======================== [`${o}-selection-item`]: { position: "relative", display: "flex", flex: "none", boxSizing: "border-box", maxWidth: "100%", height: l, marginTop: le, marginBottom: le, lineHeight: `${l - e.lineWidth * 2}px`, background: e.colorFillSecondary, border: `${e.lineWidth}px solid ${e.colorSplit}`, borderRadius: e.borderRadiusSM, cursor: "default", transition: `font-size ${e.motionDurationSlow}, line-height ${e.motionDurationSlow}, height ${e.motionDurationSlow}`, userSelect: "none", marginInlineEnd: le * 2, paddingInlineStart: e.paddingXS, paddingInlineEnd: e.paddingXS / 2, [`${o}-disabled&`]: { color: e.colorTextDisabled, borderColor: e.colorBorder, cursor: "not-allowed" }, // It's ok not to do this, but 24px makes bottom narrow in view should adjust "&-content": { display: "inline-block", marginInlineEnd: e.paddingXS / 2, overflow: "hidden", whiteSpace: "pre", textOverflow: "ellipsis" }, "&-remove": d(d({}, Je()), { display: "inline-block", color: e.colorIcon, fontWeight: "bold", fontSize: 10, lineHeight: "inherit", cursor: "pointer", [`> ${t}`]: { verticalAlign: "-0.2em" }, "&:hover": { color: e.colorIconHover } }) }, // ========================== Input ========================== [`${i}-item + ${i}-item`]: { [`${o}-selection-search`]: { marginInlineStart: 0 } }, [`${o}-selection-search`]: { display: "inline-flex", position: "relative", maxWidth: "100%", marginInlineStart: e.inputPaddingHorizontalBase - m, "\n &-input,\n &-mirror\n ": { height: l, fontFamily: e.fontFamily, lineHeight: `${l}px`, transition: `all ${e.motionDurationSlow}` }, "&-input": { width: "100%", minWidth: 4.1 // fix search cursor missing }, "&-mirror": { position: "absolute", top: 0, insetInlineStart: 0, insetInlineEnd: "auto", zIndex: 999, whiteSpace: "pre", visibility: "hidden" } }, // ======================= Placeholder ======================= [`${o}-selection-placeholder `]: { position: "absolute", top: "50%", insetInlineStart: e.inputPaddingHorizontalBase, insetInlineEnd: e.inputPaddingHorizontalBase, transform: "translateY(-50%)", transition: `all ${e.motionDurationSlow}` } } }; } function Fo(e) { const { componentCls: n } = e, o = Z(e, { controlHeight: e.controlHeightSM, controlHeightSM: e.controlHeightXS, borderRadius: e.borderRadiusSM, borderRadiusSM: e.borderRadiusXS }), [, t] = an(e); return [ xe(e), // ======================== Small ======================== // Shared xe(o, "sm"), // Padding { [`${n}-multiple${n}-sm`]: { [`${n}-selection-placeholder`]: { insetInlineStart: e.controlPaddingHorizontalSM - e.lineWidth, insetInlineEnd: "auto" }, // https://github.com/ant-design/ant-design/issues/29559 [`${n}-selection-search`]: { marginInlineStart: t } } }, // ======================== Large ======================== // Shared xe(Z(e, { fontSize: e.fontSizeLG, controlHeight: e.controlHeightLG, controlHeightSM: e.controlHeight, borderRadius: e.borderRadiusLG, borderRadiusSM: e.borderRadius }), "lg") ]; } function Ce(e, n) { const { componentCls: o, inputPaddingHorizontalBase: t, borderRadius: i } = e, l = e.controlHeight - e.lineWidth * 2, m = Math.ceil(e.fontSize * 1.25), v = n ? `${o}-${n}` : ""; return { [`${o}-single${v}`]: { fontSize: e.fontSize, // ========================= Selector ========================= [`${o}-selector`]: d(d({}, Fe(e)), { display: "flex", borderRadius: i, [`${o}-selection-search`]: { position: "absolute", top: 0, insetInlineStart: t, insetInlineEnd: t, bottom: 0, "&-input": { width: "100%" } }, [` ${o}-selection-item, ${o}-selection-placeholder `]: { padding: 0, lineHeight: `${l}px`, transition: `all ${e.motionDurationSlow}`, // Firefox inline-block position calculation is not same as Chrome & Safari. Patch this: "@supports (-moz-appearance: meterbar)": { lineHeight: `${l}px` } }, [`${o}-selection-item`]: { position: "relative", userSelect: "none" }, [`${o}-selection-placeholder`]: { transition: "none", pointerEvents: "none" }, // For common baseline align [[ "&:after", /* For '' value baseline align */ `${o}-selection-item:after`, /* For undefined value baseline align */ `${o}-selection-placeholder:after` ].join(",")]: { display: "inline-block", width: 0, visibility: "hidden", content: '"\\a0"' } }), [` &${o}-show-arrow ${o}-selection-item, &${o}-show-arrow ${o}-selection-placeholder `]: { paddingInlineEnd: m }, // Opacity selection if open [`&${o}-open ${o}-selection-item`]: { color: e.colorTextPlaceholder }, // ========================== Input ========================== // We only change the style of non-customize input which is only support by `combobox` mode. // Not customize [`&:not(${o}-customize-input)`]: { [`${o}-selector`]: { width: "100%", height: e.controlHeight, padding: `0 ${t}px`, [`${o}-selection-search-input`]: { height: l }, "&:after": { lineHeight: `${l}px` } } }, [`&${o}-customize-input`]: { [`${o}-selector`]: { "&:after": { display: "none" }, [`${o}-selection-search`]: { position: "static", width: "100%" }, [`${o}-selection-placeholder`]: { position: "absolute", insetInlineStart: 0, insetInlineEnd: 0, padding: `0 ${t}px`, "&:after": { display: "none" } } } } } }; } function Do(e) { const { componentCls: n } = e, o = e.controlPaddingHorizontalSM - e.lineWidth; return [ Ce(e), // ======================== Small ======================== // Shared Ce(Z(e, { controlHeight: e.controlHeightSM, borderRadius: e.borderRadiusSM }), "sm"), // padding { [`${n}-single${n}-sm`]: { [`&:not(${n}-customize-input)`]: { [`${n}-selection-search`]: { insetInlineStart: o, insetInlineEnd: o }, [`${n}-selector`]: { padding: `0 ${o}px` }, // With arrow should provides `padding-right` to show the arrow [`&${n}-show-arrow ${n}-selection-search`]: { insetInlineEnd: o + e.fontSize * 1.5 }, [` &${n}-show-arrow ${n}-selection-item, &${n}-show-arrow ${n}-selection-placeholder `]: { paddingInlineEnd: e.fontSize * 1.5 } } } }, // ======================== Large ======================== // Shared Ce(Z(e, { controlHeight: e.controlHeightLG, fontSize: e.fontSizeLG, borderRadius: e.borderRadiusLG }), "lg") ]; } const Eo = (e) => { const { componentCls: n } = e; return { position: "relative", backgroundColor: e.colorBgContainer, border: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`, transition: `all ${e.motionDurationMid} ${e.motionEaseInOut}`, input: { cursor: "pointer" }, [`${n}-show-search&`]: { cursor: "text", input: { cursor: "auto", color: "inherit" } }, [`${n}-disabled&`]: { color: e.colorTextDisabled, background: e.colorBgContainerDisabled, cursor: "not-allowed", [`${n}-multiple&`]: { background: e.colorBgContainerDisabled }, input: { cursor: "not-allowed" } } }; }, $e = function(e, n) { let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1; const { componentCls: t, borderHoverColor: i, outlineColor: l, antCls: m } = n, v = o ? { [`${t}-selector`]: { borderColor: i } } : {}; return { [e]: { [`&:not(${t}-disabled):not(${t}-customize-input):not(${m}-pagination-size-changer)`]: d(d({}, v), { [`${t}-focused& ${t}-selector`]: { borderColor: i, boxShadow: `0 0 0 ${n.controlOutlineWidth}px ${l}`, borderInlineEndWidth: `${n.controlLineWidth}px !important`, outline: 0 }, [`&:hover ${t}-selector`]: { borderColor: i, borderInlineEndWidth: `${n.controlLineWidth}px !important` } }) } }; }, Oo = (e) => { const { componentCls: n } = e; return { [`${n}-selection-search-input`]: { margin: 0, padding: 0, background: "transparent", border: "none", outline: "none", appearance: "none", "&::-webkit-search-cancel-button": { display: "none", "-webkit-appearance": "none" } } }; }, Mo = (e) => { const { componentCls: n, inputPaddingHorizontalBase: o, iconCls: t } = e; return { [n]: d(d({}, Fe(e)), { position: "relative", display: "inline-block", cursor: "pointer", [`&:not(${n}-customize-input) ${n}-selector`]: d(d({}, Eo(e)), Oo(e)), // [`&:not(&-disabled):hover ${selectCls}-selector`]: { // ...genHoverStyle(token), // }, // ======================== Selection ======================== [`${n}-selection-item`]: d({ flex: 1, fontWeight: "normal" }, Pe), // ======================= Placeholder ======================= [`${n}-selection-placeholder`]: d(d({}, Pe), { flex: 1, color: e.colorTextPlaceholder, pointerEvents: "none" }), // ========================== Arrow ========================== [`${n}-arrow`]: d(d({}, Je()), { position: "absolute", top: "50%", insetInlineStart: "auto", insetInlineEnd: o, height: e.fontSizeIcon, marginTop: -e.fontSizeIcon / 2, color: e.colorTextQuaternary, fontSize: e.fontSizeIcon, lineHeight: 1, textAlign: "center", pointerEvents: "none", display: "flex", alignItems: "center", [t]: { verticalAlign: "top", transition: `transform ${e.motionDurationSlow}`, "> svg": { verticalAlign: "top" }, [`&:not(${n}-suffix)`]: { pointerEvents: "auto" } }, [`${n}-disabled &`]: { cursor: "not-allowed" }, "> *:not(:last-child)": { marginInlineEnd: 8 // FIXME: magic } }), // ========================== Clear ========================== [`${n}-clear`]: { position: "absolute", top: "50%", insetInlineStart: "auto", insetInlineEnd: o, zIndex: 1, display: "inline-block", width: e.fontSizeIcon, height: e.fontSizeIcon, marginTop: -e.fontSizeIcon / 2, color: e.colorTextQuaternary, fontSize: e.fontSizeIcon, fontStyle: "normal", lineHeight: 1, textAlign: "center", textTransform: "none", background: e.colorBgContainer, cursor: "pointer", opacity: 0, transition: `color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`, textRendering: "auto", "&:before": { display: "block" }, "&:hover": { color: e.colorTextTertiary } }, "&:hover": { [`${n}-clear`]: { opacity: 1 } } }), // ========================= Feedback ========================== [`${n}-has-feedback`]: { [`${n}-clear`]: { insetInlineEnd: o + e.fontSize + e.paddingXXS } } }; }, Ro = (e) => { const { componentCls: n } = e; return [ { [n]: { // ==================== BorderLess ==================== [`&-borderless ${n}-selector`]: { backgroundColor: "transparent !important", borderColor: "transparent !important", boxShadow: "none !important" }, // ==================== In Form ==================== [`&${n}-in-form-item`]: { width: "100%" } } }, // ===================================================== // == LTR == // ===================================================== // Base Mo(e), // Single Do(e), // Multiple Fo(e), // Dropdown To(e), // ===================================================== // == RTL == // ===================================================== { [`${n}-rtl`]: { direction: "rtl" } }, // ===================================================== // == Status == // ===================================================== $e(n, Z(e, { borderHoverColor: e.colorPrimaryHover, outlineColor: e.controlOutline })), $e(`${n}-status-error`, Z(e, { borderHoverColor: e.colorErrorHover, outlineColor: e.colorErrorOutline }), !0), $e(`${n}-status-warning`, Z(e, { borderHoverColor: e.colorWarningHover, outlineColor: e.colorWarningOutline }), !0), // ===================================================== // == Space Compact == // ===================================================== Jn(e, { borderElCls: `${n}-selector`, focusElCls: `${n}-focused` }) ]; }, ko = Qn("Select", (e, n) => { let { rootPrefixCls: o } = n; const t = Z(e, { rootPrefixCls: o, inputPaddingHorizontalBase: e.paddingSM - 1 }); return [Ro(t)]; }, (e) => ({ zIndexPopup: e.zIndexPopupBase + 50 })); export { Qo as B, Jo as a, Io as b, ko as c, Me as d, Yo as e, Zo as g, bo as t, qo as u };