sveltekit-ui 1.0.10 → 1.0.12

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.
Files changed (59) hide show
  1. package/dist/Components/Content/index.svelte +12 -12
  2. package/dist/Components/Content/index.svelte.js +97 -49
  3. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte.js +1 -5
  4. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte.js +1 -2
  5. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte.js +1 -3
  6. package/dist/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte.js +2 -4
  7. package/dist/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte.js +28 -32
  8. package/dist/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte.js +1 -3
  9. package/dist/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte.js +1 -3
  10. package/dist/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte.js +3 -13
  11. package/dist/Components/ContentInput/AttributesInput/index.svelte +1 -0
  12. package/dist/Components/ContentInput/AttributesInput/index.svelte.js +89 -120
  13. package/dist/Components/ContentInput/index.svelte.js +38 -62
  14. package/dist/Components/DataTypeInput/index.svelte.js +0 -3
  15. package/dist/Components/IconInput/index.svelte +1 -1
  16. package/dist/Components/TableAdvanced/ColumnInput/index.svelte.js +15 -62
  17. package/dist/Components/TableAdvanced/SortByInput/index.svelte.js +2 -1
  18. package/dist/Components/TableAdvanced/index.svelte.js +72 -73
  19. package/dist/Components/TextInput/index.svelte +1 -1
  20. package/dist/Components/TextInput/index.svelte.js +12 -0
  21. package/dist/Components/VariablePathInput/index.svelte +47 -93
  22. package/dist/Components/VariablePathInput/index.svelte.js +205 -191
  23. package/dist/client/astc_formatting/index.js +15 -58
  24. package/dist/client/docs/index.js +4 -23
  25. package/dist/client/index.js +38 -90
  26. package/dist/client/types/index.js +2 -0
  27. package/dist/index.js +2 -0
  28. package/package.json +6 -6
  29. package/src/lib/Components/Content/index.svelte +12 -12
  30. package/src/lib/Components/Content/index.svelte.js +97 -49
  31. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte.js +1 -5
  32. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte.js +1 -2
  33. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte.js +1 -3
  34. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte.js +2 -4
  35. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte.js +28 -32
  36. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte.js +1 -3
  37. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte.js +1 -3
  38. package/src/lib/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte.js +3 -13
  39. package/src/lib/Components/ContentInput/AttributesInput/index.svelte +1 -0
  40. package/src/lib/Components/ContentInput/AttributesInput/index.svelte.js +89 -120
  41. package/src/lib/Components/ContentInput/index.svelte.js +38 -62
  42. package/src/lib/Components/DataTypeInput/index.svelte.js +0 -3
  43. package/src/lib/Components/IconInput/index.svelte +1 -1
  44. package/src/lib/Components/TableAdvanced/ColumnInput/index.svelte.js +15 -62
  45. package/src/lib/Components/TableAdvanced/SortByInput/index.svelte.js +2 -1
  46. package/src/lib/Components/TableAdvanced/index.svelte.js +72 -73
  47. package/src/lib/Components/TextInput/index.svelte +1 -1
  48. package/src/lib/Components/TextInput/index.svelte.js +12 -0
  49. package/src/lib/Components/VariablePathInput/index.svelte +47 -93
  50. package/src/lib/Components/VariablePathInput/index.svelte.js +205 -191
  51. package/src/lib/client/astc_formatting/index.js +15 -58
  52. package/src/lib/client/docs/index.js +4 -23
  53. package/src/lib/client/index.js +38 -90
  54. package/src/lib/client/types/index.js +2 -0
  55. package/src/lib/index.js +2 -0
  56. package/src/routes/+layout.svelte +21 -0
  57. package/src/routes/[component]/Showcase/Content/index.svelte +49 -83
  58. package/src/routes/[component]/Showcase/ContentInput/index.svelte +11 -13
  59. package/src/routes/[component]/Showcase/TableAdvanced/index.svelte +71 -252
