@humandialog/forms.svelte 0.4.14 → 0.4.15

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.
Files changed (36) hide show
  1. package/components/Grid.menu.svelte +2 -0
  2. package/components/combo/combo.d.ts +2 -0
  3. package/components/combo/combo.js +2 -0
  4. package/components/combo/combo.source.svelte +6 -2
  5. package/components/combo/combo.source.svelte.d.ts +3 -1
  6. package/components/combo/combo.svelte +121 -75
  7. package/components/combo/combo.svelte.d.ts +5 -0
  8. package/components/date.svelte +14 -5
  9. package/components/list/List.d.ts +28 -0
  10. package/components/list/List.js +34 -0
  11. package/components/list/internal/list.element.svelte +295 -0
  12. package/components/list/internal/list.element.svelte.d.ts +29 -0
  13. package/components/list/internal/list.inserter.svelte +20 -0
  14. package/components/list/internal/list.inserter.svelte.d.ts +18 -0
  15. package/components/list/list.combo.svelte +20 -0
  16. package/components/list/list.combo.svelte.d.ts +21 -0
  17. package/components/list/list.date.svelte +14 -0
  18. package/components/list/list.date.svelte.d.ts +18 -0
  19. package/components/list/list.inserter.svelte +6 -0
  20. package/components/list/list.inserter.svelte.d.ts +16 -0
  21. package/components/list/list.summary.svelte +7 -0
  22. package/components/list/list.summary.svelte.d.ts +17 -0
  23. package/components/list/list.svelte +148 -0
  24. package/components/list/list.svelte.d.ts +41 -0
  25. package/components/list/list.title.svelte +7 -0
  26. package/components/list/list.title.svelte.d.ts +17 -0
  27. package/components/sidebar/sidebar.item.svelte +27 -15
  28. package/components/sidebar/sidebar.item.svelte.d.ts +3 -0
  29. package/desk.svelte +15 -3
  30. package/index.d.ts +9 -2
  31. package/index.js +10 -2
  32. package/package.json +10 -1
  33. package/page.svelte +8 -2
  34. package/stores.js +4 -3
  35. package/utils.d.ts +1 -0
  36. package/utils.js +46 -7
