@humandialog/forms.svelte 1.3.17 → 1.4.1
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 +99 -48
- package/components/combo/combo.svelte +18 -15
- package/components/combo/combo.svelte.d.ts +1 -0
- package/components/contextmenu.svelte +54 -16
- 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 +22 -0
- package/components/kanban/internal/kanban.card.svelte +2 -2
- package/components/kanban/internal/kanban.props.svelte +1 -1
- 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 +20 -8
- 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.tags.svelte +32 -0
- package/components/list/list.tags.svelte.d.ts +24 -0
- package/components/menu.js +4 -0
- package/components/sidebar/sidebar.item.svelte +15 -11
- package/components/tags.svelte +15 -7
- package/components/tags.svelte.d.ts +2 -0
- package/desk.svelte +5 -5
- package/horizontal.toolbar.svelte +41 -14
- package/horizontal.toolbar.svelte.d.ts +6 -2
- package/index.d.ts +8 -2
- package/index.js +8 -2
- package/operations.svelte +71 -19
- package/package.json +4 -2
- package/stores.d.ts +3 -0
- package/stores.js +25 -2
- package/tenant.members.svelte +63 -59
- package/tenant.members.svelte.d.ts +2 -0
- package/vertical.toolbar.svelte +51 -23
- package/vertical.toolbar.svelte.d.ts +6 -2
|
@@ -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'
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
|
|
272
272
|
function onSelectionChanged(e)
|
|
273
273
|
{
|
|
274
|
-
console.log('onSelectionChanged')
|
|
274
|
+
//console.log('onSelectionChanged')
|
|
275
275
|
determineFABVisibilityAsync();
|
|
276
276
|
}
|
|
277
277
|
|
|
@@ -459,14 +459,14 @@
|
|
|
459
459
|
{#each $alerts as alert, idx}
|
|
460
460
|
<Alert class="bg-red-900/40 shadow-lg shadow-stone-400 dark:shadow-black flex flex-row">
|
|
461
461
|
<button class="sm:hidden font-bold ml-auto"
|
|
462
|
-
on:click={() => {
|
|
462
|
+
on:click={() => {removeAlert(alert)}}>
|
|
463
463
|
x
|
|
464
464
|
</button>
|
|
465
465
|
<p>
|
|
466
|
-
{alert}
|
|
466
|
+
{alert.msg}
|
|
467
467
|
</p>
|
|
468
468
|
<button class="hidden sm:block font-bold ml-auto"
|
|
469
|
-
on:click={() => {
|
|
469
|
+
on:click={() => {removeAlert(alert)}}>
|
|
470
470
|
x
|
|
471
471
|
</button>
|
|
472
472
|
</Alert>
|
|
@@ -27,8 +27,11 @@
|
|
|
27
27
|
import { isDeviceSmallerThan, isOnNavigationPage, pushNavigationPage, popNavigationPage } from './utils.js';
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
export let appConfig;
|
|
30
|
+
export let appConfig = undefined;
|
|
31
31
|
export let clearsContext = 'sel props'
|
|
32
|
+
|
|
33
|
+
export let definedTabs = undefined
|
|
34
|
+
export let mainToolbarConfig = undefined
|
|
32
35
|
|
|
33
36
|
let config = null;
|
|
34
37
|
let has_selection_details = false;
|
|
@@ -45,23 +48,39 @@
|
|
|
45
48
|
|
|
46
49
|
$:
|
|
47
50
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
if(appConfig)
|
|
52
|
+
{
|
|
53
|
+
config = appConfig.mainToolbar;
|
|
54
|
+
has_selection_details = appConfig.selectionDetails;
|
|
55
|
+
if(has_selection_details)
|
|
56
|
+
selection_details_caption = appConfig.selectionDetails.caption ?? 'Properties';
|
|
57
|
+
}
|
|
58
|
+
else
|
|
59
|
+
{
|
|
60
|
+
config = mainToolbarConfig
|
|
61
|
+
has_selection_details = false
|
|
62
|
+
}
|
|
63
|
+
|
|
52
64
|
is_logged_in = $session.isActive;
|
|
53
65
|
show_sign_in_out_icons = config.signin ? true : false;
|
|
54
66
|
sign_in_href = $signInHRef;
|
|
55
67
|
sign_out_href = $signOutHRef;
|
|
56
68
|
//user_is_in_multiple_groups = $session.tenants.length > 1
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
if(tabs.length > 1)
|
|
60
|
-
icon = FaBars;
|
|
61
|
-
else
|
|
70
|
+
if(definedTabs && Array.isArray(definedTabs) && definedTabs.length > 0)
|
|
62
71
|
{
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
else
|
|
75
|
+
{
|
|
76
|
+
tabs = Object.keys(appConfig.sidebar);
|
|
77
|
+
if(tabs.length > 1)
|
|
78
|
+
icon = FaBars;
|
|
79
|
+
else
|
|
80
|
+
{
|
|
81
|
+
let first_tab = appConfig.sidebar[tabs[0]];
|
|
82
|
+
icon = first_tab.icon;
|
|
83
|
+
}
|
|
65
84
|
}
|
|
66
85
|
}
|
|
67
86
|
|
|
@@ -283,9 +302,17 @@
|
|
|
283
302
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
284
303
|
<div class="no-print flex flex-row w-full" on:click={clearSelection}>
|
|
285
304
|
<div class="flex-none left-0 flex h-12 sm:h-10">
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
305
|
+
{#if definedTabs && definedTabs.length > 0}
|
|
306
|
+
{#each definedTabs as tab}
|
|
307
|
+
<button class="w-12 sm:w-10 h-full flex justify-center items-center text-stone-300 hover:text-stone-100" on:click={tab.onclick}>
|
|
308
|
+
<Icon class="w-5 h-5" component={tab.icon}/>
|
|
309
|
+
</button>
|
|
310
|
+
{/each}
|
|
311
|
+
{:else}
|
|
312
|
+
<button class="w-12 sm:w-10 h-full flex justify-center items-center text-stone-300 hover:text-stone-100" on:click|stopPropagation={toggle_navigator}>
|
|
313
|
+
<Icon class="w-5 h-5" component={icon}/>
|
|
314
|
+
</button>
|
|
315
|
+
{/if}
|
|
289
316
|
</div>
|
|
290
317
|
|
|
291
318
|
<div class="grow">
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} HorizontalEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} HorizontalSlots */
|
|
4
4
|
export default class Horizontal extends SvelteComponentTyped<{
|
|
5
|
-
appConfig
|
|
5
|
+
appConfig?: any;
|
|
6
6
|
clearsContext?: string | undefined;
|
|
7
|
+
definedTabs?: any;
|
|
8
|
+
mainToolbarConfig?: any;
|
|
7
9
|
}, {
|
|
8
10
|
[evt: string]: CustomEvent<any>;
|
|
9
11
|
}, {}> {
|
|
@@ -14,8 +16,10 @@ export type HorizontalSlots = typeof __propDef.slots;
|
|
|
14
16
|
import { SvelteComponentTyped } from "svelte";
|
|
15
17
|
declare const __propDef: {
|
|
16
18
|
props: {
|
|
17
|
-
appConfig
|
|
19
|
+
appConfig?: any;
|
|
18
20
|
clearsContext?: string | undefined;
|
|
21
|
+
definedTabs?: any;
|
|
22
|
+
mainToolbarConfig?: any;
|
|
19
23
|
};
|
|
20
24
|
events: {
|
|
21
25
|
[evt: string]: CustomEvent<any>;
|
package/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as Box } from "./form.box.svelte";
|
|
|
5
5
|
export { default as Operations } from './operations.svelte';
|
|
6
6
|
export { default as Layout } from './desk.svelte';
|
|
7
7
|
export { default as VerticalToolbar } from './vertical.toolbar.svelte';
|
|
8
|
+
export { default as HorizontalToolbar } from './horizontal.toolbar.svelte';
|
|
8
9
|
export { default as Icon } from "./components/icon.svelte";
|
|
9
10
|
export { default as IconT } from "./components/icon.ex.svelte";
|
|
10
11
|
export { default as Button } from './components/button.svelte';
|
|
@@ -39,6 +40,7 @@ export { default as ListInserter } from './components/list/list.inserter.svelte'
|
|
|
39
40
|
export { default as ListDateProperty } from './components/list/list.date.svelte';
|
|
40
41
|
export { default as ListComboProperty } from './components/list/list.combo.svelte';
|
|
41
42
|
export { default as ListStaticProperty } from './components/list/list.static.svelte';
|
|
43
|
+
export { default as ListTags } from './components/list/list.tags.svelte';
|
|
42
44
|
export { default as Modal } from './modal.svelte';
|
|
43
45
|
export { default as MembersPage } from './tenant.members.svelte';
|
|
44
46
|
export { default as Console } from './console.svelte';
|
|
@@ -56,9 +58,13 @@ export { default as KanbanTagsProperty } from './components/kanban/kanban.tags.s
|
|
|
56
58
|
export { default as KanbanCallbacks } from './components/kanban/kanban.callbacks.svelte';
|
|
57
59
|
export { KanbanColumnTop, KanbanColumnBottom } from './components/kanban/Kanban';
|
|
58
60
|
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';
|
|
61
|
+
export { getNiceStringDateTime, getFormattedStringDate, getNiceStringDate, dayName, monthName } from './components/date_utils';
|
|
62
|
+
export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp, alerts, addAlert, onErrorShowAlert, main_sidebar_visible_store, tagsReloader, reloadVisibleTags, dark_mode_store } from './stores.js';
|
|
61
63
|
export { data_tick_store, // tmp
|
|
62
64
|
hasSelectedItem, hasDataItem, setNavigatorTitle } from "./stores";
|
|
63
65
|
export { contextToolbarOperations, pageToolbarOperations, contextItemsStore, contextTypesStore } from './stores';
|
|
64
66
|
export { informModification, informModificationEx, informItem, pushChanges } from './updates';
|
|
67
|
+
export { default as IcH1 } from './components/document/internal/h1.icon.svelte';
|
|
68
|
+
export { default as IcH2 } from './components/document/internal/h2.icon.svelte';
|
|
69
|
+
export { default as IcH3 } from './components/document/internal/h3.icon.svelte';
|
|
70
|
+
export { default as IcH4 } from './components/document/internal/h4.icon.svelte';
|
package/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { default as Box } from "./form.box.svelte";
|
|
|
9
9
|
export { default as Operations } from './operations.svelte';
|
|
10
10
|
export { default as Layout } from './desk.svelte';
|
|
11
11
|
export { default as VerticalToolbar } from './vertical.toolbar.svelte';
|
|
12
|
+
export { default as HorizontalToolbar } from './horizontal.toolbar.svelte';
|
|
12
13
|
// @ts-ignore
|
|
13
14
|
export { default as Icon } from "./components/icon.svelte";
|
|
14
15
|
export { default as IconT } from "./components/icon.ex.svelte";
|
|
@@ -45,6 +46,7 @@ export { default as ListInserter } from './components/list/list.inserter.svelte'
|
|
|
45
46
|
export { default as ListDateProperty } from './components/list/list.date.svelte';
|
|
46
47
|
export { default as ListComboProperty } from './components/list/list.combo.svelte';
|
|
47
48
|
export { default as ListStaticProperty } from './components/list/list.static.svelte';
|
|
49
|
+
export { default as ListTags } from './components/list/list.tags.svelte';
|
|
48
50
|
export { default as Modal } from './modal.svelte';
|
|
49
51
|
export { default as MembersPage } from './tenant.members.svelte';
|
|
50
52
|
export { default as Console } from './console.svelte';
|
|
@@ -62,9 +64,13 @@ export { default as KanbanTagsProperty } from './components/kanban/kanban.tags.s
|
|
|
62
64
|
export { default as KanbanCallbacks } from './components/kanban/kanban.callbacks.svelte';
|
|
63
65
|
export { KanbanColumnTop, KanbanColumnBottom } from './components/kanban/Kanban';
|
|
64
66
|
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';
|
|
67
|
+
export { getNiceStringDateTime, getFormattedStringDate, getNiceStringDate, dayName, monthName } from './components/date_utils';
|
|
68
|
+
export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp, alerts, addAlert, onErrorShowAlert, main_sidebar_visible_store, tagsReloader, reloadVisibleTags, dark_mode_store } from './stores.js';
|
|
67
69
|
export { data_tick_store, // tmp
|
|
68
70
|
hasSelectedItem, hasDataItem, setNavigatorTitle } from "./stores";
|
|
69
71
|
export { contextToolbarOperations, pageToolbarOperations, contextItemsStore, contextTypesStore } from './stores'; // tmp
|
|
70
72
|
export { informModification, informModificationEx, informItem, pushChanges } from './updates'; // tmp
|
|
73
|
+
export { default as IcH1 } from './components/document/internal/h1.icon.svelte';
|
|
74
|
+
export { default as IcH2 } from './components/document/internal/h2.icon.svelte';
|
|
75
|
+
export { default as IcH3 } from './components/document/internal/h3.icon.svelte';
|
|
76
|
+
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,7 +121,8 @@ function isOperationActivated(operation) {
|
|
|
74
121
|
}
|
|
75
122
|
</script>
|
|
76
123
|
|
|
77
|
-
|
|
124
|
+
{#if hasOperations}
|
|
125
|
+
<section class="flex flex-row no-print h-10 bg-stone-50 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}>
|
|
80
128
|
|
|
@@ -85,16 +133,17 @@ 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-
|
|
89
|
-
|
|
90
|
-
|
|
136
|
+
text-sm font-thin
|
|
137
|
+
text-stone-800 hover:bg-stone-700 active:bg-stone-300 border-stone-200
|
|
138
|
+
dark:text-stone-300 dark:hover:text-white dark:hover:bg-stone-800 dark:active:bg-stone-600 dark:border-stone-600
|
|
139
|
+
focus:outline-none
|
|
91
140
|
inline-flex items-center"
|
|
92
141
|
class:bg-stone-700={isActive}
|
|
93
142
|
class:dark:bg-stone-800={isActive}
|
|
94
143
|
on:click={(e) => {on_click(e, operation)}}
|
|
95
144
|
on:mousedown={mousedown}>
|
|
96
145
|
{#if operation.icon}
|
|
97
|
-
<div class="w-
|
|
146
|
+
<div class="w-5 h-5 mr-1"><svelte:component this={operation.icon}/></div>
|
|
98
147
|
{/if}
|
|
99
148
|
{#if operation.caption}
|
|
100
149
|
<span class="ml-1">{operation.caption}</span>
|
|
@@ -105,16 +154,17 @@ function isOperationActivated(operation) {
|
|
|
105
154
|
|
|
106
155
|
<button type="button"
|
|
107
156
|
class="py-2.5 px-4
|
|
108
|
-
text-
|
|
109
|
-
|
|
110
|
-
|
|
157
|
+
text-sm font-thin
|
|
158
|
+
text-stone-600 hover:text-stone-800 hover:bg-stone-200 active:bg-stone-200 border-stone-200
|
|
159
|
+
dark:text-stone-300 dark:hover:text-white dark:hover:bg-stone-800 dark:active:bg-stone-600 dark:border-stone-600
|
|
160
|
+
focus:outline-none
|
|
111
161
|
inline-flex items-center"
|
|
112
162
|
class:bg-stone-700={isActive}
|
|
113
163
|
class:dark:bg-stone-800={isActive}
|
|
114
164
|
on:click={(e) => {on_click(e, operation)}}
|
|
115
165
|
on:mousedown={mousedown}>
|
|
116
166
|
{#if operation.icon}
|
|
117
|
-
<div class="w-
|
|
167
|
+
<div class="w-5 h-5 mr-1"><svelte:component this={operation.icon}/></div>
|
|
118
168
|
{/if}
|
|
119
169
|
{#if operation.caption}
|
|
120
170
|
<span class="ml-1">{operation.caption}</span>
|
|
@@ -133,16 +183,17 @@ function isOperationActivated(operation) {
|
|
|
133
183
|
{@const isActive=isOperationActivated(operation)}
|
|
134
184
|
<button type="button"
|
|
135
185
|
class="py-2.5 px-4
|
|
136
|
-
text-
|
|
137
|
-
|
|
138
|
-
|
|
186
|
+
text-sm font-thin
|
|
187
|
+
text-stone-600 hover:text-stone-800 hover:bg-stone-200 active:bg-stone-200 border-stone-200
|
|
188
|
+
dark:text-stone-300 dark:hover:text-white dark:hover:bg-stone-800 dark:active:bg-stone-600 dark:border-stone-600
|
|
189
|
+
focus:outline-none
|
|
139
190
|
inline-flex items-center"
|
|
140
191
|
class:bg-stone-700={isActive}
|
|
141
192
|
class:dark:bg-stone-800={isActive}
|
|
142
193
|
on:click={(e) => {on_click(e, operation)}}
|
|
143
194
|
on:mousedown={mousedown}>
|
|
144
195
|
{#if operation.icon}
|
|
145
|
-
<div class="w-
|
|
196
|
+
<div class="w-5 h-5 mr-1"><svelte:component this={operation.icon}/></div>
|
|
146
197
|
{/if}
|
|
147
198
|
{#if operation.caption}
|
|
148
199
|
<span class="ml-1">{operation.caption}</span>
|
|
@@ -152,6 +203,7 @@ function isOperationActivated(operation) {
|
|
|
152
203
|
{/each}
|
|
153
204
|
</div>
|
|
154
205
|
</section>
|
|
206
|
+
{/if}
|
|
155
207
|
|
|
156
208
|
<style>
|
|
157
209
|
@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.1",
|
|
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()
|