From ce9665a842299d7341a941c2d9c0703c76e9eebd Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Mon, 9 Feb 2026 09:30:34 +0300 Subject: [PATCH] feat(ComboControlV2): merge two version of component into one with reduced prop that regulate appearance --- .../ui/ComboControlV2/ComboControlV2.svelte | 217 +++++++++++++----- 1 file changed, 165 insertions(+), 52 deletions(-) diff --git a/src/shared/ui/ComboControlV2/ComboControlV2.svelte b/src/shared/ui/ComboControlV2/ComboControlV2.svelte index ebbbe8c..6e5126b 100644 --- a/src/shared/ui/ComboControlV2/ComboControlV2.svelte +++ b/src/shared/ui/ComboControlV2/ComboControlV2.svelte @@ -4,11 +4,29 @@ --> -
- - -
-
- {#each Array(5) as _, i} +{#snippet ComboControl()} +
+
+ {#if showScale}
- - { - Number.isInteger(control.step) - ? Math.round(control.min + (i * (control.max - control.min) / 4)) - : (control.min + (i * (control.max - control.min) / 4)).toFixed(2) - } - -
+ {#each Array(5) as _, i} +
+ + {calculateScale(i)} + +
+
+
+ {/each}
- {/each} + {/if} + +
- -
- {#if label} -
-
-
- - {label} - -
- {/if} -
+ {#if label} +
+
+
+ + {label} + +
+ {/if} +
+{/snippet} + +{#if reduced} + {@render ComboControl()} +{:else} + + + + + {#snippet icon({ className })} + + {/snippet} + + + + {#snippet child({ props })} + + {/snippet} + + + {@render ComboControl()} + + + + + {#snippet icon({ className })} + + {/snippet} + + + + {#if controlLabel} + + {controlLabel} + + {/if} + +{/if}