@intechstudio/grid-uikit 1.20260713.1934 → 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 +16 -8
- package/dist/MeltRadio.svelte.d.ts +1 -0
- package/package.json +1 -1
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}
|