@@ -0,0 +1,295 @@
1
+ <script>import { tick, getContext } from "svelte";
2
+ import { context_items_store } from "../../../stores";
3
+ import {
4
+ is_selected,
5
+ selectable,
6
+ activate_item,
7
+ is_active,
8
+ editable,
9
+ start_editing
10
+ } from "../../../utils";
11
+ import { show_grid_menu, show_menu } from "../../menu";
12
+ import { push_changes, inform_modification } from "../../../updates";
13
+ import Combo from "../../combo/combo.svelte";
14
+ import DatePicker from "../../date.svelte";
15
+ import { rList_definition, rList_property_type } from "../List";
16
+ export let item;
17
+ export let title = "";
18
+ export let summary = "";
19
+ export let typename = void 0;
20
+ export let toolbar_operations;
21
+ export let context_menu;
22
+ let definition = getContext("rList-definition");
23
+ let placeholder = "";
24
+ let props = [];
25
+ $:
26
+ is_row_active = calculate_active(item, $context_items_store);
27
+ $:
28
+ is_row_selected = selected(item, $context_items_store);
29
+ $:
30
+ selected_class = is_row_selected ? "!border-blue-300" : "";
31
+ $:
32
+ focused_class = is_row_active ? "bg-gray-200 dark:bg-gray-700" : "";
33
+ if (!typename) {
34
+ if (item.$type)
35
+ typename = item.$type;
36
+ else if (item.$ref) {
37
+ let s = item.$ref.split("/");
38
+ typename = s[0];
39
+ }
40
+ }
41
+ if (!title)
42
+ title = definition.title;
43
+ if (!summary)
44
+ summary = definition.summary;
45
+ function calculate_active(...args) {
46
+ return is_active("props", item);
47
+ }
48
+ function selected(...args) {
49
+ return is_selected(item);
50
+ }
51
+ async function change_name(text) {
52
+ item[title] = text;
53
+ inform_modification(item, title, typename);
54
+ push_changes();
55
+ }
56
+ async function change_summary(text) {
57
+ item[summary] = text;
58
+ inform_modification(item, summary, typename);
59
+ push_changes();
60
+ }
61
+ function edit(e) {
62
+ if (!is_row_active)
63
+ return;
64
+ start_editing(e.target);
65
+ }
66
+ export function activate() {
67
+ activate_row(null, item);
68
+ }
69
+ function activate_row(e, item2) {
70
+ if (is_row_active) {
71
+ let can_show_context_menu = true;
72
+ let n = e.target;
73
+ while (n) {
74
+ let is_in_cell = n.getAttribute("role") == "gridcell";
75
+ if (is_in_cell) {
76
+ can_show_context_menu = false;
77
+ break;
78
+ }
79
+ n = n.parentElement;
80
+ }
81
+ if (can_show_context_menu && context_menu) {
82
+ const pt = new DOMPoint(e.clientX, e.clientY);
83
+ let context_operations = context_menu(item2);
84
+ if (context_operations !== null) {
85
+ if (typeof context_operations === "object") {
86
+ if (Array.isArray(context_operations))
87
+ show_menu(pt, context_operations);
88
+ else if (context_operations.grid)
89
+ show_grid_menu(pt, context_operations.grid);
90
+ }
91
+ }
92
+ }
93
+ }
94
+ activate_item("props", item2, toolbar_operations(item2));
95
+ if (e)
96
+ e.stopPropagation();
97
+ }
98
+ function on_contextmenu(e) {
99
+ if (!context_menu)
100
+ return;
101
+ const pt = new DOMPoint(e.clientX, e.clientY);
102
+ let context_operations = context_menu(item);
103
+ if (context_operations !== null) {
104
+ if (typeof context_operations === "object") {
105
+ if (Array.isArray(context_operations))
106
+ show_menu(pt, context_operations);
107
+ else if (context_operations.grid)
108
+ show_grid_menu(pt, context_operations.grid);
109
+ }
110
+ }
111
+ e.preventDefault();
112
+ }
113
+ function on_date_changed(value, a) {
114
+ if (!value)
115
+ item[a] = "";
116
+ else
117
+ item[a] = value.toJSON();
118
+ }
119
+ function on_combo_changed(key, name, prop) {
120
+ if (prop.association) {
121
+ let iname = prop.combo_definition.element_name ?? "$display";
122
+ item[prop.a] = {
123
+ $ref: key,
124
+ [iname]: name
125
+ };
126
+ } else {
127
+ let value = key ?? name;
128
+ item[prop.a] = value;
129
+ }
130
+ }
131
+ export function edit_property(field) {
132
+ if (field == "Summary")
133
+ force_editing("Summary");
134
+ else {
135
+ let prop_idx = definition.properties.findIndex((p) => p.name == field);
136
+ if (prop_idx < 0)
137
+ return;
138
+ let property = definition.properties[prop_idx];
139
+ switch (property.type) {
140
+ case rList_property_type.Date:
141
+ edit_date(field, prop_idx);
142
+ break;
143
+ case rList_property_type.Combo:
144
+ edit_combo(field, prop_idx);
145
+ break;
146
+ }
147
+ }
148
+ }
149
+ async function force_editing(field) {
150
+ let element_id = `__hd_list_ctrl_${item.Id}_${field}`;
151
+ let element_node = document.getElementById(element_id);
152
+ if (!element_node) {
153
+ placeholder = field;
154
+ await tick();
155
+ element_node = document.getElementById(element_id);
156
+ if (!element_node)
157
+ return;
158
+ }
159
+ if (!element_node.classList.contains("editable")) {
160
+ return;
161
+ }
162
+ start_editing(element_node, () => {
163
+ placeholder = "";
164
+ });
165
+ }
166
+ async function edit_combo(field, prop_idx) {
167
+ let combo = props[prop_idx];
168
+ if (!!combo)
169
+ combo.show();
170
+ else {
171
+ placeholder = field;
172
+ await tick();
173
+ combo = props[prop_idx];
174
+ if (!!combo)
175
+ combo.show(void 0, () => {
176
+ placeholder = "";
177
+ });
178
+ }
179
+ }
180
+ async function edit_date(field, prop_idx) {
181
+ let combo = props[prop_idx];
182
+ if (!!combo)
183
+ combo.show();
184
+ else {
185
+ placeholder = field;
186
+ await tick();
187
+ combo = props[prop_idx];
188
+ if (!!combo)
189
+ combo.show(void 0, () => {
190
+ placeholder = "";
191
+ });
192
+ }
193
+ }
194
+ </script>
195
+
196
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
197
+ <section class="flex flex-row my-0 w-full text-sm text-slate-700 dark:text-slate-400 cursor-default rounded-md border-2 border-transparent {selected_class} {focused_class}"
198
+ on:contextmenu={on_contextmenu}
199
+ role="menu"
200
+ tabindex="-1">
201
+
202
+ <slot name="left" element={item}/>
203
+
204
+ <div class="ml-3 w-full py-1" use:selectable={item} on:click={(e) => {activate_row(e, item)}} role="row" tabindex="0">
205
+ <div class="flex flex-row">
206
+ <p class="font-bold whitespace-nowrap overflow-clip flex-none w-1/2 sm:w-1/3">
207
+ <span id="__hd_list_ctrl_{item.Id}_Title" role="gridcell" tabindex="0"
208
+ use:editable={(text) => {change_name(text)}}
209
+ on:click={edit}>
210
+ {item[title]}
211
+ </span>
212
+ </p>
213
+
214
+ <!--div class="flex flex-row justify-between text-xs flex-none w-1/2 sm:w-2/3"-->
215
+ <div class="text-xs flex-none w-1/2 sm:w-2/3 grid-{definition.properties.length}">
216
+ {#each definition.properties as prop, prop_index}
217
+ <p class="col-span-1 w-full mr-auto">
218
+ {#if item[prop.a] || placeholder == prop.name}
219
+ <span role="gridcell" tabindex="0">
220
+ {#if prop.type == rList_property_type.Date}
221
+ <DatePicker self={item}
222
+ a={prop.a}
223
+ compact={true}
224
+ on_select={prop.on_select}
225
+ s="xs"
226
+ in_context="props sel"
227
+ bind:this={props[prop_index]}
228
+ changed={(value)=>{on_date_changed(value, prop.a)}}
229
+ />
230
+ {:else if prop.type == rList_property_type.Combo}
231
+ <Combo self={item}
232
+ in_context="props sel"
233
+ compact={true}
234
+ a={prop.a}
235
+ on_select={prop.on_select}
236
+ is_association={prop.association}
237
+ icon={false}
238
+ bind:this={props[prop_index]}
239
+ definition={prop.combo_definition}
240
+ changed={(key,name)=>{on_combo_changed(key, name, prop)}}
241
+ s='xs'/>
242
+ {/if}
243
+ </span>
244
+ {/if}
245
+ </p>
246
+ {/each}
247
+ </div>
248
+ </div>
249
+
250
+ {#if summary && (item[summary] || placeholder=='Summary')}
251
+ {@const element_id = `__hd_list_ctrl_${item.Id}_Summary`}
252
+ <p class="text-xs text-slate-400" style="min-height: 1rem;">
253
+ {#if item[summary]}
254
+ <span id={element_id} role="gridcell" tabindex="0"
255
+ use:editable={(text) => {change_summary(text)}}
256
+ on:click={edit}>
257
+ {item[summary]}
258
+ </span>
259
+ {:else if placeholder == 'Summary'}
260
+ <span id={element_id}
261
+ use:editable={(text) => {change_summary(text)}}>
262
+ </span>
263
+ {/if}
264
+
265
+ </p>
266
+ {/if}
267
+ </div>
268
+ </section>
269
+
270
+ <style>
271
+ .grid-1
272
+ {
273
+ display: grid;
274
+ grid-template-columns: 100%;
275
+ }
276
+
277
+ .grid-2
278
+ {
279
+ display: grid;
280
+ grid-template-columns: 50% 50%;
281
+ }
282
+
283
+ .grid-3
284
+ {
285
+ display: grid;
286
+ grid-template-columns: 33% 33% 33%;
287
+ }
288
+
289
+ .grid-4
290
+ {
291
+ display: grid;
292
+ grid-template-columns: 25% 25% 25% 25%;
293
+ }
294
+
295
+ </style>
@@ -0,0 +1,29 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ item: object;
5
+ title?: string | undefined;
6
+ summary?: string | undefined;
7
+ typename?: string | undefined;
8
+ toolbar_operations: any;
9
+ context_menu: any;
10
+ activate?: (() => void) | undefined;
11
+ edit_property?: ((field: string) => void) | undefined;
12
+ };
13
+ events: {
14
+ [evt: string]: CustomEvent<any>;
15
+ };
16
+ slots: {
17
+ left: {
18
+ element: object;
19
+ };
20
+ };
21
+ };
22
+ export type ListProps = typeof __propDef.props;
23
+ export type ListEvents = typeof __propDef.events;
24
+ export type ListSlots = typeof __propDef.slots;
25
+ export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
26
+ get activate(): () => void;
27
+ get edit_property(): (field: string) => void;
28
+ }
29
+ export {};
@@ -0,0 +1,20 @@
1
+ <script>import { start_editing } from "../../../utils";
2
+ import Icon from "../../icon.svelte";
3
+ import { FaRegCircle } from "svelte-icons/fa";
4
+ export let oninsert;
5
+ export function run(onclose) {
6
+ start_editing(insertion_paragraph, onclose);
7
+ }
8
+ let insertion_paragraph;
9
+ </script>
10
+
11
+ <section class="flex flex-row my-0 w-full text-sm text-slate-700 dark:text-slate-400 cursor-default rounded-md border-2 border-transparent bg-gray-200 dark:bg-gray-700">
12
+ <Icon size={4}
13
+ component={FaRegCircle}
14
+ class="cursor-pointer mt-1.5 ml-2 "/>
15
+
16
+ <p class="ml-3 py-1 font-bold whitespace-nowrap overflow-clip flex-none w-1/2 sm:w-1/3"
17
+ bind:this={insertion_paragraph}
18
+ use:editable={oninsert} >
19
+ </p>
20
+ </section>
@@ -0,0 +1,18 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ oninsert: any;
5
+ run?: ((onclose: any) => void) | undefined;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export type ListProps = typeof __propDef.props;
13
+ export type ListEvents = typeof __propDef.events;
14
+ export type ListSlots = typeof __propDef.slots;
15
+ export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
16
+ get run(): (onclose: any) => void;
17
+ }
18
+ export {};
@@ -0,0 +1,20 @@
1
+ <script>import { getContext, setContext } from "svelte";
2
+ import { rList_property_combo } from "./List";
3
+ import {} from "../combo/combo";
4
+ export let name;
5
+ export let a = "";
6
+ export let on_select = void 0;
7
+ export let association = false;
8
+ let definition = getContext("rList-definition");
9
+ let combo_property = new rList_property_combo();
10
+ combo_property.name = name;
11
+ combo_property.a = a;
12
+ if (!combo_property.a)
13
+ combo_property.a = combo_property.name;
14
+ combo_property.on_select = on_select;
15
+ combo_property.association = association;
16
+ definition.properties.push(combo_property);
17
+ setContext("rCombo-definition", combo_property.combo_definition);
18
+ </script>
19
+
20
+ <slot/>
@@ -0,0 +1,21 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ name: string;
5
+ a?: string | undefined;
6
+ on_select?: undefined;
7
+ association?: boolean | undefined;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {
13
+ default: {};
14
+ };
15
+ };
16
+ export type ListProps = typeof __propDef.props;
17
+ export type ListEvents = typeof __propDef.events;
18
+ export type ListSlots = typeof __propDef.slots;
19
+ export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
20
+ }
21
+ export {};
@@ -0,0 +1,14 @@
1
+ <script>import { getContext } from "svelte";
2
+ import { rList_property_type, rList_property } from "./List";
3
+ export let name;
4
+ export let a = "";
5
+ export let on_select = void 0;
6
+ let definition = getContext("rList-definition");
7
+ let date_property = new rList_property(rList_property_type.Date);
8
+ date_property.name = name;
9
+ date_property.a = a;
10
+ if (!date_property.a)
11
+ date_property.a = date_property.name;
12
+ date_property.on_select = on_select;
13
+ definition.properties.push(date_property);
14
+ </script>
@@ -0,0 +1,18 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ name: string;
5
+ a?: string | undefined;
6
+ on_select?: undefined;
7
+ };
8
+ events: {
9
+ [evt: string]: CustomEvent<any>;
10
+ };
11
+ slots: {};
12
+ };
13
+ export type ListProps = typeof __propDef.props;
14
+ export type ListEvents = typeof __propDef.events;
15
+ export type ListSlots = typeof __propDef.slots;
16
+ export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
17
+ }
18
+ export {};
@@ -0,0 +1,6 @@
1
+ <script>import { getContext } from "svelte";
2
+ export let action;
3
+ let definition = getContext("rList-definition");
4
+ definition.can_insert = true;
5
+ definition.oninsert = action;
6
+ </script>
@@ -0,0 +1,16 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ action: Function;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type ListProps = typeof __propDef.props;
12
+ export type ListEvents = typeof __propDef.events;
13
+ export type ListSlots = typeof __propDef.slots;
14
+ export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,7 @@
1
+ <script>import { getContext } from "svelte";
2
+ export let a;
3
+ export let editable = false;
4
+ let definition = getContext("rList-definition");
5
+ definition.summary = a;
6
+ definition.summary_editable = editable;
7
+ </script>
@@ -0,0 +1,17 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ a: string;
5
+ editable?: boolean | undefined;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export type ListProps = typeof __propDef.props;
13
+ export type ListEvents = typeof __propDef.events;
14
+ export type ListSlots = typeof __propDef.slots;
15
+ export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
16
+ }
17
+ export {};
@@ -0,0 +1,148 @@
1
+ <script>import { setContext, getContext, afterUpdate, tick } from "svelte";
2
+ import { data_tick_store, context_items_store, context_types_store } from "../../stores";
3
+ import { activate_item, get_active, clear_active_item, parse_width_directive } from "../../utils";
4
+ import { rList_definition } from "./List";
5
+ import List_element from "./internal/list.element.svelte";
6
+ import Inserter from "./internal/list.inserter.svelte";
7
+ export let title = "";
8
+ export let self = null;
9
+ export let a = "";
10
+ export let objects = void 0;
11
+ export let context = "";
12
+ export let typename = "";
13
+ export let c = "";
14
+ export let toolbar_operations;
15
+ export let context_menu;
16
+ let definition = new rList_definition();
17
+ setContext("rList-definition", definition);
18
+ setContext("rIs-table-component", true);
19
+ let item = null;
20
+ let items = null;
21
+ let ctx = context ? context : getContext("ctx");
22
+ let cs = c ? parse_width_directive(c) : "w-full min-w-full";
23
+ let show_insertion_row_after_element = null;
24
+ const END_OF_LIST = {};
25
+ let rows = [];
26
+ let activate_after_dom_update = null;
27
+ let inserter;
28
+ clear_active_item("props");
29
+ let last_tick = -1;
30
+ $:
31
+ setup($data_tick_store, $context_items_store);
32
+ function setup(...args) {
33
+ last_tick = $data_tick_store;
34
+ item = self ?? $context_items_store[ctx];
35
+ if (objects)
36
+ items = objects;
37
+ else if (item && a)
38
+ items = item[a];
39
+ else
40
+ items = [];
41
+ if (!typename)
42
+ typename = $context_types_store[ctx];
43
+ }
44
+ afterUpdate(() => {
45
+ if (activate_after_dom_update) {
46
+ let row_to_activate_idx = items.findIndex((e) => e == activate_after_dom_update);
47
+ activate_after_dom_update = null;
48
+ if (row_to_activate_idx >= 0) {
49
+ rows[row_to_activate_idx].activate();
50
+ }
51
+ }
52
+ });
53
+ export function refresh() {
54
+ setup();
55
+ }
56
+ export function update_objects(_objects) {
57
+ objects = _objects;
58
+ setup();
59
+ }
60
+ export function update_self(_self) {
61
+ self = _self;
62
+ setup();
63
+ }
64
+ let last_activated_element = null;
65
+ export async function add(after = null) {
66
+ if (!definition.can_insert)
67
+ return;
68
+ show_insertion_row_after_element = after ?? END_OF_LIST;
69
+ last_activated_element = get_active("props");
70
+ let fake_item = {};
71
+ activate_item("props", fake_item);
72
+ await tick();
73
+ if (!inserter)
74
+ return;
75
+ inserter.run(async (detail) => {
76
+ show_insertion_row_after_element = null;
77
+ if (detail.cancel)
78
+ activate_after_dom_update = last_activated_element;
79
+ else {
80
+ if (detail.incremental) {
81
+ let current_active = get_active("props");
82
+ await add(current_active);
83
+ }
84
+ }
85
+ });
86
+ }
87
+ async function insert(title2, after) {
88
+ let new_element = await definition.oninsert(title2, after);
89
+ if (!new_element)
90
+ return;
91
+ activate_after_dom_update = new_element;
92
+ refresh();
93
+ }
94
+ export function remove(element) {
95
+ let removing_idx = items?.findIndex((e) => e == element);
96
+ if (removing_idx < 0)
97
+ return;
98
+ let active_element = get_active("props");
99
+ if (active_element == element) {
100
+ if (removing_idx + 1 < items.length)
101
+ rows[removing_idx + 1].activate();
102
+ else
103
+ activate_item("props", null, []);
104
+ }
105
+ items = items.filter((t) => t != element);
106
+ }
107
+ export function edit(element, property_name) {
108
+ let editing_idx = items?.findIndex((e) => e == element);
109
+ if (editing_idx < 0)
110
+ return;
111
+ rows[editing_idx].edit_property(property_name);
112
+ }
113
+ </script>
114
+
115
+ <slot/> <!-- Launch definition settings -->
116
+
117
+
118
+ {#if title}
119
+ <p class="mt-3 uppercase text-sm text-center">{title}</p>
120
+ <hr class="w-full">
121
+ {/if}
122
+
123
+
124
+ {#if items && items.length > 0 }
125
+ {#each items as element, i (element.Id)}
126
+
127
+ <List_element item={element}
128
+ {toolbar_operations}
129
+ {context_menu}
130
+ bind:this={rows[i]}
131
+ >
132
+ <span slot="left" let:element>
133
+ <slot name="left" {element}/>
134
+ </span>
135
+ </List_element>
136
+
137
+ {#if show_insertion_row_after_element == element}
138
+ <Inserter oninsert={async (text) => {await insert(text, show_insertion_row_after_element)}}
139
+ bind:this={inserter} />
140
+ {/if}
141
+ {/each}
142
+ {/if}
143
+
144
+ {#if show_insertion_row_after_element == END_OF_LIST}
145
+ <Inserter oninsert={async (text) => {await insert(text, null)}}
146
+ bind:this={inserter} />
147
+ {/if}
148
+
@@ -0,0 +1,41 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ title?: string | undefined;
5
+ self?: object | null | undefined;
6
+ a?: string | undefined;
7
+ objects?: object[] | undefined;
8
+ context?: string | undefined;
9
+ typename?: string | undefined;
10
+ c?: string | undefined;
11
+ toolbar_operations: any;
12
+ context_menu: any;
13
+ refresh?: (() => void) | undefined;
14
+ update_objects?: ((_objects: object[]) => void) | undefined;
15
+ update_self?: ((_self: object) => void) | undefined;
16
+ add?: ((after?: object | null) => Promise<void>) | undefined;
17
+ remove?: ((element: object) => void) | undefined;
18
+ edit?: ((element: object, property_name: string) => void) | undefined;
19
+ };
20
+ events: {
21
+ [evt: string]: CustomEvent<any>;
22
+ };
23
+ slots: {
24
+ default: {};
25
+ left: {
26
+ element: object;
27
+ };
28
+ };
29
+ };
30
+ export type ListProps = typeof __propDef.props;
31
+ export type ListEvents = typeof __propDef.events;
32
+ export type ListSlots = typeof __propDef.slots;
33
+ export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
34
+ get refresh(): () => void;
35
+ get update_objects(): (_objects: object[]) => void;
36
+ get update_self(): (_self: object) => void;
37
+ get add(): (after?: object | null) => Promise<void>;
38
+ get remove(): (element: object) => void;
39
+ get edit(): (element: object, property_name: string) => void;
40
+ }
41
+ export {};
@@ -0,0 +1,7 @@
1
+ <script>import { getContext } from "svelte";
2
+ export let a;
3
+ export let editable = false;
4
+ let definition = getContext("rList-definition");
5
+ definition.title = a;
6
+ definition.title_editable = editable;
7
+ </script>