@v-c/notification 2.0.0-rc.1 → 2.0.0-rc.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.
@@ -92,7 +92,7 @@ var NotificationList = /* @__PURE__ */ defineComponent((props, { attrs }) => {
92
92
  let motionGroupProps = {};
93
93
  if (placementMotion.value) motionGroupProps = getTransitionGroupProps(placementMotion.value.name, placementMotion.value);
94
94
  const renderItems = () => keys.value.map((config) => {
95
- const { key, placement: _itemPlacement, classNames: configClassNames, styles: configStyles, className: configClassName, style: configStyle, ...notificationConfig } = config;
95
+ const { key, placement: _itemPlacement, classNames: configClassNames, styles: configStyles, className: configClassName, style: configStyle, onClose: configOnClose, ...notificationConfig } = config;
96
96
  const strKey = String(key);
97
97
  const notificationIndex = getIndex(keys.value, key);
98
98
  const stackInThreshold = stackEnabled.value && notificationIndex !== void 0 && notificationIndex < (stackParams.threshold?.value ?? 0);
@@ -115,7 +115,7 @@ var NotificationList = /* @__PURE__ */ defineComponent((props, { attrs }) => {
115
115
  "notificationIndex": notificationIndex,
116
116
  "stackInThreshold": stackInThreshold,
117
117
  "onClose": () => {
118
- config.onClose?.();
118
+ configOnClose?.();
119
119
  onNoticeClose?.(key);
120
120
  }
121
121
  }), null);
@@ -145,10 +145,7 @@ var NotificationList = /* @__PURE__ */ defineComponent((props, { attrs }) => {
145
145
  "topNoticeWidth": positionResult.topNoticeWidth,
146
146
  "className": ncs?.listContent,
147
147
  "style": nss?.listContent
148
- }, { default: () => [createVNode(TransitionGroup, mergeProps({
149
- "tag": false,
150
- "appear": true
151
- }, motionGroupProps, { "onAfterLeave": checkAllClosed }), _isSlot(_slot = renderItems()) ? _slot : { default: () => [_slot] })] })]);
148
+ }, { default: () => [createVNode(TransitionGroup, mergeProps({ "appear": true }, motionGroupProps, { "onAfterLeave": checkAllClosed }), _isSlot(_slot = renderItems()) ? _slot : { default: () => [_slot] })] })]);
152
149
  };
153
150
  }, {
154
151
  props: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/notification",
3
3
  "type": "module",
4
- "version": "2.0.0-rc.1",
4
+ "version": "2.0.0-rc.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -191,7 +191,20 @@ const NotificationList = defineComponent<NotificationListProps>(
191
191
 
192
192
  const renderItems = () =>
193
193
  keys.value.map((config) => {
194
- const { key, placement: _itemPlacement, classNames: configClassNames, styles: configStyles, className: configClassName, style: configStyle, ...notificationConfig } = config
194
+ const {
195
+ key,
196
+ placement: _itemPlacement,
197
+ classNames: configClassNames,
198
+ styles: configStyles,
199
+ className: configClassName,
200
+ style: configStyle,
201
+ // Extract onClose so the spread below does not also bind it.
202
+ // Vue would otherwise merge our `onClose={...}` and the spread's
203
+ // `onClose` into an Array, breaking `props.onClose?.()` in the
204
+ // notice itself.
205
+ onClose: configOnClose,
206
+ ...notificationConfig
207
+ } = config
195
208
  const strKey = String(key)
196
209
  const notificationIndex = getIndex(keys.value, key)
197
210
  const stackInThreshold
@@ -220,7 +233,7 @@ const NotificationList = defineComponent<NotificationListProps>(
220
233
  notificationIndex={notificationIndex}
221
234
  stackInThreshold={stackInThreshold}
222
235
  onClose={() => {
223
- (config as NotificationListConfig).onClose?.()
236
+ configOnClose?.()
224
237
  onNoticeClose?.(key)
225
238
  }}
226
239
  />
@@ -261,7 +274,6 @@ const NotificationList = defineComponent<NotificationListProps>(
261
274
  style={nss?.listContent}
262
275
  >
263
276
  <TransitionGroup
264
- tag={false as any}
265
277
  appear
266
278
  {...motionGroupProps}
267
279
  onAfterLeave={checkAllClosed}