@fiscozen/dialog 0.1.17 → 0.1.19

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.
Files changed (2) hide show
  1. package/package.json +8 -7
  2. package/src/FzDialog.vue +7 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiscozen/dialog",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Design System Dialog component",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -9,9 +9,9 @@
9
9
  "peerDependencies": {
10
10
  "tailwindcss": "^3.4.1",
11
11
  "vue": "^3.4.13",
12
- "@fiscozen/composables": "^0.1.25",
13
- "@fiscozen/style": "^0.1.1",
14
- "@fiscozen/button": "^0.1.6"
12
+ "@fiscozen/composables": "^0.1.29",
13
+ "@fiscozen/button": "^0.1.7",
14
+ "@fiscozen/style": "^0.1.1"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@fortawesome/fontawesome-svg-core": "^6.5.1",
@@ -32,12 +32,13 @@
32
32
  "vitest": "^1.2.0",
33
33
  "vue-tsc": "^1.8.25",
34
34
  "@fiscozen/eslint-config": "^0.1.0",
35
- "@fiscozen/tsconfig": "^0.1.0",
36
- "@fiscozen/prettier-config": "^0.1.0"
35
+ "@fiscozen/prettier-config": "^0.1.0",
36
+ "@fiscozen/tsconfig": "^0.1.0"
37
37
  },
38
38
  "license": "MIT",
39
39
  "dependencies": {
40
- "@fiscozen/composables": "^0.1.25"
40
+ "dialog-polyfill": "^0.5.6",
41
+ "@fiscozen/composables": "^0.1.29"
41
42
  },
42
43
  "scripts": {
43
44
  "coverage": "vitest run --coverage",
package/src/FzDialog.vue CHANGED
@@ -34,6 +34,8 @@ import { computed, ref, watch } from "vue";
34
34
  import { FzDialogProps } from "./types";
35
35
  import { useKeyUp } from "@fiscozen/composables";
36
36
  import { useClickOutside } from "@fiscozen/composables";
37
+ import dialogPolyfill from 'dialog-polyfill';
38
+ import 'dialog-polyfill/dist/dialog-polyfill.css';
37
39
 
38
40
  const props = withDefaults(defineProps<FzDialogProps>(), {
39
41
  size: "md",
@@ -56,6 +58,7 @@ const showModal = () => {
56
58
  }, 100);
57
59
 
58
60
  if (props.shouldAlwaysRender) {
61
+ dialogPolyfill.registerDialog(dialog.value!);
59
62
  dialog.value!.show();
60
63
  visible.value = true;
61
64
  } else {
@@ -64,7 +67,7 @@ const showModal = () => {
64
67
  };
65
68
 
66
69
  const closeModal = (returnVal?: string) => {
67
- dialog.value!.close(returnVal);
70
+ dialog.value?.close(returnVal);
68
71
  };
69
72
 
70
73
  function handleModalClose() {
@@ -76,6 +79,7 @@ function handleModalClose() {
76
79
 
77
80
  watch(dialog, (dialog) => {
78
81
  if (dialog && shouldRender.value) {
82
+ dialogPolyfill.registerDialog(dialog);
79
83
  dialog.show();
80
84
  visible.value = true;
81
85
  }
@@ -107,13 +111,8 @@ const handleKeyUp = (e: KeyboardEvent) => {
107
111
 
108
112
  useKeyUp(handleKeyUp);
109
113
 
110
- const staticClasses = ["flex", "flex-col", "bg-core-white"];
111
-
112
- const dialogStaticClasses = {
113
- "border-1": true,
114
- rounded: true,
115
- "border-grey-100": true,
116
- };
114
+ const staticClasses = "flex flex-col bg-core-white";
115
+ const dialogStaticClasses = "border-1 rounded border-grey-100 p-0";
117
116
 
118
117
  const dialogClasses = computed(() => {
119
118
  let res: string[] = [];