antdv-next 1.5.4 → 1.5.6

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 (250) hide show
  1. package/dist/_util/PurePanel.js +2 -1
  2. package/dist/_util/hooks/useMergeSemantic.js +3 -2
  3. package/dist/_util/statusUtils.d.ts +1 -1
  4. package/dist/_util/styleUtils.d.ts +19 -1
  5. package/dist/_util/styleUtils.js +24 -1
  6. package/dist/_util/vnode/index.js +5 -5
  7. package/dist/_util/warning.d.ts +0 -1
  8. package/dist/affix/index.js +7 -18
  9. package/dist/alert/Alert.js +11 -12
  10. package/dist/anchor/Anchor.d.ts +1 -1
  11. package/dist/anchor/Anchor.js +16 -7
  12. package/dist/anchor/AnchorLink.js +3 -2
  13. package/dist/antd-with-locales.esm.js +17656 -16491
  14. package/dist/antd-with-locales.js +80 -80
  15. package/dist/antd.css +1 -1
  16. package/dist/antd.esm.js +15077 -14114
  17. package/dist/antd.js +81 -81
  18. package/dist/app/App.js +1 -1
  19. package/dist/app/index.js +0 -3
  20. package/dist/auto-complete/index.js +11 -4
  21. package/dist/avatar/Avatar.d.ts +4 -1
  22. package/dist/avatar/Avatar.js +21 -13
  23. package/dist/avatar/AvatarGroup.js +2 -2
  24. package/dist/avatar/index.d.ts +2 -2
  25. package/dist/badge/Ribbon.js +3 -4
  26. package/dist/badge/index.js +11 -9
  27. package/dist/breadcrumb/Breadcrumb.js +6 -3
  28. package/dist/breadcrumb/BreadcrumbItem.js +4 -3
  29. package/dist/breadcrumb/useItemRender.js +5 -8
  30. package/dist/button/Button.js +2 -0
  31. package/dist/card/Card.js +6 -7
  32. package/dist/carousel/index.d.ts +1 -1
  33. package/dist/carousel/index.js +7 -8
  34. package/dist/cascader/Panel.d.ts +1 -0
  35. package/dist/cascader/Panel.js +2 -1
  36. package/dist/cascader/index.d.ts +5 -4
  37. package/dist/cascader/index.js +8 -6
  38. package/dist/checkbox/Checkbox.js +14 -28
  39. package/dist/collapse/Collapse.d.ts +2 -3
  40. package/dist/collapse/Collapse.js +7 -4
  41. package/dist/color-picker/ColorPicker.js +2 -2
  42. package/dist/color-picker/components/ColorClear.d.ts +1 -0
  43. package/dist/color-picker/components/ColorClear.js +14 -4
  44. package/dist/color-picker/components/ColorPresets.js +4 -4
  45. package/dist/color-picker/components/ColorSlider.js +8 -2
  46. package/dist/color-picker/components/ColorTrigger.js +3 -2
  47. package/dist/color-picker/interface.d.ts +0 -2
  48. package/dist/color-picker/style/index.js +5 -6
  49. package/dist/components.d.ts +3 -3
  50. package/dist/config-provider/context.d.ts +2 -5
  51. package/dist/config-provider/index.d.ts +2 -2
  52. package/dist/date-picker/generatePicker/generateRangePicker.d.ts +4 -3
  53. package/dist/date-picker/generatePicker/generateRangePicker.js +3 -1
  54. package/dist/date-picker/generatePicker/generateSinglePicker.d.ts +1 -0
  55. package/dist/date-picker/generatePicker/generateSinglePicker.js +3 -1
  56. package/dist/date-picker/generatePicker/index.d.ts +1 -1
  57. package/dist/date-picker/generatePicker/interface.d.ts +0 -2
  58. package/dist/date-picker/generatePicker/useComponents.d.ts +3 -3
  59. package/dist/date-picker/index.d.ts +3 -2
  60. package/dist/date-picker/locale/bn_BD.js +1 -0
  61. package/dist/date-picker/locale/et_EE.js +8 -0
  62. package/dist/date-picker/locale/eu_ES.js +8 -0
  63. package/dist/date-picker/locale/ga_IE.js +1 -0
  64. package/dist/date-picker/locale/is_IS.js +8 -0
  65. package/dist/date-picker/locale/ka_GE.js +1 -0
  66. package/dist/date-picker/locale/kk_KZ.js +1 -0
  67. package/dist/date-picker/locale/km_KH.js +1 -0
  68. package/dist/date-picker/locale/kmr_IQ.js +8 -0
  69. package/dist/date-picker/locale/lv_LV.js +8 -0
  70. package/dist/date-picker/locale/mk_MK.js +8 -0
  71. package/dist/date-picker/locale/ml_IN.js +1 -0
  72. package/dist/date-picker/locale/mn_MN.js +8 -0
  73. package/dist/date-picker/locale/sl_SI.js +8 -0
  74. package/dist/date-picker/locale/ta_IN.js +1 -0
  75. package/dist/date-picker/locale/ur_PK.js +1 -0
  76. package/dist/date-picker/locale/uz_UZ.js +1 -0
  77. package/dist/date-picker/util.d.ts +2 -2
  78. package/dist/descriptions/Row.js +3 -2
  79. package/dist/descriptions/hooks/useItems.d.ts +8 -8
  80. package/dist/descriptions/index.js +6 -3
  81. package/dist/divider/index.d.ts +0 -1
  82. package/dist/drawer/DrawerPanel.js +4 -1
  83. package/dist/drawer/index.d.ts +0 -3
  84. package/dist/drawer/index.js +15 -3
  85. package/dist/dropdown/index.js +0 -3
  86. package/dist/float-button/BackTop.d.ts +4 -2
  87. package/dist/float-button/BackTop.js +12 -4
  88. package/dist/float-button/FloatButton.d.ts +2 -2
  89. package/dist/float-button/FloatButton.js +10 -3
  90. package/dist/float-button/FloatButtonGroup.d.ts +2 -2
  91. package/dist/float-button/FloatButtonGroup.js +10 -3
  92. package/dist/float-button/PurePanel.js +20 -8
  93. package/dist/form/FormItem/index.js +4 -3
  94. package/dist/form/FormItemInput.js +4 -2
  95. package/dist/grid/col.js +1 -1
  96. package/dist/grid/row.js +1 -1
  97. package/dist/image/PreviewGroup.js +7 -5
  98. package/dist/image/hooks/usePreviewConfig.d.ts +9 -9
  99. package/dist/image/hooks/usePreviewConfig.js +1 -1
  100. package/dist/image/index.js +3 -4
  101. package/dist/index.d.ts +3 -3
  102. package/dist/input/Input.d.ts +0 -1
  103. package/dist/input/Input.js +16 -4
  104. package/dist/input/OTP/OTPInput.js +16 -4
  105. package/dist/input/Password.js +12 -3
  106. package/dist/input/Search.js +16 -4
  107. package/dist/input/TextArea.d.ts +0 -1
  108. package/dist/input/TextArea.js +17 -2
  109. package/dist/input/style/index.d.ts +2 -1
  110. package/dist/input/style/index.js +12 -11
  111. package/dist/input/style/variants.js +1 -4
  112. package/dist/input-number/index.d.ts +0 -1
  113. package/dist/input-number/index.js +30 -9
  114. package/dist/input-number/style/index.js +13 -39
  115. package/dist/listy/index.js +13 -8
  116. package/dist/listy/interface.d.ts +2 -2
  117. package/dist/locale/az_AZ.js +4 -0
  118. package/dist/locale/bn_BD.js +4 -0
  119. package/dist/locale/by_BY.js +4 -0
  120. package/dist/locale/eu_ES.js +4 -0
  121. package/dist/locale/ga_IE.js +4 -0
  122. package/dist/locale/hy_AM.js +20 -2
  123. package/dist/locale/is_IS.js +4 -0
  124. package/dist/locale/ka_GE.js +4 -0
  125. package/dist/locale/kk_KZ.js +4 -0
  126. package/dist/locale/km_KH.js +4 -0
  127. package/dist/locale/kmr_IQ.js +4 -0
  128. package/dist/locale/kn_IN.js +4 -0
  129. package/dist/locale/ku_IQ.js +4 -0
  130. package/dist/locale/mk_MK.js +4 -0
  131. package/dist/locale/ml_IN.js +4 -0
  132. package/dist/locale/mn_MN.js +4 -0
  133. package/dist/locale/mr_IN.js +4 -0
  134. package/dist/locale/my_MM.js +4 -0
  135. package/dist/locale/ne_NP.js +4 -0
  136. package/dist/locale/si_LK.js +4 -0
  137. package/dist/locale/sq_AL.js +4 -0
  138. package/dist/locale/ta_IN.js +4 -0
  139. package/dist/locale/tk_TK.js +4 -0
  140. package/dist/locale/ur_PK.js +4 -0
  141. package/dist/locale/uz_UZ.js +4 -0
  142. package/dist/masonry/Masonry.js +9 -1
  143. package/dist/mentions/index.d.ts +1 -1
  144. package/dist/mentions/index.js +7 -3
  145. package/dist/menu/MenuContext.js +4 -1
  146. package/dist/menu/MenuItem.js +2 -2
  147. package/dist/menu/OverrideContext.js +4 -1
  148. package/dist/menu/index.d.ts +2 -2
  149. package/dist/message/PurePanel.js +2 -1
  150. package/dist/message/index.js +14 -9
  151. package/dist/message/interface.d.ts +8 -0
  152. package/dist/message/useMessage.d.ts +1 -1
  153. package/dist/message/useMessage.js +26 -32
  154. package/dist/modal/ConfirmDialog.js +1 -1
  155. package/dist/modal/Modal.js +3 -2
  156. package/dist/modal/PurePanel.js +2 -2
  157. package/dist/modal/interface.d.ts +0 -6
  158. package/dist/modal/shared.js +2 -1
  159. package/dist/notification/PurePanel.d.ts +1 -1
  160. package/dist/notification/PurePanel.js +12 -10
  161. package/dist/notification/index.js +4 -1
  162. package/dist/notification/interface.d.ts +4 -0
  163. package/dist/notification/useNotification.js +19 -21
  164. package/dist/package.js +1 -1
  165. package/dist/pagination/Pagination.js +3 -4
  166. package/dist/popconfirm/index.js +4 -1
  167. package/dist/popover/PurePanel.js +8 -2
  168. package/dist/popover/index.js +4 -1
  169. package/dist/qrcode/QrcodeStatus.js +4 -1
  170. package/dist/qrcode/index.js +2 -1
  171. package/dist/radio/group.js +2 -2
  172. package/dist/radio/radio.js +2 -2
  173. package/dist/rate/index.d.ts +1 -1
  174. package/dist/rate/index.js +1 -5
  175. package/dist/result/index.js +4 -3
  176. package/dist/segmented/index.js +8 -2
  177. package/dist/select/index.d.ts +2 -3
  178. package/dist/select/index.js +2 -2
  179. package/dist/skeleton/Element.js +2 -2
  180. package/dist/slider/SliderTooltip.js +4 -1
  181. package/dist/slider/index.d.ts +1 -0
  182. package/dist/slider/index.js +5 -3
  183. package/dist/space/Compact.d.ts +1 -1
  184. package/dist/spin/index.js +2 -2
  185. package/dist/splitter/Panel.js +12 -3
  186. package/dist/splitter/SplitBar.js +12 -1
  187. package/dist/splitter/Splitter.js +2 -1
  188. package/dist/splitter/hooks/sizeUtil.js +17 -1
  189. package/dist/splitter/interface.d.ts +3 -1
  190. package/dist/splitter/style/index.js +6 -1
  191. package/dist/statistic/Number.js +2 -1
  192. package/dist/statistic/Statistic.js +2 -2
  193. package/dist/steps/index.js +3 -4
  194. package/dist/switch/index.d.ts +0 -2
  195. package/dist/table/Column.d.ts +5 -1
  196. package/dist/table/Column.js +10 -1
  197. package/dist/table/ColumnGroup.js +5 -0
  198. package/dist/table/InternalTable.d.ts +4 -1
  199. package/dist/table/InternalTable.js +28 -18
  200. package/dist/table/Table.js +16 -5
  201. package/dist/table/hooks/useFilter/index.d.ts +3 -1
  202. package/dist/table/hooks/useFilter/index.js +2 -2
  203. package/dist/table/hooks/useSelection.js +7 -3
  204. package/dist/table/interface.d.ts +10 -3
  205. package/dist/table/style/index.js +30 -2
  206. package/dist/table/util.d.ts +1 -1
  207. package/dist/table/utils.js +20 -2
  208. package/dist/tabs/index.d.ts +2 -0
  209. package/dist/tabs/index.js +11 -6
  210. package/dist/tag/CheckableTag.d.ts +0 -3
  211. package/dist/tag/CheckableTagGroup.js +18 -2
  212. package/dist/tag/index.js +2 -1
  213. package/dist/theme/context.d.ts +0 -1
  214. package/dist/theme/util/alias.js +3 -0
  215. package/dist/theme/util/genStyleUtils.d.ts +4 -0
  216. package/dist/time-picker/index.d.ts +8 -3
  217. package/dist/time-picker/index.js +46 -8
  218. package/dist/timeline/TimelineItem.js +4 -1
  219. package/dist/timeline/useItems.js +2 -1
  220. package/dist/tooltip/PurePanel.js +4 -1
  221. package/dist/tooltip/index.d.ts +5 -2
  222. package/dist/tooltip/index.js +4 -1
  223. package/dist/tooltip/style/index.d.ts +0 -1
  224. package/dist/tour/index.js +2 -3
  225. package/dist/tour/interface.d.ts +7 -5
  226. package/dist/tour/panelRender.js +6 -6
  227. package/dist/transfer/ListBody.js +1 -1
  228. package/dist/transfer/Section.js +3 -2
  229. package/dist/transfer/Transfer.js +37 -13
  230. package/dist/transfer/hooks/useSelection.js +1 -1
  231. package/dist/transfer/interface.d.ts +1 -1
  232. package/dist/tree/DirectoryTree.js +2 -1
  233. package/dist/tree/Tree.js +6 -6
  234. package/dist/tree/utils/dictUtil.js +2 -2
  235. package/dist/tree-select/index.d.ts +2 -3
  236. package/dist/tree-select/index.js +16 -8
  237. package/dist/typography/Base/Ellipsis.js +2 -1
  238. package/dist/typography/Base/index.js +6 -3
  239. package/dist/typography/Editable.js +2 -1
  240. package/dist/upload/Dragger.js +2 -4
  241. package/dist/upload/Upload.d.ts +0 -1
  242. package/dist/upload/Upload.js +2 -2
  243. package/dist/upload/UploadList/ListItem.d.ts +1 -0
  244. package/dist/upload/UploadList/ListItem.js +15 -9
  245. package/dist/upload/UploadList/index.js +1 -0
  246. package/dist/upload/interface.d.ts +6 -7
  247. package/dist/version/token.json +1 -1
  248. package/package.json +26 -26
  249. package/web-tags.json +1383 -1377
  250. package/web-types.json +4046 -4165
