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