sveltekit-ui 1.0.33 → 1.0.35
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 +10 -0
- package/dist/Components/Content/index.svelte.js +1 -5
- package/dist/Components/ContentInput/index.svelte.js +0 -5
- package/dist/Components/TableAdvanced/index.svelte.js +19 -7
- package/dist/Components/Time/index.svelte.js +0 -3
- package/dist/client/astc_formatting/index.js +4 -5
- package/dist/client/index.js +0 -1
- package/dist/client/types/index.js +15 -0
- package/package.json +3 -3
- package/src/lib/Components/Content/index.svelte +10 -0
- package/src/lib/Components/Content/index.svelte.js +1 -5
- package/src/lib/Components/ContentInput/index.svelte.js +0 -5
- package/src/lib/Components/TableAdvanced/index.svelte.js +19 -7
- package/src/lib/Components/Time/index.svelte.js +0 -3
- package/src/lib/client/astc_formatting/index.js +4 -5
- package/src/lib/client/index.js +0 -1
- package/src/lib/client/types/index.js +15 -0
- package/src/routes/[component]/Showcase/TableAdvanced/index.svelte +1182 -91
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
import TableAdvanced from "../TableAdvanced/index.svelte"
|
|
29
29
|
import FileInput from "../FileInput/index.svelte"
|
|
30
30
|
import Button from "../Button/index.svelte"
|
|
31
|
+
import Spacer from "../Spacer/index.svelte"
|
|
31
32
|
import Self from "./index.svelte"
|
|
32
33
|
import { format_date, set_closurable_color, set_closurable, cron_to_english } from "../../client/index.js"
|
|
33
34
|
|
|
@@ -451,6 +452,15 @@
|
|
|
451
452
|
</span>
|
|
452
453
|
{:else if manager?.val_prepped?.type_id === "br"}
|
|
453
454
|
<br />
|
|
455
|
+
{:else if manager?.val_prepped?.type_id === "spacer"}
|
|
456
|
+
<Spacer
|
|
457
|
+
mt={manager?.val_prepped?.attributes?.mt}
|
|
458
|
+
mb={manager?.val_prepped?.attributes?.mb}
|
|
459
|
+
ml={manager?.val_prepped?.attributes?.ml}
|
|
460
|
+
mr={manager?.val_prepped?.attributes?.mr}
|
|
461
|
+
is_vert={manager?.val_prepped?.attributes?.is_vert}
|
|
462
|
+
color={manager?.val_prepped?.attributes?.color}
|
|
463
|
+
/>
|
|
454
464
|
{:else if manager?.val_prepped?.type_id === "hr"}
|
|
455
465
|
<hr id={manager?.val_prepped?.selector_id} />
|
|
456
466
|
{:else if manager?.val_prepped?.type_id === "slot"}
|
|
@@ -98,7 +98,7 @@ export function create_content_manager(config) {
|
|
|
98
98
|
}
|
|
99
99
|
for (let item of input) {
|
|
100
100
|
if (Array.isArray(item)) {
|
|
101
|
-
const res = get_def_from_variable_path(item)
|
|
101
|
+
const res = get_def_from_variable_path(item, definition_stack)
|
|
102
102
|
cleaned_path.push(res)
|
|
103
103
|
} else {
|
|
104
104
|
cleaned_path.push(item)
|
|
@@ -109,7 +109,6 @@ export function create_content_manager(config) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
async function set_variable_at_path(path, value, type) {
|
|
112
|
-
console.log("set_variable_at_path88", path, value, type)
|
|
113
112
|
if (!Array.isArray(path)) {
|
|
114
113
|
return
|
|
115
114
|
}
|
|
@@ -361,7 +360,6 @@ export function create_content_manager(config) {
|
|
|
361
360
|
children: [],
|
|
362
361
|
}
|
|
363
362
|
} else if (val_loc?.type_id == "color_input") {
|
|
364
|
-
console.log("color_input555", val_loc?.attributes)
|
|
365
363
|
return {
|
|
366
364
|
type_id: val_loc?.type_id,
|
|
367
365
|
selector_id: val_loc?.selector_id,
|
|
@@ -608,7 +606,6 @@ export function create_content_manager(config) {
|
|
|
608
606
|
const static_val = set_closurable(val_loc?.attributes?.val)
|
|
609
607
|
if (Array.isArray(static_val)) {
|
|
610
608
|
for (let i = 0; i < static_val.length; i++) {
|
|
611
|
-
// console.log("loop_test", val_loc?.attributes)
|
|
612
609
|
let children = []
|
|
613
610
|
if (Array.isArray(val_loc?.children) && val_loc?.children.length > 0) {
|
|
614
611
|
is_children = true
|
|
@@ -859,7 +856,6 @@ export function create_content_manager(config) {
|
|
|
859
856
|
},
|
|
860
857
|
on_change: (input) => set_variable_at_path(val_loc?.attributes?.val_from_variable_path, input),
|
|
861
858
|
})
|
|
862
|
-
console.log("table_dropdown", { val_loc, val_from: val_loc?.attributes?.val_from_variable_path })
|
|
863
859
|
return {
|
|
864
860
|
type_id: val_loc?.type_id,
|
|
865
861
|
selector_id: val_loc?.selector_id,
|
|
@@ -56,7 +56,6 @@ export function create_content_input_manager(config) {
|
|
|
56
56
|
if (input?.type_id == selector_id) {
|
|
57
57
|
return { defined, is_found_selector_id: true }
|
|
58
58
|
} else if (input?.type_id == "loop") {
|
|
59
|
-
console.log("loop_iter_iter_identifier", input?.attributes?.iter_identifier)
|
|
60
59
|
if (input?.attributes?.iter_identifier) {
|
|
61
60
|
defined[input?.attributes?.iter_identifier] = { type: "text_literal" }
|
|
62
61
|
}
|
|
@@ -76,13 +75,10 @@ export function create_content_input_manager(config) {
|
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
function get_defined_options(selector_id) {
|
|
79
|
-
console.log("get_defined_options", deep_copy({ definition_stack, selector_id }))
|
|
80
78
|
const defined_at_selector_id = get_defined_at_selector_id(selector_id)
|
|
81
|
-
console.log("defined_at_selector_id", deep_copy({ defined_at_selector_id }))
|
|
82
79
|
const defined_data_type = json_to_data_type(
|
|
83
80
|
Object.assign({}, ...[...(Array.isArray(definition_stack) ? definition_stack : [])].reverse())
|
|
84
81
|
)
|
|
85
|
-
console.log("defined_data_type", deep_copy({ defined_data_type }))
|
|
86
82
|
return Object.entries({ ...(defined_data_type?.properties || {}), ...defined_at_selector_id }).map(
|
|
87
83
|
([key, val]) => ({
|
|
88
84
|
key,
|
|
@@ -438,7 +434,6 @@ export function create_content_input_manager(config) {
|
|
|
438
434
|
|
|
439
435
|
function handle_element_child_drag_drop(e, selector_id, is_children = false) {
|
|
440
436
|
e.stopPropagation()
|
|
441
|
-
console.log("handle_element_child_drag_drop", { selector_id, dragging_selector_id, is_children })
|
|
442
437
|
if (selector_id == dragging_selector_id) {
|
|
443
438
|
dragging_selector_id = null
|
|
444
439
|
return
|
|
@@ -507,6 +507,7 @@ export function create_table_advanced_manager(config) {
|
|
|
507
507
|
storage_items: null, // tbd
|
|
508
508
|
on_search_table_row_ids: config?.on_search_table_row_ids,
|
|
509
509
|
on_event: (input) => {
|
|
510
|
+
console.log("on_e", deep_copy({ input, row_definition_stack }))
|
|
510
511
|
const res = set_definition_stack(input, row_definition_stack)
|
|
511
512
|
row_definition_stack = res?.definition_stack
|
|
512
513
|
const row_data = get_def_from_variable_path([row_edit_def_identifier], row_definition_stack)
|
|
@@ -688,16 +689,27 @@ export function create_table_advanced_manager(config) {
|
|
|
688
689
|
row_edit_def_identifier,
|
|
689
690
|
column_id,
|
|
690
691
|
])
|
|
691
|
-
if (guessed_column_input_content?.hasOwnProperty("attributes")) {
|
|
692
|
-
if (!guessed_column_input_content.attributes) {
|
|
693
|
-
guessed_column_input_content.attributes = {}
|
|
694
|
-
}
|
|
695
|
-
guessed_column_input_content.attributes.label = column_id
|
|
696
|
-
}
|
|
697
692
|
return {
|
|
698
693
|
type_id: "div",
|
|
699
694
|
selector_id: create_unique_id(null, 8),
|
|
700
|
-
children: [
|
|
695
|
+
children: [
|
|
696
|
+
{
|
|
697
|
+
type_id: "strong",
|
|
698
|
+
selector_id: create_unique_id(null, 8),
|
|
699
|
+
children: [],
|
|
700
|
+
attributes: { content: column_id },
|
|
701
|
+
},
|
|
702
|
+
guessed_column_input_content,
|
|
703
|
+
{
|
|
704
|
+
type_id: "spacer",
|
|
705
|
+
selector_id: create_unique_id(null, 8),
|
|
706
|
+
children: [],
|
|
707
|
+
attributes: {
|
|
708
|
+
mt: 1,
|
|
709
|
+
mb: 1,
|
|
710
|
+
},
|
|
711
|
+
},
|
|
712
|
+
],
|
|
701
713
|
attributes: {},
|
|
702
714
|
}
|
|
703
715
|
}
|
|
@@ -7,7 +7,6 @@ export function create_time_manager(config) {
|
|
|
7
7
|
let text_color = $derived(set_closurable_color(config?.text_color, null))
|
|
8
8
|
|
|
9
9
|
function init(config) {
|
|
10
|
-
console.log("create_time_manager", config)
|
|
11
10
|
const time_full = get_time_object_from_val(
|
|
12
11
|
set_closurable(config?.val),
|
|
13
12
|
set_closurable(config?.format),
|
|
@@ -16,12 +15,10 @@ export function create_time_manager(config) {
|
|
|
16
15
|
)
|
|
17
16
|
datetime = time_full?.datetime ?? time_full?.iso_8601 ?? null
|
|
18
17
|
content = time_full?.content ?? set_closurable(config?.val)
|
|
19
|
-
console.log("time_full", { time_full, datetime, content })
|
|
20
18
|
if (config?.display_format == "calendar_date" && time_full?.year) {
|
|
21
19
|
content = `${time_full?.year}-${String(time_full?.month).padStart(2, "0")}-${String(
|
|
22
20
|
time_full?.day_of_month
|
|
23
21
|
).padStart(2, "0")}`
|
|
24
|
-
console.log("content_cal_da", { content })
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
24
|
|
|
@@ -780,11 +780,13 @@ export function variables_data_type_remaining_to_astc(
|
|
|
780
780
|
if (preferred_content_use == "input") {
|
|
781
781
|
const child_astc = variables_data_type_remaining_to_astc(
|
|
782
782
|
variables_data_type_remaining?.items,
|
|
783
|
-
preferred_content_use
|
|
783
|
+
preferred_content_use,
|
|
784
|
+
[...leading_variable_path, ["loop_index"]]
|
|
784
785
|
)
|
|
785
786
|
return astc_element("array_uniform_input", [child_astc], {
|
|
786
787
|
val_from_variable_path: leading_variable_path,
|
|
787
788
|
...(variables_data_type_remaining?.attributes ?? {}),
|
|
789
|
+
iter_identifier: "loop_index",
|
|
788
790
|
})
|
|
789
791
|
}
|
|
790
792
|
// if (preferred_content_type == "object") {
|
|
@@ -795,7 +797,6 @@ export function variables_data_type_remaining_to_astc(
|
|
|
795
797
|
preferred_content_use,
|
|
796
798
|
[...leading_variable_path, ["loop_index"]]
|
|
797
799
|
)
|
|
798
|
-
console.log("loop_child", { child_astc, variables_data_type_remaining })
|
|
799
800
|
return astc_element("loop", [child_astc], {
|
|
800
801
|
val_from_variable_path: leading_variable_path,
|
|
801
802
|
...(variables_data_type_remaining?.attributes ?? {}),
|
|
@@ -840,7 +841,7 @@ export function variables_data_type_remaining_to_astc(
|
|
|
840
841
|
})
|
|
841
842
|
: null
|
|
842
843
|
if (preferred_content_use == "input") {
|
|
843
|
-
let children = label ? [label] : []
|
|
844
|
+
let children = variables_data_type_remaining?.attributes?.label ? [label] : []
|
|
844
845
|
for (let [key, val] of Object.entries(variables_data_type_remaining?.properties || {})) {
|
|
845
846
|
let property_children = []
|
|
846
847
|
property_children.push(
|
|
@@ -1088,10 +1089,8 @@ export function json_to_data_type(data, type = null, is_list_child = false) {
|
|
|
1088
1089
|
structure = json_to_data_type(data, "time_literal")
|
|
1089
1090
|
} else if (keys.includes("cron")) {
|
|
1090
1091
|
structure = json_to_data_type(data, "cron_literal")
|
|
1091
|
-
console.log("cronnnnn", structure)
|
|
1092
1092
|
} else if (keys.includes("main_number") && keys.includes("country_code")) {
|
|
1093
1093
|
structure = json_to_data_type(data, "phone_literal")
|
|
1094
|
-
console.log("phonnnnn", structure)
|
|
1095
1094
|
} else {
|
|
1096
1095
|
let properties = {}
|
|
1097
1096
|
for (let key of Object.keys(data || {})) {
|
package/dist/client/index.js
CHANGED
|
@@ -336,7 +336,6 @@ function add_keys_to_set(obj, set, prefix) {
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
function get_value_by_path(obj, path) {
|
|
339
|
-
console.log("get_value_by_path000", { obj, path })
|
|
340
339
|
if (Array.isArray(path)) {
|
|
341
340
|
for (let i = 0; i < path.length; i++) {
|
|
342
341
|
if (obj && typeof obj == "object" && obj.hasOwnProperty(path?.[i])) {
|
|
@@ -1436,6 +1436,21 @@ export const content_types = {
|
|
|
1436
1436
|
attributes: {},
|
|
1437
1437
|
child_elements: {},
|
|
1438
1438
|
},
|
|
1439
|
+
spacer: {
|
|
1440
|
+
kind: "content",
|
|
1441
|
+
category: "content",
|
|
1442
|
+
name: "Spacer",
|
|
1443
|
+
display_order: 40,
|
|
1444
|
+
attributes: {
|
|
1445
|
+
mt: { type: "float_literal" },
|
|
1446
|
+
mb: { type: "float_literal" },
|
|
1447
|
+
ml: { type: "float_literal" },
|
|
1448
|
+
mr: { type: "float_literal" },
|
|
1449
|
+
is_vert: { type: "boolean_literal" },
|
|
1450
|
+
color: { type: "color_literal" },
|
|
1451
|
+
},
|
|
1452
|
+
child_elements: {},
|
|
1453
|
+
},
|
|
1439
1454
|
hr: {
|
|
1440
1455
|
kind: "content",
|
|
1441
1456
|
category: "content",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sveltekit-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.35",
|
|
4
4
|
"description": "A SvelteKit UI component library for building modern web applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"context-filter-polyfill": "^0.3.23",
|
|
21
21
|
"qr-code-styling": "^1.9.2",
|
|
22
|
-
"svelte": "^5.38.
|
|
22
|
+
"svelte": "^5.38.6"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@sveltejs/kit": "^2.22.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@sveltejs/adapter-vercel": "^5.10.2",
|
|
29
|
-
"@sveltejs/kit": "^2.36.
|
|
29
|
+
"@sveltejs/kit": "^2.36.3",
|
|
30
30
|
"@sveltejs/package": "^2.5.0",
|
|
31
31
|
"@sveltejs/vite-plugin-svelte": "^6.1.3",
|
|
32
32
|
"@vercel/analytics": "^1.5.0",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
import TableAdvanced from "$lib/Components/TableAdvanced/index.svelte"
|
|
29
29
|
import FileInput from "$lib/Components/FileInput/index.svelte"
|
|
30
30
|
import Button from "$lib/Components/Button/index.svelte"
|
|
31
|
+
import Spacer from "$lib/Components/Spacer/index.svelte"
|
|
31
32
|
import Self from "./index.svelte"
|
|
32
33
|
import { format_date, set_closurable_color, set_closurable, cron_to_english } from "$lib/client/index.js"
|
|
33
34
|
|
|
@@ -451,6 +452,15 @@
|
|
|
451
452
|
</span>
|
|
452
453
|
{:else if manager?.val_prepped?.type_id === "br"}
|
|
453
454
|
<br />
|
|
455
|
+
{:else if manager?.val_prepped?.type_id === "spacer"}
|
|
456
|
+
<Spacer
|
|
457
|
+
mt={manager?.val_prepped?.attributes?.mt}
|
|
458
|
+
mb={manager?.val_prepped?.attributes?.mb}
|
|
459
|
+
ml={manager?.val_prepped?.attributes?.ml}
|
|
460
|
+
mr={manager?.val_prepped?.attributes?.mr}
|
|
461
|
+
is_vert={manager?.val_prepped?.attributes?.is_vert}
|
|
462
|
+
color={manager?.val_prepped?.attributes?.color}
|
|
463
|
+
/>
|
|
454
464
|
{:else if manager?.val_prepped?.type_id === "hr"}
|
|
455
465
|
<hr id={manager?.val_prepped?.selector_id} />
|
|
456
466
|
{:else if manager?.val_prepped?.type_id === "slot"}
|
|
@@ -98,7 +98,7 @@ export function create_content_manager(config) {
|
|
|
98
98
|
}
|
|
99
99
|
for (let item of input) {
|
|
100
100
|
if (Array.isArray(item)) {
|
|
101
|
-
const res = get_def_from_variable_path(item)
|
|
101
|
+
const res = get_def_from_variable_path(item, definition_stack)
|
|
102
102
|
cleaned_path.push(res)
|
|
103
103
|
} else {
|
|
104
104
|
cleaned_path.push(item)
|
|
@@ -109,7 +109,6 @@ export function create_content_manager(config) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
async function set_variable_at_path(path, value, type) {
|
|
112
|
-
console.log("set_variable_at_path88", path, value, type)
|
|
113
112
|
if (!Array.isArray(path)) {
|
|
114
113
|
return
|
|
115
114
|
}
|
|
@@ -361,7 +360,6 @@ export function create_content_manager(config) {
|
|
|
361
360
|
children: [],
|
|
362
361
|
}
|
|
363
362
|
} else if (val_loc?.type_id == "color_input") {
|
|
364
|
-
console.log("color_input555", val_loc?.attributes)
|
|
365
363
|
return {
|
|
366
364
|
type_id: val_loc?.type_id,
|
|
367
365
|
selector_id: val_loc?.selector_id,
|
|
@@ -608,7 +606,6 @@ export function create_content_manager(config) {
|
|
|
608
606
|
const static_val = set_closurable(val_loc?.attributes?.val)
|
|
609
607
|
if (Array.isArray(static_val)) {
|
|
610
608
|
for (let i = 0; i < static_val.length; i++) {
|
|
611
|
-
// console.log("loop_test", val_loc?.attributes)
|
|
612
609
|
let children = []
|
|
613
610
|
if (Array.isArray(val_loc?.children) && val_loc?.children.length > 0) {
|
|
614
611
|
is_children = true
|
|
@@ -859,7 +856,6 @@ export function create_content_manager(config) {
|
|
|
859
856
|
},
|
|
860
857
|
on_change: (input) => set_variable_at_path(val_loc?.attributes?.val_from_variable_path, input),
|
|
861
858
|
})
|
|
862
|
-
console.log("table_dropdown", { val_loc, val_from: val_loc?.attributes?.val_from_variable_path })
|
|
863
859
|
return {
|
|
864
860
|
type_id: val_loc?.type_id,
|
|
865
861
|
selector_id: val_loc?.selector_id,
|
|
@@ -56,7 +56,6 @@ export function create_content_input_manager(config) {
|
|
|
56
56
|
if (input?.type_id == selector_id) {
|
|
57
57
|
return { defined, is_found_selector_id: true }
|
|
58
58
|
} else if (input?.type_id == "loop") {
|
|
59
|
-
console.log("loop_iter_iter_identifier", input?.attributes?.iter_identifier)
|
|
60
59
|
if (input?.attributes?.iter_identifier) {
|
|
61
60
|
defined[input?.attributes?.iter_identifier] = { type: "text_literal" }
|
|
62
61
|
}
|
|
@@ -76,13 +75,10 @@ export function create_content_input_manager(config) {
|
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
function get_defined_options(selector_id) {
|
|
79
|
-
console.log("get_defined_options", deep_copy({ definition_stack, selector_id }))
|
|
80
78
|
const defined_at_selector_id = get_defined_at_selector_id(selector_id)
|
|
81
|
-
console.log("defined_at_selector_id", deep_copy({ defined_at_selector_id }))
|
|
82
79
|
const defined_data_type = json_to_data_type(
|
|
83
80
|
Object.assign({}, ...[...(Array.isArray(definition_stack) ? definition_stack : [])].reverse())
|
|
84
81
|
)
|
|
85
|
-
console.log("defined_data_type", deep_copy({ defined_data_type }))
|
|
86
82
|
return Object.entries({ ...(defined_data_type?.properties || {}), ...defined_at_selector_id }).map(
|
|
87
83
|
([key, val]) => ({
|
|
88
84
|
key,
|
|
@@ -438,7 +434,6 @@ export function create_content_input_manager(config) {
|
|
|
438
434
|
|
|
439
435
|
function handle_element_child_drag_drop(e, selector_id, is_children = false) {
|
|
440
436
|
e.stopPropagation()
|
|
441
|
-
console.log("handle_element_child_drag_drop", { selector_id, dragging_selector_id, is_children })
|
|
442
437
|
if (selector_id == dragging_selector_id) {
|
|
443
438
|
dragging_selector_id = null
|
|
444
439
|
return
|
|
@@ -507,6 +507,7 @@ export function create_table_advanced_manager(config) {
|
|
|
507
507
|
storage_items: null, // tbd
|
|
508
508
|
on_search_table_row_ids: config?.on_search_table_row_ids,
|
|
509
509
|
on_event: (input) => {
|
|
510
|
+
console.log("on_e", deep_copy({ input, row_definition_stack }))
|
|
510
511
|
const res = set_definition_stack(input, row_definition_stack)
|
|
511
512
|
row_definition_stack = res?.definition_stack
|
|
512
513
|
const row_data = get_def_from_variable_path([row_edit_def_identifier], row_definition_stack)
|
|
@@ -688,16 +689,27 @@ export function create_table_advanced_manager(config) {
|
|
|
688
689
|
row_edit_def_identifier,
|
|
689
690
|
column_id,
|
|
690
691
|
])
|
|
691
|
-
if (guessed_column_input_content?.hasOwnProperty("attributes")) {
|
|
692
|
-
if (!guessed_column_input_content.attributes) {
|
|
693
|
-
guessed_column_input_content.attributes = {}
|
|
694
|
-
}
|
|
695
|
-
guessed_column_input_content.attributes.label = column_id
|
|
696
|
-
}
|
|
697
692
|
return {
|
|
698
693
|
type_id: "div",
|
|
699
694
|
selector_id: create_unique_id(null, 8),
|
|
700
|
-
children: [
|
|
695
|
+
children: [
|
|
696
|
+
{
|
|
697
|
+
type_id: "strong",
|
|
698
|
+
selector_id: create_unique_id(null, 8),
|
|
699
|
+
children: [],
|
|
700
|
+
attributes: { content: column_id },
|
|
701
|
+
},
|
|
702
|
+
guessed_column_input_content,
|
|
703
|
+
{
|
|
704
|
+
type_id: "spacer",
|
|
705
|
+
selector_id: create_unique_id(null, 8),
|
|
706
|
+
children: [],
|
|
707
|
+
attributes: {
|
|
708
|
+
mt: 1,
|
|
709
|
+
mb: 1,
|
|
710
|
+
},
|
|
711
|
+
},
|
|
712
|
+
],
|
|
701
713
|
attributes: {},
|
|
702
714
|
}
|
|
703
715
|
}
|
|
@@ -7,7 +7,6 @@ export function create_time_manager(config) {
|
|
|
7
7
|
let text_color = $derived(set_closurable_color(config?.text_color, null))
|
|
8
8
|
|
|
9
9
|
function init(config) {
|
|
10
|
-
console.log("create_time_manager", config)
|
|
11
10
|
const time_full = get_time_object_from_val(
|
|
12
11
|
set_closurable(config?.val),
|
|
13
12
|
set_closurable(config?.format),
|
|
@@ -16,12 +15,10 @@ export function create_time_manager(config) {
|
|
|
16
15
|
)
|
|
17
16
|
datetime = time_full?.datetime ?? time_full?.iso_8601 ?? null
|
|
18
17
|
content = time_full?.content ?? set_closurable(config?.val)
|
|
19
|
-
console.log("time_full", { time_full, datetime, content })
|
|
20
18
|
if (config?.display_format == "calendar_date" && time_full?.year) {
|
|
21
19
|
content = `${time_full?.year}-${String(time_full?.month).padStart(2, "0")}-${String(
|
|
22
20
|
time_full?.day_of_month
|
|
23
21
|
).padStart(2, "0")}`
|
|
24
|
-
console.log("content_cal_da", { content })
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
24
|
|
|
@@ -780,11 +780,13 @@ export function variables_data_type_remaining_to_astc(
|
|
|
780
780
|
if (preferred_content_use == "input") {
|
|
781
781
|
const child_astc = variables_data_type_remaining_to_astc(
|
|
782
782
|
variables_data_type_remaining?.items,
|
|
783
|
-
preferred_content_use
|
|
783
|
+
preferred_content_use,
|
|
784
|
+
[...leading_variable_path, ["loop_index"]]
|
|
784
785
|
)
|
|
785
786
|
return astc_element("array_uniform_input", [child_astc], {
|
|
786
787
|
val_from_variable_path: leading_variable_path,
|
|
787
788
|
...(variables_data_type_remaining?.attributes ?? {}),
|
|
789
|
+
iter_identifier: "loop_index",
|
|
788
790
|
})
|
|
789
791
|
}
|
|
790
792
|
// if (preferred_content_type == "object") {
|
|
@@ -795,7 +797,6 @@ export function variables_data_type_remaining_to_astc(
|
|
|
795
797
|
preferred_content_use,
|
|
796
798
|
[...leading_variable_path, ["loop_index"]]
|
|
797
799
|
)
|
|
798
|
-
console.log("loop_child", { child_astc, variables_data_type_remaining })
|
|
799
800
|
return astc_element("loop", [child_astc], {
|
|
800
801
|
val_from_variable_path: leading_variable_path,
|
|
801
802
|
...(variables_data_type_remaining?.attributes ?? {}),
|
|
@@ -840,7 +841,7 @@ export function variables_data_type_remaining_to_astc(
|
|
|
840
841
|
})
|
|
841
842
|
: null
|
|
842
843
|
if (preferred_content_use == "input") {
|
|
843
|
-
let children = label ? [label] : []
|
|
844
|
+
let children = variables_data_type_remaining?.attributes?.label ? [label] : []
|
|
844
845
|
for (let [key, val] of Object.entries(variables_data_type_remaining?.properties || {})) {
|
|
845
846
|
let property_children = []
|
|
846
847
|
property_children.push(
|
|
@@ -1088,10 +1089,8 @@ export function json_to_data_type(data, type = null, is_list_child = false) {
|
|
|
1088
1089
|
structure = json_to_data_type(data, "time_literal")
|
|
1089
1090
|
} else if (keys.includes("cron")) {
|
|
1090
1091
|
structure = json_to_data_type(data, "cron_literal")
|
|
1091
|
-
console.log("cronnnnn", structure)
|
|
1092
1092
|
} else if (keys.includes("main_number") && keys.includes("country_code")) {
|
|
1093
1093
|
structure = json_to_data_type(data, "phone_literal")
|
|
1094
|
-
console.log("phonnnnn", structure)
|
|
1095
1094
|
} else {
|
|
1096
1095
|
let properties = {}
|
|
1097
1096
|
for (let key of Object.keys(data || {})) {
|
package/src/lib/client/index.js
CHANGED
|
@@ -336,7 +336,6 @@ function add_keys_to_set(obj, set, prefix) {
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
function get_value_by_path(obj, path) {
|
|
339
|
-
console.log("get_value_by_path000", { obj, path })
|
|
340
339
|
if (Array.isArray(path)) {
|
|
341
340
|
for (let i = 0; i < path.length; i++) {
|
|
342
341
|
if (obj && typeof obj == "object" && obj.hasOwnProperty(path?.[i])) {
|
|
@@ -1436,6 +1436,21 @@ export const content_types = {
|
|
|
1436
1436
|
attributes: {},
|
|
1437
1437
|
child_elements: {},
|
|
1438
1438
|
},
|
|
1439
|
+
spacer: {
|
|
1440
|
+
kind: "content",
|
|
1441
|
+
category: "content",
|
|
1442
|
+
name: "Spacer",
|
|
1443
|
+
display_order: 40,
|
|
1444
|
+
attributes: {
|
|
1445
|
+
mt: { type: "float_literal" },
|
|
1446
|
+
mb: { type: "float_literal" },
|
|
1447
|
+
ml: { type: "float_literal" },
|
|
1448
|
+
mr: { type: "float_literal" },
|
|
1449
|
+
is_vert: { type: "boolean_literal" },
|
|
1450
|
+
color: { type: "color_literal" },
|
|
1451
|
+
},
|
|
1452
|
+
child_elements: {},
|
|
1453
|
+
},
|
|
1439
1454
|
hr: {
|
|
1440
1455
|
kind: "content",
|
|
1441
1456
|
category: "content",
|