@@ -1,4 +1,5 @@
1
1
  import { useBaseConfig } from "../config-provider/context.js";
2
+ import { normalizeStyle as normalizeStyle$1 } from "./styleUtils.js";
2
3
  import ConfigProvider from "../config-provider/index.js";
3
4
  import { createVNode, defineComponent, mergeProps, shallowRef, useAttrs, useSlots, watch } from "vue";
4
5
  //#region src/_util/PurePanel.tsx
@@ -60,7 +61,7 @@ function genPurePanel(Component, alignPropName, postProps, defaultPrefixCls, get
60
61
  let mergedProps = {
61
62
  ...props,
62
63
  style: {
63
- ...style,
64
+ ...normalizeStyle$1(style) || {},
64
65
  margin: 0
65
66
  },
66
67
  open: open.value,
@@ -1,3 +1,4 @@
1
+ import { normalizeStyle as normalizeStyle$1 } from "../styleUtils.js";
1
2
  import { computed, unref } from "vue";
2
3
  import { classNames } from "@v-c/util";
3
4
  import { omit } from "es-toolkit";
@@ -29,7 +30,7 @@ function mergeStyles(...styles) {
29
30
  Object.keys(cur).forEach((key) => {
30
31
  acc[key] = {
31
32
  ...acc[key],
32
- ...cur[key]
33
+ ...normalizeStyle$1(cur[key])
33
34
  };
34
35
  });
35
36
  return acc;
@@ -121,7 +122,7 @@ function pureAttrs(attrs, options = defaultOptions) {
121
122
  function getAttrStyleAndClass(attrs, options, props) {
122
123
  return {
123
124
  className: attrs.class ?? props?.class,
124
- style: attrs.style ?? props?.style,
125
+ style: normalizeStyle$1(attrs.style ?? props?.style),
125
126
  restAttrs: pureAttrs(attrs, options)
126
127
  };
127
128
  }
@@ -3,6 +3,6 @@ import { ValidateStatus } from "../form/FormItem/index.js";
3
3
  declare const _InputStatuses: readonly ["warning", "error", "", "success", "validating"];
4
4
  type InputStatus = (typeof _InputStatuses)[number];
5
5
  declare function getStatusClassNames(prefixCls: string, status?: ValidateStatus, hasFeedback?: boolean): string;
6
- declare function getMergedStatus(contextStatus?: ValidateStatus, customStatus?: InputStatus): "" | "success" | "warning" | "error" | "validating" | undefined;
6
+ declare function getMergedStatus(contextStatus?: ValidateStatus, customStatus?: InputStatus): "" | "error" | "success" | "warning" | "validating" | undefined;
7
7
  //#endregion
8
8
  export { InputStatus, getMergedStatus, getStatusClassNames };
@@ -1,4 +1,22 @@
1
1
  //#region src/_util/styleUtils.d.ts
2
2
  declare function formatUnit(value: string | number | undefined | null): string | undefined;
3
+ /**
4
+ * Normalize a user-provided `style` (string | object | array of them) into a
5
+ * plain style object.
6
+ *
7
+ * Vue passes string styles through `props.style` untouched (a string is a
8
+ * legal vnode style, applied as `cssText`), so components that spread or
9
+ * merge the user style into an object must normalize it first: spreading a
10
+ * string produces numeric keys (`{0:'w', 1:'i', ...}`) which makes Vue's
11
+ * `patchStyle` throw "Failed to set an indexed property [0] on
12
+ * 'CSSStyleDeclaration'".
13
+ *
14
+ * Delegates to Vue's own `normalizeStyle`, which merges arrays (parsing each
15
+ * string entry with its parenthesis-aware cssText split, so values like
16
+ * `background-image: url("data:image/svg+xml;...")` stay intact). The only
17
+ * addition here is parsing a *top-level* string, which Vue intentionally
18
+ * leaves as-is because `patchStyle` can apply it directly as `cssText`.
19
+ */
20
+ declare function normalizeStyle(style?: unknown): Record<PropertyKey, unknown> | undefined;
3
21
  //#endregion
4
- export { formatUnit };
22
+ export { formatUnit, normalizeStyle };
@@ -1,3 +1,4 @@
1
+ import { normalizeStyle as normalizeStyle$1 } from "vue";
1
2
  //#region src/_util/styleUtils.ts
2
3
  function formatUnit(value) {
3
4
  if (value === void 0 || value === null) return;
@@ -5,5 +6,27 @@ function formatUnit(value) {
5
6
  if (typeof value === "string" && !value.endsWith("px") && !Number.isNaN(Number(value))) return `${value}px`;
6
7
  return value;
7
8
  }
9
+ /**
10
+ * Normalize a user-provided `style` (string | object | array of them) into a
11
+ * plain style object.
12
+ *
13
+ * Vue passes string styles through `props.style` untouched (a string is a
14
+ * legal vnode style, applied as `cssText`), so components that spread or
15
+ * merge the user style into an object must normalize it first: spreading a
16
+ * string produces numeric keys (`{0:'w', 1:'i', ...}`) which makes Vue's
17
+ * `patchStyle` throw "Failed to set an indexed property [0] on
18
+ * 'CSSStyleDeclaration'".
19
+ *
20
+ * Delegates to Vue's own `normalizeStyle`, which merges arrays (parsing each
21
+ * string entry with its parenthesis-aware cssText split, so values like
22
+ * `background-image: url("data:image/svg+xml;...")` stay intact). The only
23
+ * addition here is parsing a *top-level* string, which Vue intentionally
24
+ * leaves as-is because `patchStyle` can apply it directly as `cssText`.
25
+ */
26
+ function normalizeStyle(style) {
27
+ const normalized = normalizeStyle$1(style);
28
+ if (typeof normalized === "string") return normalizeStyle$1([normalized]);
29
+ return normalized || void 0;
30
+ }
8
31
  //#endregion
9
- export { formatUnit };
32
+ export { formatUnit, normalizeStyle };
@@ -8,7 +8,7 @@ function hasOwn(obj, key) {
8
8
  function isFunction(value) {
9
9
  return typeof value === "function";
10
10
  }
11
- function camelize(str) {
11
+ function camelize$1(str) {
12
12
  return str.replace(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
13
13
  }
14
14
  function hyphenate(str) {
@@ -46,10 +46,10 @@ function normalizePropsOptions(vnode) {
46
46
  const needCastKeys = [];
47
47
  if (Array.isArray(raw)) raw.forEach((key) => {
48
48
  if (typeof key !== "string") return;
49
- normalized[camelize(key)] = {};
49
+ normalized[camelize$1(key)] = {};
50
50
  });
51
51
  else if (typeof raw === "object") Object.keys(raw).forEach((key) => {
52
- const normalizedKey = camelize(key);
52
+ const normalizedKey = camelize$1(key);
53
53
  const opt = raw[key];
54
54
  const prop = Array.isArray(opt) || isFunction(opt) ? { type: opt } : opt ? { ...opt } : {};
55
55
  const propType = prop.type;
@@ -105,7 +105,7 @@ function resolveVNodeProps(vnode, name, markerKey) {
105
105
  Object.keys(rawProps).forEach((key) => {
106
106
  if (isReservedProp(key)) return;
107
107
  const value = rawProps[key];
108
- const camelKey = camelize(key);
108
+ const camelKey = camelize$1(key);
109
109
  if (hasOwn(options, camelKey)) if (!needCastKeySet.has(camelKey)) resolvedProps[camelKey] = value;
110
110
  else rawCastValues[camelKey] = value;
111
111
  else attrs[key] = value;
@@ -134,7 +134,7 @@ function resolveVNodeProps(vnode, name, markerKey) {
134
134
  result.children = value;
135
135
  return;
136
136
  }
137
- result[camelize(slotName)] = value;
137
+ result[camelize$1(slotName)] = value;
138
138
  });
139
139
  return result;
140
140
  }
@@ -19,7 +19,6 @@ interface WarningContextProps {
19
19
  /**
20
20
  * @descCN 设置警告等级,设置 `false` 时会将废弃相关信息聚合为单条信息。
21
21
  * @descEN Set the warning level. When set to `false`, discard related information will be aggregated into a single message.
22
- * @since 5.10.0
23
22
  */
24
23
  strict?: boolean;
25
24
  }
@@ -40,7 +40,7 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
40
40
  return offsetBottom === void 0 && offsetTop === void 0 ? 0 : offsetTop;
41
41
  });
42
42
  const measure = () => {
43
- if (status.value !== AFFIX_STATUS_PREPARE || !fixedNodeRef.value || !placeholderNodeRef.value || !targetFunc.value) return;
43
+ if (status.value !== AFFIX_STATUS_PREPARE || !fixedNodeRef.value || !placeholderNodeRef.value) return;
44
44
  const targetNode = targetFunc.value();
45
45
  if (targetNode) {
46
46
  const newState = { status: AFFIX_STATUS_NONE };
@@ -50,21 +50,10 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
50
50
  const targetRect = getTargetRect(targetNode);
51
51
  const fixedTop = getFixedTop(placeholderRect, targetRect, internalOffsetTop.value);
52
52
  const fixedBottom = getFixedBottom(placeholderRect, targetRect, props.offsetBottom);
53
- if (fixedTop !== void 0) {
53
+ if (fixedTop !== void 0 || fixedBottom !== void 0) {
54
54
  newState.affixStyle = {
55
55
  position: "fixed",
56
- top: `${fixedTop}px`,
57
- width: `${placeholderRect.width}px`,
58
- height: `${contentHeight}px`
59
- };
60
- newState.placeholderStyle = {
61
- width: `${placeholderRect.width}px`,
62
- height: `${contentHeight}px`
63
- };
64
- } else if (fixedBottom !== void 0) {
65
- newState.affixStyle = {
66
- position: "fixed",
67
- bottom: `${fixedBottom}px`,
56
+ ...fixedTop !== void 0 ? { top: `${fixedTop}px` } : { bottom: `${fixedBottom}px` },
68
57
  width: `${placeholderRect.width}px`,
69
58
  height: `${contentHeight}px`
70
59
  };
@@ -89,20 +78,20 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
89
78
  prepareMeasure();
90
79
  });
91
80
  const lazyUpdatePosition = throttleByAnimationFrame(() => {
92
- if (targetFunc.value && affixStyle.value) {
81
+ if (affixStyle.value) {
93
82
  const targetNode = targetFunc.value();
94
83
  if (targetNode && placeholderNodeRef.value) {
95
84
  const targetRect = getTargetRect(targetNode);
96
85
  const placeholderRect = getTargetRect(placeholderNodeRef.value);
97
86
  const fixedTop = getFixedTop(placeholderRect, targetRect, internalOffsetTop.value);
98
87
  const fixedBottom = getFixedBottom(placeholderRect, targetRect, props.offsetBottom);
99
- if (fixedTop !== void 0 && affixStyle.value.top === fixedTop || fixedBottom !== void 0 && affixStyle.value.bottom === fixedBottom) return;
88
+ if (fixedTop !== void 0 && affixStyle.value.top === `${fixedTop}px` || fixedBottom !== void 0 && affixStyle.value.bottom === `${fixedBottom}px`) return;
100
89
  }
101
90
  }
102
91
  prepareMeasure();
103
92
  });
104
93
  const addListeners = () => {
105
- const listenerTarget = targetFunc.value?.();
94
+ const listenerTarget = targetFunc.value();
106
95
  if (!listenerTarget) return;
107
96
  TRIGGER_EVENTS.forEach((eventName) => {
108
97
  if (prevListener.value) prevTarget.value?.removeEventListener(eventName, prevListener.value);
@@ -112,7 +101,7 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
112
101
  prevListener.value = lazyUpdatePosition;
113
102
  };
114
103
  const removeListeners = () => {
115
- const newTarget = targetFunc.value?.();
104
+ const newTarget = targetFunc.value();
116
105
  TRIGGER_EVENTS.forEach((eventName) => {
117
106
  newTarget?.removeEventListener(eventName, lazyUpdatePosition);
118
107
  if (prevListener.value) prevTarget.value?.removeEventListener(eventName, prevListener.value);
@@ -1,11 +1,11 @@
1
1
  import { useComponentBaseConfig } from "../config-provider/context.js";
2
- import { pureAttrs, useMergeSemanticNoRef } from "../_util/hooks/useMergeSemantic.js";
2
+ import { getAttrStyleAndClass, pureAttrs, useMergeSemanticNoRef } from "../_util/hooks/useMergeSemantic.js";
3
3
  import { getSlotPropFn, getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
4
4
  import { isRenderable } from "../_util/is.js";
5
5
  import style_default from "./style/index.js";
6
6
  import { Transition, computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef } from "vue";
7
7
  import { classNames, clsx } from "@v-c/util";
8
- import { filterEmpty, getAttrStyleAndClass } from "@v-c/util/dist/props-util";
8
+ import { filterEmpty } from "@v-c/util/dist/props-util";
9
9
  import { CheckCircleFilled, CloseCircleFilled, CloseOutlined, ExclamationCircleFilled, InfoCircleFilled } from "@antdv-next/icons";
10
10
  //#region src/alert/Alert.tsx
11
11
  const alertDefaultProps = { showIcon: void 0 };
@@ -199,6 +199,7 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
199
199
  const mergedTitle = getSlotPropsFnRun(slots, props, "title") ?? message;
200
200
  const description = getSlotPropsFnRun(slots, props, "description");
201
201
  const action = getSlotPropsFnRun(slots, props, "action");
202
+ const icon = getSlotPropsFnRun(slots, props, "icon");
202
203
  const isShowIcon = banner && showIcon === void 0 ? true : showIcon;
203
204
  const mergedProps = {
204
205
  ...props,
@@ -240,9 +241,9 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
240
241
  return createVNode(Transition, {
241
242
  "name": `${prefixCls.value}-motion`,
242
243
  "appear": false,
243
- "leaveFromClass": "ant-alert-motion-leave",
244
- "leaveActiveClass": "ant-alert-motion-leave ant-alert-motion-leave-active",
245
- "leaveToClass": "ant-alert-motion-leave ant-alert-motion-leave-active",
244
+ "leaveFromClass": `${prefixCls.value}-motion-leave`,
245
+ "leaveActiveClass": `${prefixCls.value}-motion-leave ${prefixCls.value}-motion-leave-active`,
246
+ "leaveToClass": `${prefixCls.value}-motion-leave ${prefixCls.value}-motion-leave-active`,
246
247
  "onBeforeLeave": handleBeforeLeave,
247
248
  "onAfterLeave": () => props?.afterClose?.()
248
249
  }, { default: () => [!closed.value ? createVNode("div", mergeProps({
@@ -257,7 +258,7 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
257
258
  "class": mergedClassNames.icon,
258
259
  "style": mergedStyles.icon,
259
260
  "description": description,
260
- "icon": props.icon,
261
+ "icon": icon,
261
262
  "prefixCls": prefixCls.value,
262
263
  "type": type.value,
263
264
  "successIcon": successIcon.value,
@@ -355,14 +356,12 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
355
356
  required: false
356
357
  },
357
358
  classes: {
358
- type: Function,
359
- required: false,
360
- skipCheck: true
359
+ type: [Object, Function],
360
+ required: false
361
361
  },
362
362
  styles: {
363
- type: Function,
364
- required: false,
365
- skipCheck: true
363
+ type: [Object, Function],
364
+ required: false
366
365
  },
367
366
  banner: {
368
367
  type: Boolean,
@@ -58,7 +58,7 @@ type AnchorSlots = SlotsDefineType<{
58
58
  item: (item: AnchorLinkItemProps) => any;
59
59
  }>;
60
60
  interface AntAnchor {
61
- registerLink: (link: string) => void;
61
+ registerLink: (link: string, targetOffset?: number) => void;
62
62
  unregisterLink: (link: string) => void;
63
63
  activeLink: string | null;
64
64
  scrollTo: (link: string, linkTargetOffset?: number) => void;
@@ -36,6 +36,7 @@ function getOffsetTop(element, container) {
36
36
  }
37
37
  const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) => {
38
38
  const links = ref([]);
39
+ const linkTargetOffsetRef = ref({});
39
40
  const activeLink = shallowRef();
40
41
  const _activeLink = shallowRef(activeLink.value);
41
42
  const activeLinkRef = computed({
@@ -47,18 +48,21 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
47
48
  const rawActiveLink = shallowRef(activeLink.value);
48
49
  const wrapperRef = shallowRef();
49
50
  const spanLinkNode = shallowRef();
50
- const animating = shallowRef(false);
51
+ const animatingRef = shallowRef(false);
52
+ const scrollRequestIdRef = shallowRef(null);
51
53
  const { prefixCls, direction, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, getTargetContainer } = useComponentBaseConfig("anchor", props);
52
54
  const { direction: anchorDirection, classes, styles } = toPropsRefs$1(props, "direction", "classes", "styles");
53
55
  const rootCls = useCSSVarCls(prefixCls);
54
56
  const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
55
57
  const getCurrentContainer = () => props?.getContainer?.() ?? getTargetContainer?.() ?? getDefaultContainer?.();
56
58
  const dependencyListItem = computed(() => JSON.stringify(links.value));
57
- const registerLink = (link) => {
59
+ const registerLink = (link, targetOffset) => {
58
60
  if (!links.value.includes(link)) links.value.push(link);
61
+ if (targetOffset !== void 0) linkTargetOffsetRef.value[link] = targetOffset;
59
62
  };
60
63
  const unregisterLink = (link) => {
61
64
  links.value = links.value.filter((item) => item !== link);
65
+ delete linkTargetOffsetRef.value[link];
62
66
  };
63
67
  const updateInk = () => {
64
68
  const linkNode = wrapperRef.value?.querySelector(`.${prefixCls.value}-link-title-active`);
@@ -84,7 +88,7 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
84
88
  const target = document.getElementById(sharpLinkMatch[1]);
85
89
  if (target) {
86
90
  const top = getOffsetTop(target, container);
87
- if (top <= _offsetTop + _bounds) linkSections.push({
91
+ if (top <= (linkTargetOffsetRef.value[link] ?? _offsetTop) + _bounds) linkSections.push({
88
92
  link,
89
93
  top
90
94
  });
@@ -106,7 +110,7 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
106
110
  emit("change", link);
107
111
  };
108
112
  const handleScroll = () => {
109
- if (animating.value) return;
113
+ if (animatingRef.value) return;
110
114
  const currentActiveLink = getInternalCurrentAnchor(links.value, props.targetOffset !== void 0 ? props.targetOffset : props.offsetTop || 0, props.bounds);
111
115
  setCurrentActiveLink(currentActiveLink);
112
116
  };
@@ -118,14 +122,19 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
118
122
  if (!sharpLinkMatch) return;
119
123
  const targetElement = document.getElementById(sharpLinkMatch[1]);
120
124
  if (!targetElement) return;
125
+ if (animatingRef.value) {
126
+ if (previousRawActiveLink === link) return;
127
+ scrollRequestIdRef.value?.();
128
+ }
121
129
  const container = getCurrentContainer();
122
130
  let y = getScroll(container) + getOffsetTop(targetElement, container);
123
131
  y -= linkTargetOffset ?? (targetOffset !== void 0 ? targetOffset : offsetTop || 0);
124
- animating.value = true;
125
- scrollTo(y, {
132
+ animatingRef.value = true;
133
+ scrollRequestIdRef.value = scrollTo(y, {
126
134
  getContainer: getCurrentContainer,
127
135
  callback() {
128
- animating.value = false;
136
+ animatingRef.value = false;
137
+ scrollRequestIdRef.value = null;
129
138
  }
130
139
  });
131
140
  };
@@ -7,9 +7,9 @@ import { classNames } from "@v-c/util";
7
7
  const AnchorLink = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
8
8
  const { registerLink, direction, unregisterLink, activeLink, scrollTo, onClick, classes: mergedClassNames, styles: mergedStyles } = useAnchorContext() ?? {};
9
9
  const { prefixCls } = useBaseConfig("anchor", props);
10
- watch(() => props.href, async (href, _, onCleanup) => {
10
+ watch([() => props.href, () => props.targetOffset], async ([href, targetOffset], _, onCleanup) => {
11
11
  await nextTick();
12
- registerLink?.(href);
12
+ registerLink?.(href, targetOffset);
13
13
  onCleanup(() => {
14
14
  unregisterLink?.(href);
15
15
  });
@@ -28,6 +28,7 @@ const AnchorLink = /* @__PURE__ */ defineComponent((props, { slots, attrs }) =>
28
28
  e.preventDefault();
29
29
  window.location.replace(href);
30
30
  }
31
+ return;
31
32
  }
32
33
  e.preventDefault();
33
34
  const historyMethod = replace ? "replaceState" : "pushState";