@humandialog/forms.svelte 0.4.12 → 0.4.14
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/Floating_container.svelte +43 -10
- package/components/Floating_container.svelte.d.ts +4 -2
- package/components/Grid.menu.svelte +3 -3
- package/components/Grid.menu.svelte.d.ts +2 -2
- package/components/combo/combo.svelte +6 -8
- package/components/contextmenu.svelte +23 -9
- package/components/contextmenu.svelte.d.ts +4 -2
- package/components/date.svelte +130 -22
- package/components/date.svelte.d.ts +7 -0
- package/components/menu.d.ts +3 -3
- package/components/menu.js +20 -10
- package/components/sidebar/sidebar.brand.svelte +16 -0
- package/components/sidebar/sidebar.brand.svelte.d.ts +29 -0
- package/components/sidebar/sidebar.group.svelte +21 -0
- package/components/sidebar/sidebar.group.svelte.d.ts +31 -0
- package/components/sidebar/sidebar.item.svelte +60 -0
- package/components/sidebar/sidebar.item.svelte.d.ts +25 -0
- package/components/sidebar/sidebar.svelte +9 -0
- package/components/sidebar/sidebar.svelte.d.ts +27 -0
- package/components/simple.table.svelte.d.ts +2 -2
- package/components/table/_template.table.svelte.d.ts +2 -2
- package/components/table/table.svelte +1 -1
- package/desk.svelte +57 -33
- package/horizontal.toolbar.svelte +11 -5
- package/index.d.ts +6 -1
- package/index.js +6 -1
- package/operations.svelte +11 -5
- package/operations.svelte.d.ts +3 -1
- package/package.json +6 -2
- package/utils.d.ts +20 -0
- package/utils.js +224 -1
- package/vertical.toolbar.svelte +11 -4
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} SidebarProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} SidebarEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} SidebarSlots */
|
|
4
|
+
export default class Sidebar extends SvelteComponentTyped<{
|
|
5
|
+
inserter?: any;
|
|
6
|
+
border?: boolean | undefined;
|
|
7
|
+
inserter_placeholder?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
}, {
|
|
11
|
+
default: {};
|
|
12
|
+
}> {
|
|
13
|
+
}
|
|
14
|
+
export type SidebarProps = typeof __propDef.props;
|
|
15
|
+
export type SidebarEvents = typeof __propDef.events;
|
|
16
|
+
export type SidebarSlots = typeof __propDef.slots;
|
|
17
|
+
import { SvelteComponentTyped } from "svelte";
|
|
18
|
+
declare const __propDef: {
|
|
19
|
+
props: {
|
|
20
|
+
inserter?: any;
|
|
21
|
+
border?: boolean | undefined;
|
|
22
|
+
inserter_placeholder?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
};
|
|
27
|
+
slots: {
|
|
28
|
+
default: {};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script>import Icon from "../icon.svelte";
|
|
2
|
+
import { context_items_store, auto_hide_sidebar } from "../../stores";
|
|
3
|
+
import {
|
|
4
|
+
selectable as _selectable,
|
|
5
|
+
is_selected,
|
|
6
|
+
editable as _editable
|
|
7
|
+
} from "../../utils";
|
|
8
|
+
export let href;
|
|
9
|
+
export let icon = void 0;
|
|
10
|
+
export let active = false;
|
|
11
|
+
export let selectable = void 0;
|
|
12
|
+
export let editable = void 0;
|
|
13
|
+
$:
|
|
14
|
+
context_data = $context_items_store;
|
|
15
|
+
let user_class = $$props.class ?? "";
|
|
16
|
+
function selectable_if_needed(node, selectable2) {
|
|
17
|
+
if (selectable2)
|
|
18
|
+
_selectable(node, selectable2);
|
|
19
|
+
}
|
|
20
|
+
function selected(itm, context_data2) {
|
|
21
|
+
if (is_selected(itm))
|
|
22
|
+
return true;
|
|
23
|
+
else
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
function editable_if_needed(node, editable2) {
|
|
27
|
+
if (editable2)
|
|
28
|
+
_editable(node, editable2);
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<li>
|
|
33
|
+
<a
|
|
34
|
+
href={href}
|
|
35
|
+
on:click={ (e) => auto_hide_sidebar() }
|
|
36
|
+
on:contextmenu
|
|
37
|
+
class="flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 border-2 border-transparent {user_class}"
|
|
38
|
+
class:bg-gray-200={active}
|
|
39
|
+
class:dark:bg-gray-700={active}
|
|
40
|
+
use:selectable_if_needed={selectable}
|
|
41
|
+
class:selected={selected(selectable, context_data)}
|
|
42
|
+
>
|
|
43
|
+
{#if icon}
|
|
44
|
+
<Icon size={5} component={icon}/>
|
|
45
|
+
{/if}
|
|
46
|
+
<span class="ml-3"
|
|
47
|
+
use:editable_if_needed={editable}>
|
|
48
|
+
<slot/>
|
|
49
|
+
</span>
|
|
50
|
+
</a>
|
|
51
|
+
</li>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<style>
|
|
55
|
+
.selected {
|
|
56
|
+
border-width: 2px;
|
|
57
|
+
--tw-border-opacity: 1 !important;
|
|
58
|
+
border-color: rgb(147 197 253 / var(--tw-border-opacity)) !important
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
href: string;
|
|
6
|
+
icon?: any | undefined;
|
|
7
|
+
active?: boolean | undefined;
|
|
8
|
+
selectable?: any | undefined;
|
|
9
|
+
editable?: any | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
contextmenu: MouseEvent;
|
|
13
|
+
} & {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {
|
|
17
|
+
default: {};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type SidebarProps = typeof __propDef.props;
|
|
21
|
+
export type SidebarEvents = typeof __propDef.events;
|
|
22
|
+
export type SidebarSlots = typeof __propDef.slots;
|
|
23
|
+
export default class Sidebar extends SvelteComponentTyped<SidebarProps, SidebarEvents, SidebarSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} SidebarProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} SidebarEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} SidebarSlots */
|
|
4
|
+
export default class Sidebar extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type SidebarProps = typeof __propDef.props;
|
|
13
|
+
export type SidebarEvents = typeof __propDef.events;
|
|
14
|
+
export type SidebarSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
[x: string]: never;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} SimpleEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SimpleSlots */
|
|
4
4
|
export default class Simple extends SvelteComponentTyped<{
|
|
5
|
-
focus?: boolean | undefined;
|
|
6
5
|
select?: string | undefined;
|
|
6
|
+
focus?: boolean | undefined;
|
|
7
7
|
context?: string | undefined;
|
|
8
8
|
self?: null | undefined;
|
|
9
9
|
nav?: boolean | undefined;
|
|
@@ -22,8 +22,8 @@ export type SimpleSlots = typeof __propDef.slots;
|
|
|
22
22
|
import { SvelteComponentTyped } from "svelte";
|
|
23
23
|
declare const __propDef: {
|
|
24
24
|
props: {
|
|
25
|
-
focus?: boolean | undefined;
|
|
26
25
|
select?: string | undefined;
|
|
26
|
+
focus?: boolean | undefined;
|
|
27
27
|
context?: string | undefined;
|
|
28
28
|
self?: null | undefined;
|
|
29
29
|
nav?: boolean | undefined;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} TemplateEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} TemplateSlots */
|
|
4
4
|
export default class Template extends SvelteComponentTyped<{
|
|
5
|
-
focus?: boolean | undefined;
|
|
6
5
|
select?: string | undefined;
|
|
6
|
+
focus?: boolean | undefined;
|
|
7
7
|
context?: string | undefined;
|
|
8
8
|
self?: null | undefined;
|
|
9
9
|
nav?: boolean | undefined;
|
|
@@ -30,8 +30,8 @@ export type TemplateSlots = typeof __propDef.slots;
|
|
|
30
30
|
import { SvelteComponentTyped } from "svelte";
|
|
31
31
|
declare const __propDef: {
|
|
32
32
|
props: {
|
|
33
|
-
focus?: boolean | undefined;
|
|
34
33
|
select?: string | undefined;
|
|
34
|
+
focus?: boolean | undefined;
|
|
35
35
|
context?: string | undefined;
|
|
36
36
|
self?: null | undefined;
|
|
37
37
|
nav?: boolean | undefined;
|
package/desk.svelte
CHANGED
|
@@ -16,10 +16,30 @@
|
|
|
16
16
|
set_dark_mode_default } from './stores.js'
|
|
17
17
|
|
|
18
18
|
import {session, AuthorizedView, Authorized, NotAuthorized, Auth} from '@humandialog/auth.svelte'
|
|
19
|
+
import { handle_select, is_device_smaller_than } from './utils'
|
|
20
|
+
|
|
21
|
+
export let layout;
|
|
19
22
|
|
|
23
|
+
const sizes = {
|
|
24
|
+
bottom: 240,
|
|
25
|
+
toolbar: 40,
|
|
26
|
+
operations: 40,
|
|
27
|
+
sidebar: 320
|
|
28
|
+
}
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
$: outerWidth = 0
|
|
31
|
+
$: innerWidth = 0
|
|
32
|
+
$: outerHeight = 0
|
|
33
|
+
$: innerHeight = 0
|
|
34
|
+
|
|
35
|
+
const media_break_sm = 640; //px @media (min-width: 640px) { ... }
|
|
36
|
+
const media_break_md = 768; //px @media (min-width: 768px) { ... }
|
|
37
|
+
const media_break_lg = 1024; //px @media (min-width: 1024px) { ... }
|
|
38
|
+
const media_break_xl = 1280; //px @media (min-width: 1280px) { ... }
|
|
39
|
+
const media_break_2xl = 1536; //px
|
|
40
|
+
let test = "ala\n ma\n\tkota"
|
|
22
41
|
|
|
42
|
+
$: is_small = is_device_smaller_than("sm")
|
|
23
43
|
|
|
24
44
|
let main_side_panel_visibility = "hidden"
|
|
25
45
|
let lg_content_area_horizontal_dim = ""
|
|
@@ -54,7 +74,7 @@
|
|
|
54
74
|
else
|
|
55
75
|
{
|
|
56
76
|
main_side_panel_visibility = "lg:block"
|
|
57
|
-
lg_content_area_horizontal_dim =
|
|
77
|
+
lg_content_area_horizontal_dim = `lg:left-[360px] lg:w-[calc(100vw-360px)]`
|
|
58
78
|
}
|
|
59
79
|
}
|
|
60
80
|
|
|
@@ -63,7 +83,6 @@
|
|
|
63
83
|
let bottom_bar_visibility = "hidden"
|
|
64
84
|
let bottom_bar_visible = false
|
|
65
85
|
let lg_main_sidebar_height = ""
|
|
66
|
-
let lg_main_side_panel_height = "lg:h-[calc(100vh-240px)]"
|
|
67
86
|
let fab_bottom = "bottom-0"
|
|
68
87
|
|
|
69
88
|
let content_top = ""
|
|
@@ -75,34 +94,39 @@
|
|
|
75
94
|
|
|
76
95
|
if(!has_selected_item())
|
|
77
96
|
bottom_bar_visible = false;
|
|
78
|
-
|
|
97
|
+
|
|
79
98
|
if(tools_visible)
|
|
80
99
|
{
|
|
81
100
|
tools_visibility = "fixed"
|
|
82
|
-
|
|
101
|
+
|
|
102
|
+
if(is_small)
|
|
103
|
+
content_top = `top-[80px] sm:top-[40px]`
|
|
104
|
+
else
|
|
105
|
+
content_top = `top-[80px] sm:top-[40px]`
|
|
106
|
+
|
|
83
107
|
if(bottom_bar_visible)
|
|
84
|
-
content_height =
|
|
108
|
+
content_height = `h-[calc(100vh-320px)] sm:h-[calc(100vh-280px)]`
|
|
85
109
|
else
|
|
86
|
-
content_height =
|
|
110
|
+
content_height = `h-[calc(100vh-80px)] sm:h-[calc(100vh-40px)]`
|
|
87
111
|
|
|
88
112
|
}
|
|
89
113
|
else
|
|
90
114
|
{
|
|
91
115
|
tools_visibility = "hidden"
|
|
92
|
-
content_top =
|
|
116
|
+
content_top = `top-[40px] sm:top-0`
|
|
93
117
|
if(bottom_bar_visible)
|
|
94
|
-
content_height =
|
|
118
|
+
content_height = `h-[calc(100vh-280px)] sm:h-[calc(100vh-240px)]`
|
|
95
119
|
else
|
|
96
|
-
content_height =
|
|
120
|
+
content_height = `h-[calc(100vh-40px)] sm:h-screen`
|
|
97
121
|
}
|
|
98
122
|
|
|
99
123
|
|
|
100
124
|
|
|
101
125
|
if(bottom_bar_visible)
|
|
102
126
|
{
|
|
103
|
-
lg_main_sidebar_height =
|
|
127
|
+
lg_main_sidebar_height = `lg:h-[calc(100vh-240px)]`
|
|
104
128
|
bottom_bar_visibility = "fixed"
|
|
105
|
-
fab_bottom =
|
|
129
|
+
fab_bottom = `bottom-[240px]`;
|
|
106
130
|
}
|
|
107
131
|
else
|
|
108
132
|
{
|
|
@@ -113,27 +137,21 @@
|
|
|
113
137
|
|
|
114
138
|
}
|
|
115
139
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
$: innerWidth = 0;
|
|
121
|
-
$: outerHeight = 0;
|
|
122
|
-
$: innerHeight = 0;
|
|
123
|
-
const media_break_sm = 640; //px @media (min-width: 640px) { ... }
|
|
124
|
-
const media_break_md = 768; //px @media (min-width: 768px) { ... }
|
|
125
|
-
const media_break_lg = 1024; //px @media (min-width: 1024px) { ... }
|
|
126
|
-
const media_break_xl = 1280; //px @media (min-width: 1280px) { ... }
|
|
127
|
-
const media_break_2xl = 1536; //px
|
|
128
|
-
let test = "ala\n ma\n\tkota"
|
|
129
|
-
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
130
144
|
//$: screen.width = innerWidth;
|
|
131
145
|
</script>
|
|
132
146
|
|
|
133
147
|
<svelte:window bind:innerWidth bind:outerWidth bind:innerHeight bind:outerHeight />
|
|
134
148
|
|
|
135
149
|
<AuthorizedView>
|
|
136
|
-
|
|
150
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
151
|
+
<div id="__hd_svelte_layout_root" class="{$dark_mode_store}"
|
|
152
|
+
on:click={handle_select}
|
|
153
|
+
on:contextmenu={handle_select}>
|
|
154
|
+
|
|
137
155
|
<div class="bg-white dark:bg-gray-900 dark:text-white min-h-screen h-screen">
|
|
138
156
|
<!--###########################################################-->
|
|
139
157
|
<!--## HORIZONTAL TOOLBAR (FOR PHONES) ######################-->
|
|
@@ -160,9 +178,12 @@
|
|
|
160
178
|
<!--#######################################################-->
|
|
161
179
|
<!--## MAIN SIDE BAR ##################-->
|
|
162
180
|
<!--#######################################################-->
|
|
163
|
-
<div class="{main_side_panel_visibility} fixed
|
|
164
|
-
|
|
165
|
-
|
|
181
|
+
<div class="{main_side_panel_visibility} fixed
|
|
182
|
+
left-0 sm:left-[40px]
|
|
183
|
+
top-[40px] sm:top-0
|
|
184
|
+
h-[calc(100vh-40px)] sm:h-full {lg_main_sidebar_height}
|
|
185
|
+
w-screen sm:w-[320px]
|
|
186
|
+
z-10 overflow-x-hidden">
|
|
166
187
|
|
|
167
188
|
<div class=" bg-slate-50 w-full h-full dark:bg-slate-800 overflow-y-auto py-4 px-0">
|
|
168
189
|
<Configurable config={layout.sidebar[visible_sidebar]}>
|
|
@@ -174,15 +195,18 @@
|
|
|
174
195
|
<!--## HORIZONTAL TOOLS ######################-->
|
|
175
196
|
<!--###########################################################-->
|
|
176
197
|
|
|
177
|
-
<div class=" {tools_visibility}
|
|
178
|
-
|
|
198
|
+
<div class=" {tools_visibility}
|
|
199
|
+
w-screen sm:w-[calc(100vw-40px)]
|
|
200
|
+
h-[40px]
|
|
201
|
+
left-0 sm:left-[40px]
|
|
202
|
+
top-[40px] sm:top-0
|
|
179
203
|
{lg_content_area_horizontal_dim}
|
|
180
204
|
z-0 overflow-hidden " >
|
|
181
205
|
|
|
182
206
|
<Operations/>
|
|
183
207
|
</div>
|
|
184
208
|
|
|
185
|
-
<div class="{tools_visibility} right-3 {fab_bottom} mb-1 cursor-pointer z-20">
|
|
209
|
+
<div class="!hidden {tools_visibility} right-3 {fab_bottom} mb-1 cursor-pointer z-20">
|
|
186
210
|
<Fab/>
|
|
187
211
|
</div>
|
|
188
212
|
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
let sidebar = $main_sidebar_visible_store;
|
|
72
72
|
if(sidebar == "*")
|
|
73
73
|
{
|
|
74
|
-
if(!previously_visible_sidebar)
|
|
74
|
+
if((!previously_visible_sidebar) || previously_visible_sidebar === '*')
|
|
75
75
|
sidebar = Object.keys(app_config.sidebar)[0];
|
|
76
76
|
else
|
|
77
77
|
sidebar = previously_visible_sidebar;
|
|
@@ -83,9 +83,14 @@
|
|
|
83
83
|
|
|
84
84
|
function show_options(e)
|
|
85
85
|
{
|
|
86
|
-
let
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
let owner = e.target;
|
|
87
|
+
while(owner && owner.tagName != 'BUTTON')
|
|
88
|
+
owner = owner.parentElement
|
|
89
|
+
|
|
90
|
+
if(!owner)
|
|
91
|
+
return;
|
|
92
|
+
|
|
93
|
+
let rect = owner.getBoundingClientRect();
|
|
89
94
|
let options = [];
|
|
90
95
|
|
|
91
96
|
if(show_sign_in_out_icons)
|
|
@@ -149,7 +154,8 @@
|
|
|
149
154
|
});
|
|
150
155
|
}
|
|
151
156
|
|
|
152
|
-
|
|
157
|
+
let pt = new DOMPoint(rect.left, rect.bottom)
|
|
158
|
+
show_menu(pt, options);
|
|
153
159
|
}
|
|
154
160
|
|
|
155
161
|
</script>
|
package/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { default as Layout } from './desk.svelte';
|
|
|
7
7
|
export { default as Icon } from "./components/icon.svelte";
|
|
8
8
|
export { default as Button } from './components/button.svelte';
|
|
9
9
|
export { default as Checkbox } from './components/checkbox.svelte';
|
|
10
|
-
export { default as
|
|
10
|
+
export { default as DatePicker } from './components/date.svelte';
|
|
11
11
|
export { default as Edit } from './components/edit.field.svelte';
|
|
12
12
|
export { default as FileLoader } from './components/file.loader.svelte';
|
|
13
13
|
export { default as Input } from './components/inputbox.ltop.svelte';
|
|
@@ -24,5 +24,10 @@ export { default as RichEdit } from './components/document/rich.edit.svelte';
|
|
|
24
24
|
export { default as Spinner } from './components/delayed.spinner.svelte';
|
|
25
25
|
export { show_menu, show_grid_menu, show_floating_toolbar } from './components/menu';
|
|
26
26
|
export { default as Fab } from './components/Fab.svelte';
|
|
27
|
+
export { default as Sidebar } from './components/sidebar/sidebar.svelte';
|
|
28
|
+
export { default as SidebarBrand } from './components/sidebar/sidebar.brand.svelte';
|
|
29
|
+
export { default as SidebarGroup } from './components/sidebar/sidebar.group.svelte';
|
|
30
|
+
export { default as SidebarItem } from './components/sidebar/sidebar.item.svelte';
|
|
31
|
+
export { select_item, activate_item, clear_active_item, is_active, is_selected, editable, start_editing, selectable, handle_select } from './utils';
|
|
27
32
|
export { data_tick_store, has_selected_item, has_data_item } from "./stores";
|
|
28
33
|
export { context_toolbar_operations, page_toolbar_operations, context_items_store } from './stores';
|
package/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { default as Layout } from './desk.svelte';
|
|
|
11
11
|
export { default as Icon } from "./components/icon.svelte";
|
|
12
12
|
export { default as Button } from './components/button.svelte';
|
|
13
13
|
export { default as Checkbox } from './components/checkbox.svelte';
|
|
14
|
-
export { default as
|
|
14
|
+
export { default as DatePicker } from './components/date.svelte';
|
|
15
15
|
export { default as Edit } from './components/edit.field.svelte';
|
|
16
16
|
export { default as FileLoader } from './components/file.loader.svelte';
|
|
17
17
|
export { default as Input } from './components/inputbox.ltop.svelte';
|
|
@@ -29,5 +29,10 @@ export { default as Spinner } from './components/delayed.spinner.svelte';
|
|
|
29
29
|
//export { default as Menu } from './components/contextmenu.svelte'
|
|
30
30
|
export { show_menu, show_grid_menu, show_floating_toolbar } from './components/menu';
|
|
31
31
|
export { default as Fab } from './components/Fab.svelte';
|
|
32
|
+
export { default as Sidebar } from './components/sidebar/sidebar.svelte';
|
|
33
|
+
export { default as SidebarBrand } from './components/sidebar/sidebar.brand.svelte';
|
|
34
|
+
export { default as SidebarGroup } from './components/sidebar/sidebar.group.svelte';
|
|
35
|
+
export { default as SidebarItem } from './components/sidebar/sidebar.item.svelte';
|
|
36
|
+
export { select_item, activate_item, clear_active_item, is_active, is_selected, editable, start_editing, selectable, handle_select } from './utils';
|
|
32
37
|
export { data_tick_store, has_selected_item, has_data_item } from "./stores";
|
|
33
38
|
export { context_toolbar_operations, page_toolbar_operations, context_items_store } from './stores'; // tmp
|
package/operations.svelte
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import { show_floating_toolbar, show_menu, show_grid_menu } from "./components/menu.js";
|
|
2
2
|
import { context_toolbar_operations, page_toolbar_operations, context_items_store } from "./stores.js";
|
|
3
|
+
export let mobile = false;
|
|
3
4
|
$:
|
|
4
5
|
update($page_toolbar_operations, $context_toolbar_operations);
|
|
5
6
|
let operations = [];
|
|
@@ -25,24 +26,29 @@ function on_click(e, operation) {
|
|
|
25
26
|
if (!owner)
|
|
26
27
|
return;
|
|
27
28
|
let rect = owner.getBoundingClientRect();
|
|
29
|
+
let x = rect.left;
|
|
30
|
+
let y = mobile ? rect.top : rect.bottom;
|
|
28
31
|
if (operation.menu)
|
|
29
|
-
show_menu(rect
|
|
32
|
+
show_menu(rect, operation.menu);
|
|
30
33
|
else if (operation.toolbar)
|
|
31
|
-
show_floating_toolbar(rect
|
|
34
|
+
show_floating_toolbar(rect, operation.toolbar);
|
|
32
35
|
else if (operation.grid)
|
|
33
|
-
show_grid_menu(rect
|
|
36
|
+
show_grid_menu(rect, operation.grid);
|
|
34
37
|
}
|
|
35
38
|
</script>
|
|
36
39
|
|
|
37
|
-
<div
|
|
40
|
+
<div class="bg-slate-100 w-full h-10 dark:bg-slate-800 overflow-x-clip overflow-y-hidden py-0 text-xs flex flex-row"
|
|
41
|
+
class:flex-row-reverse={mobile}>
|
|
38
42
|
|
|
39
43
|
{#each operations as operation}
|
|
40
44
|
<button type="button"
|
|
41
45
|
class="py-2.5 px-5
|
|
42
46
|
text-xs font-medium text-gray-900 dark:text-gray-400 dark:hover:text-white
|
|
43
47
|
bg-slate-100 hover:bg-slate-200 dark:bg-gray-800 dark:hover:bg-gray-700 active:bg-slate-300 dark:active:bg-gray-600
|
|
44
|
-
border-
|
|
48
|
+
border-gray-200 focus:outline-none dark:border-gray-600
|
|
45
49
|
inline-flex items-center"
|
|
50
|
+
class:border-r={!mobile}
|
|
51
|
+
class:border-l={mobile}
|
|
46
52
|
on:click={(e) => {on_click(e, operation)}}>
|
|
47
53
|
<div class="w-3 h-3"><svelte:component this={operation.icon}/></div>
|
|
48
54
|
<span class="ml-1">{operation.caption}</span>
|
package/operations.svelte.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humandialog/forms.svelte",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.14",
|
|
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.0.
|
|
29
|
+
"@humandialog/auth.svelte": "^1.0.4",
|
|
30
30
|
"flowbite-svelte": "^0.29.13",
|
|
31
31
|
"svelte-icons": "^2.1.0",
|
|
32
32
|
"svelte-spa-router": "^3.3.0"
|
|
@@ -76,6 +76,10 @@
|
|
|
76
76
|
"./components/inputbox.ltop.svelte": "./components/inputbox.ltop.svelte",
|
|
77
77
|
"./components/menu": "./components/menu.js",
|
|
78
78
|
"./components/radio.svelte": "./components/radio.svelte",
|
|
79
|
+
"./components/sidebar/sidebar.brand.svelte": "./components/sidebar/sidebar.brand.svelte",
|
|
80
|
+
"./components/sidebar/sidebar.group.svelte": "./components/sidebar/sidebar.group.svelte",
|
|
81
|
+
"./components/sidebar/sidebar.item.svelte": "./components/sidebar/sidebar.item.svelte",
|
|
82
|
+
"./components/sidebar/sidebar.svelte": "./components/sidebar/sidebar.svelte",
|
|
79
83
|
"./components/simple.table.svelte": "./components/simple.table.svelte",
|
|
80
84
|
"./components/table/column.svelte": "./components/table/column.svelte",
|
|
81
85
|
"./components/table/item.svelte": "./components/table/item.svelte",
|
package/utils.d.ts
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
|
+
export function is_device_smaller_than(br: any): boolean;
|
|
2
|
+
export function select_item(itm: any): void;
|
|
3
|
+
export function activate_item(context_level: any, itm: any, operations?: null): void;
|
|
4
|
+
export function clear_active_item(context_level: any): void;
|
|
5
|
+
export function is_selected(itm: any): boolean;
|
|
6
|
+
export function is_active(context_level: any, itm: any): boolean;
|
|
7
|
+
export function editable(node: any, action: any): {
|
|
8
|
+
destroy(): void;
|
|
9
|
+
};
|
|
10
|
+
export function start_editing(element: any, finish_callback: any): void;
|
|
11
|
+
export function selectable(node: any, itm: any): {
|
|
12
|
+
destroy(): void;
|
|
13
|
+
};
|
|
14
|
+
export function handle_select(e: any): void;
|
|
1
15
|
export function parse_width_directive(c: any): string;
|
|
2
16
|
export function should_be_comapact(): boolean;
|
|
3
17
|
export namespace icons {
|
|
4
18
|
const symbols: null;
|
|
5
19
|
}
|
|
20
|
+
export namespace SCREEN_SIZES {
|
|
21
|
+
const sm: number;
|
|
22
|
+
const md: number;
|
|
23
|
+
const lg: number;
|
|
24
|
+
const xl: number;
|
|
25
|
+
}
|