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.
Files changed (56) hide show
  1. package/dist/Components/Content/index.svelte +12 -12
  2. package/dist/Components/Content/index.svelte.js +73 -61
  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 +16 -64
  17. package/dist/Components/TableAdvanced/SortByInput/index.svelte.js +2 -1
  18. package/dist/Components/TableAdvanced/index.svelte.js +124 -98
  19. package/dist/Components/TextInput/index.svelte.js +12 -0
  20. package/dist/Components/VariablePathInput/index.svelte +47 -93
  21. package/dist/Components/VariablePathInput/index.svelte.js +205 -191
  22. package/dist/client/astc_formatting/index.js +15 -58
  23. package/dist/client/docs/index.js +4 -23
  24. package/dist/client/index.js +86 -90
  25. package/dist/client/types/index.js +2 -0
  26. package/dist/index.js +2 -0
  27. package/package.json +4 -4
  28. package/src/lib/Components/Content/index.svelte +12 -12
  29. package/src/lib/Components/Content/index.svelte.js +73 -61
  30. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte.js +1 -5
  31. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte.js +1 -2
  32. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte.js +1 -3
  33. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte.js +2 -4
  34. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte.js +28 -32
  35. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte.js +1 -3
  36. package/src/lib/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte.js +1 -3
  37. package/src/lib/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte.js +3 -13
  38. package/src/lib/Components/ContentInput/AttributesInput/index.svelte +1 -0
  39. package/src/lib/Components/ContentInput/AttributesInput/index.svelte.js +89 -120
  40. package/src/lib/Components/ContentInput/index.svelte.js +38 -62
  41. package/src/lib/Components/DataTypeInput/index.svelte.js +0 -3
  42. package/src/lib/Components/IconInput/index.svelte +1 -1
  43. package/src/lib/Components/TableAdvanced/ColumnInput/index.svelte.js +16 -64
  44. package/src/lib/Components/TableAdvanced/SortByInput/index.svelte.js +2 -1
  45. package/src/lib/Components/TableAdvanced/index.svelte.js +124 -98
  46. package/src/lib/Components/TextInput/index.svelte.js +12 -0
  47. package/src/lib/Components/VariablePathInput/index.svelte +47 -93
  48. package/src/lib/Components/VariablePathInput/index.svelte.js +205 -191
  49. package/src/lib/client/astc_formatting/index.js +15 -58
  50. package/src/lib/client/docs/index.js +4 -23
  51. package/src/lib/client/index.js +86 -90
  52. package/src/lib/client/types/index.js +2 -0
  53. package/src/lib/index.js +2 -0
  54. package/src/routes/[component]/Showcase/Content/index.svelte +49 -83
  55. package/src/routes/[component]/Showcase/ContentInput/index.svelte +11 -13
  56. package/src/routes/[component]/Showcase/TableAdvanced/index.svelte +108 -418
@@ -14,9 +14,10 @@ import {
14
14
  json_to_csv,
15
15
  csv_to_json,
16
16
  create_unique_id,
17
- set_closurable,
18
- get_data_type_at_path,
19
- set_content_variables,
17
+ set_definition_stack,
18
+ set_def,
19
+ get_def_from_variable_path,
20
+ variables_data_type_remaining_to_astc,
20
21
  } from "../../client/index.js"
21
22
  import { tick } from "svelte"
22
23
  import { browser } from "$app/environment"
