antdv-next 1.4.6 → 1.5.1

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 (193) hide show
  1. package/dist/_util/hooks/useMergeSemantic.d.ts +7 -4
  2. package/dist/_util/hooks/useMergeSemantic.js +8 -3
  3. package/dist/_util/is.d.ts +9 -1
  4. package/dist/_util/is.js +25 -2
  5. package/dist/_util/scrollTo.d.ts +1 -1
  6. package/dist/_util/scrollTo.js +17 -5
  7. package/dist/_util/vueNode.d.ts +6 -2
  8. package/dist/alert/Alert.js +1 -1
  9. package/dist/alert/style/index.d.ts +5 -0
  10. package/dist/alert/style/index.js +2 -1
  11. package/dist/antd-with-locales.esm.js +12939 -12342
  12. package/dist/antd-with-locales.js +80 -80
  13. package/dist/antd.css +1 -1
  14. package/dist/antd.esm.js +10123 -9740
  15. package/dist/antd.js +55 -55
  16. package/dist/app/App.js +2 -1
  17. package/dist/avatar/AvatarGroup.d.ts +4 -1
  18. package/dist/avatar/AvatarGroup.js +6 -4
  19. package/dist/avatar/index.d.ts +2 -2
  20. package/dist/badge/Ribbon.d.ts +4 -1
  21. package/dist/badge/Ribbon.js +11 -11
  22. package/dist/badge/index.d.ts +3 -2
  23. package/dist/badge/index.js +26 -24
  24. package/dist/border-beam/BorderBeam.d.ts +4 -0
  25. package/dist/border-beam/BorderBeam.js +48 -12
  26. package/dist/border-beam/hooks/useBorderSize.d.ts +3 -7
  27. package/dist/border-beam/hooks/useBorderSize.js +31 -25
  28. package/dist/border-beam/style/index.js +13 -12
  29. package/dist/border-beam/util.d.ts +4 -1
  30. package/dist/border-beam/util.js +7 -2
  31. package/dist/breadcrumb/Breadcrumb.d.ts +4 -1
  32. package/dist/breadcrumb/Breadcrumb.js +12 -7
  33. package/dist/breadcrumb/index.d.ts +2 -2
  34. package/dist/button/Button.js +5 -14
  35. package/dist/button/style/index.js +0 -1
  36. package/dist/calendar/generateCalendar.d.ts +4 -1
  37. package/dist/calendar/generateCalendar.js +8 -5
  38. package/dist/calendar/index.d.ts +2 -2
  39. package/dist/calendar/locale/sq_AL.d.ts +2 -0
  40. package/dist/calendar/locale/sq_AL.js +5 -0
  41. package/dist/card/CardGrid.d.ts +4 -1
  42. package/dist/card/CardGrid.js +7 -4
  43. package/dist/card/CardMeta.d.ts +4 -1
  44. package/dist/card/CardMeta.js +5 -3
  45. package/dist/card/index.d.ts +3 -3
  46. package/dist/carousel/index.d.ts +1 -0
  47. package/dist/carousel/index.js +8 -8
  48. package/dist/checkbox/Group.js +3 -3
  49. package/dist/color-picker/ColorPicker.js +4 -7
  50. package/dist/components.d.ts +27 -21
  51. package/dist/components.js +6 -3
  52. package/dist/config-provider/context.d.ts +28 -8
  53. package/dist/config-provider/define.d.ts +4 -1
  54. package/dist/config-provider/index.js +29 -0
  55. package/dist/date-picker/generatePicker/generateRangePicker.js +2 -5
  56. package/dist/date-picker/generatePicker/generateSinglePicker.js +2 -5
  57. package/dist/date-picker/generatePicker/useComponents.d.ts +1 -1
  58. package/dist/date-picker/hooks/useMergedPickerSemantic.d.ts +1 -1
  59. package/dist/date-picker/hooks/useMergedPickerSemantic.js +7 -3
  60. package/dist/date-picker/locale/sq_AL.d.ts +6 -0
  61. package/dist/date-picker/locale/sq_AL.js +72 -0
  62. package/dist/date-picker/locale/zh_TW.js +2 -2
  63. package/dist/date-picker/util.d.ts +2 -2
  64. package/dist/descriptions/hooks/useItems.d.ts +4 -4
  65. package/dist/descriptions/index.d.ts +4 -1
  66. package/dist/descriptions/index.js +5 -2
  67. package/dist/divider/index.d.ts +4 -1
  68. package/dist/divider/index.js +9 -6
  69. package/dist/drawer/DrawerPanel.js +5 -3
  70. package/dist/drawer/index.js +9 -13
  71. package/dist/drawer/style/index.js +1 -0
  72. package/dist/dropdown/dropdown.js +4 -6
  73. package/dist/empty/index.d.ts +4 -1
  74. package/dist/empty/index.js +5 -2
  75. package/dist/float-button/BackTop.d.ts +2 -0
  76. package/dist/float-button/BackTop.js +27 -44
  77. package/dist/float-button/FloatButtonGroup.d.ts +4 -1
  78. package/dist/float-button/FloatButtonGroup.js +5 -4
  79. package/dist/float-button/hooks/useScroll.d.ts +16 -0
  80. package/dist/float-button/hooks/useScroll.js +80 -0
  81. package/dist/float-button/index.d.ts +2 -2
  82. package/dist/float-button/style/button.js +17 -0
  83. package/dist/form/ErrorList.js +2 -2
  84. package/dist/form/FormItem/index.js +23 -24
  85. package/dist/form/context.d.ts +1 -1
  86. package/dist/form/hooks/useVariant.d.ts +2 -2
  87. package/dist/form/hooks/useVariant.js +15 -5
  88. package/dist/form/types.d.ts +11 -3
  89. package/dist/form/utils/validateUtil.js +4 -0
  90. package/dist/image/hooks/usePreviewConfig.d.ts +6 -5
  91. package/dist/image/index.js +8 -9
  92. package/dist/index.d.ts +27 -21
  93. package/dist/index.js +3 -2
  94. package/dist/input/OTP/index.js +6 -3
  95. package/dist/input/Password.js +4 -1
  96. package/dist/input/Search.js +11 -6
  97. package/dist/input/index.d.ts +1 -1
  98. package/dist/input/style/token.js +2 -1
  99. package/dist/input/style/variants.js +1 -1
  100. package/dist/layout/Sider.d.ts +2 -0
  101. package/dist/layout/Sider.js +14 -2
  102. package/dist/listy/index.d.ts +12 -0
  103. package/dist/listy/index.js +119 -0
  104. package/dist/listy/interface.d.ts +21 -0
  105. package/dist/listy/interface.js +1 -0
  106. package/dist/listy/style/index.d.ts +23 -0
  107. package/dist/listy/style/index.js +57 -0
  108. package/dist/locale/sq_AL.d.ts +5 -0
  109. package/dist/locale/sq_AL.js +151 -0
  110. package/dist/locale/zh_TW.js +41 -41
  111. package/dist/masonry/Masonry.js +4 -4
  112. package/dist/mentions/index.d.ts +1 -0
  113. package/dist/mentions/index.js +4 -0
  114. package/dist/message/useMessage.js +4 -4
  115. package/dist/modal/PurePanel.js +4 -7
  116. package/dist/notification/useNotification.js +4 -5
  117. package/dist/package.js +1 -1
  118. package/dist/package.json.d.ts +1 -0
  119. package/dist/pagination/Pagination.js +14 -6
  120. package/dist/pagination/index.d.ts +2 -2
  121. package/dist/pagination/interface.d.ts +20 -3
  122. package/dist/popconfirm/index.js +17 -8
  123. package/dist/popover/PurePanel.js +10 -0
  124. package/dist/popover/index.js +24 -16
  125. package/dist/qrcode/index.d.ts +4 -1
  126. package/dist/qrcode/index.js +16 -13
  127. package/dist/rate/style/index.js +12 -9
  128. package/dist/result/index.d.ts +4 -1
  129. package/dist/result/index.js +7 -4
  130. package/dist/select/style/dropdown.js +4 -0
  131. package/dist/select/style/select-input.js +1 -1
  132. package/dist/select/style/token.js +4 -2
  133. package/dist/skeleton/Skeleton.d.ts +4 -1
  134. package/dist/skeleton/Skeleton.js +10 -4
  135. package/dist/skeleton/index.d.ts +2 -2
  136. package/dist/slider/SliderTooltip.js +5 -0
  137. package/dist/slider/index.d.ts +5 -1
  138. package/dist/slider/index.js +9 -9
  139. package/dist/space/Compact.d.ts +4 -1
  140. package/dist/space/Compact.js +8 -3
  141. package/dist/space/index.d.ts +2 -2
  142. package/dist/space/index.js +3 -3
  143. package/dist/spin/index.d.ts +4 -1
  144. package/dist/spin/index.js +7 -5
  145. package/dist/splitter/SplitBar.js +1 -12
  146. package/dist/splitter/Splitter.d.ts +4 -1
  147. package/dist/splitter/Splitter.js +4 -2
  148. package/dist/splitter/index.d.ts +2 -2
  149. package/dist/splitter/style/index.js +2 -1
  150. package/dist/statistic/Statistic.d.ts +4 -1
  151. package/dist/statistic/index.d.ts +2 -2
  152. package/dist/steps/index.js +6 -8
  153. package/dist/steps/style/index.js +2 -1
  154. package/dist/table/style/virtual.js +4 -0
  155. package/dist/table/util.d.ts +1 -1
  156. package/dist/tag/hooks/useColor.d.ts +1 -1
  157. package/dist/tag/index.js +3 -3
  158. package/dist/theme/interface/components.d.ts +70 -68
  159. package/dist/theme/interface/seeds.d.ts +8 -0
  160. package/dist/theme/themes/seed.js +1 -0
  161. package/dist/theme/util/alias.js +1 -1
  162. package/dist/time-picker/locale/sq_AL.d.ts +5 -0
  163. package/dist/time-picker/locale/sq_AL.js +7 -0
  164. package/dist/timeline/Timeline.js +5 -7
  165. package/dist/tooltip/PurePanel.js +5 -0
  166. package/dist/tooltip/index.d.ts +1 -0
  167. package/dist/tooltip/index.js +27 -13
  168. package/dist/tour/PurePanel.js +0 -8
  169. package/dist/tour/index.js +10 -13
  170. package/dist/tour/interface.d.ts +4 -6
  171. package/dist/tour/panelRender.js +8 -2
  172. package/dist/transfer/Transfer.d.ts +4 -1
  173. package/dist/transfer/Transfer.js +5 -2
  174. package/dist/transfer/index.d.ts +2 -2
  175. package/dist/tree/index.d.ts +3 -2
  176. package/dist/tree/index.js +3 -2
  177. package/dist/tree/style/index.js +4 -0
  178. package/dist/typography/Base/EllipsisTooltip.d.ts +6 -1
  179. package/dist/typography/Base/EllipsisTooltip.js +2 -2
  180. package/dist/typography/Base/index.js +9 -26
  181. package/dist/typography/hooks/useCopyClick.d.ts +1 -1
  182. package/dist/typography/hooks/useCopyClick.js +5 -15
  183. package/dist/upload/Upload.js +7 -9
  184. package/dist/upload/UploadList/ListItem.js +4 -12
  185. package/dist/upload/index.d.ts +2 -2
  186. package/dist/watermark/index.d.ts +4 -1
  187. package/dist/watermark/index.js +2 -1
  188. package/global.d.ts +1 -0
  189. package/package.json +10 -9
  190. package/web-tags.json +1384 -1338
  191. package/web-types.json +4584 -4467
  192. package/dist/slider/useRafLock.d.ts +0 -5
  193. package/dist/slider/useRafLock.js +0 -23