@@ -30,47 +30,54 @@ import { node_types, deep_copy, set_closurable, create_unique_id, copy_to_clipbo
30
30
 
31
31
  export function create_content_manager(config) {
32
32
  const id = create_unique_id(null, 20)
33
+ let definition_stack = $state([])
33
34
  let is_dark_theme = $derived(set_closurable(config?.is_dark_theme, false))
34
35
  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
36
  let mapkit_js_token = $derived(set_closurable(config?.mapkit_js_token, null))
38
37
  let val_prepped = $state(null)
39
38
 
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
- }
39
+ function get_def(input) {
40
+ for (let item of definition_stack) {
41
+ if (item.hasOwnProperty(input)) {
42
+ return item?.[input]
53
43
  }
54
- return combined_variables_loc
55
44
  }
56
45
  return null
57
46
  }
58
47
 
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)
48
+ function get_def_from_variable_path(input) {
49
+ let val = null
50
+ if (Array.isArray(input) && input.length > 0) {
51
+ val = get_def(input?.[0])
52
+ for (let i = 1; i < input.length; i++) {
53
+ if (Array.isArray(input?.[i])) {
54
+ const res = get_def_from_variable_path(input?.[i])
55
+ val = val?.[res]
67
56
  } else {
68
- cleaned_path.push(path_item)
57
+ val = val?.[input?.[i]]
69
58
  }
70
59
  }
71
- return cleaned_path
72
60
  }
73
- return null
61
+ return val
62
+ }
63
+
64
+ function is_defined(input) {
65
+ for (let item of definition_stack) {
66
+ if (item.hasOwnProperty(input)) {
67
+ return true
68
+ }
69
+ }
70
+ return false
71
+ }
72
+
73
+ function set_def(identifier, value) {
74
+ console.log("set_def", identifier, value)
75
+ for (let i = 0; i < definition_stack.length; i++) {
76
+ if (definition_stack[i].hasOwnProperty(identifier)) {
77
+ definition_stack[i][identifier] = value
78
+ }
79
+ }
80
+ console.log("definition_stack_after_Set", definition_stack)
74
81
  }
75
82
 
