sveltekit-ui 1.0.32 → 1.0.34
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 +4 -3
- package/dist/Components/ContentInput/AttributesInput/index.svelte.js +2 -2
- package/dist/Components/ContentInput/index.svelte.js +0 -5
- package/dist/Components/TableAdvanced/index.svelte.js +19 -7
- package/dist/client/astc_formatting/index.js +3 -4
- package/dist/client/index.js +0 -1
- package/dist/client/types/index.js +15 -0
- package/dist/index.js +2 -0
- package/package.json +3 -3
- package/src/lib/Components/Content/index.svelte +10 -0
- package/src/lib/Components/Content/index.svelte.js +4 -3
- package/src/lib/Components/ContentInput/AttributesInput/index.svelte.js +2 -2
- package/src/lib/Components/ContentInput/index.svelte.js +0 -5
- package/src/lib/Components/TableAdvanced/index.svelte.js +19 -7
- package/src/lib/client/astc_formatting/index.js +3 -4
- package/src/lib/client/index.js +0 -1
- package/src/lib/client/types/index.js +15 -0
- package/src/lib/index.js +2 -0
- package/src/routes/[component]/Showcase/TableAdvanced/index.svelte +1182 -90
|
@@ -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"}
|
|
@@ -93,12 +93,14 @@ export function create_content_manager(config) {
|
|
|
93
93
|
let cleaned_path = []
|
|
94
94
|
if (Array.isArray(input) && input.length > 0) {
|
|
95
95
|
let is_def = is_defined(input?.[0], definition_stack)
|
|
96
|
+
console.log("is_def", { is_def, item: input?.[0] })
|
|
96
97
|
if (!is_def) {
|
|
97
98
|
return []
|
|
98
99
|
}
|
|
99
100
|
for (let item of input) {
|
|
100
101
|
if (Array.isArray(item)) {
|
|
101
|
-
const res = get_def_from_variable_path(item)
|
|
102
|
+
const res = get_def_from_variable_path(item, definition_stack)
|
|
103
|
+
console.log("get_def_from_variable_path", { item, res })
|
|
102
104
|
cleaned_path.push(res)
|
|
103
105
|
} else {
|
|
104
106
|
cleaned_path.push(item)
|
|
@@ -109,11 +111,11 @@ export function create_content_manager(config) {
|
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
async function set_variable_at_path(path, value, type) {
|
|
112
|
-
console.log("set_variable_at_path88", path, value, type)
|
|
113
114
|
if (!Array.isArray(path)) {
|
|
114
115
|
return
|
|
115
116
|
}
|
|
116
117
|
let cleaned_path = clean_variable_path(path)
|
|
118
|
+
console.log("set_variable_at_path88", deep_copy({ path, value, type, cleaned_path, definition_stack }))
|
|
117
119
|
if (typeof config?.on_event == "function") {
|
|
118
120
|
if (type == "insert") {
|
|
119
121
|
return config?.on_event({
|
|
@@ -608,7 +610,6 @@ export function create_content_manager(config) {
|
|
|
608
610
|
const static_val = set_closurable(val_loc?.attributes?.val)
|
|
609
611
|
if (Array.isArray(static_val)) {
|
|
610
612
|
for (let i = 0; i < static_val.length; i++) {
|
|
611
|
-
// console.log("loop_test", val_loc?.attributes)
|
|
612
613
|
let children = []
|
|
613
614
|
if (Array.isArray(val_loc?.children) && val_loc?.children.length > 0) {
|
|
614
615
|
is_children = true
|
|
@@ -116,14 +116,14 @@ export function create_attributes_input_manager(config) {
|
|
|
116
116
|
val_format_dropdown_manager = create_dropdown_manager({
|
|
117
117
|
label: "Format",
|
|
118
118
|
is_button_compressed: true,
|
|
119
|
-
val: config?.val?.format ?? "
|
|
119
|
+
val: config?.val?.format ?? "time_full",
|
|
120
120
|
options: Object.entries(time_formats).map(([key, val]) => ({ key: key, name: val?.name })),
|
|
121
121
|
})
|
|
122
122
|
let display_format_dropdown_manager = $state(
|
|
123
123
|
create_dropdown_manager({
|
|
124
124
|
label: "Display Format",
|
|
125
125
|
is_button_compressed: true,
|
|
126
|
-
val: config?.val?.display_format,
|
|
126
|
+
val: config?.val?.display_format ?? "calendar_date",
|
|
127
127
|
options: [
|
|
128
128
|
{ key: "raw", name: "Raw" },
|
|
129
129
|
{ key: "time_ago", name: "Time Ago" },
|
|
@@ -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
|
}
|
|
@@ -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 ?? {}),
|
|
@@ -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/dist/index.js
CHANGED
|
@@ -66,6 +66,8 @@ export { default as TextArrayInput } from "./Components/TextArrayInput/index.sve
|
|
|
66
66
|
export { create_text_array_input_manager } from "./Components/TextArrayInput/index.svelte.js"
|
|
67
67
|
export { default as TimeInput } from "./Components/TimeInput/index.svelte"
|
|
68
68
|
export { create_time_input_manager } from "./Components/TimeInput/index.svelte.js"
|
|
69
|
+
export { default as Time } from "./Components/Time/index.svelte"
|
|
70
|
+
export { create_time_manager } from "./Components/Time/index.svelte.js"
|
|
69
71
|
export { default as DataTypeInput } from "./Components/DataTypeInput/index.svelte"
|
|
70
72
|
export { create_data_type_input_manager } from "./Components/DataTypeInput/index.svelte.js"
|
|
71
73
|
export { default as Button } from "./Components/Button/index.svelte"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sveltekit-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.34",
|
|
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"}
|
|
@@ -93,12 +93,14 @@ export function create_content_manager(config) {
|
|
|
93
93
|
let cleaned_path = []
|
|
94
94
|
if (Array.isArray(input) && input.length > 0) {
|
|
95
95
|
let is_def = is_defined(input?.[0], definition_stack)
|
|
96
|
+
console.log("is_def", { is_def, item: input?.[0] })
|
|
96
97
|
if (!is_def) {
|
|
97
98
|
return []
|
|
98
99
|
}
|
|
99
100
|
for (let item of input) {
|
|
100
101
|
if (Array.isArray(item)) {
|
|
101
|
-
const res = get_def_from_variable_path(item)
|
|
102
|
+
const res = get_def_from_variable_path(item, definition_stack)
|
|
103
|
+
console.log("get_def_from_variable_path", { item, res })
|
|
102
104
|
cleaned_path.push(res)
|
|
103
105
|
} else {
|
|
104
106
|
cleaned_path.push(item)
|
|
@@ -109,11 +111,11 @@ export function create_content_manager(config) {
|
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
async function set_variable_at_path(path, value, type) {
|
|
112
|
-
console.log("set_variable_at_path88", path, value, type)
|
|
113
114
|
if (!Array.isArray(path)) {
|
|
114
115
|
return
|
|
115
116
|
}
|
|
116
117
|
let cleaned_path = clean_variable_path(path)
|
|
118
|
+
console.log("set_variable_at_path88", deep_copy({ path, value, type, cleaned_path, definition_stack }))
|
|
117
119
|
if (typeof config?.on_event == "function") {
|
|
118
120
|
if (type == "insert") {
|
|
119
121
|
return config?.on_event({
|
|
@@ -608,7 +610,6 @@ export function create_content_manager(config) {
|
|
|
608
610
|
const static_val = set_closurable(val_loc?.attributes?.val)
|
|
609
611
|
if (Array.isArray(static_val)) {
|
|
610
612
|
for (let i = 0; i < static_val.length; i++) {
|
|
611
|
-
// console.log("loop_test", val_loc?.attributes)
|
|
612
613
|
let children = []
|
|
613
614
|
if (Array.isArray(val_loc?.children) && val_loc?.children.length > 0) {
|
|
614
615
|
is_children = true
|
|
@@ -116,14 +116,14 @@ export function create_attributes_input_manager(config) {
|
|
|
116
116
|
val_format_dropdown_manager = create_dropdown_manager({
|
|
117
117
|
label: "Format",
|
|
118
118
|
is_button_compressed: true,
|
|
119
|
-
val: config?.val?.format ?? "
|
|
119
|
+
val: config?.val?.format ?? "time_full",
|
|
120
120
|
options: Object.entries(time_formats).map(([key, val]) => ({ key: key, name: val?.name })),
|
|
121
121
|
})
|
|
122
122
|
let display_format_dropdown_manager = $state(
|
|
123
123
|
create_dropdown_manager({
|
|
124
124
|
label: "Display Format",
|
|
125
125
|
is_button_compressed: true,
|
|
126
|
-
val: config?.val?.display_format,
|
|
126
|
+
val: config?.val?.display_format ?? "calendar_date",
|
|
127
127
|
options: [
|
|
128
128
|
{ key: "raw", name: "Raw" },
|
|
129
129
|
{ key: "time_ago", name: "Time Ago" },
|
|
@@ -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
|
}
|
|
@@ -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 ?? {}),
|
|
@@ -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",
|
package/src/lib/index.js
CHANGED
|
@@ -66,6 +66,8 @@ export { default as TextArrayInput } from "./Components/TextArrayInput/index.sve
|
|
|
66
66
|
export { create_text_array_input_manager } from "./Components/TextArrayInput/index.svelte.js"
|
|
67
67
|
export { default as TimeInput } from "./Components/TimeInput/index.svelte"
|
|
68
68
|
export { create_time_input_manager } from "./Components/TimeInput/index.svelte.js"
|
|
69
|
+
export { default as Time } from "./Components/Time/index.svelte"
|
|
70
|
+
export { create_time_manager } from "./Components/Time/index.svelte.js"
|
|
69
71
|
export { default as DataTypeInput } from "./Components/DataTypeInput/index.svelte"
|
|
70
72
|
export { create_data_type_input_manager } from "./Components/DataTypeInput/index.svelte.js"
|
|
71
73
|
export { default as Button } from "./Components/Button/index.svelte"
|