antdv-next 1.8.2 → 1.8.4

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 (137) hide show
  1. package/dist/_util/hooks/index.d.ts +2 -1
  2. package/dist/_util/hooks/index.js +2 -1
  3. package/dist/_util/hooks/useClosable.d.ts +3 -3
  4. package/dist/_util/hooks/useClosable.js +9 -9
  5. package/dist/_util/hooks/useScopeId.d.ts +7 -0
  6. package/dist/_util/hooks/useScopeId.js +15 -0
  7. package/dist/_util/scrollTo.js +1 -1
  8. package/dist/_util/statusUtils.js +1 -1
  9. package/dist/_util/vueNode.d.ts +2 -6
  10. package/dist/affix/index.js +2 -7
  11. package/dist/anchor/Anchor.js +4 -2
  12. package/dist/antd-with-locales.esm.js +17314 -16799
  13. package/dist/antd-with-locales.js +81 -81
  14. package/dist/antd.css +1 -1
  15. package/dist/antd.esm.js +14978 -14467
  16. package/dist/antd.js +81 -81
  17. package/dist/badge/SingleNumber.js +11 -2
  18. package/dist/badge/index.d.ts +4 -1
  19. package/dist/badge/index.js +4 -4
  20. package/dist/button/buttonHelper.d.ts +1 -1
  21. package/dist/button/style/index.js +8 -2
  22. package/dist/calendar/generateCalendar.d.ts +5 -4
  23. package/dist/calendar/generateCalendar.js +4 -7
  24. package/dist/card/Card.d.ts +4 -1
  25. package/dist/card/Card.js +24 -18
  26. package/dist/card/index.d.ts +2 -2
  27. package/dist/cascader/index.d.ts +5 -2
  28. package/dist/cascader/index.js +10 -7
  29. package/dist/checkbox/Checkbox.js +3 -0
  30. package/dist/checkbox/Group.d.ts +2 -1
  31. package/dist/checkbox/Group.js +3 -7
  32. package/dist/color-picker/ColorPicker.js +4 -0
  33. package/dist/color-picker/ColorPickerPanel.js +4 -0
  34. package/dist/color-picker/components/ColorSlider.js +12 -4
  35. package/dist/color-picker/components/PanelPicker/GradientColorBar.js +2 -0
  36. package/dist/components.d.ts +13 -9
  37. package/dist/components.js +3 -3
  38. package/dist/config-provider/context.d.ts +3 -3
  39. package/dist/config-provider/context.js +3 -3
  40. package/dist/date-picker/generatePicker/generateRangePicker.js +4 -5
  41. package/dist/date-picker/generatePicker/generateSinglePicker.js +4 -6
  42. package/dist/descriptions/hooks/useItems.d.ts +6 -6
  43. package/dist/descriptions/hooks/useRow.js +1 -1
  44. package/dist/float-button/FloatButtonGroup.js +3 -1
  45. package/dist/float-button/style/button.js +2 -2
  46. package/dist/form/Form.d.ts +17 -44
  47. package/dist/form/Form.js +54 -5
  48. package/dist/form/FormItem/ItemHolder.js +1 -1
  49. package/dist/form/FormItem/index.d.ts +3 -3
  50. package/dist/form/FormItem/index.js +4 -0
  51. package/dist/form/context.d.ts +3 -3
  52. package/dist/form/hooks/useForm.d.ts +4 -5
  53. package/dist/form/index.d.ts +29 -3
  54. package/dist/form/index.js +6 -6
  55. package/dist/form/types.d.ts +15 -7
  56. package/dist/image/hooks/usePreviewConfig.d.ts +6 -6
  57. package/dist/image/index.d.ts +5 -5
  58. package/dist/index.d.ts +15 -8
  59. package/dist/index.js +2 -2
  60. package/dist/input/Group.d.ts +3 -2
  61. package/dist/input/Group.js +23 -19
  62. package/dist/input/Input.d.ts +8 -1
  63. package/dist/input/Input.js +4 -0
  64. package/dist/input/OTP/OTPInput.js +4 -0
  65. package/dist/input/Password.js +4 -0
  66. package/dist/input/Search.js +4 -0
  67. package/dist/input/TextArea.d.ts +2 -0
  68. package/dist/input/TextArea.js +8 -0
  69. package/dist/input/index.d.ts +2 -2
  70. package/dist/input-number/style/index.js +3 -2
  71. package/dist/layout/layout.js +2 -3
  72. package/dist/listy/index.js +4 -3
  73. package/dist/locale/ko_KR.js +25 -23
  74. package/dist/locale/pt_BR.js +9 -7
  75. package/dist/mentions/index.js +10 -1
  76. package/dist/menu/MenuItem.js +1 -1
  77. package/dist/menu/index.d.ts +2 -1
  78. package/dist/menu/index.js +29 -5
  79. package/dist/menu/menu.js +41 -15
  80. package/dist/message/index.js +11 -9
  81. package/dist/modal/confirm.js +2 -3
  82. package/dist/modal/index.d.ts +2 -2
  83. package/dist/modal/interface.d.ts +1 -1
  84. package/dist/modal/useModal/index.js +9 -4
  85. package/dist/notification/index.js +3 -7
  86. package/dist/package.js +1 -1
  87. package/dist/package.json.d.ts +1 -0
  88. package/dist/pagination/Pagination.js +3 -1
  89. package/dist/radio/group.d.ts +1 -0
  90. package/dist/radio/group.js +2 -5
  91. package/dist/radio/interface.d.ts +1 -1
  92. package/dist/segmented/style/index.js +3 -2
  93. package/dist/select/index.d.ts +1 -0
  94. package/dist/select/index.js +3 -7
  95. package/dist/select/useIcons.d.ts +3 -1
  96. package/dist/select/useIcons.js +5 -2
  97. package/dist/skeleton/style/index.js +9 -13
  98. package/dist/slider/SliderTooltip.js +0 -1
  99. package/dist/slider/index.d.ts +2 -0
  100. package/dist/slider/index.js +4 -0
  101. package/dist/splitter/Splitter.d.ts +2 -3
  102. package/dist/splitter/Splitter.js +18 -34
  103. package/dist/splitter/interface.d.ts +17 -8
  104. package/dist/statistic/Timer.d.ts +2 -2
  105. package/dist/steps/index.js +2 -1
  106. package/dist/table/hooks/useFilter/FilterDropdown.js +1 -1
  107. package/dist/table/hooks/usePagination.d.ts +1 -2
  108. package/dist/table/hooks/usePagination.js +1 -3
  109. package/dist/table/hooks/useSorter.js +4 -8
  110. package/dist/table/style/index.js +1 -0
  111. package/dist/table/style/size.js +1 -0
  112. package/dist/tabs/style/index.js +5 -1
  113. package/dist/tag/hooks/useColor.d.ts +1 -1
  114. package/dist/theme/themes/dark/colors.d.ts +2 -1
  115. package/dist/theme/themes/dark/colors.js +19 -3
  116. package/dist/theme/themes/dark/index.js +2 -3
  117. package/dist/tour/index.js +4 -1
  118. package/dist/tour/style/index.js +6 -6
  119. package/dist/transfer/ListItem.js +1 -0
  120. package/dist/transfer/Section.js +1 -0
  121. package/dist/transfer/hooks/useSelection.js +2 -1
  122. package/dist/tree/DirectoryTree.js +11 -6
  123. package/dist/tree/utils/dictUtil.js +5 -8
  124. package/dist/typography/Base/EllipsisTooltip.js +5 -1
  125. package/dist/typography/Base/index.js +11 -8
  126. package/dist/typography/Base/util.js +2 -1
  127. package/dist/upload/Dragger.js +0 -8
  128. package/dist/upload/Upload.d.ts +2 -0
  129. package/dist/upload/Upload.js +23 -22
  130. package/dist/upload/UploadList/ListItem.js +4 -0
  131. package/dist/upload/UploadList/index.js +6 -1
  132. package/dist/upload/interface.d.ts +4 -2
  133. package/dist/version/token.json +1 -1
  134. package/dist/watermark/utils.js +1 -1
  135. package/package.json +44 -43
  136. package/web-tags.json +22 -14
  137. package/web-types.json +64 -31
