iconograph-ui 1.2.15 → 1.2.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/index.js +4 -0
- package/lib/layout/Modal.svelte +92 -0
- package/lib/user/SelectUserInput.svelte +6 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -9,11 +9,13 @@ import MainMenu from "./lib/navigation/MainMenu.svelte"
|
|
|
9
9
|
import Button from "./lib/navigation/Button.svelte"
|
|
10
10
|
import Notification from "./lib/notification/Notification.svelte";
|
|
11
11
|
import NotificationWrapper from "./lib/notification/NotificationWrapper.svelte";
|
|
12
|
+
import { addNotification } from "./lib/notification/NotificationWrapper.svelte";
|
|
12
13
|
import Table from "./lib/table/Table.svelte"
|
|
13
14
|
import CellLink from "./lib/table/CellLink.svelte"
|
|
14
15
|
import UserPicture from "./lib/user/UserPicture.svelte";
|
|
15
16
|
import NavBar from "./lib/navigation/NavBar.svelte";
|
|
16
17
|
import SelectUserInput from "./lib/user/SelectUserInput.svelte";
|
|
18
|
+
import Modal from "./lib/layout/Modal.svelte"
|
|
17
19
|
|
|
18
20
|
export {
|
|
19
21
|
Button,
|
|
@@ -32,4 +34,6 @@ export {
|
|
|
32
34
|
UserPicture,
|
|
33
35
|
NavBar,
|
|
34
36
|
SelectUserInput,
|
|
37
|
+
Modal,
|
|
38
|
+
addNotification,
|
|
35
39
|
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Portal from 'svelte-portal';
|
|
3
|
+
|
|
4
|
+
export let open = true;
|
|
5
|
+
|
|
6
|
+
function handleClose() {
|
|
7
|
+
open = false;
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
{#if open}
|
|
12
|
+
|
|
13
|
+
<Portal target="body" >
|
|
14
|
+
<div id="bgk" class="{!open ? 'hidden' : ''}">
|
|
15
|
+
<div class="container">
|
|
16
|
+
<div on:click|stopPropagation|preventDefault={handleClose} class="croix">+</div>
|
|
17
|
+
|
|
18
|
+
<slot></slot>
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</Portal>
|
|
23
|
+
|
|
24
|
+
{/if}
|
|
25
|
+
|
|
26
|
+
<style>
|
|
27
|
+
#bgk {
|
|
28
|
+
position: fixed;
|
|
29
|
+
top: 0px;
|
|
30
|
+
left: 0px;
|
|
31
|
+
width: 100vw;
|
|
32
|
+
height: 100vh;
|
|
33
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
transition: all ease-in-out 0.35s;
|
|
38
|
+
@starting-style {
|
|
39
|
+
opacity: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
#bgk.hidden {
|
|
43
|
+
opacity: 0;
|
|
44
|
+
@starting-style {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
#bgk .container {
|
|
49
|
+
max-width: calc(100% - 48px);
|
|
50
|
+
max-height: calc(100vh - 48px);
|
|
51
|
+
min-width: 300px;
|
|
52
|
+
min-height: 200px;
|
|
53
|
+
background-color: var(--main-bg-color);
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
border-radius: 16px;
|
|
56
|
+
overflow: auto;
|
|
57
|
+
position: relative;
|
|
58
|
+
top: 0vh;
|
|
59
|
+
transition: all ease-in-out 0.3s;
|
|
60
|
+
@starting-style {
|
|
61
|
+
top: -300px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
#bgk.hidden .container {
|
|
65
|
+
top: -300px;
|
|
66
|
+
@starting-style {
|
|
67
|
+
top: 0vh;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
.croix {
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
margin-left: 8px;
|
|
73
|
+
height: 24px;
|
|
74
|
+
width: 24px;
|
|
75
|
+
min-width: 24px;
|
|
76
|
+
background-color: #ddd;
|
|
77
|
+
border-radius: 20px;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
font-size: 20px;
|
|
80
|
+
text-align: center;
|
|
81
|
+
line-height: 24px;
|
|
82
|
+
color: #777;
|
|
83
|
+
transform: rotate(45deg);
|
|
84
|
+
transition: all ease-in-out 0.14s;
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 8px;
|
|
87
|
+
right: 8px;
|
|
88
|
+
}
|
|
89
|
+
.croix:hover {
|
|
90
|
+
background-color: #ccc;
|
|
91
|
+
}
|
|
92
|
+
</style>
|
|
@@ -3,23 +3,22 @@
|
|
|
3
3
|
import UserSelect from "./UserSelect.svelte";
|
|
4
4
|
import UserPicture from './UserPicture.svelte';
|
|
5
5
|
|
|
6
|
-
let user;
|
|
7
6
|
export let name;
|
|
8
|
-
export
|
|
7
|
+
export let value;
|
|
9
8
|
|
|
10
9
|
function handleRemove() {
|
|
11
|
-
|
|
10
|
+
value = undefined;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
</script>
|
|
15
14
|
|
|
16
15
|
<div id="single-select-wrapper" name={name} >
|
|
17
|
-
{#if !
|
|
18
|
-
<UserSelect uri={'/user'} bind:selected={
|
|
16
|
+
{#if !value}
|
|
17
|
+
<UserSelect uri={'/user'} bind:selected={value} ></UserSelect>
|
|
19
18
|
{:else}
|
|
20
19
|
<div>
|
|
21
|
-
<UserPicture size={24} user={
|
|
22
|
-
<span>{
|
|
20
|
+
<UserPicture size={24} user={value}></UserPicture>
|
|
21
|
+
<span>{value.firstname} {value.lastname}</span>
|
|
23
22
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
24
23
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
25
24
|
<div on:click={handleRemove}>+</div>
|