hamzus-ui 0.0.38 → 0.0.40
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
|
@@ -8,6 +8,7 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
8
8
|
export let triggerFullWidth = false;
|
|
9
9
|
export let direction = 'bottom';
|
|
10
10
|
export let onOpen = undefined;
|
|
11
|
+
export let avoidOpening = false
|
|
11
12
|
// locale var
|
|
12
13
|
let display = false;
|
|
13
14
|
let exit = false;
|
|
@@ -30,8 +31,12 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
30
31
|
};
|
|
31
32
|
// function
|
|
32
33
|
function handleDisplay(e) {
|
|
34
|
+
if (avoidOpening) {
|
|
35
|
+
return
|
|
36
|
+
}
|
|
33
37
|
if (!calc[direction]) {
|
|
34
38
|
console.error('Error : direction props not found !');
|
|
39
|
+
return
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
if (!display) {
|
|
@@ -63,6 +68,21 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
63
68
|
display = !display;
|
|
64
69
|
}
|
|
65
70
|
|
|
71
|
+
export let open = ()=>{
|
|
72
|
+
if (display) {
|
|
73
|
+
return
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
toggleDisplay()
|
|
77
|
+
}
|
|
78
|
+
export let close = ()=>{
|
|
79
|
+
if (!display) {
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
toggleDisplay()
|
|
84
|
+
}
|
|
85
|
+
|
|
66
86
|
const calc = {
|
|
67
87
|
bottom: () => {
|
|
68
88
|
// recuperer la taille du content
|