@humandialog/forms.svelte 1.1.5 → 1.1.6
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/console.svelte +1 -1
- package/desk.svelte +45 -16
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
- package/stores.d.ts +3 -0
- package/stores.js +9 -0
- package/tenant.members.svelte +12 -29
package/console.svelte
CHANGED
package/desk.svelte
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import Configurable from './internal/configurable.content.svelte'
|
|
5
5
|
import Operations from './operations.svelte'
|
|
6
6
|
import Fab from './components/Fab.svelte'
|
|
7
|
+
import {Alert} from 'flowbite-svelte'
|
|
7
8
|
|
|
8
9
|
import {main_sidebar_visible_store,
|
|
9
10
|
tools_visible_store,
|
|
@@ -15,26 +16,15 @@
|
|
|
15
16
|
set_default_tools_visible,
|
|
16
17
|
set_dark_mode_default,
|
|
17
18
|
sidebar_left_pos,
|
|
18
|
-
wholeAppReloader
|
|
19
|
+
wholeAppReloader,
|
|
20
|
+
alerts } from './stores.js'
|
|
19
21
|
|
|
20
|
-
import { AuthorizedView} from '@humandialog/auth.svelte'
|
|
21
|
-
import { handleSelect, isDeviceSmallerThan } from './utils'
|
|
22
|
-
|
|
22
|
+
//import { AuthorizedView} from '@humandialog/auth.svelte'
|
|
23
|
+
import { handleSelect, isDeviceSmallerThan, removeAt } from './utils'
|
|
24
|
+
import { afterUpdate, onMount } from 'svelte';
|
|
23
25
|
|
|
24
26
|
export let layout;
|
|
25
27
|
|
|
26
|
-
onMount( () => {
|
|
27
|
-
window.addEventListener('resize', on_resize)
|
|
28
|
-
return () => {
|
|
29
|
-
window.removeEventListener('resize', on_resize)
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
function on_resize()
|
|
34
|
-
{
|
|
35
|
-
auto_hide_sidebar();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
28
|
const sizes = {
|
|
39
29
|
bottom: 240,
|
|
40
30
|
toolbar: 40,
|
|
@@ -163,6 +153,22 @@
|
|
|
163
153
|
document.body.className = $dark_mode_store;
|
|
164
154
|
}
|
|
165
155
|
|
|
156
|
+
onMount( () => {
|
|
157
|
+
window.addEventListener('resize', on_resize)
|
|
158
|
+
return () => {
|
|
159
|
+
window.removeEventListener('resize', on_resize)
|
|
160
|
+
|
|
161
|
+
// remove dark class form body element when we leave Layout view
|
|
162
|
+
if($dark_mode_store)
|
|
163
|
+
document.body.classList.remove($dark_mode_store)
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
function on_resize()
|
|
168
|
+
{
|
|
169
|
+
auto_hide_sidebar();
|
|
170
|
+
}
|
|
171
|
+
|
|
166
172
|
</script>
|
|
167
173
|
|
|
168
174
|
<svelte:window bind:innerWidth bind:outerWidth bind:innerHeight bind:outerHeight />
|
|
@@ -278,6 +284,29 @@
|
|
|
278
284
|
|
|
279
285
|
</div>
|
|
280
286
|
|
|
287
|
+
<!--##########################################################-->
|
|
288
|
+
<!--## ALERTS ###############################################-->
|
|
289
|
+
<!--##########################################################-->
|
|
290
|
+
<section class="absolute left-2 sm:left-auto sm:right-2 bottom-2 flex flex-col gap-2">
|
|
291
|
+
{#if $alerts && $alerts.length > 0}
|
|
292
|
+
{#each $alerts as alert, idx}
|
|
293
|
+
<Alert class="bg-red-900/40 shadow-lg shadow-stone-400 dark:shadow-black flex flex-row">
|
|
294
|
+
<button class="sm:hidden font-bold ml-auto"
|
|
295
|
+
on:click={() => {$alerts = removeAt($alerts, idx)}}>
|
|
296
|
+
x
|
|
297
|
+
</button>
|
|
298
|
+
<p>
|
|
299
|
+
{alert}
|
|
300
|
+
</p>
|
|
301
|
+
<button class="hidden sm:block font-bold ml-auto"
|
|
302
|
+
on:click={() => {$alerts = removeAt($alerts, idx)}}>
|
|
303
|
+
x
|
|
304
|
+
</button>
|
|
305
|
+
</Alert>
|
|
306
|
+
{/each}
|
|
307
|
+
{/if}
|
|
308
|
+
</section>
|
|
309
|
+
|
|
281
310
|
<!-- #########################################################-->
|
|
282
311
|
<!-- ## MODAL DIALOG #########################################-->
|
|
283
312
|
<!-- #########################################################-->
|
package/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export { default as KanbanTagsProperty } from './components/kanban/kanban.tags.s
|
|
|
53
53
|
export { default as KanbanCallbacks } from './components/kanban/kanban.callbacks.svelte';
|
|
54
54
|
export { KanbanColumnTop, KanbanColumnBottom } from './components/kanban/Kanban';
|
|
55
55
|
export { selectItem, activateItem, clearActiveItem, isActive, isSelected, getActive, editable, startEditing, saveCurrentEditable, selectable, handleSelect, isDeviceSmallerThan } from './utils';
|
|
56
|
-
export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp } from './stores.js';
|
|
56
|
+
export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp, alerts, addAlert, onErrorShowAlert } from './stores.js';
|
|
57
57
|
export { data_tick_store, // tmp
|
|
58
58
|
hasSelectedItem, hasDataItem, setNavigatorTitle } from "./stores";
|
|
59
59
|
export { contextToolbarOperations, pageToolbarOperations, contextItemsStore, contextTypesStore } from './stores';
|
package/index.js
CHANGED
|
@@ -59,7 +59,7 @@ export { default as KanbanTagsProperty } from './components/kanban/kanban.tags.s
|
|
|
59
59
|
export { default as KanbanCallbacks } from './components/kanban/kanban.callbacks.svelte';
|
|
60
60
|
export { KanbanColumnTop, KanbanColumnBottom } from './components/kanban/Kanban';
|
|
61
61
|
export { selectItem, activateItem, clearActiveItem, isActive, isSelected, getActive, editable, startEditing, saveCurrentEditable, selectable, handleSelect, isDeviceSmallerThan } from './utils';
|
|
62
|
-
export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp } from './stores.js';
|
|
62
|
+
export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp, alerts, addAlert, onErrorShowAlert } from './stores.js';
|
|
63
63
|
export { data_tick_store, // tmp
|
|
64
64
|
hasSelectedItem, hasDataItem, setNavigatorTitle } from "./stores";
|
|
65
65
|
export { contextToolbarOperations, pageToolbarOperations, contextItemsStore, contextTypesStore } from './stores'; // tmp
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humandialog/forms.svelte",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Basic Svelte UI components for Object Reef applications",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@playwright/test": "^1.28.1",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@humandialog/auth.svelte": "^1.8.
|
|
29
|
+
"@humandialog/auth.svelte": "^1.8.3",
|
|
30
30
|
"flowbite-svelte": "^0.44.4",
|
|
31
31
|
"svelte-icons": "^2.1.0",
|
|
32
32
|
"svelte-spa-router": "^4.0.1"
|
package/stores.d.ts
CHANGED
|
@@ -31,6 +31,9 @@ export const page_title: import("svelte/store").Writable<string>;
|
|
|
31
31
|
export const nav_titles: import("svelte/store").Writable<{}>;
|
|
32
32
|
export const mainContentPageReloader: import("svelte/store").Writable<number>;
|
|
33
33
|
export const wholeAppReloader: import("svelte/store").Writable<number>;
|
|
34
|
+
export const alerts: import("svelte/store").Writable<never[]>;
|
|
35
|
+
export function addAlert(txt: any): void;
|
|
36
|
+
export function onErrorShowAlert(txt: any): void;
|
|
34
37
|
export const dark_mode_store: import("svelte/store").Writable<any>;
|
|
35
38
|
export const main_sidebar_visible_store: import("svelte/store").Writable<any>;
|
|
36
39
|
export let previously_visible_sidebar: string;
|
package/stores.js
CHANGED
|
@@ -12,6 +12,15 @@ export const page_title = writable('');
|
|
|
12
12
|
export const nav_titles = writable({});
|
|
13
13
|
export const mainContentPageReloader = writable(1);
|
|
14
14
|
export const wholeAppReloader = writable(1)
|
|
15
|
+
export const alerts = writable([])
|
|
16
|
+
|
|
17
|
+
export const addAlert = (txt) => {
|
|
18
|
+
let al = get(alerts)
|
|
19
|
+
al = [txt, ...al];
|
|
20
|
+
alerts.set(al);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const onErrorShowAlert = addAlert;
|
|
15
24
|
|
|
16
25
|
export function setNavigatorTitle(key, title)
|
|
17
26
|
{
|
package/tenant.members.svelte
CHANGED
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
import Combo from './components/combo/combo.svelte'
|
|
19
19
|
import Modal from './modal.svelte'
|
|
20
20
|
import Checkbox from './components/checkbox.svelte';
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
import { reef, session, signInHRef } from '@humandialog/auth.svelte';
|
|
23
23
|
import { ComboSource } from './';
|
|
24
|
-
import {removeAt} from './utils'
|
|
25
24
|
import {showMenu} from './components/menu'
|
|
25
|
+
import {onErroronErrorAddAlert} from './stores'
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
// ==============================================================================
|
|
@@ -202,8 +202,7 @@
|
|
|
202
202
|
else
|
|
203
203
|
{
|
|
204
204
|
const err_msg = await res.text();
|
|
205
|
-
|
|
206
|
-
alerts = [...alerts];
|
|
205
|
+
onErrorShowAlert(err_msg);
|
|
207
206
|
return false;
|
|
208
207
|
}
|
|
209
208
|
}
|
|
@@ -230,8 +229,7 @@
|
|
|
230
229
|
else
|
|
231
230
|
{
|
|
232
231
|
const err_msg = await res.text();
|
|
233
|
-
|
|
234
|
-
alerts = [...alerts];
|
|
232
|
+
onErrorShowAlert(err_msg)
|
|
235
233
|
return false;
|
|
236
234
|
}
|
|
237
235
|
}
|
|
@@ -259,7 +257,7 @@
|
|
|
259
257
|
else
|
|
260
258
|
{
|
|
261
259
|
const err_msg = await res.text();
|
|
262
|
-
|
|
260
|
+
onErrorShowAlert(err_msg);
|
|
263
261
|
return false;
|
|
264
262
|
}
|
|
265
263
|
}
|
|
@@ -527,12 +525,12 @@
|
|
|
527
525
|
else
|
|
528
526
|
{
|
|
529
527
|
const err_msg = await res.text();
|
|
530
|
-
|
|
528
|
+
onErrorShowAlert(err_msg);
|
|
531
529
|
}
|
|
532
530
|
}
|
|
533
531
|
catch (err)
|
|
534
532
|
{
|
|
535
|
-
|
|
533
|
+
onErrorShowAlert(err);
|
|
536
534
|
}
|
|
537
535
|
|
|
538
536
|
new_user.name = '';
|
|
@@ -555,8 +553,6 @@
|
|
|
555
553
|
create_new_user_enabled = false;
|
|
556
554
|
}
|
|
557
555
|
|
|
558
|
-
let alerts = []
|
|
559
|
-
|
|
560
556
|
let removeModal;
|
|
561
557
|
let userToRemove;
|
|
562
558
|
function askToRemove(user)
|
|
@@ -586,12 +582,12 @@
|
|
|
586
582
|
else
|
|
587
583
|
{
|
|
588
584
|
const err = await res.text()
|
|
589
|
-
|
|
585
|
+
onErrorShowAlert(err);
|
|
590
586
|
}
|
|
591
587
|
}
|
|
592
588
|
catch(err)
|
|
593
589
|
{
|
|
594
|
-
|
|
590
|
+
onErrorShowAlert(err);
|
|
595
591
|
}
|
|
596
592
|
}
|
|
597
593
|
|
|
@@ -620,7 +616,7 @@
|
|
|
620
616
|
else
|
|
621
617
|
{
|
|
622
618
|
const err = await res.text()
|
|
623
|
-
|
|
619
|
+
onErrorShowAlert(err);
|
|
624
620
|
}
|
|
625
621
|
}
|
|
626
622
|
catch(err)
|
|
@@ -628,7 +624,7 @@
|
|
|
628
624
|
deleteAccountModal.hide();
|
|
629
625
|
|
|
630
626
|
console.error(err)
|
|
631
|
-
|
|
627
|
+
onErrorShowAlert(err);
|
|
632
628
|
}
|
|
633
629
|
}
|
|
634
630
|
|
|
@@ -640,20 +636,7 @@
|
|
|
640
636
|
clearsContext='props sel'>
|
|
641
637
|
<!--a href="/" class="underline text-sm font-semibold ml-3"> < Back to root</a-->
|
|
642
638
|
|
|
643
|
-
|
|
644
|
-
<section class="absolute left-2 sm:left-auto sm:right-2 bottom-2 flex flex-col gap-2">
|
|
645
|
-
{#each alerts as alert, idx}
|
|
646
|
-
<Alert class="bg-red-900/40 shadow-lg shadow-stone-400 dark:shadow-black flex flex-row">
|
|
647
|
-
<p>
|
|
648
|
-
{alert}
|
|
649
|
-
</p>
|
|
650
|
-
<button class="font-bold ml-auto"
|
|
651
|
-
on:click={() => {alerts = removeAt(alerts, idx)}}>
|
|
652
|
-
x
|
|
653
|
-
</button>
|
|
654
|
-
</Alert>
|
|
655
|
-
{/each}
|
|
656
|
-
</section>
|
|
639
|
+
|
|
657
640
|
|
|
658
641
|
|
|
659
642
|
|