Skip to content

Commit

Permalink
fix: allowing for reactive classes for Autocomplete, Currency, DatePi…
Browse files Browse the repository at this point in the history
…cker, InputNumber
  • Loading branch information
N00nDay committed Oct 4, 2023
1 parent b4a0228 commit d5238fb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/autocomplete/Autocomplete.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
setContext('autocomplete-mobile', isMobile);
setContext('autocomplete-actual-value', value);
const finalClass = twMerge(defaultClass, $$props.class);
$: finalClass = twMerge(defaultClass, $$props.class);
</script>

<div
Expand Down
6 changes: 2 additions & 4 deletions src/lib/components/currency/Currency.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@
value = undefined;
}
const finalClass = twMerge(
'stwui-currency-wrapper',
const defaultClass = 'stwui-currency-wrapper';
$$props.class
);
$: finalClass = twMerge(defaultClass, $$props.class);
setContext('currency-name', name);
setContext('currency-error', currentError);
Expand Down
7 changes: 2 additions & 5 deletions src/lib/components/datepicker/DateInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,8 @@
setContext('datepicker-name', name);
setContext('datepicker-error', currentError);
const finalClass = twMerge(
'stwui-datepicker-wrapper',
$$props.class
);
const defaultClass = 'stwui-datepicker-wrapper';
$: finalClass = twMerge(defaultClass, $$props.class);
onMount(() => {
valueDayJS = value === null ? null : dayjs(value);
Expand Down
7 changes: 2 additions & 5 deletions src/lib/components/input-number/InputNumber.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@
}
}
const finalClass = twMerge(
'stwui-input-number',
$$props.class
);
const defaultClass = 'stwui-input-number';
$: finalClass = twMerge(defaultClass, $$props.class);
setContext('input-number-name', name);
setContext('input-number-error', currentError);
Expand Down

0 comments on commit d5238fb

Please sign in to comment.