antdv-next 1.4.6 → 1.5.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 (56) hide show
  1. package/dist/_util/is.d.ts +9 -1
  2. package/dist/_util/is.js +25 -2
  3. package/dist/_util/scrollTo.d.ts +1 -1
  4. package/dist/_util/scrollTo.js +17 -5
  5. package/dist/_util/statusUtils.d.ts +1 -1
  6. package/dist/_util/vueNode.d.ts +6 -2
  7. package/dist/alert/Alert.js +1 -1
  8. package/dist/antd-with-locales.esm.js +10428 -9738
  9. package/dist/antd-with-locales.js +50 -50
  10. package/dist/antd.css +1 -1
  11. package/dist/antd.esm.js +7047 -6357
  12. package/dist/antd.js +47 -47
  13. package/dist/app/App.js +2 -1
  14. package/dist/border-beam/BorderBeam.d.ts +3 -0
  15. package/dist/border-beam/BorderBeam.js +18 -1
  16. package/dist/border-beam/hooks/useBorderSize.js +8 -1
  17. package/dist/border-beam/style/index.js +5 -5
  18. package/dist/border-beam/util.d.ts +2 -1
  19. package/dist/border-beam/util.js +4 -2
  20. package/dist/button/buttonHelper.d.ts +1 -1
  21. package/dist/checkbox/Group.js +3 -3
  22. package/dist/components.d.ts +3 -1
  23. package/dist/components.js +3 -1
  24. package/dist/config-provider/context.d.ts +5 -1
  25. package/dist/config-provider/define.d.ts +3 -1
  26. package/dist/config-provider/index.js +19 -0
  27. package/dist/date-picker/generatePicker/useComponents.d.ts +1 -1
  28. package/dist/date-picker/util.d.ts +8 -4
  29. package/dist/descriptions/hooks/useItems.d.ts +6 -6
  30. package/dist/float-button/BackTop.js +2 -1
  31. package/dist/form/context.d.ts +1 -1
  32. package/dist/form/hooks/useVariant.d.ts +1 -1
  33. package/dist/image/hooks/usePreviewConfig.d.ts +5 -5
  34. package/dist/index.d.ts +3 -1
  35. package/dist/index.js +2 -1
  36. package/dist/layout/Sider.d.ts +2 -0
  37. package/dist/layout/Sider.js +14 -2
  38. package/dist/listy/index.d.ts +12 -0
  39. package/dist/listy/index.js +119 -0
  40. package/dist/listy/interface.d.ts +20 -0
  41. package/dist/listy/interface.js +1 -0
  42. package/dist/listy/style/index.d.ts +23 -0
  43. package/dist/listy/style/index.js +57 -0
  44. package/dist/package.js +1 -1
  45. package/dist/package.json.d.ts +1 -0
  46. package/dist/select/useIcons.d.ts +6 -2
  47. package/dist/splitter/SplitBar.js +1 -12
  48. package/dist/tag/hooks/useColor.d.ts +1 -1
  49. package/dist/theme/interface/components.d.ts +70 -68
  50. package/dist/tour/PurePanel.js +0 -8
  51. package/dist/tour/interface.d.ts +4 -6
  52. package/dist/tour/panelRender.js +8 -2
  53. package/global.d.ts +1 -0
  54. package/package.json +5 -4
  55. package/web-tags.json +1480 -1463
  56. package/web-types.json +4903 -4851
@@ -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,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" | "error" | "warning" | "validating" | undefined;
6
+ declare function getMergedStatus(contextStatus?: ValidateStatus, customStatus?: InputStatus): "" | "error" | "success" | "warning" | "validating" | undefined;
7
7
  //#endregion
8
8
  export { InputStatus, getMergedStatus, getStatusClassNames };
@@ -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;