@intechstudio/grid-uikit 1.20260713.1604 → 1.20260714.912
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.
package/dist/MeltRadio.svelte
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
interface option_t {
|
|
6
6
|
title: string;
|
|
7
7
|
value: string | boolean | number; // melt uses string values internally
|
|
8
|
+
disabled?: boolean; // per-option disable; defaults to enabled
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export let options: option_t[];
|
|
@@ -70,34 +71,41 @@
|
|
|
70
71
|
<!-- Convert value to string in case it was originally boolean -->
|
|
71
72
|
{@const value = option.value.toString()}
|
|
72
73
|
{@const title = option.title}
|
|
74
|
+
<!-- Option is disabled if the group is disabled or the option opts in -->
|
|
75
|
+
{@const optionDisabled = disabled || option.disabled === true}
|
|
73
76
|
<label
|
|
74
77
|
class:horizontal-padding={style !== "button"}
|
|
75
|
-
class:disabled
|
|
78
|
+
class:disabled={optionDisabled}
|
|
76
79
|
class="row"
|
|
77
80
|
>
|
|
78
81
|
{#if style === "radio"}
|
|
79
|
-
<button
|
|
80
|
-
|
|
82
|
+
<button
|
|
83
|
+
{...$item({ value, disabled: optionDisabled })}
|
|
84
|
+
use:item
|
|
85
|
+
id={title}
|
|
86
|
+
class:disabled={optionDisabled}
|
|
87
|
+
>
|
|
88
|
+
<div class="style-radio" class:disabled={optionDisabled}>
|
|
81
89
|
<div
|
|
82
90
|
style:display={$isChecked(value) ? "block" : "none"}
|
|
83
91
|
class="style-radio-inside"
|
|
84
|
-
class:disabled
|
|
92
|
+
class:disabled={optionDisabled}
|
|
85
93
|
/>
|
|
86
94
|
</div>
|
|
87
|
-
<span class:disabled>{title}</span>
|
|
95
|
+
<span class:disabled={optionDisabled}>{title}</span>
|
|
88
96
|
</button>
|
|
89
97
|
{/if}
|
|
90
98
|
{#if style === "button"}
|
|
91
99
|
<button
|
|
92
|
-
{...$item(value)}
|
|
100
|
+
{...$item({ value, disabled: optionDisabled })}
|
|
93
101
|
use:item
|
|
94
102
|
id={title}
|
|
95
103
|
class="style-button"
|
|
96
104
|
class:selected={$isChecked(value)}
|
|
97
|
-
class:disabled
|
|
105
|
+
class:disabled={optionDisabled}
|
|
98
106
|
>
|
|
99
107
|
{#if typeof title !== "undefined"}
|
|
100
|
-
<span class:disabled>{title}</span>
|
|
108
|
+
<span class:disabled={optionDisabled}>{title}</span>
|
|
101
109
|
{:else}
|
|
102
110
|
<span style:visibility="hidden">N/A</span>
|
|
103
111
|
{/if}
|
|
@@ -150,6 +150,10 @@
|
|
|
150
150
|
button.grouped {
|
|
151
151
|
border-top-right-radius: 0;
|
|
152
152
|
border-bottom-right-radius: 0;
|
|
153
|
+
/* Cap the label width so a long selected label truncates (…) instead
|
|
154
|
+
of stretching the split button. The button already has
|
|
155
|
+
overflow/ellipsis/nowrap; it just needs a width bound to act on. */
|
|
156
|
+
max-width: 16em;
|
|
153
157
|
}
|
|
154
158
|
|
|
155
159
|
button.style-normal {
|
|
@@ -200,7 +200,9 @@
|
|
|
200
200
|
|
|
201
201
|
.menu {
|
|
202
202
|
z-index: 40;
|
|
203
|
-
width:
|
|
203
|
+
width: -moz-max-content;
|
|
204
|
+
width: max-content;
|
|
205
|
+
min-width: 8em;
|
|
204
206
|
background-color: var(--popover-background);
|
|
205
207
|
color: var(--foreground-muted);
|
|
206
208
|
border: 1px solid var(--foreground-muted);
|
|
@@ -210,7 +212,14 @@
|
|
|
210
212
|
.option {
|
|
211
213
|
cursor: pointer;
|
|
212
214
|
padding: 0.5rem;
|
|
215
|
+
/* Cap width here, not on .menu: floating-ui writes an inline
|
|
216
|
+
max-width on the menu element (fitViewport), which would override
|
|
217
|
+
a stylesheet max-width. The menu is width:max-content, so capping
|
|
218
|
+
the options caps the menu's intrinsic width too. */
|
|
219
|
+
max-width: 20em;
|
|
213
220
|
white-space: nowrap;
|
|
221
|
+
overflow: hidden;
|
|
222
|
+
text-overflow: ellipsis;
|
|
214
223
|
}
|
|
215
224
|
|
|
216
225
|
.option:hover,
|