@humandialog/forms.svelte 0.4.9 → 0.4.11

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,10 +55,8 @@ 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
- if ($data_tick_store <= last_tick)
59
- return;
60
60
  last_tick = $data_tick_store;
61
61
  item = self ?? $context_items_store[ctx];
62
62
  if (!typename)
@@ -64,8 +64,8 @@ function setup(...args) {
64
64
  if (!label)
65
65
  label = a;
66
66
  tick_request_internal = tick_request_internal + 1;
67
- if (is_table_component) {
68
- if ($context_items_store["sel"] != self)
67
+ if (is_compact) {
68
+ if ($context_items_store[in_context] != self)
69
69
  can_be_activated = false;
70
70
  else
71
71
  can_be_activated = true;
@@ -209,7 +209,7 @@ function get_combo_text() {
209
209
  if (found)
210
210
  return found.Name ?? found.Key;
211
211
  else
212
- return !is_table_component ? placeholder : "";
212
+ return !is_compact ? placeholder : "";
213
213
  } else
214
214
  return textbox.innerHTML;
215
215
  }
@@ -430,7 +430,7 @@ function setup_view(...args) {
430
430
 
431
431
  <div class={cs}
432
432
  on:focusout={(e) => setTimeout(() => {hide()}, 100)}>
433
- {#if !is_table_component}
433
+ {#if !is_compact}
434
434
  <label for="name" class="block {label_mb} text-xs font-small text-gray-900 dark:text-white">{label}</label>
435
435
  {/if}
436
436
  <!-- 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.11",
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