@humandialog/forms.svelte 1.3.16 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Fab.svelte +77 -46
- package/components/Floating_container.svelte +1 -1
- package/components/combo/combo.svelte +18 -15
- package/components/combo/combo.svelte.d.ts +1 -0
- package/components/contextmenu.svelte +25 -6
- package/components/date.svelte +10 -4
- package/components/date.svelte.d.ts +1 -0
- package/components/date_utils.d.ts +1 -0
- package/components/date_utils.js +10 -0
- package/components/delayed.spinner.svelte +1 -2
- package/components/document/editor.svelte +419 -46
- package/components/document/editor.svelte.d.ts +115 -0
- package/components/document/internal/palette.svelte +20 -0
- package/components/list/List.d.ts +6 -0
- package/components/list/List.js +6 -0
- package/components/list/internal/list.element.props.svelte +23 -8
- package/components/list/internal/list.element.svelte +43 -18
- package/components/list/internal/list.element.svelte.d.ts +1 -0
- package/components/list/list.combo.svelte +6 -0
- package/components/list/list.combo.svelte.d.ts +3 -0
- package/components/list/list.date.svelte +8 -0
- package/components/list/list.date.svelte.d.ts +4 -0
- package/components/list/list.static.svelte +6 -0
- package/components/list/list.static.svelte.d.ts +3 -0
- package/components/list/list.svelte +17 -17
- package/components/list/list.tags.svelte +32 -0
- package/components/list/list.tags.svelte.d.ts +24 -0
- package/components/sidebar/sidebar.item.svelte +25 -8
- package/components/tags.svelte +15 -7
- package/components/tags.svelte.d.ts +2 -0
- package/desk.svelte +9 -6
- package/index.d.ts +7 -2
- package/index.js +7 -2
- package/operations.svelte +61 -12
- package/package.json +4 -2
- package/stores.d.ts +3 -0
- package/stores.js +25 -2
- package/tenant.members.svelte +61 -59
- package/tenant.members.svelte.d.ts +2 -0
|
@@ -16,9 +16,69 @@ declare const __propDef: {
|
|
|
16
16
|
onRemoveImage?: undefined;
|
|
17
17
|
c?: string | undefined;
|
|
18
18
|
pushChangesImmediately?: boolean | undefined;
|
|
19
|
+
chat?: object | undefined;
|
|
20
|
+
readOnly?: boolean | undefined;
|
|
21
|
+
extraFrontPaletteCommands?: any[] | undefined;
|
|
22
|
+
extraBackPaletteCommands?: any[] | undefined;
|
|
23
|
+
extraInsertPaletteCommands?: any[] | undefined;
|
|
19
24
|
run?: ((onStop?: undefined) => void) | undefined;
|
|
20
25
|
getFormattingOperations?: ((withCaptions?: boolean) => any[]) | undefined;
|
|
26
|
+
getMarksOperations?: ((tbr?: string) => {
|
|
27
|
+
caption: string;
|
|
28
|
+
operations: any[];
|
|
29
|
+
preAction: (f: any) => void;
|
|
30
|
+
tbr: string;
|
|
31
|
+
}) | undefined;
|
|
32
|
+
getStylesOperations?: ((tbr?: string) => {
|
|
33
|
+
caption: string;
|
|
34
|
+
operations: any[];
|
|
35
|
+
preAction: (f: any) => void;
|
|
36
|
+
tbr: string;
|
|
37
|
+
}) | undefined;
|
|
38
|
+
getInsertOperations?: ((tbr?: string) => {
|
|
39
|
+
caption: string;
|
|
40
|
+
operations: any[];
|
|
41
|
+
preAction: (f: any) => void;
|
|
42
|
+
tbr: string;
|
|
43
|
+
}) | undefined;
|
|
44
|
+
scrollIntoView?: ((param: any) => void) | undefined;
|
|
21
45
|
save?: (() => void) | undefined;
|
|
46
|
+
addTemporaryImage?: ((src: any) => void) | undefined;
|
|
47
|
+
replaceTemporaryImage?: ((temporarySrc: any, dataPath: any) => void) | undefined;
|
|
48
|
+
removeTemporaryImage?: ((temporarySrc: any) => void) | undefined;
|
|
49
|
+
getInnerHtml?: (() => any) | undefined;
|
|
50
|
+
setInnerHtml?: ((content: any) => void) | undefined;
|
|
51
|
+
setBold?: (() => void) | undefined;
|
|
52
|
+
setItalic?: (() => void) | undefined;
|
|
53
|
+
setUnderline?: (() => void) | undefined;
|
|
54
|
+
setStrikethrough?: (() => void) | undefined;
|
|
55
|
+
setNormal?: (() => void) | undefined;
|
|
56
|
+
setHeading?: ((level: any) => void) | undefined;
|
|
57
|
+
setCode?: (() => void) | undefined;
|
|
58
|
+
setComment?: (() => void) | undefined;
|
|
59
|
+
setQuote?: (() => void) | undefined;
|
|
60
|
+
setWarning?: (() => void) | undefined;
|
|
61
|
+
setInfo?: (() => void) | undefined;
|
|
62
|
+
setBulletList?: (() => void) | undefined;
|
|
63
|
+
setImage?: (() => void) | undefined;
|
|
64
|
+
setTable?: (() => void) | undefined;
|
|
65
|
+
setHorizontalRule?: (() => void) | undefined;
|
|
66
|
+
isActiveBold?: (() => any) | undefined;
|
|
67
|
+
isActiveItalic?: (() => any) | undefined;
|
|
68
|
+
isActiveUnderlie?: (() => any) | undefined;
|
|
69
|
+
isActiveStrikethrough?: (() => any) | undefined;
|
|
70
|
+
isActiveNormal?: (() => any) | undefined;
|
|
71
|
+
isActiveHeading?: ((level: any) => any) | undefined;
|
|
72
|
+
isActiveCode?: (() => any) | undefined;
|
|
73
|
+
isActiveComment?: (() => any) | undefined;
|
|
74
|
+
isActiveQuote?: (() => any) | undefined;
|
|
75
|
+
isActiveWarning?: (() => any) | undefined;
|
|
76
|
+
isActiveInfo?: (() => any) | undefined;
|
|
77
|
+
isActiveBulletList?: (() => any) | undefined;
|
|
78
|
+
isActiveImage?: (() => boolean) | undefined;
|
|
79
|
+
isActiveTable?: (() => void) | undefined;
|
|
80
|
+
isActiveHorizontalRule?: (() => boolean) | undefined;
|
|
81
|
+
preventBlur?: (() => void) | undefined;
|
|
22
82
|
};
|
|
23
83
|
events: {
|
|
24
84
|
[evt: string]: CustomEvent<any>;
|
|
@@ -31,6 +91,61 @@ export type EditorSlots = typeof __propDef.slots;
|
|
|
31
91
|
export default class Editor extends SvelteComponentTyped<EditorProps, EditorEvents, EditorSlots> {
|
|
32
92
|
get run(): (onStop?: undefined) => void;
|
|
33
93
|
get getFormattingOperations(): (withCaptions?: boolean) => any[];
|
|
94
|
+
get getMarksOperations(): (tbr?: string) => {
|
|
95
|
+
caption: string;
|
|
96
|
+
operations: any[];
|
|
97
|
+
preAction: (f: any) => void;
|
|
98
|
+
tbr: string;
|
|
99
|
+
};
|
|
100
|
+
get getStylesOperations(): (tbr?: string) => {
|
|
101
|
+
caption: string;
|
|
102
|
+
operations: any[];
|
|
103
|
+
preAction: (f: any) => void;
|
|
104
|
+
tbr: string;
|
|
105
|
+
};
|
|
106
|
+
get getInsertOperations(): (tbr?: string) => {
|
|
107
|
+
caption: string;
|
|
108
|
+
operations: any[];
|
|
109
|
+
preAction: (f: any) => void;
|
|
110
|
+
tbr: string;
|
|
111
|
+
};
|
|
112
|
+
get scrollIntoView(): (param: any) => void;
|
|
34
113
|
get save(): () => void;
|
|
114
|
+
get addTemporaryImage(): (src: any) => void;
|
|
115
|
+
get replaceTemporaryImage(): (temporarySrc: any, dataPath: any) => void;
|
|
116
|
+
get removeTemporaryImage(): (temporarySrc: any) => void;
|
|
117
|
+
get getInnerHtml(): () => any;
|
|
118
|
+
get setInnerHtml(): (content: any) => void;
|
|
119
|
+
get setBold(): () => void;
|
|
120
|
+
get setItalic(): () => void;
|
|
121
|
+
get setUnderline(): () => void;
|
|
122
|
+
get setStrikethrough(): () => void;
|
|
123
|
+
get setNormal(): () => void;
|
|
124
|
+
get setHeading(): (level: any) => void;
|
|
125
|
+
get setCode(): () => void;
|
|
126
|
+
get setComment(): () => void;
|
|
127
|
+
get setQuote(): () => void;
|
|
128
|
+
get setWarning(): () => void;
|
|
129
|
+
get setInfo(): () => void;
|
|
130
|
+
get setBulletList(): () => void;
|
|
131
|
+
get setImage(): () => void;
|
|
132
|
+
get setTable(): () => void;
|
|
133
|
+
get setHorizontalRule(): () => void;
|
|
134
|
+
get isActiveBold(): () => any;
|
|
135
|
+
get isActiveItalic(): () => any;
|
|
136
|
+
get isActiveUnderlie(): () => any;
|
|
137
|
+
get isActiveStrikethrough(): () => any;
|
|
138
|
+
get isActiveNormal(): () => any;
|
|
139
|
+
get isActiveHeading(): (level: any) => any;
|
|
140
|
+
get isActiveCode(): () => any;
|
|
141
|
+
get isActiveComment(): () => any;
|
|
142
|
+
get isActiveQuote(): () => any;
|
|
143
|
+
get isActiveWarning(): () => any;
|
|
144
|
+
get isActiveInfo(): () => any;
|
|
145
|
+
get isActiveBulletList(): () => any;
|
|
146
|
+
get isActiveImage(): () => boolean;
|
|
147
|
+
get isActiveTable(): () => void;
|
|
148
|
+
get isActiveHorizontalRule(): () => boolean;
|
|
149
|
+
get preventBlur(): () => void;
|
|
35
150
|
}
|
|
36
151
|
export {};
|
|
@@ -98,6 +98,26 @@ export function filter(key) {
|
|
|
98
98
|
else
|
|
99
99
|
return true;
|
|
100
100
|
});
|
|
101
|
+
let lastSeparatorIdx = -1;
|
|
102
|
+
let commandsNo = filtered_commands.length;
|
|
103
|
+
for (let i = 0; i < commandsNo; i++) {
|
|
104
|
+
if (filtered_commands[i].separator == true) {
|
|
105
|
+
if (i == 0) {
|
|
106
|
+
filtered_commands.splice(i, 1);
|
|
107
|
+
commandsNo--;
|
|
108
|
+
i--;
|
|
109
|
+
} else if (lastSeparatorIdx < 0)
|
|
110
|
+
lastSeparatorIdx = i;
|
|
111
|
+
else if (lastSeparatorIdx == i - 1) {
|
|
112
|
+
filtered_commands.splice(i, 1);
|
|
113
|
+
commandsNo--;
|
|
114
|
+
i--;
|
|
115
|
+
} else
|
|
116
|
+
lastSeparatorIdx = i;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (filtered_commands[commandsNo - 1].separator == true)
|
|
120
|
+
filtered_commands.splice(commandsNo - 1, 1);
|
|
101
121
|
if (!current_command || filtered_commands.every((v) => v != current_command)) {
|
|
102
122
|
if (filtered_commands.length)
|
|
103
123
|
current_command = get_operation_or_next_valid(0);
|
|
@@ -14,6 +14,11 @@ export declare class rList_property {
|
|
|
14
14
|
a: string;
|
|
15
15
|
onSelect: Function | undefined;
|
|
16
16
|
position: number | string | undefined;
|
|
17
|
+
readOnly: boolean;
|
|
18
|
+
detailed: boolean;
|
|
19
|
+
prefix: string;
|
|
20
|
+
postfix: string;
|
|
21
|
+
getter: Function | undefined;
|
|
17
22
|
}
|
|
18
23
|
export declare class rList_property_combo extends rList_property {
|
|
19
24
|
constructor();
|
|
@@ -44,4 +49,5 @@ export declare class rList_definition {
|
|
|
44
49
|
inserter_icon: boolean;
|
|
45
50
|
onOpen: Function | undefined;
|
|
46
51
|
properties: rList_property[];
|
|
52
|
+
tags: rList_property_tags | null;
|
|
47
53
|
}
|
package/components/list/List.js
CHANGED
|
@@ -17,6 +17,11 @@ export class rList_property {
|
|
|
17
17
|
a = '';
|
|
18
18
|
onSelect = undefined;
|
|
19
19
|
position = undefined;
|
|
20
|
+
readOnly = false;
|
|
21
|
+
detailed = false;
|
|
22
|
+
prefix = '';
|
|
23
|
+
postfix = '';
|
|
24
|
+
getter = undefined;
|
|
20
25
|
}
|
|
21
26
|
export class rList_property_combo extends rList_property {
|
|
22
27
|
constructor() {
|
|
@@ -52,4 +57,5 @@ export class rList_definition {
|
|
|
52
57
|
inserter_icon = false;
|
|
53
58
|
onOpen = undefined;
|
|
54
59
|
properties = [];
|
|
60
|
+
tags = null;
|
|
55
61
|
}
|
|
@@ -70,10 +70,11 @@ async function edit_date(field, prop_idx) {
|
|
|
70
70
|
|
|
71
71
|
<div class="text-base grid-{definition.properties.length}">
|
|
72
72
|
{#each definition.properties as prop, prop_index}
|
|
73
|
-
<
|
|
74
|
-
{#if item[prop.a] || placeholder == prop.name}
|
|
75
|
-
<
|
|
73
|
+
<div class="col-span-1 w-full mr-auto mt-0.5">
|
|
74
|
+
{#if item[prop.a] || placeholder == prop.name || prop.getter}
|
|
75
|
+
<div role="gridcell" tabindex="0">
|
|
76
76
|
{#if prop.type == rList_property_type.Date}
|
|
77
|
+
{@const pickerType = prop.detailed ? 'datetime-local' : 'date'}
|
|
77
78
|
<DatePicker self={item}
|
|
78
79
|
a={prop.a}
|
|
79
80
|
compact={true}
|
|
@@ -82,6 +83,8 @@ async function edit_date(field, prop_idx) {
|
|
|
82
83
|
inContext="props sel"
|
|
83
84
|
bind:this={props[prop_index]}
|
|
84
85
|
changed={(value)=>{on_date_changed(value, prop.a)}}
|
|
86
|
+
readOnly={prop.readOnly}
|
|
87
|
+
type={pickerType}
|
|
85
88
|
/>
|
|
86
89
|
{:else if prop.type == rList_property_type.Combo}
|
|
87
90
|
<Combo self={item}
|
|
@@ -95,15 +98,27 @@ async function edit_date(field, prop_idx) {
|
|
|
95
98
|
bind:this={props[prop_index]}
|
|
96
99
|
definition={prop.combo_definition}
|
|
97
100
|
changed={(key,name)=>{on_combo_changed(key, name, prop)}}
|
|
101
|
+
readOnly={prop.readOnly}
|
|
98
102
|
s="sm"/>
|
|
99
103
|
{:else if prop.type == rList_property_type.Static}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
{@const value = prop.getter ? prop.getter(item) : item[prop.a]}
|
|
105
|
+
<p class="truncate text-sm">
|
|
106
|
+
{#if prop.prefix}
|
|
107
|
+
<span>{prop.prefix}</span>
|
|
108
|
+
{/if}
|
|
109
|
+
|
|
110
|
+
{value}
|
|
111
|
+
|
|
112
|
+
{#if prop.postfix}
|
|
113
|
+
<span>{prop.postfix}</span>
|
|
114
|
+
{/if}
|
|
115
|
+
|
|
116
|
+
</p>
|
|
103
117
|
{/if}
|
|
104
|
-
|
|
118
|
+
|
|
119
|
+
</div>
|
|
105
120
|
{/if}
|
|
106
|
-
|
|
121
|
+
</div>
|
|
107
122
|
{/each}
|
|
108
123
|
</div>
|
|
109
124
|
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
selectable,
|
|
6
6
|
activateItem,
|
|
7
7
|
isActive,
|
|
8
|
+
getActive,
|
|
8
9
|
editable,
|
|
9
10
|
startEditing
|
|
10
11
|
} from "../../../utils";
|
|
@@ -16,13 +17,14 @@ import { isDeviceSmallerThan } from "../../../utils";
|
|
|
16
17
|
import { rList_definition, rList_property_type } from "../List";
|
|
17
18
|
import { push } from "svelte-spa-router";
|
|
18
19
|
import { FaExternalLinkAlt } from "svelte-icons/fa/";
|
|
19
|
-
import
|
|
20
|
+
import Tags from "../../tags.svelte";
|
|
20
21
|
export let item;
|
|
21
22
|
export let title = "";
|
|
22
23
|
export let summary = "";
|
|
23
24
|
export let typename = void 0;
|
|
24
25
|
export let toolbarOperations = void 0;
|
|
25
26
|
export let contextMenu = void 0;
|
|
27
|
+
export let key = "";
|
|
26
28
|
let definition = getContext("rList-definition");
|
|
27
29
|
let placeholder = "";
|
|
28
30
|
let props_sm;
|
|
@@ -45,14 +47,6 @@ if (!typename) {
|
|
|
45
47
|
typename = s[1];
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
|
-
let item_key = "";
|
|
49
|
-
let keys = Object.keys(item);
|
|
50
|
-
if (keys.includes("$ref"))
|
|
51
|
-
item_key = "$ref";
|
|
52
|
-
else if (keys.includes("Id"))
|
|
53
|
-
item_key = "Id";
|
|
54
|
-
else if (keys.length > 0)
|
|
55
|
-
item_key = keys[0];
|
|
56
50
|
if (!title)
|
|
57
51
|
title = definition.title;
|
|
58
52
|
if (!summary)
|
|
@@ -74,11 +68,29 @@ function calc_horz_division() {
|
|
|
74
68
|
}
|
|
75
69
|
}
|
|
76
70
|
function calculate_active(...args) {
|
|
77
|
-
|
|
71
|
+
const activeItem = getActive("props");
|
|
72
|
+
if (!activeItem)
|
|
73
|
+
return false;
|
|
74
|
+
const activeKey = getItemKey(activeItem);
|
|
75
|
+
const itemKey = getItemKey(item);
|
|
76
|
+
if (activeKey == itemKey) {
|
|
77
|
+
return true;
|
|
78
|
+
} else
|
|
79
|
+
return false;
|
|
78
80
|
}
|
|
79
81
|
function selected(...args) {
|
|
80
82
|
return isSelected(item);
|
|
81
83
|
}
|
|
84
|
+
function getItemKey(item2) {
|
|
85
|
+
if (key)
|
|
86
|
+
return item2[key];
|
|
87
|
+
else if (item2.$ref)
|
|
88
|
+
return item2.$ref;
|
|
89
|
+
else if (item2.Id)
|
|
90
|
+
return item2.Id;
|
|
91
|
+
else
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
82
94
|
async function change_name(text) {
|
|
83
95
|
if (definition.on_title_changed) {
|
|
84
96
|
definition.on_title_changed(item, text, title);
|
|
@@ -186,7 +198,7 @@ export function editProperty(field) {
|
|
|
186
198
|
}
|
|
187
199
|
}
|
|
188
200
|
async function force_editing(field) {
|
|
189
|
-
let element_id = `__hd_list_ctrl_${item
|
|
201
|
+
let element_id = `__hd_list_ctrl_${getItemKey(item)}_${field}`;
|
|
190
202
|
let element_node = document.getElementById(element_id);
|
|
191
203
|
if (!element_node) {
|
|
192
204
|
placeholder = field;
|
|
@@ -241,10 +253,9 @@ export function scrollToView() {
|
|
|
241
253
|
{@const element_title = item[title]}
|
|
242
254
|
|
|
243
255
|
<section class="my-1 flex flex-row w-full text-stone-700 dark:text-stone-300 cursor-default rounded-md border border-transparent {selected_class} {focused_class} scroll-mt-[50px] sm:scroll-mt-[40px]"
|
|
244
|
-
on:contextmenu={on_contextmenu}
|
|
245
256
|
role="menu"
|
|
246
257
|
tabindex="-1"
|
|
247
|
-
bind:this={rootElement}>
|
|
258
|
+
bind:this={rootElement}> <!-- on:contextmenu={on_contextmenu} -->
|
|
248
259
|
|
|
249
260
|
<slot name="left" element={item}/>
|
|
250
261
|
|
|
@@ -264,7 +275,7 @@ export function scrollToView() {
|
|
|
264
275
|
|
|
265
276
|
whitespace-nowrap overflow-clip w-full sm:flex-none sm:{name_w}
|
|
266
277
|
sm:hover:cursor-pointer underline"
|
|
267
|
-
id="__hd_list_ctrl_{item
|
|
278
|
+
id="__hd_list_ctrl_{getItemKey(item)}_Title"
|
|
268
279
|
on:click|stopPropagation={followDefinedHRef}
|
|
269
280
|
use:editable={{
|
|
270
281
|
action: (text) => {change_name(text)},
|
|
@@ -279,7 +290,7 @@ export function scrollToView() {
|
|
|
279
290
|
<p class=" text-base font-semibold
|
|
280
291
|
|
|
281
292
|
whitespace-nowrap overflow-clip w-full sm:flex-none sm:{name_w}"
|
|
282
|
-
id="__hd_list_ctrl_{item
|
|
293
|
+
id="__hd_list_ctrl_{getItemKey(item)}_Title"
|
|
283
294
|
use:editable={{
|
|
284
295
|
action: (text) => {change_name(text)},
|
|
285
296
|
active: true,
|
|
@@ -300,7 +311,7 @@ export function scrollToView() {
|
|
|
300
311
|
<p class=" text-base font-semibold
|
|
301
312
|
|
|
302
313
|
whitespace-nowrap overflow-clip w-full sm:flex-none sm:{name_w}"
|
|
303
|
-
id="__hd_list_ctrl_{item
|
|
314
|
+
id="__hd_list_ctrl_{getItemKey(item)}_Title">
|
|
304
315
|
{element_title}
|
|
305
316
|
</p>
|
|
306
317
|
{/if}
|
|
@@ -316,7 +327,7 @@ export function scrollToView() {
|
|
|
316
327
|
</section>
|
|
317
328
|
|
|
318
329
|
{#if summary && (item[summary] || placeholder=='Summary')}
|
|
319
|
-
{@const element_id = `__hd_list_ctrl_${item
|
|
330
|
+
{@const element_id = `__hd_list_ctrl_${getItemKey(item)}_Summary`}
|
|
320
331
|
{#key item[summary] }
|
|
321
332
|
{#if is_row_active}
|
|
322
333
|
<p id={element_id}
|
|
@@ -342,7 +353,21 @@ export function scrollToView() {
|
|
|
342
353
|
|
|
343
354
|
{/if}
|
|
344
355
|
|
|
345
|
-
|
|
356
|
+
{#if definition.tags}
|
|
357
|
+
<Tags
|
|
358
|
+
class="mt-1 mb-1"
|
|
359
|
+
compact
|
|
360
|
+
inContext="props"
|
|
361
|
+
self={item}
|
|
362
|
+
a={definition.tags.a}
|
|
363
|
+
getGlobalTags={definition.tags.getAllTags}
|
|
364
|
+
s="sm"
|
|
365
|
+
onSelect={definition.tags.onSelect}
|
|
366
|
+
onUpdateAllTags={definition.tags.onUpdateAllTags}
|
|
367
|
+
canChangeColor={definition.tags.canChangeColor}
|
|
368
|
+
readOnly={definition.tags.readOnly}
|
|
369
|
+
/>
|
|
370
|
+
{/if}
|
|
346
371
|
|
|
347
372
|
</div>
|
|
348
373
|
</section>
|
|
@@ -7,6 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
typename?: string | undefined;
|
|
8
8
|
toolbarOperations?: undefined;
|
|
9
9
|
contextMenu?: undefined;
|
|
10
|
+
key?: string | undefined;
|
|
10
11
|
activate?: (() => void) | undefined;
|
|
11
12
|
editProperty?: ((field: string) => void) | undefined;
|
|
12
13
|
scrollToView?: (() => void) | undefined;
|
|
@@ -6,6 +6,9 @@ export let a = "";
|
|
|
6
6
|
export let onSelect = void 0;
|
|
7
7
|
export let association = false;
|
|
8
8
|
export let hasNone = association;
|
|
9
|
+
export let editable = true;
|
|
10
|
+
export let prefix = "";
|
|
11
|
+
export let postfix = "";
|
|
9
12
|
let definition = getContext("rList-definition");
|
|
10
13
|
let combo_property = new rList_property_combo();
|
|
11
14
|
combo_property.name = name;
|
|
@@ -15,6 +18,9 @@ if (!combo_property.a)
|
|
|
15
18
|
combo_property.onSelect = onSelect;
|
|
16
19
|
combo_property.association = association;
|
|
17
20
|
combo_property.hasNone = hasNone;
|
|
21
|
+
combo_property.readOnly = !editable;
|
|
22
|
+
combo_property.prefix = prefix;
|
|
23
|
+
combo_property.postfix = postfix;
|
|
18
24
|
definition.properties.push(combo_property);
|
|
19
25
|
setContext("rCombo-definition", combo_property.combo_definition);
|
|
20
26
|
</script>
|
|
@@ -6,6 +6,9 @@ declare const __propDef: {
|
|
|
6
6
|
onSelect?: undefined;
|
|
7
7
|
association?: boolean | undefined;
|
|
8
8
|
hasNone?: boolean | undefined;
|
|
9
|
+
editable?: boolean | undefined;
|
|
10
|
+
prefix?: string | undefined;
|
|
11
|
+
postfix?: string | undefined;
|
|
9
12
|
};
|
|
10
13
|
events: {
|
|
11
14
|
[evt: string]: CustomEvent<any>;
|
|
@@ -3,6 +3,10 @@ import { rList_property_type, rList_property } from "./List";
|
|
|
3
3
|
export let name;
|
|
4
4
|
export let a = "";
|
|
5
5
|
export let onSelect = void 0;
|
|
6
|
+
export let editable = true;
|
|
7
|
+
export let detailed = false;
|
|
8
|
+
export let prefix = "";
|
|
9
|
+
export let postfix = "";
|
|
6
10
|
let definition = getContext("rList-definition");
|
|
7
11
|
let date_property = new rList_property(rList_property_type.Date);
|
|
8
12
|
date_property.name = name;
|
|
@@ -10,5 +14,9 @@ date_property.a = a;
|
|
|
10
14
|
if (!date_property.a)
|
|
11
15
|
date_property.a = date_property.name;
|
|
12
16
|
date_property.onSelect = onSelect;
|
|
17
|
+
date_property.readOnly = !editable;
|
|
18
|
+
date_property.detailed = detailed;
|
|
19
|
+
date_property.prefix = prefix;
|
|
20
|
+
date_property.postfix = postfix;
|
|
13
21
|
definition.properties.push(date_property);
|
|
14
22
|
</script>
|
|
@@ -4,6 +4,10 @@ declare const __propDef: {
|
|
|
4
4
|
name: string;
|
|
5
5
|
a?: string | undefined;
|
|
6
6
|
onSelect?: undefined;
|
|
7
|
+
editable?: boolean | undefined;
|
|
8
|
+
detailed?: boolean | undefined;
|
|
9
|
+
prefix?: string | undefined;
|
|
10
|
+
postfix?: string | undefined;
|
|
7
11
|
};
|
|
8
12
|
events: {
|
|
9
13
|
[evt: string]: CustomEvent<any>;
|
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
import { rList_property_type, rList_property } from "./List";
|
|
3
3
|
export let name;
|
|
4
4
|
export let a = "";
|
|
5
|
+
export let prefix = "";
|
|
6
|
+
export let postfix = "";
|
|
7
|
+
export let getter = void 0;
|
|
5
8
|
let definition = getContext("rList-definition");
|
|
6
9
|
let date_property = new rList_property(rList_property_type.Static);
|
|
7
10
|
date_property.name = name;
|
|
8
11
|
date_property.a = a;
|
|
9
12
|
if (!date_property.a)
|
|
10
13
|
date_property.a = date_property.name;
|
|
14
|
+
date_property.prefix = prefix;
|
|
15
|
+
date_property.postfix = postfix;
|
|
16
|
+
date_property.getter = getter;
|
|
11
17
|
definition.properties.push(date_property);
|
|
12
18
|
</script>
|
|
@@ -79,42 +79,43 @@ export function rereder() {
|
|
|
79
79
|
}
|
|
80
80
|
export function reload(data, selectElement = KEEP_SELECTION) {
|
|
81
81
|
let currentSelectedItem = getActive("props");
|
|
82
|
-
let
|
|
83
|
-
let
|
|
82
|
+
let currentSelectedItemKey = currentSelectedItem ? getItemKey(currentSelectedItem) : null;
|
|
83
|
+
let selectElementId = null;
|
|
84
|
+
let altSelectElementId = null;
|
|
84
85
|
switch (selectElement) {
|
|
85
86
|
case CLEAR_SELECTION:
|
|
86
87
|
selectElementId = 0;
|
|
87
88
|
break;
|
|
88
89
|
case KEEP_SELECTION:
|
|
89
|
-
selectElementId =
|
|
90
|
+
selectElementId = currentSelectedItemKey;
|
|
90
91
|
break;
|
|
91
92
|
case SELECT_PREVIOUS:
|
|
92
93
|
if (currentSelectedItem) {
|
|
93
|
-
const selectedItemIdx = items?.findIndex((e) => e ==
|
|
94
|
+
const selectedItemIdx = items?.findIndex((e) => getItemKey(e) == currentSelectedItemKey);
|
|
94
95
|
if (selectedItemIdx != void 0 && selectedItemIdx > 0)
|
|
95
|
-
selectElementId = items[selectedItemIdx - 1]
|
|
96
|
+
selectElementId = getItemKey(items[selectedItemIdx - 1]) ?? null;
|
|
96
97
|
}
|
|
97
98
|
break;
|
|
98
99
|
case SELECT_NEXT:
|
|
99
100
|
if (currentSelectedItem) {
|
|
100
|
-
const selectedItemIdx = items?.findIndex((e) => e ==
|
|
101
|
+
const selectedItemIdx = items?.findIndex((e) => getItemKey(e) == currentSelectedItemKey);
|
|
101
102
|
if (selectedItemIdx != void 0 && selectedItemIdx >= 0 && selectedItemIdx < items.length - 1)
|
|
102
|
-
selectElementId = items[selectedItemIdx + 1]
|
|
103
|
+
selectElementId = getItemKey(items[selectedItemIdx + 1]) ?? null;
|
|
103
104
|
}
|
|
104
105
|
break;
|
|
105
106
|
case KEEP_OR_SELECT_NEXT:
|
|
106
107
|
{
|
|
107
108
|
if (currentSelectedItem) {
|
|
108
|
-
selectElementId =
|
|
109
|
-
const selectedItemIdx = items?.findIndex((e) => e ==
|
|
109
|
+
selectElementId = currentSelectedItemKey;
|
|
110
|
+
const selectedItemIdx = items?.findIndex((e) => getItemKey(e) == currentSelectedItemKey);
|
|
110
111
|
if (selectedItemIdx != void 0 && selectedItemIdx >= 0 && selectedItemIdx < items.length - 1)
|
|
111
|
-
altSelectElementId = items[selectedItemIdx + 1]
|
|
112
|
+
altSelectElementId = getItemKey(items[selectedItemIdx + 1]) ?? null;
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
break;
|
|
115
116
|
default:
|
|
116
117
|
if (typeof selectElement === "object" && !Array.isArray(selectElement) && selectElement !== null)
|
|
117
|
-
selectElementId = selectElement
|
|
118
|
+
selectElementId = getItemKey(selectElement);
|
|
118
119
|
else
|
|
119
120
|
selectElementId = selectElement;
|
|
120
121
|
}
|
|
@@ -123,19 +124,17 @@ export function reload(data, selectElement = KEEP_SELECTION) {
|
|
|
123
124
|
else
|
|
124
125
|
self = data;
|
|
125
126
|
rereder();
|
|
126
|
-
if (selectElementId
|
|
127
|
-
let itemToActivate = items?.find((e) => e
|
|
127
|
+
if (selectElementId != null) {
|
|
128
|
+
let itemToActivate = items?.find((e) => getItemKey(e) == selectElementId);
|
|
128
129
|
if (itemToActivate) {
|
|
129
130
|
activate_after_dom_update = itemToActivate;
|
|
130
|
-
} else if (altSelectElementId
|
|
131
|
-
itemToActivate = items?.find((e) => e
|
|
131
|
+
} else if (altSelectElementId != null) {
|
|
132
|
+
itemToActivate = items?.find((e) => getItemKey(e) == altSelectElementId);
|
|
132
133
|
if (itemToActivate) {
|
|
133
134
|
activate_after_dom_update = itemToActivate;
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
|
-
if (!activate_after_dom_update)
|
|
138
|
-
activateItem("props", null, []);
|
|
139
138
|
}
|
|
140
139
|
export async function moveUp(element) {
|
|
141
140
|
if (!orderAttrib)
|
|
@@ -295,6 +294,7 @@ async function insert(title2, summary, after) {
|
|
|
295
294
|
<List_element item={element}
|
|
296
295
|
{toolbarOperations}
|
|
297
296
|
{contextMenu}
|
|
297
|
+
{key}
|
|
298
298
|
bind:this={rows[i]}
|
|
299
299
|
>
|
|
300
300
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script>import { getContext } from "svelte";
|
|
2
|
+
import { rList_property_tags } from "./List";
|
|
3
|
+
export let name = "";
|
|
4
|
+
export let a = "";
|
|
5
|
+
export let prefix = "";
|
|
6
|
+
export let postfix = "";
|
|
7
|
+
export let readOnly = false;
|
|
8
|
+
export let getAllTags = void 0;
|
|
9
|
+
export let onUpdateAllTags = void 0;
|
|
10
|
+
export let onSelect = void 0;
|
|
11
|
+
export let canChangeColor = false;
|
|
12
|
+
let definition = getContext("rList-definition");
|
|
13
|
+
let tags = new rList_property_tags();
|
|
14
|
+
tags.prefix = prefix;
|
|
15
|
+
tags.postfix = postfix;
|
|
16
|
+
if (!a && name) {
|
|
17
|
+
tags.a = name;
|
|
18
|
+
tags.name = name;
|
|
19
|
+
} else if (!name && a) {
|
|
20
|
+
tags.a = a;
|
|
21
|
+
tags.name = a;
|
|
22
|
+
} else {
|
|
23
|
+
tags.a = a;
|
|
24
|
+
tags.name = name;
|
|
25
|
+
}
|
|
26
|
+
tags.onSelect = onSelect;
|
|
27
|
+
tags.onUpdateAllTags = onUpdateAllTags;
|
|
28
|
+
tags.canChangeColor = canChangeColor;
|
|
29
|
+
tags.getAllTags = getAllTags;
|
|
30
|
+
tags.readOnly = readOnly;
|
|
31
|
+
definition.tags = tags;
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
name?: string | undefined;
|
|
5
|
+
a?: string | undefined;
|
|
6
|
+
prefix?: string | undefined;
|
|
7
|
+
postfix?: string | undefined;
|
|
8
|
+
readOnly?: boolean | undefined;
|
|
9
|
+
getAllTags?: Function | undefined;
|
|
10
|
+
onUpdateAllTags?: Function | undefined;
|
|
11
|
+
onSelect?: Function | undefined;
|
|
12
|
+
canChangeColor?: boolean | undefined;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {};
|
|
18
|
+
};
|
|
19
|
+
export type ListProps = typeof __propDef.props;
|
|
20
|
+
export type ListEvents = typeof __propDef.events;
|
|
21
|
+
export type ListSlots = typeof __propDef.slots;
|
|
22
|
+
export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|