antdv-next 1.5.5 → 1.6.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/PurePanel.js +17 -14
- package/dist/_util/fallbackProp.d.ts +13 -0
- package/dist/_util/fallbackProp.js +15 -0
- package/dist/_util/hooks/useAllowClear.d.ts +19 -0
- package/dist/_util/hooks/useAllowClear.js +16 -0
- package/dist/_util/hooks/useMergeSemantic.js +3 -2
- package/dist/_util/omitUndefined.d.ts +13 -0
- package/dist/_util/omitUndefined.js +20 -0
- package/dist/_util/statusUtils.d.ts +1 -1
- package/dist/_util/vueNode.d.ts +2 -6
- package/dist/_util/wave/index.js +4 -2
- package/dist/_util/wave/style.d.ts +5 -1
- package/dist/_util/wave/useWave.d.ts +2 -1
- package/dist/_util/wave/useWave.js +4 -3
- package/dist/affix/style/index.d.ts +5 -1
- package/dist/alert/Alert.d.ts +6 -2
- package/dist/alert/Alert.js +131 -128
- package/dist/alert/style/index.d.ts +4 -1
- package/dist/alert/style/index.js +9 -6
- package/dist/anchor/style/index.d.ts +5 -1
- package/dist/antd-with-locales.esm.js +18451 -15882
- package/dist/antd-with-locales.js +80 -80
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +17338 -14784
- package/dist/antd.js +94 -94
- package/dist/app/style/index.d.ts +5 -1
- package/dist/avatar/style/index.d.ts +5 -1
- package/dist/badge/index.js +1 -1
- package/dist/badge/style/index.d.ts +5 -1
- package/dist/badge/style/index.js +2 -9
- package/dist/badge/style/ribbon.d.ts +5 -1
- package/dist/border-beam/style/index.d.ts +5 -1
- package/dist/breadcrumb/BreadcrumbItem.js +1 -1
- package/dist/breadcrumb/style/index.d.ts +5 -1
- package/dist/button/style/index.d.ts +5 -1
- package/dist/calendar/style/index.d.ts +4 -1
- package/dist/card/Card.js +1 -1
- package/dist/card/style/index.d.ts +5 -1
- package/dist/carousel/index.js +1 -1
- package/dist/carousel/style/index.d.ts +5 -1
- package/dist/carousel/style/index.js +1 -1
- package/dist/cascader/index.js +3 -2
- package/dist/cascader/style/index.d.ts +5 -1
- package/dist/cascader/style/panel.d.ts +5 -1
- package/dist/checkbox/style/index.d.ts +4 -1
- package/dist/collapse/Collapse.d.ts +2 -0
- package/dist/collapse/Collapse.js +5 -2
- package/dist/collapse/style/index.d.ts +4 -1
- package/dist/color-picker/ColorPicker.js +7 -11
- package/dist/color-picker/style/index.d.ts +5 -1
- package/dist/components.d.ts +2 -2
- package/dist/config-provider/context.d.ts +16 -21
- package/dist/config-provider/context.js +32 -38
- package/dist/config-provider/define.d.ts +3 -1
- package/dist/config-provider/hooks/useCSSVarCls.d.ts +3 -0
- package/dist/config-provider/hooks/useCSSVarCls.js +4 -3
- package/dist/config-provider/index.d.ts +2 -2
- package/dist/config-provider/index.js +24 -1
- package/dist/date-picker/generatePicker/generateRangePicker.js +10 -3
- package/dist/date-picker/generatePicker/generateSinglePicker.js +13 -5
- package/dist/date-picker/generatePicker/useComponents.d.ts +3 -3
- package/dist/date-picker/style/index.d.ts +5 -1
- package/dist/date-picker/util.d.ts +8 -12
- package/dist/date-picker/util.js +14 -7
- package/dist/descriptions/Cell.js +80 -75
- package/dist/descriptions/Row.js +14 -11
- package/dist/descriptions/hooks/useItems.d.ts +6 -6
- package/dist/descriptions/style/index.d.ts +5 -1
- package/dist/divider/style/index.d.ts +5 -1
- package/dist/drawer/DrawerPanel.js +6 -6
- package/dist/drawer/index.d.ts +0 -2
- package/dist/drawer/index.js +0 -1
- package/dist/drawer/style/index.d.ts +5 -1
- package/dist/dropdown/dropdown.js +2 -1
- package/dist/dropdown/style/index.d.ts +5 -1
- package/dist/empty/style/index.d.ts +5 -1
- package/dist/flex/index.js +1 -1
- package/dist/flex/style/index.d.ts +5 -1
- package/dist/float-button/FloatButtonGroup.js +1 -1
- package/dist/float-button/style/index.d.ts +5 -1
- package/dist/form/FormItem/index.js +36 -16
- package/dist/form/context.d.ts +1 -1
- package/dist/form/hooks/useVariant.d.ts +1 -1
- package/dist/form/style/index.d.ts +5 -1
- package/dist/grid/style/index.d.ts +5 -2
- package/dist/image/hooks/usePreviewConfig.d.ts +5 -5
- package/dist/image/style/index.d.ts +4 -1
- package/dist/index.d.ts +2 -2
- package/dist/input/style/index.d.ts +5 -2
- package/dist/input/style/otp.d.ts +5 -1
- package/dist/input/style/search.d.ts +5 -1
- package/dist/input/style/textarea.d.ts +5 -1
- package/dist/input-number/style/index.d.ts +5 -1
- package/dist/layout/style/index.d.ts +5 -1
- package/dist/layout/style/sider.d.ts +5 -1
- package/dist/listy/style/index.d.ts +5 -1
- package/dist/locale/useLocale.d.ts +1 -1
- package/dist/masonry/style/index.d.ts +4 -1
- package/dist/mentions/index.js +1 -1
- package/dist/mentions/style/index.d.ts +5 -1
- package/dist/menu/MenuItem.js +2 -1
- package/dist/menu/index.d.ts +2 -2
- package/dist/message/style/index.d.ts +5 -1
- package/dist/modal/style/index.d.ts +3 -1
- package/dist/notification/style/index.d.ts +4 -1
- package/dist/package.js +1 -1
- package/dist/pagination/style/index.d.ts +5 -1
- package/dist/popconfirm/style/index.d.ts +5 -1
- package/dist/popover/index.js +4 -3
- package/dist/popover/style/index.d.ts +5 -1
- package/dist/progress/style/index.d.ts +5 -1
- package/dist/qrcode/index.js +0 -21
- package/dist/qrcode/interface.d.ts +1 -1
- package/dist/qrcode/style/index.d.ts +5 -1
- package/dist/radio/style/index.d.ts +5 -1
- package/dist/rate/style/index.d.ts +5 -1
- package/dist/result/style/index.d.ts +5 -1
- package/dist/segmented/style/index.d.ts +5 -1
- package/dist/select/index.js +2 -2
- package/dist/select/style/index.d.ts +5 -1
- package/dist/skeleton/style/index.d.ts +5 -1
- package/dist/slider/style/index.d.ts +5 -1
- package/dist/space/Compact.d.ts +1 -1
- package/dist/space/style/addon.d.ts +5 -1
- package/dist/space/style/compact.d.ts +5 -1
- package/dist/space/style/index.d.ts +5 -1
- package/dist/spin/style/index.d.ts +5 -1
- package/dist/splitter/style/index.d.ts +5 -1
- package/dist/statistic/style/index.d.ts +5 -1
- package/dist/steps/style/index.d.ts +5 -1
- package/dist/switch/style/index.d.ts +5 -1
- package/dist/table/InternalTable.js +52 -48
- package/dist/table/hooks/useSelection.js +19 -6
- package/dist/table/style/index.d.ts +5 -1
- package/dist/table/style/selection.js +1 -1
- package/dist/table/util.d.ts +1 -1
- package/dist/tabs/style/index.d.ts +5 -1
- package/dist/tag/CheckableTagGroup.d.ts +2 -2
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/tag/style/index.d.ts +5 -1
- package/dist/theme/context.js +2 -1
- package/dist/theme/useToken.d.ts +6 -2
- package/dist/theme/useToken.js +46 -14
- package/dist/theme/util/genStyleUtils.d.ts +13 -3
- package/dist/theme/util/genStyleUtils.js +42 -28
- package/dist/timeline/style/index.d.ts +5 -1
- package/dist/timeline/useItems.d.ts +2 -2
- package/dist/timeline/useItems.js +1 -1
- package/dist/tooltip/index.js +1 -1
- package/dist/tooltip/style/index.d.ts +2 -2
- package/dist/tour/style/index.d.ts +5 -1
- package/dist/transfer/Transfer.js +2 -0
- package/dist/transfer/style/index.d.ts +5 -1
- package/dist/tree/DirectoryTree.js +1 -1
- package/dist/tree/style/index.d.ts +4 -1
- package/dist/tree-select/index.js +1 -1
- package/dist/tree-select/style/index.d.ts +2 -2
- package/dist/typography/style/index.d.ts +5 -1
- package/dist/upload/style/index.d.ts +5 -1
- package/dist/version/token.json +1 -1
- package/global.d.ts +5 -0
- package/package.json +13 -13
- package/web-tags.json +4973 -2984
- package/web-types.json +13140 -7396
package/dist/_util/PurePanel.js
CHANGED
|
@@ -82,21 +82,24 @@ function genPurePanel(Component, alignPropName, postProps, defaultPrefixCls, get
|
|
|
82
82
|
"style": mergedStyle
|
|
83
83
|
}, [createVNode(Component, mergeProps(attrs, mergedProps), slots)]);
|
|
84
84
|
};
|
|
85
|
-
}, {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
}, {
|
|
86
|
+
props: {
|
|
87
|
+
prefixCls: {
|
|
88
|
+
type: String,
|
|
89
|
+
required: false
|
|
90
|
+
},
|
|
91
|
+
style: {
|
|
92
|
+
type: Object,
|
|
93
|
+
required: false
|
|
94
|
+
},
|
|
95
|
+
open: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
required: false,
|
|
98
|
+
default: void 0
|
|
99
|
+
}
|
|
93
100
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
required: false,
|
|
97
|
-
default: void 0
|
|
98
|
-
}
|
|
99
|
-
} }));
|
|
101
|
+
inheritAttrs: false
|
|
102
|
+
}));
|
|
100
103
|
}
|
|
101
104
|
//#endregion
|
|
102
105
|
export { genPurePanel as default, withPureRenderTheme };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/_util/fallbackProp.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Search for the first non-undefined value in the arguments and return it.
|
|
4
|
+
*
|
|
5
|
+
* ```js
|
|
6
|
+
* const mergedIcon = fallbackProp(propIcon, contextIcon, defaultIcon);
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Note: it is different from `??` operator which skips null
|
|
10
|
+
*/
|
|
11
|
+
declare function fallbackProp<T>(...args: T[]): Exclude<T, undefined> | undefined;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { fallbackProp as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/_util/fallbackProp.ts
|
|
2
|
+
/**
|
|
3
|
+
* Search for the first non-undefined value in the arguments and return it.
|
|
4
|
+
*
|
|
5
|
+
* ```js
|
|
6
|
+
* const mergedIcon = fallbackProp(propIcon, contextIcon, defaultIcon);
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Note: it is different from `??` operator which skips null
|
|
10
|
+
*/
|
|
11
|
+
function fallbackProp(...args) {
|
|
12
|
+
return args.find((arg) => arg !== void 0);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { fallbackProp as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/_util/hooks/useAllowClear.d.ts
|
|
2
|
+
interface AllowClearObject {
|
|
3
|
+
clearIcon?: any;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
type AllowClear = boolean | AllowClearObject;
|
|
7
|
+
/** The hook never returns plain `true`: a truthy allowClear is normalized to the object form. */
|
|
8
|
+
type MergedAllowClear = AllowClearObject | false;
|
|
9
|
+
interface UseAllowClearOptions {
|
|
10
|
+
allowClear?: AllowClear;
|
|
11
|
+
clearIcon?: any;
|
|
12
|
+
contextAllowClear?: AllowClear;
|
|
13
|
+
contextClearIcon?: any;
|
|
14
|
+
defaultAllowClear?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Merge component- and ConfigProvider-level `allowClear` / `clearIcon` (priority: props → context → `defaultAllowClear`). */
|
|
17
|
+
declare function useAllowClear({ allowClear, clearIcon, contextAllowClear, contextClearIcon, defaultAllowClear }: UseAllowClearOptions): MergedAllowClear;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { AllowClear, AllowClearObject, MergedAllowClear, UseAllowClearOptions, useAllowClear as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isPlainObject } from "../is.js";
|
|
2
|
+
import fallbackProp from "../fallbackProp.js";
|
|
3
|
+
import { createVNode } from "vue";
|
|
4
|
+
import { CloseCircleFilled } from "@antdv-next/icons";
|
|
5
|
+
//#region src/_util/hooks/useAllowClear.tsx
|
|
6
|
+
/** The hook never returns plain `true`: a truthy allowClear is normalized to the object form. */
|
|
7
|
+
/** Merge component- and ConfigProvider-level `allowClear` / `clearIcon` (priority: props → context → `defaultAllowClear`). */
|
|
8
|
+
function useAllowClear({ allowClear, clearIcon, contextAllowClear, contextClearIcon, defaultAllowClear }) {
|
|
9
|
+
if (!(allowClear ?? contextAllowClear ?? defaultAllowClear)) return false;
|
|
10
|
+
return {
|
|
11
|
+
clearIcon: fallbackProp(isPlainObject(allowClear) ? allowClear?.clearIcon : clearIcon, isPlainObject(contextAllowClear) ? contextAllowClear?.clearIcon : contextClearIcon, createVNode(CloseCircleFilled, null, null)),
|
|
12
|
+
disabled: (isPlainObject(allowClear) ? allowClear?.disabled : void 0) ?? (isPlainObject(contextAllowClear) ? contextAllowClear?.disabled : void 0)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { useAllowClear as default };
|
|
@@ -62,11 +62,12 @@ function resolveStyleOrClass(value, info) {
|
|
|
62
62
|
* @descZH 合并来自多个来源的 classNames 和 styles,当提供了 `schema` 时,必须提供嵌套的对象结构。
|
|
63
63
|
*/
|
|
64
64
|
function useMergeSemantic(classNamesList, stylesList, info, schema) {
|
|
65
|
+
const resolveLazy = (value) => typeof value === "function" ? value(info.value) : value;
|
|
65
66
|
const resolvedClassNamesList = computed(() => {
|
|
66
|
-
return classNamesList.value.map((classNames) => classNames ?
|
|
67
|
+
return classNamesList.value.map((classNames) => classNames ? resolveLazy(classNames) : void 0);
|
|
67
68
|
});
|
|
68
69
|
const resolvedStylesList = computed(() => {
|
|
69
|
-
return stylesList.value.map((styles) => styles ?
|
|
70
|
+
return stylesList.value.map((styles) => styles ? resolveLazy(styles) : void 0);
|
|
70
71
|
});
|
|
71
72
|
const mergedClassNames = computed(() => useSemanticClassNames(schema?.value, ...resolvedClassNamesList.value));
|
|
72
73
|
const mergedStyles = computed(() => useSemanticStyles(...resolvedStylesList.value));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/_util/omitUndefined.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Copy `obj` without the keys whose value is `undefined`.
|
|
4
|
+
*
|
|
5
|
+
* Vue materialises every declared prop on `props` (unset ones as `undefined`),
|
|
6
|
+
* so spreading `props` into a child forwards dozens of empty keys that the
|
|
7
|
+
* child then has to normalise in `initProps` / `setFullProps` on every mount.
|
|
8
|
+
* Boolean props in this code base default to `undefined` rather than `false`,
|
|
9
|
+
* so leaving an unset key out is equivalent to passing it as `undefined`.
|
|
10
|
+
*/
|
|
11
|
+
declare function omitUndefined<T extends Record<string, any>>(obj: T, omitKeys?: readonly string[]): Partial<T>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { omitUndefined };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/_util/omitUndefined.ts
|
|
2
|
+
/**
|
|
3
|
+
* Copy `obj` without the keys whose value is `undefined`.
|
|
4
|
+
*
|
|
5
|
+
* Vue materialises every declared prop on `props` (unset ones as `undefined`),
|
|
6
|
+
* so spreading `props` into a child forwards dozens of empty keys that the
|
|
7
|
+
* child then has to normalise in `initProps` / `setFullProps` on every mount.
|
|
8
|
+
* Boolean props in this code base default to `undefined` rather than `false`,
|
|
9
|
+
* so leaving an unset key out is equivalent to passing it as `undefined`.
|
|
10
|
+
*/
|
|
11
|
+
function omitUndefined(obj, omitKeys = []) {
|
|
12
|
+
const result = {};
|
|
13
|
+
for (const key in obj) {
|
|
14
|
+
const value = obj[key];
|
|
15
|
+
if (value !== void 0 && !omitKeys.includes(key)) result[key] = value;
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { omitUndefined };
|
|
@@ -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): "" | "success" | "
|
|
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
|
@@ -3,12 +3,8 @@ 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
|
-
|
|
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;
|
|
6
|
+
declare function replaceElement(element: VNodeChild, replacement: VNodeChild, props?: RenderProps): VNodeChild;
|
|
7
|
+
declare function cloneElement(element: VNodeChild, props?: RenderProps): VNodeChild;
|
|
12
8
|
declare function getVNode(node: VueNode): VNodeChild;
|
|
13
9
|
declare function checkRenderNode(node: any): any;
|
|
14
10
|
declare function getTextByNode(node: any): any;
|
package/dist/_util/wave/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useConfig } from "../../config-provider/context.js";
|
|
2
|
+
import { useStyleToken } from "../../theme/util/genStyleUtils.js";
|
|
2
3
|
import style_default from "./style.js";
|
|
3
4
|
import useWave from "./useWave.js";
|
|
4
5
|
import { cloneVNode, computed, defineComponent, isVNode, onBeforeUnmount, onMounted, shallowRef, watch } from "vue";
|
|
@@ -26,9 +27,10 @@ var wave_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
26
27
|
const configCtx = useConfig();
|
|
27
28
|
const containerRef = shallowRef(null);
|
|
28
29
|
const prefixCls = computed(() => configCtx.value.getPrefixCls("wave"));
|
|
29
|
-
const
|
|
30
|
+
const tokenResult = useStyleToken();
|
|
31
|
+
const hashId = style_default(prefixCls, void 0, tokenResult);
|
|
30
32
|
const colorSource = computed(() => props.colorSource);
|
|
31
|
-
const showWave = useWave(containerRef, computed(() => classNames(prefixCls.value, hashId.value)), computed(() => props.component), colorSource);
|
|
33
|
+
const showWave = useWave(containerRef, computed(() => classNames(prefixCls.value, hashId.value)), computed(() => props.component), colorSource, tokenResult);
|
|
32
34
|
const handleEvent = (event) => {
|
|
33
35
|
const node = containerRef.value;
|
|
34
36
|
if (!node) return;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
1
4
|
import { FullToken } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
import "../../theme/internal.js";
|
|
3
7
|
//#region src/_util/wave/style.d.ts
|
|
4
8
|
interface ComponentToken {}
|
|
5
9
|
interface WaveToken extends FullToken<'Wave'> {}
|
|
6
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => import("vue").Ref<string, string>;
|
|
10
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => import("vue").Ref<string, string>;
|
|
7
11
|
//#endregion
|
|
8
12
|
export { ComponentToken, WaveToken, _default as default };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { StyleTokenResult } from "../../theme/util/genStyleUtils.js";
|
|
1
2
|
import { ShowWave, WaveComponent } from "./interface.js";
|
|
2
3
|
import { WaveProps } from "./index.js";
|
|
3
4
|
import { Ref } from "vue";
|
|
4
5
|
//#region src/_util/wave/useWave.d.ts
|
|
5
|
-
declare function useWave(nodeRef: Ref<HTMLElement | null | undefined>, className: string | Ref<string>, component?: WaveComponent | Ref<WaveComponent | undefined>, colorSource?: Ref<WaveProps['colorSource']
|
|
6
|
+
declare function useWave(nodeRef: Ref<HTMLElement | null | undefined>, className: string | Ref<string>, component?: WaveComponent | Ref<WaveComponent | undefined>, colorSource?: Ref<WaveProps['colorSource']>, tokenResult?: StyleTokenResult): ShowWave;
|
|
6
7
|
//#endregion
|
|
7
8
|
export { useWave as default };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { useConfig } from "../../config-provider/context.js";
|
|
2
|
-
import
|
|
2
|
+
import { useStyleToken } from "../../theme/util/genStyleUtils.js";
|
|
3
3
|
import { TARGET_CLS } from "./interface.js";
|
|
4
4
|
import showWaveEffect from "./WaveEffect.js";
|
|
5
5
|
import { onBeforeUnmount, ref, unref } from "vue";
|
|
6
6
|
import raf from "@v-c/util/dist/raf";
|
|
7
7
|
//#region src/_util/wave/useWave.ts
|
|
8
|
-
function useWave(nodeRef, className, component, colorSource) {
|
|
8
|
+
function useWave(nodeRef, className, component, colorSource, tokenResult = useStyleToken()) {
|
|
9
9
|
const configCtx = useConfig();
|
|
10
|
-
const
|
|
10
|
+
const token = tokenResult.realToken;
|
|
11
|
+
const hashId = tokenResult.hashId;
|
|
11
12
|
const showWave = (event) => {
|
|
12
13
|
const node = nodeRef.value;
|
|
13
14
|
if (!node) return;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
1
4
|
import { GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
import "../../theme/internal.js";
|
|
3
7
|
//#region src/affix/style/index.d.ts
|
|
4
8
|
interface ComponentToken {
|
|
@@ -9,6 +13,6 @@ interface ComponentToken {
|
|
|
9
13
|
zIndexPopup: number;
|
|
10
14
|
}
|
|
11
15
|
declare const prepareComponentToken: GetDefaultToken<'Affix'>;
|
|
12
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
16
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
13
17
|
//#endregion
|
|
14
18
|
export { ComponentToken, _default as default, prepareComponentToken };
|
package/dist/alert/Alert.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ interface AlertSemanticType {
|
|
|
27
27
|
}
|
|
28
28
|
type AlertClassNamesType = SemanticType<AlertProps, AlertSemanticType['classes']>;
|
|
29
29
|
type AlertStylesType = SemanticType<AlertProps, AlertSemanticType['styles']>;
|
|
30
|
+
type AlertClosableType = boolean | (Exclude<ClosableType, boolean> & {
|
|
31
|
+
onClose?: (e?: MouseEvent) => void;
|
|
32
|
+
afterClose?: () => void;
|
|
33
|
+
});
|
|
30
34
|
type AlertVariant = 'filled' | 'outlined';
|
|
31
35
|
interface AlertProps extends ComponentBaseProps, AlertEmitsProps {
|
|
32
36
|
/** Type of Alert styles, options:`success`, `info`, `warning`, `error` */
|
|
@@ -38,7 +42,7 @@ interface AlertProps extends ComponentBaseProps, AlertEmitsProps {
|
|
|
38
42
|
*/
|
|
39
43
|
variant?: AlertVariant;
|
|
40
44
|
/** Whether Alert can be closed */
|
|
41
|
-
closable?:
|
|
45
|
+
closable?: AlertClosableType;
|
|
42
46
|
/** Content of Alert */
|
|
43
47
|
title?: VueNode;
|
|
44
48
|
/**
|
|
@@ -84,4 +88,4 @@ interface AlertEmitsProps {
|
|
|
84
88
|
}
|
|
85
89
|
declare const Alert: import("vue").DefineSetupFnComponent<AlertProps, AlertEmits, SlotsType<AlertSlots>, AlertProps, import("vue").PublicProps>;
|
|
86
90
|
//#endregion
|
|
87
|
-
export { AlertClassNamesType, AlertEmits, AlertEmitsProps, AlertProps, AlertSemanticType, AlertSlots, AlertStylesType, AlertVariant, Alert as default };
|
|
91
|
+
export { AlertClassNamesType, AlertClosableType, AlertEmits, AlertEmitsProps, AlertProps, AlertSemanticType, AlertSlots, AlertStylesType, AlertVariant, Alert as default };
|
package/dist/alert/Alert.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
2
|
import { getAttrStyleAndClass, pureAttrs, useMergeSemanticNoRef } from "../_util/hooks/useMergeSemantic.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
4
4
|
import { isRenderable } from "../_util/is.js";
|
|
5
5
|
import style_default from "./style/index.js";
|
|
6
6
|
import { Transition, computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef } from "vue";
|
|
7
7
|
import { classNames, clsx } from "@v-c/util";
|
|
8
8
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
9
9
|
import { CheckCircleFilled, CloseCircleFilled, CloseOutlined, ExclamationCircleFilled, InfoCircleFilled } from "@antdv-next/icons";
|
|
10
|
+
import pickAttrs from "@v-c/util/dist/pickAttrs";
|
|
10
11
|
//#region src/alert/Alert.tsx
|
|
11
12
|
const alertDefaultProps = { showIcon: void 0 };
|
|
12
13
|
const IconNode = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
@@ -25,135 +26,132 @@ const IconNode = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
25
26
|
warning: warningIcon ?? createVNode(ExclamationCircleFilled, null, null)
|
|
26
27
|
};
|
|
27
28
|
return createVNode("span", {
|
|
28
|
-
"class":
|
|
29
|
+
"class": className,
|
|
29
30
|
"style": style
|
|
30
31
|
}, [icon ?? iconMapFilled[type]]);
|
|
31
32
|
};
|
|
32
|
-
}, {
|
|
33
|
-
|
|
34
|
-
type:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
default: void 0
|
|
33
|
+
}, {
|
|
34
|
+
props: {
|
|
35
|
+
type: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
icon: {
|
|
40
|
+
type: [
|
|
41
|
+
Function,
|
|
42
|
+
String,
|
|
43
|
+
Number,
|
|
44
|
+
null,
|
|
45
|
+
Object,
|
|
46
|
+
Boolean
|
|
47
|
+
],
|
|
48
|
+
required: false,
|
|
49
|
+
default: void 0
|
|
50
|
+
},
|
|
51
|
+
successIcon: {
|
|
52
|
+
type: [
|
|
53
|
+
Function,
|
|
54
|
+
String,
|
|
55
|
+
Number,
|
|
56
|
+
null,
|
|
57
|
+
Object,
|
|
58
|
+
Boolean
|
|
59
|
+
],
|
|
60
|
+
required: false,
|
|
61
|
+
default: void 0
|
|
62
|
+
},
|
|
63
|
+
infoIcon: {
|
|
64
|
+
type: [
|
|
65
|
+
Function,
|
|
66
|
+
String,
|
|
67
|
+
Number,
|
|
68
|
+
null,
|
|
69
|
+
Object,
|
|
70
|
+
Boolean
|
|
71
|
+
],
|
|
72
|
+
required: false,
|
|
73
|
+
default: void 0
|
|
74
|
+
},
|
|
75
|
+
warningIcon: {
|
|
76
|
+
type: [
|
|
77
|
+
Function,
|
|
78
|
+
String,
|
|
79
|
+
Number,
|
|
80
|
+
null,
|
|
81
|
+
Object,
|
|
82
|
+
Boolean
|
|
83
|
+
],
|
|
84
|
+
required: false,
|
|
85
|
+
default: void 0
|
|
86
|
+
},
|
|
87
|
+
errorIcon: {
|
|
88
|
+
type: [
|
|
89
|
+
Function,
|
|
90
|
+
String,
|
|
91
|
+
Number,
|
|
92
|
+
null,
|
|
93
|
+
Object,
|
|
94
|
+
Boolean
|
|
95
|
+
],
|
|
96
|
+
required: false,
|
|
97
|
+
default: void 0
|
|
98
|
+
}
|
|
99
99
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
Function,
|
|
103
|
-
String,
|
|
104
|
-
Number,
|
|
105
|
-
null,
|
|
106
|
-
Object,
|
|
107
|
-
Boolean
|
|
108
|
-
],
|
|
109
|
-
required: false,
|
|
110
|
-
default: void 0
|
|
111
|
-
}
|
|
112
|
-
} });
|
|
100
|
+
inheritAttrs: false
|
|
101
|
+
});
|
|
113
102
|
const CloseIconNode = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
114
103
|
return () => {
|
|
115
|
-
const { isClosable, prefixCls, handleClose, ariaProps } = props;
|
|
104
|
+
const { isClosable, disabled, prefixCls, handleClose, ariaProps } = props;
|
|
116
105
|
const { className, style } = getAttrStyleAndClass(attrs);
|
|
117
|
-
const closeIcon = getSlotPropsFnRun(slots, props, "closeIcon");
|
|
118
|
-
const mergedCloseIcon =
|
|
106
|
+
const closeIcon = getSlotPropsFnRun(slots, props, "closeIcon", false);
|
|
107
|
+
const mergedCloseIcon = closeIcon === true || closeIcon === void 0 ? createVNode(CloseOutlined, null, null) : closeIcon;
|
|
119
108
|
return isClosable ? createVNode("button", mergeProps({
|
|
120
109
|
"type": "button",
|
|
110
|
+
"disabled": disabled,
|
|
121
111
|
"onClick": handleClose,
|
|
122
112
|
"class": clsx(`${prefixCls}-close-icon`, className),
|
|
123
|
-
"tabindex": 0,
|
|
124
113
|
"style": style
|
|
125
114
|
}, ariaProps), [mergedCloseIcon]) : null;
|
|
126
115
|
};
|
|
127
|
-
}, {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
String,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
116
|
+
}, {
|
|
117
|
+
props: {
|
|
118
|
+
isClosable: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
required: true
|
|
121
|
+
},
|
|
122
|
+
disabled: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
required: false,
|
|
125
|
+
default: void 0
|
|
126
|
+
},
|
|
127
|
+
prefixCls: {
|
|
128
|
+
type: String,
|
|
129
|
+
required: true
|
|
130
|
+
},
|
|
131
|
+
closeIcon: {
|
|
132
|
+
type: [
|
|
133
|
+
Function,
|
|
134
|
+
String,
|
|
135
|
+
Number,
|
|
136
|
+
null,
|
|
137
|
+
Object,
|
|
138
|
+
Boolean
|
|
139
|
+
],
|
|
140
|
+
required: false,
|
|
141
|
+
default: void 0
|
|
142
|
+
},
|
|
143
|
+
handleClose: {
|
|
144
|
+
type: Function,
|
|
145
|
+
required: true
|
|
146
|
+
},
|
|
147
|
+
ariaProps: {
|
|
148
|
+
type: Object,
|
|
149
|
+
required: true
|
|
150
|
+
}
|
|
150
151
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
} });
|
|
156
|
-
const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) => {
|
|
152
|
+
inheritAttrs: false
|
|
153
|
+
});
|
|
154
|
+
const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expose }) => {
|
|
157
155
|
const { closable: contextClosable, closeIcon: contextCloseIcon, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, direction, prefixCls, successIcon, errorIcon, infoIcon, warningIcon, variant: contextVariant } = useComponentBaseConfig("alert", props, [
|
|
158
156
|
"closable",
|
|
159
157
|
"closeIcon",
|
|
@@ -166,10 +164,13 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
166
164
|
const { classes, styles } = toPropsRefs$1(props, "classes", "styles");
|
|
167
165
|
const closed = shallowRef(false);
|
|
168
166
|
const internalRef = shallowRef();
|
|
167
|
+
expose({ nativeElement: internalRef });
|
|
169
168
|
const [hashId, cssVarCls] = style_default(prefixCls);
|
|
170
169
|
const handleClose = (e) => {
|
|
171
170
|
closed.value = true;
|
|
172
|
-
|
|
171
|
+
const closable = props.closable;
|
|
172
|
+
if (typeof closable === "object" && closable?.onClose) closable.onClose(e);
|
|
173
|
+
else emit("close", e);
|
|
173
174
|
};
|
|
174
175
|
const type = computed(() => {
|
|
175
176
|
if (props.type) return props.type;
|
|
@@ -222,19 +223,19 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
222
223
|
[`${prefixCls.value}-rtl`]: direction.value === "rtl"
|
|
223
224
|
}, contextClassName.value, className, rootClass, mergedClassNames.root, cssVarCls.value, hashId.value);
|
|
224
225
|
const mergedCloseIconFn = () => {
|
|
225
|
-
if (typeof closable === "object" && closable
|
|
226
|
-
const closeIcon =
|
|
227
|
-
if (closeIcon) return closeIcon;
|
|
228
|
-
if (typeof contextClosable.value === "object" && contextClosable.value) return contextClosable.value;
|
|
226
|
+
if (typeof closable === "object" && closable?.closeIcon) return closable.closeIcon;
|
|
227
|
+
const closeIcon = getSlotPropsFnRun(slots, props, "closeIcon", false);
|
|
228
|
+
if (closeIcon !== void 0) return closeIcon;
|
|
229
|
+
if (typeof contextClosable.value === "object" && contextClosable.value?.closeIcon) return contextClosable.value.closeIcon;
|
|
229
230
|
return contextCloseIcon.value;
|
|
230
231
|
};
|
|
231
232
|
const mergedCloseIcon = mergedCloseIconFn();
|
|
232
233
|
const mergedAriaPropsFn = () => {
|
|
233
234
|
const merged = closable ?? contextClosable.value;
|
|
234
|
-
if (typeof merged === "object") {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
235
|
+
if (typeof merged === "object" && merged) return pickAttrs(merged, {
|
|
236
|
+
aria: true,
|
|
237
|
+
data: true
|
|
238
|
+
});
|
|
238
239
|
return {};
|
|
239
240
|
};
|
|
240
241
|
const mergedAriaProps = mergedAriaPropsFn();
|
|
@@ -245,7 +246,10 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
245
246
|
"leaveActiveClass": `${prefixCls.value}-motion-leave ${prefixCls.value}-motion-leave-active`,
|
|
246
247
|
"leaveToClass": `${prefixCls.value}-motion-leave ${prefixCls.value}-motion-leave-active`,
|
|
247
248
|
"onBeforeLeave": handleBeforeLeave,
|
|
248
|
-
"onAfterLeave": () =>
|
|
249
|
+
"onAfterLeave": () => {
|
|
250
|
+
if (typeof closable === "object" && closable?.afterClose) closable.afterClose();
|
|
251
|
+
else props?.afterClose?.();
|
|
252
|
+
}
|
|
249
253
|
}, { default: () => [!closed.value ? createVNode("div", mergeProps({
|
|
250
254
|
"id": props.id,
|
|
251
255
|
"ref": internalRef,
|
|
@@ -255,11 +259,9 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
255
259
|
"style": [mergedStyles.root, style]
|
|
256
260
|
}, pureAttrs(attrs)), [
|
|
257
261
|
isShowIcon ? createVNode(IconNode, {
|
|
258
|
-
"class": mergedClassNames.icon,
|
|
262
|
+
"class": clsx(`${prefixCls.value}-icon`, mergedClassNames.icon),
|
|
259
263
|
"style": mergedStyles.icon,
|
|
260
|
-
"description": description,
|
|
261
264
|
"icon": icon,
|
|
262
|
-
"prefixCls": prefixCls.value,
|
|
263
265
|
"type": type.value,
|
|
264
266
|
"successIcon": successIcon.value,
|
|
265
267
|
"infoIcon": infoIcon.value,
|
|
@@ -284,6 +286,7 @@ const Alert = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
284
286
|
"class": mergedClassNames.close,
|
|
285
287
|
"style": mergedStyles.close,
|
|
286
288
|
"isClosable": isClosable,
|
|
289
|
+
"disabled": typeof closable === "object" ? closable?.disabled : void 0,
|
|
287
290
|
"prefixCls": prefixCls.value,
|
|
288
291
|
"ariaProps": mergedAriaProps,
|
|
289
292
|
"handleClose": handleClose,
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
1
4
|
import { FullToken, GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
2
5
|
import { GenerateStyle } from "../../theme/interface/index.js";
|
|
3
6
|
import "../../theme/internal.js";
|
|
@@ -31,6 +34,6 @@ declare const genBaseStyle: GenerateStyle<AlertToken, CSSObject>;
|
|
|
31
34
|
declare const genTypeStyle: GenerateStyle<AlertToken, CSSObject>;
|
|
32
35
|
declare const genActionStyle: GenerateStyle<AlertToken, CSSObject>;
|
|
33
36
|
declare const prepareComponentToken: GetDefaultToken<'Alert'>;
|
|
34
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
37
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
35
38
|
//#endregion
|
|
36
39
|
export { ComponentToken, _default as default, genActionStyle, genBaseStyle, genTypeStyle, prepareComponentToken };
|