@@ -48,11 +48,14 @@ declare function useToProps<T>(props: Ref<T>): import("vue").ComputedRef<{
48
48
  * semantic `{ root: style }` object so it can be merged into the `styles` list at a
49
49
  * defined priority instead of being applied directly on the root element (which would
50
50
  * clobber the semantic `styles.root`). Aligns root semantic style priority.
51
- * sync ant-design#58474
51
+ *
52
+ * `key` lets components whose legacy inline `style` targets a non-root semantic node
53
+ * (e.g. Drawer `section`, Upload `trigger`, Badge `indicator`) reuse the same wrapper.
54
+ * It accepts a ref for the cases where the target node depends on the current props
55
+ * (e.g. Badge switches between `root` and `indicator`).
56
+ * sync ant-design#58474 ant-design#58564
52
57
  */
53
- declare function useSemanticRootStyle<Style = CSSProperties>(style: Ref<Style | undefined>): import("vue").ComputedRef<{
54
- root: NonNullable<Style>;
55
- } | undefined>;
58
+ declare function useSemanticRootStyle<Style = CSSProperties, Key extends string = 'root'>(style: Ref<Style | undefined>, key?: Key | Ref<Key>): import("vue").ComputedRef<Partial<Record<Key, Style>> | undefined>;
56
59
  interface RemoveBaseAttributesOptions {
57
60
  class?: boolean;
58
61
  style?: boolean;
@@ -97,10 +97,15 @@ function useToProps(props) {
97
97
  * semantic `{ root: style }` object so it can be merged into the `styles` list at a
98
98
  * defined priority instead of being applied directly on the root element (which would
99
99
  * clobber the semantic `styles.root`). Aligns root semantic style priority.
100
- * sync ant-design#58474
100
+ *
101
+ * `key` lets components whose legacy inline `style` targets a non-root semantic node
102
+ * (e.g. Drawer `section`, Upload `trigger`, Badge `indicator`) reuse the same wrapper.
103
+ * It accepts a ref for the cases where the target node depends on the current props
104
+ * (e.g. Badge switches between `root` and `indicator`).
105
+ * sync ant-design#58474 ant-design#58564
101
106
  */
102
- function useSemanticRootStyle(style) {
103
- return computed(() => style.value ? { root: style.value } : void 0);
107
+ function useSemanticRootStyle(style, key = "root") {
108
+ return computed(() => style.value ? { [unref(key)]: style.value } : void 0);
104
109
  }
105
110
  const defaultOptions = {
106
111
  class: true,
@@ -1,4 +1,12 @@
1
1
  //#region src/_util/is.d.ts
2
+ declare function isNonNullable<T>(val: T): val is NonNullable<T>;
2
3
  declare function isRenderable<T>(val: T): val is Exclude<NonNullable<T>, false | ''>;
4
+ declare function isNumber(val: any): val is number;
5
+ declare function isString(val: any): val is string;
6
+ declare function isPlainObject<T extends object = object>(val: any): val is T;
7
+ declare function isFunction<Value, Args extends unknown[], Result>(val: Value | ((...args: Args) => Result)): val is (...args: Args) => Result;
8
+ declare function isThenable<T>(val?: PromiseLike<T>): val is PromiseLike<T>;
9
+ declare function isPrimitive(val: any): boolean;
10
+ declare function isTransitionEvent(event: Event): event is TransitionEvent;
3
11
  //#endregion
4
- export { isRenderable };
12
+ export { isFunction, isNonNullable, isNumber, isPlainObject, isPrimitive, isRenderable, isString, isThenable, isTransitionEvent };
package/dist/_util/is.js CHANGED
@@ -1,7 +1,30 @@
1
- import isNonNullable from "./isNonNullable.js";
2
1
  //#region src/_util/is.ts
2
+ function isNonNullable(val) {
3
+ return val !== void 0 && val !== null;
4
+ }
3
5
  function isRenderable(val) {
4
6
  return isNonNullable(val) && val !== false && val !== "";
5
7
  }
8
+ function isNumber(val) {
9
+ return typeof val === "number" && !Number.isNaN(val);
10
+ }
11
+ function isString(val) {
12
+ return typeof val === "string";
13
+ }
14
+ function isPlainObject(val) {
15
+ return val !== null && typeof val === "object";
16
+ }
17
+ function isFunction(val) {
18
+ return typeof val === "function";
19
+ }
20
+ function isThenable(val) {
21
+ return isNonNullable(val) && isFunction(val.then);
22
+ }
23
+ function isPrimitive(val) {
24
+ return typeof val !== "object" && !isFunction(val) || val === null;
25
+ }
26
+ function isTransitionEvent(event) {
27
+ return isPlainObject(event) && "propertyName" in event && isString(event.propertyName);
28
+ }
6
29
  //#endregion
7
- export { isRenderable };
30
+ export { isFunction, isNonNullable, isNumber, isPlainObject, isPrimitive, isRenderable, isString, isThenable, isTransitionEvent };
@@ -7,6 +7,6 @@ interface ScrollToOptions {
7
7
  /** Animation duration, default as 450 */
8
8
  duration?: number;
9
9
  }
10
- declare function scrollTo(y: number, options?: ScrollToOptions): void;
10
+ declare function scrollTo(y: number, options?: ScrollToOptions): () => void;
11
11
  //#endregion
12
12
  export { scrollTo as default };
@@ -6,17 +6,29 @@ function scrollTo(y, options = {}) {
6
6
  const { getContainer = () => window, callback, duration = 450 } = options;
7
7
  const container = getContainer();
8
8
  const scrollTop = getScroll(container);
9
+ const scroll = (top) => {
10
+ if (isWindow(container)) container.scrollTo(window.pageXOffset, top);
11
+ else if (isDocument(container)) container.documentElement.scrollTop = top;
12
+ else container.scrollTop = top;
13
+ };
14
+ if (duration <= 0) {
15
+ scroll(y);
16
+ if (typeof callback === "function") callback();
17
+ return () => {};
18
+ }
9
19
  const startTime = Date.now();
20
+ let rafId;
10
21
  const frameFunc = () => {
11
22
  const time = Date.now() - startTime;
12
23
  const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
13
- if (isWindow(container)) container.scrollTo(window.pageXOffset, nextScrollTop);
14
- else if (isDocument(container)) container.documentElement.scrollTop = nextScrollTop;
15
- else container.scrollTop = nextScrollTop;
16
- if (time < duration) raf(frameFunc);
24
+ scroll(nextScrollTop);
25
+ if (time < duration) rafId = raf(frameFunc);
17
26
  else if (typeof callback === "function") callback();
18
27
  };
19
- raf(frameFunc);
28
+ rafId = raf(frameFunc);
29
+ return () => {
30
+ raf.cancel(rafId);
31
+ };
20
32
  }
21
33
  //#endregion
22
34
  export { scrollTo as default };
@@ -3,8 +3,12 @@ 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): VNodeChild;
7
- declare function cloneElement(element: VNodeChild, props?: RenderProps): VNodeChild;
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;
8
12
  declare function getVNode(node: VueNode): VNodeChild;
9
13
  declare function checkRenderNode(node: any): any;
10
14
  declare function getTextByNode(node: any): any;
@@ -185,7 +185,7 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
185
185
  const { className, style } = getAttrStyleAndClass(attrs);
186
186
  const isClosableFn = () => {
187
187
  const closeIcon = getSlotPropsFnRun(slots, props, "closeIcon");
188
- if (typeof closable === "object" && closable.closeIcon) return true;
188
+ if (typeof closable === "object") return true;
189
189
  if (typeof closable === "boolean") return closable;
190
190
  const closeIconNode = typeof closeIcon === "function" ? filterEmpty(closeIcon()) : closeIcon;
191
191
  if (Array.isArray(closeIconNode) && closeIconNode.length > 0) return true;
@@ -5,6 +5,11 @@ import { CSSProperties } from "vue";
5
5
  import { CSSObject } from "@antdv-next/cssinjs";
6
6
  //#region src/alert/style/index.d.ts
7
7
  interface ComponentToken {
8
+ /**
9
+ * @desc 组件圆角
10
+ * @descEN Border radius of alert
11
+ */
12
+ borderRadius: CSSProperties['borderRadius'];
8
13
  /**
9
14
  * @desc 默认内间距
10
15
  * @descEN Default padding
@@ -10,7 +10,7 @@ function genAlertTypeStyle(bgColor, borderColor, iconColor, token, alertCls) {
10
10
  };
11
11
  }
12
12
  const genBaseStyle = (token) => {
13
- const { componentCls, motionDurationSlow: duration, marginXS, marginSM, fontSize, fontSizeLG, lineHeight, borderRadiusLG: borderRadius, motionEaseInOutCirc, withDescriptionIconSize, colorText, colorTextHeading, withDescriptionPadding, defaultPadding } = token;
13
+ const { componentCls, motionDurationSlow: duration, marginXS, marginSM, fontSize, fontSizeLG, lineHeight, motionEaseInOutCirc, borderRadius, withDescriptionIconSize, colorText, colorTextHeading, withDescriptionPadding, defaultPadding } = token;
14
14
  return { [componentCls]: {
15
15
  ...resetComponent(token),
16
16
  position: "relative",
@@ -122,6 +122,7 @@ const genActionStyle = (token) => {
122
122
  };
123
123
  const prepareComponentToken = (token) => {
124
124
  return {
125
+ borderRadius: token.borderRadiusLG,
125
126
  withDescriptionIconSize: token.fontSizeHeading3,
126
127
  defaultPadding: `${token.paddingContentVerticalSM}px 12px`,
127
128
  withDescriptionPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`