antdv-next 1.5.1 → 1.5.3

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.
Files changed (79) hide show
  1. package/dist/_util/hooks/useClosable.d.ts +4 -2
  2. package/dist/_util/hooks/useClosable.js +9 -3
  3. package/dist/_util/statusUtils.d.ts +1 -1
  4. package/dist/_util/vueNode.d.ts +2 -6
  5. package/dist/anchor/Anchor.js +12 -6
  6. package/dist/antd-with-locales.esm.js +5684 -5361
  7. package/dist/antd-with-locales.js +82 -82
  8. package/dist/antd.css +1 -1
  9. package/dist/antd.esm.js +7613 -7294
  10. package/dist/antd.js +38 -38
  11. package/dist/auto-complete/index.d.ts +1 -1
  12. package/dist/auto-complete/index.js +13 -10
  13. package/dist/breadcrumb/BreadcrumbItem.js +2 -1
  14. package/dist/button/buttonHelper.d.ts +1 -1
  15. package/dist/card/Card.js +5 -4
  16. package/dist/card/CardMeta.js +4 -3
  17. package/dist/carousel/index.js +5 -2
  18. package/dist/checkbox/Checkbox.js +1 -1
  19. package/dist/collapse/Collapse.js +2 -4
  20. package/dist/color-picker/components/ColorTrigger.js +1 -1
  21. package/dist/color-picker/style/index.js +1 -0
  22. package/dist/config-provider/context.d.ts +5 -2
  23. package/dist/date-picker/generatePicker/generateRangePicker.js +4 -2
  24. package/dist/date-picker/generatePicker/useComponents.d.ts +2 -2
  25. package/dist/date-picker/util.d.ts +4 -4
  26. package/dist/descriptions/hooks/useItems.d.ts +6 -6
  27. package/dist/float-button/FloatButton.js +2 -1
  28. package/dist/float-button/style/button.js +16 -10
  29. package/dist/form/FormItem/ItemHolder.js +1 -1
  30. package/dist/form/FormItem/index.js +4 -5
  31. package/dist/form/FormItemLabel.js +2 -1
  32. package/dist/form/context.d.ts +1 -1
  33. package/dist/form/hooks/useVariant.d.ts +1 -1
  34. package/dist/form/style/index.js +25 -12
  35. package/dist/grid/row.js +9 -16
  36. package/dist/image/PreviewGroup.js +1 -1
  37. package/dist/listy/style/index.js +5 -1
  38. package/dist/locale/en_US.js +4 -0
  39. package/dist/locale/index.d.ts +4 -0
  40. package/dist/locale/is_IS.js +1 -1
  41. package/dist/locale/mn_MN.js +1 -1
  42. package/dist/locale/zh_CN.js +4 -0
  43. package/dist/menu/MenuItem.js +12 -2
  44. package/dist/menu/SubMenu.d.ts +1 -1
  45. package/dist/menu/style/vertical.js +10 -11
  46. package/dist/notification/index.js +2 -1
  47. package/dist/notification/useNotification.js +8 -4
  48. package/dist/package.js +1 -1
  49. package/dist/package.json.d.ts +4 -0
  50. package/dist/radio/group.js +2 -2
  51. package/dist/segmented/index.js +2 -1
  52. package/dist/select/index.d.ts +2 -2
  53. package/dist/select/index.js +1 -1
  54. package/dist/select/style/index.js +1 -1
  55. package/dist/space/Compact.d.ts +1 -1
  56. package/dist/steps/PanelArrow.js +3 -2
  57. package/dist/table/InternalTable.js +5 -4
  58. package/dist/table/hooks/useFilter/FilterDropdown.js +2 -2
  59. package/dist/table/hooks/useSorter.js +7 -9
  60. package/dist/table/style/radius.js +4 -0
  61. package/dist/table/util.d.ts +1 -1
  62. package/dist/tag/CheckableTagGroup.d.ts +3 -0
  63. package/dist/tag/CheckableTagGroup.js +2 -2
  64. package/dist/tag/hooks/useColor.d.ts +1 -1
  65. package/dist/tag/index.js +2 -1
  66. package/dist/transfer/ListBody.js +2 -1
  67. package/dist/transfer/ListItem.d.ts +1 -0
  68. package/dist/transfer/ListItem.js +6 -2
  69. package/dist/transfer/Section.js +1 -1
  70. package/dist/transfer/search.js +2 -2
  71. package/dist/tree/utils/dictUtil.js +3 -2
  72. package/dist/upload/UploadList/ListItem.js +2 -1
  73. package/dist/upload/UploadList/index.js +8 -2
  74. package/dist/upload/utils.js +8 -6
  75. package/dist/version/token-meta.json +1 -0
  76. package/dist/version/token.json +1 -0
  77. package/package.json +10 -6
  78. package/web-tags.json +1172 -1168
  79. package/web-types.json +3789 -3806
@@ -33,7 +33,7 @@ type AutoCompleteClassNamesType = SemanticClassNamesType<AutoCompleteProps, Auto
33
33
  type AutoCompleteStylesType = SemanticStylesType<AutoCompleteProps, AutoCompleteSemanticStyles, {
34
34
  popup?: SelectPopupSemanticStyles;
35
35
  }>;