@@ -2,5 +2,6 @@ import { MaskConfig, MaskType, normalizeMaskConfig, useMergedMask } from "./useM
2
2
  import { Resolvable, SemanticClassNames, SemanticClassNamesType, SemanticSchema, SemanticStyles, SemanticStylesType, SemanticType, getAttrStyleAndClass, mergeClassNames, mergeStyles, pureAttrs, resolveStyleOrClass, useMergeSemantic, useMergeSemanticNoRef, useSemanticRootStyle, useToArr, useToProps } from "./useMergeSemantic.js";
3
3
  import { PrevSelectedIndex, useMultipleSelect } from "./useMultipleSelect.js";
4
4
  import { Orientation, useOrientation } from "./useOrientation.js";
5
+ import { useScopeIdAttrs, useScopeIdOnElement } from "./useScopeId.js";
5
6
  import { CONTAINER_MAX_OFFSET, ZIndexConsumer, ZIndexContainer, consumerBaseZIndexOffset, containerBaseZIndexOffset, useZIndex } from "./useZIndex.js";
6
- export { CONTAINER_MAX_OFFSET, MaskConfig, MaskType, Orientation, PrevSelectedIndex, Resolvable, SemanticClassNames, SemanticClassNamesType, SemanticSchema, SemanticStyles, SemanticStylesType, SemanticType, ZIndexConsumer, ZIndexContainer, consumerBaseZIndexOffset, containerBaseZIndexOffset, getAttrStyleAndClass, mergeClassNames, mergeStyles, normalizeMaskConfig, pureAttrs, resolveStyleOrClass, useMergeSemantic, useMergeSemanticNoRef, useMergedMask, useMultipleSelect, useOrientation, useSemanticRootStyle, useToArr, useToProps, useZIndex };
7
+ export { CONTAINER_MAX_OFFSET, MaskConfig, MaskType, Orientation, PrevSelectedIndex, Resolvable, SemanticClassNames, SemanticClassNamesType, SemanticSchema, SemanticStyles, SemanticStylesType, SemanticType, ZIndexConsumer, ZIndexContainer, consumerBaseZIndexOffset, containerBaseZIndexOffset, getAttrStyleAndClass, mergeClassNames, mergeStyles, normalizeMaskConfig, pureAttrs, resolveStyleOrClass, useMergeSemantic, useMergeSemanticNoRef, useMergedMask, useMultipleSelect, useOrientation, useScopeIdAttrs, useScopeIdOnElement, useSemanticRootStyle, useToArr, useToProps, useZIndex };
@@ -2,5 +2,6 @@ import { normalizeMaskConfig, useMergedMask } from "./useMergedMask.js";
2
2
  import { getAttrStyleAndClass, mergeClassNames, mergeStyles, pureAttrs, resolveStyleOrClass, useMergeSemantic, useMergeSemanticNoRef, useSemanticRootStyle, useToArr, useToProps } from "./useMergeSemantic.js";
