@fiscozen/dialog 0.1.16 → 0.1.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiscozen/dialog",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Design System Dialog component",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -9,8 +9,8 @@
9
9
  "peerDependencies": {
10
10
  "tailwindcss": "^3.4.1",
11
11
  "vue": "^3.4.13",
12
- "@fiscozen/style": "^0.1.1",
13
12
  "@fiscozen/composables": "^0.1.25",
13
+ "@fiscozen/style": "^0.1.1",
14
14
  "@fiscozen/button": "^0.1.6"
15
15
  },
16
16
  "devDependencies": {
@@ -31,8 +31,8 @@
31
31
  "vite-plugin-dts": "^3.8.3",
32
32
  "vitest": "^1.2.0",
33
33
  "vue-tsc": "^1.8.25",
34
- "@fiscozen/tsconfig": "^0.1.0",
35
34
  "@fiscozen/eslint-config": "^0.1.0",
35
+ "@fiscozen/tsconfig": "^0.1.0",
36
36
  "@fiscozen/prettier-config": "^0.1.0"
37
37
  },
38
38
  "license": "MIT",
@@ -65,8 +65,7 @@ const props = withDefaults(defineProps<FzConfirmDialogProps>(), {
65
65
  disableConfirm: false,
66
66
  confirmButtonEnabled: true,
67
67
  doesCancelButtonCloseDialog: true,
68
- doesConfirmButtonCloseDialog: true,
69
- unrenderOnClose: true
68
+ doesConfirmButtonCloseDialog: true
70
69
  });
71
70
  const emit = defineEmits(["fzmodal:confirm", "fzmodal:cancel"]);
72
71
 
package/src/FzDialog.vue CHANGED
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- v-if="shouldRender || !props.unrenderOnClose"
3
+ v-if="shouldRender || shouldAlwaysRender"
4
4
  ref="backdrop"
5
5
  v-show="visible"
6
6
  class="fz-dialog__backdrop w-screen h-screen fixed flex flex-col items-center justify-start sm:justify-center z-30">
@@ -37,8 +37,7 @@ import { useClickOutside } from "@fiscozen/composables";
37
37
 
38
38
  const props = withDefaults(defineProps<FzDialogProps>(), {
39
39
  size: "md",
40
- closeOnBackdrop: true,
41
- unrenderOnClose: true
40
+ closeOnBackdrop: true
42
41
  });
43
42
  const emit = defineEmits(["fzmodal:cancel"]);
44
43
 
@@ -56,11 +55,11 @@ const showModal = () => {
56
55
  backdropClickTimeout = false;
57
56
  }, 100);
58
57
 
59
- if (props.unrenderOnClose) {
60
- shouldRender.value = true;
61
- } else {
58
+ if (props.shouldAlwaysRender) {
62
59
  dialog.value!.show();
63
60
  visible.value = true;
61
+ } else {
62
+ shouldRender.value = true;
64
63
  }
65
64
  };
66
65
 
@@ -70,7 +69,7 @@ const closeModal = (returnVal?: string) => {
70
69
 
71
70
  function handleModalClose() {
72
71
  visible.value = false;
73
- if (props.unrenderOnClose) {
72
+ if (!props.shouldAlwaysRender) {
74
73
  shouldRender.value = false;
75
74
  }
76
75
  }
package/src/types.ts CHANGED
@@ -40,9 +40,9 @@ export type FzDialogProps = {
40
40
  | Record<string, boolean | undefined>
41
41
  | Array<string | Record<string, boolean | undefined>>;
42
42
  /**
43
- * Whether the component gets unrendered on close
43
+ * Whether the component is rendered even when closed
44
44
  */
45
- unrenderOnClose?: boolean;
45
+ shouldAlwaysRender?: boolean;
46
46
  };
47
47
 
48
48
  export type FzConfirmDialogProps = FzDialogProps & {