@v-c/dialog 1.1.0 → 1.1.1

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.
@@ -12,9 +12,5 @@ export interface PanelProps extends Omit<IDialogPropTypes, 'getOpenCount'> {
12
12
  export interface ContentRef {
13
13
  focus: () => void;
14
14
  }
15
- declare const Panel: import('vue').DefineSetupFnComponent<PanelProps & {
16
- animationVisible: boolean;
17
- }, {}, {}, PanelProps & {
18
- animationVisible: boolean;
19
- } & {}, import('vue').PublicProps>;
15
+ declare const Panel: import('vue').DefineSetupFnComponent<PanelProps, {}, {}, PanelProps & {}, import('vue').PublicProps>;
20
16
  export default Panel;
@@ -20,7 +20,7 @@ var Panel = /* @__PURE__ */ defineComponent((props, { expose, slots }) => {
20
20
  internalRef.value?.focus?.({ preventScroll: true });
21
21
  } });
22
22
  return () => {
23
- const { width, height, footer, prefixCls, classNames: modalClassNames, styles: modalStyles, title, closable, closeIcon, bodyProps, bodyStyle, ariaId, style, className, forceRender, onClose, onMouseDown, onMouseUp, modalRender, animationVisible } = props;
23
+ const { width, height, footer, prefixCls, classNames: modalClassNames, styles: modalStyles, title, closable, closeIcon, bodyProps, bodyStyle, ariaId, style, className, forceRender, onClose, onMouseDown, onMouseUp, modalRender } = props;
24
24
  const contentStyle = {};
25
25
  if (width !== void 0) contentStyle.width = getStylePxValue(width);
26
26
  if (height !== void 0) contentStyle.height = getStylePxValue(height);
@@ -69,7 +69,6 @@ var Panel = /* @__PURE__ */ defineComponent((props, { expose, slots }) => {
69
69
  footerNode
70
70
  ]);
71
71
  const renderContent = () => {
72
- if (!animationVisible && forceRender) return null;
73
72
  return modalRender ? modalRender(content) : content;
74
73
  };
75
74
  return createVNode("div", mergeProps({
@@ -349,10 +348,6 @@ var Panel = /* @__PURE__ */ defineComponent((props, { expose, slots }) => {
349
348
  panelRef: {
350
349
  required: false,
351
350
  default: void 0
352
- },
353
- animationVisible: {
354
- type: Boolean,
355
- required: true
356
351
  }
357
352
  },
358
353
  name: "Panel",
@@ -1,6 +1,6 @@
1
1
  import { offset } from "../../util.js";
2
2
  import Panel from "./Panel.js";
3
- import { Transition, createVNode, defineComponent, mergeProps, nextTick, shallowRef, vShow, watch, withDirectives } from "vue";
3
+ import { Transition, createVNode, defineComponent, mergeProps, nextTick, shallowRef, vShow, withDirectives } from "vue";
4
4
  import { getTransitionProps } from "@v-c/util/dist/utils/transition";
5
5
  //#region src/Dialog/Content/index.tsx
6
6
  var Content = /* @__PURE__ */ defineComponent((props, { slots }) => {
@@ -15,12 +15,8 @@ var Content = /* @__PURE__ */ defineComponent((props, { slots }) => {
15
15
  }
16
16
  });
17
17
  }
18
- const animationVisible = shallowRef(props.visible);
19
- watch(() => props.visible, () => {
20
- if (props.visible) animationVisible.value = true;
21
- });
22
18
  return () => {
23
- const { prefixCls, className, style, visible, destroyOnHidden, onVisibleChanged, ariaId, title, motionName } = props;
19
+ const { prefixCls, className, style, visible, destroyOnHidden, onVisibleChanged, ariaId, title, motionName, forceRender } = props;
24
20
  const contentStyle = {};
25
21
  if (transformOrigin.value) contentStyle.transformOrigin = transformOrigin.value;
26
22
  return createVNode(Transition, mergeProps(getTransitionProps(motionName), {
@@ -28,10 +24,8 @@ var Content = /* @__PURE__ */ defineComponent((props, { slots }) => {
28
24
  "onAfterEnter": () => onVisibleChanged?.(true),
29
25
  "onAfterLeave": () => {
30
26
  onVisibleChanged?.(false);
31
- animationVisible.value = false;
32
27
  }
33
- }), { default: () => [visible || !destroyOnHidden ? withDirectives(createVNode(Panel, mergeProps(props, {
34
- "animationVisible": animationVisible.value,
28
+ }), { default: () => [visible || !destroyOnHidden || forceRender ? withDirectives(createVNode(Panel, mergeProps(props, {
35
29
  "title": title,
36
30
  "ariaId": ariaId,
37
31
  "prefixCls": prefixCls,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/dialog",
3
3
  "type": "module",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -25,8 +25,8 @@
25
25
  "vue": "^3.0.0"
26
26
  },
27
27
  "dependencies": {
28
- "@v-c/portal": "^1.0.8",
29
- "@v-c/util": "^1.0.19"
28
+ "@v-c/util": "^1.0.19",
29
+ "@v-c/portal": "^1.0.8"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "vite build",