3
3
  import { useMultipleSelect } from "./useMultipleSelect.js";
4
4
  import { useOrientation } from "./useOrientation.js";
5
+ import { useScopeIdAttrs, useScopeIdOnElement } from "./useScopeId.js";
5
6
  import { CONTAINER_MAX_OFFSET, consumerBaseZIndexOffset, containerBaseZIndexOffset, useZIndex } from "./useZIndex.js";
6
- export { CONTAINER_MAX_OFFSET, consumerBaseZIndexOffset, containerBaseZIndexOffset, getAttrStyleAndClass, mergeClassNames, mergeStyles, normalizeMaskConfig, pureAttrs, resolveStyleOrClass, useMergeSemantic, useMergeSemanticNoRef, useMergedMask, useMultipleSelect, useOrientation, useSemanticRootStyle, useToArr, useToProps, useZIndex };
7
+ export { CONTAINER_MAX_OFFSET, consumerBaseZIndexOffset, containerBaseZIndexOffset, getAttrStyleAndClass, mergeClassNames, mergeStyles, normalizeMaskConfig, pureAttrs, resolveStyleOrClass, useMergeSemantic, useMergeSemanticNoRef, useMergedMask, useMultipleSelect, useOrientation, useScopeIdAttrs, useScopeIdOnElement, useSemanticRootStyle, useToArr, useToProps, useZIndex };
@@ -34,11 +34,11 @@ interface UseClosableParams {
34
34
  customCloseIconRender?: (closeIcon: VNodeChild) => VNodeChild;
35
35
  context?: ContextClosable;
36
36
  }
37
- declare function useClosable(propCloseCollection?: Ref<ClosableCollection>, contextCloseCollection?: Ref<ClosableCollection | null>, fallbackCloseCollection?: Ref<FallbackCloseCollection>): import("vue").ComputedRef<({} | null)[] | readonly [true, import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
37
+ declare function useClosable(propCloseCollection?: Ref<ClosableCollection>, contextCloseCollection?: Ref<ClosableCollection | null>, fallbackCloseCollection?: Ref<FallbackCloseCollection>): import("vue").ComputedRef<({} | null)[] | readonly [true, void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
38
38
  [key: string]: any;
39
- }>, boolean, {
39
+ }> | null | undefined, boolean, {
40
40
  readonly 'aria-label': any;
41
- }] | undefined>;
41
+ }]>;
42
42
  declare function computeClosable(propCloseCollection?: Ref<ClosableCollection>, contextCloseCollection?: Ref<ClosableCollection | null>, fallbackCloseCollection?: Ref<FallbackCloseCollection>, closeLabel?: string): [closable: boolean, closeIcon: VueNode, closeBtnIsDisabled: boolean, ariaOrDataProps: AriaAttributes & DataAttributes];
