@libs-ui/components-datetime-picker 0.2.72
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/README.md +3 -0
- package/custom-ranges/calendar/calendar.component.d.ts +140 -0
- package/custom-ranges/custom-ranges.component.d.ts +59 -0
- package/defines/calendar.define.d.ts +13 -0
- package/defines/date-options.define.d.ts +20 -0
- package/esm2022/custom-ranges/calendar/calendar.component.mjs +1256 -0
- package/esm2022/custom-ranges/custom-ranges.component.mjs +266 -0
- package/esm2022/defines/calendar.define.mjs +135 -0
- package/esm2022/defines/date-options.define.mjs +55 -0
- package/esm2022/index.mjs +2 -0
- package/esm2022/interfaces/calendar-emit.interface.mjs +2 -0
- package/esm2022/interfaces/calendar-variables.interface.mjs +6 -0
- package/esm2022/interfaces/function-control.interface.mjs +2 -0
- package/esm2022/interfaces/picker.interface.mjs +2 -0
- package/esm2022/interfaces/time-variables.interface.mjs +4 -0
- package/esm2022/interfaces/valid.interface.mjs +2 -0
- package/esm2022/libs-ui-components-datetime-picker.mjs +5 -0
- package/esm2022/picker.component.mjs +180 -0
- package/fesm2022/libs-ui-components-datetime-picker.mjs +1882 -0
- package/fesm2022/libs-ui-components-datetime-picker.mjs.map +1 -0
- package/index.d.ts +1 -0
- package/interfaces/calendar-emit.interface.d.ts +25 -0
- package/interfaces/calendar-variables.interface.d.ts +80 -0
- package/interfaces/function-control.interface.d.ts +8 -0
- package/interfaces/picker.interface.d.ts +26 -0
- package/interfaces/time-variables.interface.d.ts +36 -0
- package/interfaces/valid.interface.d.ts +5 -0
- package/package.json +25 -0
- package/picker.component.d.ts +77 -0
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { ElementRef, OnDestroy, OnInit, WritableSignal } from "@angular/core";
|
|
2
|
+
import { IDropdownFunctionControlEvent, IEmitSelectKey } from "@libs-ui/components-dropdown";
|
|
3
|
+
import { IFocusAndBlurEvent, IInputFunctionControlEvent } from "@libs-ui/components-inputs-input";
|
|
4
|
+
import { IListConfigItem } from "@libs-ui/components-list";
|
|
5
|
+
import { IFlagMouse } from "@libs-ui/components-popover";
|
|
6
|
+
import { IEvent } from "@libs-ui/interfaces-types";
|
|
7
|
+
import { IHttpRequestConfig } from "@libs-ui/services-http-request";
|
|
8
|
+
import dayjs from 'dayjs';
|
|
9
|
+
import { IEmitDateCalendar } from "../../interfaces/calendar-emit.interface";
|
|
10
|
+
import { ICalendar, ICalendarVariables, IDateRange, SideEnum } from "../../interfaces/calendar-variables.interface";
|
|
11
|
+
import { ICalendarFunctionControlEvent } from "../../interfaces/function-control.interface";
|
|
12
|
+
import { LocalizationConfig } from "../../interfaces/picker.interface";
|
|
13
|
+
import { ITimepickerItemValue, ITimepickerVariables } from "../../interfaces/time-variables.interface";
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
export declare class LibsUiComponentsDatetimePickerCustomRangesCalendarComponent implements OnInit, OnDestroy {
|
|
16
|
+
/** PROPERTY */
|
|
17
|
+
protected readonly sideEnum: typeof SideEnum;
|
|
18
|
+
protected calendarVariables: WritableSignal<ICalendarVariables>;
|
|
19
|
+
protected timepickerVariables: WritableSignal<ITimepickerVariables>;
|
|
20
|
+
protected disableMonth: WritableSignal<{
|
|
21
|
+
left: WritableSignal<Array<any>>;
|
|
22
|
+
right: WritableSignal<Array<any>>;
|
|
23
|
+
}>;
|
|
24
|
+
protected today: WritableSignal<dayjs.Dayjs>;
|
|
25
|
+
protected listKeyFromSelected: WritableSignal<{
|
|
26
|
+
month: any;
|
|
27
|
+
year: any;
|
|
28
|
+
}>;
|
|
29
|
+
protected listKeyToSelected: WritableSignal<{
|
|
30
|
+
month: any;
|
|
31
|
+
year: any;
|
|
32
|
+
}>;
|
|
33
|
+
protected checkShowListDropdown: WritableSignal<{
|
|
34
|
+
[key: string]: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
protected selectedQuickRange: WritableSignal<string>;
|
|
37
|
+
protected leftCalendar: WritableSignal<{
|
|
38
|
+
calendar?: ICalendar;
|
|
39
|
+
month?: dayjs.Dayjs;
|
|
40
|
+
}>;
|
|
41
|
+
protected rightCalendar: WritableSignal<{
|
|
42
|
+
calendar?: ICalendar;
|
|
43
|
+
month?: dayjs.Dayjs;
|
|
44
|
+
}>;
|
|
45
|
+
protected listMonthsConfig: WritableSignal<IListConfigItem | undefined>;
|
|
46
|
+
protected monthHttpDetailConfig: WritableSignal<IHttpRequestConfig>;
|
|
47
|
+
protected listLeftYearConfig: WritableSignal<IListConfigItem | undefined>;
|
|
48
|
+
protected listRightYearConfig: WritableSignal<IListConfigItem | undefined>;
|
|
49
|
+
protected listYearConfig: WritableSignal<IListConfigItem | undefined>;
|
|
50
|
+
protected leftYearHttpDetailConfig: WritableSignal<IHttpRequestConfig | undefined>;
|
|
51
|
+
protected rightYearHttpDetailConfig: WritableSignal<IHttpRequestConfig | undefined>;
|
|
52
|
+
protected timePickerError: WritableSignal<boolean>;
|
|
53
|
+
protected computedDisplayTimeLeft: import("@angular/core").Signal<string>;
|
|
54
|
+
protected computedDisplayTimeRight: import("@angular/core").Signal<string>;
|
|
55
|
+
protected computedDisplayTimeLeftInputHour: import("@angular/core").Signal<string | number>;
|
|
56
|
+
protected computedDisplayTimeLeftInputMinute: import("@angular/core").Signal<string | number>;
|
|
57
|
+
protected computedDisplayTimeRightInputHour: import("@angular/core").Signal<string | number>;
|
|
58
|
+
protected computedDisplayTimeRightInputMinute: import("@angular/core").Signal<string | number>;
|
|
59
|
+
private functionControls;
|
|
60
|
+
private pickingDate;
|
|
61
|
+
private isShown;
|
|
62
|
+
private nowHoveredDate;
|
|
63
|
+
private timePickerIncrement;
|
|
64
|
+
private selectedLabel;
|
|
65
|
+
private keyCodeBackspace;
|
|
66
|
+
private checkBackspaceFocus;
|
|
67
|
+
protected timepickerValueItem: WritableSignal<ITimepickerItemValue>;
|
|
68
|
+
private isZero;
|
|
69
|
+
private oldDate;
|
|
70
|
+
private isSelectedData;
|
|
71
|
+
private splitPickerDate;
|
|
72
|
+
/** INPUT */
|
|
73
|
+
readonly quickRangesArray: import("@angular/core").InputSignal<IDateRange[]>;
|
|
74
|
+
readonly zIndex: import("@angular/core").InputSignalWithTransform<number, number>;
|
|
75
|
+
readonly classInclude: import("@angular/core").InputSignal<string>;
|
|
76
|
+
readonly isSingle: import("@angular/core").InputSignal<boolean>;
|
|
77
|
+
readonly showDropdownsSelect: import("@angular/core").InputSignal<boolean>;
|
|
78
|
+
readonly hasTimePicker: import("@angular/core").InputSignal<boolean>;
|
|
79
|
+
readonly flagMouse: import("@angular/core").InputSignal<IFlagMouse>;
|
|
80
|
+
readonly dateOptions: import("@angular/core").InputSignal<LocalizationConfig>;
|
|
81
|
+
readonly autoApply: import("@angular/core").InputSignal<boolean>;
|
|
82
|
+
readonly hasSecondPicker: import("@angular/core").InputSignal<boolean>;
|
|
83
|
+
readonly showRangeLabelOnInput: import("@angular/core").InputSignal<boolean | undefined>;
|
|
84
|
+
readonly startDate: import("@angular/core").ModelSignal<dayjs.Dayjs | undefined>;
|
|
85
|
+
readonly endDate: import("@angular/core").ModelSignal<dayjs.Dayjs | undefined>;
|
|
86
|
+
readonly minDate: import("@angular/core").InputSignalWithTransform<string | dayjs.Dayjs | undefined, dayjs.Dayjs | undefined>;
|
|
87
|
+
readonly maxDate: import("@angular/core").InputSignalWithTransform<string | dayjs.Dayjs | undefined, dayjs.Dayjs | undefined>;
|
|
88
|
+
/** OUTPUT */
|
|
89
|
+
readonly outChangStageFlagMouse: import("@angular/core").OutputEmitterRef<IFlagMouse>;
|
|
90
|
+
readonly outPickerDate: import("@angular/core").OutputEmitterRef<IEmitDateCalendar>;
|
|
91
|
+
readonly outCancel: import("@angular/core").OutputEmitterRef<string>;
|
|
92
|
+
readonly outUpdateWidth: import("@angular/core").OutputEmitterRef<number>;
|
|
93
|
+
readonly outFunctionsControl: import("@angular/core").OutputEmitterRef<ICalendarFunctionControlEvent>;
|
|
94
|
+
/** INJECTION */
|
|
95
|
+
private translate;
|
|
96
|
+
readonly pickerContainer: import("@angular/core").Signal<ElementRef<any> | undefined>;
|
|
97
|
+
constructor();
|
|
98
|
+
ngOnInit(): void;
|
|
99
|
+
private buildConfigYear;
|
|
100
|
+
protected handlerChangeFlagMouse(flagMouse: IFlagMouse): void;
|
|
101
|
+
private updateStartEndDate;
|
|
102
|
+
private calculateSelectedLabel;
|
|
103
|
+
private formatMonthYear;
|
|
104
|
+
private setStartDate;
|
|
105
|
+
private setStartDateInTimePicker;
|
|
106
|
+
private setEndDate;
|
|
107
|
+
protected handlerHoverDate(event: Event, side: SideEnum, row: number, col: number): void;
|
|
108
|
+
private getDisable;
|
|
109
|
+
protected handlerClickPrev(side: SideEnum): void;
|
|
110
|
+
protected handlerClickNext(side: SideEnum): void;
|
|
111
|
+
protected handlerPickerDate(event: any, side: SideEnum, row: number, col: number): void;
|
|
112
|
+
protected handlerClickApply(event?: Event): void;
|
|
113
|
+
protected handlerClickCancel(event: Event): void;
|
|
114
|
+
protected handlerFunctionControl(event: IDropdownFunctionControlEvent | IInputFunctionControlEvent, type: string): void;
|
|
115
|
+
protected handlerSelectedDropdown(event: IEmitSelectKey | undefined, type: string): void;
|
|
116
|
+
private updateMonthSelect;
|
|
117
|
+
private updateYearSelect;
|
|
118
|
+
private monthOrYearChanged;
|
|
119
|
+
protected handlerInputEvent(event: IEvent, type: `lefthour` | `leftminute` | `righthour` | `rightminute`): void;
|
|
120
|
+
protected handlerFocusAndBlurTime(event: IFocusAndBlurEvent, type: `lefthour` | `leftminute` | `righthour` | `rightminute`): void;
|
|
121
|
+
protected handlerChangeTimeValue(event: string | number, type: `lefthour` | `leftminute` | `righthour` | `rightminute`): void;
|
|
122
|
+
protected handlerShowListDropdown(event: boolean, type: string): void;
|
|
123
|
+
protected convertItemMonth: (item: any) => any;
|
|
124
|
+
protected convertItemYear: (item: any) => any;
|
|
125
|
+
private updateMonthsInView;
|
|
126
|
+
private setTimeInput;
|
|
127
|
+
private updateCalendars;
|
|
128
|
+
private renderCalendar;
|
|
129
|
+
private buildCells;
|
|
130
|
+
private renderTimePicker;
|
|
131
|
+
private updateElement;
|
|
132
|
+
private updateView;
|
|
133
|
+
private getDateWithTime;
|
|
134
|
+
private transformMinMaxDate;
|
|
135
|
+
private computedDisplayTime;
|
|
136
|
+
private computedDisplayTimeInput;
|
|
137
|
+
ngOnDestroy(): void;
|
|
138
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LibsUiComponentsDatetimePickerCustomRangesCalendarComponent, never>;
|
|
139
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LibsUiComponentsDatetimePickerCustomRangesCalendarComponent, "libs_ui-components-datetime-picker-custom_ranges-calendar", never, { "quickRangesArray": { "alias": "quickRangesArray"; "required": false; "isSignal": true; }; "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "classInclude": { "alias": "classInclude"; "required": false; "isSignal": true; }; "isSingle": { "alias": "isSingle"; "required": false; "isSignal": true; }; "showDropdownsSelect": { "alias": "showDropdownsSelect"; "required": false; "isSignal": true; }; "hasTimePicker": { "alias": "hasTimePicker"; "required": false; "isSignal": true; }; "flagMouse": { "alias": "flagMouse"; "required": false; "isSignal": true; }; "dateOptions": { "alias": "dateOptions"; "required": false; "isSignal": true; }; "autoApply": { "alias": "autoApply"; "required": false; "isSignal": true; }; "hasSecondPicker": { "alias": "hasSecondPicker"; "required": false; "isSignal": true; }; "showRangeLabelOnInput": { "alias": "showRangeLabelOnInput"; "required": false; "isSignal": true; }; "startDate": { "alias": "startDate"; "required": false; "isSignal": true; }; "endDate": { "alias": "endDate"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; }, { "startDate": "startDateChange"; "endDate": "endDateChange"; "outChangStageFlagMouse": "outChangStageFlagMouse"; "outPickerDate": "outPickerDate"; "outCancel": "outCancel"; "outUpdateWidth": "outUpdateWidth"; "outFunctionsControl": "outFunctionsControl"; }, never, never, true, never>;
|
|
140
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { IFlagMouse } from "@libs-ui/components-popover";
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
import { IEmitDateCalendar, IEmitDateRange, IEmitSingleDate } from "../interfaces/calendar-emit.interface";
|
|
5
|
+
import { IDateRange } from "../interfaces/calendar-variables.interface";
|
|
6
|
+
import { ICalendarFunctionControlEvent } from "../interfaces/function-control.interface";
|
|
7
|
+
import { LocalizationConfig } from "../interfaces/picker.interface";
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class LibsUiComponentsDatetimePickerCustomRangesComponent implements OnInit, OnDestroy {
|
|
10
|
+
/** PROPERTY */
|
|
11
|
+
protected showCalTableInRanges: import("@angular/core").WritableSignal<boolean>;
|
|
12
|
+
protected quickRangesArray: import("@angular/core").WritableSignal<IDateRange[]>;
|
|
13
|
+
protected selectedQuickRange: import("@angular/core").WritableSignal<string>;
|
|
14
|
+
protected chosenQuickRange: import("@angular/core").WritableSignal<string | undefined>;
|
|
15
|
+
private calendarShowing;
|
|
16
|
+
private timeouts;
|
|
17
|
+
private calendarFunctionControlEvent;
|
|
18
|
+
private chosenSingleDate;
|
|
19
|
+
private chosenDateRange;
|
|
20
|
+
/** INPUT */
|
|
21
|
+
readonly zIndex: import("@angular/core").InputSignalWithTransform<number, number>;
|
|
22
|
+
readonly classInclude: import("@angular/core").InputSignal<string>;
|
|
23
|
+
readonly extendRanges: import("@angular/core").InputSignal<IDateRange[]>;
|
|
24
|
+
readonly widthByParent: import("@angular/core").InputSignal<boolean>;
|
|
25
|
+
readonly autoApply: import("@angular/core").InputSignal<boolean>;
|
|
26
|
+
readonly positionQuickRanges: import("@angular/core").InputSignalWithTransform<"left" | "right", "left" | "right">;
|
|
27
|
+
readonly isSingle: import("@angular/core").InputSignalWithTransform<boolean, boolean>;
|
|
28
|
+
readonly hasTimePicker: import("@angular/core").InputSignal<boolean>;
|
|
29
|
+
readonly flagMouse: import("@angular/core").InputSignal<IFlagMouse>;
|
|
30
|
+
readonly dateOptions: import("@angular/core").InputSignal<LocalizationConfig>;
|
|
31
|
+
readonly alwaysShowCalendars: import("@angular/core").InputSignal<boolean>;
|
|
32
|
+
readonly startDate: import("@angular/core").ModelSignal<dayjs.Dayjs | undefined>;
|
|
33
|
+
readonly endDate: import("@angular/core").ModelSignal<dayjs.Dayjs | undefined>;
|
|
34
|
+
readonly showCustomRangeLabel: import("@angular/core").InputSignal<boolean | undefined>;
|
|
35
|
+
readonly keepCalendarOpeningWithRange: import("@angular/core").InputSignal<boolean | undefined>;
|
|
36
|
+
readonly singleDateSelected: import("@angular/core").InputSignal<IEmitSingleDate | undefined>;
|
|
37
|
+
readonly dateRangeSelected: import("@angular/core").InputSignalWithTransform<IEmitDateRange | undefined, IEmitDateRange | undefined>;
|
|
38
|
+
/** OUTPUT */
|
|
39
|
+
readonly outChangStageFlagMouse: import("@angular/core").OutputEmitterRef<IFlagMouse>;
|
|
40
|
+
readonly outUpdateWidth: import("@angular/core").OutputEmitterRef<number>;
|
|
41
|
+
readonly outCancel: import("@angular/core").OutputEmitterRef<string>;
|
|
42
|
+
readonly outSelectSingleDate: import("@angular/core").OutputEmitterRef<IEmitSingleDate>;
|
|
43
|
+
readonly outSelectDateRange: import("@angular/core").OutputEmitterRef<IEmitDateRange>;
|
|
44
|
+
readonly outClickRange: import("@angular/core").OutputEmitterRef<IDateRange>;
|
|
45
|
+
constructor();
|
|
46
|
+
ngOnInit(): void;
|
|
47
|
+
private onAfterViewInit;
|
|
48
|
+
private updateWidth;
|
|
49
|
+
private renderRanges;
|
|
50
|
+
protected handlerCancel(): void;
|
|
51
|
+
protected handlerPickerDate(event: IEmitDateCalendar): void;
|
|
52
|
+
protected handlerClickRange(e: Event, range: IDateRange): void;
|
|
53
|
+
protected handlerClickCancel(event: Event): void;
|
|
54
|
+
protected handlerChangeFlagMouse(flagMouse: IFlagMouse): void;
|
|
55
|
+
protected handlerFunctionsControl(event: ICalendarFunctionControlEvent): void;
|
|
56
|
+
ngOnDestroy(): void;
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LibsUiComponentsDatetimePickerCustomRangesComponent, never>;
|
|
58
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LibsUiComponentsDatetimePickerCustomRangesComponent, "libs_ui-components-datetime-picker-custom_ranges", never, { "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "classInclude": { "alias": "classInclude"; "required": false; "isSignal": true; }; "extendRanges": { "alias": "extendRanges"; "required": false; "isSignal": true; }; "widthByParent": { "alias": "widthByParent"; "required": false; "isSignal": true; }; "autoApply": { "alias": "autoApply"; "required": false; "isSignal": true; }; "positionQuickRanges": { "alias": "positionQuickRanges"; "required": false; "isSignal": true; }; "isSingle": { "alias": "isSingle"; "required": false; "isSignal": true; }; "hasTimePicker": { "alias": "hasTimePicker"; "required": false; "isSignal": true; }; "flagMouse": { "alias": "flagMouse"; "required": false; "isSignal": true; }; "dateOptions": { "alias": "dateOptions"; "required": false; "isSignal": true; }; "alwaysShowCalendars": { "alias": "alwaysShowCalendars"; "required": false; "isSignal": true; }; "startDate": { "alias": "startDate"; "required": false; "isSignal": true; }; "endDate": { "alias": "endDate"; "required": false; "isSignal": true; }; "showCustomRangeLabel": { "alias": "showCustomRangeLabel"; "required": false; "isSignal": true; }; "keepCalendarOpeningWithRange": { "alias": "keepCalendarOpeningWithRange"; "required": false; "isSignal": true; }; "singleDateSelected": { "alias": "singleDateSelected"; "required": false; "isSignal": true; }; "dateRangeSelected": { "alias": "dateRangeSelected"; "required": false; "isSignal": true; }; }, { "startDate": "startDateChange"; "endDate": "endDateChange"; "outChangStageFlagMouse": "outChangStageFlagMouse"; "outUpdateWidth": "outUpdateWidth"; "outCancel": "outCancel"; "outSelectSingleDate": "outSelectSingleDate"; "outSelectDateRange": "outSelectDateRange"; "outClickRange": "outClickRange"; }, never, never, true, never>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IListConfigItem } from "@libs-ui/components-list";
|
|
2
|
+
import { TranslateService } from "@ngx-translate/core";
|
|
3
|
+
import { IHttpRequestConfig } from "@libs-ui/services-http-request";
|
|
4
|
+
export declare const getMonthsListConfig: (translate: TranslateService) => IListConfigItem;
|
|
5
|
+
export declare const getMonthsDetailById: () => IHttpRequestConfig;
|
|
6
|
+
export declare const getYearsListConfig: (listOfYears?: Array<{
|
|
7
|
+
id: number;
|
|
8
|
+
label: string;
|
|
9
|
+
}>) => IListConfigItem;
|
|
10
|
+
export declare const getYearsDetailById: (listOfYears?: Array<{
|
|
11
|
+
id: number;
|
|
12
|
+
label: string;
|
|
13
|
+
}>) => IHttpRequestConfig;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LocalizationConfig } from "../interfaces/picker.interface";
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
export declare const getDateOptions: () => LocalizationConfig;
|
|
4
|
+
export declare const defaultLocaleConfig: () => {
|
|
5
|
+
direction: string;
|
|
6
|
+
separator: string;
|
|
7
|
+
weekLabel: string;
|
|
8
|
+
applyLabel: string;
|
|
9
|
+
cancelLabel: string;
|
|
10
|
+
clearLabel: string;
|
|
11
|
+
customRangeLabel: string;
|
|
12
|
+
daysOfWeek: never[];
|
|
13
|
+
monthNames: never[];
|
|
14
|
+
firstDay: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const getDateRangeDefault: () => {
|
|
17
|
+
[key: string]: Array<dayjs.Dayjs>;
|
|
18
|
+
};
|
|
19
|
+
export declare const DEFAULT_MIN_YEAR = 1945;
|
|
20
|
+
export declare const DEFAULT_MAX_YEAR = 2100;
|