antdv-next 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_util/hooks/useMergeSemantic.js +2 -2
- package/dist/_util/statusUtils.d.ts +1 -1
- package/dist/_util/vueNode.d.ts +11 -1
- package/dist/_util/vueNode.js +17 -1
- package/dist/affix/index.js +12 -9
- package/dist/alert/Alert.js +10 -5
- package/dist/anchor/Anchor.js +11 -6
- package/dist/anchor/style/index.js +2 -3
- package/dist/antd-with-locales.esm.js +16938 -18716
- package/dist/antd-with-locales.js +79 -86
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +15197 -17143
- package/dist/antd.js +80 -87
- package/dist/auto-complete/index.d.ts +2 -0
- package/dist/auto-complete/index.js +28 -23
- package/dist/avatar/Avatar.js +1 -1
- package/dist/avatar/AvatarContext.d.ts +2 -2
- package/dist/avatar/AvatarGroup.js +3 -5
- package/dist/badge/style/ribbon.d.ts +1 -0
- package/dist/border-beam/style/index.d.ts +1 -0
- package/dist/breadcrumb/index.d.ts +8 -1
- package/dist/button/Button.js +31 -18
- package/dist/button/style/index.d.ts +1 -0
- package/dist/calendar/Header.js +4 -4
- package/dist/calendar/generateCalendar.d.ts +10 -10
- package/dist/calendar/index.d.ts +1 -1
- package/dist/card/Card.js +1 -1
- package/dist/card/index.d.ts +8 -1
- package/dist/card/style/index.js +3 -7
- package/dist/carousel/index.js +3 -3
- package/dist/cascader/hooks/useIcons.js +3 -2
- package/dist/cascader/index.d.ts +9 -1
- package/dist/cascader/index.js +42 -34
- package/dist/cascader/style/panel.d.ts +1 -0
- package/dist/checkbox/Checkbox.js +5 -2
- package/dist/checkbox/Group.js +6 -6
- package/dist/collapse/Collapse.js +2 -2
- package/dist/color-picker/ColorPicker.js +15 -2
- package/dist/color-picker/components/ColorSlider.js +2 -2
- package/dist/color-picker/interface.d.ts +3 -0
- package/dist/color-picker/style/input.js +6 -11
- package/dist/components.d.ts +24 -24
- package/dist/components.js +1 -2
- package/dist/config-provider/context.d.ts +16 -11
- package/dist/config-provider/define.d.ts +2 -1
- package/dist/config-provider/index.js +9 -0
- package/dist/date-picker/generatePicker/generateRangePicker.d.ts +2 -0
- package/dist/date-picker/generatePicker/generateRangePicker.js +23 -15
- package/dist/date-picker/generatePicker/generateSinglePicker.d.ts +2 -0
- package/dist/date-picker/generatePicker/generateSinglePicker.js +18 -14
- package/dist/date-picker/generatePicker/interface.d.ts +17 -5
- package/dist/date-picker/generatePicker/useComponents.d.ts +1 -14
- package/dist/date-picker/generatePicker/useSuffix.d.ts +12 -0
- package/dist/date-picker/generatePicker/useSuffix.js +11 -0
- package/dist/date-picker/style/index.d.ts +1 -0
- package/dist/date-picker/util.d.ts +1 -1
- package/dist/date-picker/util.js +4 -3
- package/dist/descriptions/hooks/useItems.d.ts +6 -6
- package/dist/descriptions/index.js +2 -2
- package/dist/divider/index.js +14 -4
- package/dist/drawer/index.js +2 -2
- package/dist/dropdown/dropdown.js +6 -6
- package/dist/dropdown/style/index.js +0 -6
- package/dist/empty/index.js +2 -1
- package/dist/empty/style/index.d.ts +1 -0
- package/dist/flex/index.js +2 -2
- package/dist/float-button/BackTop.js +2 -1
- package/dist/float-button/FloatButton.js +2 -2
- package/dist/float-button/FloatButtonGroup.js +2 -2
- package/dist/float-button/PurePanel.js +5 -5
- package/dist/form/Form.js +47 -16
- package/dist/form/FormItem/ItemHolder.d.ts +3 -18
- package/dist/form/FormItem/StatusProvider.js +2 -1
- package/dist/form/FormItem/index.d.ts +1 -0
- package/dist/form/FormItem/index.js +22 -9
- package/dist/form/FormItemInput.js +3 -4
- package/dist/form/FormItemLabel.js +8 -4
- package/dist/form/context.d.ts +3 -3
- package/dist/form/hooks/useVariant.d.ts +14 -4
- package/dist/form/hooks/useVariant.js +24 -13
- package/dist/form/interface.d.ts +4 -1
- package/dist/form/style/index.js +1 -1
- package/dist/grid/hooks/useBreakpoint.js +12 -6
- package/dist/image/PreviewGroup.d.ts +9 -2
- package/dist/image/PreviewGroup.js +2 -2
- package/dist/image/hooks/usePreviewConfig.d.ts +2 -2
- package/dist/image/index.d.ts +3 -3
- package/dist/image/index.js +3 -3
- package/dist/index.d.ts +26 -24
- package/dist/index.js +1 -2
- package/dist/input/Input.js +4 -4
- package/dist/input/OTP/OTPInput.js +31 -30
- package/dist/input/OTP/index.js +10 -2
- package/dist/input/Password.js +7 -3
- package/dist/input/Search.js +5 -5
- package/dist/input/TextArea.js +4 -4
- package/dist/input/style/index.js +2 -15
- package/dist/input/style/otp.d.ts +1 -0
- package/dist/input/style/search.d.ts +1 -0
- package/dist/input/style/textarea.d.ts +1 -0
- package/dist/input-number/index.js +3 -3
- package/dist/input-number/style/index.d.ts +1 -0
- package/dist/layout/Sider.js +2 -2
- package/dist/layout/style/sider.d.ts +1 -0
- package/dist/listy/interface.d.ts +23 -4
- package/dist/listy/style/index.js +1 -0
- package/dist/locale/ar_EG.js +3 -1
- package/dist/locale/az_AZ.js +3 -1
- package/dist/locale/bg_BG.js +3 -1
- package/dist/locale/bn_BD.js +3 -1
- package/dist/locale/by_BY.js +3 -1
- package/dist/locale/ca_ES.js +3 -1
- package/dist/locale/cs_CZ.js +13 -9
- package/dist/locale/da_DK.js +3 -1
- package/dist/locale/de_DE.js +6 -2
- package/dist/locale/el_GR.js +3 -1
- package/dist/locale/en_GB.js +3 -1
- package/dist/locale/en_US.js +5 -2
- package/dist/locale/es_ES.js +3 -1
- package/dist/locale/et_EE.js +3 -1
- package/dist/locale/eu_ES.js +3 -1
- package/dist/locale/fa_IR.js +3 -1
- package/dist/locale/fi_FI.js +3 -1
- package/dist/locale/fr_BE.js +3 -1
- package/dist/locale/fr_CA.js +3 -1
- package/dist/locale/fr_FR.js +6 -2
- package/dist/locale/ga_IE.js +3 -1
- package/dist/locale/gl_ES.js +3 -1
- package/dist/locale/he_IL.js +3 -1
- package/dist/locale/hi_IN.js +3 -1
- package/dist/locale/hr_HR.js +3 -1
- package/dist/locale/hu_HU.js +3 -1
- package/dist/locale/hy_AM.js +5 -13
- package/dist/locale/id_ID.js +3 -1
- package/dist/locale/index.d.ts +6 -0
- package/dist/locale/is_IS.js +3 -1
- package/dist/locale/it_IT.js +6 -2
- package/dist/locale/ja_JP.js +3 -1
- package/dist/locale/ka_GE.js +3 -1
- package/dist/locale/kk_KZ.js +3 -1
- package/dist/locale/km_KH.js +3 -1
- package/dist/locale/kmr_IQ.js +3 -1
- package/dist/locale/kn_IN.js +3 -1
- package/dist/locale/ko_KR.js +3 -1
- package/dist/locale/ku_IQ.js +3 -1
- package/dist/locale/lt_LT.js +3 -1
- package/dist/locale/lv_LV.js +3 -1
- package/dist/locale/mk_MK.js +3 -1
- package/dist/locale/ml_IN.js +3 -1
- package/dist/locale/mn_MN.js +3 -1
- package/dist/locale/mr_IN.js +3 -1
- package/dist/locale/ms_MY.js +3 -1
- package/dist/locale/my_MM.js +3 -1
- package/dist/locale/nb_NO.js +3 -1
- package/dist/locale/ne_NP.js +4 -2
- package/dist/locale/nl_BE.js +3 -1
- package/dist/locale/nl_NL.js +3 -1
- package/dist/locale/pl_PL.js +3 -1
- package/dist/locale/pt_BR.js +3 -1
- package/dist/locale/pt_PT.js +3 -1
- package/dist/locale/ro_RO.js +3 -1
- package/dist/locale/ru_RU.js +3 -1
- package/dist/locale/si_LK.js +3 -1
- package/dist/locale/sk_SK.js +3 -1
- package/dist/locale/sl_SI.js +3 -1
- package/dist/locale/sq_AL.js +5 -13
- package/dist/locale/sr_RS.js +3 -1
- package/dist/locale/sv_SE.js +3 -1
- package/dist/locale/ta_IN.js +3 -1
- package/dist/locale/th_TH.js +3 -1
- package/dist/locale/tk_TK.js +3 -1
- package/dist/locale/tr_TR.js +3 -1
- package/dist/locale/uk_UA.js +3 -1
- package/dist/locale/ur_PK.js +3 -1
- package/dist/locale/uz_UZ.js +3 -1
- package/dist/locale/vi_VN.js +3 -1
- package/dist/locale/zh_CN.js +5 -2
- package/dist/locale/zh_HK.js +3 -1
- package/dist/locale/zh_TW.js +3 -1
- package/dist/mentions/index.js +4 -4
- package/dist/menu/MenuItem.js +7 -7
- package/dist/menu/SubMenu.js +5 -4
- package/dist/menu/menu.js +2 -2
- package/dist/message/PurePanel.js +2 -2
- package/dist/message/style/index.d.ts +1 -0
- package/dist/message/style/index.js +2 -1
- package/dist/modal/Modal.js +5 -5
- package/dist/modal/PurePanel.js +2 -2
- package/dist/modal/style/confirm.js +1 -1
- package/dist/notification/PurePanel.js +2 -2
- package/dist/notification/style/index.d.ts +3 -0
- package/dist/notification/style/index.js +4 -5
- package/dist/notification/style/placement.js +3 -6
- package/dist/package.js +1 -1
- package/dist/pagination/Pagination.js +6 -5
- package/dist/pagination/index.d.ts +2 -1
- package/dist/pagination/interface.d.ts +2 -2
- package/dist/pagination/style/index.js +15 -7
- package/dist/popconfirm/index.js +4 -3
- package/dist/popover/PurePanel.js +2 -2
- package/dist/popover/style/index.js +1 -0
- package/dist/progress/Circle.js +3 -3
- package/dist/progress/Line.js +2 -1
- package/dist/progress/progress.js +1 -1
- package/dist/qrcode/QrcodeStatus.js +2 -1
- package/dist/qrcode/index.js +2 -2
- package/dist/qrcode/style/index.js +0 -4
- package/dist/radio/radio.js +2 -2
- package/dist/rate/index.js +2 -2
- package/dist/select/index.d.ts +11 -3
- package/dist/select/index.js +55 -38
- package/dist/select/style/index.d.ts +1 -0
- package/dist/select/useIcons.d.ts +23 -8
- package/dist/select/useIcons.js +34 -13
- package/dist/select/useShowArrow.d.ts +2 -3
- package/dist/select/useShowArrow.js +3 -5
- package/dist/skeleton/Paragraph.js +2 -2
- package/dist/skeleton/Skeleton.js +2 -2
- package/dist/skeleton/Title.js +2 -2
- package/dist/slider/index.d.ts +6 -1
- package/dist/slider/index.js +7 -5
- package/dist/space/Item.d.ts +1 -0
- package/dist/space/Item.js +6 -2
- package/dist/space/index.d.ts +1 -1
- package/dist/space/index.js +1 -0
- package/dist/space/style/addon.d.ts +1 -0
- package/dist/space/style/compact.d.ts +1 -0
- package/dist/space/style/index.js +8 -2
- package/dist/spin/Indicator/index.js +5 -1
- package/dist/splitter/SplitBar.js +2 -1
- package/dist/splitter/Splitter.js +10 -4
- package/dist/splitter/interface.d.ts +1 -0
- package/dist/statistic/Number.js +7 -1
- package/dist/statistic/Statistic.d.ts +3 -0
- package/dist/statistic/Statistic.js +2 -1
- package/dist/steps/index.js +16 -8
- package/dist/switch/index.js +10 -4
- package/dist/table/InternalTable.js +22 -7
- package/dist/table/hooks/useFilter/index.js +5 -2
- package/dist/table/hooks/usePagination.d.ts +2 -1
- package/dist/table/hooks/usePagination.js +6 -3
- package/dist/table/index.d.ts +2 -2
- package/dist/table/util.d.ts +1 -1
- package/dist/tabs/index.js +19 -11
- package/dist/tabs/style/index.js +2 -6
- package/dist/tag/index.d.ts +1 -1
- package/dist/tag/index.js +13 -5
- package/dist/theme/getDesignToken.js +2 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/time-picker/index.d.ts +16 -9
- package/dist/time-picker/index.js +31 -84
- package/dist/timeline/Timeline.js +16 -10
- package/dist/tooltip/PurePanel.js +2 -2
- package/dist/tooltip/index.js +3 -6
- package/dist/tooltip/style/index.js +1 -1
- package/dist/tour/index.js +2 -3
- package/dist/tour/panelRender.js +4 -4
- package/dist/transfer/Section.js +2 -2
- package/dist/tree/DirectoryTree.d.ts +19 -7
- package/dist/tree/DirectoryTree.js +2 -2
- package/dist/tree/Tree.d.ts +73 -58
- package/dist/tree/Tree.js +2 -2
- package/dist/tree/index.d.ts +8 -5
- package/dist/tree/index.js +4 -3
- package/dist/tree/style/index.js +6 -1
- package/dist/tree/utils/iconUtil.js +1 -1
- package/dist/tree-select/index.d.ts +32 -2
- package/dist/tree-select/index.js +75 -75
- package/dist/upload/Upload.js +2 -2
- package/dist/upload/utils.js +8 -3
- package/dist/version/token.json +1 -1
- package/dist/watermark/useWatermark.d.ts +1 -7
- package/dist/watermark/useWatermark.js +1 -7
- package/package.json +20 -20
- package/web-tags.json +85 -29
- package/web-types.json +242 -157
- package/dist/date-picker/generatePicker/SuffixIcon.d.ts +0 -12
- package/dist/date-picker/generatePicker/SuffixIcon.js +0 -51
- package/dist/form/style/fallbackCmp.d.ts +0 -14
- package/dist/form/style/fallbackCmp.js +0 -13
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cloneIfVNode } from "../_util/vueNode.js";
|
|
1
2
|
import button_default from "../button/index.js";
|
|
2
3
|
import Spin from "../spin/index.js";
|
|
3
4
|
import { Fragment, createVNode, defineComponent } from "vue";
|
|
@@ -15,7 +16,7 @@ const QRcodeStatus = /* @__PURE__ */ defineComponent((props) => {
|
|
|
15
16
|
const defaultScannedNode = createVNode("p", { "class": `${prefixCls}-scanned` }, [locale?.scanned]);
|
|
16
17
|
const defaultNodes = {
|
|
17
18
|
expired: defaultExpiredNode,
|
|
18
|
-
loading: defaultSpin,
|
|
19
|
+
loading: cloneIfVNode(defaultSpin),
|
|
19
20
|
scanned: defaultScannedNode
|
|
20
21
|
};
|
|
21
22
|
const defaultStatusRender = (info) => defaultNodes[info.status];
|
package/dist/qrcode/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import QRcodeStatus from "./QrcodeStatus.js";
|
|
|
9
9
|
import style_default from "./style/index.js";
|
|
10
10
|
import { computed, createVNode, defineComponent, getCurrentInstance, mergeDefaults, mergeProps, shallowRef } from "vue";
|
|
11
11
|
import { classNames } from "@v-c/util";
|
|
12
|
-
import { omit } from "es-toolkit";
|
|
12
|
+
import { omit as omit$1 } from "es-toolkit";
|
|
13
13
|
import pickAttrs from "@v-c/util/dist/pickAttrs";
|
|
14
14
|
import { QRCodeCanvas, QRCodeSVG } from "@v-c/qrcode";
|
|
15
15
|
//#region src/qrcode/index.tsx
|
|
@@ -45,7 +45,7 @@ const QRCode = /* @__PURE__ */ defineComponent((props, { emit, attrs, slots, exp
|
|
|
45
45
|
const statusRender = slots?.statusRender ?? props?.statusRender;
|
|
46
46
|
const hasRefreshListener = !!instance?.vnode?.props?.onRefresh;
|
|
47
47
|
const a11yProps = pickAttrs(attrs, true);
|
|
48
|
-
const restProps = omit(attrs, Object.keys(a11yProps));
|
|
48
|
+
const restProps = omit$1(attrs, Object.keys(a11yProps));
|
|
49
49
|
const style = attrs.style;
|
|
50
50
|
const cls = attrs.class;
|
|
51
51
|
const qrCodeProps = {
|
package/dist/radio/radio.js
CHANGED
|
@@ -14,7 +14,7 @@ import style_default from "./style/index.js";
|
|
|
14
14
|
import { computed, createVNode, defineComponent, mergeProps, shallowRef, toRef } from "vue";
|
|
15
15
|
import { clsx } from "@v-c/util";
|
|
16
16
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
17
|
-
import { omit } from "es-toolkit";
|
|
17
|
+
import { omit as omit$1 } from "es-toolkit";
|
|
18
18
|
import VcCheckbox from "@v-c/checkbox";
|
|
19
19
|
//#region src/radio/radio.tsx
|
|
20
20
|
const InternalRadio = /* @__PURE__ */ defineComponent((props, { slots, expose, attrs, emit }) => {
|
|
@@ -35,7 +35,7 @@ const InternalRadio = /* @__PURE__ */ defineComponent((props, { slots, expose, a
|
|
|
35
35
|
const [hashId, cssVarCls] = style_default(radioPrefixCls, rootCls);
|
|
36
36
|
const disabled = useDisabledContext();
|
|
37
37
|
const radioProps = computed(() => {
|
|
38
|
-
const _radioProps = { ...omit(props, [
|
|
38
|
+
const _radioProps = { ...omit$1(props, [
|
|
39
39
|
"prefixCls",
|
|
40
40
|
"classes",
|
|
41
41
|
"styles",
|
package/dist/rate/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import style_default from "./style/index.js";
|
|
|
7
7
|
import { createVNode, defineComponent, isVNode, mergeDefaults, mergeProps, shallowRef } from "vue";
|
|
8
8
|
import { clsx } from "@v-c/util";
|
|
9
9
|
import { StarFilled } from "@antdv-next/icons";
|
|
10
|
-
import { omit } from "es-toolkit";
|
|
10
|
+
import { omit as omit$1 } from "es-toolkit";
|
|
11
11
|
import VcRate from "@v-c/rate";
|
|
12
12
|
//#region src/rate/index.tsx
|
|
13
13
|
function _isSlot(s) {
|
|
@@ -47,7 +47,7 @@ const Rate = /* @__PURE__ */ defineComponent((props, { attrs, emit, expose }) =>
|
|
|
47
47
|
"character": character,
|
|
48
48
|
"disabled": mergedDisabled,
|
|
49
49
|
"characterRender": characterRender
|
|
50
|
-
}, restAttrs, omit(restProps, ["characterRender", "size"]), {
|
|
50
|
+
}, restAttrs, omit$1(restProps, ["characterRender", "size"]), {
|
|
51
51
|
"class": clsx({
|
|
52
52
|
[`${ratePrefixCls.value}-large`]: mergedSize.value === "large",
|
|
53
53
|
[`${ratePrefixCls.value}-small`]: mergedSize.value === "small"
|
package/dist/select/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import "../_util/hooks/index.js";
|
|
|
4
4
|
import { SizeType } from "../config-provider/SizeContext.js";
|
|
5
5
|
import { InputStatus } from "../_util/statusUtils.js";
|
|
6
6
|
import { SelectCommonPlacement } from "../_util/motion.js";
|
|
7
|
+
import { SelectSuffixRenderInfo } from "./useIcons.js";
|
|
7
8
|
import { ComponentBaseProps, Variant } from "../config-provider/context.js";
|
|
8
9
|
import { CSSProperties, SlotsType, VNode, VNodeChild } from "vue";
|
|
9
10
|
import { SearchConfig, SelectProps as SelectProps$1 } from "@v-c/select";
|
|
@@ -17,6 +18,9 @@ interface LabeledValue {
|
|
|
17
18
|
type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;
|
|
18
19
|
interface InternalSelectProps extends ComponentBaseProps, Omit<SelectProps$1, 'mode' | 'classNames' | 'className' | 'style' | 'prefix' | 'styles' | 'onPopupVisibleChange' | 'popupRender'> {
|
|
19
20
|
prefix?: VueNode;
|
|
21
|
+
/** @since 1.8.0 */
|
|
22
|
+
suffix?: VueNode<[SelectSuffixRenderInfo]>;
|
|
23
|
+
/** @deprecated Please use `suffix` instead. */
|
|
20
24
|
suffixIcon?: VueNode;
|
|
21
25
|
size?: SizeType;
|
|
22
26
|
disabled?: boolean;
|
|
@@ -25,7 +29,7 @@ interface InternalSelectProps extends ComponentBaseProps, Omit<SelectProps$1, 'm
|
|
|
25
29
|
bordered?: boolean;
|
|
26
30
|
/**
|
|
27
31
|
* @deprecated `showArrow` is deprecated which will be removed in next major version. It will be a
|
|
28
|
-
* default behavior, you can hide it by setting `
|
|
32
|
+
* default behavior, you can hide it by setting `suffix` to null.
|
|
29
33
|
*/
|
|
30
34
|
showArrow?: boolean;
|
|
31
35
|
/**
|
|
@@ -76,7 +80,7 @@ type SelectClassNamesType = SemanticClassNamesType<SelectProps, SelectSemanticCl
|
|
|
76
80
|
type SelectStylesType = SemanticStylesType<SelectProps, SelectSemanticStyles, {
|
|
77
81
|
popup?: SelectPopupSemanticStyles;
|
|
78
82
|
}>;
|
|
79
|
-
type RcEventKeys = 'onClear' | 'onKeyUp' | 'onKeyDown' | 'onBlur' | 'onClick' | 'onActive' | 'onChange' | 'onDeselect' | 'onInputKeyDown' | 'onMouseDown' | 'onMouseLeave' | 'onMouseEnter' | 'onFocus' | 'onPopupScroll' | 'onSelect' | 'optionRender';
|
|
83
|
+
type RcEventKeys = 'onClear' | 'onKeyUp' | 'onKeyDown' | 'onBlur' | 'onClick' | 'onActive' | 'onChange' | 'onDeselect' | 'onInputKeyDown' | 'onMouseDown' | 'onMouseLeave' | 'onMouseEnter' | 'onFocus' | 'onPopupScroll' | 'onSelect' | 'onSearch' | 'optionRender';
|
|
80
84
|
interface SelectProps extends Omit<InternalSelectProps, 'mode' | 'getInputElement' | 'getRawInputElement' | 'backfill' | 'placement' | 'dropdownClassName' | 'dropdownStyle' | 'classes' | 'styles' | RcEventKeys>, SelectEmitsProps {
|
|
81
85
|
placement?: SelectCommonPlacement;
|
|
82
86
|
mode?: 'multiple' | 'tags';
|
|
@@ -118,6 +122,7 @@ interface SelectEmits {
|
|
|
118
122
|
'focus': NonNullable<SelectProps$1['onFocus']>;
|
|
119
123
|
'popupScroll': NonNullable<SelectProps$1['onPopupScroll']>;
|
|
120
124
|
'select': NonNullable<SelectProps$1['onSelect']>;
|
|
125
|
+
'search': NonNullable<SelectProps$1['onSearch']>;
|
|
121
126
|
}
|
|
122
127
|
interface SelectEmitsProps {
|
|
123
128
|
onOpenChange?: SelectEmits['openChange'];
|
|
@@ -138,9 +143,12 @@ interface SelectEmitsProps {
|
|
|
138
143
|
onFocus?: SelectEmits['focus'];
|
|
139
144
|
onPopupScroll?: SelectEmits['popupScroll'];
|
|
140
145
|
onSelect?: SelectEmits['select'];
|
|
146
|
+
onSearch?: SelectEmits['search'];
|
|
141
147
|
}
|
|
142
148
|
type OptionParams = Parameters<NonNullable<SelectProps$1['optionRender']>>;
|
|
143
149
|
interface SelectSlots {
|
|
150
|
+
suffix?: (info: SelectSuffixRenderInfo) => any;
|
|
151
|
+
/** @deprecated Please use `suffix` slot instead. */
|
|
144
152
|
suffixIcon?: () => any;
|
|
145
153
|
prefix?: () => any;
|
|
146
154
|
tagRender?: SelectProps['tagRender'];
|
|
@@ -157,4 +165,4 @@ declare const Select: import("vue").DefineSetupFnComponent<SelectProps, SelectEm
|
|
|
157
165
|
declare const SelectOption: import("vue").FunctionalComponent<import("@v-c/select/dist/Option.js").OptionProps, {}, any, {}>;
|
|
158
166
|
declare const SelectOptGroup: import("vue").FunctionalComponent<import("@v-c/select/dist/OptGroup.js").OptGroupProps, {}, any, {}>;
|
|
159
167
|
//#endregion
|
|
160
|
-
export { InternalSelectProps, LabeledValue, type SearchConfig, SelectClassNamesType, SelectEmits, SelectEmitsProps, SelectOptGroup, SelectOption, SelectPopupSemanticClassNames, SelectPopupSemanticStyles, SelectProps, SelectSemanticClassNames, SelectSemanticStyles, SelectSlots, SelectStylesType, SelectValue, Select as default };
|
|
168
|
+
export { InternalSelectProps, LabeledValue, type SearchConfig, SelectClassNamesType, SelectEmits, SelectEmitsProps, SelectOptGroup, SelectOption, SelectPopupSemanticClassNames, SelectPopupSemanticStyles, SelectProps, SelectSemanticClassNames, SelectSemanticStyles, SelectSlots, SelectStylesType, type SelectSuffixRenderInfo, SelectValue, Select as default };
|
package/dist/select/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
2
|
import { useFormItemInputContext } from "../form/context.js";
|
|
3
|
-
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
|
+
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
4
4
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
5
5
|
import useToken from "../theme/useToken.js";
|
|
6
6
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
@@ -9,15 +9,16 @@ import { useZIndex } from "../_util/hooks/useZIndex.js";
|
|
|
9
9
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
10
10
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
11
11
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
12
|
+
import { useVariants } from "../form/hooks/useVariant.js";
|
|
12
13
|
import { useLocaleGetter } from "../locale/useLocale.js";
|
|
13
14
|
import genPurePanel from "../_util/PurePanel.js";
|
|
15
|
+
import useAllowClear from "../_util/hooks/useAllowClear.js";
|
|
14
16
|
import { omitUndefined } from "../_util/omitUndefined.js";
|
|
15
17
|
import { getMergedStatus, getStatusClassNames } from "../_util/statusUtils.js";
|
|
16
18
|
import { DefaultRenderEmpty } from "../config-provider/defaultRenderEmpty.js";
|
|
17
|
-
import { useVariants } from "../form/hooks/useVariant.js";
|
|
18
19
|
import mergedBuiltinPlacements from "./mergedBuiltinPlacements.js";
|
|
19
20
|
import style_default from "./style/index.js";
|
|
20
|
-
import useIcons from "./useIcons.js";
|
|
21
|
+
import useIcons, { getCustomSuffix } from "./useIcons.js";
|
|
21
22
|
import usePopupRender from "./usePopupRender.js";
|
|
22
23
|
import useShowArrow from "./useShowArrow.js";
|
|
23
24
|
import { computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef, watch } from "vue";
|
|
@@ -42,6 +43,7 @@ const omitKeys = [
|
|
|
42
43
|
"onPopupScroll",
|
|
43
44
|
"onPopupVisibleChange",
|
|
44
45
|
"onSelect",
|
|
46
|
+
"onSearch",
|
|
45
47
|
"popupRender",
|
|
46
48
|
"labelRender",
|
|
47
49
|
"optionRender",
|
|
@@ -51,8 +53,16 @@ const omitKeys = [
|
|
|
51
53
|
const SECRET_COMBOBOX_MODE_DO_NOT_USE = "SECRET_COMBOBOX_MODE_DO_NOT_USE";
|
|
52
54
|
const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, attrs }) => {
|
|
53
55
|
const selectRef = shallowRef();
|
|
54
|
-
const { getPopupContainer: getContextPopupContainer, getPrefixCls, renderEmpty, direction: contextDirection, virtual, popupMatchSelectWidth: contextPopupMatchSelectWidth, popupOverflow, showSearch, style: contextStyle, styles: contextStyles, class: contextClassName, classes: contextClassNames, prefixCls, allowClear: contextAllowClear } = useComponentBaseConfig("select", props, [
|
|
56
|
+
const { getPopupContainer: getContextPopupContainer, getPrefixCls, renderEmpty, direction: contextDirection, virtual, popupMatchSelectWidth: contextPopupMatchSelectWidth, popupOverflow, showSearch, style: contextStyle, styles: contextStyles, class: contextClassName, classes: contextClassNames, prefixCls, allowClear: contextAllowClear, autoComplete: contextAutoComplete, clearIcon: contextClearIcon, suffix: contextSuffix, suffixIcon: contextSuffixIcon } = useComponentBaseConfig("select", props, [
|
|
57
|
+
"showSearch",
|
|
58
|
+
"allowClear",
|
|
59
|
+
"autoComplete",
|
|
60
|
+
"clearIcon",
|
|
61
|
+
"suffix",
|
|
62
|
+
"suffixIcon"
|
|
63
|
+
]);
|
|
55
64
|
const getGlobalLocale = useLocaleGetter("global");
|
|
65
|
+
const configCtx = useConfig();
|
|
56
66
|
const { listItemHeight: customListItemHeight, direction: propDirection, variant: customizeVariant, bordered, size: customizeSize, classes, styles } = toPropsRefs(props, "listItemHeight", "direction", "variant", "bordered", "size", "classes", "styles");
|
|
57
67
|
const [, token] = useToken();
|
|
58
68
|
const value = shallowRef(props.value ?? props?.defaultValue);
|
|
@@ -108,11 +118,13 @@ const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, at
|
|
|
108
118
|
popupClassName: "classes.popup.root",
|
|
109
119
|
dropdownRender: "popupRender",
|
|
110
120
|
onDropdownVisibleChange: "onOpenChange",
|
|
111
|
-
bordered: "variant"
|
|
121
|
+
bordered: "variant",
|
|
122
|
+
suffixIcon: "suffix"
|
|
112
123
|
}).forEach(([oldProp, newProp]) => {
|
|
113
124
|
warning.deprecated(!props[oldProp], oldProp, newProp);
|
|
114
125
|
});
|
|
115
|
-
warning(!
|
|
126
|
+
warning.deprecated(!slots.suffixIcon, "suffixIcon", "suffix");
|
|
127
|
+
warning(!props.showArrow, "deprecated", "`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffix` to null.");
|
|
116
128
|
warning(!(typeof maxCount !== "undefined" && !isMultiple.value), "usage", "`maxCount` only works with mode `multiple` or `tags`");
|
|
117
129
|
}
|
|
118
130
|
const mergedPopupStyle = computed(() => {
|
|
@@ -131,8 +143,9 @@ const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, at
|
|
|
131
143
|
return () => {
|
|
132
144
|
const { popupMatchSelectWidth, dropdownMatchSelectWidth, showArrow, dropdownRender, status: customStatus, allowClear, popupClassName, dropdownClassName, rootClass, popupStyle, dropdownStyle, transitionName, builtinPlacements, listHeight, getPopupContainer, maxCount, ...rest } = props;
|
|
133
145
|
const { className, style, restAttrs } = getAttrStyleAndClass(attrs);
|
|
134
|
-
const
|
|
135
|
-
const
|
|
146
|
+
const customSuffix = getCustomSuffix(slots, props);
|
|
147
|
+
const mergedCustomSuffix = customSuffix !== void 0 ? customSuffix : getSlotPropsFnRun(slots, props, "suffixIcon", false);
|
|
148
|
+
const showSuffix = useShowArrow(mergedCustomSuffix, showArrow);
|
|
136
149
|
const tagRender = slots?.tagRender ?? props?.tagRender;
|
|
137
150
|
const mergedPopupMatchSelectWidth = popupMatchSelectWidth ?? dropdownMatchSelectWidth ?? contextPopupMatchSelectWidth.value;
|
|
138
151
|
const mergedPopupRender = usePopupRender((slots?.popupRender ?? props?.popupRender) || dropdownRender);
|
|
@@ -143,23 +156,27 @@ const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, at
|
|
|
143
156
|
if (notFoundContent !== void 0) mergedNotFound = notFoundContent;
|
|
144
157
|
else if (mode.value === "combobox") mergedNotFound = null;
|
|
145
158
|
else mergedNotFound = renderEmpty?.value?.("Select") || createVNode(DefaultRenderEmpty, { "componentName": "Select" }, null);
|
|
146
|
-
const {
|
|
159
|
+
const { suffix: mergedSuffix, itemIcon, removeIcon } = useIcons({
|
|
147
160
|
...rest,
|
|
148
161
|
multiple: isMultiple.value,
|
|
149
162
|
hasFeedback,
|
|
150
163
|
feedbackIcon,
|
|
151
|
-
|
|
152
|
-
|
|
164
|
+
showSuffix,
|
|
165
|
+
showArrow,
|
|
166
|
+
suffix: mergedCustomSuffix,
|
|
167
|
+
contextSuffix: contextSuffix.value !== void 0 ? contextSuffix.value : contextSuffixIcon.value,
|
|
153
168
|
prefixCls: prefixCls.value,
|
|
154
169
|
componentName: "Select"
|
|
155
170
|
});
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
clearIcon,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
171
|
+
const mergedAllowClear = useAllowClear({
|
|
172
|
+
allowClear,
|
|
173
|
+
clearIcon: rest.clearIcon,
|
|
174
|
+
contextAllowClear: mode.value === "combobox" ? configCtx.value.autoComplete?.allowClear : contextAllowClear.value,
|
|
175
|
+
contextClearIcon: contextClearIcon.value,
|
|
176
|
+
defaultLabel: getGlobalLocale().clear
|
|
177
|
+
});
|
|
162
178
|
const selectProps = omitUndefined(rest, [
|
|
179
|
+
"suffix",
|
|
163
180
|
"suffixIcon",
|
|
164
181
|
"classes",
|
|
165
182
|
"styles",
|
|
@@ -215,14 +232,17 @@ const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, at
|
|
|
215
232
|
onMouseDown: (e) => {
|
|
216
233
|
emit("mousedown", e);
|
|
217
234
|
},
|
|
218
|
-
|
|
235
|
+
onMouseleave: (e) => {
|
|
219
236
|
emit("mouseleave", e);
|
|
220
237
|
},
|
|
221
|
-
|
|
238
|
+
onMouseenter: (e) => {
|
|
222
239
|
emit("mouseenter", e);
|
|
223
240
|
},
|
|
224
241
|
onPopupScroll: (e) => {
|
|
225
242
|
emit("popupScroll", e);
|
|
243
|
+
},
|
|
244
|
+
onSearch: (value) => {
|
|
245
|
+
emit("search", value);
|
|
226
246
|
}
|
|
227
247
|
};
|
|
228
248
|
const labelRender = slots?.labelRender ?? props?.labelRender;
|
|
@@ -258,10 +278,11 @@ const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, at
|
|
|
258
278
|
"direction": direction.value,
|
|
259
279
|
"prefix": prefix,
|
|
260
280
|
"value": value.value,
|
|
261
|
-
"
|
|
281
|
+
"suffix": mergedSuffix,
|
|
262
282
|
"menuItemSelectedIcon": itemIcon,
|
|
263
283
|
"removeIcon": removeIcon,
|
|
264
284
|
"allowClear": mergedAllowClear,
|
|
285
|
+
"autoComplete": props.autoComplete ?? contextAutoComplete.value,
|
|
265
286
|
"notFoundContent": mergedNotFound,
|
|
266
287
|
"className": mergedClassName,
|
|
267
288
|
"getPopupContainer": getPopupContainer || getContextPopupContainer,
|
|
@@ -342,6 +363,18 @@ const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, at
|
|
|
342
363
|
required: false,
|
|
343
364
|
default: void 0
|
|
344
365
|
},
|
|
366
|
+
suffix: {
|
|
367
|
+
type: [
|
|
368
|
+
Function,
|
|
369
|
+
String,
|
|
370
|
+
Number,
|
|
371
|
+
null,
|
|
372
|
+
Object,
|
|
373
|
+
Boolean
|
|
374
|
+
],
|
|
375
|
+
required: false,
|
|
376
|
+
default: void 0
|
|
377
|
+
},
|
|
345
378
|
suffixIcon: {
|
|
346
379
|
type: [
|
|
347
380
|
Function,
|
|
@@ -397,10 +430,6 @@ const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, at
|
|
|
397
430
|
type: Object,
|
|
398
431
|
required: false
|
|
399
432
|
},
|
|
400
|
-
onSearch: {
|
|
401
|
-
type: Function,
|
|
402
|
-
required: false
|
|
403
|
-
},
|
|
404
433
|
showSearch: {
|
|
405
434
|
type: [Boolean, Object],
|
|
406
435
|
required: false,
|
|
@@ -591,19 +620,6 @@ const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, at
|
|
|
591
620
|
required: false,
|
|
592
621
|
default: void 0
|
|
593
622
|
},
|
|
594
|
-
suffix: {
|
|
595
|
-
type: [
|
|
596
|
-
Object,
|
|
597
|
-
Function,
|
|
598
|
-
String,
|
|
599
|
-
Number,
|
|
600
|
-
null,
|
|
601
|
-
Boolean,
|
|
602
|
-
Array
|
|
603
|
-
],
|
|
604
|
-
required: false,
|
|
605
|
-
default: void 0
|
|
606
|
-
},
|
|
607
623
|
clearIcon: {
|
|
608
624
|
type: [
|
|
609
625
|
Object,
|
|
@@ -681,7 +697,8 @@ const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, at
|
|
|
681
697
|
"mouseenter",
|
|
682
698
|
"focus",
|
|
683
699
|
"popupScroll",
|
|
684
|
-
"select"
|
|
700
|
+
"select",
|
|
701
|
+
"search"
|
|
685
702
|
],
|
|
686
703
|
name: "ASelect",
|
|
687
704
|
inheritAttrs: false
|
|
@@ -3,6 +3,7 @@ import { AliasToken } from "../../theme/interface/alias.js";
|
|
|
3
3
|
import { ComponentToken } from "./token.js";
|
|
4
4
|
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
5
5
|
import "../../theme/interface/index.js";
|
|
6
|
+
import "../../theme/internal.js";
|
|
6
7
|
//#region src/select/style/index.d.ts
|
|
7
8
|
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
8
9
|
//#endregion
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import { RenderNodeFn, VueNode } from "../_util/type.js";
|
|
2
2
|
//#region src/select/useIcons.d.ts
|
|
3
3
|
type RenderNode = VueNode;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/** Render info passed to a function `suffix` / `#suffix` slot by the underlying `@v-c/select`. */
|
|
5
|
+
interface SelectSuffixRenderInfo {
|
|
6
|
+
searchValue: string;
|
|
7
|
+
open: boolean;
|
|
8
|
+
focused: boolean;
|
|
9
|
+
showSearch?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Read the `suffix` render prop with slot priority. The slot (or a function prop) is kept as a
|
|
14
|
+
* function so `@v-c/select` can call it with the latest open / search state.
|
|
15
|
+
*/
|
|
16
|
+
declare function getCustomSuffix(slots: Record<string, any>, props: {
|
|
17
|
+
suffix?: any;
|
|
18
|
+
}): any;
|
|
19
|
+
declare function useIcons({ suffix, contextSuffix, clearIcon, menuItemSelectedIcon, removeIcon, loading, loadingIcon, multiple, hasFeedback, showSuffix, feedbackIcon, showArrow, componentName }: {
|
|
20
|
+
suffix?: RenderNode;
|
|
21
|
+
contextSuffix?: RenderNode;
|
|
6
22
|
clearIcon?: RenderNode;
|
|
7
23
|
menuItemSelectedIcon?: RenderNode;
|
|
8
24
|
removeIcon?: RenderNode;
|
|
@@ -12,17 +28,16 @@ declare function useIcons({ suffixIcon, clearIcon, menuItemSelectedIcon, removeI
|
|
|
12
28
|
hasFeedback?: boolean;
|
|
13
29
|
feedbackIcon?: VueNode;
|
|
14
30
|
prefixCls: string;
|
|
15
|
-
|
|
31
|
+
showSuffix?: boolean;
|
|
16
32
|
showArrow?: boolean;
|
|
17
33
|
componentName: string;
|
|
18
34
|
}): {
|
|
19
35
|
clearIcon: VueNode;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}) => import("vue/jsx-runtime").JSX.Element | null) | null;
|
|
36
|
+
suffix: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}> | RenderNodeFn<any[]> | null;
|
|
24
39
|
itemIcon: string | number | boolean | import("vue/jsx-runtime").JSX.Element | RenderNodeFn<any[]> | null;
|
|
25
40
|
removeIcon: string | number | boolean | import("vue/jsx-runtime").JSX.Element | RenderNodeFn<any[]> | null;
|
|
26
41
|
};
|
|
27
42
|
//#endregion
|
|
28
|
-
export { useIcons as default };
|
|
43
|
+
export { SelectSuffixRenderInfo, useIcons as default, getCustomSuffix };
|
package/dist/select/useIcons.js
CHANGED
|
@@ -1,22 +1,43 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
+
import fallbackProp from "../_util/fallbackProp.js";
|
|
2
3
|
import { getSlotPropsFnRun } from "../_util/tools.js";
|
|
4
|
+
import { isFunction, isRenderable } from "../_util/is.js";
|
|
3
5
|
import { Fragment, createVNode } from "vue";
|
|
6
|
+
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
4
7
|
import { CheckOutlined, CloseCircleFilled, CloseOutlined, DownOutlined, LoadingOutlined, SearchOutlined } from "@antdv-next/icons";
|
|
5
8
|
//#region src/select/useIcons.tsx
|
|
6
|
-
|
|
9
|
+
/** Render info passed to a function `suffix` / `#suffix` slot by the underlying `@v-c/select`. */
|
|
10
|
+
/**
|
|
11
|
+
* Read the `suffix` render prop with slot priority. The slot (or a function prop) is kept as a
|
|
12
|
+
* function so `@v-c/select` can call it with the latest open / search state.
|
|
13
|
+
*/
|
|
14
|
+
function getCustomSuffix(slots, props) {
|
|
15
|
+
const slot = slots?.suffix;
|
|
16
|
+
if (slot) return (info) => {
|
|
17
|
+
const nodes = filterEmpty([slot(info)].flat()).filter((node) => node !== void 0 && node !== null);
|
|
18
|
+
if (!nodes.length) return;
|
|
19
|
+
return nodes.length === 1 ? nodes[0] : nodes;
|
|
20
|
+
};
|
|
21
|
+
return props.suffix;
|
|
22
|
+
}
|
|
23
|
+
function useIcons({ suffix, contextSuffix, clearIcon, menuItemSelectedIcon, removeIcon, loading, loadingIcon, multiple, hasFeedback, showSuffix, feedbackIcon, showArrow, componentName }) {
|
|
7
24
|
if (isDev) devUseWarning(componentName).deprecated(!clearIcon, "clearIcon", "allowClear={{ clearIcon: VueNode }}");
|
|
8
25
|
const mergedClearIcon = clearIcon ?? createVNode(CloseCircleFilled, null, null);
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
return createVNode(Fragment, null, [showSuffixIcon !== false && arrowIcon, hasFeedback && feedbackIcon]);
|
|
26
|
+
const getSuffixNode = (suffixNode) => {
|
|
27
|
+
if (!isRenderable(suffixNode) && !hasFeedback && !showArrow) return null;
|
|
28
|
+
return createVNode(Fragment, null, [showSuffix !== false && suffixNode, hasFeedback && feedbackIcon]);
|
|
13
29
|
};
|
|
14
|
-
let
|
|
15
|
-
if (
|
|
16
|
-
else if (loading)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
30
|
+
let mergedSuffix = null;
|
|
31
|
+
if (suffix !== void 0) mergedSuffix = isFunction(suffix) ? (props) => getSuffixNode(suffix(props)) : getSuffixNode(suffix);
|
|
32
|
+
else if (loading) mergedSuffix = getSuffixNode(getSlotPropsFnRun({}, { loadingIcon }, "loadingIcon") ?? createVNode(LoadingOutlined, {
|
|
33
|
+
"spin": true,
|
|
34
|
+
"aria-hidden": "true"
|
|
35
|
+
}, null));
|
|
36
|
+
else mergedSuffix = (props) => {
|
|
37
|
+
const { open, showSearch } = props;
|
|
38
|
+
if (open && showSearch) return getSuffixNode(createVNode(SearchOutlined, { "aria-hidden": "true" }, null));
|
|
39
|
+
const fallbackSuffix = fallbackProp(contextSuffix, createVNode(DownOutlined, { "aria-hidden": "true" }, null));
|
|
40
|
+
return getSuffixNode(isFunction(fallbackSuffix) ? fallbackSuffix(props) : fallbackSuffix);
|
|
20
41
|
};
|
|
21
42
|
let mergedItemIcon = null;
|
|
22
43
|
if (menuItemSelectedIcon !== void 0) mergedItemIcon = menuItemSelectedIcon;
|
|
@@ -27,10 +48,10 @@ function useIcons({ suffixIcon, clearIcon, menuItemSelectedIcon, removeIcon, loa
|
|
|
27
48
|
else mergedRemoveIcon = createVNode(CloseOutlined, null, null);
|
|
28
49
|
return {
|
|
29
50
|
clearIcon: mergedClearIcon,
|
|
30
|
-
|
|
51
|
+
suffix: mergedSuffix,
|
|
31
52
|
itemIcon: mergedItemIcon,
|
|
32
53
|
removeIcon: mergedRemoveIcon
|
|
33
54
|
};
|
|
34
55
|
}
|
|
35
56
|
//#endregion
|
|
36
|
-
export { useIcons as default };
|
|
57
|
+
export { useIcons as default, getCustomSuffix };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { VueNode } from "../_util/type.js";
|
|
2
1
|
//#region src/select/useShowArrow.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Since Select, TreeSelect, Cascader is same Select like component.
|
|
5
4
|
* We just use same hook to handle this logic.
|
|
6
5
|
*
|
|
7
|
-
* If `
|
|
6
|
+
* If `suffix` is not equal to `null`, always show it.
|
|
8
7
|
*/
|
|
9
|
-
declare function useShowArrow(
|
|
8
|
+
declare function useShowArrow(suffix?: unknown, showArrow?: boolean): boolean;
|
|
10
9
|
//#endregion
|
|
11
10
|
export { useShowArrow as default };
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { getSlotPropsFnRun } from "../_util/tools.js";
|
|
2
1
|
//#region src/select/useShowArrow.ts
|
|
3
2
|
/**
|
|
4
3
|
* Since Select, TreeSelect, Cascader is same Select like component.
|
|
5
4
|
* We just use same hook to handle this logic.
|
|
6
5
|
*
|
|
7
|
-
* If `
|
|
6
|
+
* If `suffix` is not equal to `null`, always show it.
|
|
8
7
|
*/
|
|
9
|
-
function useShowArrow(
|
|
10
|
-
showArrow
|
|
11
|
-
return showArrow !== void 0 ? showArrow : suffixIcon !== null;
|
|
8
|
+
function useShowArrow(suffix, showArrow) {
|
|
9
|
+
return showArrow !== void 0 ? showArrow : suffix !== null;
|
|
12
10
|
}
|
|
13
11
|
//#endregion
|
|
14
12
|
export { useShowArrow as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createVNode, defineComponent, mergeDefaults, mergeProps } from "vue";
|
|
2
2
|
import { classNames } from "@v-c/util";
|
|
3
|
-
import { omit } from "es-toolkit";
|
|
3
|
+
import { omit as omit$1 } from "es-toolkit";
|
|
4
4
|
//#region src/skeleton/Paragraph.tsx
|
|
5
5
|
function getWidth(index, props) {
|
|
6
6
|
const { width, rows = 2 } = props;
|
|
@@ -14,7 +14,7 @@ const Paragraph = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
14
14
|
"key": index,
|
|
15
15
|
"style": { width: getWidth(index, props) }
|
|
16
16
|
}, null));
|
|
17
|
-
return createVNode("ul", mergeProps({ "class": classNames(prefixCls, rootClass, attrs?.class) }, omit(attrs, ["class"])), [rowList]);
|
|
17
|
+
return createVNode("ul", mergeProps({ "class": classNames(prefixCls, rootClass, attrs?.class) }, omit$1(attrs, ["class"])), [rowList]);
|
|
18
18
|
};
|
|
19
19
|
}, {
|
|
20
20
|
props: /*@__PURE__*/ mergeDefaults({
|
|
@@ -12,7 +12,7 @@ import Paragraph from "./Paragraph.js";
|
|
|
12
12
|
import Title from "./Title.js";
|
|
13
13
|
import { computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef } from "vue";
|
|
14
14
|
import { classNames } from "@v-c/util";
|
|
15
|
-
import { omit } from "es-toolkit";
|
|
15
|
+
import { omit as omit$1 } from "es-toolkit";
|
|
16
16
|
//#region src/skeleton/Skeleton.tsx
|
|
17
17
|
function getComponentProps(prop) {
|
|
18
18
|
if (prop && typeof prop === "object") return prop;
|
|
@@ -101,7 +101,7 @@ const Skeleton = /* @__PURE__ */ defineComponent((props, { attrs, slots, expose
|
|
|
101
101
|
return createVNode("div", mergeProps({
|
|
102
102
|
"ref": nativeElementRef,
|
|
103
103
|
"class": cls
|
|
104
|
-
}, omit(attrs, ["class", "style"]), { "style": [mergedStyles.value.root, attrs?.style] }), [avatarNode, contentNode]);
|
|
104
|
+
}, omit$1(attrs, ["class", "style"]), { "style": [mergedStyles.value.root, attrs?.style] }), [avatarNode, contentNode]);
|
|
105
105
|
}
|
|
106
106
|
return slots.default?.() ?? null;
|
|
107
107
|
};
|
package/dist/skeleton/Title.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
2
2
|
import { classNames } from "@v-c/util";
|
|
3
|
-
import { omit } from "es-toolkit";
|
|
3
|
+
import { omit as omit$1 } from "es-toolkit";
|
|
4
4
|
//#region src/skeleton/Title.tsx
|
|
5
5
|
const Title = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
6
6
|
return () => {
|
|
@@ -8,7 +8,7 @@ const Title = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
8
8
|
return createVNode("h3", mergeProps({
|
|
9
9
|
"class": classNames(prefixCls, rootClass, attrs?.class),
|
|
10
10
|
"style": [{ width }, attrs?.style]
|
|
11
|
-
}, omit(attrs, ["class", "style"])), null);
|
|
11
|
+
}, omit$1(attrs, ["class", "style"])), null);
|
|
12
12
|
};
|
|
13
13
|
}, {
|
|
14
14
|
props: {
|
package/dist/slider/index.d.ts
CHANGED
|
@@ -98,7 +98,12 @@ interface SliderRef {
|
|
|
98
98
|
focus: () => void;
|
|
99
99
|
blur: () => void;
|
|
100
100
|
}
|
|
101
|
-
interface SliderSlots {
|
|
101
|
+
interface SliderSlots {
|
|
102
|
+
mark?: (ctx: {
|
|
103
|
+
point: number;
|
|
104
|
+
label?: any;
|
|
105
|
+
}) => any;
|
|
106
|
+
}
|
|
102
107
|
type SliderRange = SliderProps$1['range'];
|
|
103
108
|
interface Opens {
|
|
104
109
|
[index: number]: boolean;
|
package/dist/slider/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import style_default from "./style/index.js";
|
|
|
9
9
|
import { cloneVNode, computed, createVNode, defineComponent, isVNode, mergeProps, onMounted, onUnmounted, shallowRef } from "vue";
|
|
10
10
|
import { clsx } from "@v-c/util";
|
|
11
11
|
import raf from "@v-c/util/dist/raf";
|
|
12
|
-
import { omit } from "es-toolkit/compat";
|
|
12
|
+
import { omit as omit$1 } from "es-toolkit/compat";
|
|
13
13
|
import useDelayState from "@v-c/util/dist/hooks/useDelayState";
|
|
14
14
|
import VcSlider from "@v-c/slider";
|
|
15
15
|
//#region src/slider/index.tsx
|
|
@@ -20,7 +20,7 @@ function getTipFormatter(tipFormatter) {
|
|
|
20
20
|
if (tipFormatter || tipFormatter === null) return tipFormatter;
|
|
21
21
|
return (val) => typeof val === "number" ? val.toString() : "";
|
|
22
22
|
}
|
|
23
|
-
const Slider = /* @__PURE__ */ defineComponent((props, { attrs, emit, expose }) => {
|
|
23
|
+
const Slider = /* @__PURE__ */ defineComponent((props, { attrs, emit, expose, slots }) => {
|
|
24
24
|
const { classes, styles, vertical, orientation } = toPropsRefs(props, "classes", "styles", "vertical", "orientation");
|
|
25
25
|
const [, mergedVertical] = useOrientation(orientation, vertical);
|
|
26
26
|
const sliderRef = shallowRef();
|
|
@@ -82,7 +82,7 @@ const Slider = /* @__PURE__ */ defineComponent((props, { attrs, emit, expose })
|
|
|
82
82
|
[`${prefixCls.value}-lock`]: dragging.value
|
|
83
83
|
}, hashId.value, cssVarCls.value);
|
|
84
84
|
const restProps = {
|
|
85
|
-
...omit(props, [
|
|
85
|
+
...omit$1(props, [
|
|
86
86
|
"prefixCls",
|
|
87
87
|
"range",
|
|
88
88
|
"rootClass",
|
|
@@ -97,6 +97,8 @@ const Slider = /* @__PURE__ */ defineComponent((props, { attrs, emit, expose })
|
|
|
97
97
|
...restAttrs
|
|
98
98
|
};
|
|
99
99
|
delete restProps.onAfterChange;
|
|
100
|
+
const onBlur = restProps.onBlur;
|
|
101
|
+
delete restProps.onBlur;
|
|
100
102
|
if (isRTL.value && !mergedVertical.value) restProps.reverse = !restProps.reverse;
|
|
101
103
|
const mergedTipFormatter = getTipFormatter(tipFormatter);
|
|
102
104
|
const useActiveTooltipHandle = range && !lockOpen.value;
|
|
@@ -125,7 +127,7 @@ const Slider = /* @__PURE__ */ defineComponent((props, { attrs, emit, expose })
|
|
|
125
127
|
},
|
|
126
128
|
onBlur: (e) => {
|
|
127
129
|
setFocusOpen(false);
|
|
128
|
-
|
|
130
|
+
onBlur?.(e);
|
|
129
131
|
proxyEvent("onBlur", e);
|
|
130
132
|
}
|
|
131
133
|
});
|
|
@@ -177,7 +179,7 @@ const Slider = /* @__PURE__ */ defineComponent((props, { attrs, emit, expose })
|
|
|
177
179
|
emit("update:value", ...args);
|
|
178
180
|
},
|
|
179
181
|
"ref": sliderRef
|
|
180
|
-
}),
|
|
182
|
+
}), { mark: slots.mark });
|
|
181
183
|
};
|
|
182
184
|
}, {
|
|
183
185
|
props: {
|