Skip to content

Commit

Permalink
Models dialogs: use choice input instead icons
Browse files Browse the repository at this point in the history
Fixes #6044
  • Loading branch information
distantnative committed Jul 22, 2024
1 parent 5228fa5 commit 8accf93
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions panel/src/components/Dialogs/ModelsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,10 @@
@paginate="paginate"
>
<template #options="{ item: row }">
<k-button
v-if="isSelected(row)"
:icon="multiple && max !== 1 ? 'check' : 'circle-nested'"
:title="$t('remove')"
theme="info"
@click.stop="toggle(row)"
/>
<k-button
v-else
:title="$t('select')"
icon="circle-outline"
<k-choice-input
:checked="isSelected(row)"
:type="multiple && max !== 1 ? 'checkbox' : 'radio'"
:title="isSelected(row) ? $t('remove') : $t('select')"
@click.stop="toggle(row)"
/>
<slot name="options" v-bind="{ item: row }" />
Expand Down Expand Up @@ -166,6 +159,18 @@ export default {
.k-models-dialog .k-list-item {
cursor: pointer;
}
.k-models-dialog .k-choice-input {
--choice-color-checked: var(--color-focus);
display: flex;
align-items: center;
height: var(--item-button-height);
margin-inline-end: var(--spacing-3);
}
.k-models-dialog .k-choice-input input {
top: 0;
}
.k-models-dialog .k-collection-footer .k-pagination {
margin-bottom: 0;
}
Expand Down

0 comments on commit 8accf93

Please sign in to comment.