@kuina-ui/vue 0.2.0 → 0.3.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/components/alert/Alert.vue.d.ts +2 -0
- package/dist/components/date-picker/DateCalendar.vue.d.ts +40 -0
- package/dist/components/date-picker/DateCalendarMonth.vue.d.ts +27 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +44 -0
- package/dist/components/date-picker/DatePickerPanel.vue.d.ts +33 -0
- package/dist/components/date-picker/DateRangePicker.vue.d.ts +54 -0
- package/dist/components/date-picker/date-calendar.theme.d.ts +69 -0
- package/dist/components/date-picker/date-picker.theme.d.ts +19 -0
- package/dist/components/date-picker/datePickerProps.d.ts +39 -0
- package/dist/components/date-picker/index.d.ts +4 -0
- package/dist/components/date-picker/useDatePickerPopover.d.ts +21 -0
- package/dist/components/menu/Menu.vue.d.ts +2 -2
- package/dist/components/select/Select.vue.d.ts +81 -0
- package/dist/components/select/SelectField.vue.d.ts +70 -0
- package/dist/components/select/SelectOptionRow.vue.d.ts +33 -0
- package/dist/components/select/SelectPanel.vue.d.ts +67 -0
- package/dist/components/select/index.d.ts +6 -0
- package/dist/components/select/select-field.theme.d.ts +250 -0
- package/dist/components/select/select-panel.theme.d.ts +55 -0
- package/dist/components/select/selectOptions.d.ts +43 -0
- package/dist/components/select/useSelectControl.d.ts +77 -0
- package/dist/components/select/useSelectListbox.d.ts +48 -0
- package/dist/components/text-field/TextField.vue.d.ts +3 -0
- package/dist/components/text-field/text-field.theme.d.ts +6 -1
- package/dist/components/textarea/Textarea.vue.d.ts +3 -0
- package/dist/components/textarea/textarea.theme.d.ts +6 -1
- package/dist/elements/select-control/SelectControl.vue.d.ts +56 -0
- package/dist/elements/select-control/index.d.ts +3 -0
- package/dist/elements/select-control/select-control.theme.d.ts +87 -0
- package/dist/elements/text-link/TextLink.vue.d.ts +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/shared/composables/useCalendarLabels.d.ts +19 -0
- package/dist/shared/types/calendar.d.ts +14 -0
- package/dist/shared/utils/calendarMonth.d.ts +5 -0
- package/dist/shared/utils/createDateFormatters.d.ts +9 -0
- package/dist/shared/utils/floatingPanelTransition.d.ts +9 -0
- package/dist/shared/utils/isoDate.d.ts +18 -0
- package/dist/src-Cl5gtlze.js +6369 -0
- package/package.json +1 -1
- package/dist/src-Cn6KXW0m.js +0 -3486
|
@@ -10,6 +10,7 @@ export interface AlertProps {
|
|
|
10
10
|
showIcon?: boolean;
|
|
11
11
|
actionsPlacement?: AlertThemeVariants['actionsPlacement'];
|
|
12
12
|
closable?: boolean;
|
|
13
|
+
closeLabel?: string;
|
|
13
14
|
ui?: Partial<Record<AlertSlotName, ClassNameValue>>;
|
|
14
15
|
class?: ClassNameValue;
|
|
15
16
|
}
|
|
@@ -28,6 +29,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<AlertP
|
|
|
28
29
|
color: "primary" | "danger" | "success" | "warning" | "caution" | "info" | "discovery";
|
|
29
30
|
actionsPlacement: "end" | "bottom";
|
|
30
31
|
showIcon: boolean;
|
|
32
|
+
closeLabel: string;
|
|
31
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
32
34
|
title?: (props: {}) => any;
|
|
33
35
|
} & {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { DateOrDateRange, Weekday } from '../../shared/types/calendar';
|
|
2
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
|
+
import { type DateCalendarSlotName } from './date-calendar.theme';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
initialMonth: string;
|
|
6
|
+
initialFocusedDate: string;
|
|
7
|
+
monthCount?: number;
|
|
8
|
+
selectedStart?: string;
|
|
9
|
+
selectedEnd?: string;
|
|
10
|
+
min?: string;
|
|
11
|
+
max?: string;
|
|
12
|
+
disabledDates?: DateOrDateRange[];
|
|
13
|
+
isDateDisabled?: (isoDate: string) => boolean;
|
|
14
|
+
weekStartsOn: Weekday;
|
|
15
|
+
weekdayLabel: (weekday: Weekday) => string;
|
|
16
|
+
monthLabel: (isoMonth: string) => string;
|
|
17
|
+
dayLabel: (isoDate: string) => string;
|
|
18
|
+
previousMonthLabel: string;
|
|
19
|
+
nextMonthLabel: string;
|
|
20
|
+
ui?: Partial<Record<DateCalendarSlotName, ClassNameValue>>;
|
|
21
|
+
};
|
|
22
|
+
/** Bring a date into view: slide one month when it is next to the visible ones, else jump to it without sliding. */
|
|
23
|
+
declare function revealDate(isoDate: string): void;
|
|
24
|
+
declare function focusTabbableDay(): void;
|
|
25
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
26
|
+
focusTabbableDay: typeof focusTabbableDay;
|
|
27
|
+
revealDate: typeof revealDate;
|
|
28
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
+
selectDate: (isoDate: string) => any;
|
|
30
|
+
hoverDate: (isoDate: string) => any;
|
|
31
|
+
leaveDates: () => any;
|
|
32
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
33
|
+
onSelectDate?: ((isoDate: string) => any) | undefined;
|
|
34
|
+
onHoverDate?: ((isoDate: string) => any) | undefined;
|
|
35
|
+
onLeaveDates?: (() => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
monthCount: number;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const _default: typeof __VLS_export;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CalendarMonth, Weekday } from '../../shared/types/calendar';
|
|
2
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
|
+
import { type DateCalendarSlotName } from './date-calendar.theme';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
calendarMonth: CalendarMonth;
|
|
6
|
+
weekdays: Weekday[];
|
|
7
|
+
selectedStart?: string;
|
|
8
|
+
selectedEnd?: string;
|
|
9
|
+
tabbableDate: string;
|
|
10
|
+
today: string;
|
|
11
|
+
isDateUnavailable: (isoDate: string) => boolean;
|
|
12
|
+
weekdayLabel: (weekday: Weekday) => string;
|
|
13
|
+
monthLabel: (isoMonth: string) => string;
|
|
14
|
+
dayLabel: (isoDate: string) => string;
|
|
15
|
+
ui?: Partial<Record<DateCalendarSlotName, ClassNameValue>>;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
selectDate: (isoDate: string) => any;
|
|
19
|
+
hoverDate: (isoDate: string) => any;
|
|
20
|
+
keydownDate: (keyboardEvent: KeyboardEvent, isoDate: string) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
onSelectDate?: ((isoDate: string) => any) | undefined;
|
|
23
|
+
onHoverDate?: ((isoDate: string) => any) | undefined;
|
|
24
|
+
onKeydownDate?: ((keyboardEvent: KeyboardEvent, isoDate: string) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { DatePickerBaseProps } from './datePickerProps';
|
|
2
|
+
export interface DatePickerProps extends DatePickerBaseProps {
|
|
3
|
+
selectionLabel?: (selectedDate: string) => string;
|
|
4
|
+
}
|
|
5
|
+
export interface DatePickerSlots {
|
|
6
|
+
selection?: (selectionSlotProps: {
|
|
7
|
+
selectedDate: string;
|
|
8
|
+
}) => unknown;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DatePickerProps & {
|
|
13
|
+
modelValue?: string;
|
|
14
|
+
open?: boolean;
|
|
15
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
"update:open": (value: boolean) => any;
|
|
17
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<DatePickerProps & {
|
|
19
|
+
modelValue?: string;
|
|
20
|
+
open?: boolean;
|
|
21
|
+
}> & Readonly<{
|
|
22
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
23
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
pill: boolean;
|
|
26
|
+
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
27
|
+
variant: "soft" | "outline" | "ghost";
|
|
28
|
+
block: boolean;
|
|
29
|
+
clearLabel: string;
|
|
30
|
+
placeholder: string;
|
|
31
|
+
side: import("../../shared/types/floating-position.ts").FloatingSide;
|
|
32
|
+
align: import("../../shared/types/floating-position.ts").FloatingAlign;
|
|
33
|
+
weekStartsOn: import("../../index.ts").Weekday;
|
|
34
|
+
previousMonthLabel: string;
|
|
35
|
+
nextMonthLabel: string;
|
|
36
|
+
flip: boolean;
|
|
37
|
+
strategy: import("../../shared/types/floating-position.ts").FloatingStrategy;
|
|
38
|
+
locale: string;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DatePickerSlots>;
|
|
40
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
|
|
2
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
anchorElement: HTMLElement | null | undefined;
|
|
7
|
+
side: FloatingSide;
|
|
8
|
+
align: FloatingAlign;
|
|
9
|
+
flip: boolean;
|
|
10
|
+
strategy: FloatingStrategy;
|
|
11
|
+
panelClass?: ClassNameValue;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_template: () => {
|
|
14
|
+
__VLS_Slots: {
|
|
15
|
+
default?: (props: {}) => any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
19
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
20
|
+
panelElement: Readonly<import("vue").ShallowRef<HTMLElement | null>>;
|
|
21
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
positioned: () => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
24
|
+
onPositioned?: (() => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { DateRange } from '../../shared/types/calendar';
|
|
2
|
+
import type { DatePickerBaseProps } from './datePickerProps';
|
|
3
|
+
export type { DateRange };
|
|
4
|
+
export interface DateRangeShortcut {
|
|
5
|
+
label: string;
|
|
6
|
+
value: DateRange;
|
|
7
|
+
}
|
|
8
|
+
export interface DateRangePickerProps extends DatePickerBaseProps {
|
|
9
|
+
shortcuts?: DateRangeShortcut[];
|
|
10
|
+
maxRangeDays?: number;
|
|
11
|
+
selectionLabel?: (selectedRange: DateRange, activeShortcut?: DateRangeShortcut) => string;
|
|
12
|
+
}
|
|
13
|
+
export interface DateRangePickerSlots {
|
|
14
|
+
selection?: (selectionSlotProps: {
|
|
15
|
+
selectedRange: DateRange;
|
|
16
|
+
activeShortcut?: DateRangeShortcut;
|
|
17
|
+
}) => unknown;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DateRangePickerProps & {
|
|
22
|
+
modelValue?: DateRange;
|
|
23
|
+
open?: boolean;
|
|
24
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
+
"update:open": (value: boolean) => any;
|
|
26
|
+
"update:modelValue": (value: DateRange | undefined) => any;
|
|
27
|
+
}, string, import("vue").PublicProps, Readonly<DateRangePickerProps & {
|
|
28
|
+
modelValue?: DateRange;
|
|
29
|
+
open?: boolean;
|
|
30
|
+
}> & Readonly<{
|
|
31
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
32
|
+
"onUpdate:modelValue"?: ((value: DateRange | undefined) => any) | undefined;
|
|
33
|
+
}>, {
|
|
34
|
+
pill: boolean;
|
|
35
|
+
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
36
|
+
variant: "soft" | "outline" | "ghost";
|
|
37
|
+
block: boolean;
|
|
38
|
+
clearLabel: string;
|
|
39
|
+
placeholder: string;
|
|
40
|
+
side: import("../../shared/types/floating-position.ts").FloatingSide;
|
|
41
|
+
align: import("../../shared/types/floating-position.ts").FloatingAlign;
|
|
42
|
+
weekStartsOn: import("../../index.ts").Weekday;
|
|
43
|
+
previousMonthLabel: string;
|
|
44
|
+
nextMonthLabel: string;
|
|
45
|
+
shortcuts: DateRangeShortcut[];
|
|
46
|
+
flip: boolean;
|
|
47
|
+
strategy: import("../../shared/types/floating-position.ts").FloatingStrategy;
|
|
48
|
+
locale: string;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DateRangePickerSlots>;
|
|
50
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
51
|
+
new (): {
|
|
52
|
+
$slots: S;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type VariantProps } from '../../shared/utils/tv';
|
|
2
|
+
export declare const dateCalendarTheme: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
showsTwoMonths: {
|
|
4
|
+
true: {
|
|
5
|
+
viewport: string;
|
|
6
|
+
};
|
|
7
|
+
false: {
|
|
8
|
+
viewport: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
animatesHeight: {
|
|
12
|
+
true: {
|
|
13
|
+
viewport: string[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
calendar: string;
|
|
18
|
+
viewport: string;
|
|
19
|
+
previousMonth: string;
|
|
20
|
+
nextMonth: string;
|
|
21
|
+
monthTrack: string[];
|
|
22
|
+
month: string;
|
|
23
|
+
monthLabel: string;
|
|
24
|
+
weeks: string;
|
|
25
|
+
weekdays: string;
|
|
26
|
+
weekday: string;
|
|
27
|
+
week: string;
|
|
28
|
+
emptyDay: string;
|
|
29
|
+
}, undefined, undefined, undefined, undefined>;
|
|
30
|
+
export declare const dateCalendarDayTheme: import("tailwind-variants").TVReturnType<{
|
|
31
|
+
selected: {
|
|
32
|
+
true: {
|
|
33
|
+
day: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
inRange: {
|
|
37
|
+
true: {
|
|
38
|
+
dayCell: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
rangeStartEdge: {
|
|
42
|
+
round: {
|
|
43
|
+
dayCell: string;
|
|
44
|
+
};
|
|
45
|
+
fade: {
|
|
46
|
+
dayCell: string;
|
|
47
|
+
};
|
|
48
|
+
square: {
|
|
49
|
+
dayCell: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
rangeEndEdge: {
|
|
53
|
+
round: {
|
|
54
|
+
dayCell: string;
|
|
55
|
+
};
|
|
56
|
+
fade: {
|
|
57
|
+
dayCell: string;
|
|
58
|
+
};
|
|
59
|
+
square: {
|
|
60
|
+
dayCell: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}, {
|
|
64
|
+
dayCell: string;
|
|
65
|
+
day: string;
|
|
66
|
+
todayIndicator: string;
|
|
67
|
+
}, undefined, undefined, undefined, undefined>;
|
|
68
|
+
export type DateCalendarDayThemeVariants = VariantProps<typeof dateCalendarDayTheme>;
|
|
69
|
+
export type DateCalendarSlotName = keyof ReturnType<typeof dateCalendarTheme> | keyof ReturnType<typeof dateCalendarDayTheme>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const datePickerTheme: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
tabularSelection: {
|
|
3
|
+
true: {
|
|
4
|
+
selectionText: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
activeShortcut: {
|
|
8
|
+
true: {
|
|
9
|
+
shortcutLabel: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}, {
|
|
13
|
+
panel: string;
|
|
14
|
+
selectionText: string;
|
|
15
|
+
shortcuts: string;
|
|
16
|
+
shortcutLabel: string;
|
|
17
|
+
shortcutCheckIcon: string;
|
|
18
|
+
}, undefined, undefined, undefined, undefined>;
|
|
19
|
+
export type DatePickerSlotName = keyof ReturnType<typeof datePickerTheme>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { SelectControlSlotName, SelectControlThemeVariants } from '../../elements/select-control';
|
|
3
|
+
import type { DateOrDateRange, Weekday } from '../../shared/types/calendar';
|
|
4
|
+
import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
|
|
5
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
6
|
+
import type { DateCalendarSlotName } from './date-calendar.theme';
|
|
7
|
+
import type { DatePickerSlotName } from './date-picker.theme';
|
|
8
|
+
export interface DatePickerBaseProps {
|
|
9
|
+
label: string;
|
|
10
|
+
min?: string;
|
|
11
|
+
max?: string;
|
|
12
|
+
disabledDates?: DateOrDateRange[];
|
|
13
|
+
isDateDisabled?: (isoDate: string) => boolean;
|
|
14
|
+
locale?: string;
|
|
15
|
+
weekStartsOn?: Weekday;
|
|
16
|
+
weekdayLabel?: (weekday: Weekday) => string;
|
|
17
|
+
monthLabel?: (isoMonth: string) => string;
|
|
18
|
+
dayLabel?: (isoDate: string) => string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
clearable?: boolean;
|
|
21
|
+
clearLabel?: string;
|
|
22
|
+
previousMonthLabel?: string;
|
|
23
|
+
nextMonthLabel?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
invalid?: boolean;
|
|
27
|
+
size?: SelectControlThemeVariants['size'];
|
|
28
|
+
variant?: SelectControlThemeVariants['variant'];
|
|
29
|
+
pill?: boolean;
|
|
30
|
+
block?: boolean;
|
|
31
|
+
leadingIcon?: Component | null;
|
|
32
|
+
trailingIcon?: Component | null;
|
|
33
|
+
side?: FloatingSide;
|
|
34
|
+
align?: FloatingAlign;
|
|
35
|
+
flip?: boolean;
|
|
36
|
+
strategy?: FloatingStrategy;
|
|
37
|
+
ui?: Partial<Record<SelectControlSlotName | DatePickerSlotName | DateCalendarSlotName, ClassNameValue>>;
|
|
38
|
+
class?: ClassNameValue;
|
|
39
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as KDatePicker } from './DatePicker.vue';
|
|
2
|
+
export { default as KDateRangePicker } from './DateRangePicker.vue';
|
|
3
|
+
export type { DatePickerProps, DatePickerSlots } from './DatePicker.vue';
|
|
4
|
+
export type { DateRange, DateRangePickerProps, DateRangePickerSlots, DateRangeShortcut } from './DateRangePicker.vue';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
interface DatePickerPopoverOptions {
|
|
3
|
+
isOpen: Ref<boolean>;
|
|
4
|
+
isOpenable: () => boolean;
|
|
5
|
+
rootElement: Readonly<Ref<HTMLElement | null>>;
|
|
6
|
+
triggerElement: Readonly<Ref<HTMLElement | null>>;
|
|
7
|
+
panelElement: Readonly<Ref<HTMLElement | null>>;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
}
|
|
10
|
+
/** Open and close the calendar of a date picker from its trigger, the keyboard, focus and outside clicks. */
|
|
11
|
+
export declare function useDatePickerPopover(popoverOptions: DatePickerPopoverOptions): {
|
|
12
|
+
openCalendar: () => void;
|
|
13
|
+
closeCalendar: ({ restoreFocus }: {
|
|
14
|
+
restoreFocus: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
toggleCalendar: () => void;
|
|
17
|
+
openCalendarFromTriggerKeys: (keyboardEvent: KeyboardEvent) => void;
|
|
18
|
+
closeCalendarOnEscape: (keyboardEvent: KeyboardEvent) => void;
|
|
19
|
+
closeCalendarWhenFocusLeaves: (focusEvent: FocusEvent) => void;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -64,10 +64,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<MenuPr
|
|
|
64
64
|
width: "sm" | "md" | "lg" | "xl" | "auto" | "trigger";
|
|
65
65
|
side: "bottom" | "top" | "left" | "right";
|
|
66
66
|
align: "end" | "start" | "center";
|
|
67
|
+
flip: boolean;
|
|
68
|
+
strategy: FloatingStrategy;
|
|
67
69
|
indicatorPosition: "end" | "start";
|
|
68
70
|
indicatorVariant: "solid" | "ghost";
|
|
69
|
-
strategy: FloatingStrategy;
|
|
70
|
-
flip: boolean;
|
|
71
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
72
72
|
trigger?: (props: {
|
|
73
73
|
open: boolean;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Component, InputHTMLAttributes } from 'vue';
|
|
2
|
+
import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
|
|
3
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
4
|
+
import type { SelectPanelSlotName } from './select-panel.theme';
|
|
5
|
+
import type { SelectControlSlotName, SelectControlThemeVariants } from '../../elements/select-control';
|
|
6
|
+
import type { SelectOption, SelectOptionEntry } from './selectOptions';
|
|
7
|
+
import type { SelectAction } from './useSelectListbox';
|
|
8
|
+
type ValueAtFieldPath<SourceOption, FieldPath extends string> = FieldPath extends `${infer FieldName}.${infer RemainingPath}` ? FieldName extends keyof SourceOption ? ValueAtFieldPath<NonNullable<SourceOption[FieldName]>, RemainingPath> : unknown : FieldPath extends keyof SourceOption ? SourceOption[FieldPath] : unknown;
|
|
9
|
+
export type SelectOptionValue<SourceOption, ValueKey extends string> = SourceOption extends string | number ? SourceOption : ValueAtFieldPath<SourceOption, ValueKey>;
|
|
10
|
+
export type SelectModelValue<SourceOption, ValueKey extends string, Multiple extends boolean> = Multiple extends true ? SelectOptionValue<SourceOption, ValueKey>[] : SelectOptionValue<SourceOption, ValueKey> | undefined;
|
|
11
|
+
export interface SelectProps<SourceOption = SelectOption, ValueKey extends string = 'value', Multiple extends boolean = false> {
|
|
12
|
+
label: string;
|
|
13
|
+
options: SelectOptionEntry<SourceOption>[];
|
|
14
|
+
multiple?: Multiple & boolean;
|
|
15
|
+
valueKey?: ValueKey;
|
|
16
|
+
labelKey?: string;
|
|
17
|
+
descriptionKey?: string;
|
|
18
|
+
avatarKey?: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
searchable?: boolean;
|
|
21
|
+
searchPlacement?: 'list' | 'field';
|
|
22
|
+
searchPlaceholder?: string;
|
|
23
|
+
clearable?: boolean;
|
|
24
|
+
clearLabel?: string;
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
loadingPlaceholder?: string;
|
|
27
|
+
noResultsLabel?: (searchQuery: string) => string;
|
|
28
|
+
selectionLabel?: (selectedOptions: SourceOption[]) => string;
|
|
29
|
+
actions?: SelectAction[];
|
|
30
|
+
name?: string;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
invalid?: boolean;
|
|
33
|
+
size?: SelectControlThemeVariants['size'];
|
|
34
|
+
variant?: SelectControlThemeVariants['variant'];
|
|
35
|
+
pill?: boolean;
|
|
36
|
+
block?: boolean;
|
|
37
|
+
leadingIcon?: Component;
|
|
38
|
+
trailingIcon?: Component | null;
|
|
39
|
+
side?: FloatingSide;
|
|
40
|
+
align?: FloatingAlign;
|
|
41
|
+
flip?: boolean;
|
|
42
|
+
strategy?: FloatingStrategy;
|
|
43
|
+
ui?: Partial<Record<SelectControlSlotName | SelectPanelSlotName, ClassNameValue>>;
|
|
44
|
+
class?: ClassNameValue;
|
|
45
|
+
}
|
|
46
|
+
export interface SelectSlots<SourceOption> {
|
|
47
|
+
option?: (optionSlotProps: {
|
|
48
|
+
option: SourceOption;
|
|
49
|
+
selected: boolean;
|
|
50
|
+
}) => unknown;
|
|
51
|
+
selection?: (selectionSlotProps: {
|
|
52
|
+
selectedOptions: SourceOption[];
|
|
53
|
+
}) => unknown;
|
|
54
|
+
search?: (searchSlotProps: {
|
|
55
|
+
searchAttributes: InputHTMLAttributes;
|
|
56
|
+
}) => unknown;
|
|
57
|
+
}
|
|
58
|
+
declare const _default: typeof __VLS_export;
|
|
59
|
+
export default _default;
|
|
60
|
+
declare const __VLS_export: <SourceOption = SelectOption, ValueKey extends string = "value", Multiple extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
61
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(SelectProps<SourceOption, ValueKey, Multiple> & {
|
|
62
|
+
modelValue?: SelectModelValue<SourceOption, ValueKey, Multiple>;
|
|
63
|
+
open?: boolean;
|
|
64
|
+
}) & {
|
|
65
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
66
|
+
"onUpdate:modelValue"?: ((value: SelectModelValue<SourceOption, ValueKey, Multiple> | undefined) => any) | undefined;
|
|
67
|
+
}> & (typeof globalThis extends {
|
|
68
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
69
|
+
} ? P : {});
|
|
70
|
+
expose: (exposed: {}) => void;
|
|
71
|
+
attrs: any;
|
|
72
|
+
slots: SelectSlots<SourceOption>;
|
|
73
|
+
emit: ((event: "update:open", value: boolean) => void) & ((event: "update:modelValue", value: SelectModelValue<SourceOption, ValueKey, Multiple> | undefined) => void);
|
|
74
|
+
}>) => import("vue").VNode & {
|
|
75
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
76
|
+
};
|
|
77
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
78
|
+
[K in keyof T]: T[K];
|
|
79
|
+
} : {
|
|
80
|
+
[K in keyof T as K]: T[K];
|
|
81
|
+
}) & {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { SelectModelValue, SelectSlots } from './Select.vue';
|
|
2
|
+
import type { Component } from 'vue';
|
|
3
|
+
import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
|
|
4
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
5
|
+
import type { SelectFieldSlotName, SelectFieldThemeVariants } from './select-field.theme';
|
|
6
|
+
import type { SelectPanelSlotName } from './select-panel.theme';
|
|
7
|
+
import type { SelectOption, SelectOptionEntry } from './selectOptions';
|
|
8
|
+
import type { SelectAction } from './useSelectListbox';
|
|
9
|
+
export interface SelectFieldProps<SourceOption = SelectOption, ValueKey extends string = 'value', Multiple extends boolean = false> {
|
|
10
|
+
label: string;
|
|
11
|
+
options: SelectOptionEntry<SourceOption>[];
|
|
12
|
+
id?: string;
|
|
13
|
+
multiple?: Multiple & boolean;
|
|
14
|
+
valueKey?: ValueKey;
|
|
15
|
+
labelKey?: string;
|
|
16
|
+
descriptionKey?: string;
|
|
17
|
+
avatarKey?: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
searchable?: boolean;
|
|
20
|
+
searchPlacement?: 'list' | 'field';
|
|
21
|
+
searchPlaceholder?: string;
|
|
22
|
+
clearable?: boolean;
|
|
23
|
+
clearLabel?: string;
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
loadingLabel?: string;
|
|
26
|
+
noResultsLabel?: (searchQuery: string) => string;
|
|
27
|
+
selectionLabel?: (selectedOptions: SourceOption[]) => string;
|
|
28
|
+
actions?: SelectAction[];
|
|
29
|
+
name?: string;
|
|
30
|
+
hint?: string;
|
|
31
|
+
errorMessage?: string;
|
|
32
|
+
invalid?: boolean;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
size?: SelectFieldThemeVariants['size'];
|
|
35
|
+
variant?: SelectFieldThemeVariants['variant'];
|
|
36
|
+
pill?: boolean;
|
|
37
|
+
floatLabel?: SelectFieldThemeVariants['floatLabel'];
|
|
38
|
+
leadingIcon?: Component;
|
|
39
|
+
trailingIcon?: Component | null;
|
|
40
|
+
side?: FloatingSide;
|
|
41
|
+
align?: FloatingAlign;
|
|
42
|
+
flip?: boolean;
|
|
43
|
+
strategy?: FloatingStrategy;
|
|
44
|
+
ui?: Partial<Record<SelectFieldSlotName | SelectPanelSlotName, ClassNameValue>>;
|
|
45
|
+
class?: ClassNameValue;
|
|
46
|
+
}
|
|
47
|
+
declare const _default: typeof __VLS_export;
|
|
48
|
+
export default _default;
|
|
49
|
+
declare const __VLS_export: <SourceOption = SelectOption, ValueKey extends string = "value", Multiple extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
50
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(SelectFieldProps<SourceOption, ValueKey, Multiple> & {
|
|
51
|
+
modelValue?: SelectModelValue<SourceOption, ValueKey, Multiple>;
|
|
52
|
+
open?: boolean;
|
|
53
|
+
}) & {
|
|
54
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
55
|
+
"onUpdate:modelValue"?: ((value: SelectModelValue<SourceOption, ValueKey, Multiple> | undefined) => any) | undefined;
|
|
56
|
+
}> & (typeof globalThis extends {
|
|
57
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
58
|
+
} ? P : {});
|
|
59
|
+
expose: (exposed: {}) => void;
|
|
60
|
+
attrs: any;
|
|
61
|
+
slots: SelectSlots<SourceOption>;
|
|
62
|
+
emit: ((event: "update:open", value: boolean) => void) & ((event: "update:modelValue", value: SelectModelValue<SourceOption, ValueKey, Multiple> | undefined) => void);
|
|
63
|
+
}>) => import("vue").VNode & {
|
|
64
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
65
|
+
};
|
|
66
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
67
|
+
[K in keyof T]: T[K];
|
|
68
|
+
} : {
|
|
69
|
+
[K in keyof T as K]: T[K];
|
|
70
|
+
}) & {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
2
|
+
import { type SelectPanelSlotName } from './select-panel.theme';
|
|
3
|
+
import type { ResolvedSelectOption } from './selectOptions';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
resolvedOption: ResolvedSelectOption;
|
|
6
|
+
selected: boolean;
|
|
7
|
+
highlighted: boolean;
|
|
8
|
+
ui?: Partial<Record<SelectPanelSlotName, ClassNameValue>>;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_template: () => {
|
|
11
|
+
__VLS_Slots: {
|
|
12
|
+
default?: (props: {
|
|
13
|
+
option: unknown;
|
|
14
|
+
selected: boolean;
|
|
15
|
+
}) => any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
19
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
select: () => any;
|
|
21
|
+
highlight: () => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
onSelect?: (() => any) | undefined;
|
|
24
|
+
onHighlight?: (() => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from 'vue';
|
|
2
|
+
import type { FloatingAlign, FloatingSide, FloatingStrategy } from '../../shared/types/floating-position';
|
|
3
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
4
|
+
import { type SelectPanelSlotName } from './select-panel.theme';
|
|
5
|
+
import { type ResolvedSelectEntry, type ResolvedSelectOption } from './selectOptions';
|
|
6
|
+
import { type SelectAction } from './useSelectListbox';
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
listboxId: string;
|
|
9
|
+
label: string;
|
|
10
|
+
visibleEntries: ResolvedSelectEntry[];
|
|
11
|
+
isOptionSelected: (resolvedOption: ResolvedSelectOption) => boolean;
|
|
12
|
+
highlightedItemId?: string;
|
|
13
|
+
multiple: boolean;
|
|
14
|
+
showsSearchInput: boolean;
|
|
15
|
+
searchPlaceholder: string;
|
|
16
|
+
noResultsLabel: (searchQuery: string) => string;
|
|
17
|
+
actions: SelectAction[];
|
|
18
|
+
anchorElement: HTMLElement | null | undefined;
|
|
19
|
+
side: FloatingSide;
|
|
20
|
+
align: FloatingAlign;
|
|
21
|
+
flip: boolean;
|
|
22
|
+
strategy: FloatingStrategy;
|
|
23
|
+
ui?: Partial<Record<SelectPanelSlotName, ClassNameValue>>;
|
|
24
|
+
};
|
|
25
|
+
type __VLS_ModelProps = {
|
|
26
|
+
'searchQuery': string;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
29
|
+
declare const __VLS_template: () => {
|
|
30
|
+
__VLS_Slots: {
|
|
31
|
+
search?: (props: {
|
|
32
|
+
searchAttributes: InputHTMLAttributes;
|
|
33
|
+
}) => any;
|
|
34
|
+
} & {
|
|
35
|
+
option?: (props: {
|
|
36
|
+
option: unknown;
|
|
37
|
+
selected: boolean;
|
|
38
|
+
}) => any;
|
|
39
|
+
} & {
|
|
40
|
+
option?: (props: {
|
|
41
|
+
option: unknown;
|
|
42
|
+
selected: boolean;
|
|
43
|
+
}) => any;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
47
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
48
|
+
selectOption: (resolvedOption: ResolvedSelectOption<unknown>) => any;
|
|
49
|
+
runSelectAction: (selectAction: SelectAction, selectEvent: MouseEvent) => any;
|
|
50
|
+
highlightItem: (itemId: string) => any;
|
|
51
|
+
searchKeydown: (keyboardEvent: KeyboardEvent) => any;
|
|
52
|
+
"update:searchQuery": (value: string) => any;
|
|
53
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
54
|
+
onSelectOption?: ((resolvedOption: ResolvedSelectOption<unknown>) => any) | undefined;
|
|
55
|
+
onRunSelectAction?: ((selectAction: SelectAction, selectEvent: MouseEvent) => any) | undefined;
|
|
56
|
+
onHighlightItem?: ((itemId: string) => any) | undefined;
|
|
57
|
+
onSearchKeydown?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
|
|
58
|
+
"onUpdate:searchQuery"?: ((value: string) => any) | undefined;
|
|
59
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
60
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
61
|
+
declare const _default: typeof __VLS_export;
|
|
62
|
+
export default _default;
|
|
63
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
64
|
+
new (): {
|
|
65
|
+
$slots: S;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as KSelect } from './Select.vue';
|
|
2
|
+
export { default as KSelectField } from './SelectField.vue';
|
|
3
|
+
export type { SelectModelValue, SelectOptionValue, SelectProps, SelectSlots } from './Select.vue';
|
|
4
|
+
export type { SelectFieldProps } from './SelectField.vue';
|
|
5
|
+
export type { SelectOption, SelectOptionAvatar, SelectOptionEntry, SelectOptionGroup } from './selectOptions';
|
|
6
|
+
export type { SelectAction } from './useSelectListbox';
|