@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.
@@ -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 {...$item(value)} use:item id={title} class:disabled>
80
- <div class="style-radio" class:disabled>
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}
@@ -15,6 +15,7 @@ declare const MeltRadio: $$__sveltets_2_IsomorphicComponent<{
15
15
  options: {
16
16
  title: string;
17
17
  value: string | boolean | number;
18
+ disabled?: boolean;
18
19
  }[];
19
20
  target: any;
20
21
  orientation?: "vertical" | "horizontal";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intechstudio/grid-uikit",
3
- "version": "1.20260713.1934",
3
+ "version": "1.20260714.912",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/intechstudio/grid-uikit.git"