Skip to content

Commit

Permalink
feat(BaseDropdown): add disabled property
Browse files Browse the repository at this point in the history
  • Loading branch information
stafyniaksacha committed Aug 5, 2024
1 parent 14756b2 commit b7b73d2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/base/BaseDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const props = withDefaults(
*/
fixed?: boolean
/**
* Used a fixed strategy to float the component
*/
disabled?: boolean
/**
* The color of the button.
*
Expand Down Expand Up @@ -220,13 +225,14 @@ const textColors = {
:z-index="20"
v-bind="floatOptions"
>
<MenuButton as="template">
<MenuButton as="template" :disabled="props.disabled">
<slot name="button" v-bind="{ open, close }">
<BaseButton
v-if="variant === 'button' || props.variant === 'button'"
:size="props.buttonSize ? props.buttonSize : buttonSize"
:color="props.buttonColor ? props.buttonColor : buttonColor"
:rounded="props.rounded ? props.rounded : rounded"
:disabled="props.disabled"
class="!pe-3 !ps-4"
>
<slot name="label" v-bind="{ open, close }">
Expand All @@ -242,6 +248,7 @@ const textColors = {
v-else-if="props.variant === 'context'"
type="button"
class="nui-context-button nui-focus"
:disabled="props.disabled"
>
<span class="nui-context-button-inner">
<Icon
Expand All @@ -254,6 +261,7 @@ const textColors = {
<button
v-else-if="props.variant === 'text'"
type="button"
:disabled="props.disabled"
:class="[
'nui-text-button nui-focus',
buttonColor && textColors[buttonColor],
Expand Down

0 comments on commit b7b73d2

Please sign in to comment.