43
43
  //#endregion
44
44
  export { BaseContextClosable, ClosableType, ContextClosable, UseClosableParams, computeClosable, useClosable as default, pickClosable };
@@ -78,16 +78,16 @@ function useClosable(propCloseCollection, contextCloseCollection, fallbackCloseC
78
78
  "aria-label": mergedCloseIcon.props?.["aria-label"] ?? contextLocale?.value?.close,
79
79
  ...ariaOrDataProps
80
80
  }) : createVNode("span", mergeProps({ "aria-label": contextLocale?.value?.close }, ariaOrDataProps), [mergedCloseIcon]);
81
- return [
82
- true,
83
- mergedCloseIcon,
84
- closeBtnIsDisabled.value,
85
- {
86
- "aria-label": contextLocale?.value?.close ?? localeValues.global?.close,
87
- ...ariaOrDataProps
88
- }
89
- ];
90
81
  }
82
+ return [
83
+ true,
84
+ mergedCloseIcon,
85
+ closeBtnIsDisabled.value,
86
+ {
87
+ "aria-label": contextLocale?.value?.close ?? localeValues.global?.close,
88
+ ...ariaOrDataProps
89
+ }
90
+ ];
91
91
  });
92
92
  }
93
93
  function computeClosableConfig(closable, closeIcon) {
@@ -0,0 +1,7 @@
1
+ import { MaybeRefOrGetter, Ref } from "vue";
2
+ import { useScopeIdAttrs } from "@v-c/util";
3
+ //#region src/_util/hooks/useScopeId.d.ts
4
+ type ScopeElement = HTMLElement | Ref<HTMLElement | undefined> | undefined;
5
+ declare function useScopeIdOnElement(elementRef: MaybeRefOrGetter<ScopeElement>): void;
6
+ //#endregion
7
+ export { useScopeIdAttrs, useScopeIdOnElement };
@@ -0,0 +1,15 @@
1
+ import { onMounted, onUpdated, toValue, unref } from "vue";
2
+ import { useScopeIdAttrs } from "@v-c/util";
3
+ //#region src/_util/hooks/useScopeId.ts
4
+ function useScopeIdOnElement(elementRef) {
5
+ const scopeIdAttrs = useScopeIdAttrs();
6
+ const applyScopeId = () => {
7
+ const element = unref(toValue(elementRef));
8
+ if (!element) return;
9
+ Object.entries(scopeIdAttrs).forEach(([key, value]) => element.setAttribute(key, value));
10
+ };
11
+ onMounted(applyScopeId);
12
+ onUpdated(applyScopeId);
13
+ }
14
+ //#endregion
15
+ export { useScopeIdAttrs, useScopeIdOnElement };
@@ -7,7 +7,7 @@ function scrollTo(y, options = {}) {
7
7
  const container = getContainer();
8
8
  const scrollTop = getScroll(container);
9
9
  const scroll = (top) => {
10
- if (isWindow(container)) container.scrollTo(window.pageXOffset, top);
10
+ if (isWindow(container)) container.scrollTo(container.pageXOffset, top);
11
11
  else if (isDocument(container)) container.documentElement.scrollTop = top;
12
12
  else container.scrollTop = top;
13
13
  };
@@ -10,7 +10,7 @@ function getStatusClassNames(prefixCls, status, hasFeedback) {
10
10
  });
11
11
  }
12
12
  function getMergedStatus(contextStatus, customStatus) {
13
- return customStatus || contextStatus;
13
+ return customStatus ?? contextStatus;
14
14
  }
15
15
  //#endregion
16
16
  export { getMergedStatus, getStatusClassNames };
@@ -3,12 +3,8 @@ import { VNodeChild } from "vue";
3
3
  import { isFragment } from "@v-c/util/dist/Children/isFragment";
4
4
  //#region src/_util/vueNode.d.ts
5
5
  type RenderProps = AnyObject | ((originProps: AnyObject) => AnyObject | undefined);
