sveltekit-ui 1.0.11 → 1.0.13
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/dist/Components/Content/index.svelte +12 -12
- package/dist/Components/Content/index.svelte.js +73 -61
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte.js +1 -5
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte.js +1 -2
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte.js +1 -3
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte.js +2 -4
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte.js +28 -32
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte.js +1 -3
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte.js +1 -3
- package/dist/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte.js +3 -13
- package/dist/Components/ContentInput/AttributesInput/index.svelte +1 -0
- package/dist/Components/ContentInput/AttributesInput/index.svelte.js +89 -120
- package/dist/Components/ContentInput/index.svelte.js +38 -62
- package/dist/Components/DataTypeInput/index.svelte.js +0 -3
- package/dist/Components/IconInput/index.svelte +1 -1
- package/dist/Components/TableAdvanced/ColumnInput/index.svelte.js +16 -64
- package/dist/Components/TableAdvanced/SortByInput/index.svelte.js +2 -1
- package/dist/Components/TableAdvanced/index.svelte.js +124 -98
- package/dist/Components/TextInput/index.svelte.js +12 -0
- package/dist/Components/VariablePathInput/index.svelte +47 -93
- package/dist/Components/VariablePathInput/index.svelte.js +205 -191
- package/dist/client/astc_formatting/index.js +15 -58
- package/dist/client/docs/index.js +4 -23
- package/dist/client/index.js +86 -90
- package/dist/client/types/index.js +2 -0
- package/dist/index.js +2 -0
- package/package.json +4 -4
- package/src/lib/Components/Content/index.svelte +12 -12
- package/src/lib/Components/Content/index.svelte.js +73 -61
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte.js +1 -5
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte.js +1 -2
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte.js +1 -3
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte.js +2 -4
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte.js +28 -32
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte.js +1 -3
- package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte.js +1 -3
- package/src/lib/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte.js +3 -13
- package/src/lib/Components/ContentInput/AttributesInput/index.svelte +1 -0
- package/src/lib/Components/ContentInput/AttributesInput/index.svelte.js +89 -120
- package/src/lib/Components/ContentInput/index.svelte.js +38 -62
- package/src/lib/Components/DataTypeInput/index.svelte.js +0 -3
- package/src/lib/Components/IconInput/index.svelte +1 -1
- package/src/lib/Components/TableAdvanced/ColumnInput/index.svelte.js +16 -64
- package/src/lib/Components/TableAdvanced/SortByInput/index.svelte.js +2 -1
- package/src/lib/Components/TableAdvanced/index.svelte.js +124 -98
- package/src/lib/Components/TextInput/index.svelte.js +12 -0
- package/src/lib/Components/VariablePathInput/index.svelte +47 -93
- package/src/lib/Components/VariablePathInput/index.svelte.js +205 -191
- package/src/lib/client/astc_formatting/index.js +15 -58
- package/src/lib/client/docs/index.js +4 -23
- package/src/lib/client/index.js +86 -90
- package/src/lib/client/types/index.js +2 -0
- package/src/lib/index.js +2 -0
- package/src/routes/[component]/Showcase/Content/index.svelte +49 -83
- package/src/routes/[component]/Showcase/ContentInput/index.svelte +11 -13
- package/src/routes/[component]/Showcase/TableAdvanced/index.svelte +108 -418
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
import Self from "./index.svelte"
|
|
32
32
|
import { format_date, set_closurable_color, set_closurable, cron_to_english } from "../../client/index.js"
|
|
33
33
|
|
|
34
|
-
let { manager
|
|
34
|
+
let { manager } = $props()
|
|
35
35
|
|
|
36
36
|
function handle_anchor_click(event) {
|
|
37
37
|
event.preventDefault()
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
{#snippet children()}
|
|
49
49
|
{#if manager?.val_prepped?.is_children && Array.isArray(manager?.val_prepped?.children)}
|
|
50
50
|
{#each manager?.val_prepped?.children as child}
|
|
51
|
-
<Self manager={child}
|
|
51
|
+
<Self manager={child} />
|
|
52
52
|
{/each}
|
|
53
53
|
{/if}
|
|
54
54
|
{/snippet}
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
{#if Array.isArray(manager?.val_prepped?.children) && manager?.val_prepped?.children.some( (h) => set_closurable(h?.val_prepped?.attributes?.is_show) )}
|
|
60
60
|
{#if Array.isArray(manager?.val_prepped?.children.find( (h) => set_closurable(h?.val_prepped?.attributes?.is_show) )?.val_prepped?.children)}
|
|
61
61
|
{#each manager?.val_prepped?.children.find( (h) => set_closurable(h?.val_prepped?.attributes?.is_show) )?.val_prepped?.children as child (child?.selector_id)}
|
|
62
|
-
<Self manager={child}
|
|
62
|
+
<Self manager={child} />
|
|
63
63
|
{/each}
|
|
64
64
|
{/if}
|
|
65
65
|
{:else if Array.isArray(manager?.val_prepped?.children) && manager?.val_prepped?.children.some((h) => h?.val_prepped?.type_id == "show_conditions_item_else")}
|
|
66
66
|
{#if Array.isArray(manager?.val_prepped?.children.find((h) => h?.val_prepped?.type_id == "show_conditions_item_else")?.val_prepped?.children)}
|
|
67
67
|
{#each manager?.val_prepped?.children.find((h) => h?.val_prepped?.type_id == "show_conditions_item_else")?.val_prepped?.children as child (child?.selector_id)}
|
|
68
|
-
<Self manager={child}
|
|
68
|
+
<Self manager={child} />
|
|
69
69
|
{/each}
|
|
70
70
|
{/if}
|
|
71
71
|
{/if}
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
{#each manager?.val_prepped?.children as child_loops, i}
|
|
77
77
|
{#if Array.isArray(child_loops) && child_loops.length > 0}
|
|
78
78
|
{#each child_loops as child, i (child?.val_prepped?.selector_id)}
|
|
79
|
-
<Self manager={child}
|
|
79
|
+
<Self manager={child} />
|
|
80
80
|
{/each}
|
|
81
81
|
{/if}
|
|
82
82
|
{#if i < manager?.val_prepped?.children.length - 1 && manager?.val_prepped?.attributes?.join_text}{manager
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
<Button manager={child_loops?.remove_item_button_manager} />
|
|
94
94
|
{#if Array.isArray(child_loops?.children)}
|
|
95
95
|
{#each child_loops?.children as child (child?.selector_id)}
|
|
96
|
-
<Self manager={child}
|
|
96
|
+
<Self manager={child} />
|
|
97
97
|
{/each}
|
|
98
98
|
{/if}
|
|
99
99
|
</div>
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
<td>
|
|
129
129
|
{#if Array.isArray(child_loops?.children)}
|
|
130
130
|
{#each child_loops?.children as child (child?.selector_id)}
|
|
131
|
-
<Self manager={child}
|
|
131
|
+
<Self manager={child} />
|
|
132
132
|
{/each}
|
|
133
133
|
{/if}
|
|
134
134
|
</td>
|
|
@@ -439,11 +439,11 @@
|
|
|
439
439
|
: ''} {manager?.val_prepped?.attributes?.font_size
|
|
440
440
|
? `font-size: ${manager?.val_prepped?.attributes?.font_size}rem`
|
|
441
441
|
: ''}"
|
|
442
|
-
onclick={() =>
|
|
443
|
-
onkeydown={() =>
|
|
444
|
-
onpointerenter={() =>
|
|
445
|
-
onpointercancel={() =>
|
|
446
|
-
onpointerleave={() =>
|
|
442
|
+
onclick={() => manager?.open_edit_element_attributes_popover(manager?.val_prepped?.selector_id)}
|
|
443
|
+
onkeydown={() => manager?.open_edit_element_attributes_popover(manager?.val_prepped?.selector_id)}
|
|
444
|
+
onpointerenter={() => manager?.set_focused_selector_id(manager?.val_prepped?.selector_id)}
|
|
445
|
+
onpointercancel={() => manager?.set_focused_selector_id(null)}
|
|
446
|
+
onpointerleave={() => manager?.set_focused_selector_id(null)}
|
|
447
447
|
>
|
|
448
448
|
{set_closurable(manager?.val_prepped?.attributes?.content)}
|
|
449
449
|
</span>
|
|
@@ -26,61 +26,31 @@ import { create_qr_manager } from "../Qr/index.svelte.js"
|
|
|
26
26
|
import { create_file_input_manager } from "../FileInput/index.svelte.js"
|
|
27
27
|
import { create_cron_input_manager } from "../CronInput/index.svelte.js"
|
|
28
28
|
import { create_button_manager } from "../Button/index.svelte.js"
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
node_types,
|
|
31
|
+
deep_copy,
|
|
32
|
+
set_closurable,
|
|
33
|
+
create_unique_id,
|
|
34
|
+
copy_to_clipboard,
|
|
35
|
+
get_def_from_variable_path,
|
|
36
|
+
is_defined,
|
|
37
|
+
} from "../../client/index.js"
|
|
30
38
|
|
|
31
39
|
export function create_content_manager(config) {
|
|
32
40
|
const id = create_unique_id(null, 20)
|
|
41
|
+
let definition_stack = $state([])
|
|
33
42
|
let is_dark_theme = $derived(set_closurable(config?.is_dark_theme, false))
|
|
34
43
|
let storage_path = $derived(set_closurable(config?.storage_path, "/api/v1/storage/{storage_id}"))
|
|
35
|
-
let variables = $derived(set_closurable(config?.variables, null))
|
|
36
|
-
let loops = $derived(set_closurable(config?.loops, null))
|
|
37
44
|
let mapkit_js_token = $derived(set_closurable(config?.mapkit_js_token, null))
|
|
38
45
|
let val_prepped = $state(null)
|
|
39
46
|
|
|
40
|
-
function get_variable_from_path(path) {
|
|
41
|
-
if (Array.isArray(path)) {
|
|
42
|
-
let combined_variables_loc = {
|
|
43
|
-
variables: variables,
|
|
44
|
-
loops: loops,
|
|
45
|
-
}
|
|
46
|
-
for (let path_item of path) {
|
|
47
|
-
if (Array.isArray(path_item)) {
|
|
48
|
-
let sub_val_from_path = get_variable_from_path(path_item)
|
|
49
|
-
combined_variables_loc = combined_variables_loc?.[sub_val_from_path]
|
|
50
|
-
} else {
|
|
51
|
-
combined_variables_loc = combined_variables_loc?.[path_item]
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return combined_variables_loc
|
|
55
|
-
}
|
|
56
|
-
return null
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function clean_variable_path(path) {
|
|
60
|
-
// eg. ['variables','dddd',['loops',0]] to ['variables','dddd',3]
|
|
61
|
-
if (Array.isArray(path)) {
|
|
62
|
-
let cleaned_path = []
|
|
63
|
-
for (let path_item of path) {
|
|
64
|
-
if (Array.isArray(path_item)) {
|
|
65
|
-
let sub_val_from_path = get_variable_from_path(path_item)
|
|
66
|
-
cleaned_path.push(sub_val_from_path)
|
|
67
|
-
} else {
|
|
68
|
-
cleaned_path.push(path_item)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return cleaned_path
|
|
72
|
-
}
|
|
73
|
-
return null
|
|
74
|
-
}
|
|
75
|
-
|
|
76
47
|
function clean_attributes_from_variable_path(attributes) {
|
|
77
48
|
let cleaned_attributes = attributes
|
|
78
49
|
if (Object.keys(attributes || {}).length) {
|
|
79
50
|
for (let [att_key, att_val] of Object.entries(attributes)) {
|
|
80
51
|
if (att_key.endsWith("_from_variable_path") && att_val != null) {
|
|
81
|
-
const clean_path = clean_variable_path(att_val)
|
|
82
52
|
const att_key_to_set = att_key.split("_from_variable_path")?.[0]
|
|
83
|
-
cleaned_attributes[att_key_to_set] = (
|
|
53
|
+
cleaned_attributes[att_key_to_set] = get_def_from_variable_path(att_val, definition_stack)
|
|
84
54
|
}
|
|
85
55
|
}
|
|
86
56
|
}
|
|
@@ -119,12 +89,32 @@ export function create_content_manager(config) {
|
|
|
119
89
|
}
|
|
120
90
|
}
|
|
121
91
|
|
|
92
|
+
function clean_variable_path(input) {
|
|
93
|
+
let cleaned_path = []
|
|
94
|
+
if (Array.isArray(input) && input.length > 0) {
|
|
95
|
+
let is_def = is_defined(input?.[0], definition_stack)
|
|
96
|
+
if (!is_def) {
|
|
97
|
+
return []
|
|
98
|
+
}
|
|
99
|
+
for (let item of input) {
|
|
100
|
+
if (Array.isArray(item)) {
|
|
101
|
+
const res = get_def_from_variable_path(item)
|
|
102
|
+
cleaned_path.push(res)
|
|
103
|
+
} else {
|
|
104
|
+
cleaned_path.push(item)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return cleaned_path
|
|
109
|
+
}
|
|
110
|
+
|
|
122
111
|
async function set_variable_at_path(path, value, type) {
|
|
123
112
|
console.log("set_variable_at_path88", path, value, type)
|
|
124
113
|
if (!Array.isArray(path)) {
|
|
125
114
|
return
|
|
126
115
|
}
|
|
127
116
|
let cleaned_path = clean_variable_path(path)
|
|
117
|
+
console.log("path77", { cleaned_path, path })
|
|
128
118
|
if (typeof config?.on_event == "function") {
|
|
129
119
|
if (type == "insert") {
|
|
130
120
|
return config?.on_event({
|
|
@@ -171,11 +161,13 @@ export function create_content_manager(config) {
|
|
|
171
161
|
mapkit_js_token: mapkit_js_token,
|
|
172
162
|
table_options: config?.table_options,
|
|
173
163
|
on_search_table_row_ids: config?.on_search_table_row_ids,
|
|
164
|
+
definition_stack: definition_stack,
|
|
174
165
|
storage_path: () => storage_path,
|
|
175
166
|
is_dark_theme: () => is_dark_theme,
|
|
176
|
-
variables: () => variables,
|
|
177
|
-
loops: () => loops,
|
|
178
167
|
on_event: config?.on_event,
|
|
168
|
+
focused_selector_id: config?.focused_selector_id,
|
|
169
|
+
set_focused_selector_id: config?.set_focused_selector_id,
|
|
170
|
+
open_edit_element_attributes_popover: config?.open_edit_element_attributes_popover,
|
|
179
171
|
})
|
|
180
172
|
)
|
|
181
173
|
}
|
|
@@ -370,6 +362,7 @@ export function create_content_manager(config) {
|
|
|
370
362
|
children: [],
|
|
371
363
|
}
|
|
372
364
|
} else if (val_loc?.type_id == "color_input") {
|
|
365
|
+
console.log("color_input555", val_loc?.attributes)
|
|
373
366
|
return {
|
|
374
367
|
type_id: val_loc?.type_id,
|
|
375
368
|
selector_id: val_loc?.selector_id,
|
|
@@ -516,9 +509,8 @@ export function create_content_manager(config) {
|
|
|
516
509
|
attributes: val_loc?.attributes,
|
|
517
510
|
manager: create_table_advanced_manager({
|
|
518
511
|
...val_loc?.attributes,
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
on_event: config?.on_event, // or maybe intercept and call with adjusted params tbd
|
|
512
|
+
definition_stack: definition_stack,
|
|
513
|
+
on_event: config?.on_event,
|
|
522
514
|
// on_event: (input) => {
|
|
523
515
|
// if (input?.type == "update_row") {
|
|
524
516
|
// if (typeof input?.row_i == "number" && Array.isArray(val_loc?.attributes?.rows_data_from_variable_path)) {
|
|
@@ -593,11 +585,13 @@ export function create_content_manager(config) {
|
|
|
593
585
|
mapkit_js_token: mapkit_js_token,
|
|
594
586
|
table_options: config?.table_options,
|
|
595
587
|
on_search_table_row_ids: config?.on_search_table_row_ids,
|
|
588
|
+
definition_stack: definition_stack,
|
|
596
589
|
storage_path: () => storage_path,
|
|
597
590
|
is_dark_theme: () => is_dark_theme,
|
|
598
|
-
variables: () => variables,
|
|
599
|
-
loops: () => loops,
|
|
600
591
|
on_event: config?.on_event,
|
|
592
|
+
focused_selector_id: config?.focused_selector_id,
|
|
593
|
+
set_focused_selector_id: config?.set_focused_selector_id,
|
|
594
|
+
open_edit_element_attributes_popover: config?.open_edit_element_attributes_popover,
|
|
601
595
|
})
|
|
602
596
|
)
|
|
603
597
|
}
|
|
@@ -611,10 +605,11 @@ export function create_content_manager(config) {
|
|
|
611
605
|
}
|
|
612
606
|
} else if (val_loc?.type_id == "loop") {
|
|
613
607
|
let prepped_children = []
|
|
608
|
+
let is_children = false
|
|
614
609
|
const static_val = set_closurable(val_loc?.attributes?.val)
|
|
615
610
|
if (Array.isArray(static_val)) {
|
|
616
611
|
for (let i = 0; i < static_val.length; i++) {
|
|
617
|
-
|
|
612
|
+
console.log("loop_test", val_loc?.attributes)
|
|
618
613
|
let children = []
|
|
619
614
|
if (Array.isArray(val_loc?.children) && val_loc?.children.length > 0) {
|
|
620
615
|
is_children = true
|
|
@@ -624,11 +619,13 @@ export function create_content_manager(config) {
|
|
|
624
619
|
mapkit_js_token: mapkit_js_token,
|
|
625
620
|
table_options: config?.table_options,
|
|
626
621
|
on_search_table_row_ids: config?.on_search_table_row_ids,
|
|
622
|
+
definition_stack: [{ [val_loc?.attributes?.iter_identifier]: i }, ...definition_stack],
|
|
627
623
|
storage_path: () => storage_path,
|
|
628
624
|
is_dark_theme: () => is_dark_theme,
|
|
629
|
-
variables: () => variables,
|
|
630
|
-
loops: () => [i, ...(Array.isArray(loops) ? loops : [])],
|
|
631
625
|
on_event: config?.on_event,
|
|
626
|
+
focused_selector_id: config?.focused_selector_id,
|
|
627
|
+
set_focused_selector_id: config?.set_focused_selector_id,
|
|
628
|
+
open_edit_element_attributes_popover: config?.open_edit_element_attributes_popover,
|
|
632
629
|
})
|
|
633
630
|
children.push(child_content_manager)
|
|
634
631
|
}
|
|
@@ -640,7 +637,7 @@ export function create_content_manager(config) {
|
|
|
640
637
|
type_id: val_loc?.type_id,
|
|
641
638
|
selector_id: val_loc?.selector_id,
|
|
642
639
|
attributes: val_loc?.attributes,
|
|
643
|
-
is_children:
|
|
640
|
+
is_children: is_children,
|
|
644
641
|
children: prepped_children,
|
|
645
642
|
}
|
|
646
643
|
} else if (val_loc?.type_id == "array_uniform_input") {
|
|
@@ -659,11 +656,13 @@ export function create_content_manager(config) {
|
|
|
659
656
|
mapkit_js_token: mapkit_js_token,
|
|
660
657
|
table_options: config?.table_options,
|
|
661
658
|
on_search_table_row_ids: config?.on_search_table_row_ids,
|
|
659
|
+
definition_stack: [{ [val_loc?.attributes?.iter_identifier]: i }, ...definition_stack],
|
|
662
660
|
storage_path: () => storage_path,
|
|
663
661
|
is_dark_theme: () => is_dark_theme,
|
|
664
|
-
variables: () => variables,
|
|
665
|
-
loops: () => [i, ...(Array.isArray(loops) ? loops : [])],
|
|
666
662
|
on_event: config?.on_event,
|
|
663
|
+
focused_selector_id: config?.focused_selector_id,
|
|
664
|
+
set_focused_selector_id: config?.set_focused_selector_id,
|
|
665
|
+
open_edit_element_attributes_popover: config?.open_edit_element_attributes_popover,
|
|
667
666
|
})
|
|
668
667
|
)
|
|
669
668
|
}
|
|
@@ -721,11 +720,13 @@ export function create_content_manager(config) {
|
|
|
721
720
|
mapkit_js_token: mapkit_js_token,
|
|
722
721
|
table_options: config?.table_options,
|
|
723
722
|
on_search_table_row_ids: config?.on_search_table_row_ids,
|
|
723
|
+
definition_stack: [{ [val_loc?.attributes?.iter_identifier]: key }, ...definition_stack],
|
|
724
724
|
storage_path: () => storage_path,
|
|
725
725
|
is_dark_theme: () => is_dark_theme,
|
|
726
|
-
variables: () => variables,
|
|
727
|
-
loops: () => [key, ...(Array.isArray(loops) ? loops : [])],
|
|
728
726
|
on_event: config?.on_event,
|
|
727
|
+
focused_selector_id: config?.focused_selector_id,
|
|
728
|
+
set_focused_selector_id: config?.set_focused_selector_id,
|
|
729
|
+
open_edit_element_attributes_popover: config?.open_edit_element_attributes_popover,
|
|
729
730
|
})
|
|
730
731
|
)
|
|
731
732
|
}
|
|
@@ -882,7 +883,19 @@ export function create_content_manager(config) {
|
|
|
882
883
|
}
|
|
883
884
|
}
|
|
884
885
|
|
|
886
|
+
function open_edit_element_attributes_popover(input) {
|
|
887
|
+
if (typeof config?.open_edit_element_attributes_popover == "function") {
|
|
888
|
+
config?.open_edit_element_attributes_popover(input)
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
function set_focused_selector_id(input) {
|
|
892
|
+
if (typeof config?.set_focused_selector_id == "function") {
|
|
893
|
+
config?.set_focused_selector_id(input)
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
885
897
|
function init(config) {
|
|
898
|
+
definition_stack = config?.definition_stack ?? []
|
|
886
899
|
val_prepped = prepare_component_and_children(config?.val)
|
|
887
900
|
}
|
|
888
901
|
|
|
@@ -892,12 +905,11 @@ export function create_content_manager(config) {
|
|
|
892
905
|
get val_prepped() {
|
|
893
906
|
return val_prepped
|
|
894
907
|
},
|
|
895
|
-
get
|
|
896
|
-
return
|
|
897
|
-
},
|
|
898
|
-
get loops() {
|
|
899
|
-
return loops
|
|
908
|
+
get focused_selector_id() {
|
|
909
|
+
return config?.focused_selector_id
|
|
900
910
|
},
|
|
901
911
|
pass_event_down,
|
|
912
|
+
set_focused_selector_id,
|
|
913
|
+
open_edit_element_attributes_popover,
|
|
902
914
|
}
|
|
903
915
|
}
|
|
@@ -2,7 +2,6 @@ import { create_button_manager } from "../../../../Button/index.svelte.js"
|
|
|
2
2
|
import { create_checkbox_manager } from "../../../../Checkbox/index.svelte.js"
|
|
3
3
|
import { create_slider_manager } from "../../../../Slider/index.svelte.js"
|
|
4
4
|
import { create_text_input_manager } from "../../../../TextInput/index.svelte.js"
|
|
5
|
-
import { create_variable_path_input_manager } from "../../../../VariablePathInput/index.svelte.js"
|
|
6
5
|
import { create_defined_type_input_manager } from "../../DefinedTypeInput/index.svelte.js"
|
|
7
6
|
import { deep_copy, set_closurable } from "../../../../../client/index.js"
|
|
8
7
|
|
|
@@ -18,9 +17,6 @@ export function create_dropdown_config_manager(config) {
|
|
|
18
17
|
let target_height_slider_manager = $state(null)
|
|
19
18
|
let val_text_input_manager = $state(null)
|
|
20
19
|
let val_defined_type_input_manager = $state(null)
|
|
21
|
-
|
|
22
|
-
let variables_data_type = $derived(set_closurable(config?.variables_data_type, false))
|
|
23
|
-
|
|
24
20
|
let options = $state([])
|
|
25
21
|
let options_prepped = $state([])
|
|
26
22
|
let key_to_add_text_input_manager = $state(null)
|
|
@@ -55,7 +51,7 @@ export function create_dropdown_config_manager(config) {
|
|
|
55
51
|
val: config?.val?.val ?? null,
|
|
56
52
|
})
|
|
57
53
|
val_defined_type_input_manager = create_defined_type_input_manager({
|
|
58
|
-
|
|
54
|
+
get_defined_options: config?.get_defined_options,
|
|
59
55
|
label: "Val",
|
|
60
56
|
attribute_root_key: "val",
|
|
61
57
|
attribute_const_val: () => val_text_input_manager?.val,
|
|
@@ -28,7 +28,6 @@ export function create_number_config_manager(config) {
|
|
|
28
28
|
let round_text_input_manager = $state(null)
|
|
29
29
|
let progress_bar_start_text_input_manager = $state(null)
|
|
30
30
|
let progress_bar_end_text_input_manager = $state(null)
|
|
31
|
-
let variables_data_type = $derived(set_closurable(config?.variables_data_type, null))
|
|
32
31
|
|
|
33
32
|
const number_base = {
|
|
34
33
|
val_from_variable_path: null,
|
|
@@ -115,9 +114,9 @@ export function create_number_config_manager(config) {
|
|
|
115
114
|
val: val_loc?.val,
|
|
116
115
|
})
|
|
117
116
|
val_defined_type_input_manager = create_defined_type_input_manager({
|
|
118
|
-
variables_data_type: () => variables_data_type,
|
|
119
117
|
label: "Val",
|
|
120
118
|
attribute_root_key: "val",
|
|
119
|
+
get_defined_options: config?.get_defined_options,
|
|
121
120
|
attribute_const_val: () => val_text_input_manager?.val,
|
|
122
121
|
attributes: config?.val,
|
|
123
122
|
})
|
|
@@ -24,8 +24,6 @@ export function create_qr_config_manager(config) {
|
|
|
24
24
|
let is_show_copy_checkbox_manager = $state(null)
|
|
25
25
|
let is_show_download_checkbox_manager = $state(null)
|
|
26
26
|
|
|
27
|
-
let variables_data_type = $derived(set_closurable(config?.variables_data_type, null))
|
|
28
|
-
|
|
29
27
|
let val = $derived({
|
|
30
28
|
margin: margin_slider_manager?.val,
|
|
31
29
|
size: size_slider_manager?.val,
|
|
@@ -130,10 +128,10 @@ export function create_qr_config_manager(config) {
|
|
|
130
128
|
val: config?.val?.data ?? "https://www.sveltekit-ui.com",
|
|
131
129
|
})
|
|
132
130
|
data_defined_type_input_manager = create_defined_type_input_manager({
|
|
133
|
-
variables_data_type: () => variables_data_type,
|
|
134
131
|
label: "Data",
|
|
135
132
|
attribute_root_key: "data",
|
|
136
133
|
attribute_const_val: () => data_text_input_manager?.val,
|
|
134
|
+
get_defined_options: config?.get_defined_options,
|
|
137
135
|
attributes: config?.val,
|
|
138
136
|
})
|
|
139
137
|
image_text_input_manager = create_text_input_manager({
|
|
@@ -13,8 +13,6 @@ export function create_slider_config_manager(config) {
|
|
|
13
13
|
let val_count_slider_manager = $state(1)
|
|
14
14
|
let val_defined_type_input_manager = $state(null)
|
|
15
15
|
|
|
16
|
-
let variables_data_type = $derived(set_closurable(config?.variables_data_type, null))
|
|
17
|
-
|
|
18
16
|
let val = $derived({
|
|
19
17
|
...val_defined_type_input_manager?.val,
|
|
20
18
|
min: min_text_input_manager?.val,
|
|
@@ -81,11 +79,11 @@ export function create_slider_config_manager(config) {
|
|
|
81
79
|
color: () => color_input_manager?.val,
|
|
82
80
|
})
|
|
83
81
|
val_defined_type_input_manager = create_defined_type_input_manager({
|
|
84
|
-
variables_data_type: () => variables_data_type,
|
|
85
82
|
label: "Val",
|
|
86
83
|
attribute_root_key: "val",
|
|
87
|
-
attribute_const_val: () => val_slider_manager?.val,
|
|
88
84
|
attributes: config?.val,
|
|
85
|
+
get_defined_options: config?.get_defined_options,
|
|
86
|
+
attribute_const_val: () => val_slider_manager?.val,
|
|
89
87
|
})
|
|
90
88
|
}
|
|
91
89
|
init(config)
|
package/dist/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte.js
CHANGED
|
@@ -17,10 +17,9 @@ import {
|
|
|
17
17
|
} from "../../../../../client/index.js"
|
|
18
18
|
|
|
19
19
|
export function create_table_advanced_config_manager(config) {
|
|
20
|
-
let variables = $derived(set_closurable(config?.variables, null))
|
|
21
|
-
let loops = $derived(set_closurable(config?.loops, null))
|
|
22
|
-
|
|
23
20
|
let variables_data_type = $state(null)
|
|
21
|
+
let definition_stack = $state(null)
|
|
22
|
+
let defined_data_type = $state(null)
|
|
24
23
|
let data_type_input_manager = $state(null)
|
|
25
24
|
let data_type_input_edit_button_manager = $state(null)
|
|
26
25
|
let rows_data_from_variable_path_input_manager = $state(null)
|
|
@@ -153,7 +152,7 @@ export function create_table_advanced_config_manager(config) {
|
|
|
153
152
|
...(Array.isArray(rows_data_from_variable_path_input_manager?.val)
|
|
154
153
|
? rows_data_from_variable_path_input_manager?.val
|
|
155
154
|
: []),
|
|
156
|
-
["
|
|
155
|
+
["defs", "row_i"],
|
|
157
156
|
...(key ? [key] : []),
|
|
158
157
|
]
|
|
159
158
|
)
|
|
@@ -170,7 +169,7 @@ export function create_table_advanced_config_manager(config) {
|
|
|
170
169
|
...(Array.isArray(rows_data_from_variable_path_input_manager?.val)
|
|
171
170
|
? rows_data_from_variable_path_input_manager?.val
|
|
172
171
|
: []),
|
|
173
|
-
["
|
|
172
|
+
["defs", "row_i"],
|
|
174
173
|
])
|
|
175
174
|
children.push(guessed_column_input_content)
|
|
176
175
|
}
|
|
@@ -180,11 +179,10 @@ export function create_table_advanced_config_manager(config) {
|
|
|
180
179
|
|
|
181
180
|
function guess_columns() {
|
|
182
181
|
let row_data_type = deep_copy({
|
|
183
|
-
type: "object_literal",
|
|
184
|
-
properties: {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
},
|
|
182
|
+
// type: "object_literal",
|
|
183
|
+
// properties: {
|
|
184
|
+
// variables: variables_data_type,
|
|
185
|
+
// },
|
|
188
186
|
})
|
|
189
187
|
if (Array.isArray(rows_data_from_variable_path_input_manager?.val)) {
|
|
190
188
|
for (let path_item of rows_data_from_variable_path_input_manager?.val) {
|
|
@@ -195,6 +193,7 @@ export function create_table_advanced_config_manager(config) {
|
|
|
195
193
|
}
|
|
196
194
|
}
|
|
197
195
|
}
|
|
196
|
+
|
|
198
197
|
row_data_type = row_data_type?.items
|
|
199
198
|
let cleaned_columns = {}
|
|
200
199
|
if (row_data_type?.type == "object_literal") {
|
|
@@ -216,7 +215,7 @@ export function create_table_advanced_config_manager(config) {
|
|
|
216
215
|
...(Array.isArray(rows_data_from_variable_path_input_manager?.val)
|
|
217
216
|
? rows_data_from_variable_path_input_manager?.val
|
|
218
217
|
: []),
|
|
219
|
-
["
|
|
218
|
+
["defs", "row_i"],
|
|
220
219
|
...(key ? [key] : []),
|
|
221
220
|
])
|
|
222
221
|
const derived_column_name = key
|
|
@@ -250,7 +249,6 @@ export function create_table_advanced_config_manager(config) {
|
|
|
250
249
|
let columns_prepped_loc = {}
|
|
251
250
|
if (Object.keys(columns || {}).length) {
|
|
252
251
|
for (let column_id of Object.keys(columns || {})) {
|
|
253
|
-
console.log("variables_data_type88888", variables_data_type)
|
|
254
252
|
let column_input_manager = $state(
|
|
255
253
|
create_column_input_manager({
|
|
256
254
|
is_column_update: false,
|
|
@@ -277,9 +275,9 @@ export function create_table_advanced_config_manager(config) {
|
|
|
277
275
|
foreign_table_id: columns?.[column_id]?.foreign_table_id ?? null,
|
|
278
276
|
is_cascade: columns?.[column_id]?.is_cascade ?? false,
|
|
279
277
|
},
|
|
280
|
-
|
|
278
|
+
defined_data_type: config?.defined_data_type,
|
|
281
279
|
variables: () => variables,
|
|
282
|
-
|
|
280
|
+
defs: () => defs,
|
|
283
281
|
columns: () => columns,
|
|
284
282
|
row_data_type: () => row_data_type,
|
|
285
283
|
on_delete: () => {
|
|
@@ -331,9 +329,9 @@ export function create_table_advanced_config_manager(config) {
|
|
|
331
329
|
}
|
|
332
330
|
|
|
333
331
|
function guess_all() {
|
|
334
|
-
if (!
|
|
332
|
+
if (!defined_data_type) {
|
|
335
333
|
data_type_input_manager.guess_from_variables()
|
|
336
|
-
|
|
334
|
+
defined_data_type = data_type_input_manager?.val
|
|
337
335
|
}
|
|
338
336
|
guess_rows_data_from_variable_path()
|
|
339
337
|
guess_columns()
|
|
@@ -342,7 +340,7 @@ export function create_table_advanced_config_manager(config) {
|
|
|
342
340
|
}
|
|
343
341
|
|
|
344
342
|
function init(config) {
|
|
345
|
-
|
|
343
|
+
defined_data_type = config?.defined_data_type
|
|
346
344
|
guess_all_button_manager = create_button_manager({
|
|
347
345
|
type: "outlined",
|
|
348
346
|
text: "Guess All",
|
|
@@ -351,7 +349,7 @@ export function create_table_advanced_config_manager(config) {
|
|
|
351
349
|
})
|
|
352
350
|
rows_data_from_variable_path_input_manager = create_variable_path_input_manager({
|
|
353
351
|
is_popover: false,
|
|
354
|
-
|
|
352
|
+
get_defined_options: config?.get_defined_options,
|
|
355
353
|
val: config?.val?.rows_data_from_variable_path ?? null,
|
|
356
354
|
})
|
|
357
355
|
rows_per_page_dropdown_manager = create_dropdown_manager({
|
|
@@ -411,9 +409,8 @@ export function create_table_advanced_config_manager(config) {
|
|
|
411
409
|
val: config?.val?.row_input_content ?? null,
|
|
412
410
|
storage: null,
|
|
413
411
|
storage_default_folder_path: null,
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
loops: () => [0, ...(Array.isArray(loops) ? loops : [])],
|
|
412
|
+
defined_data_type: defined_data_type,
|
|
413
|
+
definition_stack: () => definition_stack,
|
|
417
414
|
})
|
|
418
415
|
guess_row_input_button_manager = create_button_manager({
|
|
419
416
|
text: "Guess Row Input Content",
|
|
@@ -428,19 +425,18 @@ export function create_table_advanced_config_manager(config) {
|
|
|
428
425
|
val: config?.val?.row_searchable_content_input ?? null,
|
|
429
426
|
storage: null,
|
|
430
427
|
storage_default_folder_path: null,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
loops: () => [0, ...(Array.isArray(loops) ? loops : [])],
|
|
428
|
+
defined_data_type: defined_data_type,
|
|
429
|
+
definition_stack: definition_stack,
|
|
434
430
|
})
|
|
435
431
|
data_type_input_manager = create_data_type_input_manager({
|
|
436
|
-
data_sample: () => variables,
|
|
437
|
-
val: variables_data_type,
|
|
438
|
-
on_finish: (input) => {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
},
|
|
432
|
+
// data_sample: () => variables,
|
|
433
|
+
// val: variables_data_type,
|
|
434
|
+
// on_finish: (input) => {
|
|
435
|
+
// variables_data_type = input
|
|
436
|
+
// if (!rows_data_from_variable_path_input_manager?.val) {
|
|
437
|
+
// guess_rows_data_from_variable_path()
|
|
438
|
+
// }
|
|
439
|
+
// },
|
|
444
440
|
})
|
|
445
441
|
data_type_input_edit_button_manager = create_button_manager({
|
|
446
442
|
type: "plain",
|
|
@@ -23,8 +23,6 @@ export function create_text_input_config_manager(config) {
|
|
|
23
23
|
let rows_slider_manager = $state(null)
|
|
24
24
|
let max_height_slider_manager = $state(null)
|
|
25
25
|
|
|
26
|
-
let variables_data_type = $derived(set_closurable(config?.variables_data_type, null))
|
|
27
|
-
|
|
28
26
|
let val = $derived({
|
|
29
27
|
...val_defined_type_input_manager?.val,
|
|
30
28
|
type: type_dropdown_manager?.val,
|
|
@@ -159,7 +157,7 @@ export function create_text_input_config_manager(config) {
|
|
|
159
157
|
max_height: max_height_slider_manager?.val,
|
|
160
158
|
})
|
|
161
159
|
val_defined_type_input_manager = create_defined_type_input_manager({
|
|
162
|
-
|
|
160
|
+
get_defined_options: config?.get_defined_options,
|
|
163
161
|
label: "Val",
|
|
164
162
|
attribute_root_key: "val",
|
|
165
163
|
attribute_const_val: () => val_text_input_manager?.val,
|
|
@@ -12,8 +12,6 @@ export function create_time_input_config_manager(config) {
|
|
|
12
12
|
let granularity_dropdown_manager = $state(null)
|
|
13
13
|
let format_dropdown_manager = $state(null)
|
|
14
14
|
|
|
15
|
-
let variables_data_type = $derived(set_closurable(config?.variables_data_type, null))
|
|
16
|
-
|
|
17
15
|
let val = $derived({
|
|
18
16
|
...val_defined_type_input_manager?.val,
|
|
19
17
|
format: format_dropdown_manager?.val,
|
|
@@ -55,7 +53,7 @@ export function create_time_input_config_manager(config) {
|
|
|
55
53
|
granularity: granularity_dropdown_manager?.val,
|
|
56
54
|
})
|
|
57
55
|
val_defined_type_input_manager = create_defined_type_input_manager({
|
|
58
|
-
|
|
56
|
+
get_defined_options: config?.get_defined_options,
|
|
59
57
|
label: "Val",
|
|
60
58
|
attribute_root_key: "val",
|
|
61
59
|
attribute_const_val: () => val_time_input_manager?.val,
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { create_popover_manager } from "../../../Popover/index.svelte.js"
|
|
2
1
|
import { create_button_manager } from "../../../Button/index.svelte.js"
|
|
3
2
|
import { create_dropdown_manager } from "../../../Dropdown/index.svelte.js"
|
|
4
3
|
import { create_variable_path_input_manager } from "../../../VariablePathInput/index.svelte.js"
|
|
5
|
-
import {
|
|
4
|
+
import { set_closurable } from "../../../../client/index.js"
|
|
6
5
|
|
|
7
6
|
export function create_defined_type_input_manager(config) {
|
|
8
7
|
let item_defined_by_button_input_manager = $state(null)
|
|
9
8
|
let item_defined_by_dropdown_manager = $state(null)
|
|
10
9
|
let item_variable_path_input_manager = $state(null)
|
|
11
|
-
// let item_function_input_manager = $state(null)
|
|
12
10
|
|
|
13
11
|
let label = $derived(set_closurable(config?.label, null))
|
|
14
|
-
let variables_data_type = $derived(set_closurable(config?.variables_data_type, null))
|
|
15
12
|
let attribute_root_key = $derived(set_closurable(config?.attribute_root_key, null))
|
|
16
13
|
let attribute_const_val = $derived(set_closurable(config?.attribute_const_val, null))
|
|
17
14
|
|
|
@@ -61,13 +58,9 @@ export function create_defined_type_input_manager(config) {
|
|
|
61
58
|
item_variable_path_input_manager = create_variable_path_input_manager({
|
|
62
59
|
is_popover: false,
|
|
63
60
|
val: config?.attributes?.[`${config?.attribute_root_key}_from_variable_path`],
|
|
64
|
-
|
|
61
|
+
get_defined_options: config?.get_defined_options,
|
|
62
|
+
on_finish: () => item_variable_path_input_manager.close_popover(),
|
|
65
63
|
})
|
|
66
|
-
// item_function_input_manager = create_variable_path_input_manager({
|
|
67
|
-
// is_popover: false,
|
|
68
|
-
// val: config?.attributes?.[`${config?.attribute_root_key}_from_variable_path`],
|
|
69
|
-
// variables_data_type: () => variables_data_type,
|
|
70
|
-
// })
|
|
71
64
|
}
|
|
72
65
|
|
|
73
66
|
init(config)
|
|
@@ -85,9 +78,6 @@ export function create_defined_type_input_manager(config) {
|
|
|
85
78
|
get item_variable_path_input_manager() {
|
|
86
79
|
return item_variable_path_input_manager
|
|
87
80
|
},
|
|
88
|
-
// get item_function_input_manager(){
|
|
89
|
-
// return item_function_input_manager
|
|
90
|
-
// },
|
|
91
81
|
get item_defined_by() {
|
|
92
82
|
return item_defined_by
|
|
93
83
|
},
|