@v-c/notification 2.0.3 → 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.
@@ -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 !== void 0 && title !== null ? createVNode("div", {
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 !== void 0 && description !== null ? createVNode("div", {
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 !== void 0 && icon !== null) contentNode = createVNode("div", {
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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/notification",
3
3
  "type": "module",
4
- "version": "2.0.3",
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.1.0"
32
+ "@v-c/util": "^1.2.0"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "vite build",