@uzum-tech/ui 1.12.21 → 1.13.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/index.js +2789 -510
- package/dist/index.prod.js +4 -4
- package/es/_styles/common/dark.js +1 -1
- package/es/_styles/common/light.d.ts +1 -0
- package/es/_styles/common/light.js +1 -1
- package/es/chat/src/ChatMessages.js +6 -1
- package/es/chat/src/styles/index.cssr.js +5 -1
- package/es/components.d.ts +1 -0
- package/es/components.js +1 -0
- package/es/config-provider/src/internal-interface.d.ts +3 -0
- package/es/date-picker-v2/index.d.ts +5 -0
- package/es/date-picker-v2/index.js +2 -0
- package/es/date-picker-v2/src/DatePickerV2.d.ts +4765 -0
- package/es/date-picker-v2/src/DatePickerV2.js +750 -0
- package/es/date-picker-v2/src/composables/useCalendarScroll.d.ts +1133 -0
- package/es/date-picker-v2/src/composables/useCalendarScroll.js +61 -0
- package/es/date-picker-v2/src/config.d.ts +14 -0
- package/es/date-picker-v2/src/config.js +34 -0
- package/es/date-picker-v2/src/interface.d.ts +42 -0
- package/es/date-picker-v2/src/interface.js +1 -0
- package/es/date-picker-v2/src/panel/CalendarPanel.d.ts +1222 -0
- package/es/date-picker-v2/src/panel/CalendarPanel.js +186 -0
- package/es/date-picker-v2/src/panel/CalendarRangePanel.d.ts +1246 -0
- package/es/date-picker-v2/src/panel/CalendarRangePanel.js +205 -0
- package/es/date-picker-v2/src/styles/index.cssr.d.ts +2 -0
- package/es/date-picker-v2/src/styles/index.cssr.js +190 -0
- package/es/date-picker-v2/src/utils.d.ts +12 -0
- package/es/date-picker-v2/src/utils.js +92 -0
- package/es/date-picker-v2/styles/dark.d.ts +447 -0
- package/es/date-picker-v2/styles/dark.js +19 -0
- package/es/date-picker-v2/styles/index.d.ts +3 -0
- package/es/date-picker-v2/styles/index.js +2 -0
- package/es/date-picker-v2/styles/light.d.ts +477 -0
- package/es/date-picker-v2/styles/light.js +56 -0
- package/es/dialog/src/DialogProvider.d.ts +2 -0
- package/es/header/src/Header.js +4 -1
- package/es/header/src/HeaderSearchDesktop.d.ts +12 -0
- package/es/header/src/HeaderSearchDesktop.js +21 -4
- package/es/header/src/HeaderSearchMobile.d.ts +12 -0
- package/es/header/src/HeaderSearchMobile.js +8 -2
- package/es/header/src/mobile/HeaderMobile.js +18 -3
- package/es/locales/common/enUS.js +1 -1
- package/es/theme-editor/src/ThemeEditor.d.ts +1 -0
- package/es/themes/dark.js +2 -0
- package/es/themes/light.js +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_styles/common/dark.js +1 -1
- package/lib/_styles/common/light.d.ts +1 -0
- package/lib/_styles/common/light.js +1 -1
- package/lib/chat/src/ChatMessages.js +6 -1
- package/lib/chat/src/styles/index.cssr.js +5 -1
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/config-provider/src/internal-interface.d.ts +3 -0
- package/lib/date-picker-v2/index.d.ts +5 -0
- package/lib/date-picker-v2/index.js +11 -0
- package/lib/date-picker-v2/src/DatePickerV2.d.ts +4765 -0
- package/lib/date-picker-v2/src/DatePickerV2.js +756 -0
- package/lib/date-picker-v2/src/composables/useCalendarScroll.d.ts +1133 -0
- package/lib/date-picker-v2/src/composables/useCalendarScroll.js +64 -0
- package/lib/date-picker-v2/src/config.d.ts +14 -0
- package/lib/date-picker-v2/src/config.js +37 -0
- package/lib/date-picker-v2/src/interface.d.ts +42 -0
- package/lib/date-picker-v2/src/interface.js +4 -0
- package/lib/date-picker-v2/src/panel/CalendarPanel.d.ts +1222 -0
- package/lib/date-picker-v2/src/panel/CalendarPanel.js +188 -0
- package/lib/date-picker-v2/src/panel/CalendarRangePanel.d.ts +1246 -0
- package/lib/date-picker-v2/src/panel/CalendarRangePanel.js +207 -0
- package/lib/date-picker-v2/src/styles/index.cssr.d.ts +2 -0
- package/lib/date-picker-v2/src/styles/index.cssr.js +195 -0
- package/lib/date-picker-v2/src/utils.d.ts +12 -0
- package/lib/date-picker-v2/src/utils.js +101 -0
- package/lib/date-picker-v2/styles/dark.d.ts +447 -0
- package/lib/date-picker-v2/styles/dark.js +21 -0
- package/lib/date-picker-v2/styles/index.d.ts +3 -0
- package/lib/date-picker-v2/styles/index.js +10 -0
- package/lib/date-picker-v2/styles/light.d.ts +477 -0
- package/lib/date-picker-v2/styles/light.js +60 -0
- package/lib/dialog/src/DialogProvider.d.ts +2 -0
- package/lib/header/src/Header.js +4 -1
- package/lib/header/src/HeaderSearchDesktop.d.ts +12 -0
- package/lib/header/src/HeaderSearchDesktop.js +20 -3
- package/lib/header/src/HeaderSearchMobile.d.ts +12 -0
- package/lib/header/src/HeaderSearchMobile.js +7 -1
- package/lib/header/src/mobile/HeaderMobile.js +18 -3
- package/lib/locales/common/enUS.js +1 -1
- package/lib/theme-editor/src/ThemeEditor.d.ts +1 -0
- package/lib/themes/dark.js +2 -0
- package/lib/themes/light.js +2 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/volar.d.ts +1 -0
- package/web-types.json +161 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
import { YEAR_GROUP_HEIGHT, START_YEAR, YEAR_HEADER_HEIGHT, DATE_CELL_HEIGHT, DATE_CELL_GAP, CALENDAR_MONTH_TITLE_HEIGHT, CALENDAR_MONTH_SECTION_MARGIN } from '../config';
|
|
3
|
+
export function useCalendarScroll() {
|
|
4
|
+
// Локальные рефы для scrollbar
|
|
5
|
+
const monthScrollbarRef = ref(null);
|
|
6
|
+
const yearScrollbarRef = ref(null);
|
|
7
|
+
const calendarScrollbarRef = ref(null);
|
|
8
|
+
// Прокрутить к месяцу в списке месяцев (левая колонка)
|
|
9
|
+
function scrollToMonthInMonthList(year, month) {
|
|
10
|
+
if (!monthScrollbarRef.value)
|
|
11
|
+
return;
|
|
12
|
+
const yearIndex = year - START_YEAR;
|
|
13
|
+
if (yearIndex < 0)
|
|
14
|
+
return;
|
|
15
|
+
// Позиция начала года + заголовок года + позиция месяца в году
|
|
16
|
+
const monthPosition = yearIndex * YEAR_GROUP_HEIGHT + YEAR_HEADER_HEIGHT;
|
|
17
|
+
// Отступ сверху чтобы месяц был примерно в центре видимой области (около 4-5 месяцев видно)
|
|
18
|
+
const offsetToCenter = month > 6 ? YEAR_HEADER_HEIGHT * 5 : 0;
|
|
19
|
+
monthScrollbarRef.value.scrollTo({
|
|
20
|
+
top: Math.max(0, monthPosition + offsetToCenter)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
// Прокрутить к году в dropdown
|
|
24
|
+
function scrollToYear(year) {
|
|
25
|
+
const yearIndex = year - START_YEAR;
|
|
26
|
+
if (yearIndex >= 0 && yearScrollbarRef.value) {
|
|
27
|
+
yearScrollbarRef.value.scrollTo({
|
|
28
|
+
top: yearIndex * YEAR_HEADER_HEIGHT
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function getMonthSectionHeight(rows) {
|
|
33
|
+
const safeRows = Math.max(1, rows);
|
|
34
|
+
return (CALENDAR_MONTH_TITLE_HEIGHT +
|
|
35
|
+
safeRows * DATE_CELL_HEIGHT +
|
|
36
|
+
(safeRows - 1) * DATE_CELL_GAP +
|
|
37
|
+
CALENDAR_MONTH_SECTION_MARGIN);
|
|
38
|
+
}
|
|
39
|
+
// Прокрутить к месяцу в календаре (правая колонка)
|
|
40
|
+
// Высота секции месяца зависит от количества строк (5 или 6)
|
|
41
|
+
function scrollToMonthInCalendar(month, monthRows) {
|
|
42
|
+
if (!calendarScrollbarRef.value)
|
|
43
|
+
return;
|
|
44
|
+
const safeIndex = Math.max(0, Math.min(month, monthRows.length - 1));
|
|
45
|
+
let monthPosition = 0;
|
|
46
|
+
for (let i = 0; i < safeIndex; i++) {
|
|
47
|
+
monthPosition += getMonthSectionHeight(monthRows[i]);
|
|
48
|
+
}
|
|
49
|
+
calendarScrollbarRef.value.scrollTo({
|
|
50
|
+
top: monthPosition
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
monthScrollbarRef,
|
|
55
|
+
yearScrollbarRef,
|
|
56
|
+
calendarScrollbarRef,
|
|
57
|
+
scrollToMonthInMonthList,
|
|
58
|
+
scrollToYear,
|
|
59
|
+
scrollToMonthInCalendar
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const START_YEAR = 2000;
|
|
2
|
+
export declare const END_YEAR = 2050;
|
|
3
|
+
export declare const MONTH_ITEM_HEIGHT = 48;
|
|
4
|
+
export declare const YEAR_HEADER_HEIGHT = 42;
|
|
5
|
+
export declare const MONTH_ITEM_GAP = 0;
|
|
6
|
+
export declare const YEAR_GROUP_HEIGHT: number;
|
|
7
|
+
export declare const DATE_CELL_HEIGHT = 42;
|
|
8
|
+
export declare const DATE_CELL_GAP = 4;
|
|
9
|
+
export declare const CALENDAR_MONTH_TITLE_HEIGHT = 40;
|
|
10
|
+
export declare const CALENDAR_DATE_GRID_HEIGHT: number;
|
|
11
|
+
export declare const CALENDAR_MONTH_SECTION_MARGIN = 16;
|
|
12
|
+
export declare const CALENDAR_MONTH_SECTION_HEIGHT: number;
|
|
13
|
+
export declare const MONTH_NAMES: readonly ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"];
|
|
14
|
+
export type DatePickerV2Type = 'date' | 'daterange';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const START_YEAR = 2000;
|
|
2
|
+
export const END_YEAR = 2050;
|
|
3
|
+
export const MONTH_ITEM_HEIGHT = 48;
|
|
4
|
+
export const YEAR_HEADER_HEIGHT = 42;
|
|
5
|
+
export const MONTH_ITEM_GAP = 0;
|
|
6
|
+
// Высота одной группы года = заголовок + 12 месяцев
|
|
7
|
+
export const YEAR_GROUP_HEIGHT = YEAR_HEADER_HEIGHT + MONTH_ITEM_HEIGHT * 12;
|
|
8
|
+
// Константы для секции месяца в календаре (правая колонка)
|
|
9
|
+
export const DATE_CELL_HEIGHT = 42;
|
|
10
|
+
export const DATE_CELL_GAP = 4;
|
|
11
|
+
// Высота заголовка месяца (padding-top: 12px + line-height ~20px + padding-bottom: 8px)
|
|
12
|
+
export const CALENDAR_MONTH_TITLE_HEIGHT = 40;
|
|
13
|
+
// Высота сетки дат (6 строк * 42px + 5 gaps * 4px)
|
|
14
|
+
export const CALENDAR_DATE_GRID_HEIGHT = DATE_CELL_HEIGHT * 6 + DATE_CELL_GAP * 5;
|
|
15
|
+
// Отступ снизу секции
|
|
16
|
+
export const CALENDAR_MONTH_SECTION_MARGIN = 16;
|
|
17
|
+
// Общая высота секции месяца
|
|
18
|
+
export const CALENDAR_MONTH_SECTION_HEIGHT = CALENDAR_MONTH_TITLE_HEIGHT +
|
|
19
|
+
CALENDAR_DATE_GRID_HEIGHT +
|
|
20
|
+
CALENDAR_MONTH_SECTION_MARGIN;
|
|
21
|
+
export const MONTH_NAMES = [
|
|
22
|
+
'Январь',
|
|
23
|
+
'Февраль',
|
|
24
|
+
'Март',
|
|
25
|
+
'Апрель',
|
|
26
|
+
'Май',
|
|
27
|
+
'Июнь',
|
|
28
|
+
'Июль',
|
|
29
|
+
'Август',
|
|
30
|
+
'Сентябрь',
|
|
31
|
+
'Октябрь',
|
|
32
|
+
'Ноябрь',
|
|
33
|
+
'Декабрь'
|
|
34
|
+
];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Ref, InjectionKey } from 'vue';
|
|
2
|
+
import type { MergedTheme } from '../../_mixins';
|
|
3
|
+
import type { DatePickerV2Theme } from '../styles';
|
|
4
|
+
export type Value = number | null;
|
|
5
|
+
export type RangeValue = [number, number] | null;
|
|
6
|
+
export interface DateItem {
|
|
7
|
+
year: number;
|
|
8
|
+
month: number;
|
|
9
|
+
date: number;
|
|
10
|
+
ts: number;
|
|
11
|
+
isCurrentDate: boolean;
|
|
12
|
+
isCurrentMonth: boolean;
|
|
13
|
+
selected: boolean;
|
|
14
|
+
inRange: boolean;
|
|
15
|
+
isRangeStart: boolean;
|
|
16
|
+
isRangeEnd: boolean;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface MonthItem {
|
|
20
|
+
year: number;
|
|
21
|
+
month: number;
|
|
22
|
+
label: string;
|
|
23
|
+
ts: number;
|
|
24
|
+
}
|
|
25
|
+
export interface YearItem {
|
|
26
|
+
year: number;
|
|
27
|
+
ts: number;
|
|
28
|
+
}
|
|
29
|
+
export type OnUpdateValue = (value: Value) => void;
|
|
30
|
+
export type OnUpdateRangeValue = (value: RangeValue) => void;
|
|
31
|
+
export type IsSingleDateDisabled = (date: number) => boolean;
|
|
32
|
+
export type IsRangeDateDisabled = (date: number, position: 'start' | 'end', value: [number, number] | null) => boolean;
|
|
33
|
+
export type IsDateDisabled = IsSingleDateDisabled | IsRangeDateDisabled;
|
|
34
|
+
export type TriggerPreset = 'input' | 'select' | 'button';
|
|
35
|
+
export interface DatePickerV2Injection {
|
|
36
|
+
mergedClsPrefixRef: Ref<string>;
|
|
37
|
+
mergedThemeRef: Ref<MergedTheme<DatePickerV2Theme>>;
|
|
38
|
+
localeRef: Ref<any>;
|
|
39
|
+
dateLocaleRef: Ref<any>;
|
|
40
|
+
isDateDisabledRef: Ref<IsDateDisabled | undefined>;
|
|
41
|
+
}
|
|
42
|
+
export declare const datePickerV2InjectionKey: InjectionKey<DatePickerV2Injection>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const datePickerV2InjectionKey = Symbol('datePickerV2');
|