srcdev-nuxt-components 1.0.3 → 1.0.4

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,5 +1,5 @@
1
1
  <template>
2
- <dialog class="display-dialog-core" :class="[variant, elementClasses]" :align-dialog :open ref="dialogRef">
2
+ <dialog class="display-dialog-core" :class="[variant, elementClasses]" role="dialog" :align-dialog :open :data-dialog-id="dataDialogId" ref="dialogRef">
3
3
  <focus-trap v-model:active="open" :clickOutsideDeactivates="true" @deactivate="closeDialog()">
4
4
  <div class="inner">
5
5
  <div class="header">
@@ -58,6 +58,10 @@ const props = defineProps({
58
58
  type: Boolean,
59
59
  default: false,
60
60
  },
61
+ dataDialogId: {
62
+ type: String,
63
+ required: true,
64
+ },
61
65
  });
62
66
 
63
67
  const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <DisplayDialogCore variant="confirm" :styleClassPassthrough :lockViewport="true">
2
+ <DisplayDialogCore variant="confirm" :styleClassPassthrough :lockViewport="true" :dataDialogId>
3
3
  <template #dialogTitle>
4
4
  <slot name="dialogTitle">
5
5
  <p class="text-normal wght-700">Confirm</p>
@@ -21,6 +21,10 @@ const props = defineProps({
21
21
  type: Array as PropType<string[]>,
22
22
  default: () => [],
23
23
  },
24
+ dataDialogId: {
25
+ type: String,
26
+ required: true,
27
+ },
24
28
  });
25
29
  </script>
26
30
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <DisplayDialogCore variant="dialog" :styleClassPassthrough :lockViewport="true" :allowContentScroll>
2
+ <DisplayDialogCore variant="dialog" :styleClassPassthrough :lockViewport="true" :allowContentScroll :dataDialogId>
3
3
  <template #dialogTitle>
4
4
  <slot name="dialogTitle">
5
5
  <p class="text-normal wght-700">Confirm</p>
@@ -25,6 +25,10 @@ const props = defineProps({
25
25
  type: Boolean,
26
26
  default: false,
27
27
  },
28
+ dataDialogId: {
29
+ type: String,
30
+ required: true,
31
+ },
28
32
  });
29
33
  </script>
30
34
 
@@ -0,0 +1,23 @@
1
+ export const useDialogControls = () => {
2
+ interface DialogConfig {
3
+ [key: string]: boolean;
4
+ }
5
+
6
+ const dialogsConfig = reactive<DialogConfig>({});
7
+
8
+ function initialiseDialogs(dialogIds: string[]) {
9
+ dialogIds.forEach((id) => {
10
+ dialogsConfig[id] = false;
11
+ });
12
+ }
13
+
14
+ const controlDialogs = (name: string, state: boolean) => {
15
+ dialogsConfig[name] = state;
16
+ };
17
+
18
+ return {
19
+ dialogsConfig,
20
+ controlDialogs,
21
+ initialiseDialogs,
22
+ };
23
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "main": "nuxt.config.ts",
6
6
  "scripts": {
7
7
  "clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",