antdv-next 1.8.1 → 1.8.3
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 +1 -1
- package/dist/_util/hooks/index.js +1 -1
- package/dist/_util/hooks/useClosable.d.ts +3 -3
- package/dist/_util/hooks/useClosable.js +9 -9
- package/dist/_util/hooks/useZIndex.js +14 -15
- package/dist/_util/vueNode.d.ts +6 -2
- package/dist/affix/index.js +27 -12
- package/dist/alert/Alert.d.ts +2 -2
- package/dist/alert/Alert.js +3 -3
- package/dist/alert/style/index.js +14 -8
- package/dist/anchor/Anchor.js +3 -1
- package/dist/antd-with-locales.esm.js +19634 -19203
- package/dist/antd-with-locales.js +112 -112
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +17697 -17268
- package/dist/antd.js +113 -113
- package/dist/app/App.js +2 -2
- package/dist/auto-complete/index.js +2 -2
- package/dist/avatar/Avatar.js +2 -2
- package/dist/avatar/AvatarGroup.js +1 -1
- package/dist/badge/Ribbon.js +1 -1
- package/dist/badge/index.d.ts +4 -1
- package/dist/badge/index.js +6 -6
- package/dist/border-beam/BorderBeam.js +1 -1
- package/dist/breadcrumb/Breadcrumb.js +2 -2
- package/dist/button/Button.js +1 -1
- package/dist/button/style/index.js +8 -2
- package/dist/calendar/generateCalendar.js +3 -3
- package/dist/card/Card.js +2 -2
- package/dist/card/CardGrid.js +1 -1
- package/dist/card/CardMeta.js +1 -1
- package/dist/card/style/index.js +2 -2
- package/dist/carousel/index.js +2 -2
- package/dist/cascader/Panel.js +1 -1
- package/dist/cascader/index.js +4 -4
- package/dist/checkbox/Checkbox.js +3 -2
- package/dist/checkbox/Group.js +1 -1
- package/dist/collapse/Collapse.js +2 -2
- package/dist/color-picker/ColorPicker.js +6 -2
- package/dist/color-picker/ColorPickerPanel.js +4 -0
- package/dist/color-picker/components/ColorSlider.js +12 -4
- package/dist/color-picker/components/PanelPicker/GradientColorBar.js +2 -0
- package/dist/components.d.ts +12 -8
- package/dist/components.js +3 -3
- package/dist/config-provider/context.d.ts +5 -3
- package/dist/config-provider/context.js +3 -3
- package/dist/config-provider/define.d.ts +5 -1
- package/dist/config-provider/index.js +38 -4
- package/dist/date-picker/generatePicker/generateRangePicker.js +3 -3
- package/dist/date-picker/generatePicker/generateSinglePicker.js +3 -3
- package/dist/date-picker/hooks/useMergedPickerSemantic.js +1 -1
- package/dist/date-picker/style/panel.js +3 -5
- package/dist/descriptions/hooks/useItems.d.ts +2 -2
- package/dist/descriptions/hooks/useRow.js +1 -1
- package/dist/descriptions/index.js +2 -2
- package/dist/divider/index.js +1 -1
- package/dist/drawer/DrawerPanel.js +1 -1
- package/dist/drawer/index.js +3 -3
- package/dist/dropdown/dropdown.js +3 -3
- package/dist/empty/index.js +2 -1
- package/dist/float-button/BackTop.js +2 -2
- package/dist/float-button/FloatButton.js +1 -1
- package/dist/float-button/FloatButtonGroup.js +2 -2
- package/dist/float-button/PurePanel.js +1 -1
- package/dist/form/ErrorList.js +1 -1
- package/dist/form/Form.d.ts +17 -44
- package/dist/form/Form.js +56 -7
- package/dist/form/FormItem/ItemHolder.js +3 -3
- package/dist/form/FormItem/index.d.ts +3 -3
- package/dist/form/FormItem/index.js +1 -1
- package/dist/form/FormItemLabel.js +1 -1
- package/dist/form/context.d.ts +3 -3
- package/dist/form/hooks/useForm.d.ts +4 -5
- package/dist/form/hooks/useVariant.js +1 -1
- package/dist/form/index.d.ts +29 -3
- package/dist/form/index.js +6 -6
- package/dist/form/types.d.ts +15 -7
- package/dist/grid/col.js +1 -1
- package/dist/grid/row.js +1 -1
- package/dist/image/PreviewGroup.js +2 -2
- package/dist/image/index.d.ts +5 -5
- package/dist/image/index.js +9 -5
- package/dist/index.d.ts +14 -7
- package/dist/index.js +2 -2
- package/dist/input/Group.js +2 -2
- package/dist/input/Input.js +2 -2
- package/dist/input/OTP/OTPInput.js +1 -1
- package/dist/input/OTP/index.js +2 -2
- package/dist/input/Password.js +1 -1
- package/dist/input/Search.js +2 -2
- package/dist/input/TextArea.js +2 -2
- package/dist/input-number/index.js +3 -3
- package/dist/input-number/style/index.js +3 -2
- package/dist/layout/Sider.js +2 -2
- package/dist/layout/layout.js +2 -3
- package/dist/listy/index.js +1 -1
- package/dist/locale/id_ID.js +8 -6
- package/dist/locale/uz_UZ.js +12 -12
- package/dist/masonry/Masonry.js +1 -1
- package/dist/mentions/index.js +5 -4
- package/dist/menu/MenuDivider.js +1 -1
- package/dist/menu/MenuItem.js +1 -1
- package/dist/menu/index.d.ts +2 -1
- package/dist/menu/index.js +29 -5
- package/dist/menu/menu.js +42 -18
- package/dist/message/PurePanel.js +2 -2
- package/dist/message/index.js +11 -9
- package/dist/message/useMessage.js +2 -2
- package/dist/modal/ConfirmDialog.js +2 -2
- package/dist/modal/Modal.js +4 -4
- package/dist/modal/PurePanel.js +1 -1
- package/dist/modal/confirm.js +6 -8
- package/dist/modal/index.d.ts +2 -2
- package/dist/modal/interface.d.ts +1 -1
- package/dist/modal/useModal/index.js +9 -4
- package/dist/notification/PurePanel.js +2 -2
- package/dist/notification/index.js +8 -13
- package/dist/notification/useNotification.js +2 -2
- package/dist/package.js +1 -1
- package/dist/package.json.d.ts +1 -0
- package/dist/pagination/Pagination.js +4 -4
- package/dist/popconfirm/index.js +2 -2
- package/dist/popover/PurePanel.js +2 -2
- package/dist/popover/index.js +1 -1
- package/dist/progress/progress.js +3 -3
- package/dist/qrcode/index.js +3 -3
- package/dist/radio/group.js +2 -2
- package/dist/radio/radio.js +2 -2
- package/dist/rate/index.js +2 -2
- package/dist/result/index.js +1 -1
- package/dist/segmented/index.js +1 -1
- package/dist/segmented/style/index.js +3 -2
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +5 -5
- package/dist/skeleton/Avatar.js +1 -1
- package/dist/skeleton/Button.js +1 -1
- package/dist/skeleton/Element.js +1 -1
- package/dist/skeleton/Input.js +1 -1
- package/dist/skeleton/Node.js +1 -1
- package/dist/skeleton/Skeleton.js +1 -1
- package/dist/skeleton/style/index.js +9 -13
- package/dist/slider/SliderTooltip.js +0 -1
- package/dist/slider/index.d.ts +2 -0
- package/dist/slider/index.js +5 -1
- package/dist/space/Addon.js +1 -1
- package/dist/space/index.js +1 -1
- package/dist/spin/index.js +2 -2
- package/dist/splitter/Splitter.js +2 -2
- package/dist/statistic/Statistic.js +1 -1
- package/dist/statistic/Timer.d.ts +2 -2
- package/dist/statistic/Timer.js +1 -1
- package/dist/steps/index.js +5 -4
- package/dist/switch/index.js +2 -2
- package/dist/table/InternalTable.js +10 -4
- package/dist/table/hooks/useFilter/FilterDropdown.js +2 -2
- package/dist/table/hooks/usePagination.d.ts +1 -2
- package/dist/table/hooks/usePagination.js +1 -3
- package/dist/table/hooks/useSelection.js +1 -1
- package/dist/table/hooks/useSorter.js +26 -19
- package/dist/table/style/index.js +1 -0
- package/dist/table/style/size.js +1 -0
- package/dist/table/util.d.ts +1 -1
- package/dist/tabs/index.js +3 -3
- package/dist/tabs/style/index.js +5 -1
- package/dist/tag/CheckableTag.js +1 -1
- package/dist/tag/CheckableTagGroup.d.ts +0 -1
- package/dist/tag/CheckableTagGroup.js +0 -4
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/tag/index.js +1 -1
- package/dist/theme/themes/dark/index.js +1 -1
- package/dist/theme/useToken.js +2 -2
- package/dist/timeline/Timeline.js +1 -1
- package/dist/timeline/useItems.js +1 -1
- package/dist/tooltip/PurePanel.js +1 -1
- package/dist/tooltip/index.js +2 -2
- package/dist/tour/index.js +5 -2
- package/dist/transfer/Section.js +1 -1
- package/dist/transfer/Transfer.js +3 -3
- package/dist/transfer/hooks/useSelection.js +2 -1
- package/dist/tree/DirectoryTree.js +6 -5
- package/dist/tree/Tree.js +4 -4
- package/dist/tree/utils/dictUtil.js +5 -8
- package/dist/tree-select/index.js +4 -4
- package/dist/typography/Base/index.js +5 -3
- package/dist/typography/Base/util.js +2 -1
- package/dist/typography/Editable.js +6 -2
- package/dist/typography/Typography.js +1 -1
- package/dist/upload/Upload.js +25 -16
- package/dist/upload/UploadList/ListItem.js +5 -1
- package/dist/upload/UploadList/index.js +19 -12
- package/dist/version/token.json +1 -1
- package/dist/watermark/index.d.ts +13 -4
- package/dist/watermark/index.js +11 -7
- package/dist/watermark/useRafDebounce.js +1 -2
- package/dist/watermark/utils.js +1 -1
- package/package.json +42 -41
- package/web-tags.json +22 -14
- package/web-types.json +46 -23
package/dist/_util/PurePanel.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useBaseConfig } from "../config-provider/context.js";
|
|
2
1
|
import { normalizeStyle as normalizeStyle$1 } from "./styleUtils.js";
|
|
2
|
+
import { useBaseConfig } from "../config-provider/context.js";
|
|
3
3
|
import ConfigProvider from "../config-provider/index.js";
|
|
4
4
|
import { createVNode, defineComponent, mergeProps, shallowRef, useAttrs, useSlots, watch } from "vue";
|
|
5
5
|
//#region src/_util/PurePanel.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useOrientation } from "./useOrientation.js";
|
|
2
1
|
import { normalizeMaskConfig, useMergedMask } from "./useMergedMask.js";
|
|
3
2
|
import { getAttrStyleAndClass, mergeClassNames, mergeStyles, pureAttrs, resolveStyleOrClass, useMergeSemantic, useMergeSemanticNoRef, useSemanticRootStyle, useToArr, useToProps } from "./useMergeSemantic.js";
|
|
4
3
|
import { useMultipleSelect } from "./useMultipleSelect.js";
|
|
4
|
+
import { useOrientation } from "./useOrientation.js";
|
|
5
5
|
import { CONTAINER_MAX_OFFSET, consumerBaseZIndexOffset, containerBaseZIndexOffset, useZIndex } from "./useZIndex.js";
|
|
6
6
|
export { CONTAINER_MAX_OFFSET, consumerBaseZIndexOffset, containerBaseZIndexOffset, getAttrStyleAndClass, mergeClassNames, mergeStyles, normalizeMaskConfig, pureAttrs, resolveStyleOrClass, useMergeSemantic, useMergeSemanticNoRef, useMergedMask, useMultipleSelect, useOrientation, useSemanticRootStyle, useToArr, useToProps, useZIndex };
|
|
@@ -34,11 +34,11 @@ interface UseClosableParams {
|
|
|
34
34
|
customCloseIconRender?: (closeIcon: VNodeChild) => VNodeChild;
|
|
35
35
|
context?: ContextClosable;
|
|
36
36
|
}
|
|
37
|
-
declare function useClosable(propCloseCollection?: Ref<ClosableCollection>, contextCloseCollection?: Ref<ClosableCollection | null>, fallbackCloseCollection?: Ref<FallbackCloseCollection>): import("vue").ComputedRef<({} | null)[] | readonly [true, import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
37
|
+
declare function useClosable(propCloseCollection?: Ref<ClosableCollection>, contextCloseCollection?: Ref<ClosableCollection | null>, fallbackCloseCollection?: Ref<FallbackCloseCollection>): import("vue").ComputedRef<({} | null)[] | readonly [true, void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
38
38
|
[key: string]: any;
|
|
39
|
-
}
|
|
39
|
+
}> | null | undefined, boolean, {
|
|
40
40
|
readonly 'aria-label': any;
|
|
41
|
-
}]
|
|
41
|
+
}]>;
|
|
42
42
|
declare function computeClosable(propCloseCollection?: Ref<ClosableCollection>, contextCloseCollection?: Ref<ClosableCollection | null>, fallbackCloseCollection?: Ref<FallbackCloseCollection>, closeLabel?: string): [closable: boolean, closeIcon: VueNode, closeBtnIsDisabled: boolean, ariaOrDataProps: AriaAttributes & DataAttributes];
|
|
43
43
|
//#endregion
|
|
44
44
|
export { BaseContextClosable, ClosableType, ContextClosable, UseClosableParams, computeClosable, useClosable as default, pickClosable };
|
|
@@ -78,16 +78,16 @@ function useClosable(propCloseCollection, contextCloseCollection, fallbackCloseC
|
|
|
78
78
|
"aria-label": mergedCloseIcon.props?.["aria-label"] ?? contextLocale?.value?.close,
|
|
79
79
|
...ariaOrDataProps
|
|
80
80
|
}) : createVNode("span", mergeProps({ "aria-label": contextLocale?.value?.close }, ariaOrDataProps), [mergedCloseIcon]);
|
|
81
|
-
return [
|
|
82
|
-
true,
|
|
83
|
-
mergedCloseIcon,
|
|
84
|
-
closeBtnIsDisabled.value,
|
|
85
|
-
{
|
|
86
|
-
"aria-label": contextLocale?.value?.close ?? localeValues.global?.close,
|
|
87
|
-
...ariaOrDataProps
|
|
88
|
-
}
|
|
89
|
-
];
|
|
90
81
|
}
|
|
82
|
+
return [
|
|
83
|
+
true,
|
|
84
|
+
mergedCloseIcon,
|
|
85
|
+
closeBtnIsDisabled.value,
|
|
86
|
+
{
|
|
87
|
+
"aria-label": contextLocale?.value?.close ?? localeValues.global?.close,
|
|
88
|
+
...ariaOrDataProps
|
|
89
|
+
}
|
|
90
|
+
];
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
function computeClosableConfig(closable, closeIcon) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { devUseWarning, isDev } from "../warning.js";
|
|
2
1
|
import useToken from "../../theme/useToken.js";
|
|
2
|
+
import { devUseWarning, isDev } from "../warning.js";
|
|
3
3
|
import { useZIndexContext } from "../zindexContext.js";
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
//#region src/_util/hooks/useZIndex.ts
|
|
@@ -34,24 +34,23 @@ function useZIndex(componentType, customZIndex) {
|
|
|
34
34
|
const [, token] = useToken();
|
|
35
35
|
const parentZIndex = useZIndexContext();
|
|
36
36
|
const isContainer = isContainerType(componentType);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
37
|
+
const contextZIndex = computed(() => {
|
|
38
|
+
if (customZIndex?.value !== void 0) return customZIndex.value;
|
|
39
|
+
let zIndex = parentZIndex.value ?? 0;
|
|
40
|
+
if (isContainer) zIndex += (parentZIndex.value ? 0 : token.value.zIndexPopupBase) + containerBaseZIndexOffset[componentType];
|
|
41
|
+
else zIndex += consumerBaseZIndexOffset[componentType];
|
|
42
|
+
return zIndex;
|
|
43
|
+
});
|
|
44
|
+
const zIndex = computed(() => {
|
|
45
|
+
if (customZIndex?.value !== void 0) return customZIndex.value;
|
|
46
|
+
return parentZIndex.value === void 0 ? void 0 : contextZIndex.value;
|
|
47
|
+
});
|
|
48
48
|
if (isDev) {
|
|
49
49
|
const warning = devUseWarning(componentType);
|
|
50
50
|
const maxZIndex = token.value.zIndexPopupBase + CONTAINER_MAX_OFFSET_WITH_CHILDREN;
|
|
51
|
-
|
|
52
|
-
warning(customZIndex?.value !== void 0 || currentZIndex.value <= maxZIndex, "usage", "`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.");
|
|
51
|
+
warning(customZIndex?.value !== void 0 || (zIndex.value ?? 0) <= maxZIndex, "usage", "`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.");
|
|
53
52
|
}
|
|
54
|
-
return
|
|
53
|
+
return [zIndex, contextZIndex];
|
|
55
54
|
}
|
|
56
55
|
//#endregion
|
|
57
56
|
export { CONTAINER_MAX_OFFSET, consumerBaseZIndexOffset, containerBaseZIndexOffset, useZIndex };
|
package/dist/_util/vueNode.d.ts
CHANGED
|
@@ -3,8 +3,12 @@ import { VNodeChild } from "vue";
|
|
|
3
3
|
import { isFragment } from "@v-c/util/dist/Children/isFragment";
|
|
4
4
|
//#region src/_util/vueNode.d.ts
|
|
5
5
|
type RenderProps = AnyObject | ((originProps: AnyObject) => AnyObject | undefined);
|
|
6
|
-
declare function replaceElement(element: VNodeChild, replacement: VNodeChild, props?: RenderProps):
|
|
7
|
-
|
|
6
|
+
declare function replaceElement(element: VNodeChild, replacement: VNodeChild, props?: RenderProps): string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}> | import("vue").VNodeArrayChildren | null;
|
|
9
|
+
declare function cloneElement(element: VNodeChild, props?: RenderProps): string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}> | import("vue").VNodeArrayChildren | null;
|
|
8
12
|
/**
|
|
9
13
|
* 当传入值是 VNode 时返回一个全新的克隆,数组会逐项处理,其余值原样返回。
|
|
10
14
|
*
|
package/dist/affix/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { getAttrStyleAndClass } from "../_util/hooks/useMergeSemantic.js";
|
|
2
|
+
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
1
3
|
import throttleByAnimationFrame from "../_util/throttleByAnimationFrame.js";
|
|
2
|
-
import { useConfig } from "../config-provider/context.js";
|
|
3
4
|
import style_default from "./style/index.js";
|
|
4
5
|
import { getFixedBottom, getFixedTop, getTargetRect } from "./utils.js";
|
|
5
6
|
import { computed, createVNode, defineComponent, isVNode, mergeDefaults, mergeProps, nextTick, onBeforeUnmount, onMounted, shallowRef, watch } from "vue";
|
|
@@ -19,15 +20,12 @@ const TRIGGER_EVENTS = [
|
|
|
19
20
|
function getDefaultTarget() {
|
|
20
21
|
return typeof window !== "undefined" ? window : null;
|
|
21
22
|
}
|
|
22
|
-
const AFFIX_STATUS_NONE = 0;
|
|
23
|
-
const AFFIX_STATUS_PREPARE = 1;
|
|
24
23
|
const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, emit }) => {
|
|
25
24
|
const configContext = useConfig();
|
|
26
|
-
const affixPrefixCls
|
|
25
|
+
const { prefixCls: affixPrefixCls, class: contextClassName, style: contextStyle } = useComponentBaseConfig("affix", props);
|
|
27
26
|
const lastAffix = shallowRef(false);
|
|
28
27
|
const affixStyle = shallowRef();
|
|
29
28
|
const placeholderStyle = shallowRef();
|
|
30
|
-
const status = shallowRef(AFFIX_STATUS_NONE);
|
|
31
29
|
let prevTarget = null;
|
|
32
30
|
let prevListener = null;
|
|
33
31
|
const placeholderNodeRef = shallowRef();
|
|
@@ -35,15 +33,16 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
35
33
|
const contextRef = shallowRef();
|
|
36
34
|
const timer = shallowRef(null);
|
|
37
35
|
const targetFunc = computed(() => props.target ?? configContext.value.getTargetContainer ?? getDefaultTarget);
|
|
36
|
+
const resolvedTarget = computed(() => targetFunc.value());
|
|
38
37
|
const internalOffsetTop = computed(() => {
|
|
39
38
|
const { offsetTop, offsetBottom } = props;
|
|
40
39
|
return offsetBottom === void 0 && offsetTop === void 0 ? 0 : offsetTop;
|
|
41
40
|
});
|
|
42
41
|
const measure = () => {
|
|
43
|
-
if (
|
|
42
|
+
if (!fixedNodeRef.value || !placeholderNodeRef.value) return;
|
|
44
43
|
const targetNode = targetFunc.value();
|
|
45
44
|
if (targetNode) {
|
|
46
|
-
const newState = {
|
|
45
|
+
const newState = {};
|
|
47
46
|
const placeholderRect = getTargetRect(placeholderNodeRef.value);
|
|
48
47
|
const contentHeight = getTargetRect(contextRef.value || fixedNodeRef.value).height || placeholderRect.height;
|
|
49
48
|
if (placeholderRect.top === 0 && placeholderRect.left === 0 && placeholderRect.width === 0 && placeholderRect.height === 0) return;
|
|
@@ -64,14 +63,12 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
64
63
|
}
|
|
65
64
|
newState.lastAffix = !!newState.affixStyle;
|
|
66
65
|
if (lastAffix.value !== newState.lastAffix) emit("change", newState.lastAffix);
|
|
67
|
-
status.value = newState.status;
|
|
68
66
|
affixStyle.value = newState.affixStyle;
|
|
69
67
|
placeholderStyle.value = newState.placeholderStyle;
|
|
70
68
|
lastAffix.value = newState.lastAffix;
|
|
71
69
|
}
|
|
72
70
|
};
|
|
73
71
|
const prepareMeasure = () => {
|
|
74
|
-
status.value = AFFIX_STATUS_PREPARE;
|
|
75
72
|
measure();
|
|
76
73
|
};
|
|
77
74
|
const updatePosition = throttleByAnimationFrame(() => {
|
|
@@ -92,10 +89,18 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
92
89
|
});
|
|
93
90
|
const addListeners = () => {
|
|
94
91
|
const listenerTarget = targetFunc.value();
|
|
92
|
+
const previousTarget = prevTarget;
|
|
93
|
+
const previousListener = prevListener;
|
|
94
|
+
if (previousListener) {
|
|
95
|
+
TRIGGER_EVENTS.forEach((eventName) => {
|
|
96
|
+
previousTarget?.removeEventListener(eventName, previousListener);
|
|
97
|
+
});
|
|
98
|
+
prevTarget = null;
|
|
99
|
+
prevListener = null;
|
|
100
|
+
}
|
|
95
101
|
if (!listenerTarget) return;
|
|
96
102
|
TRIGGER_EVENTS.forEach((eventName) => {
|
|
97
|
-
|
|
98
|
-
listenerTarget?.addEventListener(eventName, lazyUpdatePosition);
|
|
103
|
+
listenerTarget.addEventListener(eventName, lazyUpdatePosition);
|
|
99
104
|
});
|
|
100
105
|
prevTarget = listenerTarget;
|
|
101
106
|
prevListener = lazyUpdatePosition;
|
|
@@ -123,6 +128,7 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
123
128
|
});
|
|
124
129
|
watch([
|
|
125
130
|
() => props.target,
|
|
131
|
+
resolvedTarget,
|
|
126
132
|
affixStyle,
|
|
127
133
|
lastAffix,
|
|
128
134
|
() => props.offsetTop,
|
|
@@ -136,6 +142,7 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
136
142
|
});
|
|
137
143
|
watch([
|
|
138
144
|
() => props.target,
|
|
145
|
+
resolvedTarget,
|
|
139
146
|
() => props.offsetTop,
|
|
140
147
|
() => props.offsetBottom
|
|
141
148
|
], async () => {
|
|
@@ -158,7 +165,15 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
158
165
|
const _el = unrefElement(el);
|
|
159
166
|
if (_el) contextRef.value = _el;
|
|
160
167
|
} });
|
|
161
|
-
|
|
168
|
+
const { className, style, restAttrs } = getAttrStyleAndClass(attrs);
|
|
169
|
+
return createVNode("div", mergeProps(restAttrs, {
|
|
170
|
+
"ref": placeholderNodeRef,
|
|
171
|
+
"class": classNames(className, contextClassName.value),
|
|
172
|
+
"style": {
|
|
173
|
+
...contextStyle.value,
|
|
174
|
+
...style
|
|
175
|
+
}
|
|
176
|
+
}), [affixStyle.value && createVNode("div", {
|
|
162
177
|
"style": placeholderStyle.value,
|
|
163
178
|
"aria-hidden": "true"
|
|
164
179
|
}, null), createVNode("div", {
|
package/dist/alert/Alert.d.ts
CHANGED
|
@@ -37,8 +37,8 @@ interface AlertProps extends ComponentBaseProps, AlertEmitsProps {
|
|
|
37
37
|
type?: 'success' | 'info' | 'warning' | 'error';
|
|
38
38
|
/**
|
|
39
39
|
* Visual variant. `filled` keeps the existing solid background, `outlined`
|
|
40
|
-
* renders with the colored border style
|
|
41
|
-
* @default '
|
|
40
|
+
* renders with the colored border style.
|
|
41
|
+
* @default 'outlined'
|
|
42
42
|
*/
|
|
43
43
|
variant?: AlertVariant;
|
|
44
44
|
/** Whether Alert can be closed */
|
package/dist/alert/Alert.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
1
|
import { getAttrStyleAndClass, pureAttrs, useMergeSemanticNoRef } from "../_util/hooks/useMergeSemantic.js";
|
|
2
|
+
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
3
|
import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
4
|
-
import { isRenderable } from "../_util/is.js";
|
|
4
|
+
import { isPlainObject, isRenderable } from "../_util/is.js";
|
|
5
5
|
import useVariant from "../form/hooks/useVariant.js";
|
|
6
6
|
import style_default from "./style/index.js";
|
|
7
7
|
import { Transition, computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef, toRef } from "vue";
|
|
@@ -191,7 +191,7 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expo
|
|
|
191
191
|
const { className, style } = getAttrStyleAndClass(attrs);
|
|
192
192
|
const isClosableFn = () => {
|
|
193
193
|
const closeIcon = getSlotPropsFnRun(slots, props, "closeIcon");
|
|
194
|
-
if (
|
|
194
|
+
if (isPlainObject(closable)) return true;
|
|
195
195
|
if (typeof closable === "boolean") return closable;
|
|
196
196
|
const closeIconNode = typeof closeIcon === "function" ? filterEmpty(closeIcon()) : closeIcon;
|
|
197
197
|
if (Array.isArray(closeIconNode) && closeIconNode.length > 0) return true;
|
|
@@ -2,15 +2,14 @@ import { genFocusStyle, resetComponent } from "../../style/index.js";
|
|
|
2
2
|
import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
3
3
|
import { unit } from "@antdv-next/cssinjs";
|
|
4
4
|
//#region src/alert/style/index.ts
|
|
5
|
-
function genAlertTypeStyle(bgColor,
|
|
5
|
+
function genAlertTypeStyle(bgColor, iconColor, alertCls) {
|
|
6
6
|
return {
|
|
7
7
|
background: bgColor,
|
|
8
|
-
border: `${unit(token.lineWidth)} ${token.lineType} ${borderColor}`,
|
|
9
8
|
[`${alertCls}-icon`]: { color: iconColor }
|
|
10
9
|
};
|
|
11
10
|
}
|
|
12
11
|
const genBaseStyle = (token) => {
|
|
13
|
-
const { componentCls, motionDurationSlow: duration, marginXS, marginSM, fontSize, fontSizeLG, lineHeight, motionEaseInOutCirc, containerBorderRadius, withDescriptionIconSize, colorText, colorTextHeading, withDescriptionPadding, defaultPadding } = token;
|
|
12
|
+
const { componentCls, motionDurationSlow: duration, marginXS, marginSM, fontSize, fontSizeLG, lineHeight, motionEaseInOutCirc, containerBorderRadius, withDescriptionIconSize, colorText, colorTextHeading, withDescriptionPadding, defaultPadding, lineWidth, lineType, colorSuccessBorder, colorWarningBorder, colorErrorBorder, colorInfoBorder } = token;
|
|
14
13
|
return { [componentCls]: {
|
|
15
14
|
...resetComponent(token),
|
|
16
15
|
position: "relative",
|
|
@@ -19,6 +18,13 @@ const genBaseStyle = (token) => {
|
|
|
19
18
|
padding: defaultPadding,
|
|
20
19
|
wordWrap: "break-word",
|
|
21
20
|
borderRadius: containerBorderRadius,
|
|
21
|
+
borderWidth: unit(lineWidth),
|
|
22
|
+
borderStyle: lineType,
|
|
23
|
+
[`&${componentCls}-success`]: { borderColor: colorSuccessBorder },
|
|
24
|
+
[`&${componentCls}-info`]: { borderColor: colorInfoBorder },
|
|
25
|
+
[`&${componentCls}-warning`]: { borderColor: colorWarningBorder },
|
|
26
|
+
[`&${componentCls}-error`]: { borderColor: colorErrorBorder },
|
|
27
|
+
[`&${componentCls}-filled`]: { borderColor: "transparent" },
|
|
22
28
|
[`&${componentCls}-rtl`]: { direction: "rtl" },
|
|
23
29
|
[`${componentCls}-section`]: {
|
|
24
30
|
flex: 1,
|
|
@@ -79,13 +85,13 @@ const genBaseStyle = (token) => {
|
|
|
79
85
|
} };
|
|
80
86
|
};
|
|
81
87
|
const genTypeStyle = (token) => {
|
|
82
|
-
const { componentCls, colorSuccess,
|
|
88
|
+
const { componentCls, colorSuccess, colorSuccessBg, colorWarning, colorWarningBg, colorError, colorErrorBg, colorInfo, colorInfoBg } = token;
|
|
83
89
|
return { [componentCls]: {
|
|
84
|
-
"&-success": genAlertTypeStyle(colorSuccessBg,
|
|
85
|
-
"&-info": genAlertTypeStyle(colorInfoBg,
|
|
86
|
-
"&-warning": genAlertTypeStyle(colorWarningBg,
|
|
90
|
+
"&-success": genAlertTypeStyle(colorSuccessBg, colorSuccess, componentCls),
|
|
91
|
+
"&-info": genAlertTypeStyle(colorInfoBg, colorInfo, componentCls),
|
|
92
|
+
"&-warning": genAlertTypeStyle(colorWarningBg, colorWarning, componentCls),
|
|
87
93
|
"&-error": {
|
|
88
|
-
...genAlertTypeStyle(colorErrorBg,
|
|
94
|
+
...genAlertTypeStyle(colorErrorBg, colorError, componentCls),
|
|
89
95
|
[`${componentCls}-description > pre`]: {
|
|
90
96
|
margin: 0,
|
|
91
97
|
padding: 0
|
package/dist/anchor/Anchor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
1
|
import { useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
2
|
+
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
3
|
import { clsx as clsx$1, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
4
4
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
5
5
|
import { Affix } from "../affix/index.js";
|
|
@@ -134,9 +134,11 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
|
|
|
134
134
|
const container = getCurrentContainer();
|
|
135
135
|
let y = getScroll(container) + getOffsetTop(targetElement, container);
|
|
136
136
|
y -= linkTargetOffset ?? (targetOffset !== void 0 ? targetOffset : offsetTop || 0);
|
|
137
|
+
const prefersReducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)");
|
|
137
138
|
animatingRef.value = true;
|
|
138
139
|
scrollRequestIdRef.value = scrollTo(y, {
|
|
139
140
|
getContainer: getCurrentContainer,
|
|
141
|
+
duration: prefersReducedMotion?.matches ? 0 : void 0,
|
|
140
142
|
callback() {
|
|
141
143
|
animatingRef.value = false;
|
|
142
144
|
scrollRequestIdRef.value = null;
|