@bitrix24/b24ui-nuxt 2.0.8 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/meta.d.mts +84957 -50082
- package/dist/meta.mjs +84957 -50082
- package/dist/module.d.mts +13 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +8 -7
- package/dist/runtime/air-design-tokens/001_b24_global.css +1 -1
- package/dist/runtime/air-design-tokens/003_b24_context_light.css +1 -1
- package/dist/runtime/air-design-tokens/004_b24_context_dark.css +1 -1
- package/dist/runtime/air-design-tokens/005_b24_context_edge-light.css +1 -1
- package/dist/runtime/air-design-tokens/006_b24_context_edge-dark.css +1 -1
- package/dist/runtime/air-design-tokens/007_b24_global.css +1 -1
- package/dist/runtime/air-design-tokens/008_ui_global.css +1 -1
- package/dist/runtime/air-design-tokens/009_b24_tools.css +1 -1
- package/dist/runtime/air-design-tokens/components/badge-counter.css +1 -1
- package/dist/runtime/air-design-tokens/components/button.css +1 -1
- package/dist/runtime/air-design-tokens/components/navigation-menu.css +1 -1
- package/dist/runtime/air-design-tokens/components/popup.css +1 -1
- package/dist/runtime/air-design-tokens/components/scrollbar.css +1 -2
- package/dist/runtime/air-design-tokens/index.css +1 -1
- package/dist/runtime/components/Advice.d.vue.ts +1 -1
- package/dist/runtime/components/Advice.vue +1 -3
- package/dist/runtime/components/Advice.vue.d.ts +1 -1
- package/dist/runtime/components/App.d.vue.ts +1 -1
- package/dist/runtime/components/App.vue +2 -1
- package/dist/runtime/components/App.vue.d.ts +1 -1
- package/dist/runtime/components/Avatar.d.vue.ts +2 -1
- package/dist/runtime/components/Avatar.vue.d.ts +2 -1
- package/dist/runtime/components/Button.vue +1 -0
- package/dist/runtime/components/ChatPrompt.d.vue.ts +2 -2
- package/dist/runtime/components/ChatPrompt.vue +5 -5
- package/dist/runtime/components/ChatPrompt.vue.d.ts +2 -2
- package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +5 -5
- package/dist/runtime/components/ChatPromptSubmit.vue +53 -4
- package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +5 -5
- package/dist/runtime/components/Checkbox.d.vue.ts +2 -1
- package/dist/runtime/components/Checkbox.vue.d.ts +2 -1
- package/dist/runtime/components/CommandPalette.vue +5 -4
- package/dist/runtime/components/DashboardSearch.d.vue.ts +3 -6
- package/dist/runtime/components/DashboardSearch.vue +2 -3
- package/dist/runtime/components/DashboardSearch.vue.d.ts +3 -6
- package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -3
- package/dist/runtime/components/DashboardSearchButton.vue +44 -6
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -3
- package/dist/runtime/components/Error.d.vue.ts +1 -1
- package/dist/runtime/components/Error.vue.d.ts +1 -1
- package/dist/runtime/components/FileUpload.d.vue.ts +3 -2
- package/dist/runtime/components/FileUpload.vue +9 -9
- package/dist/runtime/components/FileUpload.vue.d.ts +3 -2
- package/dist/runtime/components/Form.d.vue.ts +3 -2
- package/dist/runtime/components/Form.vue +3 -4
- package/dist/runtime/components/Form.vue.d.ts +3 -2
- package/dist/runtime/components/Input.d.vue.ts +7 -7
- package/dist/runtime/components/Input.vue +2 -2
- package/dist/runtime/components/Input.vue.d.ts +7 -7
- package/dist/runtime/components/InputDate.d.vue.ts +115 -0
- package/dist/runtime/components/InputDate.vue +198 -0
- package/dist/runtime/components/InputDate.vue.d.ts +115 -0
- package/dist/runtime/components/InputMenu.d.vue.ts +7 -128
- package/dist/runtime/components/InputMenu.vue +3 -3
- package/dist/runtime/components/InputMenu.vue.d.ts +7 -128
- package/dist/runtime/components/InputNumber.d.vue.ts +25 -124
- package/dist/runtime/components/InputNumber.vue +3 -3
- package/dist/runtime/components/InputNumber.vue.d.ts +25 -124
- package/dist/runtime/components/InputTags.d.vue.ts +6 -109
- package/dist/runtime/components/InputTags.vue +8 -8
- package/dist/runtime/components/InputTags.vue.d.ts +6 -109
- package/dist/runtime/components/InputTime.d.vue.ts +99 -0
- package/dist/runtime/components/InputTime.vue +170 -0
- package/dist/runtime/components/InputTime.vue.d.ts +99 -0
- package/dist/runtime/components/Link.d.vue.ts +4 -49
- package/dist/runtime/components/Link.vue +1 -0
- package/dist/runtime/components/Link.vue.d.ts +4 -49
- package/dist/runtime/components/Modal.d.vue.ts +6 -1
- package/dist/runtime/components/Modal.vue +37 -9
- package/dist/runtime/components/Modal.vue.d.ts +6 -1
- package/dist/runtime/components/Pagination.d.vue.ts +2 -2
- package/dist/runtime/components/Pagination.vue.d.ts +2 -2
- package/dist/runtime/components/PinInput.d.vue.ts +3 -3
- package/dist/runtime/components/PinInput.vue.d.ts +3 -3
- package/dist/runtime/components/Progress.d.vue.ts +1 -1
- package/dist/runtime/components/Progress.vue.d.ts +1 -1
- package/dist/runtime/components/Select.d.vue.ts +6 -107
- package/dist/runtime/components/Select.vue +3 -3
- package/dist/runtime/components/Select.vue.d.ts +6 -107
- package/dist/runtime/components/SelectMenu.d.vue.ts +7 -106
- package/dist/runtime/components/SelectMenu.vue +3 -3
- package/dist/runtime/components/SelectMenu.vue.d.ts +7 -106
- package/dist/runtime/components/Slideover.d.vue.ts +1 -1
- package/dist/runtime/components/Slideover.vue.d.ts +1 -1
- package/dist/runtime/components/Switch.d.vue.ts +2 -1
- package/dist/runtime/components/Switch.vue.d.ts +2 -1
- package/dist/runtime/components/Table.d.vue.ts +5 -4
- package/dist/runtime/components/Table.vue +4 -3
- package/dist/runtime/components/Table.vue.d.ts +5 -4
- package/dist/runtime/components/Textarea.d.vue.ts +7 -6
- package/dist/runtime/components/Textarea.vue +2 -2
- package/dist/runtime/components/Textarea.vue.d.ts +7 -6
- package/dist/runtime/components/Toast.vue +5 -5
- package/dist/runtime/components/Toaster.d.vue.ts +1 -1
- package/dist/runtime/components/Toaster.vue.d.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeAvatar.d.vue.ts +3 -3
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +16 -4
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +3 -3
- package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +3 -3
- package/dist/runtime/components/color-mode/ColorModeButton.vue +54 -6
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -3
- package/dist/runtime/components/color-mode/ColorModeImage.d.vue.ts +4 -3
- package/dist/runtime/components/color-mode/ColorModeImage.vue +4 -0
- package/dist/runtime/components/color-mode/ColorModeImage.vue.d.ts +4 -3
- package/dist/runtime/components/color-mode/ColorModeSelect.d.vue.ts +5 -3
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +47 -5
- package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +5 -3
- package/dist/runtime/components/color-mode/ColorModeSwitch.d.vue.ts +2 -2
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +29 -5
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +2 -2
- package/dist/runtime/components/content/ContentSearch.d.vue.ts +3 -6
- package/dist/runtime/components/content/ContentSearch.vue +2 -3
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +3 -6
- package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -3
- package/dist/runtime/components/content/ContentSearchButton.vue +43 -5
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -3
- package/dist/runtime/components/content/ContentSurround.vue +7 -1
- package/dist/runtime/components/locale/LocaleSelect.d.vue.ts +11 -7
- package/dist/runtime/components/locale/LocaleSelect.vue +50 -6
- package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +11 -7
- package/dist/runtime/components/prose/Callout.vue +4 -0
- package/dist/runtime/composables/index.d.ts +8 -0
- package/dist/runtime/composables/index.js +8 -0
- package/dist/runtime/composables/useFileUpload.d.ts +2 -1
- package/dist/runtime/composables/useFileUpload.js +13 -4
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/inertia/components/Link.d.vue.ts +17 -10
- package/dist/runtime/inertia/components/Link.vue +8 -6
- package/dist/runtime/inertia/components/Link.vue.d.ts +17 -10
- package/dist/runtime/inertia/stubs.d.ts +1 -1
- package/dist/runtime/plugins/colors.js +4 -8
- package/dist/runtime/types/html.d.ts +8 -0
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/types/input.d.ts +5 -5
- package/dist/runtime/types/utils.d.ts +2 -0
- package/dist/runtime/utils/content.d.ts +2 -2
- package/dist/runtime/utils/dashboard.d.ts +1 -1
- package/dist/runtime/utils/link.d.ts +1 -0
- package/dist/runtime/utils/link.js +40 -24
- package/dist/runtime/vue/components/Link.d.vue.ts +8 -37
- package/dist/runtime/vue/components/Link.vue +6 -11
- package/dist/runtime/vue/components/Link.vue.d.ts +8 -37
- package/dist/runtime/vue/components/color-mode/ColorModeButton.d.vue.ts +2 -2
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +55 -5
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue.d.ts +2 -2
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.d.vue.ts +5 -3
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +46 -3
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +5 -3
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.d.vue.ts +1 -1
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +24 -3
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
- package/dist/runtime/vue/stubs.d.ts +2 -2
- package/dist/runtime/vue/stubs.js +1 -1
- package/dist/shared/{b24ui-nuxt.CEMVb5Ee.mjs → b24ui-nuxt.CXLCGBie.mjs} +353 -128
- package/dist/unplugin.d.mts +3 -1
- package/dist/unplugin.mjs +4 -3
- package/dist/vite.mjs +3 -3
- package/package.json +27 -17
- /package/dist/runtime/{air-design-tokens/002_b24_context_utility.css → types/html.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConfigProviderProps, TooltipProviderProps } from 'reka-ui';
|
|
2
2
|
import type { ToasterProps, Locale, Messages } from '../types';
|
|
3
|
-
export interface AppProps<T extends Messages = Messages> extends Omit<ConfigProviderProps, 'useId' | '
|
|
3
|
+
export interface AppProps<T extends Messages = Messages> extends Omit<ConfigProviderProps, 'useId' | 'locale'> {
|
|
4
4
|
tooltip?: TooltipProviderProps;
|
|
5
5
|
toaster?: ToasterProps | null;
|
|
6
6
|
locale?: Locale<T>;
|
|
@@ -17,6 +17,7 @@ const props = defineProps({
|
|
|
17
17
|
toaster: { type: [Object, null], required: false },
|
|
18
18
|
locale: { type: Object, required: false },
|
|
19
19
|
portal: { type: [Boolean, String], required: false, skipCheck: true, default: "body" },
|
|
20
|
+
dir: { type: String, required: false },
|
|
20
21
|
scrollBody: { type: [Boolean, Object], required: false },
|
|
21
22
|
nonce: { type: String, required: false }
|
|
22
23
|
});
|
|
@@ -31,7 +32,7 @@ provide(portalTargetInjectionKey, portal);
|
|
|
31
32
|
</script>
|
|
32
33
|
|
|
33
34
|
<template>
|
|
34
|
-
<ConfigProvider :use-id="() => useId()" :dir="locale?.dir" :locale="locale?.code" v-bind="configProviderProps">
|
|
35
|
+
<ConfigProvider :use-id="() => useId()" :dir="props.dir || locale?.dir" :locale="locale?.code" v-bind="configProviderProps">
|
|
35
36
|
<TooltipProvider v-bind="tooltipProps">
|
|
36
37
|
<B24Toaster v-if="toaster !== null" v-bind="toasterProps">
|
|
37
38
|
<slot />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConfigProviderProps, TooltipProviderProps } from 'reka-ui';
|
|
2
2
|
import type { ToasterProps, Locale, Messages } from '../types';
|
|
3
|
-
export interface AppProps<T extends Messages = Messages> extends Omit<ConfigProviderProps, 'useId' | '
|
|
3
|
+
export interface AppProps<T extends Messages = Messages> extends Omit<ConfigProviderProps, 'useId' | 'locale'> {
|
|
4
4
|
tooltip?: TooltipProviderProps;
|
|
5
5
|
toaster?: ToasterProps | null;
|
|
6
6
|
locale?: Locale<T>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { AppConfig } from '@nuxt/schema';
|
|
2
2
|
import theme from '#build/b24ui/avatar';
|
|
3
3
|
import type { IconComponent, ChipProps } from '../types';
|
|
4
|
+
import type { ImgHTMLAttributes } from '../types/html';
|
|
4
5
|
import type { ComponentConfig } from '../types/tv';
|
|
5
6
|
type Avatar = ComponentConfig<typeof theme, AppConfig, 'avatar'>;
|
|
6
|
-
export interface AvatarProps {
|
|
7
|
+
export interface AvatarProps extends /** @vue-ignore */ Omit<ImgHTMLAttributes, 'src' | 'alt'> {
|
|
7
8
|
/**
|
|
8
9
|
* The element or component this component should render as.
|
|
9
10
|
* @defaultValue 'span'
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { AppConfig } from '@nuxt/schema';
|
|
2
2
|
import theme from '#build/b24ui/avatar';
|
|
3
3
|
import type { IconComponent, ChipProps } from '../types';
|
|
4
|
+
import type { ImgHTMLAttributes } from '../types/html';
|
|
4
5
|
import type { ComponentConfig } from '../types/tv';
|
|
5
6
|
type Avatar = ComponentConfig<typeof theme, AppConfig, 'avatar'>;
|
|
6
|
-
export interface AvatarProps {
|
|
7
|
+
export interface AvatarProps extends /** @vue-ignore */ Omit<ImgHTMLAttributes, 'src' | 'alt'> {
|
|
7
8
|
/**
|
|
8
9
|
* The element or component this component should render as.
|
|
9
10
|
* @defaultValue 'span'
|
|
@@ -60,6 +60,7 @@ const props = defineProps({
|
|
|
60
60
|
prefetch: { type: Boolean, required: false },
|
|
61
61
|
prefetchOn: { type: [String, Object], required: false },
|
|
62
62
|
noPrefetch: { type: Boolean, required: false },
|
|
63
|
+
trailingSlash: { type: String, required: false },
|
|
63
64
|
exactActiveClass: { type: String, required: false },
|
|
64
65
|
ariaCurrentValue: { type: String, required: false },
|
|
65
66
|
viewTransition: { type: Boolean, required: false },
|
|
@@ -33,7 +33,7 @@ export interface ChatPromptSlots extends TextareaSlots {
|
|
|
33
33
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPromptProps & {
|
|
34
34
|
modelValue?: string;
|
|
35
35
|
}, {
|
|
36
|
-
textareaRef: HTMLTextAreaElement | null | undefined
|
|
36
|
+
textareaRef: Readonly<import("vue").Ref<HTMLTextAreaElement | null | undefined, HTMLTextAreaElement | null | undefined>>;
|
|
37
37
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
38
|
close: (event: Event) => any;
|
|
39
39
|
submit: (event: Event) => any;
|
|
@@ -45,10 +45,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPr
|
|
|
45
45
|
onSubmit?: ((event: Event) => any) | undefined;
|
|
46
46
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
47
47
|
}>, {
|
|
48
|
+
rows: number;
|
|
48
49
|
as: any;
|
|
49
50
|
autofocus: boolean;
|
|
50
51
|
autoresize: boolean;
|
|
51
|
-
rows: number;
|
|
52
52
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChatPromptSlots>;
|
|
53
53
|
declare const _default: typeof __VLS_export;
|
|
54
54
|
export default _default;
|
|
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/chat-prompt";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { computed, useTemplateRef } from "vue";
|
|
6
|
+
import { computed, toRef, useTemplateRef } from "vue";
|
|
7
7
|
import { Primitive, useForwardProps } from "reka-ui";
|
|
8
8
|
import { reactivePick } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
@@ -40,6 +40,7 @@ const getProxySlots = () => omit(slots, ["header", "footer", "default"]);
|
|
|
40
40
|
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.chatPrompt || {} })({
|
|
41
41
|
variant: props.variant
|
|
42
42
|
}));
|
|
43
|
+
const textareaRef = useTemplateRef("textareaRef");
|
|
43
44
|
function submit(e) {
|
|
44
45
|
if (model.value.trim() === "") {
|
|
45
46
|
return;
|
|
@@ -47,12 +48,11 @@ function submit(e) {
|
|
|
47
48
|
emits("submit", e);
|
|
48
49
|
}
|
|
49
50
|
function blur(e) {
|
|
50
|
-
|
|
51
|
+
textareaRef.value?.textareaRef?.blur();
|
|
51
52
|
emits("close", e);
|
|
52
53
|
}
|
|
53
|
-
const textarea = useTemplateRef("textarea");
|
|
54
54
|
defineExpose({
|
|
55
|
-
textareaRef:
|
|
55
|
+
textareaRef: toRef(() => textareaRef.value?.textareaRef)
|
|
56
56
|
});
|
|
57
57
|
</script>
|
|
58
58
|
|
|
@@ -63,7 +63,7 @@ defineExpose({
|
|
|
63
63
|
</div>
|
|
64
64
|
|
|
65
65
|
<B24Textarea
|
|
66
|
-
ref="
|
|
66
|
+
ref="textareaRef"
|
|
67
67
|
v-model="model"
|
|
68
68
|
:placeholder="placeholder || t('chatPrompt.placeholder')"
|
|
69
69
|
:disabled="Boolean(error) || disabled"
|
|
@@ -33,7 +33,7 @@ export interface ChatPromptSlots extends TextareaSlots {
|
|
|
33
33
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPromptProps & {
|
|
34
34
|
modelValue?: string;
|
|
35
35
|
}, {
|
|
36
|
-
textareaRef: HTMLTextAreaElement | null | undefined
|
|
36
|
+
textareaRef: Readonly<import("vue").Ref<HTMLTextAreaElement | null | undefined, HTMLTextAreaElement | null | undefined>>;
|
|
37
37
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
38
|
close: (event: Event) => any;
|
|
39
39
|
submit: (event: Event) => any;
|
|
@@ -45,10 +45,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPr
|
|
|
45
45
|
onSubmit?: ((event: Event) => any) | undefined;
|
|
46
46
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
47
47
|
}>, {
|
|
48
|
+
rows: number;
|
|
48
49
|
as: any;
|
|
49
50
|
autofocus: boolean;
|
|
50
51
|
autoresize: boolean;
|
|
51
|
-
rows: number;
|
|
52
52
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChatPromptSlots>;
|
|
53
53
|
declare const _default: typeof __VLS_export;
|
|
54
54
|
export default _default;
|
|
@@ -4,7 +4,7 @@ import theme from '#build/b24ui/chat-prompt-submit';
|
|
|
4
4
|
import type { ButtonProps, ButtonSlots, IconComponent } from '../types';
|
|
5
5
|
import type { ComponentConfig } from '../types/tv';
|
|
6
6
|
type ChatPromptSubmit = ComponentConfig<typeof theme, AppConfig, 'chatPromptSubmit'>;
|
|
7
|
-
export interface ChatPromptSubmitProps extends
|
|
7
|
+
export interface ChatPromptSubmitProps extends Omit<ButtonProps, 'icon' | 'color'> {
|
|
8
8
|
status?: ChatStatus;
|
|
9
9
|
/**
|
|
10
10
|
* The icon displayed in the button when the status is `ready`.
|
|
@@ -64,11 +64,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPr
|
|
|
64
64
|
onStop?: (() => any) | undefined;
|
|
65
65
|
onReload?: (() => any) | undefined;
|
|
66
66
|
}>, {
|
|
67
|
-
color: "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "default" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
68
67
|
status: ChatStatus;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
69
|
+
streamingColor: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
70
|
+
submittedColor: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
71
|
+
errorColor: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
72
72
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonSlots>;
|
|
73
73
|
declare const _default: typeof __VLS_export;
|
|
74
74
|
export default _default;
|
|
@@ -4,12 +4,15 @@ import theme from "#build/b24ui/chat-prompt-submit";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed } from "vue";
|
|
7
|
+
import { useForwardProps } from "reka-ui";
|
|
8
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
7
9
|
import { useAppConfig } from "#imports";
|
|
8
10
|
import { useLocale } from "../composables/useLocale";
|
|
9
11
|
import { transformUI } from "../utils";
|
|
10
12
|
import { tv } from "../utils/tv";
|
|
11
13
|
import icons from "../dictionary/icons";
|
|
12
14
|
import B24Button from "./Button.vue";
|
|
15
|
+
defineOptions({ inheritAttrs: false });
|
|
13
16
|
const props = defineProps({
|
|
14
17
|
status: { type: String, required: false, default: "ready" },
|
|
15
18
|
icon: { type: [Function, Object], required: false },
|
|
@@ -21,13 +24,54 @@ const props = defineProps({
|
|
|
21
24
|
errorIcon: { type: [Function, Object], required: false },
|
|
22
25
|
errorColor: { type: null, required: false, default: "air-primary-alert" },
|
|
23
26
|
b24ui: { type: void 0, required: false },
|
|
24
|
-
class: { type: null, required: false }
|
|
27
|
+
class: { type: null, required: false },
|
|
28
|
+
label: { type: String, required: false },
|
|
29
|
+
activeColor: { type: null, required: false },
|
|
30
|
+
depth: { type: null, required: false },
|
|
31
|
+
activeDepth: { type: null, required: false },
|
|
32
|
+
size: { type: null, required: false },
|
|
33
|
+
rounded: { type: Boolean, required: false },
|
|
34
|
+
block: { type: Boolean, required: false },
|
|
35
|
+
loadingAuto: { type: Boolean, required: false },
|
|
36
|
+
normalCase: { type: Boolean, required: false },
|
|
37
|
+
useWait: { type: Boolean, required: false },
|
|
38
|
+
useClock: { type: Boolean, required: false },
|
|
39
|
+
useDropdown: { type: Boolean, required: false },
|
|
40
|
+
onClick: { type: [Function, Array], required: false },
|
|
41
|
+
activeClass: { type: String, required: false },
|
|
42
|
+
inactiveClass: { type: String, required: false },
|
|
43
|
+
avatar: { type: Object, required: false },
|
|
44
|
+
loading: { type: Boolean, required: false },
|
|
45
|
+
as: { type: null, required: false },
|
|
46
|
+
type: { type: null, required: false },
|
|
47
|
+
disabled: { type: Boolean, required: false },
|
|
48
|
+
active: { type: Boolean, required: false },
|
|
49
|
+
exact: { type: Boolean, required: false },
|
|
50
|
+
exactQuery: { type: [Boolean, String], required: false },
|
|
51
|
+
exactHash: { type: Boolean, required: false },
|
|
52
|
+
isAction: { type: Boolean, required: false },
|
|
53
|
+
to: { type: null, required: false },
|
|
54
|
+
href: { type: null, required: false },
|
|
55
|
+
external: { type: Boolean, required: false },
|
|
56
|
+
target: { type: [String, Object, null], required: false },
|
|
57
|
+
rel: { type: [String, Object, null], required: false },
|
|
58
|
+
noRel: { type: Boolean, required: false },
|
|
59
|
+
prefetchedClass: { type: String, required: false },
|
|
60
|
+
prefetch: { type: Boolean, required: false },
|
|
61
|
+
prefetchOn: { type: [String, Object], required: false },
|
|
62
|
+
noPrefetch: { type: Boolean, required: false },
|
|
63
|
+
trailingSlash: { type: String, required: false },
|
|
64
|
+
exactActiveClass: { type: String, required: false },
|
|
65
|
+
ariaCurrentValue: { type: String, required: false },
|
|
66
|
+
viewTransition: { type: Boolean, required: false },
|
|
67
|
+
replace: { type: Boolean, required: false }
|
|
25
68
|
});
|
|
26
69
|
const emits = defineEmits(["stop", "reload"]);
|
|
27
70
|
const slots = defineSlots();
|
|
28
71
|
const { t } = useLocale();
|
|
29
72
|
const appConfig = useAppConfig();
|
|
30
|
-
const buttonProps =
|
|
73
|
+
const buttonProps = useForwardProps(reactiveOmit(props, "icon", "color", "status", "streamingIcon", "streamingColor", "submittedIcon", "submittedColor", "errorIcon", "errorColor", "class", "b24ui"));
|
|
74
|
+
const statusButtonProps = computed(() => ({
|
|
31
75
|
ready: {
|
|
32
76
|
icon: props.icon || icons.imSend,
|
|
33
77
|
color: props.color,
|
|
@@ -60,9 +104,14 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.chatPro
|
|
|
60
104
|
|
|
61
105
|
<template>
|
|
62
106
|
<B24Button
|
|
107
|
+
v-bind="{
|
|
108
|
+
...buttonProps,
|
|
109
|
+
...statusButtonProps,
|
|
110
|
+
'aria-label': t('chatPromptSubmit.label'),
|
|
111
|
+
'rounded': true,
|
|
112
|
+
...$attrs
|
|
113
|
+
}"
|
|
63
114
|
:aria-label="t('chatPromptSubmit.label')"
|
|
64
|
-
rounded
|
|
65
|
-
v-bind="buttonProps"
|
|
66
115
|
:class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
|
|
67
116
|
:b24ui="transformUI(b24ui, props.b24ui)"
|
|
68
117
|
>
|
|
@@ -4,7 +4,7 @@ import theme from '#build/b24ui/chat-prompt-submit';
|
|
|
4
4
|
import type { ButtonProps, ButtonSlots, IconComponent } from '../types';
|
|
5
5
|
import type { ComponentConfig } from '../types/tv';
|
|
6
6
|
type ChatPromptSubmit = ComponentConfig<typeof theme, AppConfig, 'chatPromptSubmit'>;
|
|
7
|
-
export interface ChatPromptSubmitProps extends
|
|
7
|
+
export interface ChatPromptSubmitProps extends Omit<ButtonProps, 'icon' | 'color'> {
|
|
8
8
|
status?: ChatStatus;
|
|
9
9
|
/**
|
|
10
10
|
* The icon displayed in the button when the status is `ready`.
|
|
@@ -64,11 +64,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChatPr
|
|
|
64
64
|
onStop?: (() => any) | undefined;
|
|
65
65
|
onReload?: (() => any) | undefined;
|
|
66
66
|
}>, {
|
|
67
|
-
color: "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "default" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
68
67
|
status: ChatStatus;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
69
|
+
streamingColor: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
70
|
+
submittedColor: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
71
|
+
errorColor: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
72
72
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonSlots>;
|
|
73
73
|
declare const _default: typeof __VLS_export;
|
|
74
74
|
export default _default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { CheckboxRootProps } from 'reka-ui';
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/b24ui/checkbox';
|
|
4
|
+
import type { ButtonHTMLAttributes } from '../types/html';
|
|
4
5
|
import type { ComponentConfig } from '../types/tv';
|
|
5
6
|
type Checkbox = ComponentConfig<typeof theme, AppConfig, 'checkbox'>;
|
|
6
|
-
export interface CheckboxProps extends Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id' | 'defaultValue'> {
|
|
7
|
+
export interface CheckboxProps extends Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id' | 'defaultValue'>, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled' | 'name'> {
|
|
7
8
|
/**
|
|
8
9
|
* The element or component this component should render as.
|
|
9
10
|
* @defaultValue 'div'
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { CheckboxRootProps } from 'reka-ui';
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/b24ui/checkbox';
|
|
4
|
+
import type { ButtonHTMLAttributes } from '../types/html';
|
|
4
5
|
import type { ComponentConfig } from '../types/tv';
|
|
5
6
|
type Checkbox = ComponentConfig<typeof theme, AppConfig, 'checkbox'>;
|
|
6
|
-
export interface CheckboxProps extends Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id' | 'defaultValue'> {
|
|
7
|
+
export interface CheckboxProps extends Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id' | 'defaultValue'>, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled' | 'name'> {
|
|
7
8
|
/**
|
|
8
9
|
* The element or component this component should render as.
|
|
9
10
|
* @defaultValue 'div'
|
|
@@ -22,6 +22,7 @@ import B24LinkBase from "./LinkBase.vue";
|
|
|
22
22
|
import B24Link from "./Link.vue";
|
|
23
23
|
import B24Input from "./Input.vue";
|
|
24
24
|
import B24Kbd from "./Kbd.vue";
|
|
25
|
+
defineOptions({ inheritAttrs: false });
|
|
25
26
|
const props = defineProps({
|
|
26
27
|
as: { type: null, required: false },
|
|
27
28
|
icon: { type: [Function, Object], required: false },
|
|
@@ -152,7 +153,7 @@ const filteredGroups = computed(() => {
|
|
|
152
153
|
}, [...fuseGroups]);
|
|
153
154
|
});
|
|
154
155
|
const filteredItems = computed(() => filteredGroups.value.flatMap((group) => group.items || []));
|
|
155
|
-
const
|
|
156
|
+
const rootRef = useTemplateRef("rootRef");
|
|
156
157
|
function navigate(item) {
|
|
157
158
|
if (!item.children?.length) {
|
|
158
159
|
return;
|
|
@@ -165,7 +166,7 @@ function navigate(item) {
|
|
|
165
166
|
items: item.children
|
|
166
167
|
});
|
|
167
168
|
searchTerm.value = "";
|
|
168
|
-
|
|
169
|
+
rootRef.value?.highlightFirstItem();
|
|
169
170
|
}
|
|
170
171
|
function navigateBack() {
|
|
171
172
|
if (!history.value.length) {
|
|
@@ -173,7 +174,7 @@ function navigateBack() {
|
|
|
173
174
|
}
|
|
174
175
|
history.value.pop();
|
|
175
176
|
searchTerm.value = "";
|
|
176
|
-
|
|
177
|
+
rootRef.value?.highlightFirstItem();
|
|
177
178
|
}
|
|
178
179
|
function onBackspace() {
|
|
179
180
|
if (!searchTerm.value) {
|
|
@@ -326,7 +327,7 @@ function onSelect(e, item) {
|
|
|
326
327
|
</ListboxItem>
|
|
327
328
|
</DefineItemTemplate>
|
|
328
329
|
|
|
329
|
-
<ListboxRoot v-bind="rootProps" ref="
|
|
330
|
+
<ListboxRoot v-bind="{ ...rootProps, ...$attrs }" ref="rootRef" :selection-behavior="selectionBehavior" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
330
331
|
<ListboxFilter v-model="searchTerm" as-child>
|
|
331
332
|
<B24Input
|
|
332
333
|
:placeholder="placeholder"
|
|
@@ -4,6 +4,9 @@ import theme from '#build/b24ui/dashboard-search';
|
|
|
4
4
|
import type { ButtonProps, InputProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, IconComponent } from '../types';
|
|
5
5
|
import type { ComponentConfig } from '../types/tv';
|
|
6
6
|
type DashboardSearch = ComponentConfig<typeof theme, AppConfig, 'dashboardSearch'>;
|
|
7
|
+
/**
|
|
8
|
+
* @memo not use loadingIcon
|
|
9
|
+
*/
|
|
7
10
|
export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPaletteItem> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'> {
|
|
8
11
|
/**
|
|
9
12
|
* The icon displayed in the input.
|
|
@@ -23,12 +26,6 @@ export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPale
|
|
|
23
26
|
autofocus?: boolean;
|
|
24
27
|
/** When `true`, the loading icon will be displayed. */
|
|
25
28
|
loading?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The icon when the `loading` prop is `true`.
|
|
28
|
-
* @defaultValue icons.loading
|
|
29
|
-
* @IconComponent
|
|
30
|
-
*/
|
|
31
|
-
loadingIcon?: IconComponent;
|
|
32
29
|
/**
|
|
33
30
|
* Display a close button in the input (useful when inside a Modal for example).
|
|
34
31
|
* `{ size: 'sm', color: 'air-tertiary-no-accent' }`{lang="ts-type"}
|
|
@@ -19,7 +19,6 @@ const props = defineProps({
|
|
|
19
19
|
placeholder: { type: String, required: false },
|
|
20
20
|
autofocus: { type: Boolean, required: false },
|
|
21
21
|
loading: { type: Boolean, required: false },
|
|
22
|
-
loadingIcon: { type: [Function, Object], required: false },
|
|
23
22
|
close: { type: [Boolean, Object], required: false, default: true },
|
|
24
23
|
closeIcon: { type: [Function, Object], required: false },
|
|
25
24
|
shortcut: { type: String, required: false, default: "meta_k" },
|
|
@@ -47,7 +46,7 @@ useRuntimeHook("dashboard:search:toggle", () => {
|
|
|
47
46
|
const { t } = useLocale();
|
|
48
47
|
const colorMode = useColorMode();
|
|
49
48
|
const appConfig = useAppConfig();
|
|
50
|
-
const commandPaletteProps = useForwardProps(reactivePick(props, "icon", "placeholder", "autofocus", "loading", "
|
|
49
|
+
const commandPaletteProps = useForwardProps(reactivePick(props, "icon", "placeholder", "autofocus", "loading", "close", "closeIcon"));
|
|
51
50
|
const modalProps = useForwardProps(reactivePick(props, "overlay", "transition", "content", "dismissible", "fullscreen", "modal", "portal"));
|
|
52
51
|
const getProxySlots = () => omit(slots, ["content"]);
|
|
53
52
|
const fuse = computed(() => defu({}, props.fuse, {
|
|
@@ -93,6 +92,7 @@ const groups = computed(() => {
|
|
|
93
92
|
}
|
|
94
93
|
return groups2;
|
|
95
94
|
});
|
|
95
|
+
const commandPaletteRef = useTemplateRef("commandPaletteRef");
|
|
96
96
|
function onSelect(item) {
|
|
97
97
|
if (item.disabled) {
|
|
98
98
|
return;
|
|
@@ -106,7 +106,6 @@ defineShortcuts({
|
|
|
106
106
|
handler: () => open.value = !open.value
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
-
const commandPaletteRef = useTemplateRef("commandPaletteRef");
|
|
110
109
|
defineExpose({
|
|
111
110
|
commandPaletteRef
|
|
112
111
|
});
|
|
@@ -4,6 +4,9 @@ import theme from '#build/b24ui/dashboard-search';
|
|
|
4
4
|
import type { ButtonProps, InputProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, IconComponent } from '../types';
|
|
5
5
|
import type { ComponentConfig } from '../types/tv';
|
|
6
6
|
type DashboardSearch = ComponentConfig<typeof theme, AppConfig, 'dashboardSearch'>;
|
|
7
|
+
/**
|
|
8
|
+
* @memo not use loadingIcon
|
|
9
|
+
*/
|
|
7
10
|
export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPaletteItem> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'> {
|
|
8
11
|
/**
|
|
9
12
|
* The icon displayed in the input.
|
|
@@ -23,12 +26,6 @@ export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPale
|
|
|
23
26
|
autofocus?: boolean;
|
|
24
27
|
/** When `true`, the loading icon will be displayed. */
|
|
25
28
|
loading?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The icon when the `loading` prop is `true`.
|
|
28
|
-
* @defaultValue icons.loading
|
|
29
|
-
* @IconComponent
|
|
30
|
-
*/
|
|
31
|
-
loadingIcon?: IconComponent;
|
|
32
29
|
/**
|
|
33
30
|
* Display a close button in the input (useful when inside a Modal for example).
|
|
34
31
|
* `{ size: 'sm', color: 'air-tertiary-no-accent' }`{lang="ts-type"}
|
|
@@ -3,7 +3,7 @@ import theme from '#build/b24ui/dashboard-search-button';
|
|
|
3
3
|
import type { ButtonProps, ButtonSlots, IconComponent, KbdProps, TooltipProps } from '../types';
|
|
4
4
|
import type { ComponentConfig } from '../types/tv';
|
|
5
5
|
type DashboardSearchButton = ComponentConfig<typeof theme, AppConfig, 'dashboardSearchButton'>;
|
|
6
|
-
export interface DashboardSearchButtonProps {
|
|
6
|
+
export interface DashboardSearchButtonProps extends Omit<ButtonProps, 'icon' | 'label' | 'color'> {
|
|
7
7
|
/**
|
|
8
8
|
* The icon displayed in the button.
|
|
9
9
|
* @defaultValue icons.search
|
|
@@ -20,7 +20,6 @@ export interface DashboardSearchButtonProps {
|
|
|
20
20
|
* @defaultValue 'air-tertiary-no-accent'
|
|
21
21
|
*/
|
|
22
22
|
color?: ButtonProps['color'];
|
|
23
|
-
size?: ButtonProps['size'];
|
|
24
23
|
/**
|
|
25
24
|
* Whether the button is collapsed.
|
|
26
25
|
* @defaultValue false
|
|
@@ -41,7 +40,7 @@ export interface DashboardSearchButtonProps {
|
|
|
41
40
|
class?: any;
|
|
42
41
|
}
|
|
43
42
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DashboardSearchButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSearchButtonProps> & Readonly<{}>, {
|
|
44
|
-
color: "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "
|
|
43
|
+
color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
45
44
|
tooltip: boolean | TooltipProps;
|
|
46
45
|
kbds: KbdProps["value"][] | KbdProps[];
|
|
47
46
|
collapsed: boolean;
|
|
@@ -6,10 +6,10 @@ import theme from "#build/b24ui/dashboard-search-button";
|
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
7
|
import { useForwardProps } from "reka-ui";
|
|
8
8
|
import { defu } from "defu";
|
|
9
|
-
import {
|
|
9
|
+
import { reactiveOmit, createReusableTemplate } from "@vueuse/core";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
11
11
|
import { useLocale } from "../composables/useLocale";
|
|
12
|
-
import { useDashboard } from "
|
|
12
|
+
import { useDashboard } from "../utils/dashboard";
|
|
13
13
|
import { omit, transformUI } from "../utils";
|
|
14
14
|
import { tv } from "../utils/tv";
|
|
15
15
|
import icons from "../dictionary/icons";
|
|
@@ -21,17 +21,55 @@ const props = defineProps({
|
|
|
21
21
|
icon: { type: [Function, Object], required: false },
|
|
22
22
|
label: { type: String, required: false },
|
|
23
23
|
color: { type: null, required: false, default: "air-tertiary-no-accent" },
|
|
24
|
-
size: { type: null, required: false },
|
|
25
24
|
collapsed: { type: Boolean, required: false, default: false },
|
|
26
25
|
tooltip: { type: [Boolean, Object], required: false, default: false },
|
|
27
26
|
kbds: { type: Array, required: false, default: () => ["meta", "k"] },
|
|
28
27
|
b24ui: { type: void 0, required: false },
|
|
29
|
-
class: { type: null, required: false }
|
|
28
|
+
class: { type: null, required: false },
|
|
29
|
+
activeColor: { type: null, required: false },
|
|
30
|
+
depth: { type: null, required: false },
|
|
31
|
+
activeDepth: { type: null, required: false },
|
|
32
|
+
size: { type: null, required: false },
|
|
33
|
+
rounded: { type: Boolean, required: false },
|
|
34
|
+
block: { type: Boolean, required: false },
|
|
35
|
+
loadingAuto: { type: Boolean, required: false },
|
|
36
|
+
normalCase: { type: Boolean, required: false },
|
|
37
|
+
useWait: { type: Boolean, required: false },
|
|
38
|
+
useClock: { type: Boolean, required: false },
|
|
39
|
+
useDropdown: { type: Boolean, required: false },
|
|
40
|
+
onClick: { type: [Function, Array], required: false },
|
|
41
|
+
activeClass: { type: String, required: false },
|
|
42
|
+
inactiveClass: { type: String, required: false },
|
|
43
|
+
avatar: { type: Object, required: false },
|
|
44
|
+
loading: { type: Boolean, required: false },
|
|
45
|
+
as: { type: null, required: false },
|
|
46
|
+
type: { type: null, required: false },
|
|
47
|
+
disabled: { type: Boolean, required: false },
|
|
48
|
+
active: { type: Boolean, required: false },
|
|
49
|
+
exact: { type: Boolean, required: false },
|
|
50
|
+
exactQuery: { type: [Boolean, String], required: false },
|
|
51
|
+
exactHash: { type: Boolean, required: false },
|
|
52
|
+
isAction: { type: Boolean, required: false },
|
|
53
|
+
to: { type: null, required: false },
|
|
54
|
+
href: { type: null, required: false },
|
|
55
|
+
external: { type: Boolean, required: false },
|
|
56
|
+
target: { type: [String, Object, null], required: false },
|
|
57
|
+
rel: { type: [String, Object, null], required: false },
|
|
58
|
+
noRel: { type: Boolean, required: false },
|
|
59
|
+
prefetchedClass: { type: String, required: false },
|
|
60
|
+
prefetch: { type: Boolean, required: false },
|
|
61
|
+
prefetchOn: { type: [String, Object], required: false },
|
|
62
|
+
noPrefetch: { type: Boolean, required: false },
|
|
63
|
+
trailingSlash: { type: String, required: false },
|
|
64
|
+
exactActiveClass: { type: String, required: false },
|
|
65
|
+
ariaCurrentValue: { type: String, required: false },
|
|
66
|
+
viewTransition: { type: Boolean, required: false },
|
|
67
|
+
replace: { type: Boolean, required: false }
|
|
30
68
|
});
|
|
31
69
|
const slots = defineSlots();
|
|
32
70
|
const [DefineButtonTemplate, ReuseButtonTemplate] = createReusableTemplate();
|
|
33
71
|
const getProxySlots = () => omit(slots, ["trailing"]);
|
|
34
|
-
const
|
|
72
|
+
const buttonProps = useForwardProps(reactiveOmit(props, "icon", "label", "collapsed", "tooltip", "kbds", "class", "b24ui"));
|
|
35
73
|
const tooltipProps = toRef(() => defu(typeof props.tooltip === "boolean" ? {} : props.tooltip, { delayDuration: 0, content: { side: "right" } }));
|
|
36
74
|
const { t } = useLocale();
|
|
37
75
|
const appConfig = useAppConfig();
|
|
@@ -46,7 +84,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.dashboa
|
|
|
46
84
|
:icon="icon || icons.search"
|
|
47
85
|
:label="label || t('dashboardSearchButton.label')"
|
|
48
86
|
v-bind="{
|
|
49
|
-
...
|
|
87
|
+
...buttonProps,
|
|
50
88
|
...collapsed ? {
|
|
51
89
|
'label': void 0,
|
|
52
90
|
'aria-label': label || t('dashboardSearchButton.label')
|
|
@@ -3,7 +3,7 @@ import theme from '#build/b24ui/dashboard-search-button';
|
|
|
3
3
|
import type { ButtonProps, ButtonSlots, IconComponent, KbdProps, TooltipProps } from '../types';
|
|
4
4
|
import type { ComponentConfig } from '../types/tv';
|
|
5
5
|
type DashboardSearchButton = ComponentConfig<typeof theme, AppConfig, 'dashboardSearchButton'>;
|
|
6
|
-
export interface DashboardSearchButtonProps {
|
|
6
|
+
export interface DashboardSearchButtonProps extends Omit<ButtonProps, 'icon' | 'label' | 'color'> {
|
|
7
7
|
/**
|
|
8
8
|
* The icon displayed in the button.
|
|
9
9
|
* @defaultValue icons.search
|
|
@@ -20,7 +20,6 @@ export interface DashboardSearchButtonProps {
|
|
|
20
20
|
* @defaultValue 'air-tertiary-no-accent'
|
|
21
21
|
*/
|
|
22
22
|
color?: ButtonProps['color'];
|
|
23
|
-
size?: ButtonProps['size'];
|
|
24
23
|
/**
|
|
25
24
|
* Whether the button is collapsed.
|
|
26
25
|
* @defaultValue false
|
|
@@ -41,7 +40,7 @@ export interface DashboardSearchButtonProps {
|
|
|
41
40
|
class?: any;
|
|
42
41
|
}
|
|
43
42
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DashboardSearchButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSearchButtonProps> & Readonly<{}>, {
|
|
44
|
-
color: "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "
|
|
43
|
+
color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
|
|
45
44
|
tooltip: boolean | TooltipProps;
|
|
46
45
|
kbds: KbdProps["value"][] | KbdProps[];
|
|
47
46
|
collapsed: boolean;
|
|
@@ -35,8 +35,8 @@ export interface ErrorSlots {
|
|
|
35
35
|
links(props?: {}): any;
|
|
36
36
|
}
|
|
37
37
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ErrorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ErrorProps> & Readonly<{}>, {
|
|
38
|
-
clear: boolean | Partial<ButtonProps>;
|
|
39
38
|
redirect: string;
|
|
39
|
+
clear: boolean | Partial<ButtonProps>;
|
|
40
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ErrorSlots>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
|
42
42
|
export default _default;
|
|
@@ -35,8 +35,8 @@ export interface ErrorSlots {
|
|
|
35
35
|
links(props?: {}): any;
|
|
36
36
|
}
|
|
37
37
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ErrorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ErrorProps> & Readonly<{}>, {
|
|
38
|
-
clear: boolean | Partial<ButtonProps>;
|
|
39
38
|
redirect: string;
|
|
39
|
+
clear: boolean | Partial<ButtonProps>;
|
|
40
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ErrorSlots>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
|
42
42
|
export default _default;
|