sveltekit-ui 1.0.13 → 1.0.14

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.
@@ -72,7 +72,9 @@ export function create_content_input_manager(config) {
72
72
 
73
73
  function get_defined_options(selector_id) {
74
74
  const defined_at_selector_id = get_defined_at_selector_id(selector_id)
75
- const defined_data_type = json_to_data_type(Object.assign({}, ...[...definition_stack].reverse()))
75
+ const defined_data_type = json_to_data_type(
76
+ Object.assign({}, ...[...(Array.isArray(definition_stack) ? definition_stack : [])].reverse())
77
+ )
76
78
  return Object.entries({ ...(defined_data_type?.properties || {}), ...defined_at_selector_id }).map(
77
79
  ([key, val]) => ({
78
80
  key,
@@ -39,6 +39,7 @@ export function create_column_input_manager(config) {
39
39
  let column_is_cascade_checkbox_manager = $state(null)
40
40
  let guess_header_content_button_manager = $state(null)
41
41
  let guess_body_content_button_manager = $state(null)
42
+ let definition_stack = $state(null)
42
43
 
43
44
  let default_value = $state(null)
44
45
 
@@ -48,10 +49,10 @@ export function create_column_input_manager(config) {
48
49
  let delete_column_cancel_button_manager = $state(null)
49
50
 
50
51
  let rows_data_from_variable_path = $derived(set_closurable(config?.rows_data_from_variable_path, null))
52
+ let row_iter_identifier = $derived(set_closurable(config?.row_iter_identifier, "row_i"))
51
53
  let columns = $derived(set_closurable(config?.columns, null))
52
54
  let columns_length = $derived(Object.keys(columns || {}).length)
53
55
  let column_id = $derived(set_closurable(config?.column_id, null))
54
- let definition_stack = $derived(set_closurable(config?.definition_stack, null))
55
56
  let is_column_update = $derived(set_closurable(config?.is_column_update, true))
56
57
  let column_input_options = $derived(set_closurable(config?.column_input_options, null))
57
58
 
@@ -104,8 +105,13 @@ export function create_column_input_manager(config) {
104
105
  is_cascade: column_is_cascade_checkbox_manager?.val,
105
106
  })
106
107
 
108
+ function reset_definition_stack(input) {
109
+ definition_stack = input
110
+ }
111
+
107
112
  function init(config) {
108
113
  console.log("column_input_init", config)
114
+ definition_stack = config?.definition_stack
109
115
  column_id_text_input_manager = create_text_input_manager({
110
116
  label: "Column ID",
111
117
  val: config?.column_id ?? config?.val?.id ?? null,
@@ -124,7 +130,7 @@ export function create_column_input_manager(config) {
124
130
  val: config?.val?.body_content ?? null,
125
131
  storage: config?.storage,
126
132
  storage_default_folder_path: null,
127
- definition_stack: () => definition_stack,
133
+ definition_stack: definition_stack,
128
134
  on_event: (input) => {
129
135
  console.log("set_definition_stack_tbd33")
130
136
  set_definition_stack(input)
@@ -195,7 +201,7 @@ export function create_column_input_manager(config) {
195
201
  val: default_content_input_astc,
196
202
  table_options: config?.table_options,
197
203
  on_search_table_row_ids: config?.on_search_table_row_ids,
198
- definition_stack: () => definition_stack,
204
+ definition_stack: definition_stack,
199
205
  on_event: (input) => {
200
206
  const res = set_definition_stack(
201
207
  input,
@@ -277,7 +283,11 @@ export function create_column_input_manager(config) {
277
283
  let guessed_column_display_content = variables_data_type_remaining_to_astc(
278
284
  column_db_data_type_input_manager?.val,
279
285
  "display",
280
- ["rows", ["row_i"], column_id_text_input_manager.val]
286
+ [
287
+ ...(Array.isArray(rows_data_from_variable_path) ? rows_data_from_variable_path : []),
288
+ [row_iter_identifier],
289
+ column_id_text_input_manager.val,
290
+ ]
281
291
  )
282
292
  console.log("guessed_column_display_content", guessed_column_display_content)
283
293
  body_content_input_manager.add_version(guessed_column_display_content)
@@ -442,5 +452,6 @@ export function create_column_input_manager(config) {
442
452
  get columns_length() {
443
453
  return columns_length
444
454
  },
455
+ reset_definition_stack,
445
456
  }
446
457
  }
@@ -364,12 +364,13 @@ export function create_table_advanced_manager(config) {
364
364
  foreign_table_id: column?.foreign_table_id,
365
365
  is_cascade: column?.is_cascade,
366
366
  },
367
+ row_iter_identifier: row_iter_identifier,
368
+ rows_data_from_variable_path: rows_data_from_variable_path,
367
369
  column_input_options: config?.column_input_options,
368
370
  table_options: config?.table_options,
369
371
  on_search_table_row_ids: config?.on_search_table_row_ids,
370
372
  definition_stack: definition_stack,
371
373
  columns: () => columns_prepped,
372
- rows_data_from_variable_path: () => rows_data_from_variable_path,
373
374
  on_delete: async () => {
374
375
  if (typeof config?.on_event == "function") {
375
376
  const res = await config?.on_event({
@@ -676,8 +676,6 @@ export function set_definition_stack(input, definition_stack, pass_event_down) {
676
676
  temp[last_key] = input?.value
677
677
  }
678
678
  definition_stack[defined_i][root_key] = defined_variables_loc
679
- console.log("defined_variables_loc112", defined_variables_loc)
680
- console.log("vars_fin", deep_copy(definition_stack))
681
679
  if (typeof pass_event_down === "function") {
682
680
  pass_event_down({
683
681
  value: input.value,
package/dist/index.js CHANGED
@@ -153,6 +153,11 @@ export {
153
153
  astc_to_email_html,
154
154
  variables_data_type_remaining_to_astc,
155
155
  hcl_to_hex,
156
+ get_def,
157
+ get_def_from_variable_path,
158
+ is_defined,
159
+ set_def,
160
+ set_definition_stack,
156
161
  node_types,
157
162
  content_types,
158
163
  acceptable_storage_mime_types,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltekit-ui",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "A SvelteKit UI component library for building modern web applications",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -72,7 +72,9 @@ export function create_content_input_manager(config) {
72
72
 
73
73
  function get_defined_options(selector_id) {
74
74
  const defined_at_selector_id = get_defined_at_selector_id(selector_id)
75
- const defined_data_type = json_to_data_type(Object.assign({}, ...[...definition_stack].reverse()))
75
+ const defined_data_type = json_to_data_type(
76
+ Object.assign({}, ...[...(Array.isArray(definition_stack) ? definition_stack : [])].reverse())
77
+ )
76
78
  return Object.entries({ ...(defined_data_type?.properties || {}), ...defined_at_selector_id }).map(
77
79
  ([key, val]) => ({
78
80
  key,
@@ -39,6 +39,7 @@ export function create_column_input_manager(config) {
39
39
  let column_is_cascade_checkbox_manager = $state(null)
40
40
  let guess_header_content_button_manager = $state(null)
41
41
  let guess_body_content_button_manager = $state(null)
42
+ let definition_stack = $state(null)
42
43
 
43
44
  let default_value = $state(null)
44
45
 
@@ -48,10 +49,10 @@ export function create_column_input_manager(config) {
48
49
  let delete_column_cancel_button_manager = $state(null)
49
50
 
50
51
  let rows_data_from_variable_path = $derived(set_closurable(config?.rows_data_from_variable_path, null))
52
+ let row_iter_identifier = $derived(set_closurable(config?.row_iter_identifier, "row_i"))
51
53
  let columns = $derived(set_closurable(config?.columns, null))
52
54
  let columns_length = $derived(Object.keys(columns || {}).length)
53
55
  let column_id = $derived(set_closurable(config?.column_id, null))
54
- let definition_stack = $derived(set_closurable(config?.definition_stack, null))
55
56
  let is_column_update = $derived(set_closurable(config?.is_column_update, true))
56
57
  let column_input_options = $derived(set_closurable(config?.column_input_options, null))
57
58
 
@@ -104,8 +105,13 @@ export function create_column_input_manager(config) {
104
105
  is_cascade: column_is_cascade_checkbox_manager?.val,
105
106
  })
106
107
 
108
+ function reset_definition_stack(input) {
109
+ definition_stack = input
110
+ }
111
+
107
112
  function init(config) {
108
113
  console.log("column_input_init", config)
114
+ definition_stack = config?.definition_stack
109
115
  column_id_text_input_manager = create_text_input_manager({
110
116
  label: "Column ID",
111
117
  val: config?.column_id ?? config?.val?.id ?? null,
@@ -124,7 +130,7 @@ export function create_column_input_manager(config) {
124
130
  val: config?.val?.body_content ?? null,
125
131
  storage: config?.storage,
126
132
  storage_default_folder_path: null,
127
- definition_stack: () => definition_stack,
133
+ definition_stack: definition_stack,
128
134
  on_event: (input) => {
129
135
  console.log("set_definition_stack_tbd33")
130
136
  set_definition_stack(input)
@@ -195,7 +201,7 @@ export function create_column_input_manager(config) {
195
201
  val: default_content_input_astc,
196
202
  table_options: config?.table_options,
197
203
  on_search_table_row_ids: config?.on_search_table_row_ids,
198
- definition_stack: () => definition_stack,
204
+ definition_stack: definition_stack,
199
205
  on_event: (input) => {
200
206
  const res = set_definition_stack(
201
207
  input,
@@ -277,7 +283,11 @@ export function create_column_input_manager(config) {
277
283
  let guessed_column_display_content = variables_data_type_remaining_to_astc(
278
284
  column_db_data_type_input_manager?.val,
279
285
  "display",
280
- ["rows", ["row_i"], column_id_text_input_manager.val]
286
+ [
287
+ ...(Array.isArray(rows_data_from_variable_path) ? rows_data_from_variable_path : []),
288
+ [row_iter_identifier],
289
+ column_id_text_input_manager.val,
290
+ ]
281
291
  )
282
292
  console.log("guessed_column_display_content", guessed_column_display_content)
283
293
  body_content_input_manager.add_version(guessed_column_display_content)
@@ -442,5 +452,6 @@ export function create_column_input_manager(config) {
442
452
  get columns_length() {
443
453
  return columns_length
444
454
  },
455
+ reset_definition_stack,
445
456
  }
446
457
  }
@@ -364,12 +364,13 @@ export function create_table_advanced_manager(config) {
364
364
  foreign_table_id: column?.foreign_table_id,
365
365
  is_cascade: column?.is_cascade,
366
366
  },
367
+ row_iter_identifier: row_iter_identifier,
368
+ rows_data_from_variable_path: rows_data_from_variable_path,
367
369
  column_input_options: config?.column_input_options,
368
370
  table_options: config?.table_options,
369
371
  on_search_table_row_ids: config?.on_search_table_row_ids,
370
372
  definition_stack: definition_stack,
371
373
  columns: () => columns_prepped,
372
- rows_data_from_variable_path: () => rows_data_from_variable_path,
373
374
  on_delete: async () => {
374
375
  if (typeof config?.on_event == "function") {
375
376
  const res = await config?.on_event({
@@ -676,8 +676,6 @@ export function set_definition_stack(input, definition_stack, pass_event_down) {
676
676
  temp[last_key] = input?.value
677
677
  }
678
678
  definition_stack[defined_i][root_key] = defined_variables_loc
679
- console.log("defined_variables_loc112", defined_variables_loc)
680
- console.log("vars_fin", deep_copy(definition_stack))
681
679
  if (typeof pass_event_down === "function") {
682
680
  pass_event_down({
683
681
  value: input.value,
package/src/lib/index.js CHANGED
@@ -153,6 +153,11 @@ export {
153
153
  astc_to_email_html,
154
154
  variables_data_type_remaining_to_astc,
155
155
  hcl_to_hex,
156
+ get_def,
157
+ get_def_from_variable_path,
158
+ is_defined,
159
+ set_def,
160
+ set_definition_stack,
156
161
  node_types,
157
162
  content_types,
158
163
  acceptable_storage_mime_types,
@@ -389,14 +389,6 @@
389
389
  row_searchable_content: null,
390
390
  })
391
391
 
392
- let row_data_type = {
393
- type: "object_literal",
394
- attributes: {},
395
- properties: Object.fromEntries(Object.entries(data?.columns || {}).map(([key, val]) => [key, val?.db_data_type])),
396
- }
397
-
398
- console.log("row_data_type", row_data_type)
399
-
400
392
  let table_manager = $state(null)
401
393
  let variables = $state({ rows: data?.rows })
402
394
 
@@ -408,7 +400,6 @@
408
400
  table_options: [{ key: "test", name: "Test" }],
409
401
  definition_stack: [{ ...variables }],
410
402
  rows_data_from_variable_path: ["rows"],
411
- row_data_type: row_data_type,
412
403
  row_iter_identifier: "row_i",
413
404
  table_header_max_height: 8,
414
405
  table_row_max_height: 8,