import { d, l as Nn, P as s, aq as Vn, _ as Q, c as fe, p as Je, J as Ze, ar as Ln, K as C, n as An, i as Hn, as as Wn, af as Kn, A as _n, ad as jn, ac as Un, at as Xn, au as Gn, r as Fe, av as Yn, aw as Qn, ax as qn, ay as Jn, t as Pe, az as je, aA as Ue, m as Z, aB as ke, g as Zn, v as kn } from "./index2.js"; import { defineComponent as ce, computed as N, ref as ue, createVNode as f, isVNode as eo, cloneVNode as no, inject as De, provide as Ee, shallowRef as W, watchEffect as en, onMounted as re, watch as ae, createTextVNode as Te, Fragment as he, onBeforeUnmount as Oe, isRef as oo, reactive as Xe, toRefs as to } from "vue"; import { B as io } from "./BaseInput.js"; import { c as nn } from "./createRef.js"; import { i as lo } from "./isMobile.js"; function Ge(e, n) { const { key: o } = e; let t; return "value" in e && ({ value: t } = e), o != null ? o : t !== void 0 ? t : `rc-index-key-${n}`; } function ao(e, n) { const { label: o, value: t, options: i } = e || {}; return { label: o || (n ? "children" : "label"), value: t || "value", options: i || "options" }; } function Jo(e) { let { fieldNames: n, childrenAsData: o } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const t = [], { label: i, value: l, options: p } = ao(n, !1); function m(I, g) { I.forEach((a) => { const x = a[i]; if (g || !(p in a)) { const $ = a[l]; t.push({ key: Ge(a, t.length), groupOption: g, data: a, label: x, value: $ }); } else { let $ = x; $ === void 0 && o && ($ = a.label), t.push({ key: Ge(a, t.length), group: !0, data: a, label: $ }), m(a[p], !0); } }); } return m(e, !1), t; } function Zo(e) { const n = d({}, e); return "props" in n || Object.defineProperty(n, "props", { get() { return Nn(!1, "Return type is option instead of Option instance. Please read value directly instead of reading from `props`."), n; } }), n; } function ro(e, n) { if (!n || !n.length) return null; let o = !1; function t(l, p) { let [m, ...I] = p; if (!m) return [l]; const g = l.split(m); return o = o || g.length > 1, g.reduce((a, x) => [...a, ...t(x, I)], []).filter((a) => a); } const i = t(e, n); return o ? i : null; } var uo = 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 so = (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 } } }; }, co = 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: m } = e; return so(m); }), p = ue(); return i({ getPopupElement: () => p.value }), () => { const m = d(d({}, e), t), { empty: I = !1 } = m, g = uo(m, ["empty"]), { visible: a, dropdownAlign: x, prefixCls: $, popupElement: P, dropdownClassName: h, dropdownStyle: S, direction: b = "ltr", placement: c, dropdownMatchSelectWidth: v, containerWidth: T, dropdownRender: y, animation: O, transitionName: F, getPopupContainer: w, getTriggerDOMNode: U, onPopupVisibleChange: E, onPopupMouseEnter: V, onPopupFocusin: R, onPopupFocusout: Y } = g, L = `${$}-dropdown`; let X = P; y && (X = y({ menuNode: P, props: e })); const D = O ? `${L}-${O}` : F, B = d({ minWidth: `${T}px` }, S); return typeof v == "number" ? B.width = `${v}px` : v && (B.width = `${T}px`), f(Vn, Q(Q({}, e), {}, { showAction: E ? ["click"] : [], hideAction: E ? ["click"] : [], popupPlacement: c || (b === "rtl" ? "bottomRight" : "bottomLeft"), builtinPlacements: l.value, prefixCls: L, popupTransitionName: D, popupAlign: x, popupVisible: a, getPopupContainer: w, popupClassName: fe(h, { [`${L}-empty`]: I }), popupStyle: B, getTriggerDOMNode: U, onPopupVisibleChange: E }), { default: o.default, popup: () => f("div", { ref: p, onMouseenter: V, onFocusin: R, onFocusout: Y }, [X]) }); }; } }), se = (e, n) => { let { slots: o } = n; var t; const { class: i, customizeIcon: l, customizeIconProps: p, onMousedown: m, onClick: I } = e; let g; return typeof l == "function" ? g = l(p) : g = eo(l) ? no(l) : l, f("span", { class: i, onMousedown: (a) => { a.preventDefault(), m && m(a); }, style: { userSelect: "none", WebkitUserSelect: "none" }, unselectable: "on", onClick: I, "aria-hidden": !0 }, [g !== void 0 ? g : f("span", { class: i.split(/\s+/).map((a) => `${a}-icon`) }, [(t = o.default) === null || t === void 0 ? void 0 : t.call(o)])]); }; se.inheritAttrs = !1; se.displayName = "TransBtn"; se.props = { class: String, customizeIcon: s.any, customizeIconProps: s.any, onMousedown: Function, onClick: Function }; const po = { 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 } }, on = ce({ compatConfig: { MODE: 3 }, name: "SelectInput", inheritAttrs: !1, props: po, setup(e) { let n = null; const o = De("VCSelectContainerEvent"); return () => { var t; const { prefixCls: i, id: l, inputElement: p, disabled: m, tabindex: I, autofocus: g, autocomplete: a, editable: x, activeDescendantId: $, value: P, onKeydown: h, onMousedown: S, onChange: b, onPaste: c, onCompositionstart: v, onCompositionend: T, onFocus: y, onBlur: O, open: F, inputRef: w, attrs: U } = e; let E = p || f(io, null, null); const V = E.props || {}, { onKeydown: R, onInput: Y, onFocus: L, onBlur: X, onMousedown: D, onCompositionstart: B, onCompositionend: oe, style: te } = V; return E = Je(E, d(d(d(d(d({ type: "search" }, V), { id: l, ref: w, disabled: m, tabindex: I, lazy: !1, autocomplete: a || "off", autofocus: g, class: fe(`${i}-selection-search-input`, (t = E == null ? void 0 : E.props) === null || t === void 0 ? void 0 : t.class), role: "combobox", "aria-expanded": F, "aria-haspopup": "listbox", "aria-owns": `${l}_list`, "aria-autocomplete": "list", "aria-controls": `${l}_list`, "aria-activedescendant": $ }), U), { value: x ? P : "", readonly: !x, unselectable: x ? null : "on", style: d(d({}, te), { opacity: x ? null : 0 }), onKeydown: (M) => { h(M), R && R(M); }, onMousedown: (M) => { S(M), D && D(M); }, onInput: (M) => { b(M), Y && Y(M); }, onCompositionstart(M) { v(M), B && B(M); }, onCompositionend(M) { T(M), oe && oe(M); }, onPaste: c, onFocus: function() { clearTimeout(n), L && L(arguments.length <= 0 ? void 0 : arguments[0]), y && y(arguments.length <= 0 ? void 0 : arguments[0]), o == null || o.focus(arguments.length <= 0 ? void 0 : arguments[0]); }, onBlur: function() { for (var M = arguments.length, q = new Array(M), ie = 0; ie < M; ie++) q[ie] = arguments[ie]; n = setTimeout(() => { X && X(q[0]), O && O(q[0]), o == null || o.blur(q[0]); }, 100); } }), E.type === "textarea" ? {} : { type: "search" }), !0, !0), E; }; } }), tn = Symbol("TreeSelectLegacyContextPropsKey"); function ko(e) { return Ee(tn, e); } function Me() { return De(tn, {}); } const fo = { 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 }, Ye = (e) => { e.preventDefault(), e.stopPropagation(); }, mo = ce({ name: "MultipleSelectSelector", inheritAttrs: !1, props: fo, setup(e) { const n = W(), o = W(0), t = W(!1), i = Me(), l = N(() => `${e.prefixCls}-selection`), p = N(() => e.open || e.mode === "tags" ? e.searchValue : ""), m = N(() => e.mode === "tags" || e.showSearch && (e.open || t.value)), I = ue(""); en(() => { I.value = p.value; }), re(() => { ae(I, () => { o.value = n.value.scrollWidth; }, { flush: "post", immediate: !0 }); }); function g(h, S, b, c, v) { return f("span", { class: fe(`${l.value}-item`, { [`${l.value}-item-disabled`]: b }), title: typeof h == "string" || typeof h == "number" ? h.toString() : void 0 }, [f("span", { class: `${l.value}-item-content` }, [S]), c && f(se, { class: `${l.value}-item-remove`, onMousedown: Ye, onClick: v, customizeIcon: e.removeIcon }, { default: () => [Te("×")] })]); } function a(h, S, b, c, v, T) { var y; const O = (w) => { Ye(w), e.onToggleOpen(!open); }; let F = T; return i.keyEntities && (F = ((y = i.keyEntities[h]) === null || y === void 0 ? void 0 : y.node) || {}), f("span", { key: h, onMousedown: O }, [e.tagRender({ label: S, value: h, disabled: b, closable: c, onClose: v, option: F })]); } function x(h) { const { disabled: S, label: b, value: c, option: v } = h, T = !e.disabled && !S; let y = b; if (typeof e.maxTagTextLength == "number" && (typeof b == "string" || typeof b == "number")) { const F = String(y); F.length > e.maxTagTextLength && (y = `${F.slice(0, e.maxTagTextLength)}...`); } const O = (F) => { var w; F && F.stopPropagation(), (w = e.onRemove) === null || w === void 0 || w.call(e, h); }; return typeof e.tagRender == "function" ? a(c, y, S, T, O, v) : g(b, y, S, T, O); } function $(h) { const { maxTagPlaceholder: S = (c) => `+ ${c.length} ...` } = e, b = typeof S == "function" ? S(h) : S; return g(b, b, !1); } const P = (h) => { const S = h.target.composing; I.value = h.target.value, S || e.onInputChange(h); }; return () => { const { id: h, prefixCls: S, values: b, open: c, inputRef: v, placeholder: T, disabled: y, autofocus: O, autocomplete: F, activeDescendantId: w, tabindex: U, compositionStatus: E, onInputPaste: V, onInputKeyDown: R, onInputMouseDown: Y, onInputCompositionStart: L, onInputCompositionEnd: X } = e, D = f("div", { class: `${l.value}-search`, style: { width: o.value + "px" }, key: "input" }, [f(on, { inputRef: v, open: c, prefixCls: S, id: h, inputElement: null, disabled: y, autofocus: O, autocomplete: F, editable: m.value, activeDescendantId: w, value: I.value, onKeydown: R, onMousedown: Y, onChange: P, onPaste: V, onCompositionstart: L, onCompositionend: X, tabindex: U, attrs: Ze(e, !0), onFocus: () => t.value = !0, onBlur: () => t.value = !1 }, null), f("span", { ref: n, class: `${l.value}-search-mirror`, "aria-hidden": !0 }, [I.value, Te(" ")])]), B = f(Ln, { prefixCls: `${l.value}-overflow`, data: b, renderItem: x, renderRest: $, suffix: D, itemKey: "key", maxCount: e.maxTagCount, key: "overflow" }, null); return f(he, null, [B, !b.length && !p.value && !E && f("span", { class: `${l.value}-placeholder` }, [T])]); }; } }), go = { 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 a = e.searchValue || ""; return o.value && e.activeValue && !n.value && (a = e.activeValue), a; }), l = Me(); ae([o, () => e.activeValue], () => { o.value && (n.value = !1); }, { immediate: !0 }); const p = N(() => e.mode !== "combobox" && !e.open && !e.showSearch ? !1 : !!i.value || e.compositionStatus), m = N(() => { const a = e.values[0]; return a && (typeof a.label == "string" || typeof a.label == "number") ? a.label.toString() : void 0; }), I = () => { if (e.values[0]) return null; const a = p.value ? { visibility: "hidden" } : void 0; return f("span", { class: `${e.prefixCls}-selection-placeholder`, style: a }, [e.placeholder]); }, g = (a) => { a.target.composing || (n.value = !0, e.onInputChange(a)); }; return () => { var a, x, $, P; const { inputElement: h, prefixCls: S, id: b, values: c, inputRef: v, disabled: T, autofocus: y, autocomplete: O, activeDescendantId: F, open: w, tabindex: U, optionLabelRender: E, onInputKeyDown: V, onInputMouseDown: R, onInputPaste: Y, onInputCompositionStart: L, onInputCompositionEnd: X } = e, D = c[0]; let B = null; if (D && l.customSlots) { const oe = (a = D.key) !== null && a !== void 0 ? a : D.value, te = ((x = l.keyEntities[oe]) === null || x === void 0 ? void 0 : x.node) || {}; B = l.customSlots[($ = te.slots) === null || $ === void 0 ? void 0 : $.title] || l.customSlots.title || D.label, typeof B == "function" && (B = B(te)); } else B = E && D ? E(D.option) : D == null ? void 0 : D.label; return f(he, null, [f("span", { class: `${S}-selection-search` }, [f(on, { inputRef: v, prefixCls: S, id: b, open: w, inputElement: h, disabled: T, autofocus: y, autocomplete: O, editable: t.value, activeDescendantId: F, value: i.value, onKeydown: V, onMousedown: R, onChange: g, onPaste: Y, onCompositionstart: L, onCompositionend: X, tabindex: U, attrs: Ze(e, !0) }, null)]), !o.value && D && !p.value && f("span", { class: `${S}-selection-item`, title: m.value }, [f(he, { key: (P = D.key) !== null && P !== void 0 ? P : D.value }, [B])]), I()]); }; } }); Re.props = go; Re.inheritAttrs = !1; function ho(e) { return ![ // System function button C.ESC, C.SHIFT, C.BACKSPACE, C.TAB, C.WIN_KEY, C.ALT, C.META, C.WIN_KEY_RIGHT, C.CTRL, C.SEMICOLON, C.EQUALS, C.CAPS_LOCK, C.CONTEXT_MENU, // F1-F12 C.F1, C.F2, C.F3, C.F4, C.F5, C.F6, C.F7, C.F8, C.F9, C.F10, C.F11, C.F12 ].includes(e); } function ln() { 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 vo = 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 = nn(), i = ue(!1), [l, p] = ln(0), m = (c) => { const { which: v } = c; (v === C.UP || v === C.DOWN) && c.preventDefault(), e.onInputKeyDown && e.onInputKeyDown(c), v === C.ENTER && e.mode === "tags" && !i.value && !e.open && e.onSearchSubmit(c.target.value), ho(v) && e.onToggleOpen(!0); }, I = () => { p(!0); }; let g = null; const a = (c) => { e.onSearch(c, !0, i.value) !== !1 && e.onToggleOpen(!0); }, x = () => { i.value = !0; }, $ = (c) => { i.value = !1, e.mode !== "combobox" && a(c.target.value); }, P = (c) => { let { target: { value: v } } = c; if (e.tokenWithEnter && g && /[\r\n]/.test(g)) { const T = g.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " "); v = v.replace(T, g); } g = null, a(v); }, h = (c) => { const { clipboardData: v } = c; g = v.getData("text"); }, S = (c) => { let { target: v } = c; v !== t.current && (document.body.style.msTouchAction !== void 0 ? setTimeout(() => { t.current.focus(); }) : t.current.focus()); }, b = (c) => { const v = l(); c.target !== t.current && !v && c.preventDefault(), (e.mode !== "combobox" && (!e.showSearch || !v) || !e.open) && (e.open && e.onSearch("", !0, !1), e.onToggleOpen()); }; return o({ focus: () => { t.current.focus(); }, blur: () => { t.current.blur(); } }), () => { const { prefixCls: c, domRef: v, mode: T } = e, y = { inputRef: t, onInputKeyDown: m, onInputMouseDown: I, onInputChange: P, onInputPaste: h, compositionStatus: i.value, onInputCompositionStart: x, onInputCompositionEnd: $ }, O = T === "multiple" || T === "tags" ? f(mo, Q(Q({}, e), y), null) : f(Re, Q(Q({}, e), y), null); return f("div", { ref: v, class: `${c}-selector`, onClick: S, onMousedown: b }, [O]); }; } }); function So(e, n, o) { function t(i) { var l, p, m; let I = i.target; I.shadowRoot && i.composed && (I = i.composedPath()[0] || I); const g = [(l = e[0]) === null || l === void 0 ? void 0 : l.value, (m = (p = e[1]) === null || p === void 0 ? void 0 : p.value) === null || m === void 0 ? void 0 : m.getPopupElement()]; n.value && g.every((a) => a && !a.contains(I) && a !== I) && o(!1); } re(() => { window.addEventListener("mousedown", t); }), Oe(() => { window.removeEventListener("mousedown", t); }); } function bo() { 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, p) => { t(), o = setTimeout(() => { n.value = l, p && p(); }, e); }, t]; } const an = Symbol("BaseSelectContextKey"); function yo(e) { return Ee(an, e); } function et() { return De(an, {}); } function wo(e) { if (!oo(e)) return Xe(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 Xe(n); } 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 Co = ["value", "onChange", "removeIcon", "placeholder", "autofocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabindex", "OptionList", "notFoundContent"], xo = () => ({ 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 }), $o = () => ({ 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 }), Po = () => d(d({}, xo()), $o()); function To(e) { return e === "tags" || e === "multiple"; } const nt = ce({ compatConfig: { MODE: 3 }, name: "BaseSelect", inheritAttrs: !1, props: Hn(Po(), { showAction: [], notFoundContent: "Not Found" }), setup(e, n) { let { attrs: o, expose: t, slots: i } = n; const l = N(() => To(e.mode)), p = N(() => e.showSearch !== void 0 ? e.showSearch : l.value || e.mode === "combobox"), m = W(!1); re(() => { m.value = lo(); }); const I = Me(), g = W(null), a = nn(), x = W(null), $ = W(null), P = W(null), h = ue(!1), [S, b, c] = bo(); t({ focus: () => { var r; (r = $.value) === null || r === void 0 || r.focus(); }, blur: () => { var r; (r = $.value) === null || r === void 0 || r.blur(); }, scrollTo: (r) => { var u; return (u = P.value) === null || u === void 0 ? void 0 : u.scrollTo(r); } }); const y = N(() => { var r; if (e.mode !== "combobox") return e.searchValue; const u = (r = e.displayValues[0]) === null || r === void 0 ? void 0 : r.value; return typeof u == "string" || typeof u == "number" ? String(u) : ""; }), O = e.open !== void 0 ? e.open : e.defaultOpen, F = W(O), w = W(O), U = (r) => { F.value = e.open !== void 0 ? e.open : r, w.value = F.value; }; ae(() => e.open, () => { U(e.open); }); const E = N(() => !e.notFoundContent && e.emptyOptions); en(() => { w.value = F.value, (e.disabled || E.value && w.value && e.mode === "combobox") && (w.value = !1); }); const V = N(() => E.value ? !1 : w.value), R = (r) => { const u = r !== void 0 ? r : !w.value; w.value !== u && !e.disabled && (U(u), e.onDropdownVisibleChange && e.onDropdownVisibleChange(u), !u && de.value && (de.value = !1, b(!1, () => { q.value = !1, h.value = !1; }))); }, Y = N(() => (e.tokenSeparators || []).some((r) => [` `, `\r `].includes(r))), L = (r, u, z) => { var A, _; let H = !0, j = r; (A = e.onActiveValueChange) === null || A === void 0 || A.call(e, null); const K = z ? null : ro(r, e.tokenSeparators); return e.mode !== "combobox" && K && (j = "", (_ = e.onSearchSplit) === null || _ === void 0 || _.call(e, K), R(!1), H = !1), e.onSearch && y.value !== j && e.onSearch(j, { source: u ? "typing" : "effect" }), H; }, X = (r) => { var u; !r || !r.trim() || (u = e.onSearch) === null || u === void 0 || u.call(e, r, { source: "submit" }); }; ae(w, () => { !w.value && !l.value && e.mode !== "combobox" && L("", !1, !1); }, { immediate: !0, flush: "post" }), ae(() => e.disabled, () => { F.value && e.disabled && U(!1), e.disabled && !h.value && b(!1); }, { immediate: !0 }); const [D, B] = ln(), oe = function(r) { var u; const z = D(), { which: A } = r; if (A === C.ENTER && (e.mode !== "combobox" && r.preventDefault(), w.value || R(!0)), B(!!y.value), A === C.BACKSPACE && !z && l.value && !y.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, H = new Array(_ > 1 ? _ - 1 : 0), j = 1; j < _; j++) H[j - 1] = arguments[j]; w.value && P.value && P.value.onKeydown(r, ...H), (u = e.onKeydown) === null || u === void 0 || u.call(e, r, ...H); }, te = function(r) { for (var u = arguments.length, z = new Array(u > 1 ? u - 1 : 0), A = 1; A < u; A++) z[A - 1] = arguments[A]; w.value && P.value && P.value.onKeyup(r, ...z), e.onKeyup && e.onKeyup(r, ...z); }, M = (r) => { const u = e.displayValues.filter((z) => z !== r); e.onDisplayValuesChange(u, { type: "remove", values: [r] }); }, q = W(!1), ie = function() { b(!0), e.disabled || (e.onFocus && !q.value && e.onFocus(...arguments), e.showAction && e.showAction.includes("focus") && R(!0)), q.value = !0; }, de = ue(!1), un = function() { if (de.value || (h.value = !0, b(!1, () => { q.value = !1, h.value = !1, R(!1); }), e.disabled)) return; const r = y.value; r && (e.mode === "tags" ? e.onSearch(r, { source: "submit" }) : e.mode === "multiple" && e.onSearch("", { source: "blur" })), e.onBlur && e.onBlur(...arguments); }, sn = () => { de.value = !0; }, cn = () => { de.value = !1; }; Ee("VCSelectContainerEvent", { focus: ie, blur: un }); const J = []; re(() => { J.forEach((r) => clearTimeout(r)), J.splice(0, J.length); }), Oe(() => { J.forEach((r) => clearTimeout(r)), J.splice(0, J.length); }); const dn = function(r) { var u, z; const { target: A } = r, _ = (u = x.value) === null || u === void 0 ? void 0 : u.getPopupElement(); if (_ && _.contains(A)) { const k = setTimeout(() => { var G; const ee = J.indexOf(k); ee !== -1 && J.splice(ee, 1), c(), !m.value && !_.contains(document.activeElement) && ((G = $.value) === null || G === void 0 || G.focus()); }); J.push(k); } for (var H = arguments.length, j = new Array(H > 1 ? H - 1 : 0), K = 1; K < H; K++) j[K - 1] = arguments[K]; (z = e.onMousedown) === null || z === void 0 || z.call(e, r, ...j); }, ve = W(null), pn = () => { }; return re(() => { ae(V, () => { var r; if (V.value) { const u = Math.ceil((r = g.value) === null || r === void 0 ? void 0 : r.offsetWidth); ve.value !== u && !Number.isNaN(u) && (ve.value = u); } }, { immediate: !0, flush: "post" }); }), So([g, x], V, R), yo(wo(d(d({}, to(e)), { open: w, triggerOpen: V, showSearch: p, multiple: l, toggleOpen: R }))), () => { const r = d(d({}, e), o), { prefixCls: u, id: z, open: A, defaultOpen: _, mode: H, // Search related showSearch: j, searchValue: K, onSearch: k, // Icons allowClear: G, clearIcon: ee, showArrow: Be, inputIcon: fn, // Others disabled: Se, loading: me, getInputElement: ze, getPopupContainer: mn, placement: gn, // Dropdown animation: hn, transitionName: vn, dropdownStyle: Sn, dropdownClassName: bn, dropdownMatchSelectWidth: yn, dropdownRender: wn, dropdownAlign: In, showAction: Vo, direction: Cn, // Tags tokenSeparators: Lo, tagRender: xn, optionLabelRender: $n, // Events onPopupScroll: Ao, onDropdownVisibleChange: Ho, onFocus: Wo, onBlur: Ko, onKeyup: _o, onKeydown: jo, onMousedown: Uo, onClear: be, omitDomProps: ye, getRawInputElement: Ne, displayValues: ge, onDisplayValuesChange: Pn, emptyOptions: Tn, activeDescendantId: Fn, activeValue: Dn, OptionList: En } = r, On = Io(r, ["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 = H === "combobox" && ze && ze() || null, pe = typeof Ne == "function" && Ne(), we = d({}, On); let Le; pe && (Le = (ne) => { R(ne); }), Co.forEach((ne) => { delete we[ne]; }), ye == null || ye.forEach((ne) => { delete we[ne]; }); const Ae = Be !== void 0 ? Be : me || !l.value && H !== "combobox"; let He; Ae && (He = f(se, { class: fe(`${u}-arrow`, { [`${u}-arrow-loading`]: me }), customizeIcon: fn, customizeIconProps: { loading: me, searchValue: y.value, open: w.value, focused: S.value, showSearch: p.value } }, null)); let We; const Mn = () => { be == null || be(), Pn([], { type: "clear", values: ge }), L("", !1, !1); }; !Se && G && (ge.length || y.value) && (We = f(se, { class: `${u}-clear`, onMousedown: Mn, customizeIcon: ee }, { default: () => [Te("×")] })); const Rn = f(En, { ref: P }, d(d({}, I.customSlots), { option: i.option })), Bn = fe(u, o.class, { [`${u}-focused`]: S.value, [`${u}-multiple`]: l.value, [`${u}-single`]: !l.value, [`${u}-allow-clear`]: G, [`${u}-show-arrow`]: Ae, [`${u}-disabled`]: Se, [`${u}-loading`]: me, [`${u}-open`]: w.value, [`${u}-customize-input`]: Ve, [`${u}-show-search`]: p.value }), Ke = f(co, { ref: x, disabled: Se, prefixCls: u, visible: V.value, popupElement: Rn, containerWidth: ve.value, animation: hn, transitionName: vn, dropdownStyle: Sn, dropdownClassName: bn, direction: Cn, dropdownMatchSelectWidth: yn, dropdownRender: wn, dropdownAlign: In, placement: gn, getPopupContainer: mn, empty: Tn, getTriggerDOMNode: () => a.current, onPopupVisibleChange: Le, onPopupMouseEnter: pn, onPopupFocusin: sn, onPopupFocusout: cn }, { default: () => pe ? An(pe) && Je(pe, { ref: a }, !1, !0) : f(vo, Q(Q({}, e), {}, { domRef: a, prefixCls: u, inputElement: Ve, ref: $, id: z, showSearch: p.value, mode: H, activeDescendantId: Fn, tagRender: xn, optionLabelRender: $n, values: ge, open: w.value, onToggleOpen: R, activeValue: Dn, searchValue: y.value, onSearch: L, onSearchSubmit: X, onRemove: M, tokenWithEnter: Y.value }), null) }); let Ie; return pe ? Ie = Ke : Ie = f("div", Q(Q({}, we), {}, { class: Bn, ref: g, onMousedown: dn, onKeydown: oe, onKeyup: te }), [S.value && !w.value && f("span", { style: { width: 0, height: 0, position: "absolute", overflow: "hidden", opacity: 0 }, "aria-live": "polite" }, [`${ge.map((ne) => { let { label: _e, value: zn } = ne; return ["number", "string"].includes(typeof _e) ? _e : zn; }).join(", ")}`]), Ke, He, We]), Ie; }; } }); let Qe = 0; const Fo = process.env.NODE_ENV !== "test" && Wn(); function Do() { let e; return Fo ? (e = Qe, Qe += 1) : e = "TEST_OR_SSR", e; } function ot() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ue(""); const n = `rc_select_${Do()}`; return e.value || n; } function tt(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const { loading: o, multiple: t, prefixCls: i, hasFeedback: l, feedbackIcon: p, showArrow: m } = e, I = e.suffixIcon || n.suffixIcon && n.suffixIcon(), g = e.clearIcon || n.clearIcon && n.clearIcon(), a = e.menuItemSelectedIcon || n.menuItemSelectedIcon && n.menuItemSelectedIcon(), x = e.removeIcon || n.removeIcon && n.removeIcon(), $ = g != null ? g : f(Kn, null, null), P = (c) => f(he, null, [m !== !1 && c, l && p]); let h = null; if (I !== void 0) h = P(I); else if (o) h = P(f(_n, { spin: !0 }, null)); else { const c = `${i}-suffix`; h = (v) => { let { open: T, showSearch: y } = v; return P(T && y ? f(Xn, { class: c }, null) : f(Gn, { class: c }, null)); }; } let S = null; a !== void 0 ? S = a : t ? S = f(jn, null, null) : S = null; let b = null; return x !== void 0 ? b = x : b = f(Un, null, null), { clearIcon: $, suffixIcon: h, itemIcon: S, removeIcon: b }; } 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" }; }, Eo = (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: Jn }, [` &${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: qn }, [`&${n}-slide-up-leave${n}-slide-up-leave-active${o}-dropdown-placement-bottomLeft`]: { animationName: Qn }, [`&${n}-slide-up-leave${n}-slide-up-leave-active${o}-dropdown-placement-topLeft`]: { animationName: Yn }, "&-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"), Ue(e, "move-up"), Ue(e, "move-down") ]; }, le = 2; function rn(e) { let { controlHeightSM: n, controlHeight: o, lineWidth: t } = e; const i = (o - n) / 2 - t, l = Math.ceil(i / 2); return [i, l]; } function Ce(e, n) { const { componentCls: o, iconCls: t } = e, i = `${o}-selection-overflow`, l = e.controlHeightSM, [p] = rn(e), m = n ? `${o}-${n}` : ""; return { [`${o}-multiple${m}`]: { 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: `${p - 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({}, ke()), { 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 - p, "\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 Oo(e) { const { componentCls: n } = e, o = Z(e, { controlHeight: e.controlHeightSM, controlHeightSM: e.controlHeightXS, borderRadius: e.borderRadiusSM, borderRadiusSM: e.borderRadiusXS }), [, t] = rn(e); return [ Ce(e), // ======================== Small ======================== // Shared Ce(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 Ce(Z(e, { fontSize: e.fontSizeLG, controlHeight: e.controlHeightLG, controlHeightSM: e.controlHeight, borderRadius: e.borderRadiusLG, borderRadiusSM: e.borderRadius }), "lg") ]; } function xe(e, n) { const { componentCls: o, inputPaddingHorizontalBase: t, borderRadius: i } = e, l = e.controlHeight - e.lineWidth * 2, p = Math.ceil(e.fontSize * 1.25), m = n ? `${o}-${n}` : ""; return { [`${o}-single${m}`]: { 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: p }, // 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 Mo(e) { const { componentCls: n } = e, o = e.controlPaddingHorizontalSM - e.lineWidth; return [ xe(e), // ======================== Small ======================== // Shared xe(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 xe(Z(e, { controlHeight: e.controlHeightLG, fontSize: e.fontSizeLG, borderRadius: e.borderRadiusLG }), "lg") ]; } const Ro = (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: p } = n, m = o ? { [`${t}-selector`]: { borderColor: i } } : {}; return { [e]: { [`&:not(${t}-disabled):not(${t}-customize-input):not(${p}-pagination-size-changer)`]: d(d({}, m), { [`${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` } }) } }; }, Bo = (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" } } }; }, zo = (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({}, Ro(e)), Bo(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({}, ke()), { 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 } } }; }, No = (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 zo(e), // Single Mo(e), // Multiple Oo(e), // Dropdown Eo(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 == // ===================================================== kn(e, { borderElCls: `${n}-selector`, focusElCls: `${n}-focused` }) ]; }, it = Zn("Select", (e, n) => { let { rootPrefixCls: o } = n; const t = Z(e, { rootPrefixCls: o, inputPaddingHorizontalBase: e.paddingSM - 1 }); return [No(t)]; }, (e) => ({ zIndexPopup: e.zIndexPopupBase + 50 })); export { nt as B, se as T, ot as a, $o as b, it as c, Zo as d, Jo as e, ao as f, tt as g, Me as h, To as i, ko as j, wo as t, et as u };