refactor: prefer class directive over class attribute (#1318)

This commit is contained in:
metonym 2022-05-29 08:16:27 -07:00 committed by GitHub
commit 0801e1d078
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 18 deletions

View file

@ -247,10 +247,11 @@
class:bx--date-picker="{true}"
class:bx--date-picker--short="{short}"
class:bx--date-picker--light="{light}"
class="{datePickerType && `bx--date-picker--${datePickerType}`}
{datePickerType === 'range' &&
$labelTextEmpty &&
'bx--date-picker--nolabel'}"
class:bx--date-picker--simple="{datePickerType === 'simple'}"
class:bx--date-picker--single="{datePickerType === 'single'}"
class:bx--date-picker--range="{datePickerType === 'range'}"
class:bx--date-picker--nolabel="{datePickerType === 'range' &&
$labelTextEmpty}"
on:keydown="{(e) => {
if (calendar?.isOpen && e.key === 'Escape') {
e.stopPropagation();