@@ -26,12 +27,11 @@ import { browser } from "$app/environment"
26
27
  export function create_table_advanced_manager(config) {
27
28
  const id = create_unique_id(null, 20)
28
29
 
29
- let variables = $derived(set_closurable(config?.variables, null))
30
- let loops = $derived(set_closurable(config?.loops, null))
31
-
30
+ let mapkit_js_token = $state(null)
31
+ let definition_stack = $state(null)
32
+ let row_iter_identifier = $state(null)
32
33
  let rows_data_from_variable_path = $state(null)
33
34
  let row_input_content = $state(null)
34
- let variables_data_type = $state(null)
35
35
  let is_data_editable = $state(null)
36
36
  let nav_items = $state(null)
37
37
  let is_paginate = $state(null)
@@ -96,6 +96,7 @@ export function create_table_advanced_manager(config) {
96
96
  let column_edit_input_manager = $state(null)
97
97
  let column_edit_upsert_column_button_manager = $state(null)
98
98
 
99
+ let row_edit_def_identifier = $state("edit_row_1001234")
99
100
  let row_edit_index = $state(null)
100
101
  let preempt_insert_row_popover_manager = $state(null)
101
102
  let row_edit_content_manager = $state(null)
@@ -107,29 +108,10 @@ export function create_table_advanced_manager(config) {
107
108
  let is_loading_rows = $state(false)
108
109
  let loading_rows_progress = $state(0)
109
110
 
110
- let row_data_type = $derived(
111
- get_data_type(variables_data_type, config?.val?.rows_data_from_variable_path ?? null)?.items
112
- )
113
-
114
- let mapkit_js_token = $derived(set_closurable(config?.mapkit_js_token, null))
115
-
116
- function get_data_type(variables_data_type, data) {
117
- let full_data_type = {
118
- name: "Object",
119
- type: "object_literal",
120
- properties: {
121
- variables: variables_data_type,
122
- loops: { type: "loop" },
123
- },
124
- }
125
- return get_data_type_at_path(data, full_data_type)
126
- }
127
-
111
+ let rows_data = $derived(get_def_from_variable_path(rows_data_from_variable_path, definition_stack))
128
112
  let row_indexes_display_order = $derived(get_available_row_indexes())
129
113
  let row_indexes_display_order_shown = $derived(get_row_indexes_shown())
130
114
 
131
- let rows_data = $derived(get_variable_from_path(set_closurable(rows_data_from_variable_path, null)))
132
-
133
115
  let cur_page_to_use = $derived(
134
116
  !Array.isArray(row_indexes_display_order) || row_indexes_display_order.length < rows_per_page_dropdown_manager?.val
135
117
  ? 1
@@ -144,27 +126,6 @@ export function create_table_advanced_manager(config) {
144
126
  : []
145
127
  )
146
128
 
147
- function get_variable_from_path(path, combined_variables_input = null) {
148
- if (Array.isArray(path)) {
149
- let combined_variables_loc = deep_copy(
150
- combined_variables_input ?? {
151
- variables: variables,
152
- loops: loops,
153
- }
154
- )
155
- for (let path_item of path) {
156
- if (Array.isArray(path_item)) {
157
- let sub_val_from_path = get_variable_from_path(path_item)
158
- combined_variables_loc = combined_variables_loc?.[sub_val_from_path]
159
- } else {
160
- combined_variables_loc = combined_variables_loc?.[path_item]
161
- }
162
- }
163
- return combined_variables_loc
164
- }
165
- return null
166
- }
167
-
168
129
  function get_available_row_indexes() {
169
130
  let row_indexes = []
170
131
  if (
@@ -185,7 +146,7 @@ export function create_table_advanced_manager(config) {
185
146
  // for (let sort_by_item of sort_by_input_manager?.val) {
186
147
  // // sort_by_item?.is_ascending
187
148
  // // sort_by_item?.data_row_variable_path
188
- // // const val_at_path = get_variable_from_path(sort_by_item?.data_row_variable_path)
149
+ // // const val_at_path = get_def_from_variable_path(sort_by_item?.data_row_variable_path)
189
150
  // }
190
151
  // }
191
152
  return row_indexes
@@ -205,6 +166,7 @@ export function create_table_advanced_manager(config) {
205
166
  const raf = () => (browser ? new Promise(requestAnimationFrame) : new Promise((r) => setTimeout(r, 0)))
206
167
 
207
168
  async function set_rows_prepped(columns_prepped_input) {
169
+ console.log("set_rows_prepped", rows_data)
208
170
  is_loading_rows = true
209
171
  rows_prepped = []
210
172
  loading_rows_progress = 0
@@ -229,9 +191,9 @@ export function create_table_advanced_manager(config) {
229
191
  }
230
192
 
231
193
  function get_row_prepped(columns_prepped_input, row_data, row_i) {
194
+ console.log("get_row_prepped", { row_data, row_i, ds: [{ [row_iter_identifier]: row_i }, ...definition_stack] })
232
195
  let searchable_text = ""
233
196
  let columns_prepped_loc = {}
234
-
235
197
  if (Array.isArray(column_ids_display_order)) {
236
198
  for (let column_id of column_ids_display_order) {
237
199
  let content_manager = create_content_manager({
@@ -242,8 +204,7 @@ export function create_table_advanced_manager(config) {
242
204
  config?.on_event(input)
243
205
  }
244
206
  },
245
- variables: () => variables,
246
- loops: [row_i, ...(Array.isArray(loops) ? loops : [])],
207
+ definition_stack: [{ [row_iter_identifier]: row_i }, ...definition_stack],
247
208
  // storage_path: () => storage_path,
248
209
  // is_dark_theme: () => is_dark_theme,
249
210
  })
@@ -312,8 +273,7 @@ export function create_table_advanced_manager(config) {
312
273
  config?.on_change(input)
313
274
  }
314
275
  },
315
- variables: () => variables,
316
- loops: loops,
276
+ definition_stack: definition_stack,
317
277
  // storage_path: () => storage_path,
318
278
  // is_dark_theme: () => is_dark_theme,
319
279
  })
@@ -407,12 +367,9 @@ export function create_table_advanced_manager(config) {
407
367
  column_input_options: config?.column_input_options,
408
368
  table_options: config?.table_options,
409
369
  on_search_table_row_ids: config?.on_search_table_row_ids,
410
- variables_data_type: () => variables_data_type,
411
- variables: () => variables,
412
- loops: () => loops,
370
+ definition_stack: definition_stack,
413
371
  columns: () => columns_prepped,
414
372
  rows_data_from_variable_path: () => rows_data_from_variable_path,
415
- row_data_type: () => row_data_type,
416
373
  on_delete: async () => {
417
374
  if (typeof config?.on_event == "function") {
418
375
  const res = await config?.on_event({
@@ -512,44 +469,28 @@ export function create_table_advanced_manager(config) {
512
469
 
513
470
  function edit_row(row_i) {
514
471
  row_edit_index = row_i
515
- let variables_combined_loc = $state(
516
- deep_copy({
517
- variables,
518
- loops: loops,
519
- })
520
- )
521
- const path_to_set = [...rows_data_from_variable_path, typeof row_i == "number" ? row_i : 0]
522
- if (typeof row_i != "number") {
523
- let row_default_to_insert = null //tbd
524
- let target = variables_combined_loc
525
- for (let i = 0; i < path_to_set.length - 1; i++) {
526
- target = target[path_to_set[i]]
527
- if (target === undefined) break
528
- }
529
- const last_key = path_to_set[path_to_set.length - 1]
530
- if (Array.isArray(target[last_key])) {
531
- target[last_key].splice(0, 0, row_default_to_insert)
532
- } else {
533
- target[last_key] = row_default_to_insert
534
- }
472
+ const path_to_set = [...rows_data_from_variable_path, Number.isInteger(row_i) ? row_i : 0]
473
+ let editable_row = null
474
+ if (!Number.isInteger(row_i)) {
475
+ console.log("columns_prepped", columns_prepped)
476
+ editable_row = {}
477
+ } else {
478
+ editable_row = get_def_from_variable_path([...rows_data_from_variable_path, row_i], definition_stack)
535
479
  }
480
+ let row_definition_stack = $state([{ [row_edit_def_identifier]: editable_row }, ...definition_stack])
536
481
  row_edit_content_manager = null
537
482
  setTimeout(() => {
538
483
  // quick fix for when update row then edit a diff row the data for other doesnt remain in place
539
484
  row_edit_content_manager = create_content_manager({
540
485
  val: row_input_content ?? null,
541
- storage_items: null, // tbd
542
- table_options: config?.table_options,
486
+ definition_stack: row_definition_stack,
543
487
  mapkit_js_token: mapkit_js_token,
488
+ storage_items: null, // tbd
544
489
  on_search_table_row_ids: config?.on_search_table_row_ids,
545
- variables_data_type: () => variables_data_type,
546
- variables: () => variables_combined_loc?.variables,
547
- loops: () => [row_i ?? 0, ...(Array.isArray(loops) ? loops : [])],
548
490
  on_event: (input) => {
549
- console.log("on_event00", input)
550
- const res = set_content_variables(input, variables_combined_loc)
551
- variables_combined_loc.variables = res?.variables
552
- const row_data = get_variable_from_path(path_to_set, variables_combined_loc)
491
+ const res = set_definition_stack(input, row_definition_stack)
492
+ row_definition_stack = res?.definition_stack
493
+ const row_data = get_def_from_variable_path([row_edit_def_identifier], row_definition_stack)
553
494
  return {
554
495
  is_success: true,
555
496
  data: {
@@ -561,12 +502,13 @@ export function create_table_advanced_manager(config) {
561
502
  })
562
503
  let upsert_row_is_loading = $state(false)
563
504
  row_edit_upsert_row_button_manager = create_button_manager({
564
- text: typeof row_i == "number" ? "Update Row" : "Insert Row",
505
+ text: Number.isInteger(row_i) ? "Update Row" : "Insert Row",
565
506
  is_loading: () => upsert_row_is_loading,
566
507
  on_click: async () => {
567
508
  upsert_row_is_loading = true
568
- const row_data = get_variable_from_path(path_to_set, variables_combined_loc)
569
- if (typeof row_i == "number") {
509
+ const row_data = get_def_from_variable_path([row_edit_def_identifier], row_definition_stack)
510
+ console.log("edited_row", { row_i, row_data })
511
+ if (Number.isInteger(row_i)) {
570
512
  if (typeof config?.on_event == "function") {
571
513
  const res = await config?.on_event({
572
514
  type: "update_row",
@@ -601,6 +543,7 @@ export function create_table_advanced_manager(config) {
601
543
  row: row_data,
602
544
  path: path_to_set,
603
545
  })
546
+ console.log("insert_row_res", { res, columns_prepped })
604
547
  if (res?.is_success) {
605
548
  preempt_insert_row_popover_manager.show_temp_message(
606
549
  "Successfully inserted row",
@@ -675,10 +618,81 @@ export function create_table_advanced_manager(config) {
675
618
  })
676
619
  }
677
620
 
621
+ function guess_row_input_content(columns) {
622
+ return {
623
+ type_id: "div",
624
+ selector_id: create_unique_id(null, 8),
625
+ children: Object.entries(columns || {})
626
+ .sort(([a_column_id, a_val], [b_column_id, b_val]) => {
627
+ const a_order = a_val?.display_order ?? 0
628
+ const b_order = b_val?.display_order ?? 0
629
+ return a_order - b_order
630
+ })
631
+ .map(([column_id, val]) => {
632
+ if (val?.is_autogenerated) {
633
+ // let guessed_column_display_content = variables_data_type_remaining_to_astc(val?.db_data_type, "display", [
634
+ // "variables",
635
+ // "rows",
636
+ // ["row_i"],
637
+ // column_id,
638
+ // ])
639
+ return {
640
+ type_id: "div",
641
+ selector_id: create_unique_id(null, 8),
642
+ children: [
643
+ {
644
+ type_id: "span",
645
+ selector_id: create_unique_id(null, 8),
646
+ children: [
647
+ {
648
+ type_id: "strong",
649
+ selector_id: create_unique_id(null, 8),
650
+ children: [],
651
+ attributes: { content: column_id },
652
+ },
653
+ {
654
+ type_id: "em",
655
+ selector_id: create_unique_id(null, 8),
656
+ children: [],
657
+ attributes: { content: " autogenerated " },
658
+ },
659
+ ],
660
+ attributes: {},
661
+ },
662
+ // guessed_column_display_content,
663
+ {
664
+ type_id: "br",
665
+ selector_id: create_unique_id(null, 8),
666
+ children: [],
667
+ attributes: {},
668
+ },
669
+ ],
670
+ attributes: {},
671
+ }
672
+ } else {
673
+ let guessed_column_input_content = variables_data_type_remaining_to_astc(val?.db_data_type, "input", [
674
+ row_edit_def_identifier,
675
+ column_id,
676
+ ])
677
+ if (guessed_column_input_content?.hasOwnProperty("attributes")) {
678
+ if (!guessed_column_input_content.attributes) {
679
+ guessed_column_input_content.attributes = {}
680
+ }
681
+ guessed_column_input_content.attributes.label = column_id
682
+ }
683
+ return {
684
+ type_id: "div",
685
+ selector_id: create_unique_id(null, 8),
686
+ children: [guessed_column_input_content],
687
+ attributes: {},
688
+ }
689
+ }
690
+ }),
691
+ }
692
+ }
693
+
678
694
  function set_attributes(attributes) {
679
695
  rows_data_from_variable_path = attributes?.rows_data_from_variable_path
680
- row_input_content = attributes?.row_input_content
681
- variables_data_type = attributes?.variables_data_type
682
696
  is_data_editable = attributes?.is_data_editable ?? false
683
697
  nav_items = Array.isArray(attributes?.nav_items)
684
698
  ? attributes.nav_items.filter((item) =>
@@ -701,12 +715,28 @@ export function create_table_advanced_manager(config) {
701
715
  table_row_max_height = attributes?.table_row_max_height ?? null
702
716
  const columns_prepped_loc = set_columns_prepped(attributes?.columns)
703
717
  set_rows_prepped(columns_prepped_loc)
718
+ row_input_content = attributes?.row_input_content ?? guess_row_input_content(attributes?.columns)
719
+ }
720
+
721
+ function reset_definition_stack(input) {
722
+ console.log("reset_definition_stack", deep_copy(input))
723
+ definition_stack = input
724
+ set_rows_prepped(columns_prepped)
725
+ }
726
+
727
+ function set_columns(input) {
728
+ set_columns_prepped(input)
729
+ set_rows_prepped(columns_prepped)
704
730
  }
705
731
 
706
732
  function init(config) {
707
733
  table_id = config?.table_id
708
734
  table_name = config?.table_name
709
735
  table_description = config?.table_description
736
+ rows_data_from_variable_path = config?.rows_data_from_variable_path
737
+ row_iter_identifier = config?.row_iter_identifier ?? "row_i"
738
+ definition_stack = config?.definition_stack
739
+ mapkit_js_token = config?.mapkit_js_token
710
740
  set_attributes(config)
711
741
  table_search_text_input_manager = create_text_input_manager({
712
742
  type: "search",
@@ -1313,9 +1343,6 @@ export function create_table_advanced_manager(config) {
1313
1343
  get columns_prepped() {
1314
1344
  return columns_prepped
1315
1345
  },
1316
- get variables() {
1317
- return variables
1318
- },
1319
1346
  get bulk_select_all_rows_toggle_checkbox_manager() {
1320
1347
  return bulk_select_all_rows_toggle_checkbox_manager
1321
1348
  },
@@ -1406,9 +1433,6 @@ export function create_table_advanced_manager(config) {
1406
1433
  get settings_delete_table_button_manager() {
1407
1434
  return settings_delete_table_button_manager
1408
1435
  },
1409
- get variables_data_type() {
1410
- return variables_data_type
1411
- },
1412
1436
  init,
1413
1437
  set_table_search_text_input,
1414
1438
  set_rows_prepped,
@@ -1418,5 +1442,7 @@ export function create_table_advanced_manager(config) {
1418
1442
  download_csv,
1419
1443
  copy_structure,
1420
1444
  set_attributes,
1445
+ reset_definition_stack,
1446
+ set_columns,
1421
1447
  }
1422
1448
  }
@@ -230,6 +230,18 @@ export function create_text_input_manager(config) {
230
230
 
231
231
  function set_type(input) {
232
232
  type = input
233
+ if (typeof window === "undefined") {
234
+ return
235
+ }
236
+ is_text_hidden = !!input
237
+ let input_el = document?.querySelector(`#input_${id}`)
238
+ if (input_el) {
239
+ if (!!input) {
240
+ input_el.type = "text"
241
+ } else {
242
+ input_el.type = input
243
+ }
244
+ }
233
245
  }
234
246
 
235
247
  async function finish() {
@@ -2,108 +2,62 @@
2
2
  import Popover from "../Popover/index.svelte"
3
3
  import Button from "../Button/index.svelte"
4
4
  import TextInput from "../TextInput/index.svelte"
5
- import Checkbox from "../Checkbox/index.svelte"
6
- import Icon from "../Icon/index.svelte"
5
+ import Dropdown from "../Dropdown/index.svelte"
7
6
  import Spacer from "../Spacer/index.svelte"
8
- import Self from './index.svelte'
7
+ import Self from "./index.svelte"
9
8
 
10
9
  let { manager } = $props()
11
10
  </script>
12
11
 
13
- {#snippet val_display()}
14
- {#if Array.isArray(manager?.val)}
12
+ <Button manager={manager?.open_edit_button_manager} />
13
+ <Popover manager={manager?.popover_manager}>
14
+ {#snippet content()}
15
15
  <div>
16
- <div style="display: flex; flex-wrap: wrap; gap: .5rem;">
17
- [
18
- {#if manager?.val.length < 1}
19
- /
20
- {:else}
21
- {#each manager?.val as path_item, i}
22
- {#if Array.isArray(path_item)}
23
- [{path_item}]
24
- {:else}
25
- {path_item}
26
- {/if}
27
- {#if i < manager?.val.length - 1}
28
- <div style="display: flex; align-items: center;">
29
- <Icon manager={manager?.arrow_icon_manager} />
16
+ {#if manager?.levels_nested}
17
+ <p>{manager?.levels_nested} levels nested</p>
18
+ {/if}
19
+ <p>{manager?.val_text}</p>
20
+ <Dropdown manager={manager?.def_dropdown_manager} />
21
+ {#if manager?.def_dropdown_manager?.val}
22
+ <Button manager={manager?.add_path_item_button_manager} />
23
+ <p class="label">Path Items (optional)</p>
24
+ {#if Array.isArray(manager?.path_prepped) && manager?.path_prepped.length > 0}
25
+ {#each manager?.path_prepped as path_item}
26
+ <div>
27
+ <div style="display: flex; gap: 1rem">
28
+ <Button manager={path_item?.remove_path_item_button_manager} />
29
+ <Button manager={path_item?.insert_path_item_before_button_manager} />
30
+ <Dropdown manager={path_item?.type_dropdown_manager} />
30
31
  </div>
31
- {/if}
32
+ {#if path_item?.type_dropdown_manager?.val == "variable"}
33
+ <div style="margin-top: 1rem;">
34
+ <Self manager={path_item?.variable_path_input_manager} />
35
+ </div>
36
+ {:else if path_item?.type_dropdown_manager?.val == "string"}
37
+ <TextInput manager={path_item?.const_string_value_text_input_manager} />
38
+ {:else if path_item?.type_dropdown_manager?.val == "number"}
39
+ <TextInput manager={path_item?.const_number_value_text_input_manager} />
40
+ {/if}
41
+ {#if Array.isArray(path_item?.key_options)}
42
+ <div style="margin-top: 1rem;">
43
+ <p class="label">Next Path Options</p>
44
+ <div style="display: flex; flex-wrap: wrap; gap: .5rem;">
45
+ {#each path_item?.key_options as key_option}
46
+ <Button manager={key_option?.select_button_manager} />
47
+ {/each}
48
+ </div>
49
+ </div>
50
+ {/if}
51
+ </div>
52
+ <Spacer mt={1} mb={1} />
32
53
  {/each}
33
- {/if}
34
- ]
35
- </div>
36
- </div>
37
- {:else}
38
- <p style="color: var(--warning-t);">null</p>
39
- {/if}
40
- {/snippet}
41
-
42
- {#snippet variable_path_input()}
43
- <div>
44
- <h4 class="label" style="margin: 0;">Data Type at Path</h4>
45
- <p>{manager?.data_type_at_path?.type}</p>
46
- {#if Array.isArray(manager?.val_prepped)}
47
- <h4 class="label" style="margin: 0;">Val</h4>
48
- {@render val_display()}
49
- <Spacer mt={.5} mb={.5} />
50
- <div style="display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem;">
51
- {#if manager?.val != null}
52
- <Button manager={manager?.set_null_button_manager} />
53
54
  {:else}
54
- <Button manager={manager?.set_root_path_button_manager} />
55
+ <p>No Path Items</p>
55
56
  {/if}
56
- {#each manager?.val_prepped as path_item_prepped}
57
- <Button manager={path_item_prepped?.remove_path_button_manager} />
58
- {/each}
59
- </div>
60
- {/if}
61
- <Spacer mt={.5} mb={.5} />
62
- <h4 class="label" style="margin: 0;">Next Path Item Options</h4>
63
- {#if manager?.is_allow_dynamic_path_item}
64
- <Checkbox manager={manager?.is_dynamic_path_item_checkbox_manager} />
65
- {#if manager?.is_dynamic_path_item_checkbox_manager?.val && manager?.next_path_variable_path_input_manager}
66
- <Self manager={manager?.next_path_variable_path_input_manager} />
67
57
  {/if}
68
- {/if}
69
- {#if !manager?.is_allow_dynamic_path_item || !manager?.is_dynamic_path_item_checkbox_manager?.val}
70
- {#if manager?.next_path_options?.type == "loop"}
71
- <TextInput manager={manager?.next_path_options?.number_input_manager} />
72
- <Button manager={manager?.next_path_options?.add_path_item_button_manager} />
73
- {:else if manager?.next_path_options?.type == "object_literal"}
74
- {#if Array.isArray(manager?.next_path_options?.options) && manager?.next_path_options.options?.length > 0}
75
- <div style="display: flex; flex-wrap: wrap; gap: .5rem;">
76
- {#each manager?.next_path_options?.options as option}
77
- <Button manager={option?.option_button_manager} />
78
- {/each}
79
- </div>
80
- {:else}
81
- <p>No options found</p>
82
- {/if}
83
- {:else}
84
- <p>No additional path item options found</p>
85
- {/if}
86
- {/if}
87
- </div>
88
- {/snippet}
89
-
90
- {#if !manager?.is_popover}
91
- {@render variable_path_input()}
92
- {:else}
93
- {#if Array.isArray(manager?.val)}
94
- <div style="display: flex; gap: .5rem;">
95
- {@render val_display()}
96
- <Button manager={manager?.small_popover_toggle_button_manager} />
97
58
  </div>
98
- {:else}
99
- <Button manager={manager?.popover_toggle_button_manager} />
100
- {/if}
101
- <Popover manager={manager.popover_manager}>
102
- {#snippet content()}
103
- {@render variable_path_input()}
104
- {/snippet}
105
- {#snippet footer()}
106
- <Button manager={manager?.finish_button_manager} />
107
- {/snippet}
108
- </Popover>
109
- {/if}
59
+ {/snippet}
60
+ {#snippet footer()}
61
+ <Button manager={manager?.finish_button_manager} />
62
+ {/snippet}
63
+ </Popover>