antdv-next 1.0.0-alpha.5 → 1.0.0-beta.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.
- package/dist/_util/PurePanel.js +106 -0
- package/dist/_util/hooks/useMergeSemantic.js +3 -3
- package/dist/_util/styleUtils.js +10 -0
- package/dist/alert/Alert.d.ts +3 -3
- package/dist/anchor/Anchor.d.ts +3 -3
- package/dist/antd.js +113 -105
- package/dist/app/App.d.ts +2 -2
- package/dist/auto-complete/index.d.ts +4 -3
- package/dist/auto-complete/index.js +8 -1
- package/dist/avatar/Avatar.d.ts +3 -3
- package/dist/avatar/AvatarGroup.d.ts +2 -2
- package/dist/badge/Ribbon.d.ts +3 -3
- package/dist/badge/ScrollNumber.js +1 -1
- package/dist/badge/SingleNumber.js +1 -1
- package/dist/badge/index.d.ts +3 -3
- package/dist/badge/index.js +5 -3
- package/dist/badge/style/index.js +1 -1
- package/dist/breadcrumb/Breadcrumb.d.ts +3 -3
- package/dist/button/Button.d.ts +3 -3
- package/dist/calendar/generateCalendar.d.ts +3 -3
- package/dist/calendar/index.d.ts +3 -3
- package/dist/calendar/style/index.d.ts +1 -1
- package/dist/calendar/style/index.js +1 -1
- package/dist/card/Card.d.ts +3 -3
- package/dist/card/CardGrid.d.ts +2 -2
- package/dist/card/CardMeta.d.ts +3 -3
- package/dist/card/style/index.js +11 -2
- package/dist/cascader/Panel.d.ts +3 -3
- package/dist/cascader/index.d.ts +1 -0
- package/dist/cascader/index.js +2 -0
- package/dist/checkbox/Checkbox.d.ts +3 -3
- package/dist/checkbox/Group.d.ts +3 -3
- package/dist/checkbox/style/index.d.ts +1 -1
- package/dist/color-picker/ColorPicker.d.ts +4 -4
- package/dist/color-picker/ColorPicker.js +11 -0
- package/dist/components.d.ts +8 -6
- package/dist/config-provider/context.d.ts +2 -1
- package/dist/config-provider/context.js +1 -1
- package/dist/config-provider/define.d.ts +14 -0
- package/dist/config-provider/index.d.ts +3 -3
- package/dist/config-provider/index.js +21 -2
- package/dist/date-picker/generatePicker/generateRangePicker.js +1 -1
- package/dist/date-picker/generatePicker/generateSinglePicker.js +2 -1
- package/dist/date-picker/generatePicker/index.d.ts +17 -17
- package/dist/date-picker/index.d.ts +29 -27
- package/dist/date-picker/index.js +3 -0
- package/dist/date-picker/style/panel.js +4 -4
- package/dist/descriptions/index.d.ts +3 -3
- package/dist/divider/index.d.ts +2 -2
- package/dist/drawer/index.d.ts +6 -4
- package/dist/drawer/index.js +17 -5
- package/dist/drawer/useFocusable.d.ts +10 -0
- package/dist/drawer/useFocusable.js +18 -0
- package/dist/dropdown/dropdown.d.ts +3 -3
- package/dist/dropdown/dropdown.js +7 -0
- package/dist/empty/index.d.ts +3 -3
- package/dist/flex/index.d.ts +3 -3
- package/dist/flex/index.js +1 -1
- package/dist/float-button/BackTop.d.ts +3 -3
- package/dist/float-button/BackTop.js +4 -1
- package/dist/float-button/FloatButton.d.ts +3 -3
- package/dist/float-button/FloatButtonGroup.d.ts +3 -3
- package/dist/float-button/PurePanel.js +5 -5
- package/dist/form/ErrorList.js +4 -7
- package/dist/form/Form.d.ts +7 -3
- package/dist/form/Form.js +39 -22
- package/dist/form/FormItem/ItemHolder.js +0 -1
- package/dist/form/FormItem/index.d.ts +5 -5
- package/dist/form/FormItem/index.js +48 -29
- package/dist/form/FormItemInput.js +17 -19
- package/dist/form/utils/valueUtil.js +4 -1
- package/dist/grid/col.js +7 -2
- package/dist/grid/index.d.ts +2 -2
- package/dist/grid/style/index.js +6 -5
- package/dist/image/PreviewGroup.d.ts +2 -2
- package/dist/image/index.d.ts +7 -4
- package/dist/image/index.js +2 -0
- package/dist/image/style/index.d.ts +1 -1
- package/dist/index.d.ts +12 -9
- package/dist/index.js +3 -1
- package/dist/input/TextArea.d.ts +3 -3
- package/dist/input/index.d.ts +11 -11
- package/dist/input/style/index.d.ts +2 -2
- package/dist/input-number/index.d.ts +4 -4
- package/dist/input-number/index.js +1 -5
- package/dist/layout/index.d.ts +6 -6
- package/dist/layout/layout.d.ts +2 -2
- package/dist/layout/style/sider.js +1 -1
- package/dist/masonry/Masonry.d.ts +3 -3
- package/dist/mentions/index.d.ts +4 -3
- package/dist/mentions/index.js +3 -1
- package/dist/menu/MenuDivider.d.ts +2 -2
- package/dist/menu/MenuItem.d.ts +3 -3
- package/dist/menu/SubMenu.d.ts +3 -3
- package/dist/menu/index.d.ts +5 -5
- package/dist/menu/style/horizontal.js +1 -1
- package/dist/menu/style/index.js +5 -5
- package/dist/message/PurePanel.d.ts +2 -2
- package/dist/message/useMessage.d.ts +1 -0
- package/dist/modal/ConfirmDialog.js +1 -1
- package/dist/modal/Modal.d.ts +3 -3
- package/dist/modal/Modal.js +17 -6
- package/dist/modal/PurePanel.js +305 -0
- package/dist/modal/index.js +2 -0
- package/dist/modal/interface.d.ts +3 -1
- package/dist/notification/PurePanel.d.ts +2 -2
- package/dist/notification/PurePanel.js +4 -3
- package/dist/notification/style/index.d.ts +1 -1
- package/dist/notification/useNotification.d.ts +3 -2
- package/dist/notification/useNotification.js +7 -7
- package/dist/package.d.ts +34 -0
- package/dist/package.js +1 -1
- package/dist/pagination/Pagination.d.ts +3 -3
- package/dist/popconfirm/PurePanel.d.ts +2 -2
- package/dist/popconfirm/PurePanel.js +2 -1
- package/dist/popconfirm/index.d.ts +3 -3
- package/dist/popover/PurePanel.js +4 -2
- package/dist/popover/index.d.ts +9 -6
- package/dist/popover/index.js +2 -1
- package/dist/progress/progress.d.ts +3 -3
- package/dist/qrcode/index.d.ts +3 -3
- package/dist/radio/index.d.ts +5 -5
- package/dist/radio/radio.d.ts +3 -3
- package/dist/radio/style/index.js +1 -1
- package/dist/rate/index.d.ts +3 -3
- package/dist/rate/style/index.d.ts +1 -1
- package/dist/result/index.d.ts +3 -3
- package/dist/segmented/index.d.ts +3 -3
- package/dist/select/index.d.ts +5 -5
- package/dist/select/index.js +3 -1
- package/dist/select/style/dropdown.js +1 -1
- package/dist/skeleton/Avatar.d.ts +2 -2
- package/dist/skeleton/Button.d.ts +2 -2
- package/dist/skeleton/Image.d.ts +2 -2
- package/dist/skeleton/Input.d.ts +2 -2
- package/dist/skeleton/Node.d.ts +3 -3
- package/dist/skeleton/Skeleton.d.ts +3 -3
- package/dist/skeleton/Skeleton.js +1 -1
- package/dist/skeleton/Title.d.ts +1 -2
- package/dist/skeleton/Title.js +0 -5
- package/dist/slider/index.d.ts +3 -3
- package/dist/space/index.d.ts +5 -5
- package/dist/spin/index.d.ts +3 -3
- package/dist/spin/index.js +7 -6
- package/dist/splitter/Splitter.d.ts +3 -3
- package/dist/splitter/index.d.ts +2 -2
- package/dist/statistic/Statistic.d.ts +3 -3
- package/dist/statistic/Timer.d.ts +5 -5
- package/dist/statistic/index.d.ts +5 -5
- package/dist/steps/index.d.ts +3 -3
- package/dist/steps/style/icon.js +1 -1
- package/dist/steps/style/inline.js +1 -1
- package/dist/steps/style/panel.js +1 -1
- package/dist/switch/index.d.ts +3 -3
- package/dist/table/Column.d.ts +3 -3
- package/dist/table/ColumnGroup.d.ts +3 -3
- package/dist/table/InternalTable.js +19 -5
- package/dist/table/Table.d.ts +3 -3
- package/dist/table/style/index.js +3 -3
- package/dist/table/style/radius.js +6 -0
- package/dist/table/style/virtual.js +1 -1
- package/dist/tabs/TabPane.d.ts +3 -3
- package/dist/tabs/index.d.ts +3 -3
- package/dist/tag/CheckableTag.d.ts +3 -3
- package/dist/tag/CheckableTagGroup.d.ts +3 -3
- package/dist/tag/CheckableTagGroup.js +3 -3
- package/dist/tag/index.d.ts +3 -3
- package/dist/theme/context.d.ts +2 -2
- package/dist/theme/index.d.ts +4 -4
- package/dist/theme/useToken.d.ts +2 -2
- package/dist/theme/useToken.js +1 -1
- package/dist/theme/util/genStyleUtils.d.ts +2 -2
- package/dist/theme/util/useResetIconStyle.js +1 -1
- package/dist/time-picker/index.d.ts +8 -7
- package/dist/time-picker/index.js +17 -13
- package/dist/timeline/Timeline.d.ts +3 -3
- package/dist/tooltip/PurePanel.d.ts +2 -2
- package/dist/tooltip/PurePanel.js +10 -6
- package/dist/tooltip/UniqueProvider/index.d.ts +2 -2
- package/dist/tooltip/index.d.ts +3 -3
- package/dist/tour/PurePanel.js +243 -0
- package/dist/tour/index.d.ts +3 -3
- package/dist/tour/index.js +2 -0
- package/dist/transfer/Actions.d.ts +2 -2
- package/dist/transfer/Section.d.ts +2 -2
- package/dist/transfer/Transfer.d.ts +3 -3
- package/dist/transfer/Transfer.js +1 -1
- package/dist/transfer/search.d.ts +3 -3
- package/dist/tree/DirectoryTree.d.ts +3 -3
- package/dist/tree/Tree.d.ts +3 -3
- package/dist/tree/style/index.d.ts +1 -1
- package/dist/tree-select/index.d.ts +5 -4
- package/dist/tree-select/index.js +2 -0
- package/dist/typography/Paragraph.d.ts +3 -3
- package/dist/typography/Text.d.ts +3 -3
- package/dist/typography/Title.d.ts +3 -3
- package/dist/typography/Typography.d.ts +3 -3
- package/dist/typography/index.d.ts +9 -9
- package/dist/upload/Dragger.d.ts +3 -3
- package/dist/upload/Upload.d.ts +3 -3
- package/dist/upload/Upload.js +15 -1
- package/dist/upload/index.d.ts +3 -3
- package/dist/upload/interface.d.ts +4 -4
- package/dist/watermark/index.d.ts +2 -2
- package/global.d.ts +1 -0
- package/package.json +49 -15
- package/web-tags.json +2452 -1907
- package/web-types.json +7148 -5592
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import throttleByAnimationFrame_default from "../_util/throttleByAnimationFrame.js";
|
|
2
2
|
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
3
|
-
import { pureAttrs } from "../_util/hooks/useMergeSemantic.js";
|
|
3
|
+
import { getAttrStyleAndClass as getAttrStyleAndClass$1, pureAttrs } from "../_util/hooks/useMergeSemantic.js";
|
|
4
4
|
import "../_util/hooks/index.js";
|
|
5
5
|
import { toPropsRefs } from "../_util/tools.js";
|
|
6
6
|
import getScroll_default from "../_util/getScroll.js";
|
|
@@ -75,12 +75,15 @@ const BackTopWithInstall = /* @__PURE__ */ defineComponent((props, { attrs, slot
|
|
|
75
75
|
emit("click", e);
|
|
76
76
|
};
|
|
77
77
|
return () => {
|
|
78
|
+
const { className, style } = getAttrStyleAndClass$1(attrs);
|
|
78
79
|
return createVNode(Transition, transitionProps.value, { default: () => visible.value ? createVNode(FloatButton_default, mergeProps(pureAttrs(attrs), omit(props, [
|
|
79
80
|
"visibilityHeight",
|
|
80
81
|
"target",
|
|
81
82
|
"duration"
|
|
82
83
|
]), {
|
|
83
84
|
"ref": floatButtonRef,
|
|
85
|
+
"class": className,
|
|
86
|
+
"style": style,
|
|
84
87
|
"shape": mergedShape.value,
|
|
85
88
|
"icon": mergedIcon.value,
|
|
86
89
|
"onClick": scrollToTop
|
|
@@ -7,7 +7,7 @@ import { ButtonSemanticName } from "../button/Button.js";
|
|
|
7
7
|
import "../button/index.js";
|
|
8
8
|
import { BadgeProps } from "../badge/index.js";
|
|
9
9
|
import { ComponentBaseProps } from "../config-provider/context.js";
|
|
10
|
-
import * as
|
|
10
|
+
import * as vue254 from "vue";
|
|
11
11
|
import { CSSProperties, SlotsType } from "vue";
|
|
12
12
|
|
|
13
13
|
//#region src/float-button/FloatButton.d.ts
|
|
@@ -54,9 +54,9 @@ interface FloatButtonEmits {
|
|
|
54
54
|
blur: (e: FocusEvent) => void;
|
|
55
55
|
[key: string]: (...args: any[]) => void;
|
|
56
56
|
}
|
|
57
|
-
declare const InternalFloatButton:
|
|
57
|
+
declare const InternalFloatButton: vue254.DefineSetupFnComponent<FloatButtonProps, FloatButtonEmits, SlotsType<FloatButtonSlots>, FloatButtonProps & {
|
|
58
58
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
59
|
-
},
|
|
59
|
+
}, vue254.PublicProps>;
|
|
60
60
|
declare const FloatButton: typeof InternalFloatButton;
|
|
61
61
|
//#endregion
|
|
62
62
|
export { FloatButton, FloatButtonGroupTrigger, FloatButtonProps, FloatButtonRef };
|
|
@@ -3,7 +3,7 @@ import { SemanticClassNamesType, SemanticStylesType } from "../_util/hooks/useMe
|
|
|
3
3
|
import "../_util/hooks/index.js";
|
|
4
4
|
import { FloatButtonGroupTrigger, FloatButtonProps } from "./FloatButton.js";
|
|
5
5
|
import { ComponentBaseProps } from "../config-provider/context.js";
|
|
6
|
-
import * as
|
|
6
|
+
import * as vue252 from "vue";
|
|
7
7
|
import { CSSProperties, SlotsType } from "vue";
|
|
8
8
|
|
|
9
9
|
//#region src/float-button/FloatButtonGroup.d.ts
|
|
@@ -31,9 +31,9 @@ interface FloatButtonGroupEmits {
|
|
|
31
31
|
'click': (e: MouseEvent) => void;
|
|
32
32
|
[key: string]: (...args: any[]) => void;
|
|
33
33
|
}
|
|
34
|
-
declare const InternalFloatButtonGroup:
|
|
34
|
+
declare const InternalFloatButtonGroup: vue252.DefineSetupFnComponent<FloatButtonGroupProps, FloatButtonGroupEmits, SlotsType<FloatButtonGroupSlots>, FloatButtonGroupProps & {
|
|
35
35
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
36
|
-
},
|
|
36
|
+
}, vue252.PublicProps>;
|
|
37
37
|
declare const FloatButtonGroup: typeof InternalFloatButtonGroup;
|
|
38
38
|
//#endregion
|
|
39
39
|
export { FloatButtonGroup, FloatButtonGroupProps };
|
|
@@ -11,7 +11,7 @@ import { omit } from "es-toolkit";
|
|
|
11
11
|
//#region src/float-button/PurePanel.tsx
|
|
12
12
|
const PureFloatButton = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
13
13
|
return () => {
|
|
14
|
-
if (props.backTop) return createVNode(BackTop_default, mergeProps(omit(props, ["backTop"]), { "visibilityHeight": 0 }
|
|
14
|
+
if (props.backTop) return createVNode(BackTop_default, mergeProps(attrs, omit(props, ["backTop"]), { "visibilityHeight": 0 }), slots);
|
|
15
15
|
return createVNode(FloatButton_default, mergeProps(omit(props, ["backTop"]), attrs), slots);
|
|
16
16
|
};
|
|
17
17
|
}, {
|
|
@@ -134,7 +134,7 @@ const PurePanel = /* @__PURE__ */ defineComponent((props, { attrs, slots }) => {
|
|
|
134
134
|
const pureCls = computed(() => `${prefixCls.value}-pure`);
|
|
135
135
|
const renderItems = () => (props.items ?? []).map((item, index) => createVNode(PureFloatButton, mergeProps({ "key": index }, item), null));
|
|
136
136
|
return () => {
|
|
137
|
-
if (props.items && props.items.length) return createVNode(FloatButtonGroup_default, mergeProps(omit(props, [
|
|
137
|
+
if (props.items && props.items.length) return createVNode(FloatButtonGroup_default, mergeProps(pureAttrs(attrs), omit(props, [
|
|
138
138
|
"items",
|
|
139
139
|
"classes",
|
|
140
140
|
"styles"
|
|
@@ -142,12 +142,12 @@ const PurePanel = /* @__PURE__ */ defineComponent((props, { attrs, slots }) => {
|
|
|
142
142
|
"class": clsx(attrs.class, pureCls.value),
|
|
143
143
|
"classes": props.classes,
|
|
144
144
|
"styles": props.styles
|
|
145
|
-
}
|
|
146
|
-
return createVNode(PureFloatButton, mergeProps(omit(props, ["items"]), {
|
|
145
|
+
}), { default: () => renderItems() });
|
|
146
|
+
return createVNode(PureFloatButton, mergeProps(pureAttrs(attrs), omit(props, ["items"]), {
|
|
147
147
|
"class": clsx(attrs.class, pureCls.value),
|
|
148
148
|
"classes": props.classes,
|
|
149
149
|
"styles": props.styles
|
|
150
|
-
}
|
|
150
|
+
}), slots);
|
|
151
151
|
};
|
|
152
152
|
}, {
|
|
153
153
|
props: {
|
package/dist/form/ErrorList.js
CHANGED
|
@@ -6,7 +6,7 @@ import motion_default from "../_util/motion.js";
|
|
|
6
6
|
import isNonNullable_default from "../_util/isNonNullable.js";
|
|
7
7
|
import { useFormItemPrefixContext } from "./context.js";
|
|
8
8
|
import style_default from "./style/index.js";
|
|
9
|
-
import { Transition, TransitionGroup, computed, createVNode, defineComponent, isVNode,
|
|
9
|
+
import { Transition, TransitionGroup, computed, createVNode, defineComponent, isVNode, mergeProps } from "vue";
|
|
10
10
|
import { clsx } from "@v-c/util";
|
|
11
11
|
import { getTransitionGroupProps, getTransitionProps } from "@v-c/util/dist/utils/transition";
|
|
12
12
|
|
|
@@ -67,22 +67,19 @@ const ErrorList = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
67
67
|
props.onVisibleChanged?.(false);
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
const transitionGroupPropsName = `${prefixCls.value}-show-help-item`;
|
|
71
70
|
const transitionGroupProps = {
|
|
72
|
-
|
|
73
|
-
class: clsx(baseClassName.value, cssVarCls.value, rootCls.value, rootClassName, hashId.value),
|
|
74
|
-
...getTransitionGroupProps(transitionGroupPropsName),
|
|
71
|
+
...getTransitionGroupProps(`${prefixCls.value}-show-help-item`),
|
|
75
72
|
...collapseMotion,
|
|
76
73
|
name: `${prefixCls.value}-show-help-item`
|
|
77
74
|
};
|
|
78
|
-
return createVNode(Transition, transitionProps, { default: () => [
|
|
75
|
+
return createVNode(Transition, transitionProps, { default: () => [!!filledKeyFullKeyList.length && createVNode("div", { "class": clsx(baseClassName.value, cssVarCls.value, rootCls.value, rootClassName, hashId.value) }, [createVNode(TransitionGroup, mergeProps(transitionGroupProps, { "appear": true }), _isSlot(_slot = filledKeyFullKeyList.map((itemProps) => {
|
|
79
76
|
const { key, error, errorStatus, class: itemClassName, style: itemStyle } = itemProps;
|
|
80
77
|
return createVNode("div", {
|
|
81
78
|
"key": key,
|
|
82
79
|
"class": clsx(itemClassName, { [`${baseClassName.value}-${errorStatus}`]: !!errorStatus }),
|
|
83
80
|
"style": itemStyle
|
|
84
81
|
}, [error]);
|
|
85
|
-
})) ? _slot : { default: () => [_slot] })
|
|
82
|
+
})) ? _slot : { default: () => [_slot] })])] });
|
|
86
83
|
};
|
|
87
84
|
}, {
|
|
88
85
|
props: {
|
package/dist/form/Form.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { FormLabelAlign, ScrollFocusOptions } from "./interface.js";
|
|
|
7
7
|
import { FieldData, InternalNamePath, NamePath, Rule, ValidateErrorEntity, ValidateMessages, ValidateOptions } from "./types.js";
|
|
8
8
|
import { FeedbackIcons } from "./FormItem/index.js";
|
|
9
9
|
import { ComponentBaseProps, Variant } from "../config-provider/context.js";
|
|
10
|
-
import * as
|
|
10
|
+
import * as vue258 from "vue";
|
|
11
11
|
import { SlotsType } from "vue";
|
|
12
12
|
|
|
13
13
|
//#region src/form/Form.d.ts
|
|
@@ -42,6 +42,7 @@ interface FormProps extends ComponentBaseProps {
|
|
|
42
42
|
preserve?: boolean;
|
|
43
43
|
clearOnDestroy?: boolean;
|
|
44
44
|
validateOnRuleChange?: boolean;
|
|
45
|
+
autoComplete?: string | undefined;
|
|
45
46
|
}
|
|
46
47
|
interface FormEmits {
|
|
47
48
|
finish: (values: Record<string, any>) => void;
|
|
@@ -79,9 +80,12 @@ interface FormInstance {
|
|
|
79
80
|
validate: () => Promise<Record<string, any>>;
|
|
80
81
|
submit: () => void;
|
|
81
82
|
nativeElement: HTMLFormElement | undefined;
|
|
83
|
+
scrollToField: (fieldName: NamePath, options?: ScrollFocusOptions | boolean) => void;
|
|
84
|
+
focusField: (fieldName: NamePath) => void;
|
|
85
|
+
getFieldInstance: (name: NamePath) => any;
|
|
82
86
|
}
|
|
83
|
-
declare const InternalForm:
|
|
87
|
+
declare const InternalForm: vue258.DefineSetupFnComponent<FormProps, FormEmits, SlotsType<FormSlots>, FormProps & {
|
|
84
88
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
85
|
-
},
|
|
89
|
+
}, vue258.PublicProps>;
|
|
86
90
|
//#endregion
|
|
87
91
|
export { FormEmits, FormInstance, FormItemLayout, FormProps, FormSlots, InternalForm, RequiredMark };
|
package/dist/form/Form.js
CHANGED
|
@@ -178,29 +178,27 @@ const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, em
|
|
|
178
178
|
};
|
|
179
179
|
});
|
|
180
180
|
const nativeElementRef = shallowRef();
|
|
181
|
-
const scrollToField = (
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
} catch {}
|
|
195
|
-
}
|
|
181
|
+
const scrollToField = (fieldName, options = {}) => {
|
|
182
|
+
let defaultScrollToFirstError = { block: "nearest" };
|
|
183
|
+
if (typeof options === "object") defaultScrollToFirstError = {
|
|
184
|
+
...defaultScrollToFirstError,
|
|
185
|
+
...options
|
|
186
|
+
};
|
|
187
|
+
const targetId = getFieldId(fieldName, props.name);
|
|
188
|
+
const node = targetId ? document.getElementById(targetId) : null;
|
|
189
|
+
if (node) {
|
|
190
|
+
scrollIntoView(node, defaultScrollToFirstError);
|
|
191
|
+
if (defaultScrollToFirstError.focus !== false) try {
|
|
192
|
+
node.focus();
|
|
193
|
+
} catch {}
|
|
196
194
|
}
|
|
197
195
|
};
|
|
198
196
|
const onInternalFinishFailed = (errorInfo) => {
|
|
199
197
|
emit("finishFailed", errorInfo);
|
|
200
198
|
if (errorInfo.errorFields?.length) {
|
|
201
199
|
const fieldName = errorInfo.errorFields?.[0]?.name;
|
|
202
|
-
if (props.scrollToFirstError !== void 0) scrollToField(props.scrollToFirstError
|
|
203
|
-
else if (contextScrollToFirstError.value !== void 0) scrollToField(contextScrollToFirstError.value
|
|
200
|
+
if (props.scrollToFirstError !== void 0) scrollToField(fieldName, props.scrollToFirstError);
|
|
201
|
+
else if (contextScrollToFirstError.value !== void 0) scrollToField(fieldName, contextScrollToFirstError.value);
|
|
204
202
|
}
|
|
205
203
|
};
|
|
206
204
|
const updateModelValue = (namePath, value) => {
|
|
@@ -265,6 +263,10 @@ const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, em
|
|
|
265
263
|
const submit = () => {
|
|
266
264
|
handleSubmit(new Event("submit"));
|
|
267
265
|
};
|
|
266
|
+
useFormContextProvider(formContextValue);
|
|
267
|
+
useVariantContextProvider(variant);
|
|
268
|
+
useDisabledContextProvider(disabled);
|
|
269
|
+
useSizeProvider(mergedSize);
|
|
268
270
|
expose({
|
|
269
271
|
getFieldValue: (name) => getFieldValue(getNamePath(name)),
|
|
270
272
|
getFieldsValue,
|
|
@@ -283,12 +285,22 @@ const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, em
|
|
|
283
285
|
validateFields,
|
|
284
286
|
validate: () => validateFields(),
|
|
285
287
|
submit,
|
|
286
|
-
nativeElement: nativeElementRef
|
|
288
|
+
nativeElement: nativeElementRef,
|
|
289
|
+
scrollToField: (name, options = {}) => {
|
|
290
|
+
scrollToField(getNamePath(name), options);
|
|
291
|
+
},
|
|
292
|
+
focusField: (name) => {
|
|
293
|
+
const targetId = getFieldId(getNamePath(name), props.name);
|
|
294
|
+
const node = targetId ? document.getElementById(targetId) : null;
|
|
295
|
+
if (node) try {
|
|
296
|
+
node.focus?.();
|
|
297
|
+
} finally {}
|
|
298
|
+
},
|
|
299
|
+
getFieldInstance: (name) => {
|
|
300
|
+
const targetId = getFieldId(getNamePath(name), props.name);
|
|
301
|
+
if (targetId) return fields.value?.[targetId];
|
|
302
|
+
}
|
|
287
303
|
});
|
|
288
|
-
useFormContextProvider(formContextValue);
|
|
289
|
-
useVariantContextProvider(variant);
|
|
290
|
-
useDisabledContextProvider(disabled);
|
|
291
|
-
useSizeProvider(mergedSize);
|
|
292
304
|
watch(() => rules.value, () => {
|
|
293
305
|
if (props.validateOnRuleChange) validateFields();
|
|
294
306
|
}, { deep: true });
|
|
@@ -457,6 +469,11 @@ const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, em
|
|
|
457
469
|
required: false,
|
|
458
470
|
default: void 0
|
|
459
471
|
},
|
|
472
|
+
autoComplete: {
|
|
473
|
+
type: [String, null],
|
|
474
|
+
required: false,
|
|
475
|
+
default: void 0
|
|
476
|
+
},
|
|
460
477
|
rootClass: {
|
|
461
478
|
type: String,
|
|
462
479
|
required: false,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Rule } from "../types.js";
|
|
1
|
+
import { NamePath, Rule } from "../types.js";
|
|
2
2
|
import { FormItemLayout } from "../Form.js";
|
|
3
3
|
import { FormItemInputProps } from "../FormItemInput.js";
|
|
4
4
|
import { FormItemLabelProps, LabelTooltipType } from "../FormItemLabel.js";
|
|
5
5
|
import { ComponentBaseProps } from "../../config-provider/context.js";
|
|
6
|
-
import * as
|
|
6
|
+
import * as vue256 from "vue";
|
|
7
7
|
import { SlotsType } from "vue";
|
|
8
8
|
|
|
9
9
|
//#region src/form/FormItem/index.d.ts
|
|
@@ -15,7 +15,7 @@ type FeedbackIcons = (itemStatus: {
|
|
|
15
15
|
warnings?: any[];
|
|
16
16
|
}) => { [key in ValidateStatus]?: any };
|
|
17
17
|
interface BaseFormItemProps {
|
|
18
|
-
name?:
|
|
18
|
+
name?: NamePath;
|
|
19
19
|
rules?: Rule[];
|
|
20
20
|
trigger?: string;
|
|
21
21
|
validateTrigger?: string | string[] | false;
|
|
@@ -41,7 +41,7 @@ interface FormItemEmits {
|
|
|
41
41
|
interface FormItemSlots {
|
|
42
42
|
default: () => any;
|
|
43
43
|
}
|
|
44
|
-
declare const InternalFormItem:
|
|
44
|
+
declare const InternalFormItem: vue256.DefineSetupFnComponent<FormItemProps, FormItemEmits, SlotsType<FormItemSlots>, BaseFormItemProps & ComponentBaseProps & Omit<FormItemLabelProps, "requiredMark"> & FormItemInputProps & {
|
|
45
45
|
noStyle?: boolean;
|
|
46
46
|
id?: string;
|
|
47
47
|
hasFeedback?: boolean | {
|
|
@@ -55,6 +55,6 @@ declare const InternalFormItem: vue241.DefineSetupFnComponent<FormItemProps, For
|
|
|
55
55
|
layout?: FormItemLayout;
|
|
56
56
|
} & {
|
|
57
57
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
58
|
-
},
|
|
58
|
+
}, vue256.PublicProps>;
|
|
59
59
|
//#endregion
|
|
60
60
|
export { FeedbackIcons, InternalFormItem, ValidateStatus };
|
|
@@ -8,7 +8,7 @@ import { getNamePath, getValue, setValue } from "../utils/valueUtil.js";
|
|
|
8
8
|
import { validateRules } from "../utils/validateUtil.js";
|
|
9
9
|
import StatusProvider_default from "./StatusProvider.js";
|
|
10
10
|
import ItemHolder_default from "./ItemHolder.js";
|
|
11
|
-
import { computed, createVNode, defineComponent, isVNode, mergeProps, onBeforeUnmount, shallowRef, watch } from "vue";
|
|
11
|
+
import { cloneVNode, computed, createVNode, defineComponent, isVNode, mergeProps, onBeforeUnmount, shallowRef, watch } from "vue";
|
|
12
12
|
import { clsx } from "@v-c/util";
|
|
13
13
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
14
14
|
|
|
@@ -70,7 +70,7 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
70
70
|
const messageVariables = computed(() => {
|
|
71
71
|
let variables = {};
|
|
72
72
|
if (typeof props.label === "string") variables.label = props.label;
|
|
73
|
-
else if (props.name) variables.label = String(props.name);
|
|
73
|
+
else if (props.name) variables.label = Array.isArray(props.name) ? props.name.join(".") : String(props.name);
|
|
74
74
|
if (props.messageVariables) variables = {
|
|
75
75
|
...variables,
|
|
76
76
|
...props.messageVariables
|
|
@@ -178,7 +178,7 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
178
178
|
updateMeta({ touched: true });
|
|
179
179
|
triggerValidate("change");
|
|
180
180
|
};
|
|
181
|
-
const
|
|
181
|
+
const onFieldFocus = () => {
|
|
182
182
|
updateMeta({ touched: true });
|
|
183
183
|
triggerValidate("focus");
|
|
184
184
|
};
|
|
@@ -212,44 +212,64 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
212
212
|
};
|
|
213
213
|
});
|
|
214
214
|
const rootClassName = computed(() => clsx(cssVarCls.value, rootCls.value, hashId.value, props.rootClass));
|
|
215
|
-
const eventKey = `form-item-${fieldId.value || namePath.value.join("-") || Math.random().toString(36).slice(2)}
|
|
216
|
-
watch(hasName, (val) => {
|
|
217
|
-
if (val && formContext.value?.addField)
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
215
|
+
const eventKey = computed(() => `form-item-${fieldId.value || namePath.value.join("-") || Math.random().toString(36).slice(2)}`);
|
|
216
|
+
watch(hasName, (val, _, onCleanup) => {
|
|
217
|
+
if (val && formContext.value?.addField) {
|
|
218
|
+
formContext.value.addField(eventKey.value, {
|
|
219
|
+
onFieldBlur,
|
|
220
|
+
namePath: () => namePath.value,
|
|
221
|
+
getValue: () => fieldValue.value,
|
|
222
|
+
getMeta: () => meta.value,
|
|
223
|
+
rules: () => mergedRules.value,
|
|
224
|
+
validateRules: (options) => validateRulesInner(options),
|
|
225
|
+
resetField,
|
|
226
|
+
clearValidate,
|
|
227
|
+
setFieldState: (state) => {
|
|
228
|
+
if (state.errors) errors.value = state.errors;
|
|
229
|
+
if (state.warnings) warnings.value = state.warnings;
|
|
230
|
+
updateMeta({
|
|
231
|
+
...meta.value,
|
|
232
|
+
...state,
|
|
233
|
+
errors: state.errors ?? meta.value.errors,
|
|
234
|
+
warnings: state.warnings ?? meta.value.warnings
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
onCleanup(() => {
|
|
239
|
+
formContext.value?.removeField?.(eventKey.value);
|
|
240
|
+
});
|
|
241
|
+
} else formContext.value?.removeField?.(eventKey.value);
|
|
238
242
|
}, { immediate: true });
|
|
239
243
|
onBeforeUnmount(() => {
|
|
240
|
-
formContext.value?.removeField?.(eventKey);
|
|
244
|
+
formContext.value?.removeField?.(eventKey.value);
|
|
241
245
|
});
|
|
242
246
|
useFormItemProvider({
|
|
243
247
|
fieldId,
|
|
244
248
|
triggerBlur: onFieldBlur,
|
|
245
249
|
triggerChange: onFieldChange,
|
|
246
250
|
clearValidate,
|
|
247
|
-
triggerFocus:
|
|
251
|
+
triggerFocus: onFieldFocus
|
|
248
252
|
});
|
|
249
253
|
return () => {
|
|
250
254
|
return renderLayout(checkRenderNode(filterEmpty(slots.default?.() ?? [])), fieldId.value, isRequired.value);
|
|
251
255
|
};
|
|
252
256
|
function renderLayout(baseChildren, currentFieldId, isRequiredMark) {
|
|
257
|
+
if (Array.isArray(baseChildren) && baseChildren.length === 1 && isVNode(baseChildren[0]) || isVNode(baseChildren)) {
|
|
258
|
+
const child = isVNode(baseChildren) ? baseChildren : baseChildren[0];
|
|
259
|
+
const childProps = child.props || {};
|
|
260
|
+
baseChildren = cloneVNode(child, {
|
|
261
|
+
id: currentFieldId,
|
|
262
|
+
...childProps,
|
|
263
|
+
onBlur: (...args) => {
|
|
264
|
+
onFieldBlur();
|
|
265
|
+
if (childProps.onBlur) childProps.onBlur(...args);
|
|
266
|
+
},
|
|
267
|
+
onFocus: (...args) => {
|
|
268
|
+
onFieldFocus();
|
|
269
|
+
if (childProps.onFocus) childProps.onFocus(...args);
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
253
273
|
if (props.noStyle && !props.hidden) return createVNode(StatusProvider_default, {
|
|
254
274
|
"prefixCls": prefixCls.value,
|
|
255
275
|
"hasFeedback": props.hasFeedback,
|
|
@@ -284,7 +304,6 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
284
304
|
}, {
|
|
285
305
|
props: {
|
|
286
306
|
name: {
|
|
287
|
-
type: String,
|
|
288
307
|
required: false,
|
|
289
308
|
default: void 0
|
|
290
309
|
},
|
|
@@ -35,25 +35,23 @@ const FormItemInput = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
35
35
|
const children = filterEmpty(slots?.default?.() ?? []);
|
|
36
36
|
const mergedWrapperColFn = () => {
|
|
37
37
|
let mergedWrapper = { ...wrapperCol || formContext.value?.wrapperCol || {} };
|
|
38
|
-
if (label === null && !labelCol && !wrapperCol && formContext.value?.labelCol)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return mergedWrapper;
|
|
56
|
-
}
|
|
38
|
+
if (label === null && !labelCol && !wrapperCol && formContext.value?.labelCol) [
|
|
39
|
+
void 0,
|
|
40
|
+
"xs",
|
|
41
|
+
"sm",
|
|
42
|
+
"md",
|
|
43
|
+
"lg",
|
|
44
|
+
"xl",
|
|
45
|
+
"xxl"
|
|
46
|
+
].forEach((size) => {
|
|
47
|
+
const _size = size ? [size] : [];
|
|
48
|
+
const formLabel = get(formContext?.value?.labelCol, _size);
|
|
49
|
+
const formLabelObj = typeof formLabel === "object" ? formLabel : {};
|
|
50
|
+
const wrapper = get(mergedWrapper, _size);
|
|
51
|
+
const wrapperObj = typeof wrapper === "object" ? wrapper : {};
|
|
52
|
+
if ("span" in formLabelObj && !("offset" in wrapperObj) && formLabelObj.span < GRID_MAX) mergedWrapper = set(mergedWrapper, [..._size, "offset"], formLabelObj.span);
|
|
53
|
+
});
|
|
54
|
+
return mergedWrapper;
|
|
57
55
|
};
|
|
58
56
|
const mergedWrapperCol = mergedWrapperColFn();
|
|
59
57
|
const className = clsx(`${baseClassName.value}-control`, mergedWrapperCol?.class);
|
|
@@ -5,12 +5,15 @@ import setValue from "@v-c/util/dist/utils/set";
|
|
|
5
5
|
//#region src/form/utils/valueUtil.ts
|
|
6
6
|
/**
|
|
7
7
|
* Convert name to internal supported format.
|
|
8
|
-
*
|
|
8
|
+
* Support formats:
|
|
9
9
|
* 'a' => ['a']
|
|
10
|
+
* 'a.b.c' => ['a', 'b', 'c']
|
|
10
11
|
* 123 => [123]
|
|
11
12
|
* ['a', 123] => ['a', 123]
|
|
13
|
+
* ['a', 'b', 'c'] => ['a', 'b', 'c']
|
|
12
14
|
*/
|
|
13
15
|
function getNamePath(path) {
|
|
16
|
+
if (typeof path === "string") return path.split(".");
|
|
14
17
|
return toArray(path);
|
|
15
18
|
}
|
|
16
19
|
/**
|
package/dist/grid/col.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { useConfig } from "../config-provider/context.js";
|
|
2
|
+
import { genCssVar } from "../theme/util/genStyleUtils.js";
|
|
2
3
|
import { useColStyle } from "./style/index.js";
|
|
3
4
|
import { useRowContext } from "./RowContext.js";
|
|
4
5
|
import { computed, createVNode, defineComponent, mergeProps } from "vue";
|
|
5
6
|
import { classNames } from "@v-c/util";
|
|
6
7
|
|
|
7
8
|
//#region src/grid/col.tsx
|
|
9
|
+
function isNumber(value) {
|
|
10
|
+
return typeof value === "number" && !Number.isNaN(value);
|
|
11
|
+
}
|
|
8
12
|
function parseFlex(flex) {
|
|
9
|
-
if (
|
|
13
|
+
if (isNumber(flex)) return `${flex} ${flex} auto`;
|
|
10
14
|
if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) return `0 0 ${flex}`;
|
|
11
15
|
return flex;
|
|
12
16
|
}
|
|
@@ -22,6 +26,7 @@ const Col = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
22
26
|
const configCtx = useConfig();
|
|
23
27
|
const { gutter, wrap } = useRowContext();
|
|
24
28
|
const prefixCls = computed(() => configCtx.value?.getPrefixCls("col", props.prefixCls));
|
|
29
|
+
const [varName] = genCssVar(computed(() => configCtx.value?.getPrefixCls()).value, "col");
|
|
25
30
|
const [hashId, cssVarCls] = useColStyle(prefixCls);
|
|
26
31
|
return () => {
|
|
27
32
|
const { span, order, offset, push, pull, flex } = props;
|
|
@@ -43,7 +48,7 @@ const Col = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
43
48
|
};
|
|
44
49
|
if (sizeProps.flex) {
|
|
45
50
|
sizeClassObj[`${prefixCls.value}-${size}-flex`] = true;
|
|
46
|
-
sizeStyle[
|
|
51
|
+
sizeStyle[varName(`${size}-flex`)] = parseFlex(sizeProps.flex);
|
|
47
52
|
}
|
|
48
53
|
});
|
|
49
54
|
const classes = classNames(prefixCls.value, {
|
package/dist/grid/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Breakpoint } from "../_util/responsiveObserver.js";
|
|
2
2
|
import { Col, ColProps, ColSize } from "./col.js";
|
|
3
3
|
import { Row, RowProps } from "./row.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as vue5 from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/grid/index.d.ts
|
|
7
|
-
declare function useBreakpoint():
|
|
7
|
+
declare function useBreakpoint(): vue5.Ref<{
|
|
8
8
|
xxl?: boolean | undefined;
|
|
9
9
|
xl?: boolean | undefined;
|
|
10
10
|
lg?: boolean | undefined;
|
package/dist/grid/style/index.js
CHANGED
|
@@ -31,8 +31,9 @@ const genGridColStyle = (token) => {
|
|
|
31
31
|
} };
|
|
32
32
|
};
|
|
33
33
|
function genLoopGridColumnsStyle(token, sizeCls) {
|
|
34
|
-
const {
|
|
35
|
-
const [
|
|
34
|
+
const { componentCls, gridColumns, antCls } = token;
|
|
35
|
+
const [gridVarName, gridVarRef] = genCssVar(antCls, "grid");
|
|
36
|
+
const [, colVarRef] = genCssVar(antCls, "col");
|
|
36
37
|
const gridColumnsStyle = {};
|
|
37
38
|
for (let i = gridColumns; i >= 0; i--) if (i === 0) {
|
|
38
39
|
gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = { display: "none" };
|
|
@@ -44,10 +45,10 @@ function genLoopGridColumnsStyle(token, sizeCls) {
|
|
|
44
45
|
gridColumnsStyle[`${componentCls}${sizeCls}-order-${i}`] = { order: 0 };
|
|
45
46
|
} else {
|
|
46
47
|
gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = [{
|
|
47
|
-
[
|
|
48
|
+
[gridVarName("display")]: "block",
|
|
48
49
|
display: "block"
|
|
49
50
|
}, {
|
|
50
|
-
display:
|
|
51
|
+
display: gridVarRef("display"),
|
|
51
52
|
flex: `0 0 ${i / gridColumns * 100}%`,
|
|
52
53
|
maxWidth: `${i / gridColumns * 100}%`
|
|
53
54
|
}];
|
|
@@ -56,7 +57,7 @@ function genLoopGridColumnsStyle(token, sizeCls) {
|
|
|
56
57
|
gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i}`] = { marginInlineStart: `${i / gridColumns * 100}%` };
|
|
57
58
|
gridColumnsStyle[`${componentCls}${sizeCls}-order-${i}`] = { order: i };
|
|
58
59
|
}
|
|
59
|
-
gridColumnsStyle[`${componentCls}${sizeCls}-flex`] = { flex:
|
|
60
|
+
gridColumnsStyle[`${componentCls}${sizeCls}-flex`] = { flex: colVarRef(`${sizeCls.replace(/-/, "")}-flex`) };
|
|
60
61
|
return gridColumnsStyle;
|
|
61
62
|
}
|
|
62
63
|
function genGridStyle(token, sizeCls) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaskType } from "../_util/hooks/useMergedMask.js";
|
|
2
2
|
import "../_util/hooks/index.js";
|
|
3
3
|
import { DeprecatedPreviewConfig, ImageClassNamesType, ImageStylesType } from "./index.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as vue260 from "vue";
|
|
5
5
|
import { PreviewGroupProps } from "@v-c/image";
|
|
6
6
|
|
|
7
7
|
//#region src/image/PreviewGroup.d.ts
|
|
@@ -17,6 +17,6 @@ interface PreviewGroupProps$1 extends Omit<PreviewGroupProps, 'preview' | 'style
|
|
|
17
17
|
classes?: ImageClassNamesType;
|
|
18
18
|
styles?: ImageStylesType;
|
|
19
19
|
}
|
|
20
|
-
declare const InternalPreviewGroup:
|
|
20
|
+
declare const InternalPreviewGroup: vue260.DefineSetupFnComponent<PreviewGroupProps$1, {}, {}, PreviewGroupProps$1 & {}, vue260.PublicProps>;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { InternalPreviewGroup, PreviewGroupProps$1 as PreviewGroupProps };
|
package/dist/image/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { VueNode } from "../_util/type.js";
|
|
|
3
3
|
import { SemanticClassNames, SemanticClassNamesType, SemanticStyles, SemanticStylesType } from "../_util/hooks/useMergeSemantic.js";
|
|
4
4
|
import "../_util/hooks/index.js";
|
|
5
5
|
import { InternalPreviewGroup, PreviewGroupProps as PreviewGroupProps$1 } from "./PreviewGroup.js";
|
|
6
|
-
import * as
|
|
6
|
+
import * as vue92 from "vue";
|
|
7
7
|
import { CSSProperties, SlotsType } from "vue";
|
|
8
8
|
import { ImageProps } from "@v-c/image";
|
|
9
9
|
|
|
@@ -58,14 +58,17 @@ interface ImageEmits {
|
|
|
58
58
|
interface ImageSlots {
|
|
59
59
|
fallback: () => any;
|
|
60
60
|
placeholder: () => any;
|
|
61
|
+
imageRender: () => any;
|
|
62
|
+
cover: () => any;
|
|
63
|
+
actionsRender: () => OriginPreviewConfig['actionsRender'];
|
|
61
64
|
}
|
|
62
|
-
declare const Image:
|
|
65
|
+
declare const Image: vue92.DefineSetupFnComponent<ImageProps$1, ImageEmits, SlotsType<ImageSlots>, ImageProps$1 & {
|
|
63
66
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
64
|
-
},
|
|
67
|
+
}, vue92.PublicProps>;
|
|
65
68
|
declare const _default_1: typeof Image & {
|
|
66
69
|
PreviewGroup: typeof InternalPreviewGroup;
|
|
67
70
|
};
|
|
68
|
-
declare const ImagePreviewGroup:
|
|
71
|
+
declare const ImagePreviewGroup: vue92.DefineSetupFnComponent<PreviewGroupProps$1, {}, {}, PreviewGroupProps$1 & {}, vue92.PublicProps>;
|
|
69
72
|
type ImagePreviewGroupProps = PreviewGroupProps$1;
|
|
70
73
|
//#endregion
|
|
71
74
|
export { DeprecatedPreviewConfig, ImageClassNamesType, ImageEmits, ImagePreviewGroup, ImagePreviewGroupProps, ImageProps$1 as ImageProps, ImageSlots, ImageStylesType, PreviewConfig, _default_1 };
|
package/dist/image/index.js
CHANGED
|
@@ -77,6 +77,8 @@ const Image = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
77
77
|
emit("click", e);
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
+
if (slots?.imageRender) mergedPreviewConfig.value.imageRender = slots.imageRender;
|
|
81
|
+
if ((mergedPreviewConfig.value?.mask || typeof mergedPreviewConfig.value?.mask === "boolean") && !mergedPreviewConfig.value.cover) mergedPreviewConfig.value.cover = slots?.cover?.();
|
|
80
82
|
return createVNode(VcImage, mergeProps(restAttrs, {
|
|
81
83
|
"prefixCls": prefixCls.value,
|
|
82
84
|
"preview": mergedPreviewConfig.value || false,
|