@humandialog/forms.svelte 0.4.9 → 0.4.10

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.
@@ -17,7 +17,9 @@ export let icon = false;
17
17
  export let placeholder = "Choose wisely...";
18
18
  export let s = "sm";
19
19
  export let c = "";
20
- let is_table_component = getContext("rIs-table-component");
20
+ export let compact = false;
21
+ export let in_context = "sel";
22
+ let is_compact = getContext("rIs-table-component") || compact;
21
23
  let definition = new rCombo_definition();
22
24
  setContext("rCombo-definition", definition);
23
25
  let is_dropdown_open = false;
@@ -40,7 +42,7 @@ switch (s) {
40
42
  break;
41
43
  }
42
44
  let appearance_class;
43
- if (is_table_component)
45
+ if (is_compact)
44
46
  appearance_class = ` text-gray-900 text-sm
45
47
  focus:ring-primary-600 block w-full ${input_pb} ${input_pt} px-2.5 dark:bg-gray-700
46
48
  dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500`;
@@ -53,7 +55,7 @@ let ctx = context ? context : getContext("ctx");
53
55
  let can_be_activated = true;
54
56
  let last_tick = -1;
55
57
  $:
56
- setup($data_tick_store);
58
+ setup($data_tick_store, $context_items_store);
57
59
  function setup(...args) {
58
60
  if ($data_tick_store <= last_tick)
59
61
  return;
@@ -64,8 +66,8 @@ function setup(...args) {
64
66
  if (!label)
65
67
  label = a;
66
68
  tick_request_internal = tick_request_internal + 1;
67
- if (is_table_component) {
68
- if ($context_items_store["sel"] != self)
69
+ if (is_compact) {
70
+ if ($context_items_store[in_context] != self)
69
71
  can_be_activated = false;
70
72
  else
71
73
  can_be_activated = true;
@@ -209,7 +211,7 @@ function get_combo_text() {
209
211
  if (found)
210
212
  return found.Name ?? found.Key;
211
213
  else
212
- return !is_table_component ? placeholder : "";
214
+ return !is_compact ? placeholder : "";
213
215
  } else
214
216
  return textbox.innerHTML;
215
217
  }
@@ -430,7 +432,7 @@ function setup_view(...args) {
430
432
 
431
433
  <div class={cs}
432
434
  on:focusout={(e) => setTimeout(() => {hide()}, 100)}>
433
- {#if !is_table_component}
435
+ {#if !is_compact}
434
436
  <label for="name" class="block {label_mb} text-xs font-small text-gray-900 dark:text-white">{label}</label>
435
437
  {/if}
436
438
  <!-- svelte-ignore a11y-click-events-have-key-events -->
@@ -12,6 +12,8 @@ declare const __propDef: {
12
12
  placeholder?: string | undefined;
13
13
  s?: string | undefined;
14
14
  c?: string | undefined;
15
+ compact?: boolean | undefined;
16
+ in_context?: string | undefined;
15
17
  };
16
18
  events: {
17
19
  [evt: string]: CustomEvent<any>;
@@ -87,7 +87,7 @@ $: {
87
87
  {/if}
88
88
  </div>
89
89
 
90
- <style>
90
+ <!--style>
91
91
  svg {
92
92
  stroke: currentColor;
93
93
  fill: currentColor;
@@ -97,4 +97,4 @@ $: {
97
97
  max-height: 100%;
98
98
  }
99
99
 
100
- </style>
100
+ </style-->
package/desk.svelte CHANGED
@@ -28,8 +28,6 @@
28
28
 
29
29
  if(layout.dark != undefined)
30
30
  {
31
- console.log('layout.dark', layout.dark)
32
-
33
31
  if(layout.dark.optional)
34
32
  layout.mainToolbar.darkMode = true;
35
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humandialog/forms.svelte",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "Basic Svelte UI components for Object Reef applications",
5
5
  "devDependencies": {
6
6
  "@playwright/test": "^1.28.1",
package/page.svelte CHANGED
@@ -92,7 +92,6 @@
92
92
 
93
93
  function clear_selection(e)
94
94
  {
95
- console.log(e, clears_context)
96
95
  if(!clears_context)
97
96
  return;
98
97