@bitrix24/b24ui-nuxt 2.0.9 → 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 +77776 -42923
- package/dist/meta.mjs +77776 -42923
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -3
- 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 +2 -1
- package/dist/runtime/components/Form.vue.d.ts +2 -1
- 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 +1 -1
- package/dist/runtime/components/Modal.vue.d.ts +1 -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/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/types/html.d.ts +8 -0
- package/dist/runtime/types/html.js +0 -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.4XNR9Ysu.mjs → b24ui-nuxt.CXLCGBie.mjs} +135 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +24 -14
|
@@ -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;
|
|
@@ -2,9 +2,10 @@ import type { AppConfig } from '@nuxt/schema';
|
|
|
2
2
|
import type { UseFileDialogReturn } from '@vueuse/core';
|
|
3
3
|
import theme from '#build/b24ui/file-upload';
|
|
4
4
|
import type { ButtonProps, IconComponent } from '../types';
|
|
5
|
+
import type { InputHTMLAttributes } from '../types/html';
|
|
5
6
|
import type { ComponentConfig } from '../types/tv';
|
|
6
7
|
type FileUpload = ComponentConfig<typeof theme, AppConfig, 'fileUpload'>;
|
|
7
|
-
export interface FileUploadProps<M extends boolean = false> {
|
|
8
|
+
export interface FileUploadProps<M extends boolean = false> extends /** @vue-ignore */ Pick<InputHTMLAttributes, 'form' | 'formaction' | 'formenctype' | 'formmethod' | 'formnovalidate' | 'formtarget'> {
|
|
8
9
|
/**
|
|
9
10
|
* The element or component this component should render as.
|
|
10
11
|
* @defaultValue 'div'
|
|
@@ -156,7 +157,7 @@ declare const __VLS_export: <M extends boolean = false>(__VLS_props: NonNullable
|
|
|
156
157
|
"onUpdate:modelValue"?: ((value: (M extends true ? File[] : File) | null | undefined) => any) | undefined;
|
|
157
158
|
}> & import("vue").PublicProps;
|
|
158
159
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
159
|
-
inputRef: import("vue").Ref<HTMLInputElement
|
|
160
|
+
inputRef: Readonly<import("vue").Ref<HTMLInputElement, HTMLInputElement>>;
|
|
160
161
|
dropzoneRef: import("vue").Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
|
|
161
162
|
}>) => void;
|
|
162
163
|
attrs: any;
|
|
@@ -3,8 +3,8 @@ import theme from "#build/b24ui/file-upload";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { computed, watch } from "vue";
|
|
7
|
-
import { Primitive } from "reka-ui";
|
|
6
|
+
import { computed, toRef, watch } from "vue";
|
|
7
|
+
import { Primitive, VisuallyHidden } from "reka-ui";
|
|
8
8
|
import { createReusableTemplate } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig, useLocale } from "#imports";
|
|
10
10
|
import { useFormField } from "../composables/useFormField";
|
|
@@ -122,13 +122,13 @@ function removeFile(index) {
|
|
|
122
122
|
dropzoneRef.value?.focus();
|
|
123
123
|
}
|
|
124
124
|
watch(modelValue, (newValue) => {
|
|
125
|
-
const hasModelReset = !
|
|
125
|
+
const hasModelReset = props.multiple ? !newValue?.length : !newValue;
|
|
126
126
|
if (hasModelReset && inputRef.value) {
|
|
127
|
-
inputRef.value.value = "";
|
|
127
|
+
inputRef.value.$el.value = "";
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
defineExpose({
|
|
131
|
-
inputRef,
|
|
131
|
+
inputRef: toRef(() => inputRef.value?.$el),
|
|
132
132
|
dropzoneRef
|
|
133
133
|
});
|
|
134
134
|
</script>
|
|
@@ -254,18 +254,18 @@ defineExpose({
|
|
|
254
254
|
<ReuseFilesTemplate v-if="position === 'outside'" />
|
|
255
255
|
</slot>
|
|
256
256
|
|
|
257
|
-
<
|
|
257
|
+
<VisuallyHidden
|
|
258
258
|
:id="id"
|
|
259
259
|
ref="inputRef"
|
|
260
|
+
as="input"
|
|
260
261
|
type="file"
|
|
262
|
+
feature="fully-hidden"
|
|
261
263
|
:name="name"
|
|
262
264
|
:accept="accept"
|
|
263
265
|
:multiple="multiple"
|
|
264
266
|
:required="required"
|
|
265
267
|
:disabled="disabled"
|
|
266
268
|
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
267
|
-
|
|
268
|
-
tabindex="-1"
|
|
269
|
-
>
|
|
269
|
+
/>
|
|
270
270
|
</Primitive>
|
|
271
271
|
</template>
|
|
@@ -2,9 +2,10 @@ import type { AppConfig } from '@nuxt/schema';
|
|
|
2
2
|
import type { UseFileDialogReturn } from '@vueuse/core';
|
|
3
3
|
import theme from '#build/b24ui/file-upload';
|
|
4
4
|
import type { ButtonProps, IconComponent } from '../types';
|
|
5
|
+
import type { InputHTMLAttributes } from '../types/html';
|
|
5
6
|
import type { ComponentConfig } from '../types/tv';
|
|
6
7
|
type FileUpload = ComponentConfig<typeof theme, AppConfig, 'fileUpload'>;
|
|
7
|
-
export interface FileUploadProps<M extends boolean = false> {
|
|
8
|
+
export interface FileUploadProps<M extends boolean = false> extends /** @vue-ignore */ Pick<InputHTMLAttributes, 'form' | 'formaction' | 'formenctype' | 'formmethod' | 'formnovalidate' | 'formtarget'> {
|
|
8
9
|
/**
|
|
9
10
|
* The element or component this component should render as.
|
|
10
11
|
* @defaultValue 'div'
|
|
@@ -156,7 +157,7 @@ declare const __VLS_export: <M extends boolean = false>(__VLS_props: NonNullable
|
|
|
156
157
|
"onUpdate:modelValue"?: ((value: (M extends true ? File[] : File) | null | undefined) => any) | undefined;
|
|
157
158
|
}> & import("vue").PublicProps;
|
|
158
159
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
159
|
-
inputRef: import("vue").Ref<HTMLInputElement
|
|
160
|
+
inputRef: Readonly<import("vue").Ref<HTMLInputElement, HTMLInputElement>>;
|
|
160
161
|
dropzoneRef: import("vue").Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
|
|
161
162
|
}>) => void;
|
|
162
163
|
attrs: any;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, FormErrorWithId, InferInput, FormData } from '../types/form';
|
|
2
|
+
import type { FormHTMLAttributes } from '../types/html';
|
|
2
3
|
export type FormProps<S extends FormSchema, T extends boolean = true, N extends boolean = false> = {
|
|
3
4
|
id?: string | number;
|
|
4
5
|
/** Schema to validate the form state. Supports Standard Schema objects, Yup, Joi, and Superstructs. */
|
|
@@ -47,7 +48,7 @@ export type FormProps<S extends FormSchema, T extends boolean = true, N extends
|
|
|
47
48
|
loadingAuto?: boolean;
|
|
48
49
|
class?: any;
|
|
49
50
|
onSubmit?: ((event: FormSubmitEvent<FormData<S, T>>) => void | Promise<void>) | (() => void | Promise<void>);
|
|
50
|
-
}
|
|
51
|
+
} & /** @vue-ignore */ Omit<FormHTMLAttributes, 'name'>;
|
|
51
52
|
export interface FormEmits<S extends FormSchema, T extends boolean = true> {
|
|
52
53
|
submit: [event: FormSubmitEvent<FormData<S, T>>];
|
|
53
54
|
error: [event: FormErrorEvent];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, FormErrorWithId, InferInput, FormData } from '../types/form';
|
|
2
|
+
import type { FormHTMLAttributes } from '../types/html';
|
|
2
3
|
export type FormProps<S extends FormSchema, T extends boolean = true, N extends boolean = false> = {
|
|
3
4
|
id?: string | number;
|
|
4
5
|
/** Schema to validate the form state. Supports Standard Schema objects, Yup, Joi, and Superstructs. */
|
|
@@ -47,7 +48,7 @@ export type FormProps<S extends FormSchema, T extends boolean = true, N extends
|
|
|
47
48
|
loadingAuto?: boolean;
|
|
48
49
|
class?: any;
|
|
49
50
|
onSubmit?: ((event: FormSubmitEvent<FormData<S, T>>) => void | Promise<void>) | (() => void | Promise<void>);
|
|
50
|
-
}
|
|
51
|
+
} & /** @vue-ignore */ Omit<FormHTMLAttributes, 'name'>;
|
|
51
52
|
export interface FormEmits<S extends FormSchema, T extends boolean = true> {
|
|
52
53
|
submit: [event: FormSubmitEvent<FormData<S, T>>];
|
|
53
54
|
error: [event: FormErrorEvent];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { InputHTMLAttributes } from 'vue';
|
|
2
1
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
2
|
import theme from '#build/b24ui/input';
|
|
4
3
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
5
4
|
import type { BadgeProps } from '../types';
|
|
5
|
+
import type { InputHTMLAttributes } from '../types/html';
|
|
6
6
|
import type { ModelModifiers } from '../types/input';
|
|
7
7
|
import type { AcceptableValue } from '../types/utils';
|
|
8
8
|
import type { ComponentConfig } from '../types/tv';
|
|
9
9
|
type Input = ComponentConfig<typeof theme, AppConfig, 'input'>;
|
|
10
10
|
export type InputValue = AcceptableValue;
|
|
11
|
-
export interface InputProps<T extends InputValue = InputValue> extends UseComponentIconsProps {
|
|
11
|
+
export interface InputProps<T extends InputValue = InputValue> extends UseComponentIconsProps, /** @vue-ignore */ Omit<InputHTMLAttributes, 'name' | 'type' | 'placeholder' | 'required' | 'autocomplete' | 'autofocus' | 'disabled'> {
|
|
12
12
|
/**
|
|
13
13
|
* The element or component this component should render as.
|
|
14
14
|
* @defaultValue 'div'
|
|
@@ -43,7 +43,7 @@ export interface InputProps<T extends InputValue = InputValue> extends UseCompon
|
|
|
43
43
|
*/
|
|
44
44
|
underline?: boolean;
|
|
45
45
|
/**
|
|
46
|
-
* Rounds the corners of the
|
|
46
|
+
* Rounds the corners of the input
|
|
47
47
|
* @defaultValue false
|
|
48
48
|
*/
|
|
49
49
|
rounded?: boolean;
|
|
@@ -76,7 +76,7 @@ export interface InputProps<T extends InputValue = InputValue> extends UseCompon
|
|
|
76
76
|
highlight?: boolean;
|
|
77
77
|
modelValue?: T;
|
|
78
78
|
defaultValue?: T;
|
|
79
|
-
modelModifiers?: ModelModifiers
|
|
79
|
+
modelModifiers?: ModelModifiers<T>;
|
|
80
80
|
class?: any;
|
|
81
81
|
b24ui?: Input['slots'];
|
|
82
82
|
}
|
|
@@ -98,16 +98,16 @@ export interface InputSlots {
|
|
|
98
98
|
}
|
|
99
99
|
declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
100
100
|
props: __VLS_PrettifyLocal<InputProps<T> & {
|
|
101
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
102
101
|
onChange?: ((event: Event) => any) | undefined;
|
|
102
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
103
103
|
"onUpdate:modelValue"?: ((value: T) => any) | undefined;
|
|
104
104
|
}> & import("vue").PublicProps;
|
|
105
105
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
106
|
-
inputRef: import("vue").
|
|
106
|
+
inputRef: Readonly<import("vue").ShallowRef<HTMLInputElement | null>>;
|
|
107
107
|
}>) => void;
|
|
108
108
|
attrs: any;
|
|
109
109
|
slots: InputSlots;
|
|
110
|
-
emit: ((evt: "
|
|
110
|
+
emit: ((evt: "change", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "update:modelValue", value: T) => void);
|
|
111
111
|
}>) => import("vue").VNode & {
|
|
112
112
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
113
113
|
};
|
|
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/input";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import {
|
|
6
|
+
import { useTemplateRef, computed, onMounted } from "vue";
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useVModel } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
@@ -71,7 +71,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.input |
|
|
|
71
71
|
trailing: Boolean(isTrailing.value || !!slots.trailing),
|
|
72
72
|
fieldGroup: orientation.value
|
|
73
73
|
}));
|
|
74
|
-
const inputRef =
|
|
74
|
+
const inputRef = useTemplateRef("inputRef");
|
|
75
75
|
function updateInput(value) {
|
|
76
76
|
if (props.modelModifiers?.trim) {
|
|
77
77
|
value = value?.trim() ?? null;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { InputHTMLAttributes } from 'vue';
|
|
2
1
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
2
|
import theme from '#build/b24ui/input';
|
|
4
3
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
5
4
|
import type { BadgeProps } from '../types';
|
|
5
|
+
import type { InputHTMLAttributes } from '../types/html';
|
|
6
6
|
import type { ModelModifiers } from '../types/input';
|
|
7
7
|
import type { AcceptableValue } from '../types/utils';
|
|
8
8
|
import type { ComponentConfig } from '../types/tv';
|
|
9
9
|
type Input = ComponentConfig<typeof theme, AppConfig, 'input'>;
|
|
10
10
|
export type InputValue = AcceptableValue;
|
|
11
|
-
export interface InputProps<T extends InputValue = InputValue> extends UseComponentIconsProps {
|
|
11
|
+
export interface InputProps<T extends InputValue = InputValue> extends UseComponentIconsProps, /** @vue-ignore */ Omit<InputHTMLAttributes, 'name' | 'type' | 'placeholder' | 'required' | 'autocomplete' | 'autofocus' | 'disabled'> {
|
|
12
12
|
/**
|
|
13
13
|
* The element or component this component should render as.
|
|
14
14
|
* @defaultValue 'div'
|
|
@@ -43,7 +43,7 @@ export interface InputProps<T extends InputValue = InputValue> extends UseCompon
|
|
|
43
43
|
*/
|
|
44
44
|
underline?: boolean;
|
|
45
45
|
/**
|
|
46
|
-
* Rounds the corners of the
|
|
46
|
+
* Rounds the corners of the input
|
|
47
47
|
* @defaultValue false
|
|
48
48
|
*/
|
|
49
49
|
rounded?: boolean;
|
|
@@ -76,7 +76,7 @@ export interface InputProps<T extends InputValue = InputValue> extends UseCompon
|
|
|
76
76
|
highlight?: boolean;
|
|
77
77
|
modelValue?: T;
|
|
78
78
|
defaultValue?: T;
|
|
79
|
-
modelModifiers?: ModelModifiers
|
|
79
|
+
modelModifiers?: ModelModifiers<T>;
|
|
80
80
|
class?: any;
|
|
81
81
|
b24ui?: Input['slots'];
|
|
82
82
|
}
|
|
@@ -98,16 +98,16 @@ export interface InputSlots {
|
|
|
98
98
|
}
|
|
99
99
|
declare const __VLS_export: <T extends InputValue>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
100
100
|
props: __VLS_PrettifyLocal<InputProps<T> & {
|
|
101
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
102
101
|
onChange?: ((event: Event) => any) | undefined;
|
|
102
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
103
103
|
"onUpdate:modelValue"?: ((value: T) => any) | undefined;
|
|
104
104
|
}> & import("vue").PublicProps;
|
|
105
105
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
106
|
-
inputRef: import("vue").
|
|
106
|
+
inputRef: Readonly<import("vue").ShallowRef<HTMLInputElement | null>>;
|
|
107
107
|
}>) => void;
|
|
108
108
|
attrs: any;
|
|
109
109
|
slots: InputSlots;
|
|
110
|
-
emit: ((evt: "
|
|
110
|
+
emit: ((evt: "change", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "update:modelValue", value: T) => void);
|
|
111
111
|
}>) => import("vue").VNode & {
|
|
112
112
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
113
113
|
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ComponentPublicInstance } from 'vue';
|
|
2
|
+
import type { DateFieldRootProps, DateFieldRootEmits, DateRangeFieldRootProps, DateRangeFieldRootEmits, DateValue } from 'reka-ui';
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
4
|
+
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
5
|
+
import type { BadgeProps, IconComponent } from '../types';
|
|
6
|
+
import type { ComponentConfig } from '../types/tv';
|
|
7
|
+
import theme from '#build/b24ui/input-date';
|
|
8
|
+
type InputDate = ComponentConfig<typeof theme, AppConfig, 'inputDate'>;
|
|
9
|
+
type _DateFieldRootProps = Omit<DateFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'locale'>;
|
|
10
|
+
type _RangeDateFieldRootProps = Omit<DateRangeFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'locale'>;
|
|
11
|
+
type InputDateDefaultValue<R extends boolean = false> = R extends true ? DateRangeFieldRootProps['defaultValue'] : DateFieldRootProps['defaultValue'];
|
|
12
|
+
type InputDateModelValue<R extends boolean = false> = (R extends true ? DateRangeFieldRootProps['modelValue'] : DateFieldRootProps['modelValue']) | undefined;
|
|
13
|
+
export interface InputDateProps<R extends boolean = false> extends UseComponentIconsProps, _DateFieldRootProps, _RangeDateFieldRootProps {
|
|
14
|
+
/**
|
|
15
|
+
* The element or component this component should render as.
|
|
16
|
+
* @defaultValue 'div'
|
|
17
|
+
*/
|
|
18
|
+
as?: any;
|
|
19
|
+
/**
|
|
20
|
+
* @defaultValue 'air-primary'
|
|
21
|
+
*/
|
|
22
|
+
color?: InputDate['variants']['color'];
|
|
23
|
+
/**
|
|
24
|
+
* @defaultValue 'md'
|
|
25
|
+
*/
|
|
26
|
+
size?: InputDate['variants']['size'];
|
|
27
|
+
/**
|
|
28
|
+
* Removes padding from input
|
|
29
|
+
* @defaultValue false
|
|
30
|
+
*/
|
|
31
|
+
noPadding?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Removes all borders (rings)
|
|
34
|
+
* @defaultValue false
|
|
35
|
+
*/
|
|
36
|
+
noBorder?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Removes all borders (rings) except the bottom one
|
|
39
|
+
* @defaultValue false
|
|
40
|
+
*/
|
|
41
|
+
underline?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Rounds the corners of the input
|
|
44
|
+
* @defaultValue false
|
|
45
|
+
*/
|
|
46
|
+
rounded?: boolean;
|
|
47
|
+
tag?: string;
|
|
48
|
+
/**
|
|
49
|
+
* @defaultValue 'air-primary'
|
|
50
|
+
*/
|
|
51
|
+
tagColor?: BadgeProps['color'];
|
|
52
|
+
/** Highlight the ring color like a focus state. */
|
|
53
|
+
highlight?: boolean;
|
|
54
|
+
autofocus?: boolean;
|
|
55
|
+
autofocusDelay?: number;
|
|
56
|
+
/**
|
|
57
|
+
* The icon to use as a range separator.
|
|
58
|
+
* @defaultValue icons.minus
|
|
59
|
+
* @IconComponent
|
|
60
|
+
*/
|
|
61
|
+
separatorIcon?: IconComponent;
|
|
62
|
+
/** Whether or not a range of dates can be selected */
|
|
63
|
+
range?: R & boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The locale to use for formatting and parsing numbers.
|
|
66
|
+
* @defaultValue B24App.locale.code
|
|
67
|
+
*/
|
|
68
|
+
locale?: string;
|
|
69
|
+
defaultValue?: InputDateDefaultValue<R>;
|
|
70
|
+
modelValue?: InputDateModelValue<R>;
|
|
71
|
+
class?: any;
|
|
72
|
+
b24ui?: InputDate['slots'];
|
|
73
|
+
}
|
|
74
|
+
export interface InputDateEmits<R extends boolean> extends Omit<DateFieldRootEmits & DateRangeFieldRootEmits, 'update:modelValue'> {
|
|
75
|
+
'update:modelValue': [date: InputDateModelValue<R>];
|
|
76
|
+
'change': [event: Event];
|
|
77
|
+
'blur': [event: FocusEvent];
|
|
78
|
+
'focus': [event: FocusEvent];
|
|
79
|
+
}
|
|
80
|
+
export interface InputDateSlots {
|
|
81
|
+
leading(props: {
|
|
82
|
+
b24ui: InputDate['b24ui'];
|
|
83
|
+
}): any;
|
|
84
|
+
default(props: {
|
|
85
|
+
b24ui: InputDate['b24ui'];
|
|
86
|
+
}): any;
|
|
87
|
+
trailing(props: {
|
|
88
|
+
b24ui: InputDate['b24ui'];
|
|
89
|
+
}): any;
|
|
90
|
+
separator(props: {
|
|
91
|
+
b24ui: InputDate['b24ui'];
|
|
92
|
+
}): any;
|
|
93
|
+
}
|
|
94
|
+
declare const __VLS_export: <R extends boolean>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
95
|
+
props: __VLS_PrettifyLocal<InputDateProps<R> & {
|
|
96
|
+
onChange?: ((event: Event) => any) | undefined;
|
|
97
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
98
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
99
|
+
"onUpdate:modelValue"?: ((date: InputDateModelValue<R>) => any) | undefined;
|
|
100
|
+
"onUpdate:placeholder"?: ((...args: DateValue[]) => any) | undefined;
|
|
101
|
+
}> & import("vue").PublicProps;
|
|
102
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
103
|
+
inputsRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
|
|
104
|
+
}>) => void;
|
|
105
|
+
attrs: any;
|
|
106
|
+
slots: InputDateSlots;
|
|
107
|
+
emit: ((evt: "change", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "update:modelValue", date: InputDateModelValue<R>) => void) & ((evt: "update:placeholder", ...args: [date: DateValue] & [date: DateValue]) => void);
|
|
108
|
+
}>) => import("vue").VNode & {
|
|
109
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
110
|
+
};
|
|
111
|
+
declare const _default: typeof __VLS_export;
|
|
112
|
+
export default _default;
|
|
113
|
+
type __VLS_PrettifyLocal<T> = {
|
|
114
|
+
[K in keyof T as K]: T[K];
|
|
115
|
+
} & {};
|