@v-c/notification 2.0.1 → 2.0.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, TransitionGroupProps } from 'vue';
|
|
2
2
|
import { Key, StackConfig } from '../interface';
|
|
3
|
-
import { ComponentsType, NotificationClassNames as NoticeClassNames,
|
|
3
|
+
import { ComponentsType, NotificationClassNames as NoticeClassNames, NotificationStyles as NoticeStyles, NotificationProps } from '../Notification';
|
|
4
4
|
export type Placement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
|
|
5
5
|
export type { StackConfig };
|
|
6
6
|
export interface NotificationListConfig extends Omit<NotificationProps, 'prefixCls'> {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import useListPosition from "../hooks/useListPosition/index.js";
|
|
2
|
-
import useStack from "../hooks/useStack.js";
|
|
3
1
|
import Notification from "../Notification.js";
|
|
4
2
|
import { useNotificationContext } from "../NotificationProvider.js";
|
|
3
|
+
import useListPosition from "../hooks/useListPosition/index.js";
|
|
4
|
+
import useStack from "../hooks/useStack.js";
|
|
5
5
|
import Content from "./Content.js";
|
|
6
6
|
import { TransitionGroup, computed, createVNode, defineComponent, isVNode, mergeProps, ref, shallowRef, toRef, watch, watchEffect } from "vue";
|
|
7
7
|
import { clsx } from "@v-c/util";
|
|
8
|
+
import { createElementRef } from "@v-c/util/dist/vnode";
|
|
8
9
|
import { unrefElement } from "@v-c/util/dist/vueuse/unref-element";
|
|
9
10
|
//#region src/NotificationList/index.tsx
|
|
10
11
|
/**
|
|
@@ -17,6 +18,9 @@ import { unrefElement } from "@v-c/util/dist/vueuse/unref-element";
|
|
|
17
18
|
* on leave without animating. Wire each phase to the correct rc-motion
|
|
18
19
|
* suffix so the opacity/transform transition runs.
|
|
19
20
|
*/
|
|
21
|
+
function _isSlot(s) {
|
|
22
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
23
|
+
}
|
|
20
24
|
function buildMotionGroupProps(name, override) {
|
|
21
25
|
return {
|
|
22
26
|
name,
|
|
@@ -31,9 +35,6 @@ function buildMotionGroupProps(name, override) {
|
|
|
31
35
|
...override
|
|
32
36
|
};
|
|
33
37
|
}
|
|
34
|
-
function _isSlot(s) {
|
|
35
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
36
|
-
}
|
|
37
38
|
var noticeSlotKeys = [
|
|
38
39
|
"wrapper",
|
|
39
40
|
"root",
|
|
@@ -120,9 +121,9 @@ var NotificationList = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
120
121
|
const notificationIndex = getIndex(keys.value, key);
|
|
121
122
|
const stackInThreshold = stackEnabled.value && notificationIndex !== void 0 && notificationIndex < (stackParams.threshold?.value ?? 0);
|
|
122
123
|
return createVNode(Notification, mergeProps({ "key": strKey }, notificationConfig, {
|
|
123
|
-
"ref": (
|
|
124
|
-
setNodeSize(strKey,
|
|
125
|
-
},
|
|
124
|
+
"ref": createElementRef((node) => {
|
|
125
|
+
setNodeSize(strKey, node ?? null);
|
|
126
|
+
}, (el) => unrefElement(el?.nativeElement) ?? null),
|
|
126
127
|
"prefixCls": prefixCls,
|
|
127
128
|
"class": clsx(ctx.value?.classNames?.notice, configClassName),
|
|
128
129
|
"style": configStyle,
|
package/dist/Notifications.js
CHANGED
|
@@ -89,7 +89,7 @@ var Notifications = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
89
89
|
})) ? _slot : { default: () => [_slot] });
|
|
90
90
|
};
|
|
91
91
|
}, {
|
|
92
|
-
props:
|
|
92
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
93
93
|
prefixCls: {
|
|
94
94
|
type: String,
|
|
95
95
|
required: false,
|
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/notification",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/antdv-next/vue-components/tree/next/packages/notification",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/antdv-next/vue-components.git"
|
|
10
|
+
},
|
|
5
11
|
"publishConfig": {
|
|
6
12
|
"access": "public"
|
|
7
13
|
},
|
|
@@ -23,7 +29,7 @@
|
|
|
23
29
|
"vue": "^3.0.0"
|
|
24
30
|
},
|
|
25
31
|
"dependencies": {
|
|
26
|
-
"@v-c/util": "^1.0.
|
|
32
|
+
"@v-c/util": "^1.0.20"
|
|
27
33
|
},
|
|
28
34
|
"scripts": {
|
|
29
35
|
"build": "vite build",
|