antdv-next 1.0.0-alpha.4 → 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/_util/tools.js +2 -1
- package/dist/_util/wave/WaveEffect.js +6 -1
- package/dist/_util/wave/style.js +4 -3
- package/dist/affix/index.d.ts +3 -3
- package/dist/alert/Alert.d.ts +4 -3
- package/dist/alert/Alert.js +1 -1
- package/dist/anchor/Anchor.d.ts +5 -5
- package/dist/anchor/AnchorLink.js +2 -2
- package/dist/anchor/index.d.ts +1 -1
- package/dist/antd.js +123 -115
- package/dist/app/App.d.ts +2 -2
- package/dist/auto-complete/index.d.ts +78 -0
- package/dist/auto-complete/index.js +634 -0
- 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 +5 -5
- package/dist/breadcrumb/Breadcrumb.js +0 -8
- package/dist/breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/dist/breadcrumb/BreadcrumbItem.js +1 -17
- package/dist/breadcrumb/index.d.ts +1 -1
- package/dist/button/Button.d.ts +3 -3
- package/dist/button/style/variant.js +116 -104
- package/dist/calendar/Header.js +1 -1
- 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/carousel/index.d.ts +3 -3
- package/dist/cascader/Panel.d.ts +3 -3
- package/dist/cascader/index.d.ts +4 -3
- package/dist/cascader/index.js +3 -1
- 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/collapse/Collapse.d.ts +3 -3
- package/dist/color-picker/ColorPicker.d.ts +3 -3
- package/dist/color-picker/ColorPicker.js +13 -2
- package/dist/components.d.ts +11 -8
- package/dist/components.js +7 -4
- package/dist/config-provider/context.d.ts +2 -1
- package/dist/config-provider/context.js +3 -3
- 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 +2 -2
- package/dist/date-picker/generatePicker/generateSinglePicker.js +3 -2
- 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 +4 -4
- package/dist/dropdown/dropdown.js +12 -3
- 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/float-button/style/button.js +4 -4
- package/dist/float-button/style/group.js +12 -12
- 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/style/index.js +3 -2
- 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/row.d.ts +2 -2
- package/dist/grid/style/index.js +7 -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 +16 -12
- package/dist/index.js +7 -4
- package/dist/input/Input.js +1 -1
- package/dist/input/OTP/index.js +1 -1
- package/dist/input/TextArea.d.ts +3 -3
- package/dist/input/TextArea.js +1 -1
- 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 +2 -6
- package/dist/input-number/style/index.js +18 -17
- 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/masonry/Masonry.js +8 -6
- package/dist/mentions/index.d.ts +4 -3
- package/dist/mentions/index.js +4 -2
- package/dist/mentions/style/index.js +18 -17
- package/dist/menu/MenuDivider.d.ts +2 -2
- package/dist/menu/MenuItem.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 +2 -1
- package/dist/notification/useNotification.js +7 -7
- package/dist/package.d.ts +143 -3
- package/dist/package.js +1 -1
- package/dist/pagination/Pagination.d.ts +3 -3
- package/dist/pagination/Pagination.js +1 -1
- package/dist/pagination/style/index.js +61 -50
- 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/popover/style/index.js +11 -8
- 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/result/noFound.d.ts +2 -2
- package/dist/result/serverError.d.ts +2 -2
- package/dist/segmented/index.d.ts +3 -3
- package/dist/select/index.d.ts +6 -6
- package/dist/select/index.js +5 -3
- package/dist/select/style/dropdown.js +1 -1
- package/dist/select/style/select-input-multiple.js +31 -29
- package/dist/select/style/select-input.js +50 -44
- 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/Compact.d.ts +2 -0
- package/dist/space/Compact.js +17 -4
- package/dist/space/index.d.ts +5 -5
- package/dist/space/style/addon.js +20 -19
- package/dist/spin/index.d.ts +3 -3
- package/dist/spin/index.js +7 -6
- package/dist/splitter/SplitBar.js +9 -2
- package/dist/splitter/Splitter.d.ts +3 -3
- package/dist/splitter/Splitter.js +2 -1
- package/dist/splitter/index.d.ts +2 -2
- package/dist/splitter/style/index.js +6 -6
- 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/ProgressIcon.js +9 -2
- package/dist/steps/index.d.ts +3 -3
- package/dist/steps/index.js +7 -4
- package/dist/steps/style/horizontal.js +13 -10
- package/dist/steps/style/icon.js +12 -9
- package/dist/steps/style/index.js +19 -18
- package/dist/steps/style/inline.js +20 -17
- package/dist/steps/style/label-placement.js +22 -20
- package/dist/steps/style/nav.js +7 -5
- package/dist/steps/style/panel.js +34 -32
- package/dist/steps/style/progress-dot.js +10 -8
- package/dist/steps/style/progress.js +29 -58
- package/dist/steps/style/rtl.js +6 -4
- package/dist/steps/style/small.js +10 -8
- package/dist/steps/style/status.js +124 -121
- package/dist/steps/style/util.js +7 -4
- package/dist/steps/style/vertical.js +17 -14
- package/dist/style/placementArrow.js +7 -5
- 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 +20 -6
- package/dist/table/Table.d.ts +3 -3
- package/dist/table/hooks/useFilter/FilterDropdown.js +1 -1
- 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 +1 -1
- 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/genStyleUtils.js +8 -5
- 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 +12 -8
- package/dist/tooltip/UniqueProvider/index.d.ts +2 -2
- package/dist/tooltip/index.d.ts +3 -3
- package/dist/tooltip/index.js +2 -3
- package/dist/tooltip/style/index.js +10 -8
- package/dist/tooltip/util.js +5 -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/tour/style/index.js +5 -4
- 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 +2 -2
- 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 +3 -1
- package/dist/typography/Link.d.ts +3 -3
- 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 +6 -3
- package/dist/upload/Upload.d.ts +3 -3
- package/dist/upload/Upload.js +15 -1
- package/dist/upload/index.d.ts +6 -3
- package/dist/upload/interface.d.ts +4 -4
- package/global.d.ts +3 -0
- package/package.json +69 -17
- package/web-tags.json +5069 -0
- package/web-types.json +14335 -0
|
@@ -4,18 +4,18 @@ import { unit } from "@antdv-next/cssinjs";
|
|
|
4
4
|
//#region src/float-button/style/button.ts
|
|
5
5
|
const genFloatButtonStyle = (token) => {
|
|
6
6
|
const { componentCls, floatButtonSize, iconCls, antCls, floatButtonIconSize } = token;
|
|
7
|
-
const
|
|
7
|
+
const [varName, varRef] = genCssVar(antCls, "float-btn");
|
|
8
8
|
const badgeCls = `${componentCls}-badge`;
|
|
9
9
|
const R = Math.SQRT2;
|
|
10
10
|
const offsetR = (R - 1) / R;
|
|
11
11
|
const offsetSquare = token.calc(token.borderRadius).mul(offsetR).equal();
|
|
12
12
|
const offsetCircle = token.calc(token.controlHeight).div(2).mul(offsetR).equal();
|
|
13
|
-
return { [componentCls]: [{ [
|
|
13
|
+
return { [componentCls]: [{ [varName("size")]: unit(floatButtonSize) }, {
|
|
14
14
|
"flexDirection": "column",
|
|
15
15
|
"margin": 0,
|
|
16
16
|
"padding": `${unit(token.paddingXXS)} 0`,
|
|
17
|
-
"width":
|
|
18
|
-
"minHeight":
|
|
17
|
+
"width": varRef("size"),
|
|
18
|
+
"minHeight": varRef("size"),
|
|
19
19
|
"height": "auto",
|
|
20
20
|
"wordBreak": "break-word",
|
|
21
21
|
"whiteSpace": "normal",
|
|
@@ -7,11 +7,11 @@ const genGroupStyle = (token) => {
|
|
|
7
7
|
const { componentCls, antCls, floatButtonSize, padding } = token;
|
|
8
8
|
const groupCls = `${componentCls}-group`;
|
|
9
9
|
const listCls = `${groupCls}-list`;
|
|
10
|
-
const
|
|
10
|
+
const [varName, varRef] = genCssVar(antCls, "float-btn");
|
|
11
11
|
return { [groupCls]: [
|
|
12
12
|
{
|
|
13
|
-
[
|
|
14
|
-
[
|
|
13
|
+
[varName("list-transform-start")]: `translate(0,${unit(floatButtonSize)})`,
|
|
14
|
+
[varName("list-trigger-offset")]: `calc(${unit(floatButtonSize)} + ${unit(padding)})`
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
...resetComponent(token),
|
|
@@ -40,7 +40,7 @@ const genGroupStyle = (token) => {
|
|
|
40
40
|
"transition": `all ${token.motionDurationSlow}`,
|
|
41
41
|
"&-enter, &-appear": {
|
|
42
42
|
"opacity": 0,
|
|
43
|
-
"transform":
|
|
43
|
+
"transform": varRef("list-transform-start"),
|
|
44
44
|
"&-active": {
|
|
45
45
|
opacity: 1,
|
|
46
46
|
transform: `translate(0, 0)`
|
|
@@ -48,22 +48,22 @@ const genGroupStyle = (token) => {
|
|
|
48
48
|
},
|
|
49
49
|
"&-leave": { "&-active": {
|
|
50
50
|
opacity: 0,
|
|
51
|
-
transform:
|
|
51
|
+
transform: varRef("list-transform-start")
|
|
52
52
|
} }
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
"&-top": { [listCls]: { bottom:
|
|
55
|
+
"&-top": { [listCls]: { bottom: varRef("list-trigger-offset") } },
|
|
56
56
|
"&-bottom": { [listCls]: {
|
|
57
|
-
[
|
|
58
|
-
top:
|
|
57
|
+
[varName("list-transform-start")]: `translate(0, calc(${unit(floatButtonSize)} * -1))`,
|
|
58
|
+
top: varRef("list-trigger-offset")
|
|
59
59
|
} },
|
|
60
60
|
"&-left": { [listCls]: {
|
|
61
|
-
[
|
|
62
|
-
right:
|
|
61
|
+
[varName("list-transform-start")]: `translate(${unit(floatButtonSize)}, 0)`,
|
|
62
|
+
right: varRef("list-trigger-offset")
|
|
63
63
|
} },
|
|
64
64
|
"&-right": { [listCls]: {
|
|
65
|
-
[
|
|
66
|
-
left:
|
|
65
|
+
[varName("list-transform-start")]: `translate(calc(${unit(floatButtonSize)} * -1), 0)`,
|
|
66
|
+
left: varRef("list-trigger-offset")
|
|
67
67
|
} }
|
|
68
68
|
}
|
|
69
69
|
] };
|
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: vue313.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);
|
package/dist/form/style/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resetComponent } from "../../style/index.js";
|
|
2
|
-
import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
2
|
+
import { genCssVar, genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
3
3
|
import { mergeToken } from "../../theme/internal.js";
|
|
4
4
|
import collapse_default from "../../style/motion/collapse.js";
|
|
5
5
|
import { zoomIn } from "../../style/motion/zoom.js";
|
|
@@ -66,6 +66,7 @@ const genFormStyle = (token) => {
|
|
|
66
66
|
};
|
|
67
67
|
const genFormItemStyle = (token) => {
|
|
68
68
|
const { formItemCls, iconCls, rootPrefixCls, antCls, labelRequiredMarkColor, labelColor, labelFontSize, labelHeight, labelColonMarginInlineStart, labelColonMarginInlineEnd, itemMarginBottom } = token;
|
|
69
|
+
const [varName] = genCssVar(antCls, "grid");
|
|
69
70
|
return { [formItemCls]: {
|
|
70
71
|
...resetComponent(token),
|
|
71
72
|
"marginBottom": itemMarginBottom,
|
|
@@ -138,7 +139,7 @@ const genFormItemStyle = (token) => {
|
|
|
138
139
|
}
|
|
139
140
|
},
|
|
140
141
|
[`${formItemCls}-control`]: {
|
|
141
|
-
["
|
|
142
|
+
[varName("display")]: "flex",
|
|
142
143
|
"flexDirection": "column",
|
|
143
144
|
"flexGrow": 1,
|
|
144
145
|
[`&:first-child:not([class^="'${rootPrefixCls}-col-'"]):not([class*="' ${rootPrefixCls}-col-'"])`]: { width: "100%" },
|
|
@@ -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/row.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Breakpoint } from "../_util/responsiveObserver.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue9 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/grid/row.d.ts
|
|
5
5
|
declare const _RowAligns: readonly ["top", "middle", "bottom", "stretch"];
|
|
@@ -16,6 +16,6 @@ interface RowProps {
|
|
|
16
16
|
prefixCls?: string;
|
|
17
17
|
wrap?: boolean;
|
|
18
18
|
}
|
|
19
|
-
declare const Row:
|
|
19
|
+
declare const Row: vue9.DefineSetupFnComponent<RowProps, {}, {}, RowProps & {}, vue9.PublicProps>;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { Row, RowProps };
|
package/dist/grid/style/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
1
|
+
import { genCssVar, genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
2
2
|
import { mergeToken } from "../../theme/internal.js";
|
|
3
3
|
import { unit } from "@antdv-next/cssinjs";
|
|
4
4
|
|
|
@@ -31,7 +31,9 @@ const genGridColStyle = (token) => {
|
|
|
31
31
|
} };
|
|
32
32
|
};
|
|
33
33
|
function genLoopGridColumnsStyle(token, sizeCls) {
|
|
34
|
-
const {
|
|
34
|
+
const { componentCls, gridColumns, antCls } = token;
|
|
35
|
+
const [gridVarName, gridVarRef] = genCssVar(antCls, "grid");
|
|
36
|
+
const [, colVarRef] = genCssVar(antCls, "col");
|
|
35
37
|
const gridColumnsStyle = {};
|
|
36
38
|
for (let i = gridColumns; i >= 0; i--) if (i === 0) {
|
|
37
39
|
gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = { display: "none" };
|
|
@@ -43,10 +45,10 @@ function genLoopGridColumnsStyle(token, sizeCls) {
|
|
|
43
45
|
gridColumnsStyle[`${componentCls}${sizeCls}-order-${i}`] = { order: 0 };
|
|
44
46
|
} else {
|
|
45
47
|
gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = [{
|
|
46
|
-
["
|
|
48
|
+
[gridVarName("display")]: "block",
|
|
47
49
|
display: "block"
|
|
48
50
|
}, {
|
|
49
|
-
display: "
|
|
51
|
+
display: gridVarRef("display"),
|
|
50
52
|
flex: `0 0 ${i / gridColumns * 100}%`,
|
|
51
53
|
maxWidth: `${i / gridColumns * 100}%`
|
|
52
54
|
}];
|
|
@@ -55,7 +57,7 @@ function genLoopGridColumnsStyle(token, sizeCls) {
|
|
|
55
57
|
gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i}`] = { marginInlineStart: `${i / gridColumns * 100}%` };
|
|
56
58
|
gridColumnsStyle[`${componentCls}${sizeCls}-order-${i}`] = { order: i };
|
|
57
59
|
}
|
|
58
|
-
gridColumnsStyle[`${componentCls}${sizeCls}-flex`] = { flex:
|
|
60
|
+
gridColumnsStyle[`${componentCls}${sizeCls}-flex`] = { flex: colVarRef(`${sizeCls.replace(/-/, "")}-flex`) };
|
|
59
61
|
return gridColumnsStyle;
|
|
60
62
|
}
|
|
61
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 };
|