6
- declare function replaceElement(element: VNodeChild, replacement: VNodeChild, props?: RenderProps): string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
7
- [key: string]: any;
8
- }> | import("vue").VNodeArrayChildren | null;
9
- declare function cloneElement(element: VNodeChild, props?: RenderProps): string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
10
- [key: string]: any;
11
- }> | import("vue").VNodeArrayChildren | null;
6
+ declare function replaceElement(element: VNodeChild, replacement: VNodeChild, props?: RenderProps): VNodeChild;
7
+ declare function cloneElement(element: VNodeChild, props?: RenderProps): VNodeChild;
12
8
  /**
13
9
  * 当传入值是 VNode 时返回一个全新的克隆,数组会逐项处理,其余值原样返回。
14
10
  *
@@ -20,15 +20,12 @@ const TRIGGER_EVENTS = [
20
20
  function getDefaultTarget() {
21
21
  return typeof window !== "undefined" ? window : null;
22
22
  }
23
- const AFFIX_STATUS_NONE = 0;
24
- const AFFIX_STATUS_PREPARE = 1;
25
23
  const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, emit }) => {
26
24
  const configContext = useConfig();
27
25
  const { prefixCls: affixPrefixCls, class: contextClassName, style: contextStyle } = useComponentBaseConfig("affix", props);
28
26
  const lastAffix = shallowRef(false);
29
27
  const affixStyle = shallowRef();
30
28
  const placeholderStyle = shallowRef();
31
- const status = shallowRef(AFFIX_STATUS_NONE);
32
29
  let prevTarget = null;
33
30
  let prevListener = null;
34
31
  const placeholderNodeRef = shallowRef();
@@ -42,10 +39,10 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
42
39
  return offsetBottom === void 0 && offsetTop === void 0 ? 0 : offsetTop;
43
40
  });
44
41
  const measure = () => {
45
- if (status.value !== AFFIX_STATUS_PREPARE || !fixedNodeRef.value || !placeholderNodeRef.value) return;
42
+ if (!fixedNodeRef.value || !placeholderNodeRef.value) return;
46
43
  const targetNode = targetFunc.value();
47
44
  if (targetNode) {
48
- const newState = { status: AFFIX_STATUS_NONE };
45
+ const newState = {};
49
46
  const placeholderRect = getTargetRect(placeholderNodeRef.value);
50
47
  const contentHeight = getTargetRect(contextRef.value || fixedNodeRef.value).height || placeholderRect.height;
51
48
  if (placeholderRect.top === 0 && placeholderRect.left === 0 && placeholderRect.width === 0 && placeholderRect.height === 0) return;
@@ -66,14 +63,12 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
66
63
  }
67
64
  newState.lastAffix = !!newState.affixStyle;
68
65
  if (lastAffix.value !== newState.lastAffix) emit("change", newState.lastAffix);
69
- status.value = newState.status;
70
66
  affixStyle.value = newState.affixStyle;
71
67
  placeholderStyle.value = newState.placeholderStyle;
72
68
  lastAffix.value = newState.lastAffix;
73
69
  }
74
70
  };
75
71
  const prepareMeasure = () => {
76
- status.value = AFFIX_STATUS_PREPARE;
77
72
  measure();
78
73
  };
79
74
  const updatePosition = throttleByAnimationFrame(() => {
@@ -1,4 +1,5 @@
1
1
  import { useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
2
+ import { useScopeIdAttrs } from "../_util/hooks/useScopeId.js";
2
3
  import { useComponentBaseConfig } from "../config-provider/context.js";
3
4
  import { clsx as clsx$1, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
4
5
  import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
@@ -48,6 +49,7 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
48
49
  });
49
50
  const rawActiveLink = shallowRef(activeLink.value);
50
51
  const wrapperRef = shallowRef();
52
+ const scopeIdAttrs = useScopeIdAttrs();
51
53
  const spanLinkNode = shallowRef();
52
54
  const animatingRef = shallowRef(false);
53
55
  const scrollRequestIdRef = shallowRef(null);
@@ -209,11 +211,11 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
209
211
  }), { default: () => [anchorDirection.value === "vertical" && createNestedLink(item.children)] });
210
212
  }) : null;
211
213
  };
212
- const anchorContent = createVNode("div", {
214
+ const anchorContent = createVNode("div", mergeProps(scopeIdAttrs, {
213
215
  "ref": wrapperRef,
214
216
  "class": wrapperClass,
215
217
  "style": wrapperStyle
216
- }, [createVNode("div", { "class": anchorClass }, [createVNode("span", {
218
+ }), [createVNode("div", { "class": anchorClass }, [createVNode("span", {
217
219
  "class": inkClass,
218
220
  "ref": spanLinkNode,
219
221
  "style": mergedStyles.value.indicator