antdv-next 1.4.2 → 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.
- package/dist/_util/statusUtils.d.ts +1 -1
- package/dist/_util/wave/index.js +1 -1
- package/dist/antd-with-locales.esm.js +10362 -10320
- package/dist/antd-with-locales.js +78 -78
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +9259 -9217
- package/dist/antd.js +53 -53
- package/dist/border-beam/style/index.js +2 -2
- package/dist/checkbox/style/index.js +3 -3
- package/dist/collapse/style/index.js +1 -1
- package/dist/descriptions/hooks/useItems.d.ts +8 -8
- package/dist/form/Form.js +23 -6
- package/dist/form/FormItem/index.js +25 -2
- package/dist/form/context.d.ts +3 -1
- package/dist/form/hooks/useVariant.d.ts +1 -1
- package/dist/form/util.d.ts +7 -1
- package/dist/form/util.js +9 -1
- package/dist/grid/col.js +2 -2
- package/dist/image/hooks/usePreviewConfig.d.ts +2 -2
- package/dist/input/Search.js +19 -13
- package/dist/layout/style/sider.js +1 -1
- package/dist/package.js +1 -1
- package/dist/radio/style/index.js +1 -5
- package/dist/segmented/style/index.js +2 -7
- package/dist/splitter/SplitBar.js +1 -12
- package/dist/splitter/Splitter.js +6 -4
- package/dist/style/motion/index.d.ts +2 -2
- package/dist/style/motion/index.js +2 -2
- package/dist/style/motion/util.d.ts +8 -1
- package/dist/style/motion/util.js +13 -1
- package/dist/switch/style/index.js +2 -2
- package/dist/tabs/index.d.ts +33 -10
- package/dist/tabs/index.js +3 -2
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/tag/index.js +1 -0
- package/dist/timeline/Timeline.d.ts +6 -6
- package/dist/timeline/Timeline.js +21 -4
- package/dist/timeline/useItems.d.ts +7 -2
- package/dist/timeline/useItems.js +14 -4
- package/dist/tour/panelRender.js +2 -8
- package/dist/tree/DirectoryTree.js +4 -4
- package/dist/tree/Tree.d.ts +3 -1
- package/dist/tree/Tree.js +10 -7
- package/dist/tree/style/index.js +4 -4
- package/dist/typography/style/mixins.js +3 -3
- package/package.json +3 -3
- package/web-tags.json +1420 -1416
- package/web-types.json +4335 -4321
package/dist/tabs/index.d.ts
CHANGED
|
@@ -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,
|
|
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?:
|
|
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
|
|
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
|
-
|
|
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:
|
|
102
|
+
item: Item;
|
|
103
103
|
index: number;
|
|
104
104
|
}) => any;
|
|
105
105
|
contentRender: (args: {
|
|
106
|
-
item:
|
|
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
|
-
|
|
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 };
|
package/dist/tabs/index.js
CHANGED
|
@@ -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
|
|
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(
|
|
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<"
|
|
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
|
-
}) =>
|
|
48
|
+
}) => VueNode;
|
|
49
49
|
labelRender?: (params: {
|
|
50
50
|
item: TimelineItemType;
|
|
51
51
|
index: number;
|
|
52
|
-
}) =>
|
|
52
|
+
}) => VueNode;
|
|
53
53
|
contentRender?: (params: {
|
|
54
54
|
item: TimelineItemType;
|
|
55
55
|
index: number;
|
|
56
|
-
}) =>
|
|
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
|
-
}) =>
|
|
70
|
+
}) => any;
|
|
71
71
|
labelRender?: (params: {
|
|
72
72
|
item: TimelineItemType;
|
|
73
73
|
index: number;
|
|
74
|
-
}) =>
|
|
74
|
+
}) => any;
|
|
75
75
|
contentRender?: (params: {
|
|
76
76
|
item: TimelineItemType;
|
|
77
77
|
index: number;
|
|
78
|
-
}) =>
|
|
78
|
+
}) => any;
|
|
79
79
|
}
|
|
80
80
|
declare const Timeline: import("vue").DefineSetupFnComponent<TimelineProps, EmptyEmit, SlotsType<TimelineSlots>, TimelineProps, import("vue").PublicProps>;
|
|
81
81
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useBaseConfig, useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
2
|
import { genCssVar } from "../theme/util/genStyleUtils.js";
|
|
3
3
|
import { useMergeSemantic, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
4
|
-
import { toPropsRefs } from "../_util/tools.js";
|
|
4
|
+
import { toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
5
5
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
6
6
|
import isNonNullable from "../_util/isNonNullable.js";
|
|
7
7
|
import { resolveSlotsNode } from "../_util/vnode/index.js";
|
|
@@ -12,6 +12,7 @@ import { TimelineItem } from "./TimelineItem.js";
|
|
|
12
12
|
import useItems from "./useItems.js";
|
|
13
13
|
import { computed, createVNode, defineComponent, mergeDefaults, mergeProps, ref, toRefs } from "vue";
|
|
14
14
|
import { classNames } from "@v-c/util";
|
|
15
|
+
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
15
16
|
import { omit } from "es-toolkit";
|
|
16
17
|
import { useUnstableProvider } from "@v-c/steps/dist/UnstableContext.js";
|
|
17
18
|
//#region src/timeline/Timeline.tsx
|
|
@@ -26,7 +27,7 @@ const Timeline = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
26
27
|
const { classes: contextClassNames, styles: contextStyles, style: contextStyle, class: contextClassName } = useComponentBaseConfig("timeline", props);
|
|
27
28
|
const { prefixCls, timeline, direction, getPrefixCls } = useBaseConfig("timeline", props);
|
|
28
29
|
const rootPrefixCls = computed(() => getPrefixCls());
|
|
29
|
-
const { classes, styles } = toPropsRefs(props, "classes", "styles");
|
|
30
|
+
const { classes, styles } = toPropsRefs$1(props, "classes", "styles");
|
|
30
31
|
const items = computed(() => props.items || resolveSlotsNode(slots, "default", void 0, "_ANTDV_NEXT_TIMELINE_ITEM"));
|
|
31
32
|
const pending = computed(() => props.pending);
|
|
32
33
|
const pendingDot = computed(() => props.pendingDot);
|
|
@@ -52,7 +53,20 @@ const Timeline = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
52
53
|
itemSection: `${prefixCls.value}-item-section`,
|
|
53
54
|
itemHeader: `${prefixCls.value}-item-header`
|
|
54
55
|
}));
|
|
55
|
-
const
|
|
56
|
+
const wrapRender = (fn) => {
|
|
57
|
+
if (typeof fn !== "function") return void 0;
|
|
58
|
+
return (params) => {
|
|
59
|
+
const node = fn(params);
|
|
60
|
+
const nodes = filterEmpty(Array.isArray(node) ? node : [node]).filter((n) => n !== void 0 && n !== null);
|
|
61
|
+
if (!nodes.length) return void 0;
|
|
62
|
+
return nodes.length === 1 ? nodes[0] : nodes;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const rawItems = useItems(rootPrefixCls, prefixCls, mergedMode, items, pending, pendingDot, computed(() => ({
|
|
66
|
+
dotRender: wrapRender(slots.dotRender ?? props.dotRender),
|
|
67
|
+
labelRender: wrapRender(slots.labelRender ?? props.labelRender),
|
|
68
|
+
contentRender: wrapRender(slots.contentRender ?? props.contentRender)
|
|
69
|
+
})));
|
|
56
70
|
const mergedItems = computed(() => {
|
|
57
71
|
return props.reverse ? [...rawItems.value].reverse() : rawItems.value;
|
|
58
72
|
});
|
|
@@ -81,7 +95,10 @@ const Timeline = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
81
95
|
return createVNode(Steps, mergeProps(omit(attrs, ["class", "style"]), omit(props, [
|
|
82
96
|
"items",
|
|
83
97
|
"prefixCls",
|
|
84
|
-
"titleSpan"
|
|
98
|
+
"titleSpan",
|
|
99
|
+
"dotRender",
|
|
100
|
+
"labelRender",
|
|
101
|
+
"contentRender"
|
|
85
102
|
]), {
|
|
86
103
|
"class": classNames(contextClassName.value, timeline.value?.class, attrs.class, rootCls.value, hashId.value, cssVarCls.value, prefixCls.value, {
|
|
87
104
|
[`${prefixCls.value}-${orientation.value}`]: orientation.value === "horizontal",
|
|
@@ -2,6 +2,11 @@ import { TimelineItemType, TimelineMode, TimelineProps } from "./Timeline.js";
|
|
|
2
2
|
import { ComputedRef } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/timeline/useItems.d.ts
|
|
5
|
-
|
|
5
|
+
interface TimelineItemRenders {
|
|
6
|
+
dotRender?: TimelineProps['dotRender'];
|
|
7
|
+
labelRender?: TimelineProps['labelRender'];
|
|
8
|
+
contentRender?: TimelineProps['contentRender'];
|
|
9
|
+
}
|
|
10
|
+
declare function useItems(rootPrefixCls: ComputedRef<string>, prefixCls: ComputedRef<string>, mode: ComputedRef<TimelineMode>, items?: ComputedRef<TimelineItemType[] | undefined>, pending?: ComputedRef<TimelineProps['pending']>, pendingDot?: ComputedRef<TimelineProps['pendingDot']>, renders?: ComputedRef<TimelineItemRenders>): ComputedRef<TimelineItemType[]>;
|
|
6
11
|
//#endregion
|
|
7
|
-
export { useItems as default };
|
|
12
|
+
export { TimelineItemRenders, useItems as default };
|
|
@@ -3,13 +3,14 @@ import { computed, createVNode } from "vue";
|
|
|
3
3
|
import { classNames } from "@v-c/util";
|
|
4
4
|
import { LoadingOutlined } from "@antdv-next/icons";
|
|
5
5
|
//#region src/timeline/useItems.tsx
|
|
6
|
-
function useItems(rootPrefixCls, prefixCls, mode, items, pending, pendingDot) {
|
|
6
|
+
function useItems(rootPrefixCls, prefixCls, mode, items, pending, pendingDot, renders) {
|
|
7
7
|
const itemCls = computed(() => `${prefixCls.value}-item`);
|
|
8
8
|
const [varName] = genCssVar(rootPrefixCls.value, "cmp-steps");
|
|
9
9
|
const parseItems = computed(() => {
|
|
10
10
|
return items && Array.isArray(items.value) ? items.value : [];
|
|
11
11
|
});
|
|
12
12
|
return computed(() => {
|
|
13
|
+
const { dotRender, labelRender, contentRender } = renders?.value ?? {};
|
|
13
14
|
const mergedItems = parseItems.value.map((item, index) => {
|
|
14
15
|
const { label, children, title, content, color, className, style, icon, dot, placement, position, loading, ...restProps } = item;
|
|
15
16
|
let mergedStyle = style;
|
|
@@ -26,12 +27,21 @@ function useItems(rootPrefixCls, prefixCls, mode, items, pending, pendingDot) {
|
|
|
26
27
|
};
|
|
27
28
|
const mergedPlacement = placement ?? position ?? (mode.value === "alternate" ? index % 2 === 0 ? "start" : "end" : mode.value);
|
|
28
29
|
mergedClass = classNames(mergedClass, `${itemCls.value}-placement-${mergedPlacement}`);
|
|
29
|
-
let mergedIcon =
|
|
30
|
+
let mergedIcon = dotRender?.({
|
|
31
|
+
item,
|
|
32
|
+
index
|
|
33
|
+
}) ?? icon ?? dot;
|
|
30
34
|
if (!mergedIcon && loading) mergedIcon = createVNode(LoadingOutlined, null, null);
|
|
31
35
|
return {
|
|
32
36
|
...restProps,
|
|
33
|
-
title:
|
|
34
|
-
|
|
37
|
+
title: labelRender?.({
|
|
38
|
+
item,
|
|
39
|
+
index
|
|
40
|
+
}) ?? title ?? label,
|
|
41
|
+
content: contentRender?.({
|
|
42
|
+
item,
|
|
43
|
+
index
|
|
44
|
+
}) ?? content ?? children,
|
|
35
45
|
style: mergedStyle,
|
|
36
46
|
class: mergedClass,
|
|
37
47
|
icon: mergedIcon,
|
package/dist/tour/panelRender.js
CHANGED
|
@@ -135,14 +135,8 @@ const TourPanel = /* @__PURE__ */ defineComponent((props) => {
|
|
|
135
135
|
type: Function,
|
|
136
136
|
required: false
|
|
137
137
|
},
|
|
138
|
-
classes: {
|
|
139
|
-
|
|
140
|
-
required: false
|
|
141
|
-
},
|
|
142
|
-
styles: {
|
|
143
|
-
type: [Object, Function],
|
|
144
|
-
required: false
|
|
145
|
-
},
|
|
138
|
+
classes: { required: false },
|
|
139
|
+
styles: { required: false },
|
|
146
140
|
actionsRender: {
|
|
147
141
|
type: Function,
|
|
148
142
|
required: false
|
|
@@ -195,6 +195,10 @@ const DirectoryTree = /* @__PURE__ */ defineComponent((props, { slots, emit, exp
|
|
|
195
195
|
type: [Object, Function],
|
|
196
196
|
required: false
|
|
197
197
|
},
|
|
198
|
+
rootStyle: {
|
|
199
|
+
type: Object,
|
|
200
|
+
required: false
|
|
201
|
+
},
|
|
198
202
|
multiple: {
|
|
199
203
|
type: Boolean,
|
|
200
204
|
required: false,
|
|
@@ -385,10 +389,6 @@ const DirectoryTree = /* @__PURE__ */ defineComponent((props, { slots, emit, exp
|
|
|
385
389
|
type: Boolean,
|
|
386
390
|
required: false,
|
|
387
391
|
default: void 0
|
|
388
|
-
},
|
|
389
|
-
rootStyle: {
|
|
390
|
-
type: Object,
|
|
391
|
-
required: false
|
|
392
392
|
}
|
|
393
393
|
},
|
|
394
394
|
emits: [
|
package/dist/tree/Tree.d.ts
CHANGED
|
@@ -101,13 +101,15 @@ interface TreeSemanticStyles {
|
|
|
101
101
|
}
|
|
102
102
|
type TreeClassNamesType = SemanticClassNamesType<TreeProps, TreeSemanticClassNames>;
|
|
103
103
|
type TreeStylesType = SemanticStylesType<TreeProps, TreeSemanticStyles>;
|
|
104
|
-
interface TreeProps<T extends BasicDataNode = DataNode> extends Omit<TreeProps$1<T>, 'prefixCls' | 'showLine' | 'direction' | 'draggable' | 'className' | 'icon' | 'switcherIcon' | 'classNames' | 'rootClassName' | 'styles' | 'onCheck' | 'onClick' | 'onBlur' | 'onDrop' | 'onLoad' | 'onActiveChange' | 'onContextMenu' | 'onDoubleClick' | 'onExpand' | 'onKeyDown' | 'onDragEnd' | 'onDragOver' | 'onDragStart' | 'onDragLeave' | 'onDragEnter' | 'tabIndex' | 'onSelect' | 'onFocus' | 'onMouseEnter' | 'onMouseLeave' | 'onRightClick' | 'onScroll' | 'style'>, TreeEmitsProps {
|
|
104
|
+
interface TreeProps<T extends BasicDataNode = DataNode> extends Omit<TreeProps$1<T>, 'prefixCls' | 'showLine' | 'direction' | 'draggable' | 'className' | 'icon' | 'switcherIcon' | 'classNames' | 'rootClassName' | 'rootStyle' | 'styles' | 'onCheck' | 'onClick' | 'onBlur' | 'onDrop' | 'onLoad' | 'onActiveChange' | 'onContextMenu' | 'onDoubleClick' | 'onExpand' | 'onKeyDown' | 'onDragEnd' | 'onDragOver' | 'onDragStart' | 'onDragLeave' | 'onDragEnter' | 'tabIndex' | 'onSelect' | 'onFocus' | 'onMouseEnter' | 'onMouseLeave' | 'onRightClick' | 'onScroll' | 'style'>, TreeEmitsProps {
|
|
105
105
|
rootClass?: string;
|
|
106
106
|
showLine?: boolean | {
|
|
107
107
|
showLeafIcon: boolean | TreeLeafIcon;
|
|
108
108
|
};
|
|
109
109
|
classes?: TreeClassNamesType;
|
|
110
110
|
styles?: TreeStylesType;
|
|
111
|
+
/** @deprecated Please use `styles.root` instead */
|
|
112
|
+
rootStyle?: CSSProperties;
|
|
111
113
|
/** Whether to support multiple selection */
|
|
112
114
|
multiple?: boolean;
|
|
113
115
|
/** Whether to automatically expand the parent node */
|
package/dist/tree/Tree.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
1
2
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
3
|
import useToken from "../theme/useToken.js";
|
|
3
|
-
import { useMergeSemantic, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
4
|
+
import { useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
4
5
|
import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
5
6
|
import initCollapseMotion from "../_util/motion.js";
|
|
6
7
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
@@ -17,7 +18,8 @@ import VcTree from "@v-c/tree";
|
|
|
17
18
|
const Tree = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, attrs }) => {
|
|
18
19
|
const { virtual, prefixCls, rootPrefixCls, direction, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles } = useComponentBaseConfig("tree", props);
|
|
19
20
|
const treeRef = shallowRef();
|
|
20
|
-
const { classes, styles, motion: customMotion } = toPropsRefs$1(props, "classes", "styles", "motion");
|
|
21
|
+
const { classes, styles, motion: customMotion, rootStyle } = toPropsRefs$1(props, "classes", "styles", "motion", "rootStyle");
|
|
22
|
+
if (isDev) devUseWarning("Tree").deprecated(!rootStyle.value, "rootStyle", "styles.root");
|
|
21
23
|
const contextDisabled = useDisabledContext();
|
|
22
24
|
const mergedDisabled = computed(() => props?.disabled ?? contextDisabled.value);
|
|
23
25
|
const motion = computed(() => customMotion.value ?? {
|
|
@@ -31,7 +33,8 @@ const Tree = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, attr
|
|
|
31
33
|
motion: motion.value
|
|
32
34
|
};
|
|
33
35
|
});
|
|
34
|
-
const
|
|
36
|
+
const rootStyleRoot = useSemanticRootStyle(rootStyle);
|
|
37
|
+
const [mergedClassNames, mergedStyles] = useMergeSemantic(useToArr(contextClassNames, classes), useToArr(contextStyles, rootStyleRoot, styles), useToProps(mergedProps));
|
|
35
38
|
const [hashId, cssVarCls] = style_default(prefixCls);
|
|
36
39
|
const [, token] = useToken();
|
|
37
40
|
const itemHeight = computed(() => token.value.paddingXS / 2 + (token.value.Tree?.titleHeight || token.value.controlHeightSM));
|
|
@@ -196,6 +199,10 @@ const Tree = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, attr
|
|
|
196
199
|
type: [Object, Function],
|
|
197
200
|
required: false
|
|
198
201
|
},
|
|
202
|
+
rootStyle: {
|
|
203
|
+
type: Object,
|
|
204
|
+
required: false
|
|
205
|
+
},
|
|
199
206
|
multiple: {
|
|
200
207
|
type: Boolean,
|
|
201
208
|
required: false,
|
|
@@ -391,10 +398,6 @@ const Tree = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, attr
|
|
|
391
398
|
type: Boolean,
|
|
392
399
|
required: false,
|
|
393
400
|
default: void 0
|
|
394
|
-
},
|
|
395
|
-
rootStyle: {
|
|
396
|
-
type: Object,
|
|
397
|
-
required: false
|
|
398
401
|
}
|
|
399
402
|
}, {
|
|
400
403
|
showIcon: false,
|
package/dist/tree/style/index.js
CHANGED
|
@@ -60,7 +60,7 @@ function genBaseStyle(prefixCls, token) {
|
|
|
60
60
|
[`${treeNodeCls}.dragging:after`]: {
|
|
61
61
|
position: "absolute",
|
|
62
62
|
inset: 0,
|
|
63
|
-
border:
|
|
63
|
+
border: `${unit(token.lineWidth)} ${token.lineType} ${token.colorPrimary}`,
|
|
64
64
|
opacity: 0,
|
|
65
65
|
animationName: treeNodeFX,
|
|
66
66
|
animationDuration: token.motionDurationSlow,
|
|
@@ -167,14 +167,14 @@ function genBaseStyle(prefixCls, token) {
|
|
|
167
167
|
insetInlineEnd: token.calc(switcherSize).div(2).equal(),
|
|
168
168
|
bottom: token.calc(treeNodePadding).mul(-1).equal(),
|
|
169
169
|
marginInlineStart: -1,
|
|
170
|
-
borderInlineEnd:
|
|
170
|
+
borderInlineEnd: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
|
|
171
171
|
content: "\"\""
|
|
172
172
|
},
|
|
173
173
|
"&:after": {
|
|
174
174
|
position: "absolute",
|
|
175
175
|
width: token.calc(token.calc(switcherSize).div(2).equal()).mul(.8).equal(),
|
|
176
176
|
height: token.calc(titleHeight).div(2).equal(),
|
|
177
|
-
borderBottom:
|
|
177
|
+
borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
|
|
178
178
|
content: "\"\""
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -219,7 +219,7 @@ function genBaseStyle(prefixCls, token) {
|
|
|
219
219
|
top: 0,
|
|
220
220
|
insetInlineEnd: token.calc(switcherSize).div(2).equal(),
|
|
221
221
|
bottom: token.calc(treeNodePadding).mul(-1).equal(),
|
|
222
|
-
borderInlineEnd:
|
|
222
|
+
borderInlineEnd: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
|
|
223
223
|
content: "\"\""
|
|
224
224
|
},
|
|
225
225
|
"&-end:before": { display: "none" }
|
|
@@ -55,7 +55,7 @@ const getResetStyles = (token) => ({
|
|
|
55
55
|
fontSize: "85%",
|
|
56
56
|
fontFamily: token.fontFamilyCode,
|
|
57
57
|
background: "rgba(150, 150, 150, 0.1)",
|
|
58
|
-
border:
|
|
58
|
+
border: `${unit(token.lineWidth)} ${token.lineType} rgba(100, 100, 100, 0.2)`,
|
|
59
59
|
borderRadius: 3
|
|
60
60
|
},
|
|
61
61
|
kbd: {
|
|
@@ -65,7 +65,7 @@ const getResetStyles = (token) => ({
|
|
|
65
65
|
fontSize: "90%",
|
|
66
66
|
fontFamily: token.fontFamilyCode,
|
|
67
67
|
background: "rgba(150, 150, 150, 0.06)",
|
|
68
|
-
border:
|
|
68
|
+
border: `${unit(token.lineWidth)} ${token.lineType} rgba(100, 100, 100, 0.2)`,
|
|
69
69
|
borderBottomWidth: 2,
|
|
70
70
|
borderRadius: 3
|
|
71
71
|
},
|
|
@@ -101,7 +101,7 @@ const getResetStyles = (token) => ({
|
|
|
101
101
|
whiteSpace: "pre-wrap",
|
|
102
102
|
wordWrap: "break-word",
|
|
103
103
|
background: "rgba(150, 150, 150, 0.1)",
|
|
104
|
-
border:
|
|
104
|
+
border: `${unit(token.lineWidth)} ${token.lineType} rgba(100, 100, 100, 0.2)`,
|
|
105
105
|
borderRadius: 3,
|
|
106
106
|
fontFamily: token.fontFamilyCode,
|
|
107
107
|
code: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antdv-next",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.4",
|
|
5
5
|
"description": "Ant Design Vue3 Component Library",
|
|
6
6
|
"author": {
|
|
7
7
|
"email": "aibayanyu@gamil.com",
|
|
@@ -251,9 +251,9 @@
|
|
|
251
251
|
"build:llm-text": "tsx ./scripts/llm/generate-llms.ts",
|
|
252
252
|
"build:llm-semantic": "tsx ./scripts/llm/generate-llms-semantic.ts",
|
|
253
253
|
"build:token-meta": "tsx ./scripts/token/generate-token-meta.ts",
|
|
254
|
-
"build:token-statistic": "cross-env NODE_ENV=production CSSINJS_STATISTIC=1 tsx ./scripts/token/collect-token-statistic.ts",
|
|
254
|
+
"build:token-statistic": "cross-env NODE_ENV=production CSSINJS_STATISTIC=1 tsx ./scripts/vite-ssr-run.ts ./scripts/token/collect-token-statistic.ts collectTokenStatistic",
|
|
255
255
|
"build:token": "run-p build:token-meta build:token-statistic",
|
|
256
|
-
"build:style": "cross-env NODE_ENV=production
|
|
256
|
+
"build:style": "cross-env NODE_ENV=production tsx ./scripts/vite-ssr-run.ts ./scripts/style/build-style.ts buildStyle",
|
|
257
257
|
"prepublish": "pnpm build",
|
|
258
258
|
"bump": "bumpp --commit \"chore(release): antdv-next %s\" --push --tag \"antdv-next@%s\""
|
|
259
259
|
}
|