@v-c/notification 2.0.2 → 2.0.4
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/Notification.d.ts +1 -1
- package/dist/Notification.js +6 -5
- package/package.json +2 -2
package/dist/Notification.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component, CSSProperties, HTMLAttributes } from 'vue';
|
|
2
1
|
import { VueNode } from '@v-c/util/dist/type';
|
|
2
|
+
import { Component, CSSProperties, HTMLAttributes } from 'vue';
|
|
3
3
|
import { ClosableType } from './hooks/useClosable';
|
|
4
4
|
import { NotificationProgressProps } from './Progress';
|
|
5
5
|
export interface NotificationClassNames {
|
package/dist/Notification.js
CHANGED
|
@@ -2,7 +2,7 @@ import useClosable from "./hooks/useClosable.js";
|
|
|
2
2
|
import useNoticeTimer from "./hooks/useNoticeTimer.js";
|
|
3
3
|
import Progress from "./Progress.js";
|
|
4
4
|
import { computed, createVNode, defineComponent, mergeProps, ref, shallowRef, watch } from "vue";
|
|
5
|
-
import { clsx } from "@v-c/util";
|
|
5
|
+
import { clsx, isNonNullable, isVueRenderable } from "@v-c/util";
|
|
6
6
|
//#region src/Notification.tsx
|
|
7
7
|
var Notification = /* @__PURE__ */ defineComponent((props, { attrs, expose }) => {
|
|
8
8
|
const nodeRef = ref(null);
|
|
@@ -57,11 +57,11 @@ var Notification = /* @__PURE__ */ defineComponent((props, { attrs, expose }) =>
|
|
|
57
57
|
return () => {
|
|
58
58
|
const { prefixCls, className, style, classNames: ncs, styles: nss, components, title, description, icon, actions, role, stackInThreshold, props: rootProps, showProgress, duration } = props;
|
|
59
59
|
const noticePrefixCls = `${prefixCls}-notice`;
|
|
60
|
-
const titleNode = title
|
|
60
|
+
const titleNode = isNonNullable(title) ? createVNode("div", {
|
|
61
61
|
"class": clsx(`${noticePrefixCls}-title`, ncs?.title),
|
|
62
62
|
"style": nss?.title
|
|
63
63
|
}, [title]) : null;
|
|
64
|
-
const descNode = description
|
|
64
|
+
const descNode = isNonNullable(description) ? createVNode("div", {
|
|
65
65
|
"class": clsx(`${noticePrefixCls}-description`, ncs?.description),
|
|
66
66
|
"style": nss?.description
|
|
67
67
|
}, [description]) : null;
|
|
@@ -73,14 +73,14 @@ var Notification = /* @__PURE__ */ defineComponent((props, { attrs, expose }) =>
|
|
|
73
73
|
"style": nss?.section
|
|
74
74
|
}, [titleNode, descNode]);
|
|
75
75
|
else contentNode = titleNode || descNode;
|
|
76
|
-
if (icon
|
|
76
|
+
if (isNonNullable(icon)) contentNode = createVNode("div", {
|
|
77
77
|
"class": clsx(`${noticePrefixCls}-wrapper`, ncs?.wrapper),
|
|
78
78
|
"style": nss?.wrapper
|
|
79
79
|
}, [createVNode("div", {
|
|
80
80
|
"class": clsx(`${noticePrefixCls}-icon`, ncs?.icon),
|
|
81
81
|
"style": nss?.icon
|
|
82
82
|
}, [icon]), contentNode]);
|
|
83
|
-
const actionsNode = actions ? createVNode("div", {
|
|
83
|
+
const actionsNode = isVueRenderable(actions) ? createVNode("div", {
|
|
84
84
|
"class": clsx(`${noticePrefixCls}-actions`, ncs?.actions),
|
|
85
85
|
"style": nss?.actions
|
|
86
86
|
}, [actions]) : null;
|
|
@@ -114,6 +114,7 @@ var Notification = /* @__PURE__ */ defineComponent((props, { attrs, expose }) =>
|
|
|
114
114
|
contentNode,
|
|
115
115
|
actionsNode,
|
|
116
116
|
mergedClosable.value && createVNode("button", mergeProps({
|
|
117
|
+
"type": "button",
|
|
117
118
|
"class": clsx(`${noticePrefixCls}-close`, ncs?.close),
|
|
118
119
|
"aria-label": "Close"
|
|
119
120
|
}, closeBtnAriaProps.value, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/notification",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/antdv-next/vue-components/tree/next/packages/notification",
|
|
7
7
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"vue": "^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@v-c/util": "^1.0
|
|
32
|
+
"@v-c/util": "^1.2.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "vite build",
|