Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion webapp/common-react/@dbeaver/ui-kit/src/Select/Select.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

&[aria-disabled='true'] {
opacity: var(--dbv-kit-control-disabled-opacity);
color: var(--dbv-kit-select-disabled-foreground);
background-color: var(--dbv-kit-select-disabled-background);
}
&:focus-visible {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@
color: var(--tw-color-gray-500);
font-size: var(--dbv-kit-select-font-size);
}

.dbv-kit-select[aria-disabled='true'] .dbv-kit-select__arrow-icon {
color: var(--dbv-kit-select-disabled-foreground);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
return getter ? getter(item) : defaultGetter(item);
}

export function SelectField<T, ItemType extends {} = SelectItem<T>>({

Check warning on line 95 in webapp/common-react/@dbeaver/ui-kit/src/Select/SelectField.tsx

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Missing return type on function
items,
value,
onChange,
Expand Down Expand Up @@ -126,7 +126,9 @@
getValueByPath<ItemType, boolean>(item, itemDisabled, i => ('disabled' in i ? Boolean((i as unknown as SelectItem<T>).disabled) : false));

const [selectedValue, setSelectedValue] = useState<T | undefined>(() => {
if (value !== undefined) return value;
if (value !== undefined) {
return value;
}

const firstEnabledItem = items.find(item => !isItemDisabled(item));
return firstEnabledItem ? getItemValue(firstEnabledItem) : undefined;
Expand All @@ -152,7 +154,7 @@
}

const selectedItem = currentValue !== undefined ? items.find(item => getItemValueSerialized(item) === currentValueSerialized) : undefined;
const displayValue = selectedRender ? selectedRender(currentValue, selectedItem) : selectedItem ? renderItem(selectedItem) : '';

Check warning on line 157 in webapp/common-react/@dbeaver/ui-kit/src/Select/SelectField.tsx

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Do not nest ternary expressions

return (
<div className={clsx('dbv-kit-select-field', className)}>
Expand All @@ -161,7 +163,7 @@

<Select id={id} name={name} disabled={disabled} required={required}>
{displayValue}
{arrowIcon ?? <Select.Arrow className="dbv-kit-select__arrow-icon" />}
{arrowIcon ?? <Select.Arrow className="dbv-kit-select__arrow-icon tw:text-sm!" />}
</Select>
{description && <span className="dbv-kit-select__description">{description}</span>}

Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-blocks/src/FormControls/Select.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

.dbv-kit-select {
padding-left: 12px;
padding-right: 4px;
padding-right: 6px;
}

.dbv-kit-select__item {
Expand Down
Loading