antdv-next 1.4.3 → 1.4.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 (42) hide show
  1. package/dist/_util/vueNode.d.ts +2 -6
  2. package/dist/_util/wave/index.js +1 -1
  3. package/dist/antd-with-locales.esm.js +9397 -9361
  4. package/dist/antd-with-locales.js +79 -79
  5. package/dist/antd.css +1 -1
  6. package/dist/antd.esm.js +8282 -8246
  7. package/dist/antd.js +39 -39
  8. package/dist/button/buttonHelper.d.ts +1 -1
  9. package/dist/collapse/style/index.js +1 -1
  10. package/dist/date-picker/generatePicker/useComponents.d.ts +2 -2
  11. package/dist/descriptions/hooks/useItems.d.ts +10 -10
  12. package/dist/form/Form.js +23 -6
  13. package/dist/form/FormItem/index.js +25 -2
  14. package/dist/form/context.d.ts +3 -1
  15. package/dist/form/hooks/useVariant.d.ts +1 -1
  16. package/dist/form/util.d.ts +7 -1
  17. package/dist/form/util.js +9 -1
  18. package/dist/grid/col.js +2 -2
  19. package/dist/image/hooks/usePreviewConfig.d.ts +2 -2
  20. package/dist/input/Search.js +19 -13
  21. package/dist/layout/style/sider.js +1 -1
  22. package/dist/package.js +1 -1
  23. package/dist/radio/style/index.js +1 -5
  24. package/dist/segmented/style/index.js +2 -7
  25. package/dist/splitter/Splitter.js +6 -4
  26. package/dist/tabs/index.d.ts +33 -10
  27. package/dist/tabs/index.js +3 -2
  28. package/dist/tag/hooks/useColor.d.ts +1 -1
  29. package/dist/tag/index.js +1 -0
  30. package/dist/timeline/Timeline.d.ts +6 -6
  31. package/dist/timeline/Timeline.js +21 -4
  32. package/dist/timeline/useItems.d.ts +7 -2
  33. package/dist/timeline/useItems.js +14 -4
  34. package/dist/tour/panelRender.js +2 -8
  35. package/dist/tree/DirectoryTree.js +4 -4
  36. package/dist/tree/Tree.d.ts +3 -1
  37. package/dist/tree/Tree.js +10 -7
  38. package/dist/tree/style/index.js +4 -4
  39. package/dist/typography/style/mixins.js +3 -3
  40. package/package.json +3 -3
  41. package/web-tags.json +679 -679
  42. package/web-types.json +2363 -2362
@@ -2,7 +2,7 @@ import { CSSProperties, VNodeChild } from "vue";
2
2
 
3
3
  //#region src/button/buttonHelper.d.ts
4
4
  declare const isTwoCNChar: (string: string) => boolean;
5
- declare function isUnBorderedButtonVariant(type?: ButtonVariantType): type is "text" | "link";
5
+ declare function isUnBorderedButtonVariant(type?: ButtonVariantType): type is "link" | "text";
6
6
  declare function spaceChildren(children: VNodeChild[], needInserted: boolean, style?: CSSProperties, className?: string): VNodeChild[];
7
7
  declare const _ButtonTypes: readonly ["default", "primary", "dashed", "link", "text"];
8
8
  type ButtonType = (typeof _ButtonTypes)[number];
