@humandialog/forms.svelte 0.5.3 → 0.5.5
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 +5 -3
- package/components/combo/combo.svelte +1 -1
- package/components/document/rich.edit.svelte +30 -7
- package/components/document/rich.edit.svelte.d.ts +2 -2
- package/components/kanban/Kanban.d.ts +24 -4
- package/components/kanban/Kanban.js +60 -4
- package/components/kanban/internal/kanban.card.svelte +148 -70
- package/components/kanban/internal/kanban.card.svelte.d.ts +2 -5
- package/components/kanban/internal/kanban.column.svelte +116 -72
- package/components/kanban/internal/kanban.column.svelte.d.ts +9 -9
- package/components/kanban/internal/kanban.inserter.svelte +1 -1
- package/components/kanban/internal/kanban.move.menu.svelte +11 -8
- package/components/kanban/internal/kanban.move.menu.svelte.d.ts +3 -0
- package/components/kanban/internal/kanban.props.svelte +140 -0
- package/components/kanban/internal/kanban.props.svelte.d.ts +19 -0
- package/components/kanban/kanban.callbacks.svelte +2 -8
- package/components/kanban/kanban.callbacks.svelte.d.ts +1 -4
- package/components/kanban/kanban.column.svelte +8 -8
- package/components/kanban/kanban.column.svelte.d.ts +4 -4
- package/components/kanban/kanban.combo.svelte +36 -0
- package/components/kanban/kanban.combo.svelte.d.ts +24 -0
- package/components/kanban/kanban.date.svelte +30 -0
- package/components/kanban/kanban.date.svelte.d.ts +21 -0
- package/components/kanban/kanban.source.svelte +25 -0
- package/components/kanban/kanban.source.svelte.d.ts +23 -0
- package/components/kanban/kanban.static.svelte +28 -0
- package/components/kanban/kanban.static.svelte.d.ts +20 -0
- package/components/kanban/kanban.summary.svelte +4 -0
- package/components/kanban/kanban.summary.svelte.d.ts +2 -0
- package/components/kanban/kanban.svelte +390 -55
- package/components/kanban/kanban.svelte.d.ts +32 -12
- package/components/kanban/kanban.tags.svelte +34 -0
- package/components/kanban/kanban.tags.svelte.d.ts +23 -0
- package/components/kanban/kanban.title.svelte +2 -0
- package/components/kanban/kanban.title.svelte.d.ts +1 -0
- package/components/list/List.d.ts +8 -1
- package/components/list/List.js +9 -0
- package/components/list/internal/list.element.summary.svelte +21 -7
- package/components/list/internal/list.element.summary.svelte.d.ts +1 -0
- package/components/list/internal/list.element.svelte +16 -11
- package/components/list/list.svelte +1 -1
- package/components/sidebar/sidebar.group.svelte +41 -3
- package/components/sidebar/sidebar.group.svelte.d.ts +6 -0
- package/components/sidebar/sidebar.list.svelte +3 -1
- package/components/tag.svelte +40 -0
- package/components/tag.svelte.d.ts +19 -0
- package/components/tags.svelte +203 -0
- package/components/tags.svelte.d.ts +31 -0
- package/horizontal.toolbar.svelte +23 -4
- package/horizontal.toolbar.svelte.d.ts +2 -0
- package/index.d.ts +9 -2
- package/index.js +9 -2
- package/operations.svelte +52 -23
- package/package.json +9 -1
- package/page.svelte +3 -3
- package/page.svelte.d.ts +2 -2
- package/tenant.members.svelte +1 -1
- package/updates.d.ts +1 -0
- package/updates.js +16 -0
- package/utils.js +11 -1
- package/vertical.toolbar.svelte +31 -6
- package/vertical.toolbar.svelte.d.ts +2 -0
package/operations.svelte
CHANGED
|
@@ -4,11 +4,15 @@ export let mobile = false;
|
|
|
4
4
|
$:
|
|
5
5
|
update($pageToolbarOperations, $contextToolbarOperations);
|
|
6
6
|
let operations = [];
|
|
7
|
+
let leftOperations = [];
|
|
8
|
+
let rightOperations = [];
|
|
7
9
|
function update(...args) {
|
|
8
10
|
if ($contextToolbarOperations && $contextToolbarOperations.length > 0)
|
|
9
11
|
operations = $contextToolbarOperations;
|
|
10
12
|
else
|
|
11
13
|
operations = $pageToolbarOperations;
|
|
14
|
+
leftOperations = operations.filter((o) => !o.right);
|
|
15
|
+
rightOperations = operations.filter((o) => o.right == true);
|
|
12
16
|
}
|
|
13
17
|
function on_click(e, operation) {
|
|
14
18
|
if (!operation)
|
|
@@ -38,30 +42,55 @@ function mousedown(e) {
|
|
|
38
42
|
}
|
|
39
43
|
</script>
|
|
40
44
|
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{#
|
|
45
|
+
<section class="flex flex-row no-print h-10 bg-stone-600 dark:bg-stone-950 overflow-x-clip overflow-y-hidden py-0 text-xs ">
|
|
46
|
+
<div class="flex flex-row"
|
|
47
|
+
class:flex-row-reverse={mobile}>
|
|
48
|
+
|
|
49
|
+
{#each leftOperations as operation}
|
|
50
|
+
{#if !operation.separator}
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</div>
|
|
52
|
+
<button type="button"
|
|
53
|
+
class="py-2.5 px-5
|
|
54
|
+
text-xs font-medium text-stone-100 dark:text-stone-300 dark:hover:text-white
|
|
55
|
+
hover:bg-stone-700 dark:hover:bg-stone-800 active:bg-stone-300 dark:active:bg-stone-600
|
|
56
|
+
border-stone-200 focus:outline-none dark:border-stone-600
|
|
57
|
+
inline-flex items-center"
|
|
58
|
+
on:click={(e) => {on_click(e, operation)}}
|
|
59
|
+
on:mousedown={mousedown}>
|
|
60
|
+
{#if operation.icon}
|
|
61
|
+
<div class="w-3 h-3 mr-1"><svelte:component this={operation.icon}/></div>
|
|
62
|
+
{/if}
|
|
63
|
+
{#if operation.caption}
|
|
64
|
+
<span>{operation.caption}</span>
|
|
65
|
+
{/if}
|
|
66
|
+
</button>
|
|
67
|
+
{/if}
|
|
68
|
+
{/each}
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<div class="ml-auto flex flex-row">
|
|
72
|
+
{#each rightOperations as operation}
|
|
73
|
+
{#if !operation.separator}
|
|
74
|
+
|
|
75
|
+
<button type="button"
|
|
76
|
+
class="py-2.5 px-5
|
|
77
|
+
text-xs font-medium text-stone-100 dark:text-stone-300 dark:hover:text-white
|
|
78
|
+
hover:bg-stone-700 dark:hover:bg-stone-800 active:bg-stone-300 dark:active:bg-stone-600
|
|
79
|
+
border-stone-200 focus:outline-none dark:border-stone-600
|
|
80
|
+
inline-flex items-center"
|
|
81
|
+
on:click={(e) => {on_click(e, operation)}}
|
|
82
|
+
on:mousedown={mousedown}>
|
|
83
|
+
{#if operation.icon}
|
|
84
|
+
<div class="w-3 h-3 mr-1"><svelte:component this={operation.icon}/></div>
|
|
85
|
+
{/if}
|
|
86
|
+
{#if operation.caption}
|
|
87
|
+
<span>{operation.caption}</span>
|
|
88
|
+
{/if}
|
|
89
|
+
</button>
|
|
90
|
+
{/if}
|
|
91
|
+
{/each}
|
|
92
|
+
</div>
|
|
93
|
+
</section>
|
|
65
94
|
|
|
66
95
|
<style>
|
|
67
96
|
@media print
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humandialog/forms.svelte",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "Basic Svelte UI components for Object Reef applications",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@playwright/test": "^1.28.1",
|
|
@@ -79,10 +79,16 @@
|
|
|
79
79
|
"./components/kanban/internal/kanban.column.svelte": "./components/kanban/internal/kanban.column.svelte",
|
|
80
80
|
"./components/kanban/internal/kanban.inserter.svelte": "./components/kanban/internal/kanban.inserter.svelte",
|
|
81
81
|
"./components/kanban/internal/kanban.move.menu.svelte": "./components/kanban/internal/kanban.move.menu.svelte",
|
|
82
|
+
"./components/kanban/internal/kanban.props.svelte": "./components/kanban/internal/kanban.props.svelte",
|
|
82
83
|
"./components/kanban/kanban.callbacks.svelte": "./components/kanban/kanban.callbacks.svelte",
|
|
83
84
|
"./components/kanban/kanban.column.svelte": "./components/kanban/kanban.column.svelte",
|
|
85
|
+
"./components/kanban/kanban.combo.svelte": "./components/kanban/kanban.combo.svelte",
|
|
86
|
+
"./components/kanban/kanban.date.svelte": "./components/kanban/kanban.date.svelte",
|
|
87
|
+
"./components/kanban/kanban.source.svelte": "./components/kanban/kanban.source.svelte",
|
|
88
|
+
"./components/kanban/kanban.static.svelte": "./components/kanban/kanban.static.svelte",
|
|
84
89
|
"./components/kanban/kanban.summary.svelte": "./components/kanban/kanban.summary.svelte",
|
|
85
90
|
"./components/kanban/kanban.svelte": "./components/kanban/kanban.svelte",
|
|
91
|
+
"./components/kanban/kanban.tags.svelte": "./components/kanban/kanban.tags.svelte",
|
|
86
92
|
"./components/kanban/kanban.title.svelte": "./components/kanban/kanban.title.svelte",
|
|
87
93
|
"./components/list/List": "./components/list/List.js",
|
|
88
94
|
"./components/list/internal/list.element.props.svelte": "./components/list/internal/list.element.props.svelte",
|
|
@@ -108,6 +114,8 @@
|
|
|
108
114
|
"./components/table/item.svelte": "./components/table/item.svelte",
|
|
109
115
|
"./components/table/table.svelte": "./components/table/table.svelte",
|
|
110
116
|
"./components/table/table": "./components/table/table.js",
|
|
117
|
+
"./components/tag.svelte": "./components/tag.svelte",
|
|
118
|
+
"./components/tags.svelte": "./components/tags.svelte",
|
|
111
119
|
"./components/textarea.ltop.svelte": "./components/textarea.ltop.svelte",
|
|
112
120
|
"./components/tile.title.svelte": "./components/tile.title.svelte",
|
|
113
121
|
"./desk.svelte": "./desk.svelte",
|
package/page.svelte
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
export let c = '';
|
|
23
23
|
|
|
24
24
|
export let toolbarOperations = undefined;
|
|
25
|
-
export let
|
|
25
|
+
export let clearsContext = '';
|
|
26
26
|
export let title = '';
|
|
27
27
|
|
|
28
28
|
switch (c) {
|
|
@@ -96,9 +96,9 @@
|
|
|
96
96
|
|
|
97
97
|
function clear_selection(e) {
|
|
98
98
|
//console.log('page click', chnages.just_changed_context)
|
|
99
|
-
if (!
|
|
99
|
+
if (!clearsContext) return;
|
|
100
100
|
|
|
101
|
-
let contexts =
|
|
101
|
+
let contexts = clearsContext.split(' ');
|
|
102
102
|
contexts.forEach((c) => {
|
|
103
103
|
$contextItemsStore[c] = null;
|
|
104
104
|
$context_info_store[c] = '';
|
package/page.svelte.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} PageEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} PageSlots */
|
|
4
4
|
export default class Page extends SvelteComponentTyped<{
|
|
5
|
+
clearsContext?: string | undefined;
|
|
5
6
|
context?: string | undefined;
|
|
6
7
|
self?: null | undefined;
|
|
7
8
|
c?: string | undefined;
|
|
@@ -10,7 +11,6 @@ export default class Page extends SvelteComponentTyped<{
|
|
|
10
11
|
focused_only?: boolean | undefined;
|
|
11
12
|
inContext?: string | undefined;
|
|
12
13
|
toolbarOperations?: any;
|
|
13
|
-
clears_context?: string | undefined;
|
|
14
14
|
title?: string | undefined;
|
|
15
15
|
}, {
|
|
16
16
|
[evt: string]: CustomEvent<any>;
|
|
@@ -24,6 +24,7 @@ export type PageSlots = typeof __propDef.slots;
|
|
|
24
24
|
import { SvelteComponentTyped } from "svelte";
|
|
25
25
|
declare const __propDef: {
|
|
26
26
|
props: {
|
|
27
|
+
clearsContext?: string | undefined;
|
|
27
28
|
context?: string | undefined;
|
|
28
29
|
self?: null | undefined;
|
|
29
30
|
c?: string | undefined;
|
|
@@ -32,7 +33,6 @@ declare const __propDef: {
|
|
|
32
33
|
focused_only?: boolean | undefined;
|
|
33
34
|
inContext?: string | undefined;
|
|
34
35
|
toolbarOperations?: any;
|
|
35
|
-
clears_context?: string | undefined;
|
|
36
36
|
title?: string | undefined;
|
|
37
37
|
};
|
|
38
38
|
events: {
|
package/tenant.members.svelte
CHANGED
|
@@ -426,7 +426,7 @@
|
|
|
426
426
|
<Page self={data_item}
|
|
427
427
|
cl="!bg-white dark:!bg-stone-900 w-full h-full flex flex-col overflow-y-auto overflow-x-hidden py-1 px-1 border-0"
|
|
428
428
|
toolbarOperations={page_operations}
|
|
429
|
-
|
|
429
|
+
clearsContext='props sel'>
|
|
430
430
|
<!--a href="/" class="underline text-sm font-semibold ml-3"> < Back to root</a-->
|
|
431
431
|
|
|
432
432
|
{#if reef_users && reef_users.length > 0}
|
package/updates.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export function informModification(itm: any, field_name: any, type_name?: undefined): boolean;
|
|
2
|
+
export function informModificationEx(typeName: any, itemId: any, attribName: any, attribValue: any): boolean;
|
|
2
3
|
export function informItem(itm: any, type_name?: undefined): boolean;
|
|
3
4
|
export function pushChanges(): void;
|
package/updates.js
CHANGED
|
@@ -34,6 +34,22 @@ export function informModification(itm, field_name, type_name=undefined)
|
|
|
34
34
|
return true;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
export function informModificationEx(typeName, itemId, attribName, attribValue)
|
|
38
|
+
{
|
|
39
|
+
let item_entry = {
|
|
40
|
+
Id: [typeName] + itemId,
|
|
41
|
+
type_name: typeName,
|
|
42
|
+
item: { [typeName]:
|
|
43
|
+
{
|
|
44
|
+
Id: itemId,
|
|
45
|
+
[attribName]: attribValue
|
|
46
|
+
} },
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
modified_item_store.set(item_entry);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
|
|
37
53
|
export function informItem(itm, type_name=undefined)
|
|
38
54
|
{
|
|
39
55
|
if(type_name == undefined)
|
package/utils.js
CHANGED
|
@@ -102,11 +102,16 @@ export function editable(node, params)
|
|
|
102
102
|
let action;
|
|
103
103
|
let active = false;
|
|
104
104
|
let onRemove = undefined;
|
|
105
|
+
let onFinish = undefined;
|
|
105
106
|
if(params instanceof Object)
|
|
106
107
|
{
|
|
107
108
|
action = params.action ?? params;
|
|
108
109
|
active = params.active ?? false;
|
|
109
110
|
onRemove = params.remove ?? undefined
|
|
111
|
+
onFinish = params.onFinish ?? undefined
|
|
112
|
+
|
|
113
|
+
if(params.readonly)
|
|
114
|
+
return;
|
|
110
115
|
}
|
|
111
116
|
else
|
|
112
117
|
action = params;
|
|
@@ -246,6 +251,11 @@ export function editable(node, params)
|
|
|
246
251
|
{
|
|
247
252
|
node.contentEditable = "true"
|
|
248
253
|
node.addEventListener('focus', focus_listener);
|
|
254
|
+
|
|
255
|
+
if(onFinish)
|
|
256
|
+
{
|
|
257
|
+
node.addEventListener("finish", (e) => { onFinish(e.detail) })
|
|
258
|
+
}
|
|
249
259
|
}
|
|
250
260
|
else
|
|
251
261
|
{
|
|
@@ -455,7 +465,7 @@ export function removeAt(array, index)
|
|
|
455
465
|
export function remove(array, element)
|
|
456
466
|
{
|
|
457
467
|
let idx = array.findIndex((t) => t == element);
|
|
458
|
-
return
|
|
468
|
+
return removeAt(array, idx);
|
|
459
469
|
}
|
|
460
470
|
|
|
461
471
|
export function swapElements(array, e1, e2)
|
package/vertical.toolbar.svelte
CHANGED
|
@@ -17,13 +17,20 @@
|
|
|
17
17
|
tools_visible_store,
|
|
18
18
|
bottom_bar_visible_store,
|
|
19
19
|
right_sidebar_visible_store,
|
|
20
|
-
main_sidebar_visible_store
|
|
20
|
+
main_sidebar_visible_store,
|
|
21
|
+
contextItemsStore,
|
|
22
|
+
context_info_store,
|
|
23
|
+
contextToolbarOperations,
|
|
24
|
+
data_tick_store
|
|
25
|
+
} from "./stores.js";
|
|
21
26
|
import Icon from './components/icon.svelte';
|
|
22
27
|
import {session, signInHRef, signOutHRef} from '@humandialog/auth.svelte'
|
|
23
28
|
import { push } from 'svelte-spa-router';
|
|
29
|
+
|
|
24
30
|
|
|
25
31
|
export let appConfig;
|
|
26
32
|
export let mobile=false;
|
|
33
|
+
export let clearsContext = 'sel props'
|
|
27
34
|
|
|
28
35
|
|
|
29
36
|
let tabs = new Array();
|
|
@@ -163,17 +170,35 @@
|
|
|
163
170
|
let pt = new DOMPoint(rect.right, rect.top)
|
|
164
171
|
showMenu(pt, options);
|
|
165
172
|
}
|
|
173
|
+
|
|
174
|
+
function clearSelection()
|
|
175
|
+
{
|
|
176
|
+
if (!clearsContext) return;
|
|
177
|
+
|
|
178
|
+
let contexts = clearsContext.split(' ');
|
|
179
|
+
contexts.forEach((c) => {
|
|
180
|
+
$contextItemsStore[c] = null;
|
|
181
|
+
$context_info_store[c] = '';
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
//e.stopPropagation();
|
|
185
|
+
|
|
186
|
+
$contextToolbarOperations = [];
|
|
187
|
+
$data_tick_store = $data_tick_store + 1;
|
|
188
|
+
}
|
|
166
189
|
|
|
167
190
|
</script>
|
|
168
191
|
|
|
192
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
169
193
|
|
|
170
|
-
|
|
194
|
+
<section class="no-print flex flex-col w-full h-full" on:click={clearSelection}>
|
|
195
|
+
<div class="px-0 w-10">
|
|
171
196
|
{#each tabs as tab}
|
|
172
197
|
{@const isSelected = $main_sidebar_visible_store == tab.key}
|
|
173
198
|
<button
|
|
174
199
|
class="h-16 px-0 flex justify-center items-center w-full text-stone-300 hover:text-stone-100"
|
|
175
200
|
class:bg-orange-500={isSelected}
|
|
176
|
-
on:click={()=> (on_tab_clicked(tab.key))}>
|
|
201
|
+
on:click|stopPropagation={()=> (on_tab_clicked(tab.key))}>
|
|
177
202
|
|
|
178
203
|
<Icon size={6} component={tab.icon}/>
|
|
179
204
|
</button>
|
|
@@ -182,18 +207,18 @@
|
|
|
182
207
|
|
|
183
208
|
{#if !mobile}
|
|
184
209
|
|
|
185
|
-
<div class="
|
|
210
|
+
<div class="mt-auto h-auto items-center w-full">
|
|
186
211
|
|
|
187
212
|
<button
|
|
188
213
|
class="h-16 px-0 flex justify-center items-center w-full text-stone-300 hover:text-stone-100"
|
|
189
|
-
on:click={show_options}>
|
|
214
|
+
on:click|stopPropagation={show_options}>
|
|
190
215
|
|
|
191
216
|
<Icon size={4} component={FaCog} />
|
|
192
217
|
</button>
|
|
193
218
|
|
|
194
219
|
</div>
|
|
195
220
|
{/if} <!-- !mobile -->
|
|
196
|
-
|
|
221
|
+
</section>
|
|
197
222
|
|
|
198
223
|
<!--Menu bind:this={menu}/-->
|
|
199
224
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
export default class Vertical extends SvelteComponentTyped<{
|
|
5
5
|
appConfig: any;
|
|
6
6
|
mobile?: boolean | undefined;
|
|
7
|
+
clearsContext?: string | undefined;
|
|
7
8
|
}, {
|
|
8
9
|
[evt: string]: CustomEvent<any>;
|
|
9
10
|
}, {}> {
|
|
@@ -16,6 +17,7 @@ declare const __propDef: {
|
|
|
16
17
|
props: {
|
|
17
18
|
appConfig: any;
|
|
18
19
|
mobile?: boolean | undefined;
|
|
20
|
+
clearsContext?: string | undefined;
|
|
19
21
|
};
|
|
20
22
|
events: {
|
|
21
23
|
[evt: string]: CustomEvent<any>;
|