@humandialog/forms.svelte 0.4.14 → 0.4.16
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/Grid.menu.svelte +2 -0
- package/components/button.svelte +5 -11
- package/components/combo/combo.d.ts +2 -0
- package/components/combo/combo.js +2 -0
- package/components/combo/combo.source.svelte +6 -2
- package/components/combo/combo.source.svelte.d.ts +3 -1
- package/components/combo/combo.svelte +122 -76
- package/components/combo/combo.svelte.d.ts +5 -0
- package/components/date.svelte +14 -5
- package/components/list/List.d.ts +28 -0
- package/components/list/List.js +34 -0
- package/components/list/internal/list.element.svelte +295 -0
- package/components/list/internal/list.element.svelte.d.ts +29 -0
- package/components/list/internal/list.inserter.svelte +20 -0
- package/components/list/internal/list.inserter.svelte.d.ts +18 -0
- package/components/list/list.combo.svelte +20 -0
- package/components/list/list.combo.svelte.d.ts +21 -0
- package/components/list/list.date.svelte +14 -0
- package/components/list/list.date.svelte.d.ts +18 -0
- package/components/list/list.inserter.svelte +6 -0
- package/components/list/list.inserter.svelte.d.ts +16 -0
- package/components/list/list.summary.svelte +7 -0
- package/components/list/list.summary.svelte.d.ts +17 -0
- package/components/list/list.svelte +148 -0
- package/components/list/list.svelte.d.ts +41 -0
- package/components/list/list.title.svelte +7 -0
- package/components/list/list.title.svelte.d.ts +17 -0
- package/components/sidebar/sidebar.item.svelte +27 -15
- package/components/sidebar/sidebar.item.svelte.d.ts +3 -0
- package/desk.svelte +16 -4
- package/index.d.ts +9 -2
- package/index.js +10 -2
- package/package.json +11 -2
- package/page.svelte +8 -2
- package/stores.js +4 -3
- package/updates.js +3 -7
- package/utils.d.ts +1 -0
- package/utils.js +46 -7
package/components/button.svelte
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { Button } from "flowbite-svelte";
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
import { data_tick_store, context_items_store, context_types_store } from "../stores.js";
|
|
4
|
-
import {
|
|
4
|
+
import { reef } from "@humandialog/auth.svelte/dist/index.js";
|
|
5
5
|
export let self = null;
|
|
6
6
|
export let operation = "";
|
|
7
7
|
export let params = null;
|
|
@@ -43,16 +43,10 @@ async function click() {
|
|
|
43
43
|
} else if (item && operation && typename) {
|
|
44
44
|
try {
|
|
45
45
|
let res;
|
|
46
|
-
if (params)
|
|
47
|
-
res = await
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
method: "POST",
|
|
51
|
-
body: JSON.stringify(params)
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
} else
|
|
55
|
-
res = await Auth.fetch(`json/yav1/${typename}/${item.Id}/${operation}`);
|
|
46
|
+
if (params)
|
|
47
|
+
res = await reef.post(`/${typename}/${item.Id}/${operation}`, params);
|
|
48
|
+
else
|
|
49
|
+
res = await reef.get(`/${typename}/${item.Id}/${operation}`);
|
|
56
50
|
if (res.ok)
|
|
57
51
|
$data_tick_store = $data_tick_store + 1;
|
|
58
52
|
} catch (err) {
|
|
@@ -7,6 +7,8 @@ export declare class rCombo_item {
|
|
|
7
7
|
export declare class rCombo_definition {
|
|
8
8
|
source: rCombo_item[];
|
|
9
9
|
collection_expr: string | undefined;
|
|
10
|
+
collection_path: string | undefined;
|
|
11
|
+
collection: object[] | undefined;
|
|
10
12
|
on_collect: undefined;
|
|
11
13
|
element_key: string | undefined;
|
|
12
14
|
element_name: string | undefined;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<script>import { getContext } from "svelte";
|
|
2
|
-
export let
|
|
2
|
+
export let association = void 0;
|
|
3
|
+
export let path = void 0;
|
|
4
|
+
export let objects = void 0;
|
|
3
5
|
export let on_collect = void 0;
|
|
4
6
|
export let key = "";
|
|
5
7
|
export let name = "";
|
|
6
8
|
export let avatar = "";
|
|
7
9
|
let definition = getContext("rCombo-definition");
|
|
8
|
-
definition.collection_expr =
|
|
10
|
+
definition.collection_expr = association;
|
|
11
|
+
definition.collection_path = path;
|
|
12
|
+
definition.collection = objects;
|
|
9
13
|
definition.on_collect = on_collect;
|
|
10
14
|
definition.element_key = key;
|
|
11
15
|
definition.element_name = name;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
|
|
4
|
+
association?: string | undefined;
|
|
5
|
+
path?: string | undefined;
|
|
6
|
+
objects?: object[] | undefined;
|
|
5
7
|
on_collect?: undefined;
|
|
6
8
|
key?: string | undefined;
|
|
7
9
|
name?: string | undefined;
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
<script>import { data_tick_store, context_items_store, context_types_store } from "../../stores.js";
|
|
2
2
|
import { inform_modification, push_changes } from "../../updates.js";
|
|
3
3
|
import { parse_width_directive, should_be_comapact } from "../../utils.js";
|
|
4
|
-
import { afterUpdate, getContext, setContext } from "svelte";
|
|
4
|
+
import { afterUpdate, getContext, onMount, setContext } from "svelte";
|
|
5
5
|
import { rCombo_definition, rCombo_item, cached_sources } from "./combo";
|
|
6
6
|
import FaChevronDown from "svelte-icons/fa/FaChevronDown.svelte";
|
|
7
7
|
import Icon from "../icon.svelte";
|
|
8
|
-
import {
|
|
8
|
+
import { reef } from "@humandialog/auth.svelte/dist/index.js";
|
|
9
9
|
export let label = "";
|
|
10
10
|
export let self = null;
|
|
11
11
|
export let a = "";
|
|
12
|
+
export let is_association = false;
|
|
12
13
|
export let context = "";
|
|
13
14
|
export let typename = "";
|
|
14
15
|
export let choice_callback = "";
|
|
15
16
|
export let on_select = void 0;
|
|
17
|
+
export let definition = null;
|
|
18
|
+
export let changed = void 0;
|
|
16
19
|
export let icon = false;
|
|
17
20
|
export let placeholder = "Choose wisely...";
|
|
18
21
|
export let s = "sm";
|
|
19
22
|
export let c = "";
|
|
20
23
|
export let compact = false;
|
|
21
24
|
export let in_context = "sel";
|
|
25
|
+
export let cached = false;
|
|
22
26
|
let is_compact = getContext("rIs-table-component") || compact;
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
if (!definition) {
|
|
28
|
+
definition = new rCombo_definition();
|
|
29
|
+
setContext("rCombo-definition", definition);
|
|
30
|
+
}
|
|
25
31
|
let is_dropdown_open = false;
|
|
26
32
|
let dropdown_position = "";
|
|
27
33
|
let combo;
|
|
@@ -76,13 +82,27 @@ function setup(...args) {
|
|
|
76
82
|
label = a;
|
|
77
83
|
tick_request_internal = tick_request_internal + 1;
|
|
78
84
|
if (is_compact) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
can_be_activated = false;
|
|
86
|
+
let contexts = in_context.split(" ");
|
|
87
|
+
contexts.forEach((ctx2) => {
|
|
88
|
+
if ($context_items_store[ctx2] == item)
|
|
89
|
+
can_be_activated = true;
|
|
90
|
+
});
|
|
83
91
|
} else
|
|
84
92
|
can_be_activated = true;
|
|
85
93
|
}
|
|
94
|
+
onMount(() => {
|
|
95
|
+
if (definition.on_collect)
|
|
96
|
+
definition.on_collect().then((source) => source_fetched(source));
|
|
97
|
+
else if (definition.collection_expr)
|
|
98
|
+
fetch_source_from_association().then((source) => source_fetched(source));
|
|
99
|
+
else if (definition.collection_path)
|
|
100
|
+
get_source_collection(definition.collection_path, `${definition.collection_path}`).then((source) => source_fetched(source));
|
|
101
|
+
else if (definition.collection)
|
|
102
|
+
source_fetched(definition.collection);
|
|
103
|
+
return () => {
|
|
104
|
+
};
|
|
105
|
+
});
|
|
86
106
|
afterUpdate(() => {
|
|
87
107
|
if (is_dropdown_open && textbox && document.activeElement != textbox)
|
|
88
108
|
textbox.focus();
|
|
@@ -170,14 +190,8 @@ export function show(event, hide_callback) {
|
|
|
170
190
|
characterData: true,
|
|
171
191
|
subtree: true
|
|
172
192
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
else if (definition.on_collect) {
|
|
176
|
-
definition.on_collect().then((source) => source_fetched(source));
|
|
177
|
-
} else {
|
|
178
|
-
filtered_source = definition.source.map((e) => e);
|
|
179
|
-
highlighted_option = filtered_source.length > 0 ? filtered_source[0] : null;
|
|
180
|
-
}
|
|
193
|
+
filtered_source = definition.source.map((e) => e);
|
|
194
|
+
highlighted_option = filtered_source.length > 0 ? filtered_source[0] : null;
|
|
181
195
|
}
|
|
182
196
|
export function hide() {
|
|
183
197
|
if (mutation_observer)
|
|
@@ -234,41 +248,82 @@ function get_combo_text() {
|
|
|
234
248
|
}
|
|
235
249
|
async function on_choose(itm) {
|
|
236
250
|
hide();
|
|
237
|
-
if (
|
|
238
|
-
let body = {
|
|
239
|
-
choice: {
|
|
240
|
-
$ref: itm.Key
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
let path = `${typename}/${item.Id}/${choice_callback}`;
|
|
244
|
-
let fields = calc_path_fields_param();
|
|
245
|
-
if (fields)
|
|
246
|
-
path += fields;
|
|
247
|
-
let res = await Auth.fetch(
|
|
248
|
-
`json/yav1/${path}`,
|
|
249
|
-
{
|
|
250
|
-
method: "POST",
|
|
251
|
-
body: JSON.stringify(body)
|
|
252
|
-
}
|
|
253
|
-
);
|
|
254
|
-
if (res.ok) {
|
|
255
|
-
let result_item = await res.json();
|
|
256
|
-
let result_typename = Object.keys(result_item)[0];
|
|
257
|
-
item[a] = result_item[result_typename];
|
|
258
|
-
tick_request_internal = tick_request_internal + 1;
|
|
259
|
-
} else
|
|
260
|
-
console.error(res);
|
|
261
|
-
} else if (on_select) {
|
|
251
|
+
if (on_select) {
|
|
262
252
|
await on_select(item, itm.Key, itm.Name);
|
|
263
253
|
tick_request_internal = tick_request_internal + 1;
|
|
264
254
|
} else {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
255
|
+
if (is_association) {
|
|
256
|
+
if (choice_callback) {
|
|
257
|
+
let body = {
|
|
258
|
+
choice: {
|
|
259
|
+
$ref: itm.Key
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
let path;
|
|
263
|
+
if (item.$ref)
|
|
264
|
+
path = `${item.$ref}/${choice_callback}`;
|
|
265
|
+
else
|
|
266
|
+
path = `${typename}/${item.Id}/${choice_callback}`;
|
|
267
|
+
let fields = calc_path_fields_param();
|
|
268
|
+
if (fields)
|
|
269
|
+
path += fields;
|
|
270
|
+
let result = await reef.post(`/${path}`, body);
|
|
271
|
+
if (result) {
|
|
272
|
+
let result_typename = Object.keys(result)[0];
|
|
273
|
+
item[a] = result[result_typename];
|
|
274
|
+
tick_request_internal = tick_request_internal + 1;
|
|
275
|
+
}
|
|
276
|
+
} else {
|
|
277
|
+
let path;
|
|
278
|
+
if (item.$ref)
|
|
279
|
+
path = `/${item.$ref}/set`;
|
|
280
|
+
else if (typename && item.Id)
|
|
281
|
+
path = `/${typename}/${item.Id}/set`;
|
|
282
|
+
let result = await reef.post(
|
|
283
|
+
path,
|
|
284
|
+
{
|
|
285
|
+
[a]: {
|
|
286
|
+
$ref: itm.Key
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
if (result) {
|
|
291
|
+
let name = definition.element_name ?? "$display";
|
|
292
|
+
item[a] = {
|
|
293
|
+
$ref: itm.Key,
|
|
294
|
+
[name]: itm.Name
|
|
295
|
+
};
|
|
296
|
+
tick_request_internal = tick_request_internal + 1;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
} else {
|
|
300
|
+
if (choice_callback) {
|
|
301
|
+
let path;
|
|
302
|
+
if (item.$ref)
|
|
303
|
+
path = `/${item.$ref}/${choice_callback}`;
|
|
304
|
+
else
|
|
305
|
+
path = `/${typename}/${item.Id}/${choice_callback}`;
|
|
306
|
+
let fields = calc_path_fields_param();
|
|
307
|
+
if (fields)
|
|
308
|
+
path += fields;
|
|
309
|
+
let value = itm.Key ?? itm.Name;
|
|
310
|
+
let result = await reef.post(path, { choice: value });
|
|
311
|
+
if (result) {
|
|
312
|
+
item[a] = result;
|
|
313
|
+
tick_request_internal = tick_request_internal + 1;
|
|
314
|
+
}
|
|
315
|
+
} else {
|
|
316
|
+
item[a] = itm.Key ?? itm.Name;
|
|
317
|
+
tick_request_internal = tick_request_internal + 1;
|
|
318
|
+
if (item && a && typename) {
|
|
319
|
+
inform_modification(item, a, typename);
|
|
320
|
+
push_changes();
|
|
321
|
+
}
|
|
322
|
+
}
|
|
270
323
|
}
|
|
271
324
|
}
|
|
325
|
+
if (!!changed)
|
|
326
|
+
changed(itm.Key, itm.Name);
|
|
272
327
|
}
|
|
273
328
|
function on_keydown(e) {
|
|
274
329
|
switch (e.key) {
|
|
@@ -335,7 +390,7 @@ let last_tick_internal = -1;
|
|
|
335
390
|
function on_mouse_move(over) {
|
|
336
391
|
highlighted_option = over;
|
|
337
392
|
}
|
|
338
|
-
async function
|
|
393
|
+
async function fetch_source_from_association() {
|
|
339
394
|
if (item.hasOwnProperty(definition.collection_expr)) {
|
|
340
395
|
let prop = item[definition.collection_expr];
|
|
341
396
|
if (!prop)
|
|
@@ -351,7 +406,11 @@ async function fetch_source() {
|
|
|
351
406
|
} else
|
|
352
407
|
return null;
|
|
353
408
|
} else {
|
|
354
|
-
let path
|
|
409
|
+
let path;
|
|
410
|
+
if (item.$ref)
|
|
411
|
+
path = `${item.$ref}/${definition.collection_expr}`;
|
|
412
|
+
else
|
|
413
|
+
path = `${typename}/${item.Id}/${definition.collection_expr}`;
|
|
355
414
|
return await get_source_collection(path, `${typename}_${definition.collection_expr}`);
|
|
356
415
|
}
|
|
357
416
|
}
|
|
@@ -376,23 +435,16 @@ function calc_path_fields_param() {
|
|
|
376
435
|
async function get_source_collection(path, cache_key) {
|
|
377
436
|
if (!cached_sources.has(cache_key)) {
|
|
378
437
|
let promise2 = new Promise(async (resolve, fail) => {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
method: "POST"
|
|
385
|
-
});
|
|
386
|
-
if (res.ok)
|
|
387
|
-
resolve(await res.json());
|
|
388
|
-
else
|
|
389
|
-
resolve(null);
|
|
390
|
-
} catch (err) {
|
|
391
|
-
console.error(err);
|
|
392
|
-
resolve(null);
|
|
393
|
-
}
|
|
438
|
+
let fields = calc_path_fields_param();
|
|
439
|
+
if (fields)
|
|
440
|
+
path += fields;
|
|
441
|
+
let res = await reef.get(path);
|
|
442
|
+
resolve(res);
|
|
394
443
|
});
|
|
395
|
-
|
|
444
|
+
if (!cached)
|
|
445
|
+
return await promise2;
|
|
446
|
+
else
|
|
447
|
+
cached_sources.set(cache_key, promise2);
|
|
396
448
|
}
|
|
397
449
|
let promise = cached_sources.get(cache_key);
|
|
398
450
|
return await promise;
|
|
@@ -407,18 +459,21 @@ function source_fetched(source) {
|
|
|
407
459
|
let type = Object.keys(source)[0];
|
|
408
460
|
array = source[type];
|
|
409
461
|
}
|
|
410
|
-
item[definition.collection_expr] = [...array];
|
|
411
462
|
definition.source = [];
|
|
412
463
|
array.forEach((e) => {
|
|
413
464
|
let el = new rCombo_item();
|
|
414
465
|
if (definition.element_name)
|
|
415
466
|
el.Name = e[definition.element_name];
|
|
416
|
-
else
|
|
467
|
+
else if (e.$display)
|
|
417
468
|
el.Name = e.$display;
|
|
469
|
+
else
|
|
470
|
+
el.Name = e.toString();
|
|
418
471
|
if (definition.element_key)
|
|
419
472
|
el.Key = e[definition.element_key];
|
|
420
|
-
else
|
|
473
|
+
else if (e.$ref)
|
|
421
474
|
el.Key = e.$ref;
|
|
475
|
+
else
|
|
476
|
+
el.Key = el.Name;
|
|
422
477
|
if (icon) {
|
|
423
478
|
if (definition.element_avatar)
|
|
424
479
|
el.Avatar = e[definition.element_avatar];
|
|
@@ -427,8 +482,6 @@ function source_fetched(source) {
|
|
|
427
482
|
}
|
|
428
483
|
definition.source.push(el);
|
|
429
484
|
});
|
|
430
|
-
filtered_source = definition.source.map((e) => e);
|
|
431
|
-
highlighted_option = filtered_source.length > 0 ? filtered_source[0] : null;
|
|
432
485
|
}
|
|
433
486
|
function setup_view(...args) {
|
|
434
487
|
if (tick_request_internal <= last_tick_internal)
|
|
@@ -498,13 +551,6 @@ function on_focus_out(e) {
|
|
|
498
551
|
style={dropdown_position}
|
|
499
552
|
use:dropdown_action>
|
|
500
553
|
<ul class="py-1">
|
|
501
|
-
<!-- {#if is_dropdown_open && definition.collection_expr}
|
|
502
|
-
{#await fetch_source()}
|
|
503
|
-
<p>Loading...</p>
|
|
504
|
-
{:then source}
|
|
505
|
-
{@const c = source_fetched(source)}
|
|
506
|
-
{/await}
|
|
507
|
-
{/if} -->
|
|
508
554
|
|
|
509
555
|
{#if definition.source && definition.source.length}
|
|
510
556
|
{@const _filtered_source = filtered_source ? filtered_source : definition.source}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { rCombo_definition } from './combo';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
label?: string | undefined;
|
|
5
6
|
self?: null | undefined;
|
|
6
7
|
a?: string | undefined;
|
|
8
|
+
is_association?: boolean | undefined;
|
|
7
9
|
context?: string | undefined;
|
|
8
10
|
typename?: string | undefined;
|
|
9
11
|
choice_callback?: string | undefined;
|
|
10
12
|
on_select?: undefined;
|
|
13
|
+
definition?: rCombo_definition | null | undefined;
|
|
14
|
+
changed?: undefined;
|
|
11
15
|
icon?: boolean | undefined;
|
|
12
16
|
placeholder?: string | undefined;
|
|
13
17
|
s?: string | undefined;
|
|
14
18
|
c?: string | undefined;
|
|
15
19
|
compact?: boolean | undefined;
|
|
16
20
|
in_context?: string | undefined;
|
|
21
|
+
cached?: boolean | undefined;
|
|
17
22
|
show?: ((event: any, hide_callback: any) => void) | undefined;
|
|
18
23
|
hide?: (() => void) | undefined;
|
|
19
24
|
};
|
package/components/date.svelte
CHANGED
|
@@ -79,6 +79,14 @@ function setup(...args) {
|
|
|
79
79
|
item = self ?? $context_items_store[ctx];
|
|
80
80
|
if (!typename)
|
|
81
81
|
typename = $context_types_store[ctx];
|
|
82
|
+
if (!typename) {
|
|
83
|
+
if (item.$type)
|
|
84
|
+
typename = item.$type;
|
|
85
|
+
else if (item.$ref) {
|
|
86
|
+
let s2 = item.$ref.split("/");
|
|
87
|
+
typename = s2[0];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
82
90
|
if (!item[a])
|
|
83
91
|
value = null;
|
|
84
92
|
else
|
|
@@ -86,10 +94,12 @@ function setup(...args) {
|
|
|
86
94
|
} else
|
|
87
95
|
value = date;
|
|
88
96
|
if (is_compact) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
can_be_activated = false;
|
|
98
|
+
let contexts = in_context.split(" ");
|
|
99
|
+
contexts.forEach((ctx2) => {
|
|
100
|
+
if ($context_items_store[ctx2] == item)
|
|
101
|
+
can_be_activated = true;
|
|
102
|
+
});
|
|
93
103
|
} else
|
|
94
104
|
can_be_activated = true;
|
|
95
105
|
rValue = get_formatted_date(value);
|
|
@@ -120,7 +130,6 @@ async function on_changed() {
|
|
|
120
130
|
value = null;
|
|
121
131
|
else
|
|
122
132
|
value = new Date(rValue);
|
|
123
|
-
console.log("rValue", rValue, "value", value);
|
|
124
133
|
if (on_select) {
|
|
125
134
|
await on_select(value);
|
|
126
135
|
} else if (item != null) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { rCombo_definition } from '../combo/combo';
|
|
2
|
+
export declare enum rList_property_type {
|
|
3
|
+
Hidden = 0,
|
|
4
|
+
Text = 1,
|
|
5
|
+
Date = 2,
|
|
6
|
+
Combo = 3
|
|
7
|
+
}
|
|
8
|
+
export declare class rList_property {
|
|
9
|
+
constructor(type: rList_property_type);
|
|
10
|
+
type: rList_property_type;
|
|
11
|
+
name: string;
|
|
12
|
+
a: string;
|
|
13
|
+
on_select: Function | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare class rList_property_combo extends rList_property {
|
|
16
|
+
constructor();
|
|
17
|
+
association: boolean;
|
|
18
|
+
combo_definition: rCombo_definition;
|
|
19
|
+
}
|
|
20
|
+
export declare class rList_definition {
|
|
21
|
+
title: string;
|
|
22
|
+
title_editable: boolean;
|
|
23
|
+
summary: string;
|
|
24
|
+
summary_editable: boolean;
|
|
25
|
+
can_insert: boolean;
|
|
26
|
+
oninsert: Function | undefined;
|
|
27
|
+
properties: rList_property[];
|
|
28
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { rCombo_definition } from '../combo/combo';
|
|
2
|
+
export var rList_property_type;
|
|
3
|
+
(function (rList_property_type) {
|
|
4
|
+
rList_property_type[rList_property_type["Hidden"] = 0] = "Hidden";
|
|
5
|
+
rList_property_type[rList_property_type["Text"] = 1] = "Text";
|
|
6
|
+
rList_property_type[rList_property_type["Date"] = 2] = "Date";
|
|
7
|
+
rList_property_type[rList_property_type["Combo"] = 3] = "Combo";
|
|
8
|
+
})(rList_property_type || (rList_property_type = {}));
|
|
9
|
+
export class rList_property {
|
|
10
|
+
constructor(type) {
|
|
11
|
+
this.type = type;
|
|
12
|
+
}
|
|
13
|
+
type = rList_property_type.Hidden;
|
|
14
|
+
name = '';
|
|
15
|
+
a = '';
|
|
16
|
+
on_select = undefined;
|
|
17
|
+
}
|
|
18
|
+
export class rList_property_combo extends rList_property {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(rList_property_type.Combo);
|
|
21
|
+
this.combo_definition = new rCombo_definition;
|
|
22
|
+
}
|
|
23
|
+
association = false;
|
|
24
|
+
combo_definition;
|
|
25
|
+
}
|
|
26
|
+
export class rList_definition {
|
|
27
|
+
title = '';
|
|
28
|
+
title_editable = false;
|
|
29
|
+
summary = '';
|
|
30
|
+
summary_editable = false;
|
|
31
|
+
can_insert = false;
|
|
32
|
+
oninsert = undefined;
|
|
33
|
+
properties = [];
|
|
34
|
+
}
|