76
83
  function clean_attributes_from_variable_path(attributes) {
@@ -78,9 +85,8 @@ export function create_content_manager(config) {
78
85
  if (Object.keys(attributes || {}).length) {
79
86
  for (let [att_key, att_val] of Object.entries(attributes)) {
80
87
  if (att_key.endsWith("_from_variable_path") && att_val != null) {
81
- const clean_path = clean_variable_path(att_val)
82
88
  const att_key_to_set = att_key.split("_from_variable_path")?.[0]
83
- cleaned_attributes[att_key_to_set] = () => get_variable_from_path(clean_path)
89
+ cleaned_attributes[att_key_to_set] = get_def_from_variable_path(att_val)
84
90
  }
85
91
  }
86
92
  }
@@ -119,12 +125,32 @@ export function create_content_manager(config) {
119
125
  }
120
126
  }
121
127
 
128
+ function clean_variable_path(input) {
129
+ let cleaned_path = []
130
+ if (Array.isArray(input) && input.length > 0) {
131
+ let is_def = is_defined(input?.[0])
132
+ if (!is_def) {
133
+ return []
134
+ }
135
+ for (let item of input) {
136
+ if (Array.isArray(item)) {
137
+ const res = get_def_from_variable_path(item)
138
+ cleaned_path.push(res)
139
+ } else {
140
+ cleaned_path.push(item)
141
+ }
142
+ }
143
+ }
144
+ return cleaned_path
145
+ }
146
+
122
147
  async function set_variable_at_path(path, value, type) {
123
148
  console.log("set_variable_at_path88", path, value, type)
124
149
  if (!Array.isArray(path)) {
125
150
  return
126
151
  }
127
152
  let cleaned_path = clean_variable_path(path)
153
+ console.log("path77", { cleaned_path, path })
128
154
  if (typeof config?.on_event == "function") {
129
155
  if (type == "insert") {
130
156
  return config?.on_event({
@@ -171,11 +197,13 @@ export function create_content_manager(config) {
171
197
  mapkit_js_token: mapkit_js_token,
172
198
  table_options: config?.table_options,
173
199
  on_search_table_row_ids: config?.on_search_table_row_ids,
200
+ definition_stack: definition_stack,
174
201
  storage_path: () => storage_path,
175
202
  is_dark_theme: () => is_dark_theme,
176
- variables: () => variables,
177
- loops: () => loops,
178
203
  on_event: config?.on_event,
204
+ focused_selector_id: config?.focused_selector_id,
205
+ set_focused_selector_id: config?.set_focused_selector_id,
206
+ open_edit_element_attributes_popover: config?.open_edit_element_attributes_popover,
179
207
  })
180
208
  )
181
209
  }
@@ -370,6 +398,7 @@ export function create_content_manager(config) {
370
398
  children: [],
371
399
  }
372
400
  } else if (val_loc?.type_id == "color_input") {
401
+ console.log("color_input555", val_loc?.attributes)
373
402
  return {
374
403
  type_id: val_loc?.type_id,
375
404
  selector_id: val_loc?.selector_id,
@@ -516,9 +545,8 @@ export function create_content_manager(config) {
516
545
  attributes: val_loc?.attributes,
517
546
  manager: create_table_advanced_manager({
518
547
  ...val_loc?.attributes,
519
- variables: () => variables,
520
- loops: () => loops,
521
- on_event: config?.on_event, // or maybe intercept and call with adjusted params tbd
548
+ definition_stack: definition_stack,
549
+ on_event: config?.on_event,
522
550
  // on_event: (input) => {
523
551
  // if (input?.type == "update_row") {
524
552
  // if (typeof input?.row_i == "number" && Array.isArray(val_loc?.attributes?.rows_data_from_variable_path)) {
@@ -593,11 +621,13 @@ export function create_content_manager(config) {
593
621
  mapkit_js_token: mapkit_js_token,
594
622
  table_options: config?.table_options,
595
623
  on_search_table_row_ids: config?.on_search_table_row_ids,
624
+ definition_stack: definition_stack,
596
625
  storage_path: () => storage_path,
597
626
  is_dark_theme: () => is_dark_theme,
598
- variables: () => variables,
599
- loops: () => loops,
600
627
  on_event: config?.on_event,
628
+ focused_selector_id: config?.focused_selector_id,
629
+ set_focused_selector_id: config?.set_focused_selector_id,
630
+ open_edit_element_attributes_popover: config?.open_edit_element_attributes_popover,
601
631
  })
602
632
  )
603
633
  }
@@ -611,10 +641,11 @@ export function create_content_manager(config) {
611
641
  }
612
642
  } else if (val_loc?.type_id == "loop") {
613
643
  let prepped_children = []
644
+ let is_children = false
614
645
  const static_val = set_closurable(val_loc?.attributes?.val)
615
646
  if (Array.isArray(static_val)) {
616
647
  for (let i = 0; i < static_val.length; i++) {
617
- let is_children = false
648
+ console.log("loop_test", val_loc?.attributes)
618
649
  let children = []
619
650
  if (Array.isArray(val_loc?.children) && val_loc?.children.length > 0) {
620
651
  is_children = true
@@ -624,11 +655,13 @@ export function create_content_manager(config) {
624
655
  mapkit_js_token: mapkit_js_token,
625
656
  table_options: config?.table_options,
626
657
  on_search_table_row_ids: config?.on_search_table_row_ids,
658
+ definition_stack: [{ [val_loc?.attributes?.iter_identifier]: i }, ...definition_stack],
627
659
  storage_path: () => storage_path,
628
660
  is_dark_theme: () => is_dark_theme,
629
- variables: () => variables,
630
- loops: () => [i, ...(Array.isArray(loops) ? loops : [])],
631
661
  on_event: config?.on_event,
662
+ focused_selector_id: config?.focused_selector_id,
663
+ set_focused_selector_id: config?.set_focused_selector_id,
664
+ open_edit_element_attributes_popover: config?.open_edit_element_attributes_popover,
632
665
  })
633
666
  children.push(child_content_manager)
634
667
  }
@@ -640,7 +673,7 @@ export function create_content_manager(config) {
640
673
  type_id: val_loc?.type_id,
641
674
  selector_id: val_loc?.selector_id,
642
675
  attributes: val_loc?.attributes,
643
- is_children: true,
676
+ is_children: is_children,
644
677
  children: prepped_children,
645
678
  }
646
679
  } else if (val_loc?.type_id == "array_uniform_input") {
@@ -659,11 +692,13 @@ export function create_content_manager(config) {
659
692
  mapkit_js_token: mapkit_js_token,
660
693
  table_options: config?.table_options,
661
694
  on_search_table_row_ids: config?.on_search_table_row_ids,
695
+ definition_stack: [{ [val_loc?.attributes?.iter_identifier]: i }, ...definition_stack],
662
696
  storage_path: () => storage_path,
663
697
  is_dark_theme: () => is_dark_theme,
664
- variables: () => variables,
665
- loops: () => [i, ...(Array.isArray(loops) ? loops : [])],
666
698
  on_event: config?.on_event,
699
+ focused_selector_id: config?.focused_selector_id,
700
+ set_focused_selector_id: config?.set_focused_selector_id,
701
+ open_edit_element_attributes_popover: config?.open_edit_element_attributes_popover,
667
702
  })
668
703
  )
669
704
  }
@@ -721,11 +756,13 @@ export function create_content_manager(config) {
721
756
  mapkit_js_token: mapkit_js_token,
722
757
  table_options: config?.table_options,
723
758
  on_search_table_row_ids: config?.on_search_table_row_ids,
759
+ definition_stack: [{ [val_loc?.attributes?.iter_identifier]: key }, ...definition_stack],
724
760
  storage_path: () => storage_path,
725
761
  is_dark_theme: () => is_dark_theme,
726
- variables: () => variables,
727
- loops: () => [key, ...(Array.isArray(loops) ? loops : [])],
728
762
  on_event: config?.on_event,
763
+ focused_selector_id: config?.focused_selector_id,
764
+ set_focused_selector_id: config?.set_focused_selector_id,
765
+ open_edit_element_attributes_popover: config?.open_edit_element_attributes_popover,
729
766
  })
730
767
  )
