antdv-next 1.8.0 → 1.8.2
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/useZIndex.js +14 -15
- package/dist/affix/index.js +25 -5
- 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 +19221 -16952
- package/dist/antd-with-locales.js +114 -111
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +19006 -16739
- package/dist/antd.js +114 -111
- 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.js +2 -2
- package/dist/badge/style/ribbon.d.ts +0 -1
- package/dist/border-beam/BorderBeam.js +1 -1
- package/dist/border-beam/style/index.d.ts +0 -1
- package/dist/breadcrumb/Breadcrumb.js +2 -2
- package/dist/button/Button.js +1 -1
- package/dist/button/buttonHelper.d.ts +1 -1
- package/dist/button/style/index.d.ts +0 -1
- package/dist/calendar/generateCalendar.js +2 -2
- 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/cascader/style/panel.d.ts +0 -1
- package/dist/checkbox/Checkbox.js +2 -2
- package/dist/checkbox/Group.js +1 -1
- package/dist/collapse/Collapse.js +2 -2
- package/dist/color-picker/ColorPicker.js +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/config-provider/context.d.ts +2 -0
- 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/generatePicker/useComponents.js +2 -2
- package/dist/date-picker/hooks/useMergedPickerSemantic.js +1 -1
- package/dist/date-picker/style/index.d.ts +0 -1
- package/dist/date-picker/style/panel.js +14 -13
- package/dist/descriptions/hooks/useItems.d.ts +6 -6
- 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/empty/style/index.d.ts +0 -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.js +2 -2
- package/dist/form/FormItem/ItemHolder.js +3 -3
- package/dist/form/FormItem/index.js +1 -1
- package/dist/form/FormItemLabel.js +1 -1
- package/dist/form/context.d.ts +1 -1
- package/dist/form/hooks/useVariant.js +1 -1
- package/dist/grid/col.js +1 -1
- package/dist/grid/row.js +1 -1
- package/dist/image/PreviewGroup.js +2 -2
- package/dist/image/hooks/usePreviewConfig.d.ts +6 -6
- package/dist/image/index.js +9 -5
- package/dist/index.d.ts +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/style/otp.d.ts +0 -1
- package/dist/input/style/search.d.ts +0 -1
- package/dist/input/style/textarea.d.ts +0 -1
- package/dist/input-number/index.js +3 -3
- package/dist/input-number/style/index.d.ts +0 -1
- package/dist/layout/Sider.js +2 -2
- package/dist/layout/style/sider.d.ts +0 -1
- 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 +3 -3
- package/dist/menu/MenuDivider.js +1 -1
- package/dist/menu/menu.js +3 -3
- package/dist/message/PurePanel.js +2 -2
- package/dist/message/style/index.d.ts +0 -1
- 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 +5 -6
- package/dist/notification/PurePanel.js +2 -2
- package/dist/notification/index.js +6 -7
- package/dist/notification/useNotification.js +2 -2
- package/dist/package.js +1 -1
- 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/select/index.js +4 -4
- package/dist/select/style/index.d.ts +0 -1
- 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/slider/index.js +1 -1
- package/dist/space/Addon.js +1 -1
- package/dist/space/index.js +1 -1
- package/dist/space/style/addon.d.ts +0 -1
- package/dist/space/style/compact.d.ts +0 -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.js +1 -1
- package/dist/steps/index.js +3 -3
- package/dist/switch/index.js +2 -2
- package/dist/table/InternalTable.js +10 -4
- package/dist/table/hooks/useFilter/FilterDropdown.js +1 -1
- package/dist/table/hooks/useSelection.js +1 -1
- package/dist/table/hooks/useSorter.js +22 -11
- package/dist/table/style/expand.js +4 -1
- package/dist/table/util.d.ts +1 -1
- package/dist/tabs/index.js +3 -3
- 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/index.d.ts +0 -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 +1 -1
- package/dist/transfer/Section.js +1 -1
- package/dist/transfer/Transfer.js +3 -3
- package/dist/tree/DirectoryTree.js +2 -2
- package/dist/tree/Tree.js +4 -4
- package/dist/tree-select/index.js +4 -4
- package/dist/typography/Base/index.js +2 -2
- package/dist/typography/Editable.js +6 -2
- package/dist/typography/Typography.js +1 -1
- package/dist/upload/Upload.js +11 -6
- package/dist/upload/UploadList/ListItem.js +1 -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/package.json +10 -10
- package/web-tags.json +14 -6
- package/web-types.json +29 -12
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 };
|
|
@@ -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/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";
|
|
@@ -23,7 +24,7 @@ const AFFIX_STATUS_NONE = 0;
|
|
|
23
24
|
const AFFIX_STATUS_PREPARE = 1;
|
|
24
25
|
const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, emit }) => {
|
|
25
26
|
const configContext = useConfig();
|
|
26
|
-
const affixPrefixCls
|
|
27
|
+
const { prefixCls: affixPrefixCls, class: contextClassName, style: contextStyle } = useComponentBaseConfig("affix", props);
|
|
27
28
|
const lastAffix = shallowRef(false);
|
|
28
29
|
const affixStyle = shallowRef();
|
|
29
30
|
const placeholderStyle = shallowRef();
|
|
@@ -35,6 +36,7 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
35
36
|
const contextRef = shallowRef();
|
|
36
37
|
const timer = shallowRef(null);
|
|
37
38
|
const targetFunc = computed(() => props.target ?? configContext.value.getTargetContainer ?? getDefaultTarget);
|
|
39
|
+
const resolvedTarget = computed(() => targetFunc.value());
|
|
38
40
|
const internalOffsetTop = computed(() => {
|
|
39
41
|
const { offsetTop, offsetBottom } = props;
|
|
40
42
|
return offsetBottom === void 0 && offsetTop === void 0 ? 0 : offsetTop;
|
|
@@ -92,10 +94,18 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
92
94
|
});
|
|
93
95
|
const addListeners = () => {
|
|
94
96
|
const listenerTarget = targetFunc.value();
|
|
97
|
+
const previousTarget = prevTarget;
|
|
98
|
+
const previousListener = prevListener;
|
|
99
|
+
if (previousListener) {
|
|
100
|
+
TRIGGER_EVENTS.forEach((eventName) => {
|
|
101
|
+
previousTarget?.removeEventListener(eventName, previousListener);
|
|
102
|
+
});
|
|
103
|
+
prevTarget = null;
|
|
104
|
+
prevListener = null;
|
|
105
|
+
}
|
|
95
106
|
if (!listenerTarget) return;
|
|
96
107
|
TRIGGER_EVENTS.forEach((eventName) => {
|
|
97
|
-
|
|
98
|
-
listenerTarget?.addEventListener(eventName, lazyUpdatePosition);
|
|
108
|
+
listenerTarget.addEventListener(eventName, lazyUpdatePosition);
|
|
99
109
|
});
|
|
100
110
|
prevTarget = listenerTarget;
|
|
101
111
|
prevListener = lazyUpdatePosition;
|
|
@@ -123,6 +133,7 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
123
133
|
});
|
|
124
134
|
watch([
|
|
125
135
|
() => props.target,
|
|
136
|
+
resolvedTarget,
|
|
126
137
|
affixStyle,
|
|
127
138
|
lastAffix,
|
|
128
139
|
() => props.offsetTop,
|
|
@@ -136,6 +147,7 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
136
147
|
});
|
|
137
148
|
watch([
|
|
138
149
|
() => props.target,
|
|
150
|
+
resolvedTarget,
|
|
139
151
|
() => props.offsetTop,
|
|
140
152
|
() => props.offsetBottom
|
|
141
153
|
], async () => {
|
|
@@ -158,7 +170,15 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
158
170
|
const _el = unrefElement(el);
|
|
159
171
|
if (_el) contextRef.value = _el;
|
|
160
172
|
} });
|
|
161
|
-
|
|
173
|
+
const { className, style, restAttrs } = getAttrStyleAndClass(attrs);
|
|
174
|
+
return createVNode("div", mergeProps(restAttrs, {
|
|
175
|
+
"ref": placeholderNodeRef,
|
|
176
|
+
"class": classNames(className, contextClassName.value),
|
|
177
|
+
"style": {
|
|
178
|
+
...contextStyle.value,
|
|
179
|
+
...style
|
|
180
|
+
}
|
|
181
|
+
}), [affixStyle.value && createVNode("div", {
|
|
162
182
|
"style": placeholderStyle.value,
|
|
163
183
|
"aria-hidden": "true"
|
|
164
184
|
}, 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;
|