@humandialog/forms.svelte 1.3.16 → 1.4.0
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 +77 -46
- package/components/Floating_container.svelte +1 -1
- package/components/combo/combo.svelte +18 -15
- package/components/combo/combo.svelte.d.ts +1 -0
- package/components/contextmenu.svelte +25 -6
- package/components/date.svelte +10 -4
- package/components/date.svelte.d.ts +1 -0
- package/components/date_utils.d.ts +1 -0
- package/components/date_utils.js +10 -0
- package/components/delayed.spinner.svelte +1 -2
- package/components/document/editor.svelte +419 -46
- package/components/document/editor.svelte.d.ts +115 -0
- package/components/document/internal/palette.svelte +20 -0
- package/components/list/List.d.ts +6 -0
- package/components/list/List.js +6 -0
- package/components/list/internal/list.element.props.svelte +23 -8
- package/components/list/internal/list.element.svelte +43 -18
- package/components/list/internal/list.element.svelte.d.ts +1 -0
- package/components/list/list.combo.svelte +6 -0
- package/components/list/list.combo.svelte.d.ts +3 -0
- package/components/list/list.date.svelte +8 -0
- package/components/list/list.date.svelte.d.ts +4 -0
- package/components/list/list.static.svelte +6 -0
- package/components/list/list.static.svelte.d.ts +3 -0
- package/components/list/list.svelte +17 -17
- package/components/list/list.tags.svelte +32 -0
- package/components/list/list.tags.svelte.d.ts +24 -0
- package/components/sidebar/sidebar.item.svelte +25 -8
- package/components/tags.svelte +15 -7
- package/components/tags.svelte.d.ts +2 -0
- package/desk.svelte +9 -6
- package/index.d.ts +7 -2
- package/index.js +7 -2
- package/operations.svelte +61 -12
- package/package.json +4 -2
- package/stores.d.ts +3 -0
- package/stores.js +25 -2
- package/tenant.members.svelte +61 -59
- package/tenant.members.svelte.d.ts +2 -0
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
activateItem,
|
|
12
12
|
startEditing,
|
|
13
13
|
getActive,
|
|
14
|
-
isOnNavigationPage
|
|
14
|
+
isOnNavigationPage,
|
|
15
|
+
UI
|
|
15
16
|
} from "../../utils";
|
|
16
17
|
import { showMenu } from "../menu";
|
|
17
18
|
export let href;
|
|
@@ -71,7 +72,17 @@ function calculateIsRowActive(...args) {
|
|
|
71
72
|
if (!item)
|
|
72
73
|
return active;
|
|
73
74
|
const activeItem = getActive("props");
|
|
74
|
-
if (
|
|
75
|
+
if (item.$ref) {
|
|
76
|
+
if (activeItem) {
|
|
77
|
+
return item.$ref == activeItem.$ref;
|
|
78
|
+
} else
|
|
79
|
+
return false;
|
|
80
|
+
} else if (item.Id) {
|
|
81
|
+
if (activeItem) {
|
|
82
|
+
return item.Id == activeItem.Id;
|
|
83
|
+
} else
|
|
84
|
+
return false;
|
|
85
|
+
} else if (activeItem == item)
|
|
75
86
|
return true;
|
|
76
87
|
else
|
|
77
88
|
return false;
|
|
@@ -108,15 +119,22 @@ function on_link_clicked(e) {
|
|
|
108
119
|
e.preventDefault();
|
|
109
120
|
if (isOnPage) {
|
|
110
121
|
if (isRowActive) {
|
|
111
|
-
|
|
112
|
-
push(href2);
|
|
122
|
+
redirect_to(href2);
|
|
113
123
|
}
|
|
114
124
|
} else {
|
|
115
125
|
auto_hide_sidebar();
|
|
116
|
-
|
|
117
|
-
push(href2);
|
|
126
|
+
redirect_to(href2);
|
|
118
127
|
}
|
|
119
128
|
}
|
|
129
|
+
function redirect_to(href2) {
|
|
130
|
+
if (!href2)
|
|
131
|
+
return;
|
|
132
|
+
let absolute_pattern = /^https?:\/\//i;
|
|
133
|
+
if (!absolute_pattern.test(href2))
|
|
134
|
+
push(href2);
|
|
135
|
+
else
|
|
136
|
+
window.location.href = href2;
|
|
137
|
+
}
|
|
120
138
|
function on_contextmenu(e) {
|
|
121
139
|
if (!operations)
|
|
122
140
|
return;
|
|
@@ -187,7 +205,6 @@ function activateRow(e) {
|
|
|
187
205
|
<div
|
|
188
206
|
on:click
|
|
189
207
|
on:click={activateRow}
|
|
190
|
-
on:contextmenu={on_contextmenu}
|
|
191
208
|
on:keydown
|
|
192
209
|
on:keyup
|
|
193
210
|
class=" mb-2
|
|
@@ -197,7 +214,7 @@ function activateRow(e) {
|
|
|
197
214
|
class:sm:dark:hover:bg-stone-700={!!href}
|
|
198
215
|
class:bg-stone-200={isRowActive}
|
|
199
216
|
class:dark:bg-stone-700={isRowActive}
|
|
200
|
-
class:selected={selected(selectable, context_data)}>
|
|
217
|
+
class:selected={selected(selectable, context_data)}> <!-- on:contextmenu={on_contextmenu} -->
|
|
201
218
|
<div class="flex flex-row justify-between
|
|
202
219
|
text-base font-semibold">
|
|
203
220
|
{#if href}
|
package/components/tags.svelte
CHANGED
|
@@ -3,7 +3,7 @@ import Tag from "./tag.svelte";
|
|
|
3
3
|
import FaPlus from "svelte-icons/fa/FaPlus.svelte";
|
|
4
4
|
import Combo from "./combo/combo.svelte";
|
|
5
5
|
import ComboItem from "./combo/combo.item.svelte";
|
|
6
|
-
import { contextItemsStore, data_tick_store, contextTypesStore } from "../stores.js";
|
|
6
|
+
import { contextItemsStore, data_tick_store, contextTypesStore, tagsReloader } from "../stores.js";
|
|
7
7
|
import { informModification, pushChanges } from "../updates.js";
|
|
8
8
|
export let tags = "";
|
|
9
9
|
export let getGlobalTags;
|
|
@@ -17,6 +17,8 @@ export let canChangeColor = false;
|
|
|
17
17
|
export let compact = true;
|
|
18
18
|
export let inContext = "";
|
|
19
19
|
export let pushChangesImmediately = true;
|
|
20
|
+
export let allowNewTags = true;
|
|
21
|
+
export let readOnly = false;
|
|
20
22
|
export let changed = void 0;
|
|
21
23
|
export let s = "sm";
|
|
22
24
|
let userClass = $$props.class ?? "";
|
|
@@ -24,9 +26,9 @@ let item = null;
|
|
|
24
26
|
let ctx = context ? context : getContext("ctx");
|
|
25
27
|
let tagsTable = [];
|
|
26
28
|
let globalTagsTable = [];
|
|
27
|
-
let isEditable =
|
|
29
|
+
let isEditable = !readOnly;
|
|
28
30
|
$:
|
|
29
|
-
setup($data_tick_store, $contextItemsStore);
|
|
31
|
+
setup($data_tick_store, $contextItemsStore, $tagsReloader);
|
|
30
32
|
function setup(...args) {
|
|
31
33
|
const globalTags = getGlobalTags();
|
|
32
34
|
globalTagsTable = decomposeTags(globalTags);
|
|
@@ -51,17 +53,17 @@ function setup(...args) {
|
|
|
51
53
|
if (compact) {
|
|
52
54
|
isEditable = false;
|
|
53
55
|
if (!inContext)
|
|
54
|
-
isEditable =
|
|
56
|
+
isEditable = !readOnly;
|
|
55
57
|
else {
|
|
56
58
|
let contexts = inContext.split(" ");
|
|
57
59
|
contexts.forEach((ctx2) => {
|
|
58
60
|
const selectedItem = $contextItemsStore[ctx2];
|
|
59
61
|
if (selectedItem && selectedItem.Id == item.Id)
|
|
60
|
-
isEditable =
|
|
62
|
+
isEditable = !readOnly;
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
65
|
} else
|
|
64
|
-
isEditable =
|
|
66
|
+
isEditable = !readOnly;
|
|
65
67
|
}
|
|
66
68
|
let addComboVisible = false;
|
|
67
69
|
let addCombo;
|
|
@@ -113,6 +115,12 @@ function onNewTagCreated(key, name) {
|
|
|
113
115
|
applyChange();
|
|
114
116
|
onUpdateAllTags(globalTags);
|
|
115
117
|
}
|
|
118
|
+
function getCreateTagCallback() {
|
|
119
|
+
if (allowNewTags)
|
|
120
|
+
return onNewTagCreated;
|
|
121
|
+
else
|
|
122
|
+
return void 0;
|
|
123
|
+
}
|
|
116
124
|
function onColorizeTag(name, color) {
|
|
117
125
|
let globalTags = getGlobalTags();
|
|
118
126
|
globalTagsTable = decomposeTags(globalTags);
|
|
@@ -218,7 +226,7 @@ switch (s) {
|
|
|
218
226
|
<Combo compact={true}
|
|
219
227
|
inContext='data'
|
|
220
228
|
onSelect={onSelectTag}
|
|
221
|
-
onNewItemCreated={
|
|
229
|
+
onNewItemCreated={getCreateTagCallback()}
|
|
222
230
|
s={s}
|
|
223
231
|
filtered
|
|
224
232
|
bind:this={addCombo}>
|
|
@@ -14,6 +14,8 @@ declare const __propDef: {
|
|
|
14
14
|
compact?: boolean | undefined;
|
|
15
15
|
inContext?: string | undefined;
|
|
16
16
|
pushChangesImmediately?: boolean | undefined;
|
|
17
|
+
allowNewTags?: boolean | undefined;
|
|
18
|
+
readOnly?: boolean | undefined;
|
|
17
19
|
changed?: undefined;
|
|
18
20
|
s?: string | undefined;
|
|
19
21
|
show?: ((event: any, hideCallback: any) => Promise<void>) | undefined;
|
package/desk.svelte
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
set_dark_mode_default,
|
|
18
18
|
sidebar_left_pos,
|
|
19
19
|
wholeAppReloader,
|
|
20
|
-
alerts } from './stores.js'
|
|
20
|
+
alerts, removeAlert } from './stores.js'
|
|
21
21
|
|
|
22
22
|
//import { AuthorizedView} from '@humandialog/auth.svelte'
|
|
23
23
|
import { handleSelect, isDeviceSmallerThan, isOnNavigationPage, isOnScreenKeyboardVisible, removeAt, UI } from './utils'
|
|
@@ -213,6 +213,8 @@
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
onMount( () => {
|
|
216
|
+
|
|
217
|
+
|
|
216
218
|
window.addEventListener('resize', on_resize)
|
|
217
219
|
|
|
218
220
|
const vp = window.visualViewport;
|
|
@@ -223,6 +225,7 @@
|
|
|
223
225
|
//document.addEventListener('focusout', onFocusOut)
|
|
224
226
|
|
|
225
227
|
return () => {
|
|
228
|
+
|
|
226
229
|
// document.removeEventListener('focusout', onFocusOut)
|
|
227
230
|
document.removeEventListener('selectionchange', onSelectionChanged)
|
|
228
231
|
vp?.removeEventListener('resize', onViewportResize)
|
|
@@ -268,7 +271,7 @@
|
|
|
268
271
|
|
|
269
272
|
function onSelectionChanged(e)
|
|
270
273
|
{
|
|
271
|
-
console.log('onSelectionChanged')
|
|
274
|
+
//console.log('onSelectionChanged')
|
|
272
275
|
determineFABVisibilityAsync();
|
|
273
276
|
}
|
|
274
277
|
|
|
@@ -429,7 +432,7 @@
|
|
|
429
432
|
z-0 overflow-x-hidden
|
|
430
433
|
{content_height} sm:overflow-y-auto"
|
|
431
434
|
>
|
|
432
|
-
<Configurable config={layout.mainContent} min_h_class="min-h-
|
|
435
|
+
<Configurable config={layout.mainContent} min_h_class="min-h-screen">
|
|
433
436
|
<div slot='alt'></div>
|
|
434
437
|
</Configurable>
|
|
435
438
|
</div>
|
|
@@ -456,14 +459,14 @@
|
|
|
456
459
|
{#each $alerts as alert, idx}
|
|
457
460
|
<Alert class="bg-red-900/40 shadow-lg shadow-stone-400 dark:shadow-black flex flex-row">
|
|
458
461
|
<button class="sm:hidden font-bold ml-auto"
|
|
459
|
-
on:click={() => {
|
|
462
|
+
on:click={() => {removeAlert(alert)}}>
|
|
460
463
|
x
|
|
461
464
|
</button>
|
|
462
465
|
<p>
|
|
463
|
-
{alert}
|
|
466
|
+
{alert.msg}
|
|
464
467
|
</p>
|
|
465
468
|
<button class="hidden sm:block font-bold ml-auto"
|
|
466
|
-
on:click={() => {
|
|
469
|
+
on:click={() => {removeAlert(alert)}}>
|
|
467
470
|
x
|
|
468
471
|
</button>
|
|
469
472
|
</Alert>
|
package/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export { default as ListInserter } from './components/list/list.inserter.svelte'
|
|
|
39
39
|
export { default as ListDateProperty } from './components/list/list.date.svelte';
|
|
40
40
|
export { default as ListComboProperty } from './components/list/list.combo.svelte';
|
|
41
41
|
export { default as ListStaticProperty } from './components/list/list.static.svelte';
|
|
42
|
+
export { default as ListTags } from './components/list/list.tags.svelte';
|
|
42
43
|
export { default as Modal } from './modal.svelte';
|
|
43
44
|
export { default as MembersPage } from './tenant.members.svelte';
|
|
44
45
|
export { default as Console } from './console.svelte';
|
|
@@ -56,9 +57,13 @@ export { default as KanbanTagsProperty } from './components/kanban/kanban.tags.s
|
|
|
56
57
|
export { default as KanbanCallbacks } from './components/kanban/kanban.callbacks.svelte';
|
|
57
58
|
export { KanbanColumnTop, KanbanColumnBottom } from './components/kanban/Kanban';
|
|
58
59
|
export { selectItem, activateItem, clearActiveItem, isActive, isSelected, getActive, editable, startEditing, saveCurrentEditable, selectable, handleSelect, isDeviceSmallerThan, resizeImage, refreshToolbarOperations, isOnScreenKeyboardVisible, randomString, UI, } from './utils';
|
|
59
|
-
export { getFormattedStringDate, getNiceStringDate, dayName, monthName } from './components/date_utils';
|
|
60
|
-
export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp, alerts, addAlert, onErrorShowAlert, main_sidebar_visible_store } from './stores.js';
|
|
60
|
+
export { getNiceStringDateTime, getFormattedStringDate, getNiceStringDate, dayName, monthName } from './components/date_utils';
|
|
61
|
+
export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp, alerts, addAlert, onErrorShowAlert, main_sidebar_visible_store, tagsReloader, reloadVisibleTags } from './stores.js';
|
|
61
62
|
export { data_tick_store, // tmp
|
|
62
63
|
hasSelectedItem, hasDataItem, setNavigatorTitle } from "./stores";
|
|
63
64
|
export { contextToolbarOperations, pageToolbarOperations, contextItemsStore, contextTypesStore } from './stores';
|
|
64
65
|
export { informModification, informModificationEx, informItem, pushChanges } from './updates';
|
|
66
|
+
export { default as IcH1 } from './components/document/internal/h1.icon.svelte';
|
|
67
|
+
export { default as IcH2 } from './components/document/internal/h2.icon.svelte';
|
|
68
|
+
export { default as IcH3 } from './components/document/internal/h3.icon.svelte';
|
|
69
|
+
export { default as IcH4 } from './components/document/internal/h4.icon.svelte';
|
package/index.js
CHANGED
|
@@ -45,6 +45,7 @@ export { default as ListInserter } from './components/list/list.inserter.svelte'
|
|
|
45
45
|
export { default as ListDateProperty } from './components/list/list.date.svelte';
|
|
46
46
|
export { default as ListComboProperty } from './components/list/list.combo.svelte';
|
|
47
47
|
export { default as ListStaticProperty } from './components/list/list.static.svelte';
|
|
48
|
+
export { default as ListTags } from './components/list/list.tags.svelte';
|
|
48
49
|
export { default as Modal } from './modal.svelte';
|
|
49
50
|
export { default as MembersPage } from './tenant.members.svelte';
|
|
50
51
|
export { default as Console } from './console.svelte';
|
|
@@ -62,9 +63,13 @@ export { default as KanbanTagsProperty } from './components/kanban/kanban.tags.s
|
|
|
62
63
|
export { default as KanbanCallbacks } from './components/kanban/kanban.callbacks.svelte';
|
|
63
64
|
export { KanbanColumnTop, KanbanColumnBottom } from './components/kanban/Kanban';
|
|
64
65
|
export { selectItem, activateItem, clearActiveItem, isActive, isSelected, getActive, editable, startEditing, saveCurrentEditable, selectable, handleSelect, isDeviceSmallerThan, resizeImage, refreshToolbarOperations, isOnScreenKeyboardVisible, randomString, UI, } from './utils';
|
|
65
|
-
export { getFormattedStringDate, getNiceStringDate, dayName, monthName } from './components/date_utils';
|
|
66
|
-
export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp, alerts, addAlert, onErrorShowAlert, main_sidebar_visible_store } from './stores.js';
|
|
66
|
+
export { getNiceStringDateTime, getFormattedStringDate, getNiceStringDate, dayName, monthName } from './components/date_utils';
|
|
67
|
+
export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp, alerts, addAlert, onErrorShowAlert, main_sidebar_visible_store, tagsReloader, reloadVisibleTags } from './stores.js';
|
|
67
68
|
export { data_tick_store, // tmp
|
|
68
69
|
hasSelectedItem, hasDataItem, setNavigatorTitle } from "./stores";
|
|
69
70
|
export { contextToolbarOperations, pageToolbarOperations, contextItemsStore, contextTypesStore } from './stores'; // tmp
|
|
70
71
|
export { informModification, informModificationEx, informItem, pushChanges } from './updates'; // tmp
|
|
72
|
+
export { default as IcH1 } from './components/document/internal/h1.icon.svelte';
|
|
73
|
+
export { default as IcH2 } from './components/document/internal/h2.icon.svelte';
|
|
74
|
+
export { default as IcH3 } from './components/document/internal/h3.icon.svelte';
|
|
75
|
+
export { default as IcH4 } from './components/document/internal/h4.icon.svelte';
|
package/operations.svelte
CHANGED
|
@@ -6,21 +6,20 @@ $:
|
|
|
6
6
|
let operations = [];
|
|
7
7
|
let leftOperations = [];
|
|
8
8
|
let rightOperations = [];
|
|
9
|
+
let hasOperations = false;
|
|
9
10
|
function update(...args) {
|
|
10
|
-
let
|
|
11
|
+
let opVer = 0;
|
|
11
12
|
if ($contextToolbarOperations && Array.isArray($contextToolbarOperations) && $contextToolbarOperations.length > 0) {
|
|
12
13
|
operations = $contextToolbarOperations;
|
|
13
14
|
} else if ($contextToolbarOperations && $contextToolbarOperations.operations && $contextToolbarOperations.operations.length > 0) {
|
|
14
15
|
operations = $contextToolbarOperations.operations;
|
|
15
|
-
|
|
16
|
-
isOpVer1 = true;
|
|
16
|
+
opVer = $contextToolbarOperations.opver ?? 0;
|
|
17
17
|
} else {
|
|
18
18
|
if (Array.isArray($pageToolbarOperations))
|
|
19
19
|
operations = $pageToolbarOperations;
|
|
20
20
|
else {
|
|
21
21
|
operations = $pageToolbarOperations.operations;
|
|
22
|
-
|
|
23
|
-
isOpVer1 = true;
|
|
22
|
+
opVer = $pageToolbarOperations.opver ?? 0;
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
leftOperations = [];
|
|
@@ -28,7 +27,7 @@ function update(...args) {
|
|
|
28
27
|
let AOperations = [];
|
|
29
28
|
let BOperations = [];
|
|
30
29
|
let COperations = [];
|
|
31
|
-
if (
|
|
30
|
+
if (opVer == 1) {
|
|
32
31
|
operations.forEach((group) => {
|
|
33
32
|
if (group.operations && group.operations.length > 0) {
|
|
34
33
|
AOperations = [...AOperations, ...group.operations.filter((o) => o.tbr == "A")];
|
|
@@ -38,10 +37,56 @@ function update(...args) {
|
|
|
38
37
|
});
|
|
39
38
|
leftOperations = [...AOperations, ...BOperations];
|
|
40
39
|
rightOperations = [...COperations];
|
|
40
|
+
} else if (opVer == 2) {
|
|
41
|
+
operations.forEach((group) => {
|
|
42
|
+
if (group.tbr) {
|
|
43
|
+
const expandOperation = {
|
|
44
|
+
caption: group.caption ?? "",
|
|
45
|
+
icon: group.icon ?? void 0,
|
|
46
|
+
preAction: group.preAction,
|
|
47
|
+
activeFunc: group.activeFunc,
|
|
48
|
+
menu: group.operations
|
|
49
|
+
};
|
|
50
|
+
switch (group.tbr) {
|
|
51
|
+
case "A":
|
|
52
|
+
AOperations.push(expandOperation);
|
|
53
|
+
break;
|
|
54
|
+
case "B":
|
|
55
|
+
BOperations.push(expandOperation);
|
|
56
|
+
break;
|
|
57
|
+
case "C":
|
|
58
|
+
COperations.push(expandOperation);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
group.operations.forEach((op) => {
|
|
63
|
+
if (op.tbr) {
|
|
64
|
+
const tbrOperation = {
|
|
65
|
+
...op
|
|
66
|
+
};
|
|
67
|
+
if (op.hideToolbarCaption)
|
|
68
|
+
tbrOperation.caption = "";
|
|
69
|
+
switch (op.tbr) {
|
|
70
|
+
case "A":
|
|
71
|
+
AOperations.push(tbrOperation);
|
|
72
|
+
break;
|
|
73
|
+
case "B":
|
|
74
|
+
BOperations.push(tbrOperation);
|
|
75
|
+
break;
|
|
76
|
+
case "C":
|
|
77
|
+
COperations.push(tbrOperation);
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
leftOperations = [...AOperations, ...BOperations];
|
|
84
|
+
rightOperations = [...COperations];
|
|
41
85
|
} else {
|
|
42
86
|
leftOperations = operations.filter((o) => !o.right);
|
|
43
87
|
rightOperations = operations.filter((o) => o.right == true);
|
|
44
88
|
}
|
|
89
|
+
hasOperations = leftOperations.length > 0 || rightOperations.length > 0;
|
|
45
90
|
}
|
|
46
91
|
function on_click(e, operation) {
|
|
47
92
|
if (!operation)
|
|
@@ -49,6 +94,8 @@ function on_click(e, operation) {
|
|
|
49
94
|
let owner = e.target;
|
|
50
95
|
while (owner && owner.tagName != "BUTTON")
|
|
51
96
|
owner = owner.parentElement;
|
|
97
|
+
if (operation.preAction)
|
|
98
|
+
operation.preAction(owner);
|
|
52
99
|
if (operation.action) {
|
|
53
100
|
operation.action(owner);
|
|
54
101
|
return;
|
|
@@ -74,6 +121,7 @@ function isOperationActivated(operation) {
|
|
|
74
121
|
}
|
|
75
122
|
</script>
|
|
76
123
|
|
|
124
|
+
{#if hasOperations}
|
|
77
125
|
<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 whitespace-nowrap">
|
|
78
126
|
<div class="flex flex-row"
|
|
79
127
|
class:flex-row-reverse={mobile}>
|
|
@@ -85,7 +133,7 @@ function isOperationActivated(operation) {
|
|
|
85
133
|
{#each operation.toolbox as operation}
|
|
86
134
|
<button type="button"
|
|
87
135
|
class="py-2.5 px-4
|
|
88
|
-
text-
|
|
136
|
+
text-sm font-thin text-stone-100 dark:text-stone-300 dark:hover:text-white
|
|
89
137
|
hover:bg-stone-700 dark:hover:bg-stone-800 active:bg-stone-300 dark:active:bg-stone-600
|
|
90
138
|
border-stone-200 focus:outline-none dark:border-stone-600
|
|
91
139
|
inline-flex items-center"
|
|
@@ -94,7 +142,7 @@ function isOperationActivated(operation) {
|
|
|
94
142
|
on:click={(e) => {on_click(e, operation)}}
|
|
95
143
|
on:mousedown={mousedown}>
|
|
96
144
|
{#if operation.icon}
|
|
97
|
-
<div class="w-
|
|
145
|
+
<div class="w-5 h-5 mr-1"><svelte:component this={operation.icon}/></div>
|
|
98
146
|
{/if}
|
|
99
147
|
{#if operation.caption}
|
|
100
148
|
<span class="ml-1">{operation.caption}</span>
|
|
@@ -105,7 +153,7 @@ function isOperationActivated(operation) {
|
|
|
105
153
|
|
|
106
154
|
<button type="button"
|
|
107
155
|
class="py-2.5 px-4
|
|
108
|
-
text-
|
|
156
|
+
text-sm font-thin text-stone-100 dark:text-stone-300 dark:hover:text-white
|
|
109
157
|
hover:bg-stone-700 dark:hover:bg-stone-800 active:bg-stone-300 dark:active:bg-stone-600
|
|
110
158
|
border-stone-200 focus:outline-none dark:border-stone-600
|
|
111
159
|
inline-flex items-center"
|
|
@@ -114,7 +162,7 @@ function isOperationActivated(operation) {
|
|
|
114
162
|
on:click={(e) => {on_click(e, operation)}}
|
|
115
163
|
on:mousedown={mousedown}>
|
|
116
164
|
{#if operation.icon}
|
|
117
|
-
<div class="w-
|
|
165
|
+
<div class="w-5 h-5 mr-1"><svelte:component this={operation.icon}/></div>
|
|
118
166
|
{/if}
|
|
119
167
|
{#if operation.caption}
|
|
120
168
|
<span class="ml-1">{operation.caption}</span>
|
|
@@ -133,7 +181,7 @@ function isOperationActivated(operation) {
|
|
|
133
181
|
{@const isActive=isOperationActivated(operation)}
|
|
134
182
|
<button type="button"
|
|
135
183
|
class="py-2.5 px-4
|
|
136
|
-
text-
|
|
184
|
+
text-sm font-thin text-stone-100 dark:text-stone-300 dark:hover:text-white
|
|
137
185
|
hover:bg-stone-700 dark:hover:bg-stone-800 active:bg-stone-300 dark:active:bg-stone-600
|
|
138
186
|
border-stone-200 focus:outline-none dark:border-stone-600
|
|
139
187
|
inline-flex items-center"
|
|
@@ -142,7 +190,7 @@ function isOperationActivated(operation) {
|
|
|
142
190
|
on:click={(e) => {on_click(e, operation)}}
|
|
143
191
|
on:mousedown={mousedown}>
|
|
144
192
|
{#if operation.icon}
|
|
145
|
-
<div class="w-
|
|
193
|
+
<div class="w-5 h-5 mr-1"><svelte:component this={operation.icon}/></div>
|
|
146
194
|
{/if}
|
|
147
195
|
{#if operation.caption}
|
|
148
196
|
<span class="ml-1">{operation.caption}</span>
|
|
@@ -152,6 +200,7 @@ function isOperationActivated(operation) {
|
|
|
152
200
|
{/each}
|
|
153
201
|
</div>
|
|
154
202
|
</section>
|
|
203
|
+
{/if}
|
|
155
204
|
|
|
156
205
|
<style>
|
|
157
206
|
@media print
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humandialog/forms.svelte",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
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.8",
|
|
30
30
|
"@tiptap/core": "^2.11.0",
|
|
31
31
|
"@tiptap/extension-bullet-list": "^2.11.5",
|
|
32
32
|
"@tiptap/extension-code-block": "^2.11.5",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@tiptap/suggestion": "^2.11.0",
|
|
44
44
|
"flowbite-svelte": "^0.44.4",
|
|
45
45
|
"pdfjs-dist": "^4.10.38",
|
|
46
|
+
"qs": "^6.14.0",
|
|
46
47
|
"svelte-icons": "^2.1.0",
|
|
47
48
|
"svelte-spa-router": "^4.0.1"
|
|
48
49
|
},
|
|
@@ -125,6 +126,7 @@
|
|
|
125
126
|
"./components/list/list.static.svelte": "./components/list/list.static.svelte",
|
|
126
127
|
"./components/list/list.summary.svelte": "./components/list/list.summary.svelte",
|
|
127
128
|
"./components/list/list.svelte": "./components/list/list.svelte",
|
|
129
|
+
"./components/list/list.tags.svelte": "./components/list/list.tags.svelte",
|
|
128
130
|
"./components/list/list.title.svelte": "./components/list/list.title.svelte",
|
|
129
131
|
"./components/list/List": "./components/list/List.js",
|
|
130
132
|
"./components/menu": "./components/menu.js",
|
package/stores.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export function hasSelectedItem(): boolean;
|
|
|
5
5
|
export function hasDataItem(): boolean;
|
|
6
6
|
export function reloadMainContentPage(): void;
|
|
7
7
|
export function reloadWholeApp(): void;
|
|
8
|
+
export function reloadVisibleTags(): void;
|
|
8
9
|
export function set_dark_mode_default(value: any): void;
|
|
9
10
|
export function set_default_tools_visible(value: any, force: any): void;
|
|
10
11
|
export function restore_defults(): void;
|
|
@@ -35,7 +36,9 @@ export const nav_titles: import("svelte/store").Writable<{}>;
|
|
|
35
36
|
export const mainContentPageReloader: import("svelte/store").Writable<number>;
|
|
36
37
|
export const wholeAppReloader: import("svelte/store").Writable<number>;
|
|
37
38
|
export const alerts: import("svelte/store").Writable<never[]>;
|
|
39
|
+
export const tagsReloader: import("svelte/store").Writable<number>;
|
|
38
40
|
export function addAlert(txt: any): void;
|
|
41
|
+
export function removeAlert(alert: any): void;
|
|
39
42
|
export function onErrorShowAlert(txt: any): void;
|
|
40
43
|
export const dark_mode_store: import("svelte/store").Writable<any>;
|
|
41
44
|
export const main_sidebar_visible_store: import("svelte/store").Writable<any>;
|
package/stores.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import {writable, get} from 'svelte/store';
|
|
3
|
-
import {SCREEN_SIZES} from './utils.js'
|
|
3
|
+
import {SCREEN_SIZES, randomString} from './utils.js'
|
|
4
4
|
|
|
5
5
|
export const data_tick_store = writable(1);
|
|
6
6
|
export const contextItemsStore = writable({focused:'', data: null, sel: null})
|
|
@@ -14,6 +14,7 @@ export const nav_titles = writable({});
|
|
|
14
14
|
export const mainContentPageReloader = writable(1);
|
|
15
15
|
export const wholeAppReloader = writable(1)
|
|
16
16
|
export const alerts = writable([])
|
|
17
|
+
export const tagsReloader = writable(1)
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
let toolsActionsOperationsStack = []
|
|
@@ -42,10 +43,26 @@ export function popToolsActionsOperations()
|
|
|
42
43
|
|
|
43
44
|
export const addAlert = (txt) => {
|
|
44
45
|
let al = get(alerts)
|
|
45
|
-
|
|
46
|
+
const alert = {
|
|
47
|
+
msg: txt,
|
|
48
|
+
id: randomString(6),
|
|
49
|
+
timeoutId: setTimeout(() => removeAlert(alert), 10000)
|
|
50
|
+
}
|
|
51
|
+
al = [alert, ...al];
|
|
46
52
|
alerts.set(al);
|
|
47
53
|
}
|
|
48
54
|
|
|
55
|
+
export const removeAlert = (alert) => {
|
|
56
|
+
let al = get(alerts)
|
|
57
|
+
const idx = al.findIndex((a) => a.id == alert.id)
|
|
58
|
+
if(idx >= 0)
|
|
59
|
+
{
|
|
60
|
+
clearTimeout(alert.timeoutId)
|
|
61
|
+
al.splice(idx, 1)
|
|
62
|
+
alerts.set(al)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
49
66
|
export const onErrorShowAlert = addAlert;
|
|
50
67
|
|
|
51
68
|
export function setNavigatorTitle(key, title)
|
|
@@ -81,6 +98,12 @@ export function reloadWholeApp()
|
|
|
81
98
|
wholeAppReloader.set(val);
|
|
82
99
|
}
|
|
83
100
|
|
|
101
|
+
export function reloadVisibleTags()
|
|
102
|
+
{
|
|
103
|
+
let val = get(tagsReloader);
|
|
104
|
+
val += 1;
|
|
105
|
+
tagsReloader.set(val);
|
|
106
|
+
}
|
|
84
107
|
|
|
85
108
|
let has_saved_dark_mode = false;
|
|
86
109
|
function create_dark_mode_store()
|