UNPKG

@aplus-frontend/ui

Version:

115 lines (114 loc) 2.96 kB
import { defineComponent as i, computed as s, createElementBlock as d, createCommentVNode as c, openBlock as u, toDisplayString as m } from "vue"; import { isArray as y } from "lodash-unified"; const f = { key: 0 }, C = /* @__PURE__ */ i({ name: "ApFieldSelectRead", __name: "read", props: { mode: {}, class: {}, style: {}, defaultValue: {}, notFoundContent: {}, suffixIcon: {}, itemIcon: {}, size: {}, bordered: { type: Boolean }, showArrow: { type: Boolean }, variant: {}, maxCount: {}, transitionName: {}, choiceTransitionName: {}, popupClassName: {}, dropdownClassName: {}, placement: {}, status: {}, children: {}, listHeight: {}, onMouseenter: {}, onMouseleave: {}, tabindex: {}, onClick: {}, onFocus: {}, onBlur: {}, onChange: {}, onKeydown: {}, onKeyup: {}, onMousedown: {}, onSelect: {}, open: { type: Boolean }, animation: {}, direction: {}, disabled: { type: Boolean }, prefixCls: {}, id: {}, autofocus: { type: Boolean }, getPopupContainer: {}, virtual: { type: Boolean }, dropdownMatchSelectWidth: {}, placeholder: {}, loading: { type: Boolean }, prefix: {}, clearIcon: {}, allowClear: { type: Boolean }, fieldNames: {}, inputValue: {}, searchValue: {}, autoClearSearchValue: { type: Boolean }, onDeselect: {}, filterOption: {}, filterSort: {}, optionFilterProp: {}, optionLabelProp: {}, options: {}, defaultActiveFirstOption: { type: Boolean }, listItemHeight: {}, onClickOption: {}, menuItemSelectedIcon: {}, labelInValue: { type: Boolean }, showSearch: { type: Boolean }, tagRender: {}, optionLabelRender: {}, onClear: {}, defaultOpen: { type: Boolean }, onDropdownVisibleChange: {}, maxTagTextLength: {}, maxTagCount: {}, maxTagPlaceholder: {}, tokenSeparators: {}, removeIcon: {}, dropdownStyle: {}, dropdownRender: {}, dropdownAlign: {}, showAction: {}, onPopupScroll: {}, onInputKeyDown: {}, emptyText: { default: "--" }, request: {}, multiple: { type: Boolean }, value: {}, "onUpdate:value": {}, searchMode: {}, refetchOnFocus: { type: Boolean }, lazy: { type: Boolean }, addAll: { type: [Boolean, Number] }, params: {}, searchDelay: {} }, setup(l) { const e = l, r = s(() => { const o = e.value; if (!o) return e.emptyText; const t = e.fieldNames?.label || "label", a = e.fieldNames?.value || "value"; return y(o) ? o.map( (n) => e.options?.find((p) => p[a] === n)?.[t] ).filter(Boolean).join("、") || e.emptyText : e.options?.find( (n) => n[a] === o )?.[t] || e.emptyText; }); return (o, t) => o.mode === "read" ? (u(), d("span", f, m(r.value), 1)) : c("", !0); } }); export { C as default };