mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
refactor: use class directive in TextInput
, DatePickerInput
(#1426)
Dynamically-formed class names should be avoided for easier static analysis. The Svelte `class:` directive should be used instead.
This commit is contained in:
parent
d2cc75d883
commit
45f14f160e
2 changed files with 4 additions and 2 deletions
|
@ -116,7 +116,8 @@
|
|||
: $inputValue}"
|
||||
class:bx--date-picker__input="{true}"
|
||||
class:bx--date-picker__input--invalid="{invalid}"
|
||||
class="{size && `bx--date-picker__input--${size}`}"
|
||||
class:bx--date-picker__input--sm="{size === 'sm'}"
|
||||
class:bx--date-picker__input--xl="{size === 'xl'}"
|
||||
on:input
|
||||
on:input="{({ target }) => {
|
||||
updateValue({ type: 'input', value: target.value });
|
||||
|
|
|
@ -146,7 +146,8 @@
|
|||
class:bx--visually-hidden="{hideLabel}"
|
||||
class:bx--label--disabled="{disabled}"
|
||||
class:bx--label--inline="{inline}"
|
||||
class="{inline && !!size && `bx--label--inline--${size}`}"
|
||||
class:bx--label--inline-sm="{inline && size === 'sm'}"
|
||||
class:bx--label--inline-xl="{inline && size === 'xl'}"
|
||||
>
|
||||
<slot name="labelText">
|
||||
{labelText}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue