@humandialog/forms.svelte 0.3.3 → 0.3.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/README.md +1 -1
- package/components/button.svelte +80 -0
- package/components/button.svelte.d.ts +24 -0
- package/components/checkbox.svelte +55 -0
- package/components/checkbox.svelte.d.ts +25 -0
- package/components/combo/combo.d.ts +15 -0
- package/components/combo/combo.item.svelte +14 -0
- package/components/combo/combo.item.svelte.d.ts +19 -0
- package/components/combo/combo.js +15 -0
- package/components/combo/combo.source.svelte +13 -0
- package/components/combo/combo.source.svelte.d.ts +20 -0
- package/components/combo/combo.svelte +527 -0
- package/components/combo/combo.svelte.d.ts +28 -0
- package/components/date.svelte +113 -0
- package/components/date.svelte.d.ts +23 -0
- package/components/document/internal/Document_command.d.ts +9 -0
- package/components/document/internal/Document_command.js +9 -0
- package/components/document/internal/Selection_helper.d.ts +7 -0
- package/components/document/internal/Selection_helper.js +133 -0
- package/components/document/internal/Selection_range.d.ts +26 -0
- package/components/document/internal/Selection_range.js +58 -0
- package/components/document/internal/palette.row.svelte +34 -0
- package/components/document/internal/palette.row.svelte.d.ts +36 -0
- package/components/document/internal/palette.svelte +123 -0
- package/components/document/internal/palette.svelte.d.ts +67 -0
- package/components/document/rich.edit.svelte +733 -0
- package/components/document/rich.edit.svelte.d.ts +23 -0
- package/components/edit.field.svelte +134 -0
- package/components/edit.field.svelte.d.ts +27 -0
- package/components/file.loader.svelte +90 -0
- package/components/file.loader.svelte.d.ts +25 -0
- package/components/input.text.svelte +37 -0
- package/components/input.text.svelte.d.ts +29 -0
- package/components/inputbox.ltop.svelte +110 -0
- package/components/inputbox.ltop.svelte.d.ts +44 -0
- package/components/radio.svelte +53 -0
- package/components/radio.svelte.d.ts +25 -0
- package/components/simple.table.svelte +106 -0
- package/components/simple.table.svelte.d.ts +41 -0
- package/components/table/_template.table.svelte +111 -0
- package/components/table/_template.table.svelte.d.ts +57 -0
- package/components/table/column.svelte +17 -0
- package/components/table/column.svelte.d.ts +19 -0
- package/components/table/item.svelte +10 -0
- package/components/table/item.svelte.d.ts +17 -0
- package/components/table/table.d.ts +11 -0
- package/components/table/table.js +11 -0
- package/components/table/table.svelte +150 -0
- package/components/table/table.svelte.d.ts +73 -0
- package/components/textarea.ltop.svelte +55 -0
- package/components/textarea.ltop.svelte.d.ts +35 -0
- package/components/tile.title.svelte +54 -0
- package/components/tile.title.svelte.d.ts +29 -0
- package/form.box.svelte +60 -0
- package/form.box.svelte.d.ts +35 -0
- package/global.d.ts +1 -0
- package/icon.svelte +105 -0
- package/icon.svelte.d.ts +62 -0
- package/index.d.ts +21 -0
- package/index.js +25 -0
- package/package.json +42 -48
- package/page.row.svelte +31 -0
- package/page.row.svelte.d.ts +31 -0
- package/page.svelte +83 -0
- package/page.svelte.d.ts +39 -0
- package/stores.d.ts +15 -0
- package/stores.js +7 -0
- package/tile.svelte +41 -0
- package/tile.svelte.d.ts +33 -0
- package/tiles.row.svelte +35 -0
- package/tiles.row.svelte.d.ts +31 -0
- package/tiles.vertical.row.svelte +25 -0
- package/tiles.vertical.row.svelte.d.ts +29 -0
- package/updates.d.ts +3 -0
- package/updates.js +95 -0
- package/utils.d.ts +5 -0
- package/utils.js +51 -0
package/page.svelte
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let context = "data"
|
|
3
|
+
export let self = null
|
|
4
|
+
export let typename = '';
|
|
5
|
+
export let focused_only = false
|
|
6
|
+
export let in_context = ''
|
|
7
|
+
export let cl =
|
|
8
|
+
"w-full h-full flex flex-col dark:bg-slate-800 overflow-y-hidden overflow-x-hidden py-1 px-1 border-0" // border-green-500
|
|
9
|
+
export let c = ''
|
|
10
|
+
import {
|
|
11
|
+
writable
|
|
12
|
+
} from 'svelte/store';
|
|
13
|
+
import {
|
|
14
|
+
setContext
|
|
15
|
+
} from 'svelte';
|
|
16
|
+
import {
|
|
17
|
+
context_items_store,
|
|
18
|
+
data_tick_store,
|
|
19
|
+
context_types_store
|
|
20
|
+
} from './stores.js'
|
|
21
|
+
switch (c) {
|
|
22
|
+
case 'main':
|
|
23
|
+
cl = "w-full h-full flex flex-col dark:bg-slate-800 overflow-y-hidden overflow-x-hidden py-1 px-1 border-0"
|
|
24
|
+
break;
|
|
25
|
+
case 'main-d':
|
|
26
|
+
cl = "bg-slate-800 w-full h-full flex flex-col dark:bg-slate-800 overflow-y-hidden overflow-x-hidden py-1 px-1 border-0"
|
|
27
|
+
break;
|
|
28
|
+
default:
|
|
29
|
+
//NOP
|
|
30
|
+
}
|
|
31
|
+
setContext('ctx', context)
|
|
32
|
+
let item = null;
|
|
33
|
+
let visibilty = "hidden"
|
|
34
|
+
if (in_context == '')
|
|
35
|
+
in_context = context;
|
|
36
|
+
let last_tick = 0
|
|
37
|
+
if (self != null)
|
|
38
|
+
$context_items_store[context] = self
|
|
39
|
+
|
|
40
|
+
if(typename)
|
|
41
|
+
$context_types_store[context] = typename;
|
|
42
|
+
|
|
43
|
+
item = $context_items_store[context]
|
|
44
|
+
visibilty = "hidden";
|
|
45
|
+
if (item != null) {
|
|
46
|
+
if (focused_only) {
|
|
47
|
+
if ($context_items_store.focused == in_context)
|
|
48
|
+
visibilty = "";
|
|
49
|
+
} else
|
|
50
|
+
visibilty = "";
|
|
51
|
+
}
|
|
52
|
+
let t = 0
|
|
53
|
+
$: {
|
|
54
|
+
t = $data_tick_store
|
|
55
|
+
if (t > last_tick) {
|
|
56
|
+
last_tick = t
|
|
57
|
+
if (self != null)
|
|
58
|
+
$context_items_store[context] = self
|
|
59
|
+
|
|
60
|
+
if(typename)
|
|
61
|
+
$context_types_store[context] = typename;
|
|
62
|
+
|
|
63
|
+
item = $context_items_store[context]
|
|
64
|
+
visibilty = "hidden";
|
|
65
|
+
if (item != null) {
|
|
66
|
+
if (focused_only) {
|
|
67
|
+
if ($context_items_store.focused == in_context)
|
|
68
|
+
visibilty = "";
|
|
69
|
+
} else
|
|
70
|
+
visibilty = "";
|
|
71
|
+
}
|
|
72
|
+
//console.log("$page[" + in_context + ", " + context + "]: " + visibilty)
|
|
73
|
+
//console.log(item)
|
|
74
|
+
//console.log("--------------")
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<div class="{visibilty} {cl} bg-slate-100 dark:bg-slate-800 ">
|
|
80
|
+
{#if visibilty == "" }
|
|
81
|
+
<slot/>
|
|
82
|
+
{/if}
|
|
83
|
+
</div>
|
package/page.svelte.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} PageProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} PageEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} PageSlots */
|
|
4
|
+
export default class Page extends SvelteComponentTyped<{
|
|
5
|
+
context?: string | undefined;
|
|
6
|
+
self?: null | undefined;
|
|
7
|
+
c?: string | undefined;
|
|
8
|
+
cl?: string | undefined;
|
|
9
|
+
typename?: string | undefined;
|
|
10
|
+
focused_only?: boolean | undefined;
|
|
11
|
+
in_context?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
default: {};
|
|
16
|
+
}> {
|
|
17
|
+
}
|
|
18
|
+
export type PageProps = typeof __propDef.props;
|
|
19
|
+
export type PageEvents = typeof __propDef.events;
|
|
20
|
+
export type PageSlots = typeof __propDef.slots;
|
|
21
|
+
import { SvelteComponentTyped } from "svelte";
|
|
22
|
+
declare const __propDef: {
|
|
23
|
+
props: {
|
|
24
|
+
context?: string | undefined;
|
|
25
|
+
self?: null | undefined;
|
|
26
|
+
c?: string | undefined;
|
|
27
|
+
cl?: string | undefined;
|
|
28
|
+
typename?: string | undefined;
|
|
29
|
+
focused_only?: boolean | undefined;
|
|
30
|
+
in_context?: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
events: {
|
|
33
|
+
[evt: string]: CustomEvent<any>;
|
|
34
|
+
};
|
|
35
|
+
slots: {
|
|
36
|
+
default: {};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export {};
|
package/stores.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const data_tick_store: import("svelte/store").Writable<number>;
|
|
2
|
+
export const context_items_store: import("svelte/store").Writable<{
|
|
3
|
+
focused: string;
|
|
4
|
+
data: null;
|
|
5
|
+
sel: null;
|
|
6
|
+
}>;
|
|
7
|
+
export const context_info_store: import("svelte/store").Writable<{
|
|
8
|
+
data: string;
|
|
9
|
+
sel: string;
|
|
10
|
+
}>;
|
|
11
|
+
export const context_types_store: import("svelte/store").Writable<{
|
|
12
|
+
focused: string;
|
|
13
|
+
data: null;
|
|
14
|
+
sel: null;
|
|
15
|
+
}>;
|
package/stores.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
import {writable, get} from 'svelte/store';
|
|
3
|
+
|
|
4
|
+
export const data_tick_store = writable(1);
|
|
5
|
+
export const context_items_store = writable({focused:'', data: null, sel: null})
|
|
6
|
+
export const context_info_store = writable({data: '', sel: ''})
|
|
7
|
+
export const context_types_store = writable({focused:'', data: null, sel: null})
|
package/tile.svelte
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import {data_tick_store, context_items_store} from './stores.js'
|
|
5
|
+
import { setContext } from 'svelte';
|
|
6
|
+
export let c = ''
|
|
7
|
+
export let cl = 'col-span-1'
|
|
8
|
+
|
|
9
|
+
export let context = ""
|
|
10
|
+
export let self = null
|
|
11
|
+
|
|
12
|
+
if(context != "")
|
|
13
|
+
{
|
|
14
|
+
setContext('ctx', context)
|
|
15
|
+
if(self != null)
|
|
16
|
+
context_items_store[context] = self
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
switch(c)
|
|
21
|
+
{
|
|
22
|
+
case 'flex':
|
|
23
|
+
cl = 'grid-cols-4 sm:grid-cols-8 md:grid-cols-10 lg:grid-cols-12'
|
|
24
|
+
break;
|
|
25
|
+
case 'x2':
|
|
26
|
+
cl = 'xl:col-span-2'
|
|
27
|
+
break;
|
|
28
|
+
case 's2-l3-x4-w5':
|
|
29
|
+
cl = 'sm:col-span-2 lg:col-span-3 xl:col-span-4 2xl:col-span-5'
|
|
30
|
+
break;
|
|
31
|
+
case 'f1':
|
|
32
|
+
cl = 'w-64 flex-none'
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class=" {cl} bg-slate-100 dark:bg-slate-800 shadow rounded-lg p-2 flex flex-col">
|
|
40
|
+
<slot/>
|
|
41
|
+
</div>
|
package/tile.svelte.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TileProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TileEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TileSlots */
|
|
4
|
+
export default class Tile extends SvelteComponentTyped<{
|
|
5
|
+
context?: string | undefined;
|
|
6
|
+
self?: null | undefined;
|
|
7
|
+
c?: string | undefined;
|
|
8
|
+
cl?: string | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
}, {
|
|
12
|
+
default: {};
|
|
13
|
+
}> {
|
|
14
|
+
}
|
|
15
|
+
export type TileProps = typeof __propDef.props;
|
|
16
|
+
export type TileEvents = typeof __propDef.events;
|
|
17
|
+
export type TileSlots = typeof __propDef.slots;
|
|
18
|
+
import { SvelteComponentTyped } from "svelte";
|
|
19
|
+
declare const __propDef: {
|
|
20
|
+
props: {
|
|
21
|
+
context?: string | undefined;
|
|
22
|
+
self?: null | undefined;
|
|
23
|
+
c?: string | undefined;
|
|
24
|
+
cl?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
events: {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
};
|
|
29
|
+
slots: {
|
|
30
|
+
default: {};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
package/tiles.row.svelte
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
export let c = ''
|
|
5
|
+
export let cl = 'grid-cols-1';
|
|
6
|
+
export let w = 'w-full'
|
|
7
|
+
|
|
8
|
+
switch(c)
|
|
9
|
+
{
|
|
10
|
+
case 'f2':
|
|
11
|
+
cl = 'grid-cols-2'
|
|
12
|
+
w = 'w-[calc(200vw)] sm:w-[calc(200vw-40px)] lg:w-[calc(100vw-40px)] h-full overflow-y-scroll'
|
|
13
|
+
break;
|
|
14
|
+
case 'g1':
|
|
15
|
+
cl="flex-grow grid-cols-2 overflow-y-scroll"
|
|
16
|
+
break;
|
|
17
|
+
case 's2-l3-x4-w5':
|
|
18
|
+
cl = 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5';
|
|
19
|
+
break;
|
|
20
|
+
case 's2-x4':
|
|
21
|
+
cl = 'grid-cols-1 sm:grid-cols-2 xl:grid-cols-4';
|
|
22
|
+
break;
|
|
23
|
+
case 's2-x3':
|
|
24
|
+
cl = 'grid-cols-1 md:grid-cols-2 xl:grid-cols-3';
|
|
25
|
+
break;
|
|
26
|
+
case '1':
|
|
27
|
+
cl = 'grid-cols-1';
|
|
28
|
+
break;
|
|
29
|
+
//default: Nie ma default. Mozna nadpisać cl i w
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div class="grid {cl} mt-0 {w} gap-1">
|
|
34
|
+
<slot/>
|
|
35
|
+
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TilesProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TilesEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TilesSlots */
|
|
4
|
+
export default class Tiles extends SvelteComponentTyped<{
|
|
5
|
+
c?: string | undefined;
|
|
6
|
+
cl?: string | undefined;
|
|
7
|
+
w?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
}, {
|
|
11
|
+
default: {};
|
|
12
|
+
}> {
|
|
13
|
+
}
|
|
14
|
+
export type TilesProps = typeof __propDef.props;
|
|
15
|
+
export type TilesEvents = typeof __propDef.events;
|
|
16
|
+
export type TilesSlots = typeof __propDef.slots;
|
|
17
|
+
import { SvelteComponentTyped } from "svelte";
|
|
18
|
+
declare const __propDef: {
|
|
19
|
+
props: {
|
|
20
|
+
c?: string | undefined;
|
|
21
|
+
cl?: string | undefined;
|
|
22
|
+
w?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
};
|
|
27
|
+
slots: {
|
|
28
|
+
default: {};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
export let c = ''
|
|
5
|
+
export let cl = 'grid-cols-1';
|
|
6
|
+
|
|
7
|
+
switch(c)
|
|
8
|
+
{
|
|
9
|
+
case '1':
|
|
10
|
+
//cl = 'grid-cols-1'; already set
|
|
11
|
+
break;
|
|
12
|
+
case '2':
|
|
13
|
+
cl = 'grid-cols-2';
|
|
14
|
+
break;
|
|
15
|
+
case '3':
|
|
16
|
+
cl = 'grid-cols-3';
|
|
17
|
+
break;
|
|
18
|
+
//default: Nie ma default. Mozna nadpisać cl
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<div class="{cl} mt-4 gap-4 bg-slate-500">
|
|
23
|
+
<slot/>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TilesProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TilesEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TilesSlots */
|
|
4
|
+
export default class Tiles extends SvelteComponentTyped<{
|
|
5
|
+
c?: string | undefined;
|
|
6
|
+
cl?: string | undefined;
|
|
7
|
+
}, {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
}, {
|
|
10
|
+
default: {};
|
|
11
|
+
}> {
|
|
12
|
+
}
|
|
13
|
+
export type TilesProps = typeof __propDef.props;
|
|
14
|
+
export type TilesEvents = typeof __propDef.events;
|
|
15
|
+
export type TilesSlots = typeof __propDef.slots;
|
|
16
|
+
import { SvelteComponentTyped } from "svelte";
|
|
17
|
+
declare const __propDef: {
|
|
18
|
+
props: {
|
|
19
|
+
c?: string | undefined;
|
|
20
|
+
cl?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
events: {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
};
|
|
25
|
+
slots: {
|
|
26
|
+
default: {};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export {};
|
package/updates.d.ts
ADDED
package/updates.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {writable} from 'svelte/store';
|
|
2
|
+
import {Auth} from '@humandialog/auth.svelte/dist/index'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const modified_item_store = writable(null);
|
|
6
|
+
export function inform_modification(itm, field_name, type_name)
|
|
7
|
+
{
|
|
8
|
+
let item_entry = {
|
|
9
|
+
Id: [type_name] + itm.Id,
|
|
10
|
+
type_name: type_name,
|
|
11
|
+
item: { [type_name]:
|
|
12
|
+
{
|
|
13
|
+
Id: itm.Id,
|
|
14
|
+
[field_name]: itm[field_name]
|
|
15
|
+
} },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
modified_item_store.set(item_entry);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function inform_item(itm, type_name)
|
|
22
|
+
{
|
|
23
|
+
let item_entry = {
|
|
24
|
+
Id: [type_name] + itm.Id,
|
|
25
|
+
type_name: type_name,
|
|
26
|
+
item: { [type_name]:
|
|
27
|
+
itm },
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
modified_item_store.set(item_entry);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const update_request_ticket = writable(0);
|
|
34
|
+
let last_update_ticket = 0;
|
|
35
|
+
export function push_changes()
|
|
36
|
+
{
|
|
37
|
+
update_request_ticket.update(n => n + 1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
const modified_items_map = new Map();
|
|
42
|
+
modified_item_store.subscribe((mod_item) => {
|
|
43
|
+
if(mod_item)
|
|
44
|
+
{
|
|
45
|
+
if(modified_items_map.has(mod_item.Id))
|
|
46
|
+
{
|
|
47
|
+
let last_itm = modified_items_map.get(mod_item.Id);
|
|
48
|
+
|
|
49
|
+
let last_mods = last_itm.item[last_itm.type_name];
|
|
50
|
+
let curr_mods = mod_item.item[mod_item.type_name];
|
|
51
|
+
Object.keys(curr_mods).forEach(prop_name => {
|
|
52
|
+
last_mods[prop_name] = curr_mods[prop_name];
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
else
|
|
56
|
+
{
|
|
57
|
+
modified_items_map.set(mod_item.Id, mod_item);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
update_request_ticket.subscribe(async (v) => {
|
|
63
|
+
if(v != last_update_ticket)
|
|
64
|
+
{
|
|
65
|
+
last_update_ticket = v;
|
|
66
|
+
|
|
67
|
+
if(!modified_items_map.size)
|
|
68
|
+
return;
|
|
69
|
+
|
|
70
|
+
let changes = [];
|
|
71
|
+
modified_items_map.forEach((value, key) =>
|
|
72
|
+
{
|
|
73
|
+
changes.push(value.item);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
try
|
|
77
|
+
{
|
|
78
|
+
console.log('push: ', changes);
|
|
79
|
+
const res = await Auth.fetch('/json/yav1/Push',
|
|
80
|
+
{
|
|
81
|
+
method: "POST",
|
|
82
|
+
body: JSON.stringify({ Items: changes }),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
if(res)
|
|
86
|
+
{
|
|
87
|
+
modified_items_map.clear();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch(err)
|
|
91
|
+
{
|
|
92
|
+
console.error(err);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
})
|
package/utils.d.ts
ADDED
package/utils.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getContext } from "svelte";
|
|
2
|
+
|
|
3
|
+
export let icons = {symbols :null}
|
|
4
|
+
|
|
5
|
+
export function parse_width_directive(c)
|
|
6
|
+
{
|
|
7
|
+
let cs = '';
|
|
8
|
+
switch (c)
|
|
9
|
+
{
|
|
10
|
+
case '1':
|
|
11
|
+
cs = 'col-span-1'
|
|
12
|
+
break;
|
|
13
|
+
case '2':
|
|
14
|
+
cs = 'col-span-2'
|
|
15
|
+
break;
|
|
16
|
+
case '3':
|
|
17
|
+
cs = 'col-span-3'
|
|
18
|
+
break;
|
|
19
|
+
case '4':
|
|
20
|
+
cs = 'col-span-4'
|
|
21
|
+
break;
|
|
22
|
+
case '5':
|
|
23
|
+
cs = 'col-span-5'
|
|
24
|
+
break;
|
|
25
|
+
case '6':
|
|
26
|
+
cs = 'col-span-6'
|
|
27
|
+
break;
|
|
28
|
+
case '1-x3':
|
|
29
|
+
cs = 'col-span-1 xl:col-span-3'
|
|
30
|
+
break;
|
|
31
|
+
case '2-x3':
|
|
32
|
+
cs = 'col-span-2 xl:col-span-3'
|
|
33
|
+
break;
|
|
34
|
+
case '3-x9':
|
|
35
|
+
cs = 'col-span-3 xl:col-span-9'
|
|
36
|
+
break;
|
|
37
|
+
case '4-x9':
|
|
38
|
+
cs = 'col-span-4 xl:col-span-9'
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return cs;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function should_be_comapact()
|
|
48
|
+
{
|
|
49
|
+
let is_in_table = getContext('rTable-definition');
|
|
50
|
+
return !!is_in_table;
|
|
51
|
+
}
|