antdv-next 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/dist/_util/hooks/useMergeSemantic.js +2 -2
  2. package/dist/_util/statusUtils.d.ts +1 -1
  3. package/dist/_util/vueNode.d.ts +11 -1
  4. package/dist/_util/vueNode.js +17 -1
  5. package/dist/affix/index.js +12 -9
  6. package/dist/alert/Alert.js +10 -5
  7. package/dist/anchor/Anchor.js +11 -6
  8. package/dist/anchor/style/index.js +2 -3
  9. package/dist/antd-with-locales.esm.js +16938 -18716
  10. package/dist/antd-with-locales.js +79 -86
  11. package/dist/antd.css +1 -1
  12. package/dist/antd.esm.js +15197 -17143
  13. package/dist/antd.js +80 -87
  14. package/dist/auto-complete/index.d.ts +2 -0
  15. package/dist/auto-complete/index.js +28 -23
  16. package/dist/avatar/Avatar.js +1 -1
  17. package/dist/avatar/AvatarContext.d.ts +2 -2
  18. package/dist/avatar/AvatarGroup.js +3 -5
  19. package/dist/badge/style/ribbon.d.ts +1 -0
  20. package/dist/border-beam/style/index.d.ts +1 -0
  21. package/dist/breadcrumb/index.d.ts +8 -1
  22. package/dist/button/Button.js +31 -18
  23. package/dist/button/style/index.d.ts +1 -0
  24. package/dist/calendar/Header.js +4 -4
  25. package/dist/calendar/generateCalendar.d.ts +10 -10
  26. package/dist/calendar/index.d.ts +1 -1
  27. package/dist/card/Card.js +1 -1
  28. package/dist/card/index.d.ts +8 -1
  29. package/dist/card/style/index.js +3 -7
  30. package/dist/carousel/index.js +3 -3
  31. package/dist/cascader/hooks/useIcons.js +3 -2
  32. package/dist/cascader/index.d.ts +9 -1
  33. package/dist/cascader/index.js +42 -34
  34. package/dist/cascader/style/panel.d.ts +1 -0
  35. package/dist/checkbox/Checkbox.js +5 -2
  36. package/dist/checkbox/Group.js +6 -6
  37. package/dist/collapse/Collapse.js +2 -2
  38. package/dist/color-picker/ColorPicker.js +15 -2
  39. package/dist/color-picker/components/ColorSlider.js +2 -2
  40. package/dist/color-picker/interface.d.ts +3 -0
  41. package/dist/color-picker/style/input.js +6 -11
  42. package/dist/components.d.ts +24 -24
  43. package/dist/components.js +1 -2
  44. package/dist/config-provider/context.d.ts +16 -11
  45. package/dist/config-provider/define.d.ts +2 -1
  46. package/dist/config-provider/index.js +9 -0
  47. package/dist/date-picker/generatePicker/generateRangePicker.d.ts +2 -0
  48. package/dist/date-picker/generatePicker/generateRangePicker.js +23 -15
  49. package/dist/date-picker/generatePicker/generateSinglePicker.d.ts +2 -0
  50. package/dist/date-picker/generatePicker/generateSinglePicker.js +18 -14
  51. package/dist/date-picker/generatePicker/interface.d.ts +17 -5
  52. package/dist/date-picker/generatePicker/useComponents.d.ts +1 -14
  53. package/dist/date-picker/generatePicker/useSuffix.d.ts +12 -0
  54. package/dist/date-picker/generatePicker/useSuffix.js +11 -0
  55. package/dist/date-picker/style/index.d.ts +1 -0
  56. package/dist/date-picker/util.d.ts +1 -1
  57. package/dist/date-picker/util.js +4 -3
  58. package/dist/descriptions/hooks/useItems.d.ts +6 -6
  59. package/dist/descriptions/index.js +2 -2
  60. package/dist/divider/index.js +14 -4
  61. package/dist/drawer/index.js +2 -2
  62. package/dist/dropdown/dropdown.js +6 -6
  63. package/dist/dropdown/style/index.js +0 -6
  64. package/dist/empty/index.js +2 -1
  65. package/dist/empty/style/index.d.ts +1 -0
  66. package/dist/flex/index.js +2 -2
  67. package/dist/float-button/BackTop.js +2 -1
  68. package/dist/float-button/FloatButton.js +2 -2
  69. package/dist/float-button/FloatButtonGroup.js +2 -2
  70. package/dist/float-button/PurePanel.js +5 -5
  71. package/dist/form/Form.js +47 -16
  72. package/dist/form/FormItem/ItemHolder.d.ts +3 -18
  73. package/dist/form/FormItem/StatusProvider.js +2 -1
  74. package/dist/form/FormItem/index.d.ts +1 -0
  75. package/dist/form/FormItem/index.js +22 -9
  76. package/dist/form/FormItemInput.js +3 -4
  77. package/dist/form/FormItemLabel.js +8 -4
  78. package/dist/form/context.d.ts +3 -3
  79. package/dist/form/hooks/useVariant.d.ts +14 -4
  80. package/dist/form/hooks/useVariant.js +24 -13
  81. package/dist/form/interface.d.ts +4 -1
  82. package/dist/form/style/index.js +1 -1
  83. package/dist/grid/hooks/useBreakpoint.js +12 -6
  84. package/dist/image/PreviewGroup.d.ts +9 -2
  85. package/dist/image/PreviewGroup.js +2 -2
  86. package/dist/image/hooks/usePreviewConfig.d.ts +2 -2
  87. package/dist/image/index.d.ts +3 -3
  88. package/dist/image/index.js +3 -3
  89. package/dist/index.d.ts +26 -24
  90. package/dist/index.js +1 -2
  91. package/dist/input/Input.js +4 -4
  92. package/dist/input/OTP/OTPInput.js +31 -30
  93. package/dist/input/OTP/index.js +10 -2
  94. package/dist/input/Password.js +7 -3
  95. package/dist/input/Search.js +5 -5
  96. package/dist/input/TextArea.js +4 -4
  97. package/dist/input/style/index.js +2 -15
  98. package/dist/input/style/otp.d.ts +1 -0
  99. package/dist/input/style/search.d.ts +1 -0
  100. package/dist/input/style/textarea.d.ts +1 -0
  101. package/dist/input-number/index.js +3 -3
  102. package/dist/input-number/style/index.d.ts +1 -0
  103. package/dist/layout/Sider.js +2 -2
  104. package/dist/layout/style/sider.d.ts +1 -0
  105. package/dist/listy/interface.d.ts +23 -4
  106. package/dist/listy/style/index.js +1 -0
  107. package/dist/locale/ar_EG.js +3 -1
  108. package/dist/locale/az_AZ.js +3 -1
  109. package/dist/locale/bg_BG.js +3 -1
  110. package/dist/locale/bn_BD.js +3 -1
  111. package/dist/locale/by_BY.js +3 -1
  112. package/dist/locale/ca_ES.js +3 -1
  113. package/dist/locale/cs_CZ.js +13 -9
  114. package/dist/locale/da_DK.js +3 -1
  115. package/dist/locale/de_DE.js +6 -2
  116. package/dist/locale/el_GR.js +3 -1
  117. package/dist/locale/en_GB.js +3 -1
  118. package/dist/locale/en_US.js +5 -2
  119. package/dist/locale/es_ES.js +3 -1
  120. package/dist/locale/et_EE.js +3 -1
  121. package/dist/locale/eu_ES.js +3 -1
  122. package/dist/locale/fa_IR.js +3 -1
  123. package/dist/locale/fi_FI.js +3 -1
  124. package/dist/locale/fr_BE.js +3 -1
  125. package/dist/locale/fr_CA.js +3 -1
  126. package/dist/locale/fr_FR.js +6 -2
  127. package/dist/locale/ga_IE.js +3 -1
  128. package/dist/locale/gl_ES.js +3 -1
  129. package/dist/locale/he_IL.js +3 -1
  130. package/dist/locale/hi_IN.js +3 -1
  131. package/dist/locale/hr_HR.js +3 -1
  132. package/dist/locale/hu_HU.js +3 -1
  133. package/dist/locale/hy_AM.js +5 -13
  134. package/dist/locale/id_ID.js +3 -1
  135. package/dist/locale/index.d.ts +6 -0
  136. package/dist/locale/is_IS.js +3 -1
  137. package/dist/locale/it_IT.js +6 -2
  138. package/dist/locale/ja_JP.js +3 -1
  139. package/dist/locale/ka_GE.js +3 -1
  140. package/dist/locale/kk_KZ.js +3 -1
  141. package/dist/locale/km_KH.js +3 -1
  142. package/dist/locale/kmr_IQ.js +3 -1
  143. package/dist/locale/kn_IN.js +3 -1
  144. package/dist/locale/ko_KR.js +3 -1
  145. package/dist/locale/ku_IQ.js +3 -1
  146. package/dist/locale/lt_LT.js +3 -1
  147. package/dist/locale/lv_LV.js +3 -1
  148. package/dist/locale/mk_MK.js +3 -1
  149. package/dist/locale/ml_IN.js +3 -1
  150. package/dist/locale/mn_MN.js +3 -1
  151. package/dist/locale/mr_IN.js +3 -1
  152. package/dist/locale/ms_MY.js +3 -1
  153. package/dist/locale/my_MM.js +3 -1
  154. package/dist/locale/nb_NO.js +3 -1
  155. package/dist/locale/ne_NP.js +4 -2
  156. package/dist/locale/nl_BE.js +3 -1
  157. package/dist/locale/nl_NL.js +3 -1
  158. package/dist/locale/pl_PL.js +3 -1
  159. package/dist/locale/pt_BR.js +3 -1
  160. package/dist/locale/pt_PT.js +3 -1
  161. package/dist/locale/ro_RO.js +3 -1
  162. package/dist/locale/ru_RU.js +3 -1
  163. package/dist/locale/si_LK.js +3 -1
  164. package/dist/locale/sk_SK.js +3 -1
  165. package/dist/locale/sl_SI.js +3 -1
  166. package/dist/locale/sq_AL.js +5 -13
  167. package/dist/locale/sr_RS.js +3 -1
  168. package/dist/locale/sv_SE.js +3 -1
  169. package/dist/locale/ta_IN.js +3 -1
  170. package/dist/locale/th_TH.js +3 -1
  171. package/dist/locale/tk_TK.js +3 -1
  172. package/dist/locale/tr_TR.js +3 -1
  173. package/dist/locale/uk_UA.js +3 -1
  174. package/dist/locale/ur_PK.js +3 -1
  175. package/dist/locale/uz_UZ.js +3 -1
  176. package/dist/locale/vi_VN.js +3 -1
  177. package/dist/locale/zh_CN.js +5 -2
  178. package/dist/locale/zh_HK.js +3 -1
  179. package/dist/locale/zh_TW.js +3 -1
  180. package/dist/mentions/index.js +4 -4
  181. package/dist/menu/MenuItem.js +7 -7
  182. package/dist/menu/SubMenu.js +5 -4
  183. package/dist/menu/menu.js +2 -2
  184. package/dist/message/PurePanel.js +2 -2
  185. package/dist/message/style/index.d.ts +1 -0
  186. package/dist/message/style/index.js +2 -1
  187. package/dist/modal/Modal.js +5 -5
  188. package/dist/modal/PurePanel.js +2 -2
  189. package/dist/modal/style/confirm.js +1 -1
  190. package/dist/notification/PurePanel.js +2 -2
  191. package/dist/notification/style/index.d.ts +3 -0
  192. package/dist/notification/style/index.js +4 -5
  193. package/dist/notification/style/placement.js +3 -6
  194. package/dist/package.js +1 -1
  195. package/dist/pagination/Pagination.js +6 -5
  196. package/dist/pagination/index.d.ts +2 -1
  197. package/dist/pagination/interface.d.ts +2 -2
  198. package/dist/pagination/style/index.js +15 -7
  199. package/dist/popconfirm/index.js +4 -3
  200. package/dist/popover/PurePanel.js +2 -2
  201. package/dist/popover/style/index.js +1 -0
  202. package/dist/progress/Circle.js +3 -3
  203. package/dist/progress/Line.js +2 -1
  204. package/dist/progress/progress.js +1 -1
  205. package/dist/qrcode/QrcodeStatus.js +2 -1
  206. package/dist/qrcode/index.js +2 -2
  207. package/dist/qrcode/style/index.js +0 -4
  208. package/dist/radio/radio.js +2 -2
  209. package/dist/rate/index.js +2 -2
  210. package/dist/select/index.d.ts +11 -3
  211. package/dist/select/index.js +55 -38
  212. package/dist/select/style/index.d.ts +1 -0
  213. package/dist/select/useIcons.d.ts +23 -8
  214. package/dist/select/useIcons.js +34 -13
  215. package/dist/select/useShowArrow.d.ts +2 -3
  216. package/dist/select/useShowArrow.js +3 -5
  217. package/dist/skeleton/Paragraph.js +2 -2
  218. package/dist/skeleton/Skeleton.js +2 -2
  219. package/dist/skeleton/Title.js +2 -2
  220. package/dist/slider/index.d.ts +6 -1
  221. package/dist/slider/index.js +7 -5
  222. package/dist/space/Item.d.ts +1 -0
  223. package/dist/space/Item.js +6 -2
  224. package/dist/space/index.d.ts +1 -1
  225. package/dist/space/index.js +1 -0
  226. package/dist/space/style/addon.d.ts +1 -0
  227. package/dist/space/style/compact.d.ts +1 -0
  228. package/dist/space/style/index.js +8 -2
  229. package/dist/spin/Indicator/index.js +5 -1
  230. package/dist/splitter/SplitBar.js +2 -1
  231. package/dist/splitter/Splitter.js +10 -4
  232. package/dist/splitter/interface.d.ts +1 -0
  233. package/dist/statistic/Number.js +7 -1
  234. package/dist/statistic/Statistic.d.ts +3 -0
  235. package/dist/statistic/Statistic.js +2 -1
  236. package/dist/steps/index.js +16 -8
  237. package/dist/switch/index.js +10 -4
  238. package/dist/table/InternalTable.js +22 -7
  239. package/dist/table/hooks/useFilter/index.js +5 -2
  240. package/dist/table/hooks/usePagination.d.ts +2 -1
  241. package/dist/table/hooks/usePagination.js +6 -3
  242. package/dist/table/index.d.ts +2 -2
  243. package/dist/table/util.d.ts +1 -1
  244. package/dist/tabs/index.js +19 -11
  245. package/dist/tabs/style/index.js +2 -6
  246. package/dist/tag/index.d.ts +1 -1
  247. package/dist/tag/index.js +13 -5
  248. package/dist/theme/getDesignToken.js +2 -1
  249. package/dist/theme/index.d.ts +1 -0
  250. package/dist/time-picker/index.d.ts +16 -9
  251. package/dist/time-picker/index.js +31 -84
  252. package/dist/timeline/Timeline.js +16 -10
  253. package/dist/tooltip/PurePanel.js +2 -2
  254. package/dist/tooltip/index.js +3 -6
  255. package/dist/tooltip/style/index.js +1 -1
  256. package/dist/tour/index.js +2 -3
  257. package/dist/tour/panelRender.js +4 -4
  258. package/dist/transfer/Section.js +2 -2
  259. package/dist/tree/DirectoryTree.d.ts +19 -7
  260. package/dist/tree/DirectoryTree.js +2 -2
  261. package/dist/tree/Tree.d.ts +73 -58
  262. package/dist/tree/Tree.js +2 -2
  263. package/dist/tree/index.d.ts +8 -5
  264. package/dist/tree/index.js +4 -3
  265. package/dist/tree/style/index.js +6 -1
  266. package/dist/tree/utils/iconUtil.js +1 -1
  267. package/dist/tree-select/index.d.ts +32 -2
  268. package/dist/tree-select/index.js +75 -75
  269. package/dist/upload/Upload.js +2 -2
  270. package/dist/upload/utils.js +8 -3
  271. package/dist/version/token.json +1 -1
  272. package/dist/watermark/useWatermark.d.ts +1 -7
  273. package/dist/watermark/useWatermark.js +1 -7
  274. package/package.json +20 -20
  275. package/web-tags.json +85 -29
  276. package/web-types.json +242 -157
  277. package/dist/date-picker/generatePicker/SuffixIcon.d.ts +0 -12
  278. package/dist/date-picker/generatePicker/SuffixIcon.js +0 -51
  279. package/dist/form/style/fallbackCmp.d.ts +0 -14
  280. package/dist/form/style/fallbackCmp.js +0 -13
