sveltekit-ui 1.0.14 → 1.0.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.
|
@@ -2,7 +2,7 @@ import { create_popover_manager } from "../Popover/index.svelte.js"
|
|
|
2
2
|
import { create_button_manager } from "../Button/index.svelte.js"
|
|
3
3
|
import { create_text_input_manager } from "../TextInput/index.svelte.js"
|
|
4
4
|
import { create_dropdown_manager } from "../Dropdown/index.svelte.js"
|
|
5
|
-
import {
|
|
5
|
+
import { deep_copy } from "../../client/index.js"
|
|
6
6
|
|
|
7
7
|
export function create_variable_path_input_manager(config) {
|
|
8
8
|
let popover_manager = $state(null)
|
|
@@ -13,12 +13,14 @@ export function create_variable_path_input_manager(config) {
|
|
|
13
13
|
let def_dropdown_manager = $state(null)
|
|
14
14
|
let levels_nested = $state(null)
|
|
15
15
|
let path_prepped = $state(null)
|
|
16
|
-
let val = $derived(
|
|
17
|
-
|
|
16
|
+
let val = $derived(get_val())
|
|
17
|
+
let val_text = $derived(val_to_text(val))
|
|
18
|
+
|
|
19
|
+
function get_val() {
|
|
20
|
+
return def_dropdown_manager?.val
|
|
18
21
|
? [def_dropdown_manager?.val, ...(Array.isArray(path_prepped) ? path_prepped.map((h) => h?.val) : [])]
|
|
19
22
|
: []
|
|
20
|
-
|
|
21
|
-
let val_text = $derived(val_to_text(val))
|
|
23
|
+
}
|
|
22
24
|
|
|
23
25
|
function prep_path(input) {
|
|
24
26
|
console.log("prep_path", input)
|
|
@@ -49,6 +51,7 @@ export function create_variable_path_input_manager(config) {
|
|
|
49
51
|
is_uniform: true,
|
|
50
52
|
support_icon: "x",
|
|
51
53
|
on_click: () => {
|
|
54
|
+
let val = get_val()
|
|
52
55
|
prep_path(Array.isArray(val) ? val.filter((_, idx) => idx !== i) : null)
|
|
53
56
|
},
|
|
54
57
|
})
|
|
@@ -56,12 +59,14 @@ export function create_variable_path_input_manager(config) {
|
|
|
56
59
|
type: "outlined",
|
|
57
60
|
is_uniform: true,
|
|
58
61
|
support_icon: "plus",
|
|
59
|
-
on_click: () =>
|
|
62
|
+
on_click: () => {
|
|
63
|
+
let val = get_val()
|
|
60
64
|
prep_path([
|
|
61
65
|
...(Array.isArray(val) ? val.slice(0, i) : []),
|
|
62
66
|
null,
|
|
63
67
|
...(Array.isArray(val) ? val.slice(i) : []),
|
|
64
|
-
])
|
|
68
|
+
])
|
|
69
|
+
},
|
|
65
70
|
})
|
|
66
71
|
let const_string_value_text_input_manager = create_text_input_manager({
|
|
67
72
|
label: "Property",
|
|
@@ -201,10 +206,8 @@ export function create_variable_path_input_manager(config) {
|
|
|
201
206
|
is_button_compressed: true,
|
|
202
207
|
val: input?.val?.[0],
|
|
203
208
|
on_dropdown_opened: () => {
|
|
204
|
-
console.log("open_def", typeof config?.get_defined_options)
|
|
205
209
|
if (typeof config?.get_defined_options == "function") {
|
|
206
210
|
defined_options = config?.get_defined_options()
|
|
207
|
-
console.log("get_defined_options", defined_options)
|
|
208
211
|
def_dropdown_manager.set_options(defined_options)
|
|
209
212
|
}
|
|
210
213
|
},
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { create_popover_manager } from "$lib/Components/Popover/index.svelte.js"
|
|
|
2
2
|
import { create_button_manager } from "$lib/Components/Button/index.svelte.js"
|
|
3
3
|
import { create_text_input_manager } from "$lib/Components/TextInput/index.svelte.js"
|
|
4
4
|
import { create_dropdown_manager } from "$lib/Components/Dropdown/index.svelte.js"
|
|
5
|
-
import {
|
|
5
|
+
import { deep_copy } from "$lib/client/index.js"
|
|
6
6
|
|
|
7
7
|
export function create_variable_path_input_manager(config) {
|
|
8
8
|
let popover_manager = $state(null)
|
|
@@ -13,12 +13,14 @@ export function create_variable_path_input_manager(config) {
|
|
|
13
13
|
let def_dropdown_manager = $state(null)
|
|
14
14
|
let levels_nested = $state(null)
|
|
15
15
|
let path_prepped = $state(null)
|
|
16
|
-
let val = $derived(
|
|
17
|
-
|
|
16
|
+
let val = $derived(get_val())
|
|
17
|
+
let val_text = $derived(val_to_text(val))
|
|
18
|
+
|
|
19
|
+
function get_val() {
|
|
20
|
+
return def_dropdown_manager?.val
|
|
18
21
|
? [def_dropdown_manager?.val, ...(Array.isArray(path_prepped) ? path_prepped.map((h) => h?.val) : [])]
|
|
19
22
|
: []
|
|
20
|
-
|
|
21
|
-
let val_text = $derived(val_to_text(val))
|
|
23
|
+
}
|
|
22
24
|
|
|
23
25
|
function prep_path(input) {
|
|
24
26
|
console.log("prep_path", input)
|
|
@@ -49,6 +51,7 @@ export function create_variable_path_input_manager(config) {
|
|
|
49
51
|
is_uniform: true,
|
|
50
52
|
support_icon: "x",
|
|
51
53
|
on_click: () => {
|
|
54
|
+
let val = get_val()
|
|
52
55
|
prep_path(Array.isArray(val) ? val.filter((_, idx) => idx !== i) : null)
|
|
53
56
|
},
|
|
54
57
|
})
|
|
@@ -56,12 +59,14 @@ export function create_variable_path_input_manager(config) {
|
|
|
56
59
|
type: "outlined",
|
|
57
60
|
is_uniform: true,
|
|
58
61
|
support_icon: "plus",
|
|
59
|
-
on_click: () =>
|
|
62
|
+
on_click: () => {
|
|
63
|
+
let val = get_val()
|
|
60
64
|
prep_path([
|
|
61
65
|
...(Array.isArray(val) ? val.slice(0, i) : []),
|
|
62
66
|
null,
|
|
63
67
|
...(Array.isArray(val) ? val.slice(i) : []),
|
|
64
|
-
])
|
|
68
|
+
])
|
|
69
|
+
},
|
|
65
70
|
})
|
|
66
71
|
let const_string_value_text_input_manager = create_text_input_manager({
|
|
67
72
|
label: "Property",
|
|
@@ -201,10 +206,8 @@ export function create_variable_path_input_manager(config) {
|
|
|
201
206
|
is_button_compressed: true,
|
|
202
207
|
val: input?.val?.[0],
|
|
203
208
|
on_dropdown_opened: () => {
|
|
204
|
-
console.log("open_def", typeof config?.get_defined_options)
|
|
205
209
|
if (typeof config?.get_defined_options == "function") {
|
|
206
210
|
defined_options = config?.get_defined_options()
|
|
207
|
-
console.log("get_defined_options", defined_options)
|
|
208
211
|
def_dropdown_manager.set_options(defined_options)
|
|
209
212
|
}
|
|
210
213
|
},
|