36
- type RcEventKeys = 'onClear' | 'onKeyUp' | 'onKeyDown' | 'onBlur' | 'onClick' | 'onActive' | 'onChange' | 'onDeselect' | 'onInputKeyDown' | 'onMouseDown' | 'onMouseLeave' | 'onMouseEnter' | 'onFocus' | 'onPopupScroll' | 'onPopupVisibleChange' | 'onSelect' | 'onSearch';
36
+ type RcEventKeys = 'onClear' | 'onKeyUp' | 'onKeyDown' | 'onBlur' | 'onClick' | 'onActive' | 'onChange' | 'onDeselect' | 'onInputKeyDown' | 'onMouseDown' | 'onMouseLeave' | 'onMouseEnter' | 'onFocus' | 'onPopupScroll' | 'onSelect' | 'onSearch';
37
37
  interface AutoCompleteProps extends Omit<InternalSelectProps, 'loading' | 'mode' | 'optionLabelProp' | 'labelInValue' | 'classes' | 'styles' | 'getInputElement' | 'getRawInputElement' | 'showSearch' | 'optionFilterProp' | 'filterSort' | RcEventKeys>, AutoCompleteEmitsProps {
38
38
  /** @deprecated Please use `options` instead */
39
39
  dataSource?: DataSourceItemType[];
@@ -4,7 +4,7 @@ import { getAttrStyleAndClass as getAttrStyleAndClass$1, useMergeSemantic, useTo
4
4
  import { toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
5
5
  import genPurePanel from "../_util/PurePanel.js";
6
6
  import Select from "../select/index.js";
7
- import { Text, computed, createVNode, defineComponent, isVNode, mergeProps } from "vue";
7
+ import { Text, computed, createVNode, defineComponent, getCurrentInstance, isVNode, mergeProps } from "vue";
8
8
  import { clsx } from "@v-c/util";
9
9
  import { filterEmpty } from "@v-c/util/dist/props-util";
10
10
  import { omit } from "es-toolkit";
@@ -26,11 +26,18 @@ const omitKeys = [
26
26
  "dropdownStyle",
27
27
  "classes",
28
28
  "styles",
29
- "popupRender"
29
+ "popupRender",
30
+ "onOpenChange",
31
+ "onDropdownVisibleChange"
30
32
  ];
31
33
  const InternalAutoComplete = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) => {
32
34
  const { prefixCls } = useComponentBaseConfig("select", props);
33
35
  const { classes, styles } = toPropsRefs$1(props, "classes", "styles");
36
+ const instance = getCurrentInstance();
37
+ const mergedOnOpenChange = (open) => {
38
+ if (instance?.vnode.props?.onOpenChange) emit("openChange", open);
39
+ else emit("dropdownVisibleChange", open);
40
+ };
34
41
  const mergedProps = computed(() => {
35
42
  return {
36
43
  ...props,
@@ -41,6 +48,7 @@ const InternalAutoComplete = /* @__PURE__ */ defineComponent((props, { slots, em
41
48
  const [mergedClassNames, mergedStyles] = useMergeSemantic(useToArr(classes), useToArr(styles), useToProps(mergedProps), computed(() => ({ popup: { _default: "root" } })));
42
49
  return () => {
43
50
  const { className, style, restAttrs } = getAttrStyleAndClass$1(attrs);
51
+ const forwardedAttrs = omit(restAttrs, ["onOpenChange", "onDropdownVisibleChange"]);
44
52
  const childNodes = toArray(filterEmpty(slots.default?.() ?? []));
45
53
  const hasSelectOptions = !!childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0]);
46
54
  let customizeInput;
@@ -115,7 +123,7 @@ const InternalAutoComplete = /* @__PURE__ */ defineComponent((props, { slots, em
115
123
  };
116
124
  const selectProps = omit(props, omitKeys);
117
125
  if (selectProps.placeholder === void 0 && customizeInputPlaceholder !== void 0) selectProps.placeholder = customizeInputPlaceholder;
118
- return createVNode(Select, mergeProps(restAttrs, selectProps, {
126
+ return createVNode(Select, mergeProps(forwardedAttrs, selectProps, {
119
127
  onSelect: (value, option) => {
120
128
  emit("select", value, option);
121
129
  },
@@ -163,12 +171,6 @@ const InternalAutoComplete = /* @__PURE__ */ defineComponent((props, { slots, em
163
171
  },
164
172
  onSearch: (value) => {
165
173
  emit("search", value);
166
- },
167
- onOpenChange: (open) => {
168
- emit("openChange", open);
169
- },
170
- onDropdownVisibleChange: (open) => {
171
- emit("dropdownVisibleChange", open);
172
174
  }
173
175
  }, getInputElement ? { getInputElement } : {}, {
174
176
  "prefixCls": prefixCls.value,
@@ -178,7 +180,8 @@ const InternalAutoComplete = /* @__PURE__ */ defineComponent((props, { slots, em
178
180
  "popupRender": mergedPopupRender,
179
181
  "popupMatchSelectWidth": mergedPopupMatchSelectWidth,
180
182
  "mode": Select.SECRET_COMBOBOX_MODE_DO_NOT_USE,
181
- "suffixIcon": null
183
+ "suffixIcon": null,
184
+ "onOpenChange": mergedOnOpenChange
182
185
  }, { "onUpdate:value": (value) => emit("update:value", value) }), {
183
186
  default: () => [optionChildren],
184
187
  ...forwardedSlots
@@ -2,6 +2,7 @@ import { useBaseConfig } from "../config-provider/context.js";
2
2
  import { getSlotPropsFnRun } from "../_util/tools.js";
3
3
  import isNonNullable from "../_util/isNonNullable.js";
4
4
  import { checkRenderNode } from "../_util/vueNode.js";
5
+ import { isRenderable } from "../_util/is.js";
5
6
  import { useBreadcrumbContext } from "./BreadcrumbContext.js";
6
7
  import Dropdown from "../dropdown/index.js";
7
8
  import BreadcrumbSeparator from "./BreadcrumbSeparator.js";
@@ -53,7 +54,7 @@ const InternalBreadcrumbItem = /* @__PURE__ */ defineComponent((props, { slots }
53
54
  if (isNonNullable(link)) return createVNode(Fragment, null, [createVNode("li", {
54
55
  "class": clsx(`${prefixCls}-item`, mergedClassNames?.item),
55
56
  "style": mergedStyles?.item
56
- }, [link]), !!separator && createVNode(BreadcrumbSeparator, null, _isSlot(separator) ? separator : { default: () => [separator] })]);
57
+ }, [link]), isRenderable(separator) && createVNode(BreadcrumbSeparator, null, _isSlot(separator) ? separator : { default: () => [separator] })]);
57
58
  return null;
58
59
  };
59
60
  }, {
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties, VNodeChild } from "vue";
2
2
  //#region src/button/buttonHelper.d.ts
3
3
  declare const isTwoCNChar: (string: string) => boolean;
4
- declare function isUnBorderedButtonVariant(type?: ButtonVariantType): type is "text" | "link";
4
+ declare function isUnBorderedButtonVariant(type?: ButtonVariantType): type is "link" | "text";
5
5
  declare function spaceChildren(children: VNodeChild[], needInserted: boolean, style?: CSSProperties, className?: string): VNodeChild[];
6
6
  declare const _ButtonTypes: readonly ["default", "primary", "dashed", "link", "text"];
7
7
  type ButtonType = (typeof _ButtonTypes)[number];
package/dist/card/Card.js CHANGED
@@ -4,6 +4,7 @@ import { useSize } from "../config-provider/hooks/useSize.js";
4
4
  import { getAttrStyleAndClass as getAttrStyleAndClass$1, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
5
5
  import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
6
6
  import skeleton_default from "../skeleton/index.js";
7
+ import { isRenderable } from "../_util/is.js";
7
8
  import useVariant from "../form/hooks/useVariant.js";
8
9
  import Tabs from "../tabs/index.js";
9
10
  import style_default from "./style/index.js";
@@ -109,7 +110,7 @@ const Card = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
109
110
  ...item
110
111
  };
111
112
  }) }), tabsSlots) : null;
112
- if (title || extra || tabs) {
113
+ if (isRenderable(title) || isRenderable(extra) || tabs) {
113
114
  const headClasses = clsx(`${prefixCls.value}-head`, mergedClassNames.value.header);
114
115
  const titleClasses = clsx(`${prefixCls.value}-head-title`, mergedClassNames.value.title);
115
116
  const extraClasses = clsx(`${prefixCls.value}-extra`, mergedClassNames.value.extra);
@@ -119,16 +120,16 @@ const Card = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
119
120
  ...headStyle,
120
121
  ...mergedStyles.value.header
121
122
  }
122
- }, [createVNode("div", { "class": `${prefixCls.value}-head-wrapper` }, [!!title && createVNode("div", {
123
+ }, [createVNode("div", { "class": `${prefixCls.value}-head-wrapper` }, [isRenderable(title) && createVNode("div", {
123
124
  "class": titleClasses,
124
125
  "style": mergedStyles.value.title
125
- }, [title]), !!extra && createVNode("div", {
126
+ }, [title]), isRenderable(extra) && createVNode("div", {
126
127
  "class": extraClasses,
127
128
  "style": mergedStyles.value.extra
128
129
  }, [extra])]), tabs]);
129
130
  }
130
131
  const coverClasses = clsx(`${prefixCls.value}-cover`, mergedClassNames.value.cover);
131
- const coverDom = cover ? createVNode("div", {
132
+ const coverDom = isRenderable(cover) ? createVNode("div", {
132
133
  "class": coverClasses,
133
134
  "style": mergedStyles.value.cover
134
135
  }, [cover]) : null;
@@ -1,6 +1,7 @@
1
1
  import { useComponentBaseConfig } from "../config-provider/context.js";
2
2
  import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
3
3
  import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
4
+ import { isRenderable } from "../_util/is.js";
4
5
  import { computed, createVNode, defineComponent, mergeProps, shallowRef } from "vue";
5
6
  import { clsx } from "@v-c/util";
6
7
  //#region src/card/CardMeta.tsx
@@ -27,15 +28,15 @@ const CardMeta = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose
27
28
  const avatar = getSlotPropsFnRun(slots, props, "avatar");
28
29
  const title = getSlotPropsFnRun(slots, props, "title");
29
30
  const description = getSlotPropsFnRun(slots, props, "description");
30
- const avatarDom = avatar ? createVNode("div", {
31
+ const avatarDom = isRenderable(avatar) ? createVNode("div", {
31
32
  "class": avatarClassNames,
32
33
  "style": mergedStyles.value.avatar
33
34
  }, [avatar]) : null;
34
- const titleDom = title ? createVNode("div", {
35
+ const titleDom = isRenderable(title) ? createVNode("div", {
35
36
  "class": titleClassNames,
36
37
  "style": mergedStyles.value.title
37
38
  }, [title]) : null;
38
- const descriptionDom = description ? createVNode("div", {
39
+ const descriptionDom = isRenderable(description) ? createVNode("div", {
39
40
  "class": descriptionClassNames,
40
41
  "style": mergedStyles.value.description
41
42
  }, [description]) : null;
@@ -2,6 +2,8 @@ import { devUseWarning, isDev } from "../_util/warning.js";
2
2
  import { useComponentBaseConfig } from "../config-provider/context.js";
3
3
  import { getAttrStyleAndClass as getAttrStyleAndClass$1 } from "../_util/hooks/useMergeSemantic.js";
4
4
  import { getSlotPropsFnRun } from "../_util/tools.js";
5
+ import localeValues from "../locale/en_US.js";
6
+ import useLocale from "../locale/useLocale.js";
5
7
  import style_default, { DotDuration } from "./style/index.js";
6
8
  import { computed, createVNode, defineComponent, isVNode, mergeDefaults, mergeProps, onMounted, shallowRef, watch } from "vue";
7
9
  import { clsx } from "@v-c/util";
@@ -59,6 +61,7 @@ const Carousel = /* @__PURE__ */ defineComponent((props, { slots, emit, expose,
59
61
  });
60
62
  const mergedVertical = computed(() => props?.vertical ?? (mergedDotPlacement.value === "start" || mergedDotPlacement.value === "end"));
61
63
  const { prefixCls, direction, class: contextClassName, style: contextStyle } = useComponentBaseConfig("carousel", props);
64
+ const [contextLocale] = useLocale("Carousel", localeValues.Carousel);
62
65
  const slickRef = shallowRef();
63
66
  const nativeElementRef = shallowRef();
64
67
  const goTo = (slide, dontAnimate = false) => {
@@ -140,8 +143,8 @@ const Carousel = /* @__PURE__ */ defineComponent((props, { slots, emit, expose,
140
143
  "dots": enableDots,
141
144
  "dotsClass": dsClass,
142
145
  "arrows": arrows,
143
- "prevArrow": prevArrow ?? createVNode(ArrowButton, { "aria-label": isRTL.value ? "next" : "prev" }, null),
144
- "nextArrow": nextArrow ?? createVNode(ArrowButton, { "aria-label": isRTL.value ? "prev" : "next" }, null),
146
+ "prevArrow": prevArrow ?? createVNode(ArrowButton, { "aria-label": isRTL.value ? contextLocale.value.nextSlide : contextLocale.value.prevSlide }, null),
147
+ "nextArrow": nextArrow ?? createVNode(ArrowButton, { "aria-label": isRTL.value ? contextLocale.value.prevSlide : contextLocale.value.nextSlide }, null),
145
148
  "draggable": draggable,
146
149
  "verticalSwiping": mergedVertical.value,
147
150
  "autoplaySpeed": autoplaySpeed,
@@ -26,7 +26,7 @@ const InternalCheckbox = /* @__PURE__ */ defineComponent((props, { slots, emit,
26
26
  const formItemInputContext = useFormItemInputContext();
27
27
  const formItemContext = useFormItemContext();
28
28
  const contextDisabled = useDisabledContext();
29
- const mergedDisabled = computed(() => (checkboxGroup?.value?.disabled || props?.disabled) ?? contextDisabled.value);
29
+ const mergedDisabled = computed(() => props.disabled ?? checkboxGroup?.value?.disabled ?? contextDisabled.value);
30
30
  const mergedCheckedValue = computed(() => props.checkedValue ?? true);
31
31
  const mergedUnCheckedValue = computed(() => props.unCheckedValue ?? false);
32
32
  const currentValue = shallowRef(props?.checked ?? props?.defaultChecked ?? mergedUnCheckedValue.value);
@@ -30,10 +30,8 @@ const Collapse = /* @__PURE__ */ defineComponent((props, { attrs, emit, slots })
30
30
  const [mergedClassNames, mergedStyles] = useMergeSemantic(useToArr(contextClassNames, classes), useToArr(contextStyles, contextStyleRoot, styles), useToProps(mergedProps));
31
31
  const renderExpandIcon = (panelProps = {}) => {
32
32
  const mergedExpandIcon = slots?.expandIcon ?? props?.expandIcon ?? expandIcon.value;
33
- const icon = typeof mergedExpandIcon === "function" ? mergedExpandIcon?.(panelProps) : createVNode(RightOutlined, {
34
- "rotate": panelProps.isActive ? direction.value === "rtl" ? -90 : 90 : void 0,
35
- "aria-label": panelProps.isActive ? "expanded" : "collapsed"
36
- }, null);
33
+ const iconIsInteractive = panelProps.collapsible === "header" || panelProps.collapsible === "icon";
34
+ const icon = typeof mergedExpandIcon === "function" ? mergedExpandIcon?.(panelProps) : createVNode(RightOutlined, mergeProps({ "rotate": panelProps.isActive ? direction.value === "rtl" ? -90 : 90 : void 0 }, iconIsInteractive ? { "aria-label": panelProps.isActive ? "expanded" : "collapsed" } : { "aria-hidden": "true" }), null);
37
35
  return cloneElement(icon, () => {
38
36
  return { class: classNames(icon.props?.class, `${prefixCls.value}-arrow`) };
39
37
  });
@@ -55,7 +55,7 @@ var ColorTrigger_default = /* @__PURE__ */ defineComponent((props, { attrs }) =>
55
55
  "style": [styles.root, style]
56
56
  }), [containerNode.value, props.showText && createVNode("div", {
57
57
  "class": [colorTextPrefixCls.value, classes.description],
58
- "style": classes.description
58
+ "style": styles.description
59
59
  }, [desc.value])]);
60
60
  };
61
61
  }, {
@@ -33,6 +33,7 @@ function genClearStyle(token, size, extraStyle) {
33
33
  position: "relative",
34
34
  overflow: "hidden",
35
35
  cursor: "inherit",
36
+ userSelect: "none",
36
37
  transition: `all ${token.motionDurationFast}`,
37
38
  ...extraStyle,
38
39
  "&::after": {
@@ -90,7 +90,7 @@ import { TreeSelectProps } from "../tree-select/index.js";
90
90
  import { BlockProps } from "../typography/interface.js";
91
91
  import { ButtonProps } from "../button/Button.js";
92
92
  import "../button/index.js";
93
- import { CSSProperties, Ref } from "vue";
93
+ import { AriaAttributes, CSSProperties, Ref } from "vue";
94
94
  import { DerivativeFunc } from "@antdv-next/cssinjs";
95
95
  import { MoreProps } from "@v-c/tabs";
96
96
  //#region src/config-provider/context.d.ts
@@ -235,7 +235,10 @@ type ButtonConfig = ComponentStyleConfig & Pick<ButtonProps, 'classes' | 'styles
235
235
  loadingIcon?: VueNode;
236
236
  };
237
237
  type FlexConfig = ComponentStyleConfig & Pick<FlexProps, 'vertical'>;
238
- type AlertConfig = ComponentStyleConfig & Pick<AlertProps, 'variant' | 'closable' | 'closeIcon' | 'classes' | 'styles'> & {
238
+ type AlertConfig = ComponentStyleConfig & Pick<AlertProps, 'variant' | 'closeIcon' | 'classes' | 'styles'> & {
239
+ closable?: boolean | ({
240
+ closeIcon?: VueNode;
241
+ } & AriaAttributes);
239
242
  successIcon?: VueNode;
240
243
  infoIcon?: VueNode;
241
244
  warningIcon?: VueNode;
@@ -10,6 +10,7 @@ import useCSSVarCls from "../../config-provider/hooks/useCSSVarCls.js";
10
10
  import { useDisabledContext } from "../../config-provider/DisabledContext.js";
11
11
  import locale from "../locale/en_US.js";
12
12
  import useLocale from "../../locale/useLocale.js";
13
+ import { isNonNullable } from "../../_util/is.js";
13
14
  import { getMergedStatus, getStatusClassNames } from "../../_util/statusUtils.js";
14
15
  import { useFormItemInputContext } from "../../form/context.js";
15
16
  import { useVariants } from "../../form/hooks/useVariant.js";
@@ -142,12 +143,13 @@ function generateRangePicker(generateConfig) {
142
143
  const inputRender = slots.inputRender || props.inputRender ? (inputProps) => resolveRender("inputRender", [inputProps], inputProps) : void 0;
143
144
  const _contextSeparator = getSlotPropsFnRun({}, { separator: contextSeparator?.value }, "separator", false);
144
145
  const mergedSeparator = (getSlotPropsFnRun(slots, props, "separator", false) || _contextSeparator) ?? _contextSeparator;
146
+ const hasCustomSeparator = isNonNullable(mergedSeparator);
145
147
  return createVNode(ContextIsolator, { "space": true }, { default: () => [createVNode(RangePicker, mergeProps(restAttrs, restProps, {
146
148
  "ref": innerRef,
147
149
  "separator": createVNode("span", {
148
- "aria-label": "to",
150
+ "aria-hidden": hasCustomSeparator ? void 0 : true,
149
151
  "class": `${prefixCls.value}-separator`
150
- }, [mergedSeparator ?? createVNode(SwapRightOutlined, null, null)]),
152
+ }, [hasCustomSeparator ? mergedSeparator : createVNode(SwapRightOutlined, null, null)]),
151
153
  "disabled": mergedDisabled.value,
152
154
  "placement": placement,
153
155
  "placeholder": getRangePlaceholder(locale$1.value, props.picker, placeholder),
@@ -4,11 +4,11 @@ import { Components } from "@v-c/picker";
4
4
  //#region src/date-picker/generatePicker/useComponents.d.ts
5
5
  declare function useComponents(components?: Components): {
6
6
  time?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
7
- year?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
8
- month?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
9
7
  date?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
10
8
  week?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
9
+ month?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
11
10
  quarter?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
11
+ year?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
12
12
  decade?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
13
13
  datetime?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
14
14
  button: string | import("vue").DefineSetupFnComponent<ButtonProps, {}, {}, ButtonProps & {}, import("vue").PublicProps> | import("vue").DefineComponent;
@@ -6,14 +6,14 @@ import { PickerMode } from "@v-c/picker";
6
6
  declare function getPlaceholder(locale: PickerLocale, picker?: PickerMode, customizePlaceholder?: string): string;
7
7
  declare function getRangePlaceholder(locale: PickerLocale, picker?: PickerMode, customizePlaceholder?: [string, string]): [string, string] | undefined;
8
8
  declare function useIcons(props: Pick<PickerProps$1, 'allowClear' | 'removeIcon'>, prefixCls: string): readonly [false, string | number | boolean | import("vue/jsx-runtime").JSX.Element | RenderNodeFn<any[]> | null] | readonly [{
9
- clearIcon: string | number | boolean | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
10
- [key: string]: any;
11
- }> | import("vue").ComponentOptions<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, any, any, any, string, {}, {}, string, {}, {}, {}, string, import("vue").ComponentProvideOptions> | import("vue").FunctionalComponent<any, {}, any, {}> | {
9
+ clearIcon: string | number | boolean | import("vue").ComponentOptions<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, any, any, any, string, {}, {}, string, {}, {}, {}, string, import("vue").ComponentProvideOptions> | import("vue").FunctionalComponent<any, {}, any, {}> | {
12
10
  new (...args: any[]): any;
13
11
  __isFragment?: never;
14
12
  __isTeleport?: never;
15
13
  __isSuspense?: never;
16
- } | RenderNodeFn<any[]> | (string | number | boolean | void | import("vue").Component | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
14
+ } | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
15
+ [key: string]: any;
16
+ }> | RenderNodeFn<any[]> | (string | number | boolean | void | import("vue").Component | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
17
17
  [key: string]: any;
18
18
  }> | null | undefined)[] | null | undefined;
19
19
  }, string | number | boolean | import("vue/jsx-runtime").JSX.Element | RenderNodeFn<any[]> | null];
@@ -8,22 +8,22 @@ declare function useItems(screens: Ref<ScreenMap>, items: Ref<DescriptionsItemTy
8
8
  filled: boolean;
9
9
  _$index: number;
10
10
  key?: import("@v-c/util/dist/type").Key;
11
- classes?: CellSemanticClassNames | undefined;
12
11
  styles?: CellSemanticStyles | undefined;
13
12
  style?: import("vue").CSSProperties | undefined;
14
- rootClass?: string | undefined;
15
- class?: string | undefined;
16
13
  label?: VueNode;
14
+ class?: string | undefined;
15
+ classes?: CellSemanticClassNames | undefined;
16
+ rootClass?: string | undefined;
17
17
  content?: VueNode;
18
18
  } | {
19
19
  span: number | undefined;
20
20
  key?: import("@v-c/util/dist/type").Key;
21
- classes?: CellSemanticClassNames | undefined;
22
21
  styles?: CellSemanticStyles | undefined;
23
22
  style?: import("vue").CSSProperties | undefined;
24
- rootClass?: string | undefined;
25
- class?: string | undefined;
26
23
  label?: VueNode;
24
+ class?: string | undefined;
25
+ classes?: CellSemanticClassNames | undefined;
26
+ rootClass?: string | undefined;
27
27
  content?: VueNode;
28
28
  _$index: number;
29
29
  })[]>;
@@ -5,6 +5,7 @@ import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.
5
5
  import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
6
6
  import InternalTooltip from "../tooltip/index.js";
7
7
  import button_default from "../button/index.js";
8
+ import { isRenderable } from "../_util/is.js";
8
9
  import Badge from "../badge/index.js";
9
10
  import { useGroupContext } from "./context.js";
10
11
  import convertToTooltipProps from "../_util/convertToTooltipProps.js";
@@ -52,7 +53,7 @@ const FloatButton = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit
52
53
  if (slotContent.length) contentNodes = slotContent;
53
54
  else if (props.content !== void 0) contentNodes = props.content;
54
55
  else if (props.description !== void 0) contentNodes = props.description;
55
- const hasContent = Array.isArray(contentNodes) ? contentNodes.length > 0 : contentNodes !== null && contentNodes !== void 0 && contentNodes !== false;
56
+ const hasContent = Array.isArray(contentNodes) ? contentNodes.length > 0 : isRenderable(contentNodes);
56
57
  const mergedIcon = getSlotPropsFnRun(slots, props, "icon") ?? props.icon ?? (!hasContent ? createVNode(FileTextOutlined, null, null) : null);
57
58
  const tooltipSlotNodes = filterEmpty(slots.tooltip?.() ?? []);
58
59
  const tooltipNode = tooltipSlotNodes.length ? tooltipSlotNodes.length === 1 ? tooltipSlotNodes[0] : tooltipSlotNodes : void 0;
@@ -4,7 +4,7 @@ import { unit } from "@antdv-next/cssinjs";
4
4
  const genFloatButtonStyle = (token) => {
5
5
  const { componentCls, floatButtonSize, iconCls, antCls, floatButtonIconSize } = token;
6
6
  const [varName, varRef] = genCssVar(antCls, "float-btn");
7
- const [buttonVarName, buttonVarRef] = genCssVar(antCls, "btn");
7
+ const [, buttonVarRef] = genCssVar(antCls, "btn");
8
8
  const getProgressBackground = (backgroundColor) => [`linear-gradient(${backgroundColor}, ${backgroundColor})`, `conic-gradient(${token.colorPrimary} ${varRef("progress", "0turn")}, ${token.colorBorderSecondary} 0)`].join(", ");
9
9
  const badgeCls = `${componentCls}-badge`;
10
10
  const R = Math.SQRT2;
@@ -35,20 +35,26 @@ const genFloatButtonStyle = (token) => {
35
35
  },
36
36
  "&:empty": { display: "none" },
37
37
  [`${componentCls}-icon`]: { lineHeight: 1 },
38
- [`&${componentCls}-progress`]: {
39
- [buttonVarName("border-width")]: unit(token.lineWidthBold),
40
- [buttonVarName("border-color")]: "transparent",
41
- [buttonVarName("border-color-hover")]: "transparent",
42
- [buttonVarName("border-color-active")]: "transparent",
43
- [buttonVarName("border-color-disabled")]: "transparent",
38
+ [`&${antCls}-btn${componentCls}-progress`]: {
39
+ borderWidth: unit(token.lineWidthBold),
40
+ borderColor: "transparent",
44
41
  backgroundImage: getProgressBackground(buttonVarRef("bg-color")),
45
42
  backgroundOrigin: "border-box",
46
43
  backgroundClip: "padding-box, border-box",
47
44
  [`&:not(:disabled):not(${antCls}-btn-disabled)`]: {
48
- "&:hover": { backgroundImage: getProgressBackground(buttonVarRef("bg-color-hover")) },
49
- "&:active": { backgroundImage: getProgressBackground(buttonVarRef("bg-color-active")) }
45
+ "&:hover": {
46
+ borderColor: "transparent",
47
+ backgroundImage: getProgressBackground(buttonVarRef("bg-color-hover"))
48
+ },
49
+ "&:active": {
50
+ borderColor: "transparent",
51
+ backgroundImage: getProgressBackground(buttonVarRef("bg-color-active"))
52
+ }
50
53
  },
51
- [`&:disabled, &${antCls}-btn-disabled`]: { backgroundImage: getProgressBackground(buttonVarRef("bg-color-disabled")) }
54
+ [`&:disabled, &${antCls}-btn-disabled`]: {
55
+ borderColor: "transparent",
56
+ backgroundImage: getProgressBackground(buttonVarRef("bg-color-disabled"))
57
+ }
52
58
  },
53
59
  [`&${componentCls}-icon-only`]: { [iconCls]: { fontSize: floatButtonIconSize } },
54
60
  [`${componentCls}-content`]: { fontSize: token.fontSizeSM },
@@ -28,7 +28,7 @@ const ItemHolder = /* @__PURE__ */ defineComponent((props, { attrs, slots }) =>
28
28
  }
29
29
  }, { immediate: true });
30
30
  const onErrorVisibleChanged = (visible) => {
31
- if (!visible) marginBottom.value = null;
31
+ if (!visible && !hasError.value) marginBottom.value = null;
32
32
  };
33
33
  function getValidateState(isDebounce = false) {
34
34
  return getStatus(isDebounce ? props?.errors : props?.meta?.errors, isDebounce ? props?.warnings : props?.meta?.warnings, props?.meta, "", !!props?.hasFeedback, props?.validateStatus);
@@ -1,7 +1,6 @@
1
1
  import { useComponentBaseConfig } from "../../config-provider/context.js";
2
2
  import { getSlotPropsFnRun } from "../../_util/tools.js";
3
3
  import useCSSVarCls from "../../config-provider/hooks/useCSSVarCls.js";
4
- import { checkRenderNode } from "../../_util/vueNode.js";
5
4
  import { useFormContext, useFormItemProvider, useNoStyleItemContext } from "../context.js";
6
5
  import { getFieldId, initialValueFormat, toArray, toNamePathStr } from "../util.js";
7
6
  import { useFormInstance } from "../hooks/useForm.js";
@@ -302,11 +301,11 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
302
301
  triggerFocus: onFieldFocus
303
302
  });
304
303
  return () => {
305
- return renderLayout(checkRenderNode(filterEmpty(slots.default?.() ?? [])), fieldId.value, isRequired.value);
304
+ return renderLayout(filterEmpty(slots.default?.() ?? []), fieldId.value, isRequired.value);
306
305
  };
307
306
  function renderLayout(baseChildren, currentFieldId, isRequiredMark) {
308
- if (Array.isArray(baseChildren) && baseChildren.length === 1 && isVNode(baseChildren[0]) || isVNode(baseChildren)) {
309
- const child = isVNode(baseChildren) ? baseChildren : baseChildren[0];
307
+ if (Array.isArray(baseChildren) && baseChildren.length === 1 && isVNode(baseChildren[0])) {
308
+ const child = baseChildren[0];
310
309
  const childProps = child.props || {};
311
310
  const _onBlur = childProps.onBlur;
312
311
  const _onFocus = childProps.onFocus;
@@ -341,7 +340,7 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
341
340
  }
342
341
  if (itemErrors.length > 0) newChildProps["aria-invalid"] = "true";
343
342
  if (props.required ?? isRequiredMark) newChildProps["aria-required"] = "true";
344
- baseChildren = createVNode(child, newChildProps);
343
+ baseChildren = [createVNode(child, newChildProps)];
345
344
  }
346
345
  if (props.noStyle && !props.hidden) return createVNode(StatusProvider, {
347
346
  "prefixCls": prefixCls.value,
@@ -2,6 +2,7 @@ import { getSlotPropsFnRun } from "../_util/tools.js";
2
2
  import InternalTooltip from "../tooltip/index.js";
3
3
  import localeValues from "../locale/en_US.js";
4
4
  import useLocale from "../locale/useLocale.js";
5
+ import { isRenderable } from "../_util/is.js";
5
6
  import { useFormContext } from "./context.js";
6
7
  import Col from "../grid/col.js";
7
8
  import convertToTooltipProps from "../_util/convertToTooltipProps.js";
@@ -17,7 +18,7 @@ const FormItemLabel = /* @__PURE__ */ defineComponent((props, { slots }) => {
17
18
  const { labelCol, labelAlign, prefixCls, required, colon, vertical, tooltip, requiredMark, htmlFor } = props;
18
19
  const { labelAlign: contextLabelAlign, labelCol: contextLabelCol, labelWrap, colon: contextColon, classes: contextClassNames, styles: contextStyles, tooltip: contextTooltip } = formContext.value;
19
20
  const label = getSlotPropsFnRun(slots, props, "label");
20
- if (!label) return null;
21
+ if (!isRenderable(label)) return null;
21
22
  const mergedLabelCol = labelCol || contextLabelCol || {};
22
23
  const mergedLabelAlign = labelAlign || contextLabelAlign;
23
24
  const labelClsBasic = `${prefixCls}-item-label`;
@@ -71,7 +71,7 @@ declare function useFormItemPrefixContext(): Ref<{
71
71
  prefixCls: string;
72
72
  }>;
73
73
  declare function useVariantContextProvider(variant: Ref<Variant | undefined>): void;
74
- declare function useVariantContext(): Ref<"outlined" | "filled" | "borderless" | "underlined" | undefined, "outlined" | "filled" | "borderless" | "underlined" | undefined>;
74
+ declare function useVariantContext(): Ref<"filled" | "outlined" | "borderless" | "underlined" | undefined, "filled" | "outlined" | "borderless" | "underlined" | undefined>;
75
75
  interface FormItemStatusContextProps {
76
76
  isFormItemInput?: boolean;
77
77
  status?: ValidateStatus;
@@ -3,7 +3,7 @@ import { Variant } from "../../config-provider/context.js";
3
3
  import { Ref } from "vue";
4
4
  //#region src/form/hooks/useVariant.d.ts
5
5
  type VariantComponents = keyof Pick<ConfigProviderProps, 'input' | 'inputPassword' | 'inputSearch' | 'otp' | 'inputNumber' | 'textArea' | 'mentions' | 'select' | 'cascader' | 'treeSelect' | 'datePicker' | 'timePicker' | 'rangePicker' | 'card'>;
6
- declare function useVariant(component: VariantComponents, variant?: Ref<Variant | undefined>, legacyBordered?: Ref<boolean | undefined> | boolean, fallbackComponent?: VariantComponents): readonly [import("vue").ComputedRef<"outlined" | "filled" | "borderless" | "underlined">, import("vue").ComputedRef<boolean>, import("vue").ComputedRef<boolean>];
6
+ declare function useVariant(component: VariantComponents, variant?: Ref<Variant | undefined>, legacyBordered?: Ref<boolean | undefined> | boolean, fallbackComponent?: VariantComponents): readonly [import("vue").ComputedRef<"filled" | "outlined" | "borderless" | "underlined">, import("vue").ComputedRef<boolean>, import("vue").ComputedRef<boolean>];
7
7
  declare const useVariants: typeof useVariant;
8
8
  //#endregion
9
9
  export { useVariant as default, useVariants };
@@ -194,9 +194,8 @@ const genFormItemStyle = (token) => {
194
194
  }
195
195
  } };
196
196
  };
197
- const makeVerticalLayoutLabel = (token) => ({
197
+ const makeVerticalLayoutLabelBase = (token) => ({
198
198
  padding: token.verticalLabelPadding,
199
- margin: token.verticalLabelMargin,
200
199
  whiteSpace: "initial",
201
200
  textAlign: "start",
202
201
  "> label": {
@@ -204,6 +203,17 @@ const makeVerticalLayoutLabel = (token) => ({
204
203
  "&::after": { visibility: "hidden" }
205
204
  }
206
205
  });
206
+ const makeVerticalLayoutLabel = (token) => ({
207
+ ...makeVerticalLayoutLabelBase(token),
208
+ margin: token.verticalLabelMargin
209
+ });
210
+ const makeVerticalLayoutLabelWithOffset = (token) => {
211
+ const [formVarName] = genCssVar(token.antCls, "form");
212
+ return {
213
+ ...makeVerticalLayoutLabelBase(token),
214
+ [formVarName("item-label-margin")]: token.verticalLabelMargin
215
+ };
216
+ };
207
217
  const genHorizontalStyle = (token) => {
208
218
  const { antCls, formItemCls } = token;
209
219
  return { [`${formItemCls}-horizontal`]: {
@@ -213,8 +223,8 @@ const genHorizontalStyle = (token) => {
213
223
  minWidth: 0
214
224
  },
215
225
  [`${formItemCls}-label[class$='-24'], ${formItemCls}-label[class*='-24 ']`]: { [`& + ${formItemCls}-control`]: { minWidth: "unset" } },
216
- [`${antCls}-col-24${formItemCls}-label,
217
- ${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
226
+ [`> ${formItemCls}-row > ${antCls}-col-24${formItemCls}-label,
227
+ > ${formItemCls}-row > ${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
218
228
  } };
219
229
  };
220
230
  const genInlineStyle = (token) => {
@@ -241,7 +251,7 @@ const genInlineStyle = (token) => {
241
251
  const makeVerticalLayout = (token) => {
242
252
  const { componentCls, formItemCls, rootPrefixCls } = token;
243
253
  return {
244
- [`${formItemCls} ${formItemCls}-label`]: makeVerticalLayoutLabel(token),
254
+ [`${formItemCls}:not(${formItemCls}-vertical) > ${formItemCls}-row > ${formItemCls}-label`]: makeVerticalLayoutLabel(token),
245
255
  [`${componentCls}:not(${componentCls}-inline)`]: { [formItemCls]: {
246
256
  flexWrap: "wrap",
247
257
  [`${formItemCls}-label, ${formItemCls}-control`]: { [`&:not([class*=" ${rootPrefixCls}-col-xs"])`]: {
@@ -253,19 +263,22 @@ const makeVerticalLayout = (token) => {
253
263
  };
254
264
  const genVerticalStyle = (token) => {
255
265
  const { componentCls, formItemCls, antCls, verticalLabelHeight } = token;
266
+ const [formVarName, formVarRef] = genCssVar(antCls, "form");
256
267
  return {
268
+ [formItemCls]: { [formVarName("item-label-margin")]: "initial" },
269
+ [`${formItemCls}-label`]: { margin: formVarRef("item-label-margin") },
257
270
  [`${formItemCls}-vertical`]: {
258
271
  [`${formItemCls}-row`]: { flexDirection: "column" },
259
272
  [`${formItemCls}-label > label`]: { height: verticalLabelHeight },
260
273
  [`${formItemCls}-control`]: { width: "100%" },
261
- [`${formItemCls}-label,
262
- ${antCls}-col-24${formItemCls}-label,
263
- ${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
274
+ [`> ${formItemCls}-row > ${formItemCls}-label,
275
+ > ${formItemCls}-row > ${antCls}-col-24${formItemCls}-label,
276
+ > ${formItemCls}-row > ${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabelWithOffset(token)
264
277
  },
265
- [`@media (max-width: ${unit(token.screenXSMax)})`]: [makeVerticalLayout(token), { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal)`]: { [`${antCls}-col-xs-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } }],
266
- [`@media (max-width: ${unit(token.screenSMMax)})`]: { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal)`]: { [`${antCls}-col-sm-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } },
267
- [`@media (max-width: ${unit(token.screenMDMax)})`]: { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal)`]: { [`${antCls}-col-md-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } },
268
- [`@media (max-width: ${unit(token.screenLGMax)})`]: { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal)`]: { [`${antCls}-col-lg-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } }
278
+ [`@media (max-width: ${unit(token.screenXSMax)})`]: [makeVerticalLayout(token), { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal):not(${formItemCls}-vertical)`]: { [`> ${formItemCls}-row > ${antCls}-col-xs-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } }],
279
+ [`@media (max-width: ${unit(token.screenSMMax)})`]: { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal):not(${formItemCls}-vertical)`]: { [`> ${formItemCls}-row > ${antCls}-col-sm-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } },
280
+ [`@media (max-width: ${unit(token.screenMDMax)})`]: { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal):not(${formItemCls}-vertical)`]: { [`> ${formItemCls}-row > ${antCls}-col-md-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } },
281
+ [`@media (max-width: ${unit(token.screenLGMax)})`]: { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal):not(${formItemCls}-vertical)`]: { [`> ${formItemCls}-row > ${antCls}-col-lg-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } }
269
282
  };
270
283
  };
271
284
  const prepareComponentToken = (token) => ({