@@ -114,7 +114,7 @@ const genBorderlessStyle = (token) => {
114
114
  return { [`${componentCls}-borderless`]: {
115
115
  backgroundColor: headerBg,
116
116
  border: 0,
117
- [`> ${componentCls}-item`]: { borderBottom: `1px solid ${colorBorder}` },
117
+ [`> ${componentCls}-item`]: { borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${colorBorder}` },
118
118
  [`
119
119
  > ${componentCls}-item:last-child,
120
120
  > ${componentCls}-item:last-child ${componentCls}-header
@@ -4,11 +4,11 @@ import { Components } from "@v-c/picker";
4
4
  //#region src/date-picker/generatePicker/useComponents.d.ts
5
5
  declare function useComponents(components?: Components): {
6
6
  time?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
7
+ year?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
8
+ month?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
7
9
  date?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
8
10
  week?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
9
- month?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
10
11
  quarter?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
11
- year?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
12
12
  decade?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
13
13
  datetime?: import("vue").DefineComponent<import("@v-c/picker/dist/interface").SharedPanelProps<any>> | undefined;
14
14
  button: string | import("vue").DefineSetupFnComponent<ButtonProps, {}, {}, ButtonProps & {}, import("vue").PublicProps> | import("vue").DefineComponent;
@@ -9,23 +9,23 @@ declare function useItems(screens: Ref<ScreenMap>, items: Ref<DescriptionsItemTy
9
9
  filled: boolean;
10
10
  _$index: number;
11
11
  key?: import("@v-c/util/dist/type").Key;
12
- styles?: CellSemanticStyles | undefined;
13
- style?: import("vue").CSSProperties | undefined;
14
- content?: VueNode;
15
- classes?: CellSemanticClassNames | undefined;
16
- rootClass?: string | undefined;
17
12
  label?: VueNode;
13
+ rootClass?: string | undefined;
14
+ style?: import("vue").CSSProperties | undefined;
15
+ styles?: CellSemanticStyles | undefined;
18
16
  class?: string | undefined;
17
+ classes?: CellSemanticClassNames | undefined;
18
+ content?: VueNode;
19
19
  } | {
20
20
  span: number | undefined;
21
21
  key?: import("@v-c/util/dist/type").Key;
22
- styles?: CellSemanticStyles | undefined;
23
- style?: import("vue").CSSProperties | undefined;
24
- content?: VueNode;
25
- classes?: CellSemanticClassNames | undefined;
26
- rootClass?: string | undefined;
27
22
  label?: VueNode;
23
+ rootClass?: string | undefined;
24
+ style?: import("vue").CSSProperties | undefined;
25
+ styles?: CellSemanticStyles | undefined;
28
26
  class?: string | undefined;
27
+ classes?: CellSemanticClassNames | undefined;
28
+ content?: VueNode;
29
29
  _$index: number;
30
30
  })[]>;
31
31
  //#endregion
package/dist/form/Form.js CHANGED
@@ -8,7 +8,7 @@ import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
8
8
  import { useDisabledContext, useDisabledContextProvider } from "../config-provider/DisabledContext.js";
9
9
  import useLocale from "../locale/useLocale.js";
10
10
  import { NoFormStyle, useFormContextProvider, useVariantContextProvider } from "./context.js";
11
- import { getFieldId, toArray } from "./util.js";
11
+ import { getFieldId, toArray, toNamePathStr } from "./util.js";
12
12
  import { FormHookRegistryKey, FormInstanceContextKey } from "./hooks/useForm.js";
13
13
  import style_default from "./style/index.js";
14
14
  import { allPromiseFinish } from "./utils/asyncUtil.js";
@@ -19,6 +19,7 @@ import { computed, createVNode, defineComponent, getCurrentInstance, inject, mer
19
19
  import { clsx, get, set } from "@v-c/util";
20
20
  import { pick } from "es-toolkit";
21
21
  import scrollIntoView from "scroll-into-view-if-needed";
22
+ import { getDOM } from "@v-c/util/dist/Dom/findDOMNode";
22
23
  //#region src/form/Form.tsx
23
24
  const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, emit, attrs }) => {
24
25
  const contextDisabled = useDisabledContext();
@@ -81,6 +82,16 @@ const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, em
81
82
  const removeField = (eventKey) => {
82
83
  delete fields.value[eventKey];
83
84
  };
85
+ const items = /* @__PURE__ */ new Map();
86
+ const addItem = (namePathStr, instance) => {
87
+ items.set(namePathStr, instance);
88
+ };
89
+ const removeItem = (namePathStr) => {
90
+ items.delete(namePathStr);
91
+ };
92
+ const getFieldInstance = (name) => {
93
+ return items.get(toNamePathStr(getNamePath(name)));
94
+ };
84
95
  const getFieldsByNameList = (namePathList, partialMatch = false) => {
85
96
  const mergedNamePathList = namePathList?.length ? namePathList : void 0;
86
97
  const fieldList = Object.values(fields.value);
@@ -201,6 +212,8 @@ const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, em
201
212
  feedbackIcons: feedbackIcons.value,
202
213
  addField,
203
214
  removeField,
215
+ addItem,
216
+ removeItem,
204
217
  onValidate,
205
218
  triggerValuesChange,
206
219
  triggerFieldsChange,
@@ -327,16 +340,20 @@ const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, em
327
340
  scrollToField(getNamePath(name), options);
328
341
  },
329
342
  focusField: (name) => {
343
+ const instance = getFieldInstance(name);
344
+ if (typeof instance?.focus === "function") {
345
+ try {
346
+ instance.focus();
347
+ } finally {}
348
+ return;
349
+ }
330
350
  const targetId = getFieldId(getNamePath(name), props.name);
331
- const node = targetId ? document.getElementById(targetId) : null;
351
+ const node = getDOM(instance) ?? (targetId ? document.getElementById(targetId) : null);
332
352
  if (node) try {
333
353
  node.focus?.();
334
354
  } finally {}
335
355
  },
336
- getFieldInstance: (name) => {
337
- const targetId = getFieldId(getNamePath(name), props.name);
338
- if (targetId) return fields.value?.[targetId];
339
- }
356
+ getFieldInstance
340
357
  };
341
358
  expose(formInstance);
342
359
  provide(FormInstanceContextKey, formInstance);
@@ -3,7 +3,7 @@ import { getSlotPropsFnRun } from "../../_util/tools.js";
3
3
  import useCSSVarCls from "../../config-provider/hooks/useCSSVarCls.js";
4
4
  import { checkRenderNode } from "../../_util/vueNode.js";
5
5
  import { useFormContext, useFormItemProvider, useNoStyleItemContext } from "../context.js";
6
- import { getFieldId, initialValueFormat, toArray } from "../util.js";
6
+ import { getFieldId, initialValueFormat, toArray, toNamePathStr } from "../util.js";
7
7
  import style_default from "../style/index.js";
8
8
  import { getNamePath, getValue, setValue } from "../utils/valueUtil.js";
9
9
  import { validateRules } from "../utils/validateUtil.js";
@@ -250,6 +250,24 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
250
250
  });
251
251
  const rootClassName = computed(() => clsx(cssVarCls.value, rootCls.value, hashId.value, props.rootClass));
252
252
  const eventKey = computed(() => `form-item-${fieldId.value || namePath.value.join("-") || Math.random().toString(36).slice(2)}`);
253
+ let itemInstanceKey;
254
+ let itemInstance = null;
255
+ const setItemInstance = (instance) => {
256
+ itemInstance = instance;
257
+ if (!hasName.value) return;
258
+ const nextKey = toNamePathStr(namePath.value);
259
+ if (itemInstanceKey && itemInstanceKey !== nextKey) formContext.value?.removeItem?.(itemInstanceKey);
260
+ itemInstanceKey = nextKey;
261
+ if (instance) formContext.value?.addItem?.(nextKey, instance);
262
+ else formContext.value?.removeItem?.(nextKey);
263
+ };
264
+ watch([namePath, hasName], () => {
265
+ if (itemInstanceKey) {
266
+ formContext.value?.removeItem?.(itemInstanceKey);
267
+ itemInstanceKey = void 0;
268
+ }
269
+ if (itemInstance) setItemInstance(itemInstance);
270
+ }, { flush: "post" });
253
271
  watch(hasName, (val, _, onCleanup) => {
254
272
  if (val && formContext.value?.addField) {
255
273
  formContext.value.addField(eventKey.value, {
@@ -284,6 +302,10 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
284
302
  destroy: true
285
303
  }, meta.value.name);
286
304
  formContext.value?.removeField?.(eventKey.value);
305
+ if (itemInstanceKey) {
306
+ formContext.value?.removeItem?.(itemInstanceKey);
307
+ itemInstanceKey = void 0;
308
+ }
287
309
  });
288
310
  useFormItemProvider({
289
311
  fieldId,
@@ -318,7 +340,8 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
318
340
  if (typeof fn === "function") fn(...args);
319
341
  });
320
342
  else _onFocus?.(...args);
321
- }
343
+ },
344
+ ref: setItemInstance
322
345
  });
