antdv-next 1.7.0 → 1.8.0
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/hooks/useMergeSemantic.js +2 -2
- package/dist/_util/statusUtils.d.ts +1 -1
- package/dist/_util/vueNode.d.ts +11 -1
- package/dist/_util/vueNode.js +17 -1
- package/dist/affix/index.js +12 -9
- package/dist/alert/Alert.js +10 -5
- package/dist/anchor/Anchor.js +11 -6
- package/dist/anchor/style/index.js +2 -3
- package/dist/antd-with-locales.esm.js +16938 -18716
- package/dist/antd-with-locales.js +79 -86
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +15197 -17143
- package/dist/antd.js +80 -87
- package/dist/auto-complete/index.d.ts +2 -0
- package/dist/auto-complete/index.js +28 -23
- package/dist/avatar/Avatar.js +1 -1
- package/dist/avatar/AvatarContext.d.ts +2 -2
- package/dist/avatar/AvatarGroup.js +3 -5
- package/dist/badge/style/ribbon.d.ts +1 -0
- package/dist/border-beam/style/index.d.ts +1 -0
- package/dist/breadcrumb/index.d.ts +8 -1
- package/dist/button/Button.js +31 -18
- package/dist/button/style/index.d.ts +1 -0
- package/dist/calendar/Header.js +4 -4
- package/dist/calendar/generateCalendar.d.ts +10 -10
- package/dist/calendar/index.d.ts +1 -1
- package/dist/card/Card.js +1 -1
- package/dist/card/index.d.ts +8 -1
- package/dist/card/style/index.js +3 -7
- package/dist/carousel/index.js +3 -3
- package/dist/cascader/hooks/useIcons.js +3 -2
- package/dist/cascader/index.d.ts +9 -1
- package/dist/cascader/index.js +42 -34
- package/dist/cascader/style/panel.d.ts +1 -0
- package/dist/checkbox/Checkbox.js +5 -2
- package/dist/checkbox/Group.js +6 -6
- package/dist/collapse/Collapse.js +2 -2
- package/dist/color-picker/ColorPicker.js +15 -2
- package/dist/color-picker/components/ColorSlider.js +2 -2
- package/dist/color-picker/interface.d.ts +3 -0
- package/dist/color-picker/style/input.js +6 -11
- package/dist/components.d.ts +24 -24
- package/dist/components.js +1 -2
- package/dist/config-provider/context.d.ts +16 -11
- package/dist/config-provider/define.d.ts +2 -1
- package/dist/config-provider/index.js +9 -0
- package/dist/date-picker/generatePicker/generateRangePicker.d.ts +2 -0
- package/dist/date-picker/generatePicker/generateRangePicker.js +23 -15
- package/dist/date-picker/generatePicker/generateSinglePicker.d.ts +2 -0
- package/dist/date-picker/generatePicker/generateSinglePicker.js +18 -14
- package/dist/date-picker/generatePicker/interface.d.ts +17 -5
- package/dist/date-picker/generatePicker/useComponents.d.ts +1 -14
- package/dist/date-picker/generatePicker/useSuffix.d.ts +12 -0
- package/dist/date-picker/generatePicker/useSuffix.js +11 -0
- package/dist/date-picker/style/index.d.ts +1 -0
- package/dist/date-picker/util.d.ts +1 -1
- package/dist/date-picker/util.js +4 -3
- package/dist/descriptions/hooks/useItems.d.ts +6 -6
- package/dist/descriptions/index.js +2 -2
- package/dist/divider/index.js +14 -4
- package/dist/drawer/index.js +2 -2
- package/dist/dropdown/dropdown.js +6 -6
- package/dist/dropdown/style/index.js +0 -6
- package/dist/empty/index.js +2 -1
- package/dist/empty/style/index.d.ts +1 -0
- package/dist/flex/index.js +2 -2
- package/dist/float-button/BackTop.js +2 -1
- package/dist/float-button/FloatButton.js +2 -2
- package/dist/float-button/FloatButtonGroup.js +2 -2
- package/dist/float-button/PurePanel.js +5 -5
- package/dist/form/Form.js +47 -16
- package/dist/form/FormItem/ItemHolder.d.ts +3 -18
- package/dist/form/FormItem/StatusProvider.js +2 -1
- package/dist/form/FormItem/index.d.ts +1 -0
- package/dist/form/FormItem/index.js +22 -9
- package/dist/form/FormItemInput.js +3 -4
- package/dist/form/FormItemLabel.js +8 -4
- package/dist/form/context.d.ts +3 -3
- package/dist/form/hooks/useVariant.d.ts +14 -4
- package/dist/form/hooks/useVariant.js +24 -13
- package/dist/form/interface.d.ts +4 -1
- package/dist/form/style/index.js +1 -1
- package/dist/grid/hooks/useBreakpoint.js +12 -6
- package/dist/image/PreviewGroup.d.ts +9 -2
- package/dist/image/PreviewGroup.js +2 -2
- package/dist/image/hooks/usePreviewConfig.d.ts +2 -2
- package/dist/image/index.d.ts +3 -3
- package/dist/image/index.js +3 -3
- package/dist/index.d.ts +26 -24
- package/dist/index.js +1 -2
- package/dist/input/Input.js +4 -4
- package/dist/input/OTP/OTPInput.js +31 -30
- package/dist/input/OTP/index.js +10 -2
- package/dist/input/Password.js +7 -3
- package/dist/input/Search.js +5 -5
- package/dist/input/TextArea.js +4 -4
- package/dist/input/style/index.js +2 -15
- package/dist/input/style/otp.d.ts +1 -0
- package/dist/input/style/search.d.ts +1 -0
- package/dist/input/style/textarea.d.ts +1 -0
- package/dist/input-number/index.js +3 -3
- package/dist/input-number/style/index.d.ts +1 -0
- package/dist/layout/Sider.js +2 -2
- package/dist/layout/style/sider.d.ts +1 -0
- package/dist/listy/interface.d.ts +23 -4
- package/dist/listy/style/index.js +1 -0
- package/dist/locale/ar_EG.js +3 -1
- package/dist/locale/az_AZ.js +3 -1
- package/dist/locale/bg_BG.js +3 -1
- package/dist/locale/bn_BD.js +3 -1
- package/dist/locale/by_BY.js +3 -1
- package/dist/locale/ca_ES.js +3 -1
- package/dist/locale/cs_CZ.js +13 -9
- package/dist/locale/da_DK.js +3 -1
- package/dist/locale/de_DE.js +6 -2
- package/dist/locale/el_GR.js +3 -1
- package/dist/locale/en_GB.js +3 -1
- package/dist/locale/en_US.js +5 -2
- package/dist/locale/es_ES.js +3 -1
- package/dist/locale/et_EE.js +3 -1
- package/dist/locale/eu_ES.js +3 -1
- package/dist/locale/fa_IR.js +3 -1
- package/dist/locale/fi_FI.js +3 -1
- package/dist/locale/fr_BE.js +3 -1
- package/dist/locale/fr_CA.js +3 -1
- package/dist/locale/fr_FR.js +6 -2
- package/dist/locale/ga_IE.js +3 -1
- package/dist/locale/gl_ES.js +3 -1
- package/dist/locale/he_IL.js +3 -1
- package/dist/locale/hi_IN.js +3 -1
- package/dist/locale/hr_HR.js +3 -1
- package/dist/locale/hu_HU.js +3 -1
- package/dist/locale/hy_AM.js +5 -13
- package/dist/locale/id_ID.js +3 -1
- package/dist/locale/index.d.ts +6 -0
- package/dist/locale/is_IS.js +3 -1
- package/dist/locale/it_IT.js +6 -2
- package/dist/locale/ja_JP.js +3 -1
- package/dist/locale/ka_GE.js +3 -1
- package/dist/locale/kk_KZ.js +3 -1
- package/dist/locale/km_KH.js +3 -1
- package/dist/locale/kmr_IQ.js +3 -1
- package/dist/locale/kn_IN.js +3 -1
- package/dist/locale/ko_KR.js +3 -1
- package/dist/locale/ku_IQ.js +3 -1
- package/dist/locale/lt_LT.js +3 -1
- package/dist/locale/lv_LV.js +3 -1
- package/dist/locale/mk_MK.js +3 -1
- package/dist/locale/ml_IN.js +3 -1
- package/dist/locale/mn_MN.js +3 -1
- package/dist/locale/mr_IN.js +3 -1
- package/dist/locale/ms_MY.js +3 -1
- package/dist/locale/my_MM.js +3 -1
- package/dist/locale/nb_NO.js +3 -1
- package/dist/locale/ne_NP.js +4 -2
- package/dist/locale/nl_BE.js +3 -1
- package/dist/locale/nl_NL.js +3 -1
- package/dist/locale/pl_PL.js +3 -1
- package/dist/locale/pt_BR.js +3 -1
- package/dist/locale/pt_PT.js +3 -1
- package/dist/locale/ro_RO.js +3 -1
- package/dist/locale/ru_RU.js +3 -1
- package/dist/locale/si_LK.js +3 -1
- package/dist/locale/sk_SK.js +3 -1
- package/dist/locale/sl_SI.js +3 -1
- package/dist/locale/sq_AL.js +5 -13
- package/dist/locale/sr_RS.js +3 -1
- package/dist/locale/sv_SE.js +3 -1
- package/dist/locale/ta_IN.js +3 -1
- package/dist/locale/th_TH.js +3 -1
- package/dist/locale/tk_TK.js +3 -1
- package/dist/locale/tr_TR.js +3 -1
- package/dist/locale/uk_UA.js +3 -1
- package/dist/locale/ur_PK.js +3 -1
- package/dist/locale/uz_UZ.js +3 -1
- package/dist/locale/vi_VN.js +3 -1
- package/dist/locale/zh_CN.js +5 -2
- package/dist/locale/zh_HK.js +3 -1
- package/dist/locale/zh_TW.js +3 -1
- package/dist/mentions/index.js +4 -4
- package/dist/menu/MenuItem.js +7 -7
- package/dist/menu/SubMenu.js +5 -4
- package/dist/menu/menu.js +2 -2
- package/dist/message/PurePanel.js +2 -2
- package/dist/message/style/index.d.ts +1 -0
- package/dist/message/style/index.js +2 -1
- package/dist/modal/Modal.js +5 -5
- package/dist/modal/PurePanel.js +2 -2
- package/dist/modal/style/confirm.js +1 -1
- package/dist/notification/PurePanel.js +2 -2
- package/dist/notification/style/index.d.ts +3 -0
- package/dist/notification/style/index.js +4 -5
- package/dist/notification/style/placement.js +3 -6
- package/dist/package.js +1 -1
- package/dist/pagination/Pagination.js +6 -5
- package/dist/pagination/index.d.ts +2 -1
- package/dist/pagination/interface.d.ts +2 -2
- package/dist/pagination/style/index.js +15 -7
- package/dist/popconfirm/index.js +4 -3
- package/dist/popover/PurePanel.js +2 -2
- package/dist/popover/style/index.js +1 -0
- package/dist/progress/Circle.js +3 -3
- package/dist/progress/Line.js +2 -1
- package/dist/progress/progress.js +1 -1
- package/dist/qrcode/QrcodeStatus.js +2 -1
- package/dist/qrcode/index.js +2 -2
- package/dist/qrcode/style/index.js +0 -4
- package/dist/radio/radio.js +2 -2
- package/dist/rate/index.js +2 -2
- package/dist/select/index.d.ts +11 -3
- package/dist/select/index.js +55 -38
- package/dist/select/style/index.d.ts +1 -0
- package/dist/select/useIcons.d.ts +23 -8
- package/dist/select/useIcons.js +34 -13
- package/dist/select/useShowArrow.d.ts +2 -3
- package/dist/select/useShowArrow.js +3 -5
- package/dist/skeleton/Paragraph.js +2 -2
- package/dist/skeleton/Skeleton.js +2 -2
- package/dist/skeleton/Title.js +2 -2
- package/dist/slider/index.d.ts +6 -1
- package/dist/slider/index.js +7 -5
- package/dist/space/Item.d.ts +1 -0
- package/dist/space/Item.js +6 -2
- package/dist/space/index.d.ts +1 -1
- package/dist/space/index.js +1 -0
- package/dist/space/style/addon.d.ts +1 -0
- package/dist/space/style/compact.d.ts +1 -0
- package/dist/space/style/index.js +8 -2
- package/dist/spin/Indicator/index.js +5 -1
- package/dist/splitter/SplitBar.js +2 -1
- package/dist/splitter/Splitter.js +10 -4
- package/dist/splitter/interface.d.ts +1 -0
- package/dist/statistic/Number.js +7 -1
- package/dist/statistic/Statistic.d.ts +3 -0
- package/dist/statistic/Statistic.js +2 -1
- package/dist/steps/index.js +16 -8
- package/dist/switch/index.js +10 -4
- package/dist/table/InternalTable.js +22 -7
- package/dist/table/hooks/useFilter/index.js +5 -2
- package/dist/table/hooks/usePagination.d.ts +2 -1
- package/dist/table/hooks/usePagination.js +6 -3
- package/dist/table/index.d.ts +2 -2
- package/dist/table/util.d.ts +1 -1
- package/dist/tabs/index.js +19 -11
- package/dist/tabs/style/index.js +2 -6
- package/dist/tag/index.d.ts +1 -1
- package/dist/tag/index.js +13 -5
- package/dist/theme/getDesignToken.js +2 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/time-picker/index.d.ts +16 -9
- package/dist/time-picker/index.js +31 -84
- package/dist/timeline/Timeline.js +16 -10
- package/dist/tooltip/PurePanel.js +2 -2
- package/dist/tooltip/index.js +3 -6
- package/dist/tooltip/style/index.js +1 -1
- package/dist/tour/index.js +2 -3
- package/dist/tour/panelRender.js +4 -4
- package/dist/transfer/Section.js +2 -2
- package/dist/tree/DirectoryTree.d.ts +19 -7
- package/dist/tree/DirectoryTree.js +2 -2
- package/dist/tree/Tree.d.ts +73 -58
- package/dist/tree/Tree.js +2 -2
- package/dist/tree/index.d.ts +8 -5
- package/dist/tree/index.js +4 -3
- package/dist/tree/style/index.js +6 -1
- package/dist/tree/utils/iconUtil.js +1 -1
- package/dist/tree-select/index.d.ts +32 -2
- package/dist/tree-select/index.js +75 -75
- package/dist/upload/Upload.js +2 -2
- package/dist/upload/utils.js +8 -3
- package/dist/version/token.json +1 -1
- package/dist/watermark/useWatermark.d.ts +1 -7
- package/dist/watermark/useWatermark.js +1 -7
- package/package.json +20 -20
- package/web-tags.json +85 -29
- package/web-types.json +242 -157
- package/dist/date-picker/generatePicker/SuffixIcon.d.ts +0 -12
- package/dist/date-picker/generatePicker/SuffixIcon.js +0 -51
- package/dist/form/style/fallbackCmp.d.ts +0 -14
- package/dist/form/style/fallbackCmp.js +0 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeStyle as normalizeStyle$1 } from "../styleUtils.js";
|
|
2
2
|
import { computed, unref } from "vue";
|
|
3
3
|
import { classNames } from "@v-c/util";
|
|
4
|
-
import { omit } from "es-toolkit";
|
|
4
|
+
import { omit as omit$1 } from "es-toolkit";
|
|
5
5
|
//#region src/_util/hooks/useMergeSemantic.ts
|
|
6
6
|
function mergeClassNames(schema, ...classNames$1) {
|
|
7
7
|
const mergedSchema = schema || {};
|
|
@@ -117,7 +117,7 @@ function pureAttrs(attrs, options = defaultOptions) {
|
|
|
117
117
|
const newAttrs = { ...attrs };
|
|
118
118
|
if (options.class) delete newAttrs.class;
|
|
119
119
|
if (options.style) delete newAttrs.style;
|
|
120
|
-
if (options.omit) return omit(newAttrs, options.omit);
|
|
120
|
+
if (options.omit) return omit$1(newAttrs, options.omit);
|
|
121
121
|
return newAttrs;
|
|
122
122
|
}
|
|
123
123
|
function getAttrStyleAndClass(attrs, options, props) {
|
|
@@ -3,6 +3,6 @@ import { ValidateStatus } from "../form/FormItem/index.js";
|
|
|
3
3
|
declare const _InputStatuses: readonly ["warning", "error", "", "success", "validating"];
|
|
4
4
|
type InputStatus = (typeof _InputStatuses)[number];
|
|
5
5
|
declare function getStatusClassNames(prefixCls: string, status?: ValidateStatus, hasFeedback?: boolean): string;
|
|
6
|
-
declare function getMergedStatus(contextStatus?: ValidateStatus, customStatus?: InputStatus): "" | "
|
|
6
|
+
declare function getMergedStatus(contextStatus?: ValidateStatus, customStatus?: InputStatus): "" | "success" | "error" | "warning" | "validating" | undefined;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { InputStatus, getMergedStatus, getStatusClassNames };
|
package/dist/_util/vueNode.d.ts
CHANGED
|
@@ -9,10 +9,20 @@ declare function replaceElement(element: VNodeChild, replacement: VNodeChild, pr
|
|
|
9
9
|
declare function cloneElement(element: VNodeChild, props?: RenderProps): string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
}> | import("vue").VNodeArrayChildren | null;
|
|
12
|
+
/**
|
|
13
|
+
* 当传入值是 VNode 时返回一个全新的克隆,数组会逐项处理,其余值原样返回。
|
|
14
|
+
*
|
|
15
|
+
* 用于模块级共享的默认 vnode(图标 / 图片等)。一旦原始 vnode 被真正挂载,
|
|
16
|
+
* Vue 会把 el / component 写回它身上;而模块级常量是常驻的 GC Root,Vue 在
|
|
17
|
+
* unmount 时又不会清空这些字段,于是这条引用会把已卸载页面的整条实例链一直
|
|
18
|
+
* 保留下来,造成内存泄漏。渲染前克隆可让模块原始 vnode 永远保持未挂载
|
|
19
|
+
* (el 恒为 null),从而彻底切断该引用链。
|
|
20
|
+
*/
|
|
21
|
+
declare function cloneIfVNode<T>(node: T): T;
|
|
12
22
|
declare function getVNode(node: VueNode): VNodeChild;
|
|
13
23
|
declare function checkRenderNode(node: any): any;
|
|
14
24
|
declare function getTextByNode(node: any): any;
|
|
15
25
|
declare function getTextNodeArr(nodes: any[]): any[];
|
|
16
26
|
type EmitToProps<T extends Record<string, any>> = { [K in keyof T as `on${Capitalize<K & string>}`]: T[K]; };
|
|
17
27
|
//#endregion
|
|
18
|
-
export { EmitToProps, checkRenderNode, cloneElement, getTextByNode, getTextNodeArr, getVNode, isFragment, replaceElement };
|
|
28
|
+
export { EmitToProps, checkRenderNode, cloneElement, cloneIfVNode, getTextByNode, getTextNodeArr, getVNode, isFragment, replaceElement };
|
package/dist/_util/vueNode.js
CHANGED
|
@@ -9,6 +9,22 @@ function replaceElement(element, replacement, props) {
|
|
|
9
9
|
function cloneElement(element, props) {
|
|
10
10
|
return replaceElement(element, element, props);
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* 当传入值是 VNode 时返回一个全新的克隆,数组会逐项处理,其余值原样返回。
|
|
14
|
+
*
|
|
15
|
+
* 用于模块级共享的默认 vnode(图标 / 图片等)。一旦原始 vnode 被真正挂载,
|
|
16
|
+
* Vue 会把 el / component 写回它身上;而模块级常量是常驻的 GC Root,Vue 在
|
|
17
|
+
* unmount 时又不会清空这些字段,于是这条引用会把已卸载页面的整条实例链一直
|
|
18
|
+
* 保留下来,造成内存泄漏。渲染前克隆可让模块原始 vnode 永远保持未挂载
|
|
19
|
+
* (el 恒为 null),从而彻底切断该引用链。
|
|
20
|
+
*/
|
|
21
|
+
function cloneIfVNode(node) {
|
|
22
|
+
if (Array.isArray(node)) return node.map((item) => cloneIfVNode(item));
|
|
23
|
+
if (!isVNode(node)) return node;
|
|
24
|
+
const cloned = cloneVNode(node);
|
|
25
|
+
if (Array.isArray(cloned.children)) cloned.children = cloned.children.map((item) => cloneIfVNode(item));
|
|
26
|
+
return cloned;
|
|
27
|
+
}
|
|
12
28
|
function getVNode(node) {
|
|
13
29
|
if (typeof node === "function") return node?.();
|
|
14
30
|
return node;
|
|
@@ -33,4 +49,4 @@ function getTextNodeArr(nodes) {
|
|
|
33
49
|
return res;
|
|
34
50
|
}
|
|
35
51
|
//#endregion
|
|
36
|
-
export { checkRenderNode, cloneElement, getTextByNode, getTextNodeArr, getVNode, isFragment, replaceElement };
|
|
52
|
+
export { checkRenderNode, cloneElement, cloneIfVNode, getTextByNode, getTextNodeArr, getVNode, isFragment, replaceElement };
|
package/dist/affix/index.js
CHANGED
|
@@ -28,8 +28,8 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
28
28
|
const affixStyle = shallowRef();
|
|
29
29
|
const placeholderStyle = shallowRef();
|
|
30
30
|
const status = shallowRef(AFFIX_STATUS_NONE);
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
let prevTarget = null;
|
|
32
|
+
let prevListener = null;
|
|
33
33
|
const placeholderNodeRef = shallowRef();
|
|
34
34
|
const fixedNodeRef = shallowRef();
|
|
35
35
|
const contextRef = shallowRef();
|
|
@@ -94,17 +94,16 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
94
94
|
const listenerTarget = targetFunc.value();
|
|
95
95
|
if (!listenerTarget) return;
|
|
96
96
|
TRIGGER_EVENTS.forEach((eventName) => {
|
|
97
|
-
if (prevListener
|
|
97
|
+
if (prevListener) prevTarget?.removeEventListener(eventName, prevListener);
|
|
98
98
|
listenerTarget?.addEventListener(eventName, lazyUpdatePosition);
|
|
99
99
|
});
|
|
100
|
-
prevTarget
|
|
101
|
-
prevListener
|
|
100
|
+
prevTarget = listenerTarget;
|
|
101
|
+
prevListener = lazyUpdatePosition;
|
|
102
102
|
};
|
|
103
|
-
const removeListeners = () => {
|
|
104
|
-
const newTarget = targetFunc.value();
|
|
103
|
+
const removeListeners = (newTarget = targetFunc.value()) => {
|
|
105
104
|
TRIGGER_EVENTS.forEach((eventName) => {
|
|
106
105
|
newTarget?.removeEventListener(eventName, lazyUpdatePosition);
|
|
107
|
-
if (prevListener
|
|
106
|
+
if (prevListener) prevTarget?.removeEventListener(eventName, prevListener);
|
|
108
107
|
});
|
|
109
108
|
updatePosition.cancel();
|
|
110
109
|
lazyUpdatePosition.cancel();
|
|
@@ -113,7 +112,9 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
113
112
|
onMounted(() => {
|
|
114
113
|
timer.value = setTimeout(addListeners);
|
|
115
114
|
});
|
|
115
|
+
let unmounted = false;
|
|
116
116
|
onBeforeUnmount(() => {
|
|
117
|
+
unmounted = true;
|
|
117
118
|
if (timer.value) {
|
|
118
119
|
clearTimeout(timer.value);
|
|
119
120
|
timer.value = null;
|
|
@@ -128,8 +129,10 @@ const Affix = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose, em
|
|
|
128
129
|
() => props.offsetBottom
|
|
129
130
|
], async (_new, _old, onCleanup) => {
|
|
130
131
|
await nextTick();
|
|
132
|
+
if (unmounted) return;
|
|
131
133
|
addListeners();
|
|
132
|
-
|
|
134
|
+
const target = prevTarget;
|
|
135
|
+
onCleanup(() => removeListeners(target));
|
|
133
136
|
});
|
|
134
137
|
watch([
|
|
135
138
|
() => props.target,
|
package/dist/alert/Alert.js
CHANGED
|
@@ -2,8 +2,9 @@ import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
|
2
2
|
import { getAttrStyleAndClass, pureAttrs, useMergeSemanticNoRef } from "../_util/hooks/useMergeSemantic.js";
|
|
3
3
|
import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
4
4
|
import { isRenderable } from "../_util/is.js";
|
|
5
|
+
import useVariant from "../form/hooks/useVariant.js";
|
|
5
6
|
import style_default from "./style/index.js";
|
|
6
|
-
import { Transition, computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef } from "vue";
|
|
7
|
+
import { Transition, computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef, toRef } from "vue";
|
|
7
8
|
import { classNames, clsx } from "@v-c/util";
|
|
8
9
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
9
10
|
import { CheckCircleFilled, CloseCircleFilled, CloseOutlined, ExclamationCircleFilled, InfoCircleFilled } from "@antdv-next/icons";
|
|
@@ -152,15 +153,18 @@ const CloseIconNode = /* @__PURE__ */ defineComponent((props, { slots, attrs })
|
|
|
152
153
|
inheritAttrs: false
|
|
153
154
|
});
|
|
154
155
|
const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expose }) => {
|
|
155
|
-
const { closable: contextClosable, closeIcon: contextCloseIcon, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, direction, prefixCls, successIcon, errorIcon, infoIcon, warningIcon
|
|
156
|
+
const { closable: contextClosable, closeIcon: contextCloseIcon, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, direction, prefixCls, successIcon, errorIcon, infoIcon, warningIcon } = useComponentBaseConfig("alert", props, [
|
|
156
157
|
"closable",
|
|
157
158
|
"closeIcon",
|
|
158
159
|
"successIcon",
|
|
159
160
|
"errorIcon",
|
|
160
161
|
"infoIcon",
|
|
161
|
-
"warningIcon"
|
|
162
|
-
"variant"
|
|
162
|
+
"warningIcon"
|
|
163
163
|
]);
|
|
164
|
+
const [variant] = useVariant("alert", toRef(() => props.variant), {
|
|
165
|
+
variants: ["outlined", "filled"],
|
|
166
|
+
defaultVariant: "outlined"
|
|
167
|
+
});
|
|
164
168
|
const { classes, styles } = toPropsRefs$1(props, "classes", "styles");
|
|
165
169
|
const closed = shallowRef(false);
|
|
166
170
|
const internalRef = shallowRef();
|
|
@@ -202,8 +206,10 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expo
|
|
|
202
206
|
const action = getSlotPropsFnRun(slots, props, "action");
|
|
203
207
|
const icon = getSlotPropsFnRun(slots, props, "icon");
|
|
204
208
|
const isShowIcon = banner && showIcon === void 0 ? true : showIcon;
|
|
209
|
+
const mergedVariant = variant.value;
|
|
205
210
|
const mergedProps = {
|
|
206
211
|
...props,
|
|
212
|
+
variant: mergedVariant,
|
|
207
213
|
prefixCls: prefixCls.value,
|
|
208
214
|
type: type.value,
|
|
209
215
|
showIcon: isShowIcon,
|
|
@@ -215,7 +221,6 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expo
|
|
|
215
221
|
contextStyleRoot,
|
|
216
222
|
styles.value
|
|
217
223
|
], { props: mergedProps });
|
|
218
|
-
const mergedVariant = props.variant ?? contextVariant?.value ?? "outlined";
|
|
219
224
|
const alertCls = classNames(prefixCls.value, `${prefixCls.value}-${type.value}`, `${prefixCls.value}-${mergedVariant}`, {
|
|
220
225
|
[`${prefixCls.value}-with-description`]: isRenderable(description),
|
|
221
226
|
[`${prefixCls.value}-no-icon`]: !isShowIcon,
|
package/dist/anchor/Anchor.js
CHANGED
|
@@ -36,7 +36,8 @@ function getOffsetTop(element, container) {
|
|
|
36
36
|
}
|
|
37
37
|
const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) => {
|
|
38
38
|
const links = ref([]);
|
|
39
|
-
|
|
39
|
+
let linkList = [];
|
|
40
|
+
const linkTargetOffsets = {};
|
|
40
41
|
const activeLink = shallowRef();
|
|
41
42
|
const _activeLink = shallowRef(activeLink.value);
|
|
42
43
|
const activeLinkRef = computed({
|
|
@@ -57,12 +58,16 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
|
|
|
57
58
|
const getCurrentContainer = () => props?.getContainer?.() ?? getTargetContainer?.() ?? getDefaultContainer?.();
|
|
58
59
|
const dependencyListItem = computed(() => JSON.stringify(links.value));
|
|
59
60
|
const registerLink = (link, targetOffset) => {
|
|
60
|
-
if (!
|
|
61
|
-
|
|
61
|
+
if (!linkList.includes(link)) {
|
|
62
|
+
linkList = [...linkList, link];
|
|
63
|
+
links.value = linkList;
|
|
64
|
+
}
|
|
65
|
+
if (targetOffset !== void 0) linkTargetOffsets[link] = targetOffset;
|
|
62
66
|
};
|
|
63
67
|
const unregisterLink = (link) => {
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
linkList = linkList.filter((item) => item !== link);
|
|
69
|
+
links.value = linkList;
|
|
70
|
+
delete linkTargetOffsets[link];
|
|
66
71
|
};
|
|
67
72
|
const updateInk = () => {
|
|
68
73
|
const linkNode = wrapperRef.value?.querySelector(`.${prefixCls.value}-link-title-active`);
|
|
@@ -88,7 +93,7 @@ const Anchor = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
|
|
|
88
93
|
const target = document.getElementById(sharpLinkMatch[1]);
|
|
89
94
|
if (target) {
|
|
90
95
|
const top = getOffsetTop(target, container);
|
|
91
|
-
if (top <= (
|
|
96
|
+
if (top <= (linkTargetOffsets[link] ?? _offsetTop) + _bounds) linkSections.push({
|
|
92
97
|
link,
|
|
93
98
|
top
|
|
94
99
|
});
|
|
@@ -91,12 +91,11 @@ const prepareComponentToken = (token) => ({
|
|
|
91
91
|
linkPaddingInlineStart: token.padding
|
|
92
92
|
});
|
|
93
93
|
var style_default = genStyleHooks("Anchor", (token) => {
|
|
94
|
-
const { fontSize,
|
|
94
|
+
const { fontSize, paddingXXS, calc } = token;
|
|
95
95
|
const anchorToken = mergeToken(token, {
|
|
96
96
|
holderOffsetBlock: paddingXXS,
|
|
97
97
|
anchorPaddingBlockSecondary: calc(paddingXXS).div(2).equal(),
|
|
98
|
-
anchorTitleBlock: calc(fontSize).div(14).mul(3).equal()
|
|
99
|
-
anchorBallSize: calc(fontSizeLG).div(2).equal()
|
|
98
|
+
anchorTitleBlock: calc(fontSize).div(14).mul(3).equal()
|
|
100
99
|
});
|
|
101
100
|
return [genSharedAnchorStyle(anchorToken), genSharedAnchorHorizontalStyle(anchorToken)];
|
|
102
101
|
}, prepareComponentToken);
|