@humandialog/forms.svelte 0.4.37 → 0.4.39
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/components/Fab.svelte +20 -2
- package/components/list/internal/list.element.svelte +3 -2
- package/components/list/list.svelte +3 -0
- package/desk.svelte +9 -3
- package/horizontal.toolbar.svelte +4 -1
- package/package.json +1 -2
- package/stores.d.ts +1 -0
- package/stores.js +1 -0
- package/tenant.members.svelte +82 -3
- package/components/Fab2.svelte +0 -89
- package/components/Fab2.svelte.d.ts +0 -14
package/components/Fab.svelte
CHANGED
|
@@ -7,6 +7,7 @@ $:
|
|
|
7
7
|
update($page_toolbar_operations, $context_toolbar_operations);
|
|
8
8
|
let operations = [];
|
|
9
9
|
function update(...args) {
|
|
10
|
+
expanded = false;
|
|
10
11
|
if ($context_toolbar_operations && $context_toolbar_operations.length > 0)
|
|
11
12
|
operations = $context_toolbar_operations;
|
|
12
13
|
else
|
|
@@ -78,8 +79,25 @@ function toggle_expand(e) {
|
|
|
78
79
|
</button>
|
|
79
80
|
|
|
80
81
|
{#if operations.length == 3}
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
{@const thrid_operation = operations[2]}
|
|
83
|
+
<button class=" bg-transparent
|
|
84
|
+
w-[55px] h-[55px]
|
|
85
|
+
fixed m-0 absolute bottom-[70px] right-[0px]
|
|
86
|
+
|
|
87
|
+
flex items-center justify-center
|
|
88
|
+
disable-dbl-tap-zoom"
|
|
89
|
+
on:click|stopPropagation={(e) => {on_click(e, thrid_operation)}} >
|
|
90
|
+
<div class=" w-10 h-10
|
|
91
|
+
text-white bg-zinc-500 hover:bg-zinc-500
|
|
92
|
+
font-medium rounded-full text-sm text-center shadow-md
|
|
93
|
+
dark:bg-zinc-500 dark:hover:bg-zinc-500
|
|
94
|
+
flex items-center justify-center">
|
|
95
|
+
<div class="w-5 h-5">
|
|
96
|
+
<svelte:component this={thrid_operation.icon}/>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</button>
|
|
100
|
+
{:else if operations.length > 3}
|
|
83
101
|
<button class=" bg-transparent
|
|
84
102
|
w-[55px] h-[55px]
|
|
85
103
|
fixed m-0 absolute bottom-[70px] right-[0px]
|
|
@@ -94,6 +94,7 @@ function activate_row(e, item2) {
|
|
|
94
94
|
}
|
|
95
95
|
n = n.parentElement;
|
|
96
96
|
}
|
|
97
|
+
can_show_context_menu = false;
|
|
97
98
|
if (can_show_context_menu && context_menu) {
|
|
98
99
|
const pt = new DOMPoint(e.clientX, e.clientY);
|
|
99
100
|
let context_operations = context_menu(item2);
|
|
@@ -213,7 +214,7 @@ async function edit_date(field, prop_idx) {
|
|
|
213
214
|
|
|
214
215
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
215
216
|
{#if item}
|
|
216
|
-
<section class="flex flex-row my-0 w-full text-sm text-slate-700 dark:text-slate-400 cursor-default rounded-md border
|
|
217
|
+
<section class="flex flex-row my-0 w-full text-sm text-slate-700 dark:text-slate-400 cursor-default rounded-md border border-transparent {selected_class} {focused_class}"
|
|
217
218
|
on:contextmenu={on_contextmenu}
|
|
218
219
|
role="menu"
|
|
219
220
|
tabindex="-1">
|
|
@@ -239,7 +240,7 @@ async function edit_date(field, prop_idx) {
|
|
|
239
240
|
<!--div class="flex flex-row justify-between text-xs flex-none w-1/2 sm:w-2/3"-->
|
|
240
241
|
<div class="text-xs flex-none w-1/2 sm:w-2/3 grid-{definition.properties.length}">
|
|
241
242
|
{#each definition.properties as prop, prop_index}
|
|
242
|
-
<p class="col-span-1 w-full mr-auto">
|
|
243
|
+
<p class="col-span-1 w-full mr-auto mt-0.5">
|
|
243
244
|
{#if item[prop.a] || placeholder == prop.name}
|
|
244
245
|
<span role="gridcell" tabindex="0">
|
|
245
246
|
{#if prop.type == rList_property_type.Date}
|
|
@@ -137,6 +137,7 @@ export function edit(element, property_name) {
|
|
|
137
137
|
<hr class="w-full">
|
|
138
138
|
{/if}
|
|
139
139
|
|
|
140
|
+
<!--div class="w-full h-full overflow-y-auto"-->
|
|
140
141
|
|
|
141
142
|
{#if items && items.length > 0 && !!item_key }
|
|
142
143
|
{#each items as element, i (element[item_key])}
|
|
@@ -166,3 +167,5 @@ export function edit(element, property_name) {
|
|
|
166
167
|
bind:this={inserter} />
|
|
167
168
|
{/if}
|
|
168
169
|
|
|
170
|
+
<!--/div-->
|
|
171
|
+
|
package/desk.svelte
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
dark_mode_store,
|
|
14
14
|
data_tick_store,
|
|
15
15
|
set_default_tools_visible,
|
|
16
|
-
set_dark_mode_default
|
|
16
|
+
set_dark_mode_default,
|
|
17
|
+
sidebar_left_pos } from './stores.js'
|
|
17
18
|
|
|
18
19
|
import { AuthorizedView} from '@humandialog/auth.svelte'
|
|
19
20
|
import { handle_select, is_device_smaller_than } from './utils'
|
|
@@ -186,11 +187,15 @@
|
|
|
186
187
|
<!--#######################################################-->
|
|
187
188
|
<!--## MAIN SIDE BAR ##################-->
|
|
188
189
|
<!--#######################################################-->
|
|
190
|
+
{#if true}
|
|
191
|
+
{@const sidebar_left = $sidebar_left_pos==0 ? "left-0" : "left-[40px]"}
|
|
192
|
+
{@const sidebar_small_width = $sidebar_left_pos==0 ? "w-full" : "w-[calc(100vw-40px)]"}
|
|
193
|
+
|
|
189
194
|
<div class="{main_side_panel_visibility}
|
|
190
|
-
|
|
195
|
+
{sidebar_left} sm:left-[40px]
|
|
191
196
|
top-[40px] sm:top-0
|
|
192
197
|
h-[calc(100vh-40px)] sm:h-full {lg_main_sidebar_height}
|
|
193
|
-
|
|
198
|
+
{sidebar_small_width} sm:w-[320px]
|
|
194
199
|
z-20 overflow-x-hidden">
|
|
195
200
|
|
|
196
201
|
<div class=" bg-slate-50 w-full h-full dark:bg-slate-800 overflow-y-auto py-4 px-0">
|
|
@@ -199,6 +204,7 @@
|
|
|
199
204
|
</Configurable>
|
|
200
205
|
</div>
|
|
201
206
|
</div>
|
|
207
|
+
{/if}
|
|
202
208
|
|
|
203
209
|
<section on:click|capture={auto_hide_sidebar}>
|
|
204
210
|
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
tools_visible_store,
|
|
23
23
|
bottom_bar_visible_store,
|
|
24
24
|
previously_visible_sidebar,
|
|
25
|
-
main_sidebar_visible_store
|
|
25
|
+
main_sidebar_visible_store,
|
|
26
|
+
sidebar_left_pos
|
|
26
27
|
} from "./stores.js";
|
|
27
28
|
import Icon from './components/icon.svelte';
|
|
28
29
|
import {session, signin_href, signout_href} from '@humandialog/auth.svelte'
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
{
|
|
67
68
|
if(tabs.length == 1)
|
|
68
69
|
{
|
|
70
|
+
$sidebar_left_pos = 0;
|
|
69
71
|
toggle_sidebar(tabs[0]);
|
|
70
72
|
}
|
|
71
73
|
else
|
|
@@ -79,6 +81,7 @@
|
|
|
79
81
|
sidebar = previously_visible_sidebar;
|
|
80
82
|
}
|
|
81
83
|
|
|
84
|
+
$sidebar_left_pos = 40;
|
|
82
85
|
toggle_sidebar(sidebar)
|
|
83
86
|
}
|
|
84
87
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humandialog/forms.svelte",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.39",
|
|
4
4
|
"description": "Basic Svelte UI components for Object Reef applications",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@playwright/test": "^1.28.1",
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"exports": {
|
|
53
53
|
"./package.json": "./package.json",
|
|
54
54
|
"./components/Fab.svelte": "./components/Fab.svelte",
|
|
55
|
-
"./components/Fab2.svelte": "./components/Fab2.svelte",
|
|
56
55
|
"./components/Floating_container.svelte": "./components/Floating_container.svelte",
|
|
57
56
|
"./components/Grid.menu.svelte": "./components/Grid.menu.svelte",
|
|
58
57
|
"./components/button.svelte": "./components/button.svelte",
|
package/stores.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export const page_toolbar_operations: import("svelte/store").Writable<never[]>;
|
|
|
27
27
|
export const dark_mode_store: import("svelte/store").Writable<any>;
|
|
28
28
|
export const main_sidebar_visible_store: import("svelte/store").Writable<any>;
|
|
29
29
|
export let previously_visible_sidebar: string;
|
|
30
|
+
export let sidebar_left_pos: import("svelte/store").Writable<number>;
|
|
30
31
|
export const tools_visible_store: import("svelte/store").Writable<any>;
|
|
31
32
|
export const bottom_bar_visible_store: import("svelte/store").Writable<any>;
|
|
32
33
|
export const right_sidebar_visible_store: import("svelte/store").Writable<boolean>;
|
package/stores.js
CHANGED
|
@@ -46,6 +46,7 @@ export const main_sidebar_visible_store = writable((localStorage.main_sidebar_vi
|
|
|
46
46
|
main_sidebar_visible_store.subscribe( (value) => { localStorage.main_sidebar_visible_store = value });
|
|
47
47
|
|
|
48
48
|
export let previously_visible_sidebar = "";
|
|
49
|
+
export let sidebar_left_pos = writable(0)
|
|
49
50
|
|
|
50
51
|
let has_saved_tools_visible = false;
|
|
51
52
|
function create_tools_visible_store()
|
package/tenant.members.svelte
CHANGED
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
let reef_users = [];
|
|
43
43
|
let new_reef_user_id = 1;
|
|
44
44
|
|
|
45
|
+
let fake_users;
|
|
46
|
+
|
|
45
47
|
async function init()
|
|
46
48
|
{
|
|
47
49
|
reef_users = [];
|
|
@@ -68,6 +70,9 @@
|
|
|
68
70
|
})
|
|
69
71
|
}
|
|
70
72
|
|
|
73
|
+
fake_users = [];
|
|
74
|
+
add_fake_users(fake_users);
|
|
75
|
+
|
|
71
76
|
await fetch_details();
|
|
72
77
|
|
|
73
78
|
}
|
|
@@ -84,7 +89,11 @@
|
|
|
84
89
|
|
|
85
90
|
handled_no++;
|
|
86
91
|
if(handled_no == reef_users.length)
|
|
92
|
+
{
|
|
93
|
+
|
|
94
|
+
|
|
87
95
|
list?.update_objects(reef_users);
|
|
96
|
+
}
|
|
88
97
|
} )
|
|
89
98
|
}
|
|
90
99
|
|
|
@@ -294,6 +303,74 @@
|
|
|
294
303
|
return !!s;
|
|
295
304
|
}
|
|
296
305
|
|
|
306
|
+
function add_fake_users(reef_users)
|
|
307
|
+
{
|
|
308
|
+
const names = [
|
|
309
|
+
"Evangeline Burnett",
|
|
310
|
+
"Veronica Shaffer",
|
|
311
|
+
"Evan Moyer",
|
|
312
|
+
"Maisey Knox",
|
|
313
|
+
"Princess Taylor",
|
|
314
|
+
"Lilli Brown",
|
|
315
|
+
"Celine Terrell",
|
|
316
|
+
"Alexander Simmons",
|
|
317
|
+
"Leslie Rowland",
|
|
318
|
+
"Amira Reeves",
|
|
319
|
+
"Remi Parks",
|
|
320
|
+
"Daniela Holder",
|
|
321
|
+
"Sonny Watkins",
|
|
322
|
+
"Kiran Patton",
|
|
323
|
+
"Nadia O'Brien",
|
|
324
|
+
"Aine Lyons",
|
|
325
|
+
"Arran Mccoy",
|
|
326
|
+
"Aliya Hart",
|
|
327
|
+
"Zara Ross",
|
|
328
|
+
"Chad Ramirez",
|
|
329
|
+
"Aron Briggs",
|
|
330
|
+
"Nicole Hall",
|
|
331
|
+
"Mitchell Hendricks",
|
|
332
|
+
"Lila Chandler",
|
|
333
|
+
"Carter Padilla",
|
|
334
|
+
"Christian Thompson",
|
|
335
|
+
"Ishaq Smith",
|
|
336
|
+
"Sofia Blanchard",
|
|
337
|
+
"Taha Kelly",
|
|
338
|
+
"Jensen Huber",
|
|
339
|
+
"Jaya Hewitt",
|
|
340
|
+
"Hari Nielsen",
|
|
341
|
+
"Celeste Higgins",
|
|
342
|
+
"Soraya Farrell",
|
|
343
|
+
"Jacob Copeland",
|
|
344
|
+
"Robbie Soto",
|
|
345
|
+
"Krishan Kelley",
|
|
346
|
+
"Erica Ferrell",
|
|
347
|
+
"Moshe Valenzuela",
|
|
348
|
+
"Ahmed Mathews",
|
|
349
|
+
"Emilie Moore",
|
|
350
|
+
"Anisa Gamble",
|
|
351
|
+
"Esmee Haines",
|
|
352
|
+
"Francesca Fischer",
|
|
353
|
+
"Md Mcdaniel",
|
|
354
|
+
"Saarah Zamora",
|
|
355
|
+
"Tomos Ponce",
|
|
356
|
+
"Sonia Barrera",
|
|
357
|
+
"Pedro Hogan",
|
|
358
|
+
"Connie Weeks"
|
|
359
|
+
]
|
|
360
|
+
const how_many = 50
|
|
361
|
+
for(let i=0; i<how_many; i++)
|
|
362
|
+
{
|
|
363
|
+
reef_users.push(
|
|
364
|
+
{
|
|
365
|
+
[name_attrib]: names[i],
|
|
366
|
+
[email_attrib]: 'u@fake.com',
|
|
367
|
+
[ref_attrib]: `./User/${1000+i}`,
|
|
368
|
+
__hd_internal_item_id: 1000+i
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
297
374
|
async function on_new_user_requested()
|
|
298
375
|
{
|
|
299
376
|
if(!name_input?.validate())
|
|
@@ -328,6 +405,8 @@
|
|
|
328
405
|
list?.update_objects(reef_users);
|
|
329
406
|
}
|
|
330
407
|
|
|
408
|
+
|
|
409
|
+
|
|
331
410
|
new_user.name = '';
|
|
332
411
|
new_user.email = '';
|
|
333
412
|
new_user.maintainer = false;
|
|
@@ -345,13 +424,13 @@
|
|
|
345
424
|
</script>
|
|
346
425
|
|
|
347
426
|
<Page self={data_item}
|
|
348
|
-
cl="!bg-white dark:!bg-slate-900 w-full h-full flex flex-col overflow-y-
|
|
427
|
+
cl="!bg-white dark:!bg-slate-900 w-full h-full flex flex-col overflow-y-auto overflow-x-hidden py-1 px-1 border-0"
|
|
349
428
|
toolbar_operations={page_operations}
|
|
350
429
|
clears_context='props sel'>
|
|
351
430
|
<a href="/" class="underline text-sm font-semibold ml-3"> < Back to root</a>
|
|
352
431
|
|
|
353
|
-
{#if
|
|
354
|
-
<List objects={
|
|
432
|
+
{#if fake_users && fake_users.length > 0}
|
|
433
|
+
<List objects={fake_users}
|
|
355
434
|
title='Members'
|
|
356
435
|
toolbar_operations={user_operations}
|
|
357
436
|
context_menu={user_context_menu}
|
package/components/Fab2.svelte
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<script>import { context_toolbar_operations, page_toolbar_operations, context_items_store } from "../stores.js";
|
|
2
|
-
let expanded = false;
|
|
3
|
-
$:
|
|
4
|
-
update($page_toolbar_operations, $context_toolbar_operations);
|
|
5
|
-
let operations = [];
|
|
6
|
-
function update(...args) {
|
|
7
|
-
if ($context_toolbar_operations && $context_toolbar_operations.length > 0)
|
|
8
|
-
operations = $context_toolbar_operations;
|
|
9
|
-
else
|
|
10
|
-
operations = $page_toolbar_operations;
|
|
11
|
-
}
|
|
12
|
-
function on_click(operation) {
|
|
13
|
-
if (!operation)
|
|
14
|
-
return;
|
|
15
|
-
if (!operation.action)
|
|
16
|
-
return;
|
|
17
|
-
let focused_item = null;
|
|
18
|
-
if ($context_items_store.focused)
|
|
19
|
-
focused_item = $context_items_store[$context_items_store.focused];
|
|
20
|
-
operation.action(focused_item);
|
|
21
|
-
}
|
|
22
|
-
function toggle_expand(e) {
|
|
23
|
-
expanded = !expanded;
|
|
24
|
-
}
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
{#if operations && operations.length > 0}
|
|
28
|
-
{#if operations.length == 1}
|
|
29
|
-
{@const operation = operations[0]}
|
|
30
|
-
<button class="text-white bg-blue-700 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300
|
|
31
|
-
font-medium rounded-full text-sm text-center shadow-md
|
|
32
|
-
mr-2 mb-2 w-10 h-10
|
|
33
|
-
dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800
|
|
34
|
-
flex items-center justify-center
|
|
35
|
-
disable-dbl-tap-zoom"
|
|
36
|
-
on:click|stopPropagation={(e) => {on_click(operation)}} >
|
|
37
|
-
<div class="w-5 h-5"><svelte:component this={operation.icon}/></div>
|
|
38
|
-
</button>
|
|
39
|
-
{:else}
|
|
40
|
-
<button class="text-white bg-blue-700 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300
|
|
41
|
-
font-medium rounded-full text-sm text-center shadow-md
|
|
42
|
-
mr-2 mb-2 w-10 h-10
|
|
43
|
-
dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800
|
|
44
|
-
flex items-center justify-center
|
|
45
|
-
disable-dbl-tap-zoom"
|
|
46
|
-
on:click|stopPropagation={toggle_expand}>
|
|
47
|
-
<div class="w-5 h-5">
|
|
48
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
49
|
-
viewBox="0 0 192 512"
|
|
50
|
-
style=" stroke: currentColor;
|
|
51
|
-
fill: currentColor;
|
|
52
|
-
stroke-width: 0;
|
|
53
|
-
width: 100%;
|
|
54
|
-
height: auto;
|
|
55
|
-
max-height: 100%;">
|
|
56
|
-
<path d="M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z" />
|
|
57
|
-
</svg>
|
|
58
|
-
</div>
|
|
59
|
-
</button>
|
|
60
|
-
{#if expanded}
|
|
61
|
-
<ul class="list-none m-0 absolute bottom-[60px] right-0">
|
|
62
|
-
{#each operations as operation}
|
|
63
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
64
|
-
<li class="flex flex-row px-1 py-0 justify-end group"
|
|
65
|
-
on:click|stopPropagation={(e) => {on_click(operation)}}>
|
|
66
|
-
<div>
|
|
67
|
-
<span class="block whitespace-nowrap text-sm mt-3 font-semibold text-white mr-3 select-none bg-slate-700 group-hover:bg-slate-800 px-1 shadow-lg rounded">{operation.caption}</span>
|
|
68
|
-
</div>
|
|
69
|
-
<button class=" text-white bg-blue-700 group-hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300
|
|
70
|
-
font-medium rounded-full text-sm text-center shadow-md
|
|
71
|
-
mr-1 mb-2 w-10 h-10
|
|
72
|
-
dark:bg-blue-600 dark:group-hover:bg-blue-700 dark:focus:ring-blue-800
|
|
73
|
-
flex items-center justify-center
|
|
74
|
-
disable-dbl-tap-zoom">
|
|
75
|
-
<div class="w-5 h-5"><svelte:component this={operation.icon}/></div>
|
|
76
|
-
</button>
|
|
77
|
-
</li>
|
|
78
|
-
{/each}
|
|
79
|
-
</ul>
|
|
80
|
-
{/if}
|
|
81
|
-
{/if}
|
|
82
|
-
{/if}
|
|
83
|
-
|
|
84
|
-
<style>
|
|
85
|
-
|
|
86
|
-
.disable-dbl-tap-zoom {
|
|
87
|
-
touch-action: manipulation;
|
|
88
|
-
}
|
|
89
|
-
</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: Record<string, never>;
|
|
4
|
-
events: {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
};
|
|
7
|
-
slots: {};
|
|
8
|
-
};
|
|
9
|
-
export type Fab2Props = typeof __propDef.props;
|
|
10
|
-
export type Fab2Events = typeof __propDef.events;
|
|
11
|
-
export type Fab2Slots = typeof __propDef.slots;
|
|
12
|
-
export default class Fab2 extends SvelteComponentTyped<Fab2Props, Fab2Events, Fab2Slots> {
|
|
13
|
-
}
|
|
14
|
-
export {};
|