@@ -1,7 +1,7 @@
1
1
  import { normalizeStyle as normalizeStyle$1 } from "../styleUtils.js";
2
2
  import { computed, unref } from "vue";
3
3
  import { classNames } from "@v-c/util";
4
- import { omit } from "es-toolkit";
4
+ import { omit as omit$1 } from "es-toolkit";
5
5
  //#region src/_util/hooks/useMergeSemantic.ts
6
6
  function mergeClassNames(schema, ...classNames$1) {
7
7
  const mergedSchema = schema || {};
@@ -117,7 +117,7 @@ function pureAttrs(attrs, options = defaultOptions) {
117
117
  const newAttrs = { ...attrs };
118
118
  if (options.class) delete newAttrs.class;
119
119
  if (options.style) delete newAttrs.style;
120
- if (options.omit) return omit(newAttrs, options.omit);
120
+ if (options.omit) return omit$1(newAttrs, options.omit);
121
121
  return newAttrs;
122
122
  }
123
123
  function getAttrStyleAndClass(attrs, options, props) {
@@ -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): "" | "error" | "success" | "warning" | "validating" | undefined;
6
+ declare function getMergedStatus(contextStatus?: ValidateStatus, customStatus?: InputStatus): "" | "success" | "error" | "warning" | "validating" | undefined;
7
7
  //#endregion
8
8
  export { InputStatus, getMergedStatus, getStatusClassNames };
@@ -9,10 +9,20 @@ declare function replaceElement(element: VNodeChild, replacement: VNodeChild, pr
9
9
  declare function cloneElement(element: VNodeChild, props?: RenderProps): string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
10
10
  [key: string]: any;
11
11
  }> | import("vue").VNodeArrayChildren | null;
12
+ /**
13
+ * 当传入值是 VNode 时返回一个全新的克隆,数组会逐项处理,其余值原样返回。
14
+ *
15
+ * 用于模块级共享的默认 vnode(图标 / 图片等)。一旦原始 vnode 被真正挂载,
16
+ * Vue 会把 el / component 写回它身上;而模块级常量是常驻的 GC Root,Vue 在
17
+ * unmount 时又不会清空这些字段,于是这条引用会把已卸载页面的整条实例链一直
18
+ * 保留下来,造成内存泄漏。渲染前克隆可让模块原始 vnode 永远保持未挂载
19
+ * (el 恒为 null),从而彻底切断该引用链。
20
+ */
21
+ declare function cloneIfVNode<T>(node: T): T;
12
22
  declare function getVNode(node: VueNode): VNodeChild;
13
23
  declare function checkRenderNode(node: any): any;
14
24
  declare function getTextByNode(node: any): any;
15
25
  declare function getTextNodeArr(nodes: any[]): any[];
16
26
  type EmitToProps<T extends Record<string, any>> = { [K in keyof T as `on${Capitalize<K & string>}`]: T[K]; };
17
27
  //#endregion
18
- export { EmitToProps, checkRenderNode, cloneElement, getTextByNode, getTextNodeArr, getVNode, isFragment, replaceElement };
28
+ export { EmitToProps, checkRenderNode, cloneElement, cloneIfVNode, getTextByNode, getTextNodeArr, getVNode, isFragment, replaceElement };
@@ -9,6 +9,22 @@ function replaceElement(element, replacement, props) {
9
9
  function cloneElement(element, props) {
10
10
  return replaceElement(element, element, props);
11
11
  }
12
+ /**
13
+ * 当传入值是 VNode 时返回一个全新的克隆,数组会逐项处理,其余值原样返回。
14
+ *
15
+ * 用于模块级共享的默认 vnode(图标 / 图片等)。一旦原始 vnode 被真正挂载,
16
+ * Vue 会把 el / component 写回它身上;而模块级常量是常驻的 GC Root,Vue 在
17
+ * unmount 时又不会清空这些字段,于是这条引用会把已卸载页面的整条实例链一直
18
+ * 保留下来,造成内存泄漏。渲染前克隆可让模块原始 vnode 永远保持未挂载
19
+ * (el 恒为 null),从而彻底切断该引用链。
20
+ */
21
+ function cloneIfVNode(node) {
22
+ if (Array.isArray(node)) return node.map((item) => cloneIfVNode(item));
23
+ if (!isVNode(node)) return node;
24
+ const cloned = cloneVNode(node);
25
+ if (Array.isArray(cloned.children)) cloned.children = cloned.children.map((item) => cloneIfVNode(item));
26
+ return cloned;
27
+ }
12
28
  function getVNode(node) {
13
29
  if (typeof node === "function") return node?.();
14
30
  return node;
@@ -33,4 +49,4 @@ function getTextNodeArr(nodes) {
33
49
  return res;
34
50
  }
35
51
  //#endregion
36
- export { checkRenderNode, cloneElement, getTextByNode, getTextNodeArr, getVNode, isFragment, replaceElement };
52
+ export { checkRenderNode, cloneElement, cloneIfVNode, getTextByNode, getTextNodeArr, getVNode, isFragment, replaceElement };
@@ -28,8 +28,8 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
28
28
  const affixStyle = shallowRef();
29
29
  const placeholderStyle = shallowRef();
30
30
  const status = shallowRef(AFFIX_STATUS_NONE);
31
- const prevTarget = shallowRef(null);
32
- const prevListener = shallowRef(null);
31
+ let prevTarget = null;
32
+ let prevListener = null;
33
33
  const placeholderNodeRef = shallowRef();
34
34
  const fixedNodeRef = shallowRef();
35
35
  const contextRef = shallowRef();
@@ -94,17 +94,16 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
94
94
  const listenerTarget = targetFunc.value();
95
95
  if (!listenerTarget) return;
96
96
  TRIGGER_EVENTS.forEach((eventName) => {
97
- if (prevListener.value) prevTarget.value?.removeEventListener(eventName, prevListener.value);
97
+ if (prevListener) prevTarget?.removeEventListener(eventName, prevListener);
98
98
  listenerTarget?.addEventListener(eventName, lazyUpdatePosition);
99
99
  });
100
- prevTarget.value = listenerTarget;
101
- prevListener.value = lazyUpdatePosition;
100
+ prevTarget = listenerTarget;
101
+ prevListener = lazyUpdatePosition;
102
102
  };
103
- const removeListeners = () => {
104
- const newTarget = targetFunc.value();
103
+ const removeListeners = (newTarget = targetFunc.value()) => {
105
104
  TRIGGER_EVENTS.forEach((eventName) => {
106
105
  newTarget?.removeEventListener(eventName, lazyUpdatePosition);
107
- if (prevListener.value) prevTarget.value?.removeEventListener(eventName, prevListener.value);
106
+ if (prevListener) prevTarget?.removeEventListener(eventName, prevListener);
108
107
  });
109
108
  updatePosition.cancel();
110
109
  lazyUpdatePosition.cancel();
@@ -113,7 +112,9 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
113
112
  onMounted(() => {
114
113
  timer.value = setTimeout(addListeners);
115
114
  });
115
+ let unmounted = false;
116
116
  onBeforeUnmount(() => {
117
+ unmounted = true;
117
118
  if (timer.value) {
118
119
  clearTimeout(timer.value);
119
120
  timer.value = null;
@@ -128,8 +129,10 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
128
129
  () => props.offsetBottom
129
130
  ], async (_new, _old, onCleanup) => {
130
131
  await nextTick();
132
+ if (unmounted) return;
131
133
  addListeners();
132
- onCleanup(removeListeners);
134
+ const target = prevTarget;
135
+ onCleanup(() => removeListeners(target));
133
136
  });
134
137
  watch([
135
138
  () => props.target,
@@ -2,8 +2,9 @@ import { useComponentBaseConfig } from "../config-provider/context.js";
2
2
  import { getAttrStyleAndClass, pureAttrs, useMergeSemanticNoRef } from "../_util/hooks/useMergeSemantic.js";
3
3
  import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
4
4
  import { isRenderable } from "../_util/is.js";
5
+ import useVariant from "../form/hooks/useVariant.js";
5
6
  import style_default from "./style/index.js";
6
- import { Transition, computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef } from "vue";
7
+ import { Transition, computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef, toRef } from "vue";
7
8
  import { classNames, clsx } from "@v-c/util";
8
9
  import { filterEmpty } from "@v-c/util/dist/props-util";
9
10
  import { CheckCircleFilled, CloseCircleFilled, CloseOutlined, ExclamationCircleFilled, InfoCircleFilled } from "@antdv-next/icons";
@@ -152,15 +153,18 @@ const CloseIconNode = /* @__PURE__ */ defineComponent((props, { slots, attrs })
152
153
  inheritAttrs: false
153
154
  });
154
155
  const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expose }) => {
155
- const { closable: contextClosable, closeIcon: contextCloseIcon, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, direction, prefixCls, successIcon, errorIcon, infoIcon, warningIcon, variant: contextVariant } = useComponentBaseConfig("alert", props, [
156
+ const { closable: contextClosable, closeIcon: contextCloseIcon, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, direction, prefixCls, successIcon, errorIcon, infoIcon, warningIcon } = useComponentBaseConfig("alert", props, [
156
157
  "closable",
157
158
  "closeIcon",
158
159
  "successIcon",
159
160
  "errorIcon",
160
161
  "infoIcon",
161
- "warningIcon",
162
- "variant"
162
+ "warningIcon"
163
163
  ]);
164
+ const [variant] = useVariant("alert", toRef(() => props.variant), {
165
+ variants: ["outlined", "filled"],
166
+ defaultVariant: "outlined"
167
+ });
164
168
  const { classes, styles } = toPropsRefs$1(props, "classes", "styles");
165
169
  const closed = shallowRef(false);
166
170
  const internalRef = shallowRef();
@@ -202,8 +206,10 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expo
202
206
  const action = getSlotPropsFnRun(slots, props, "action");
203
207
  const icon = getSlotPropsFnRun(slots, props, "icon");
204
208
  const isShowIcon = banner && showIcon === void 0 ? true : showIcon;
209
+ const mergedVariant = variant.value;
205
210
  const mergedProps = {
206
211
  ...props,
212
+ variant: mergedVariant,
207
213
  prefixCls: prefixCls.value,
208
214
  type: type.value,
209
215
  showIcon: isShowIcon,
@@ -215,7 +221,6 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expo
215
221
  contextStyleRoot,
216
222
  styles.value
217
223
  ], { props: mergedProps });
218
- const mergedVariant = props.variant ?? contextVariant?.value ?? "outlined";
219
224
  const alertCls = classNames(prefixCls.value, `${prefixCls.value}-${type.value}`, `${prefixCls.value}-${mergedVariant}`, {
220
225
  [`${prefixCls.value}-with-description`]: isRenderable(description),
221
226
  [`${prefixCls.value}-no-icon`]: !isShowIcon,
@@ -36,7 +36,8 @@ 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
+ let linkList = [];
40
+ const linkTargetOffsets = {};
40
41
  const activeLink = shallowRef();
41
42
  const _activeLink = shallowRef(activeLink.value);
42
43
  const activeLinkRef = computed({
@@ -57,12 +58,16 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
57
58
  const getCurrentContainer = () => props?.getContainer?.() ?? getTargetContainer?.() ?? getDefaultContainer?.();
58
59
  const dependencyListItem = computed(() => JSON.stringify(links.value));
59
60
  const registerLink = (link, targetOffset) => {
60
- if (!links.value.includes(link)) links.value.push(link);
61
- if (targetOffset !== void 0) linkTargetOffsetRef.value[link] = targetOffset;
61
+ if (!linkList.includes(link)) {
62
+ linkList = [...linkList, link];
63
+ links.value = linkList;
64
+ }
65
+ if (targetOffset !== void 0) linkTargetOffsets[link] = targetOffset;
62
66
  };
63
67
  const unregisterLink = (link) => {
64
- links.value = links.value.filter((item) => item !== link);
65
- delete linkTargetOffsetRef.value[link];
68
+ linkList = linkList.filter((item) => item !== link);
69
+ links.value = linkList;
70
+ delete linkTargetOffsets[link];
66
71
  };
67
72
  const updateInk = () => {
68
73
  const linkNode = wrapperRef.value?.querySelector(`.${prefixCls.value}-link-title-active`);
@@ -88,7 +93,7 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
88
93
  const target = document.getElementById(sharpLinkMatch[1]);
89
94
  if (target) {
90
95
  const top = getOffsetTop(target, container);
91
- if (top <= (linkTargetOffsetRef.value[link] ?? _offsetTop) + _bounds) linkSections.push({
96
+ if (top <= (linkTargetOffsets[link] ?? _offsetTop) + _bounds) linkSections.push({
92
97
  link,
93
98
  top
94
99
  });
@@ -91,12 +91,11 @@ const prepareComponentToken = (token) => ({
91
91
  linkPaddingInlineStart: token.padding
92
92
  });
93
93
  var style_default = genStyleHooks("Anchor", (token) => {
94
- const { fontSize, fontSizeLG, paddingXXS, calc } = token;
94
+ const { fontSize, paddingXXS, calc } = token;
95
95
  const anchorToken = mergeToken(token, {
96
96
  holderOffsetBlock: paddingXXS,
97
97
  anchorPaddingBlockSecondary: calc(paddingXXS).div(2).equal(),
98
- anchorTitleBlock: calc(fontSize).div(14).mul(3).equal(),
99
- anchorBallSize: calc(fontSizeLG).div(2).equal()
98
+ anchorTitleBlock: calc(fontSize).div(14).mul(3).equal()
100
99
  });
101
100
  return [genSharedAnchorStyle(anchorToken), genSharedAnchorHorizontalStyle(anchorToken)];
102
101
  }, prepareComponentToken);