@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
|
|
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 (
|
|
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 (
|
|
68
|
-
if ($context_items_store[
|
|
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 !
|
|
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 !
|
|
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 -->
|
package/components/icon.svelte
CHANGED
package/desk.svelte
CHANGED
package/package.json
CHANGED