323
346
  }
324
347
  if (props.noStyle && !props.hidden) return createVNode(StatusProvider, {
@@ -45,6 +45,8 @@ interface FormContextProps {
45
45
  clearOnDestroy?: boolean;
46
46
  addField?: (eventKey: string, field: FormFieldRegister) => void;
47
47
  removeField?: (eventKey: string) => void;
48
+ addItem?: (namePathStr: string, instance: any) => void;
49
+ removeItem?: (namePathStr: string) => void;
48
50
  onValidate?: (name: InternalNamePath, status: boolean, errors: any[] | null) => void;
49
51
  triggerValuesChange?: (namePath: InternalNamePath, value: any) => void;
50
52
  triggerFieldsChange?: (namePathList?: InternalNamePath[]) => void;
@@ -69,7 +71,7 @@ declare function useFormItemPrefixContext(): Ref<{
69
71
  prefixCls: string;
70
72
  }>;
71
73
  declare function useVariantContextProvider(variant: Ref<Variant | undefined>): void;
72
- declare function useVariantContext(): Ref<"outlined" | "borderless" | "filled" | "underlined" | undefined, "outlined" | "borderless" | "filled" | "underlined" | undefined>;
74
+ declare function useVariantContext(): Ref<"filled" | "outlined" | "borderless" | "underlined" | undefined, "filled" | "outlined" | "borderless" | "underlined" | undefined>;
73
75
  interface FormItemStatusContextProps {
74
76
  isFormItemInput?: boolean;
75
77
  status?: ValidateStatus;
@@ -4,7 +4,7 @@ import { Ref } from "vue";
4
4
 
5
5
  //#region src/form/hooks/useVariant.d.ts
6
6
  type VariantComponents = keyof Pick<ConfigProviderProps, 'input' | 'inputNumber' | 'textArea' | 'mentions' | 'select' | 'cascader' | 'treeSelect' | 'datePicker' | 'timePicker' | 'rangePicker' | 'card'>;
7
- declare function useVariant(component: VariantComponents, variant?: Ref<Variant | undefined>, legacyBordered?: Ref<boolean | undefined> | boolean): readonly [import("vue").ComputedRef<"outlined" | "borderless" | "filled" | "underlined">, import("vue").ComputedRef<boolean>];
7
+ declare function useVariant(component: VariantComponents, variant?: Ref<Variant | undefined>, legacyBordered?: Ref<boolean | undefined> | boolean): readonly [import("vue").ComputedRef<"filled" | "outlined" | "borderless" | "underlined">, import("vue").ComputedRef<boolean>];
8
8
  declare const useVariants: typeof useVariant;
9
9
  //#endregion
10
10
  export { useVariant as default, useVariants };
@@ -3,6 +3,12 @@ import { ValidateStatus } from "./FormItem/index.js";
3
3
 
4
4
  //#region src/form/util.d.ts
5
5
  declare function toArray<T>(candidate?: T | T[] | false): T[];
6
+ /**
7
+ * Key used to track the rendered control instance of a Form.Item.
8
+ * Unlike `getFieldId`, this is not prefixed with the form name, so it stays
9
+ * stable no matter whether the Form declares a `name`.
10
+ */
11
+ declare function toNamePathStr(namePath: InternalNamePath): string;
6
12
  declare function getFieldId(namePath: InternalNamePath, formName?: string): string | undefined;
7
13
  /**
8
14
  * Get merged status by meta or passed `validateStatus`.
@@ -10,4 +16,4 @@ declare function getFieldId(namePath: InternalNamePath, formName?: string): stri
10
16
  declare function getStatus<DefaultValue>(errors: any[], warnings: any[], meta: Meta, defaultValidateStatus: ValidateStatus | DefaultValue, hasFeedback?: boolean, validateStatus?: ValidateStatus): ValidateStatus | DefaultValue;
11
17
  declare function initialValueFormat(value: any): any;
12
18
  //#endregion
13
- export { getFieldId, getStatus, initialValueFormat, toArray };
19
+ export { getFieldId, getStatus, initialValueFormat, toArray, toNamePathStr };
package/dist/form/util.js CHANGED
@@ -10,6 +10,14 @@ function toArray(candidate) {
10
10
  if (candidate === void 0 || candidate === false) return [];
11
11
  return Array.isArray(candidate) ? candidate : [candidate];
12
12
  }
13
+ /**
14
+ * Key used to track the rendered control instance of a Form.Item.
15
+ * Unlike `getFieldId`, this is not prefixed with the form name, so it stays
16
+ * stable no matter whether the Form declares a `name`.
17
+ */
18
+ function toNamePathStr(namePath) {
19
+ return namePath.join("_");
20
+ }
13
21
  function getFieldId(namePath, formName) {
14
22
  if (!namePath.length) return;
15
23
  const mergedId = namePath.join("_");
@@ -34,4 +42,4 @@ function initialValueFormat(value) {
34
42
  return value;
35
43
  }
36
44
  //#endregion
37
- export { getFieldId, getStatus, initialValueFormat, toArray };
45
+ export { getFieldId, getStatus, initialValueFormat, toArray, toNamePathStr };
package/dist/grid/col.js CHANGED
@@ -40,7 +40,7 @@ const Col = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
40
40
  [`${prefixCls.value}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0,
41
41
  [`${prefixCls.value}-rtl`]: configCtx.value.direction === "rtl"
42
42
  };
43
- if (sizeProps.flex) {
43
+ if (sizeProps.flex || sizeProps.flex === 0) {
44
44
  sizeClassObj[`${prefixCls.value}-${size}-flex`] = true;
45
45
  sizeStyle[varName(`${size}-flex`)] = parseFlex(sizeProps.flex);
46
46
  }
@@ -58,7 +58,7 @@ const Col = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
58
58
  mergedStyle.paddingLeft = `${horizontalGutter}px`;
59
59
  mergedStyle.paddingRight = `${horizontalGutter}px`;
60
60
  }
61
- if (flex) {
61
+ if (flex || flex === 0) {
62
62
  mergedStyle.flex = parseFlex(flex);
63
63
  if (wrap?.value === false && !mergedStyle.minWidth) mergedStyle.minWidth = 0;
64
64
  }
@@ -37,12 +37,12 @@ declare function usePreviewConfig<T extends PreviewConfig | GroupPreviewConfig>(
37
37
  image: import("@v-c/image").ImgInfo;
38
38
  }) => import("@v-c/util").VueNode;
39
39
  readonly onChange?: (current: number, prevCurrent: number) => void;
40
+ readonly zIndex?: number;
41
+ readonly closeIcon?: import("@v-c/util").VueNode | boolean | null;
40
42
  readonly focusTrap?: boolean;
41
43
  readonly afterOpenChange?: (open: boolean) => void;
42
44
  readonly maskClosable?: boolean;
43
- readonly zIndex?: number;
44
45
  readonly getContainer?: import("@v-c/portal/dist/Portal.js").PortalProps["getContainer"];
45
- readonly closeIcon?: import("@v-c/util").VueNode | boolean | null;
46
46
  readonly motionName?: string;
47
47
  readonly src?: string;
48
48
  readonly alt?: string;
@@ -3,6 +3,7 @@ import { useSize } from "../config-provider/hooks/useSize.js";
3
3
  import { useCompactItemContext } from "../space/Compact.js";
4
4
  import { getAttrStyleAndClass, useMergeSemantic, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
5
5
  import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
6
+ import { useDisabledContext } from "../config-provider/DisabledContext.js";
6
7
  import button_default from "../button/index.js";
7
8
  import { SpaceCompact } from "../space/index.js";
8
9
  import InternalInput from "./Input.js";
@@ -32,6 +33,8 @@ const InternalSearch = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
32
33
  const { prefixCls, direction, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, getPrefixCls } = useComponentBaseConfig("inputSearch", props, void 0, "input-search");
33
34
  const inputPrefixCls = computed(() => getPrefixCls("input", props.inputPrefixCls));
34
35
  const { classes, styles, size: customizeSize, disabled: customDisabled, variant } = toPropsRefs(props, "classes", "styles", "size", "disabled", "variant");
36
+ const contextDisabled = useDisabledContext();
37
+ const mergedDisabled = computed(() => customDisabled.value ?? contextDisabled.value);
35
38
  const [hashId, cssVarCls] = search_default(prefixCls);
36
39
  const { compactSize } = useCompactItemContext(prefixCls, direction);
37
40
  const mergedSize = useSize((ctx) => customizeSize.value ?? compactSize.value ?? ctx);
@@ -101,19 +104,22 @@ const InternalSearch = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
101
104
  const isButtonVNode = isVNode(enterButtonNode);
102
105
  const isAntdButton = isButtonVNode && Boolean(enterButtonNode.type?.__ANT_BUTTON);
103
106
  const isNativeButton = isButtonVNode && enterButtonNode.type === "button";
104
- if (isAntdButton || isNativeButton) buttonNode = cloneVNode(enterButtonNode, {
105
- onMousedown: onMouseDown,
106
- onClick: (e) => {
107
- enterButtonNode?.props?.onClick?.(e);
108
- onSearchClick(e);
109
- },
110
- class: clsx(enterButtonNode?.props?.class, btnClassName),
111
- ...isAntdButton ? {
112
- loading: props.loading,
113
- size: mergedSize.value
114
- } : {}
115
- });
116
- else buttonNode = createVNode(button_default, {
107
+ if (isAntdButton || isNativeButton) {
108
+ const enterButtonProps = enterButtonNode?.props ?? {};
109
+ buttonNode = cloneVNode(enterButtonNode, {
110
+ disabled: mergedDisabled.value || enterButtonProps.disabled || !isAntdButton && props.loading,
111
+ onMousedown: onMouseDown,
112
+ onClick: (e) => {
113
+ enterButtonProps.onClick?.(e);
114
+ onSearchClick(e);
115
+ },
116
+ class: clsx(enterButtonProps.class, btnClassName),
117
+ ...isAntdButton ? {
118
+ loading: props.loading || enterButtonProps.loading,
119
+ size: mergedSize.value
120
+ } : {}
121
+ });
122
+ } else buttonNode = createVNode(button_default, {
117
123
  "classes": mergedClassNames.value.button,
118
124
  "styles": mergedStyles.value.button,
119
125
  "class": btnClassName,
@@ -68,7 +68,7 @@ const genSiderStyle = (token) => {
68
68
  [`${componentCls}-zero-width-trigger`]: {
69
69
  color: lightTriggerColor,
70
70
  background: lightTriggerBg,
71
- border: `1px solid ${bodyBg}`,
71
+ border: `${unit(token.lineWidth)} ${token.lineType} ${bodyBg}`,
72
72
  borderInlineStart: 0
73
73
  }
74
74
  }
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "1.4.3";
2
+ var version = "1.4.4";
3
3
  //#endregion
4
4
  export { version };
@@ -1,7 +1,6 @@
1
1
  import { genFocusOutline, resetComponent } from "../../style/index.js";
2
2
  import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
3
3
  import { mergeToken } from "../../theme/internal.js";
4
- import { genNoMotionRawStyle, genNoMotionStyle } from "../../style/motion/util.js";
5
4
  import { unit } from "@antdv-next/cssinjs";
6
5
  //#region src/radio/style/index.ts
7
6
  const getGroupRadioStyle = (token) => {
@@ -90,7 +89,6 @@ const getRadioBasicStyle = (token) => {
90
89
  border: `${unit(lineWidth)} ${lineType} ${colorBorder}`,
91
90
  borderRadius: "50%",
92
91
  transition: `all ${motionDurationMid}`,
93
- ...genNoMotionStyle(),
94
92
  "&:after": {
95
93
  content: "\"\"",
96
94
  position: "absolute",
@@ -103,8 +101,7 @@ const getRadioBasicStyle = (token) => {
103
101
  borderRadius: "50%",
104
102
  transformOrigin: "50% 50%",
105
103
  opacity: 0,
106
- transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`,
107
- ...genNoMotionRawStyle()
104
+ transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`
108
105
  },
109
106
  [`${componentCls}-input`]: {
110
107
  position: "absolute",
@@ -170,7 +167,6 @@ const getRadioButtonStyle = (token) => {
170
167
  `background-color`,
171
168
  `box-shadow`
172
169
  ].map((prop) => `${prop} ${motionDurationMid}`).join(","),
173
- ...genNoMotionStyle(),
174
170
  a: { color: buttonColor },
175
171
  [`> ${componentCls}-button`]: {
176
172
  position: "absolute",
@@ -1,7 +1,6 @@
1
1
  import { genFocusOutline, genFocusStyle, resetComponent, textEllipsis } from "../../style/index.js";
2
2
  import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
3
3
  import { mergeToken } from "../../theme/internal.js";
4
- import { genNoMotionRawStyle, genNoMotionStyle } from "../../style/motion/util.js";
5
4
  import { unit } from "@antdv-next/cssinjs";
6
5
  //#region src/segmented/style/index.ts
7
6
  function getItemDisabledStyle(cls, token) {
@@ -33,7 +32,6 @@ const genSegmentedStyle = (token) => {
33
32
  background: token.trackBg,
34
33
  borderRadius: token.borderRadius,
35
34
  transition: `all ${motionDurationMid}`,
36
- ...genNoMotionStyle(),
37
35
  ...genFocusStyle(token),
38
36
  [`${componentCls}-group`]: {
39
37
  position: "relative",
@@ -62,7 +60,6 @@ const genSegmentedStyle = (token) => {
62
60
  textAlign: "center",
63
61
  cursor: "pointer",
64
62
  transition: `color ${motionDurationMid}`,
65
- ...genNoMotionStyle(),
66
63
  borderRadius: token.borderRadiusSM,
67
64
  transform: "translateZ(0)",
68
65
  "&-selected": {
@@ -81,8 +78,7 @@ const genSegmentedStyle = (token) => {
81
78
  borderRadius: "inherit",
82
79
  opacity: 0,
83
80
  pointerEvents: "none",
84
- transition: ["opacity", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", "),
85
- ...genNoMotionRawStyle()
81
+ transition: ["opacity", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", ")
86
82
  },
87
83
  [`&:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)`]: {
88
84
  "&:hover, &:active": { color: token.itemHoverColor },
@@ -146,8 +142,7 @@ const genSegmentedStyle = (token) => {
146
142
  ...getItemDisabledStyle(`${componentCls}-item-disabled`, token),
147
143
  [`${componentCls}-thumb-motion-appear`]: {
148
144
  willChange: "transform, width",
149
- transition: [`transform`, `width`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(", "),
150
- ...genNoMotionStyle()
145
+ transition: [`transform`, `width`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(", ")
151
146
  },
152
147
  [`&${componentCls}-shape-round`]: {
153
148
  borderRadius: 9999,
@@ -112,10 +112,12 @@ const Splitter = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
112
112
  let splitBar = null;
113
113
  const resizableInfo = resizableInfos.value[idx];
114
114
  if (resizableInfo) {
115
- const ariaMinStart = (stackSizes.value[idx - 1] || 0) + itemPtgMinSizes.value[idx];
116
- const ariaMinEnd = (stackSizes.value[idx + 1] || 100) - itemPtgMaxSizes.value[idx + 1];
117
- const ariaMaxStart = (stackSizes.value[idx - 1] || 0) + itemPtgMaxSizes.value[idx];
118
- const ariaMaxEnd = (stackSizes.value[idx + 1] || 100) - itemPtgMinSizes.value[idx + 1];
115
+ const prevStackSize = Number.isFinite(stackSizes.value[idx - 1]) ? stackSizes.value[idx - 1] : 0;
116
+ const nextStackSize = Number.isFinite(stackSizes.value[idx + 1]) ? stackSizes.value[idx + 1] : 1;
117
+ const ariaMinStart = prevStackSize + itemPtgMinSizes.value[idx];
118
+ const ariaMinEnd = nextStackSize - itemPtgMaxSizes.value[idx + 1];
119
+ const ariaMaxStart = prevStackSize + itemPtgMaxSizes.value[idx];
120
+ const ariaMaxEnd = nextStackSize - itemPtgMinSizes.value[idx + 1];
119
121
  splitBar = createVNode(SplitBar, {
120
122
  "lazy": lazy,
121
123
  "index": idx,
@@ -3,7 +3,7 @@ import { SemanticClassNamesType, SemanticStylesType } from "../_util/hooks/useMe
3
3
  import { SizeType } from "../config-provider/SizeContext.js";
4
4
  import TabPane, { TabPaneProps } from "./TabPane.js";
5
5
  import { ComponentBaseProps } from "../config-provider/context.js";
6
- import { CSSProperties, SlotsType } from "vue";
6
+ import { App, CSSProperties, PublicProps } from "vue";
7
7
  import { GetIndicatorSize, MoreProps, Tab as Tab$1, TabsProps as TabsProps$1 } from "@v-c/tabs";
8
8
 
9
9
  //#region src/tabs/index.d.ts
@@ -47,10 +47,11 @@ interface Tab extends Omit<Tab$1, 'children' | 'className'> {
47
47
  content?: VueNode;
48
48
  class?: string;
49
49
  }
50
+ type TabItem = Tab & Record<string, any>;
50
51
  interface TabsRef {
51
52
  nativeElement: any;
52
53
  }
53
- interface BaseTabsProps extends ComponentBaseProps {
54
+ interface BaseTabsProps<Item extends Tab = TabItem> extends ComponentBaseProps {
54
55
  type?: TabsType;
55
56
  size?: SizeType;
56
57
  hideAdd?: boolean;
@@ -62,7 +63,7 @@ interface BaseTabsProps extends ComponentBaseProps {
62
63
  tabPlacement?: TabPlacement;
63
64
  /** @deprecated Please use `indicator={{ size: ... }}` instead */
64
65
  indicatorSize?: GetIndicatorSize;
65
- items?: Tab[];
66
+ items?: Item[];
66
67
  }
67
68
  interface TabsEmits {
68
69
  'edit': (e: MouseEvent | KeyboardEvent | string, action: 'add' | 'remove') => void;
@@ -78,7 +79,7 @@ interface TabsEmitsProps {
78
79
  onTabScroll?: TabsEmits['tabScroll'];
79
80
  'onUpdate:activeKey'?: TabsEmits['update:activeKey'];
80
81
  }
81
- interface TabsProps extends BaseTabsProps, CompatibilityProps, Omit<TabsProps$1, 'editable' | 'items' | 'classNames' | 'className' | 'popupClassName' | 'styles' | 'style' | 'onChange' | 'onTabScroll' | 'onTabClick' | 'renderTabBar'>, TabsEmitsProps {
82
+ interface TabsProps<Item extends Tab = TabItem> extends BaseTabsProps<Item>, CompatibilityProps, Omit<TabsProps$1, 'editable' | 'items' | 'classNames' | 'className' | 'popupClassName' | 'styles' | 'style' | 'onChange' | 'onTabScroll' | 'onTabClick' | 'renderTabBar'>, TabsEmitsProps {
82
83
  addIcon?: VueNode;
83
84
  moreIcon?: VueNode;
84
85
  more?: MoreProps;
@@ -92,18 +93,17 @@ interface TabsProps extends BaseTabsProps, CompatibilityProps, Omit<TabsProps$1,
92
93
  TabNavListComponent: any;
93
94
  }) => any;
94
95
  }
95
- type TabItem = Tab & Record<string, any>;
96
- interface TabsSlots {
96
+ interface TabsSlots<Item extends Tab = TabItem> {
97
97
  default: () => any;
98
98
  addIcon: () => any;
99
99
  moreIcon: () => any;
100
100
  removeIcon: () => any;
101
101
  labelRender: (args: {
102
- item: TabItem;
102
+ item: Item;
103
103
  index: number;
104
104
  }) => any;
105
105
  contentRender: (args: {
106
- item: TabItem;
106
+ item: Item;
107
107
  index: number;
108
108
  }) => any;
109
109
  renderTabBar?: (args: {
@@ -113,6 +113,29 @@ interface TabsSlots {
113
113
  rightExtra?: () => any;
114
114
  leftExtra?: () => any;
115
115
  }
116
- declare const Tabs: import("vue").DefineSetupFnComponent<TabsProps, TabsEmits, SlotsType<TabsSlots>, TabsProps, import("vue").PublicProps>;
116
+ type TabsInstance<Item extends Tab = TabItem> = {
117
+ $props: TabsProps<Item> & PublicProps;
118
+ $emit: {
119
+ (event: 'edit', e: MouseEvent | KeyboardEvent | string, action: 'add' | 'remove'): void;
120
+ (event: 'change', ...args: Parameters<TabsEmits['change']>): void;
121
+ (event: 'tabClick', ...args: Parameters<TabsEmits['tabClick']>): void;
122
+ (event: 'tabScroll', ...args: Parameters<TabsEmits['tabScroll']>): void;
123
+ (event: 'update:activeKey', activeKey: string): void;
124
+ };
125
+ $slots: TabsSlots<Item>;
126
+ } & TabsRef;
127
+ interface TabsConstructor {
128
+ new <Item extends Tab = TabItem>(props: TabsProps<Item>): TabsInstance<Item>;
129
+ /**
130
+ * Non-generic fallback signature. TypeScript infers from the last overload,
131
+ * so this keeps render-function usage like `h(Tabs, props)` resolvable
132
+ * against Vue's `Constructor<P>` overload of `h` (see #634), while the
133
+ * generic signature above still drives template/Volar inference.
134
+ */
135
+ new (props: TabsProps<any>): TabsInstance<any>;
136
+ install: (app: App) => void;
137
+ TabPane: typeof TabPane;
138
+ }
139
+ declare const Tabs: TabsConstructor;
117
140
  //#endregion
118
- export { BaseTabsProps, CompatibilityProps, Tab, TabItem, TabPane, type TabPaneProps, TabPlacement, TabPosition, TabsClassNamesType, TabsEmits, TabsEmitsProps, TabsProps, TabsRef, TabsSemanticClassNames, TabsSemanticName, TabsSemanticStyles, TabsSlots, TabsStylesType, TabsType, Tabs as default };
141
+ export { BaseTabsProps, CompatibilityProps, Tab, TabItem, TabPane, type TabPaneProps, TabPlacement, TabPosition, TabsClassNamesType, TabsConstructor, TabsEmits, TabsEmitsProps, TabsProps, TabsRef, TabsSemanticClassNames, TabsSemanticName, TabsSemanticStyles, TabsSlots, TabsStylesType, TabsType, Tabs as default };
@@ -15,7 +15,7 @@ import { CloseOutlined, EllipsisOutlined, PlusOutlined } from "@antdv-next/icons
15
15
  import { omit } from "es-toolkit";
16
16
  import VcTabs from "@v-c/tabs";
17
17
  //#region src/tabs/index.tsx
18
- const Tabs = /* @__PURE__ */ defineComponent((props, { attrs, slots, emit, expose }) => {
18
+ const InternalTabs = /* @__PURE__ */ defineComponent((props, { attrs, slots, emit, expose }) => {
19
19
  const { classes, styles, type, size: customSize, tabPlacement: tabPlacementProp, tabPosition, hideAdd, centered, indicatorSize } = toPropsRefs$1(props, "classes", "styles", "type", "size", "tabPlacement", "tabPosition", "hideAdd", "centered", "indicatorSize");
20
20
  const more = toRef(props, "more");
21
21
  const popupClassName = toRef(props, "popupClassName");
@@ -355,9 +355,10 @@ const Tabs = /* @__PURE__ */ defineComponent((props, { attrs, slots, emit, expos
355
355
  name: "ATabs",
356
356
  inheritAttrs: false
357
357
  });
358
+ const Tabs = InternalTabs;
358
359
  Tabs.TabPane = TabPane;
359
360
  Tabs.install = (app) => {
360
- app.component(Tabs.name, Tabs);
361
+ app.component(InternalTabs.name, Tabs);
361
362
  app.component(TabPane.name, TabPane);
362
363
  };
363
364
  //#endregion
@@ -10,6 +10,6 @@ declare function useColor(props: {
10
10
  color: Ref<TagProps['color']>;
11
11
  variant: Ref<TagProps['variant']>;
12
12
  bordered: Ref<TagProps['bordered']>;
13
- }, contextVariant?: Ref<TagProps['variant']>): readonly [import("vue").ComputedRef<"outlined" | "filled" | "solid">, import("vue").ComputedRef<string | undefined>, import("vue").ComputedRef<boolean>, import("vue").ComputedRef<boolean>, import("vue").ComputedRef<CSSProperties>];
13
+ }, contextVariant?: Ref<TagProps['variant']>): readonly [import("vue").ComputedRef<"solid" | "filled" | "outlined">, import("vue").ComputedRef<string | undefined>, import("vue").ComputedRef<boolean>, import("vue").ComputedRef<boolean>, import("vue").ComputedRef<CSSProperties>];
14
14
  //#endregion
15
15
  export { useColor as default };
package/dist/tag/index.js CHANGED
@@ -48,6 +48,7 @@ const InternalTag = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit
48
48
  e.stopPropagation();
49
49
  emit("close", e);
50
50
  if (e.defaultPrevented) return;
51
+ if (href.value) e.preventDefault();
51
52
  visible.value = false;
52
53
  };
53
54
  const handleCloseKeyDown = (e) => {
@@ -45,15 +45,15 @@ interface TimelineProps extends ComponentBaseProps {
45
45
  dotRender?: (params: {
46
46
  item: TimelineItemType;
47
47
  index: number;
48
- }) => void;
48
+ }) => VueNode;
49
49
  labelRender?: (params: {
50
50
  item: TimelineItemType;
51
51
  index: number;
52
- }) => void;
52
+ }) => VueNode;
53
53
  contentRender?: (params: {
54
54
  item: TimelineItemType;
55
55
  index: number;
56
- }) => void;
56
+ }) => VueNode;
57
57
  orientation?: 'horizontal' | 'vertical';
58
58
  variant?: StepsProps['variant'];
59
59
  classes?: TimelineClassNamesType;
@@ -67,15 +67,15 @@ interface TimelineSlots {
67
67
  dotRender?: (params: {
68
68
  item: TimelineItemType;
69
69
  index: number;
70
- }) => void;
70
+ }) => any;
71
71
  labelRender?: (params: {
72
72
  item: TimelineItemType;
73
73
  index: number;
74
- }) => void;
74
+ }) => any;
75
75
  contentRender?: (params: {
76
76
  item: TimelineItemType;
77
77
  index: number;
78
- }) => void;
78
+ }) => any;
79
79
  }
80
80
  declare const Timeline: import("vue").DefineSetupFnComponent<TimelineProps, EmptyEmit, SlotsType<TimelineSlots>, TimelineProps, import("vue").PublicProps>;
81
81
  //#endregion