v2.15.0

DashboardSearchButton

Готовая кнопка, которая открывает модальное окно DashboardSearch.

Использование

Компонент DashboardSearchButton открывает модальное окно DashboardSearch.

<template>
  <B24DashboardSearchButton />
</template>

Компонент расширяет Button, поэтому ему можно передать любое свойство: color, size и другие.

<template>
  <B24DashboardSearchButton color="air-primary-success" />
</template>
По умолчанию кнопка имеет color="air-secondary-no-accent", если не свёрнута, и color="air-tertiary-no-accent", если свёрнута.

Свёрнутая кнопка

Пропс collapsed скрывает подпись кнопки и клавиши. По умолчанию false.

<template>
  <B24DashboardSearchButton />
</template>
В компоненте DashboardSidebar используйте слот-проп collapsed напрямую.

Клавиши

Пропс kbds показывает на кнопке клавиши. По умолчанию ['meta', 'K'], как сочетание клавиш компонента DashboardSearch.

<template>
  <B24DashboardSearchButton
    :kbds="{
      '0': 'alt',
      '1': 'O'
    }"
  />
</template>

API

Пропсы

Prop Default Type
as'button'any

The element or component this component should render as when not a link.

iconicons.searchIconComponent

The icon displayed in the button. Set to false to hide the icon.

labelt('dashboardSearchButton.label') string

The label displayed in the button.

color'air-tertiary-no-accent'"air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-alert" | "air-secondary-accent" | "air-secondary-accent-1" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost"

The color of the button.

collapsedfalseboolean

Whether the button is collapsed.

tooltipfalseboolean | TooltipProps

Display a tooltip on the button when is collapsed with the button label. This has priority over the global tooltip prop.

kbds["meta", "k"] (string | undefined)[] | KbdProps[]

The keyboard keys to display in the button. { accent: 'default' }

type'button' "reset" | "submit" | "button"

The type of the button when not a link.

avatar AvatarProps

Display an avatar on the left side.

loadingboolean

When true, the loading icon will be displayed.

autofocus false | true | "false" | "true"
disabledboolean
name string
activeColor"air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-alert" | "air-secondary-accent" | "air-secondary-accent-1" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost"
depth'normal' "dark" | "light" | "normal"
Deprecated — removed in 3.0.0

Renders nothing on the air-* colours, the default among them: the depth compound variants are keyed on the legacy colour names only.

activeDepth "dark" | "light" | "normal"
Deprecated — removed in 3.0.0

Same as depth — no effect on the air-* colours.

size'md' "sm" | "md" | "xs" | "lg" | "xss" | "xl"
roundedfalseboolean

Rounds the corners of the button

blockfalseboolean

Render the button full width

loadingAutofalseboolean

Set loading state automatically based on the @click promise state

normalCasetrueboolean

Disable uppercase label

useWaitfalseboolean

Shows LoaderWaitIcon in loading mode

useClockfalseboolean

Shows LoaderClockIcon icon in loading mode

useDropdownfalseboolean

Shows a dropdown chevron on the right side, from the dictionary's chevronDown role, so an app.config override reaches it.

b24ui { base?: SlotClass; baseLine?: SlotClass; label?: SlotClass; trailing?: SlotClass; } & { base?: SlotClass; baseLoading?: SlotClass; baseLoadingWaitIcon?: SlotClass; baseLoadingClockIcon?: SlotClass; baseLoadingSpinnerIcon?: SlotClass; baseLine?: SlotClass; label?: SlotClass; labelInner?: SlotClass; leadingIcon?: SlotClass; leadingAvatar?: SlotClass; leadingAvatarSize?: SlotClass; trailingIcon?: SlotClass; safeList?: SlotClass; }
Компонент поддерживает и все нативные HTML-атрибуты <button>.

Слоты

Slot Type
leading{ b24ui: object; }
default{ b24ui: object; }
trailing{ b24ui: object; }

Тема

https://github.com/bx-shef/b24-ui/tree/main/src/theme/dashboard-search-button.ts
export default {
  slots: {
    base: '',
    baseLine: '',
    label: '',
    trailing: 'hidden lg:flex items-center gap-0.5 ms-auto'
  },
  variants: {
    collapsed: {
      true: {
        baseLine: 'ps-[5px] pe-[5px]',
        label: 'hidden',
        trailing: 'lg:hidden'
      }
    }
  }
}