731
768
  }
@@ -882,7 +919,19 @@ export function create_content_manager(config) {
882
919
  }
883
920
  }
884
921
 
922
+ function open_edit_element_attributes_popover(input) {
923
+ if (typeof config?.open_edit_element_attributes_popover == "function") {
924
+ config?.open_edit_element_attributes_popover(input)
925
+ }
926
+ }
927
+ function set_focused_selector_id(input) {
928
+ if (typeof config?.set_focused_selector_id == "function") {
929
+ config?.set_focused_selector_id(input)
930
+ }
931
+ }
932
+
885
933
  function init(config) {
934
+ definition_stack = config?.definition_stack ?? []
886
935
  val_prepped = prepare_component_and_children(config?.val)
887
936
  }
888
937
 
@@ -892,12 +941,11 @@ export function create_content_manager(config) {
892
941
  get val_prepped() {
893
942
  return val_prepped
894
943
  },
895
- get variables() {
896
- return variables
897
- },
898
- get loops() {
899
- return loops
944
+ get focused_selector_id() {
945
+ return config?.focused_selector_id
900
946
  },
901
947
  pass_event_down,
948
+ set_focused_selector_id,
949
+ open_edit_element_attributes_popover,
902
950
  }
903
951
  }
@@ -2,7 +2,6 @@ import { create_button_manager } from "$lib/Components/Button/index.svelte.js"
2
2
  import { create_checkbox_manager } from "$lib/Components/Checkbox/index.svelte.js"
3
3
  import { create_slider_manager } from "$lib/Components/Slider/index.svelte.js"
4
4
  import { create_text_input_manager } from "$lib/Components/TextInput/index.svelte.js"
5
- import { create_variable_path_input_manager } from "$lib/Components/VariablePathInput/index.svelte.js"
6
5
  import { create_defined_type_input_manager } from "$lib/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte.js"
7
6
  import { deep_copy, set_closurable } from "$lib/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
- variables_data_type: () => variables_data_type,
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)
@@ -17,10 +17,9 @@ import {
17
17
  } from "$lib/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
- ["loops", 0],
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
- ["loops", 0],
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
- variables: variables_data_type,
186
- loops: { type: "loop" },
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
- ["loops", 0],
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
- variables_data_type: () => variables_data_type,
278
+ defined_data_type: config?.defined_data_type,
281
279
  variables: () => variables,
282
- loops: () => loops,
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 (!variables_data_type) {
332
+ if (!defined_data_type) {
335
333
  data_type_input_manager.guess_from_variables()
336
- variables_data_type = data_type_input_manager?.val
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
- variables_data_type = set_closurable(config?.variables_data_type, null)
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
- variables_data_type: () => variables_data_type,
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
- variables_data_type: () => variables_data_type,
415
- variables: () => variables,
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
- variables_data_type: () => variables_data_type,
432
- variables: () => variables,
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
- variables_data_type = input
440
- if (!rows_data_from_variable_path_input_manager?.val) {
441
- guess_rows_data_from_variable_path()
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
- variables_data_type: () => variables_data_type,
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
- variables_data_type: () => variables_data_type,
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 "$lib/Components/Popover/index.svelte.js"
2
1
  import { create_button_manager } from "$lib/Components/Button/index.svelte.js"
3
2
  import { create_dropdown_manager } from "$lib/Components/Dropdown/index.svelte.js"
4
3
  import { create_variable_path_input_manager } from "$lib/Components/VariablePathInput/index.svelte.js"
5
- import { create_unique_id, deep_copy, set_closurable } from "$lib/client/index.js"
4
+ import { set_closurable } from "$lib/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
- variables_data_type: () => variables_data_type,
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
  },
@@ -319,6 +319,7 @@
319
319
  {:else if manager?.content_type == "loop"}
320
320
  <h3 class="label">Path with items to loop over</h3>
321
321
  <VariablePathInput manager={manager?.attributes_manager?.val_input_manager} />
322
+ <TextInput manager={manager?.attributes_manager?.iter_identifier_text_input_manager} />
322
323
  <DefinedTypeInput manager={manager?.attributes_manager?.join_text_defined_type_input_manager}>
323
324
  {#snippet content()}
324
325
  <TextInput manager={manager?.attributes_manager?.join_text_text_input_manager} />