@humandialog/forms.svelte 0.5.4 → 0.5.6
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 +0 -0
- package/components/Fab.svelte +5 -3
- package/components/Fab.svelte.d.ts +14 -14
- package/components/Floating_container.svelte.d.ts +21 -21
- package/components/Grid.menu.svelte.d.ts +25 -25
- package/components/button.svelte.d.ts +24 -24
- package/components/checkbox.svelte.d.ts +26 -26
- package/components/combo/combo.d.ts +17 -17
- package/components/combo/combo.item.svelte.d.ts +19 -19
- package/components/combo/combo.js +17 -17
- package/components/combo/combo.source.svelte.d.ts +22 -22
- package/components/combo/combo.svelte +1 -1
- package/components/combo/combo.svelte.d.ts +42 -42
- package/components/contextmenu.svelte.d.ts +26 -26
- package/components/date.svelte.d.ts +31 -31
- package/components/delayed.spinner.svelte.d.ts +19 -19
- package/components/document/internal/Document_command.d.ts +9 -9
- package/components/document/internal/Document_command.js +9 -9
- package/components/document/internal/Selection_helper.d.ts +7 -7
- package/components/document/internal/Selection_helper.js +133 -133
- package/components/document/internal/Selection_range.d.ts +26 -26
- package/components/document/internal/Selection_range.js +58 -58
- package/components/document/internal/palette.row.svelte.d.ts +36 -36
- package/components/document/internal/palette.svelte.d.ts +67 -67
- package/components/document/rich.edit.svelte +49 -8
- package/components/document/rich.edit.svelte.d.ts +32 -32
- package/components/edit.field.svelte.d.ts +28 -28
- package/components/file.loader.svelte.d.ts +25 -25
- package/components/icon.svelte.d.ts +62 -62
- package/components/input.text.svelte.d.ts +29 -29
- package/components/inputbox.ltop.svelte +1 -1
- package/components/inputbox.ltop.svelte.d.ts +52 -52
- package/components/kanban/Kanban.d.ts +43 -23
- package/components/kanban/Kanban.js +79 -23
- package/components/kanban/internal/kanban.card.svelte +195 -117
- package/components/kanban/internal/kanban.card.svelte.d.ts +32 -35
- package/components/kanban/internal/kanban.column.svelte +152 -108
- package/components/kanban/internal/kanban.column.svelte.d.ts +51 -51
- package/components/kanban/internal/kanban.inserter.svelte +14 -14
- package/components/kanban/internal/kanban.inserter.svelte.d.ts +18 -18
- package/components/kanban/internal/kanban.move.menu.svelte +138 -135
- package/components/kanban/internal/kanban.move.menu.svelte.d.ts +22 -19
- package/components/kanban/internal/kanban.props.svelte +140 -0
- package/components/kanban/internal/kanban.props.svelte.d.ts +19 -0
- package/components/kanban/kanban.callbacks.svelte +3 -9
- package/components/kanban/kanban.callbacks.svelte.d.ts +18 -21
- package/components/kanban/kanban.column.svelte +10 -10
- package/components/kanban/kanban.column.svelte.d.ts +21 -21
- package/components/kanban/kanban.combo.svelte +36 -0
- package/components/kanban/kanban.combo.svelte.d.ts +24 -0
- package/components/kanban/kanban.date.svelte +30 -0
- package/components/kanban/kanban.date.svelte.d.ts +21 -0
- package/components/kanban/kanban.source.svelte +25 -0
- package/components/kanban/kanban.source.svelte.d.ts +23 -0
- package/components/kanban/kanban.static.svelte +28 -0
- package/components/kanban/kanban.static.svelte.d.ts +20 -0
- package/components/kanban/kanban.summary.svelte +4 -0
- package/components/kanban/kanban.summary.svelte.d.ts +18 -16
- package/components/kanban/kanban.svelte +459 -124
- package/components/kanban/kanban.svelte.d.ts +63 -43
- package/components/kanban/kanban.tags.svelte +34 -0
- package/components/kanban/kanban.tags.svelte.d.ts +23 -0
- package/components/kanban/kanban.title.svelte +4 -2
- package/components/kanban/kanban.title.svelte.d.ts +18 -17
- package/components/list/List.d.ts +44 -36
- package/components/list/List.js +52 -42
- package/components/list/internal/list.element.props.svelte +65 -65
- package/components/list/internal/list.element.props.svelte.d.ts +21 -21
- package/components/list/internal/list.element.summary.svelte +44 -30
- package/components/list/internal/list.element.summary.svelte.d.ts +25 -24
- package/components/list/internal/list.element.svelte +24 -11
- package/components/list/internal/list.element.svelte.d.ts +29 -29
- package/components/list/internal/list.inserter.svelte.d.ts +19 -19
- package/components/list/list.combo.svelte.d.ts +21 -21
- package/components/list/list.date.svelte.d.ts +18 -18
- package/components/list/list.inserter.svelte.d.ts +17 -17
- package/components/list/list.static.svelte.d.ts +17 -17
- package/components/list/list.summary.svelte.d.ts +19 -19
- package/components/list/list.svelte +2 -2
- package/components/list/list.svelte.d.ts +59 -59
- package/components/list/list.title.svelte +2 -0
- package/components/list/list.title.svelte.d.ts +22 -21
- package/components/menu.d.ts +4 -4
- package/components/menu.js +56 -56
- package/components/radio.svelte.d.ts +26 -26
- package/components/sidebar/sidebar.brand.svelte.d.ts +31 -31
- package/components/sidebar/sidebar.group.svelte +41 -3
- package/components/sidebar/sidebar.group.svelte.d.ts +33 -27
- package/components/sidebar/sidebar.item.svelte.d.ts +28 -28
- package/components/sidebar/sidebar.list.svelte +15 -15
- package/components/sidebar/sidebar.list.svelte.d.ts +33 -33
- package/components/sidebar/sidebar.svelte.d.ts +27 -27
- package/components/simple.table.svelte.d.ts +41 -41
- package/components/table/_template.table.svelte.d.ts +57 -57
- package/components/table/column.svelte.d.ts +19 -19
- package/components/table/item.svelte.d.ts +17 -17
- package/components/table/table.d.ts +11 -11
- package/components/table/table.js +11 -11
- package/components/table/table.svelte.d.ts +75 -75
- package/components/tag.svelte +40 -0
- package/components/tag.svelte.d.ts +19 -0
- package/components/tags.svelte +207 -0
- package/components/tags.svelte.d.ts +31 -0
- package/components/textarea.ltop.svelte.d.ts +35 -35
- package/components/tile.title.svelte.d.ts +29 -29
- package/desk.svelte.d.ts +23 -23
- package/form.box.svelte.d.ts +35 -35
- package/horizontal.toolbar.svelte +23 -4
- package/horizontal.toolbar.svelte.d.ts +25 -23
- package/index.d.ts +59 -52
- package/index.js +65 -58
- package/internal/configurable.content.svelte.d.ts +27 -27
- package/internal/loading.svelte.d.ts +23 -23
- package/modal.svelte +7 -7
- package/modal.svelte.d.ts +35 -35
- package/operations.svelte +52 -23
- package/operations.svelte.d.ts +16 -16
- package/package.json +16 -8
- package/page.row.svelte.d.ts +31 -31
- package/page.svelte +3 -3
- package/page.svelte.d.ts +45 -45
- package/stores.d.ts +39 -39
- package/stores.js +0 -0
- package/tenant.members.svelte +10 -11
- package/tenant.members.svelte.d.ts +33 -33
- package/tile.svelte.d.ts +33 -33
- package/tiles.row.svelte.d.ts +31 -31
- package/tiles.vertical.row.svelte.d.ts +29 -29
- package/updates.d.ts +4 -3
- package/updates.js +16 -0
- package/utils.d.ts +35 -35
- package/utils.js +11 -1
- package/vertical.toolbar.svelte +31 -6
- package/vertical.toolbar.svelte.d.ts +27 -25
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} InputboxProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} InputboxEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} InputboxSlots */
|
|
4
|
-
export default class Inputbox extends SvelteComponentTyped<{
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
invalid?: boolean | undefined;
|
|
7
|
-
label?: string | undefined;
|
|
8
|
-
context?: string | undefined;
|
|
9
|
-
self?: null | undefined;
|
|
10
|
-
c?: string | undefined;
|
|
11
|
-
typename?: string | undefined;
|
|
12
|
-
a?: string | undefined;
|
|
13
|
-
pushChangesImmediately?: boolean | undefined;
|
|
14
|
-
s?: string | undefined;
|
|
15
|
-
placeholder?: string | undefined;
|
|
16
|
-
itype?: string | undefined;
|
|
17
|
-
val?: string | undefined;
|
|
18
|
-
validateCb?: any;
|
|
19
|
-
validate?: (() => boolean) | undefined;
|
|
20
|
-
}, {
|
|
21
|
-
[evt: string]: CustomEvent<any>;
|
|
22
|
-
}, {}> {
|
|
23
|
-
get validate(): () => boolean;
|
|
24
|
-
}
|
|
25
|
-
export type InputboxProps = typeof __propDef.props;
|
|
26
|
-
export type InputboxEvents = typeof __propDef.events;
|
|
27
|
-
export type InputboxSlots = typeof __propDef.slots;
|
|
28
|
-
import { SvelteComponentTyped } from "svelte";
|
|
29
|
-
declare const __propDef: {
|
|
30
|
-
props: {
|
|
31
|
-
[x: string]: any;
|
|
32
|
-
invalid?: boolean | undefined;
|
|
33
|
-
label?: string | undefined;
|
|
34
|
-
context?: string | undefined;
|
|
35
|
-
self?: null | undefined;
|
|
36
|
-
c?: string | undefined;
|
|
37
|
-
typename?: string | undefined;
|
|
38
|
-
a?: string | undefined;
|
|
39
|
-
pushChangesImmediately?: boolean | undefined;
|
|
40
|
-
s?: string | undefined;
|
|
41
|
-
placeholder?: string | undefined;
|
|
42
|
-
itype?: string | undefined;
|
|
43
|
-
val?: string | undefined;
|
|
44
|
-
validateCb?: any;
|
|
45
|
-
validate?: (() => boolean) | undefined;
|
|
46
|
-
};
|
|
47
|
-
events: {
|
|
48
|
-
[evt: string]: CustomEvent<any>;
|
|
49
|
-
};
|
|
50
|
-
slots: {};
|
|
51
|
-
};
|
|
52
|
-
export {};
|
|
1
|
+
/** @typedef {typeof __propDef.props} InputboxProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} InputboxEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} InputboxSlots */
|
|
4
|
+
export default class Inputbox extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
invalid?: boolean | undefined;
|
|
7
|
+
label?: string | undefined;
|
|
8
|
+
context?: string | undefined;
|
|
9
|
+
self?: null | undefined;
|
|
10
|
+
c?: string | undefined;
|
|
11
|
+
typename?: string | undefined;
|
|
12
|
+
a?: string | undefined;
|
|
13
|
+
pushChangesImmediately?: boolean | undefined;
|
|
14
|
+
s?: string | undefined;
|
|
15
|
+
placeholder?: string | undefined;
|
|
16
|
+
itype?: string | undefined;
|
|
17
|
+
val?: string | undefined;
|
|
18
|
+
validateCb?: any;
|
|
19
|
+
validate?: (() => boolean) | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}> {
|
|
23
|
+
get validate(): () => boolean;
|
|
24
|
+
}
|
|
25
|
+
export type InputboxProps = typeof __propDef.props;
|
|
26
|
+
export type InputboxEvents = typeof __propDef.events;
|
|
27
|
+
export type InputboxSlots = typeof __propDef.slots;
|
|
28
|
+
import { SvelteComponentTyped } from "svelte";
|
|
29
|
+
declare const __propDef: {
|
|
30
|
+
props: {
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
invalid?: boolean | undefined;
|
|
33
|
+
label?: string | undefined;
|
|
34
|
+
context?: string | undefined;
|
|
35
|
+
self?: null | undefined;
|
|
36
|
+
c?: string | undefined;
|
|
37
|
+
typename?: string | undefined;
|
|
38
|
+
a?: string | undefined;
|
|
39
|
+
pushChangesImmediately?: boolean | undefined;
|
|
40
|
+
s?: string | undefined;
|
|
41
|
+
placeholder?: string | undefined;
|
|
42
|
+
itype?: string | undefined;
|
|
43
|
+
val?: string | undefined;
|
|
44
|
+
validateCb?: any;
|
|
45
|
+
validate?: (() => boolean) | undefined;
|
|
46
|
+
};
|
|
47
|
+
events: {
|
|
48
|
+
[evt: string]: CustomEvent<any>;
|
|
49
|
+
};
|
|
50
|
+
slots: {};
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -1,23 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import type { rList_property } from "../list/List";
|
|
2
|
+
export declare const KanbanCardTop = 1;
|
|
3
|
+
export declare const KanbanCardMiddle = 2;
|
|
4
|
+
export declare const KanbanCardBottom = 3;
|
|
5
|
+
export declare class rKanban_column {
|
|
6
|
+
id: number;
|
|
7
|
+
title: string;
|
|
8
|
+
width: string;
|
|
9
|
+
state: any;
|
|
10
|
+
finishing: boolean;
|
|
11
|
+
operations: object[] | undefined;
|
|
12
|
+
onTitleChanged: Function | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare class rKanban_definition {
|
|
15
|
+
columns: rKanban_column[];
|
|
16
|
+
titleAttrib: string;
|
|
17
|
+
titleOnChange: Function | undefined;
|
|
18
|
+
titleReadOnly: boolean;
|
|
19
|
+
summaryAttrib: string;
|
|
20
|
+
summaryOnChange: Function | undefined;
|
|
21
|
+
summaryReadOnly: boolean;
|
|
22
|
+
properties: rList_property[];
|
|
23
|
+
self: object | undefined;
|
|
24
|
+
a: string;
|
|
25
|
+
objects: object[] | undefined;
|
|
26
|
+
context: string;
|
|
27
|
+
key: string;
|
|
28
|
+
typename: string;
|
|
29
|
+
stateAttrib: string;
|
|
30
|
+
orderAttrib: string;
|
|
31
|
+
onUp: Function | undefined;
|
|
32
|
+
onDown: Function | undefined;
|
|
33
|
+
onAdd: Function | undefined;
|
|
34
|
+
onRemove: Function | undefined;
|
|
35
|
+
onReplace: Function | undefined;
|
|
36
|
+
onOpen: Function | undefined;
|
|
37
|
+
getCardOperations: Function | undefined;
|
|
38
|
+
private items;
|
|
39
|
+
getItems(): object[];
|
|
40
|
+
clear(): void;
|
|
41
|
+
}
|
|
42
|
+
export declare const KanbanColumnTop = -1;
|
|
43
|
+
export declare const KanbanColumnBottom = -2;
|
|
@@ -1,23 +1,79 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
export const KanbanCardTop = 1;
|
|
2
|
+
export const KanbanCardMiddle = 2;
|
|
3
|
+
export const KanbanCardBottom = 3;
|
|
4
|
+
export class rKanban_column {
|
|
5
|
+
id;
|
|
6
|
+
title = '';
|
|
7
|
+
width = 'w-[240px]';
|
|
8
|
+
state = '';
|
|
9
|
+
finishing = false;
|
|
10
|
+
operations = undefined;
|
|
11
|
+
onTitleChanged = undefined;
|
|
12
|
+
}
|
|
13
|
+
export class rKanban_definition {
|
|
14
|
+
columns = [];
|
|
15
|
+
titleAttrib = '';
|
|
16
|
+
titleOnChange = undefined;
|
|
17
|
+
titleReadOnly = false;
|
|
18
|
+
summaryAttrib = '';
|
|
19
|
+
summaryOnChange = undefined;
|
|
20
|
+
summaryReadOnly = false;
|
|
21
|
+
properties = [];
|
|
22
|
+
self = undefined;
|
|
23
|
+
a = '';
|
|
24
|
+
objects = undefined;
|
|
25
|
+
context = '';
|
|
26
|
+
key = '';
|
|
27
|
+
typename = '';
|
|
28
|
+
stateAttrib = '';
|
|
29
|
+
orderAttrib = '';
|
|
30
|
+
onUp = undefined;
|
|
31
|
+
onDown = undefined;
|
|
32
|
+
onAdd = undefined;
|
|
33
|
+
onRemove = undefined;
|
|
34
|
+
onReplace = undefined;
|
|
35
|
+
onOpen = undefined;
|
|
36
|
+
getCardOperations = undefined;
|
|
37
|
+
items = null;
|
|
38
|
+
getItems() {
|
|
39
|
+
if (this.items == null) {
|
|
40
|
+
let item = this.self;
|
|
41
|
+
this.items = null;
|
|
42
|
+
if (this.objects)
|
|
43
|
+
this.items = this.objects;
|
|
44
|
+
else if (item && this.a)
|
|
45
|
+
this.items = item[this.a];
|
|
46
|
+
if (this.items == null)
|
|
47
|
+
this.items = [];
|
|
48
|
+
}
|
|
49
|
+
return this.items;
|
|
50
|
+
}
|
|
51
|
+
clear() {
|
|
52
|
+
this.columns = [];
|
|
53
|
+
this.titleAttrib = '';
|
|
54
|
+
this.titleOnChange = undefined;
|
|
55
|
+
this.titleReadOnly = false;
|
|
56
|
+
this.summaryAttrib = '';
|
|
57
|
+
this.summaryOnChange = undefined;
|
|
58
|
+
this.summaryReadOnly = false;
|
|
59
|
+
this.properties = [];
|
|
60
|
+
this.self = undefined;
|
|
61
|
+
this.a = '';
|
|
62
|
+
this.objects = undefined;
|
|
63
|
+
this.context = '';
|
|
64
|
+
this.key = '';
|
|
65
|
+
this.typename = '';
|
|
66
|
+
this.stateAttrib = '';
|
|
67
|
+
this.orderAttrib = '';
|
|
68
|
+
this.onUp = undefined;
|
|
69
|
+
this.onDown = undefined;
|
|
70
|
+
this.onAdd = undefined;
|
|
71
|
+
this.onRemove = undefined;
|
|
72
|
+
this.onReplace = undefined;
|
|
73
|
+
this.onOpen = undefined;
|
|
74
|
+
this.getCardOperations = undefined;
|
|
75
|
+
this.items = null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export const KanbanColumnTop = -1;
|
|
79
|
+
export const KanbanColumnBottom = -2;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { getContext } from "svelte";
|
|
1
|
+
<script>import { getContext, tick } from "svelte";
|
|
2
2
|
import {
|
|
3
3
|
contextItemsStore,
|
|
4
4
|
isActive,
|
|
@@ -6,23 +6,24 @@ import {
|
|
|
6
6
|
activateItem,
|
|
7
7
|
selectable,
|
|
8
8
|
editable,
|
|
9
|
-
showFloatingToolbar
|
|
9
|
+
showFloatingToolbar,
|
|
10
|
+
informModification,
|
|
11
|
+
pushChanges
|
|
10
12
|
} from "../../..";
|
|
11
|
-
import { FaArrowsAlt, FaTrash, FaPlus,
|
|
13
|
+
import { FaArrowsAlt, FaTrash, FaPlus, FaExternalLinkAlt } from "svelte-icons/fa";
|
|
12
14
|
import MoveOperations from "./kanban.move.menu.svelte";
|
|
15
|
+
import Properties from "./kanban.props.svelte";
|
|
16
|
+
import { KanbanCardTop, KanbanCardMiddle, KanbanCardBottom } from "../Kanban";
|
|
13
17
|
export let item;
|
|
14
|
-
export let showMoveOperationsForItem = void 0;
|
|
15
|
-
export let scrollViewToCard = void 0;
|
|
16
|
-
export let runInserter = void 0;
|
|
17
18
|
let definition = getContext("rKanban-definition");
|
|
18
19
|
$:
|
|
19
|
-
|
|
20
|
+
isCardActive = calculate_active(item, $contextItemsStore);
|
|
20
21
|
$:
|
|
21
|
-
|
|
22
|
+
isCardSelected = selected(item, $contextItemsStore);
|
|
22
23
|
$:
|
|
23
|
-
|
|
24
|
+
selectedClass = isCardSelected ? "!border-blue-300" : "";
|
|
24
25
|
$:
|
|
25
|
-
|
|
26
|
+
focusedClass = isCardActive ? "bg-stone-100 dark:bg-stone-700" : "";
|
|
26
27
|
function calculate_active(...args) {
|
|
27
28
|
return isActive("props", item);
|
|
28
29
|
}
|
|
@@ -35,47 +36,19 @@ export function activate(e) {
|
|
|
35
36
|
if (isActive("props", item)) {
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
39
|
+
let operations = getOperations();
|
|
38
40
|
activateItem("props", item, operations);
|
|
39
41
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
runInserter(item);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
caption: "",
|
|
51
|
-
icon: FaArrowsAlt,
|
|
52
|
-
toolbar: MoveOperations,
|
|
53
|
-
props: {
|
|
54
|
-
definition,
|
|
55
|
-
item,
|
|
56
|
-
afterActionOperation: scrollViewToCard
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
caption: "",
|
|
61
|
-
icon: FaTrash,
|
|
62
|
-
action: (f) => definition.onRemove(item)
|
|
42
|
+
function getOperations() {
|
|
43
|
+
let operations = [];
|
|
44
|
+
const getCustomOperations = definition.getCardOperations;
|
|
45
|
+
if (getCustomOperations) {
|
|
46
|
+
const cutomOperations = getCustomOperations(item);
|
|
47
|
+
cutomOperations.forEach((o) => operations.push(o));
|
|
63
48
|
}
|
|
64
|
-
|
|
65
|
-
let moveButton;
|
|
66
|
-
let card;
|
|
67
|
-
export function showMoveOperations() {
|
|
68
|
-
let rect = moveButton.getBoundingClientRect();
|
|
69
|
-
showFloatingToolbar(
|
|
70
|
-
rect,
|
|
71
|
-
MoveOperations,
|
|
72
|
-
{
|
|
73
|
-
definition,
|
|
74
|
-
item,
|
|
75
|
-
afterActionOperation: showMoveOperationsForItem
|
|
76
|
-
}
|
|
77
|
-
);
|
|
49
|
+
return operations;
|
|
78
50
|
}
|
|
51
|
+
let card;
|
|
79
52
|
export function _scrollViewToCard() {
|
|
80
53
|
card?.scrollIntoView(
|
|
81
54
|
{
|
|
@@ -85,74 +58,179 @@ export function _scrollViewToCard() {
|
|
|
85
58
|
}
|
|
86
59
|
);
|
|
87
60
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
61
|
+
function onTitleChanged(text) {
|
|
62
|
+
if (definition.titleOnChange)
|
|
63
|
+
definition.titleOnChange(text, item);
|
|
64
|
+
else {
|
|
65
|
+
item[definition.titleAttrib] = text;
|
|
66
|
+
informModification(item, definition.titleAttrib);
|
|
67
|
+
pushChanges();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function onSummaryChanged(text) {
|
|
71
|
+
if (definition.summaryOnChange)
|
|
72
|
+
definition.summaryOnChange(text, item);
|
|
73
|
+
else {
|
|
74
|
+
item[definition.summaryAttrib] = text;
|
|
75
|
+
informModification(item, definition.summaryAttrib);
|
|
76
|
+
pushChanges();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function setSelectionAtEnd(element) {
|
|
80
|
+
const textNode = element.childNodes[0];
|
|
81
|
+
const text = textNode.textContent;
|
|
82
|
+
let range = document.createRange();
|
|
83
|
+
let end_offset = text.length;
|
|
84
|
+
let end_container = textNode;
|
|
85
|
+
range.setStart(end_container, end_offset);
|
|
86
|
+
range.setEnd(end_container, end_offset);
|
|
87
|
+
let sel = window.getSelection();
|
|
88
|
+
sel.removeAllRanges();
|
|
89
|
+
sel.addRange(range);
|
|
90
|
+
}
|
|
91
|
+
let topProps;
|
|
92
|
+
let middleProps;
|
|
93
|
+
let bottomProps;
|
|
94
|
+
let titleElement;
|
|
95
|
+
let summaryElement;
|
|
96
|
+
let summaryPlaceholder = false;
|
|
97
|
+
export async function editProperty(field) {
|
|
98
|
+
if (field == "Title") {
|
|
99
|
+
titleElement.focus();
|
|
100
|
+
await tick();
|
|
101
|
+
setSelectionAtEnd(titleElement);
|
|
102
|
+
} else if (field == "Summary") {
|
|
103
|
+
if (!!summaryElement) {
|
|
104
|
+
summaryElement.focus();
|
|
105
|
+
await tick();
|
|
106
|
+
setSelectionAtEnd(summaryElement);
|
|
107
|
+
} else {
|
|
108
|
+
summaryPlaceholder = true;
|
|
109
|
+
await tick();
|
|
110
|
+
if (!!summaryElement)
|
|
111
|
+
summaryElement.focus();
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
const property = definition.properties.find((p) => p.name == field);
|
|
115
|
+
if (!property)
|
|
116
|
+
return;
|
|
117
|
+
switch (property.position) {
|
|
118
|
+
case KanbanCardTop:
|
|
119
|
+
topProps.editProperty(field);
|
|
120
|
+
break;
|
|
121
|
+
case KanbanCardMiddle:
|
|
122
|
+
middleProps.editProperty(field);
|
|
123
|
+
break;
|
|
124
|
+
case KanbanCardBottom:
|
|
125
|
+
bottomProps.editProperty(field);
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
133
|
+
|
|
134
|
+
<li class="mx-2 pt-2 pb-4 px-1 rounded-md border border-transparent {selectedClass} {focusedClass}"
|
|
135
|
+
class:cursor-pointer={!isCardActive}
|
|
136
|
+
on:click={activate}
|
|
137
|
+
use:selectable={item}
|
|
138
|
+
bind:this={card}>
|
|
139
|
+
|
|
140
|
+
<!-- -->
|
|
141
|
+
<!--section class="h-6 w-full flex flex-row ">
|
|
142
|
+
<button class="h-3 w-3"
|
|
143
|
+
class:hidden={!isCardActive}
|
|
144
|
+
on:click={(e) => showMoveOperations()}
|
|
145
|
+
bind:this={moveButton}>
|
|
146
|
+
<FaArrowsAlt/>
|
|
147
|
+
</button>
|
|
148
|
+
|
|
149
|
+
{#if $$slots.kanbanCardTopProps}
|
|
150
|
+
<div class="ml-auto flex flex-row gap-2">
|
|
151
|
+
<slot name="kanbanCardTopProps" element={item}/>
|
|
152
|
+
</div>
|
|
153
|
+
{/if}
|
|
154
|
+
</section-->
|
|
155
|
+
|
|
156
|
+
{#if $$slots.kanbanCardTopProps}
|
|
157
|
+
<section class="flex flex-row justify-between">
|
|
158
|
+
<slot name="kanbanCardTopProps" element={item}/>
|
|
159
|
+
</section>
|
|
160
|
+
{/if}
|
|
161
|
+
<Properties position={KanbanCardTop} {item} bind:this={topProps}/>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
{#if isCardActive}
|
|
165
|
+
<h3 class=" text-lg font-semibold min-h-[1.75rem]
|
|
166
|
+
sm:text-sm sm:font-semibold sm:min-h-[1.25rem]
|
|
167
|
+
whitespace-nowrap overflow-clip truncate w-full sm:flex-none
|
|
168
|
+
relative"
|
|
169
|
+
use:editable={{
|
|
170
|
+
action: (text) => onTitleChanged(text),
|
|
171
|
+
active: true,
|
|
172
|
+
readonly: definition.titleReadOnly,
|
|
173
|
+
onFinish: (d) => {titleElement.blur()}}}
|
|
174
|
+
bind:this={titleElement}>
|
|
175
|
+
{item[definition.titleAttrib]}
|
|
176
|
+
|
|
177
|
+
{#if definition.onOpen}
|
|
178
|
+
<button class="absolute top-1 right-0 w-5 h-5 sm:w-3 sm:h-3"
|
|
179
|
+
on:click={(e) => definition.onOpen(item)}>
|
|
180
|
+
<FaExternalLinkAlt/>
|
|
181
|
+
</button>
|
|
182
|
+
{/if}
|
|
183
|
+
</h3>
|
|
184
|
+
{:else}
|
|
185
|
+
<h3 class=" text-lg font-semibold min-h-[1.75rem]
|
|
186
|
+
sm:text-sm sm:font-semibold sm:min-h-[1.25rem]
|
|
187
|
+
whitespace-nowrap overflow-clip truncate w-full sm:flex-none
|
|
188
|
+
relative">
|
|
189
|
+
{item[definition.titleAttrib]}
|
|
190
|
+
|
|
191
|
+
</h3>
|
|
192
|
+
{/if}
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
{#if $$slots.kanbanCardMiddleProps}
|
|
196
|
+
<section class="w-full flex flex-row">
|
|
197
|
+
<slot name="kanbanCardMiddleProps" element={item} />
|
|
198
|
+
</section>
|
|
199
|
+
{/if}
|
|
200
|
+
|
|
201
|
+
<Properties position={KanbanCardMiddle} {item} bind:this={middleProps}/>
|
|
202
|
+
|
|
203
|
+
{#if item[definition.summaryAttrib] || summaryPlaceholder}
|
|
204
|
+
{#key item[definition.summaryAttrib]}
|
|
205
|
+
{#if isCardActive}
|
|
206
|
+
<summary class=" sm:text-xs sm:min-h-[1rem]
|
|
207
|
+
text-base min-h-[1.5rem]
|
|
208
|
+
text-stone-400
|
|
209
|
+
max-h-[75px] sm:max-h-[64px]
|
|
210
|
+
overflow-hidden"
|
|
211
|
+
use:editable={{
|
|
212
|
+
action: (text) => onSummaryChanged(text),
|
|
213
|
+
active: true,
|
|
214
|
+
readonly: definition.summaryReadOnly,
|
|
215
|
+
onFinish: (d) => {summaryPlaceholder = false}}}
|
|
216
|
+
bind:this={summaryElement}>
|
|
217
|
+
{item[definition.summaryAttrib]}
|
|
218
|
+
</summary>
|
|
219
|
+
{:else}
|
|
220
|
+
<summary class=" sm:text-xs sm:min-h-[1rem]
|
|
221
|
+
text-base min-h-[1.5rem]
|
|
222
|
+
text-stone-400
|
|
223
|
+
max-h-[75px] sm:max-h-[64px]
|
|
224
|
+
overflow-hidden">
|
|
225
|
+
{item[definition.summaryAttrib]}
|
|
226
|
+
</summary>
|
|
227
|
+
{/if}
|
|
228
|
+
{/key}
|
|
229
|
+
{/if}
|
|
230
|
+
|
|
231
|
+
{#if $$slots.kanbanCardBottomProps}
|
|
232
|
+
<slot name="kanbanCardBottomProps" element={item} />
|
|
233
|
+
{/if}
|
|
234
|
+
|
|
235
|
+
<Properties position={KanbanCardBottom} {item} bind:this={bottomProps}/>
|
|
158
236
|
</li>
|