datex-ui 1.1.8 → 1.1.9
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.
|
@@ -8,6 +8,7 @@ export declare class CalendarService {
|
|
|
8
8
|
constructor(options: Required<DatexOptions>, locale: DatexLocale);
|
|
9
9
|
buildCalendarMatrix(month: Date): Date[][];
|
|
10
10
|
renderCalendarHTML(calendar: CalendarState, side: "left" | "right", startDate: Date, endDate: Date | null, canGoPrev: boolean, canGoNext: boolean): string;
|
|
11
|
+
renderTimeControls(date: Date): string;
|
|
11
12
|
private renderHeader;
|
|
12
13
|
private renderDayHeaders;
|
|
13
14
|
private renderCalendarBody;
|
|
@@ -17,7 +17,6 @@ export declare class KeyboardService {
|
|
|
17
17
|
private onDateSelect?;
|
|
18
18
|
private onClose?;
|
|
19
19
|
private onApply?;
|
|
20
|
-
private onCancel?;
|
|
21
20
|
private onToday?;
|
|
22
21
|
private onClear?;
|
|
23
22
|
private currentFocusedDate;
|
|
@@ -27,7 +26,6 @@ export declare class KeyboardService {
|
|
|
27
26
|
onDateSelect?: (date: Date) => void;
|
|
28
27
|
onClose?: () => void;
|
|
29
28
|
onApply?: () => void;
|
|
30
|
-
onCancel?: () => void;
|
|
31
29
|
onToday?: () => void;
|
|
32
30
|
onClear?: () => void;
|
|
33
31
|
}): void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advanced theme manager with light/dark mode support
|
|
3
|
+
*/
|
|
4
|
+
export type ThemeMode = "light" | "dark" | "auto";
|
|
5
|
+
export interface DatexThemeAdvanced {
|
|
6
|
+
mode?: ThemeMode;
|
|
7
|
+
light?: DatexThemeColors;
|
|
8
|
+
dark?: DatexThemeColors;
|
|
9
|
+
animations?: {
|
|
10
|
+
duration?: number;
|
|
11
|
+
easing?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
borderRadius?: "none" | "small" | "medium" | "large";
|
|
15
|
+
size?: "small" | "medium" | "large";
|
|
16
|
+
density?: "compact" | "comfortable" | "spacious";
|
|
17
|
+
}
|
|
18
|
+
export interface DatexThemeColors {
|
|
19
|
+
primaryColor?: string;
|
|
20
|
+
secondaryColor?: string;
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
surfaceColor?: string;
|
|
23
|
+
borderColor?: string;
|
|
24
|
+
textColor?: string;
|
|
25
|
+
textSecondaryColor?: string;
|
|
26
|
+
hoverColor?: string;
|
|
27
|
+
selectedColor?: string;
|
|
28
|
+
rangeColor?: string;
|
|
29
|
+
todayColor?: string;
|
|
30
|
+
disabledColor?: string;
|
|
31
|
+
errorColor?: string;
|
|
32
|
+
successColor?: string;
|
|
33
|
+
shadowColor?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare class ThemeManager {
|
|
36
|
+
private container;
|
|
37
|
+
private theme;
|
|
38
|
+
private currentMode;
|
|
39
|
+
private mediaQuery?;
|
|
40
|
+
private styleElement?;
|
|
41
|
+
static readonly LIGHT_THEME: DatexThemeColors;
|
|
42
|
+
static readonly DARK_THEME: DatexThemeColors;
|
|
43
|
+
constructor(container: HTMLElement, theme?: DatexThemeAdvanced);
|
|
44
|
+
private initializeTheme;
|
|
45
|
+
private detectSystemTheme;
|
|
46
|
+
private setupMediaQueryListener;
|
|
47
|
+
private applyTheme;
|
|
48
|
+
private createThemeStyles;
|
|
49
|
+
applyCurrentTheme(): void;
|
|
50
|
+
setMode(mode: ThemeMode): void;
|
|
51
|
+
getMode(): ThemeMode;
|
|
52
|
+
getCurrentMode(): "light" | "dark";
|
|
53
|
+
updateTheme(theme: Partial<DatexThemeAdvanced>): void;
|
|
54
|
+
cleanup(): void;
|
|
55
|
+
}
|
|
@@ -2,14 +2,23 @@
|
|
|
2
2
|
* Theme management service for Datex date picker
|
|
3
3
|
*/
|
|
4
4
|
import { DatexTheme } from "../types/datex-types";
|
|
5
|
+
export type ThemeMode = "light" | "dark" | "auto";
|
|
5
6
|
export declare class ThemeService {
|
|
6
7
|
private theme;
|
|
7
8
|
private container;
|
|
8
9
|
private styleId?;
|
|
10
|
+
private mode;
|
|
11
|
+
private mediaQuery?;
|
|
9
12
|
constructor(container: HTMLElement, theme?: DatexTheme);
|
|
10
13
|
applyTheme(): void;
|
|
11
14
|
setTheme(theme: DatexTheme): void;
|
|
15
|
+
setMode(mode: ThemeMode): void;
|
|
16
|
+
getMode(): ThemeMode;
|
|
17
|
+
getCurrentMode(): "light" | "dark";
|
|
12
18
|
cleanup(): void;
|
|
19
|
+
private setupMediaQueryListener;
|
|
20
|
+
private handleMediaChange;
|
|
21
|
+
private getThemeForMode;
|
|
13
22
|
private removeExistingStyles;
|
|
14
23
|
private createAndApplyStyles;
|
|
15
24
|
private generateStyleId;
|
package/package.json
CHANGED