@nuralyui/datepicker 0.0.4 → 0.0.6
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/bundle.js +788 -0
- package/datepicker.component.d.ts +189 -0
- package/datepicker.component.js +668 -0
- package/datepicker.component.js.map +1 -0
- package/datepicker.constant.d.ts +60 -0
- package/datepicker.constant.js +60 -0
- package/datepicker.constant.js.map +1 -0
- package/datepicker.style.d.ts +17 -0
- package/datepicker.style.js +455 -0
- package/datepicker.style.js.map +1 -0
- package/datepicker.style.variables.d.ts +2 -0
- package/datepicker.style.variables.js +119 -0
- package/datepicker.style.variables.js.map +1 -0
- package/datepicker.types.d.ts +113 -10
- package/datepicker.types.js +67 -0
- package/datepicker.types.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +16 -2
- package/react.d.ts +15 -2
- package/react.js +17 -4
- package/react.js.map +1 -1
- package/constants.d.ts +0 -2
- package/constants.d.ts.map +0 -1
- package/constants.js +0 -2
- package/constants.js.map +0 -1
- package/core/day.helper.d.ts +0 -5
- package/core/day.helper.d.ts.map +0 -1
- package/core/day.helper.js +0 -53
- package/core/day.helper.js.map +0 -1
- package/core/formatter.d.ts +0 -2
- package/core/formatter.d.ts.map +0 -1
- package/core/formatter.js +0 -9
- package/core/formatter.js.map +0 -1
- package/core/locale.helper.d.ts +0 -144
- package/core/locale.helper.d.ts.map +0 -1
- package/core/locale.helper.js +0 -151
- package/core/locale.helper.js.map +0 -1
- package/core/month.helper.d.ts +0 -3
- package/core/month.helper.d.ts.map +0 -1
- package/core/month.helper.js +0 -24
- package/core/month.helper.js.map +0 -1
- package/core/string.helper.d.ts +0 -2
- package/core/string.helper.d.ts.map +0 -1
- package/core/string.helper.js +0 -4
- package/core/string.helper.js.map +0 -1
- package/date-picker.component.d.ts +0 -80
- package/date-picker.component.d.ts.map +0 -1
- package/date-picker.component.js +0 -475
- package/date-picker.component.js.map +0 -1
- package/date-picker.style.d.ts +0 -2
- package/date-picker.style.d.ts.map +0 -1
- package/date-picker.style.js +0 -223
- package/date-picker.style.js.map +0 -1
- package/datepicker.types.d.ts.map +0 -1
- package/demo/date-picker-demo.d.ts +0 -18
- package/demo/date-picker-demo.d.ts.map +0 -1
- package/demo/date-picker-demo.js +0 -95
- package/demo/date-picker-demo.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/react.d.ts.map +0 -1
- package/templates/days.template.d.ts +0 -4
- package/templates/days.template.d.ts.map +0 -1
- package/templates/days.template.js +0 -28
- package/templates/days.template.js.map +0 -1
- package/templates/headers.template.d.ts +0 -2
- package/templates/headers.template.d.ts.map +0 -1
- package/templates/headers.template.js +0 -5
- package/templates/headers.template.js.map +0 -1
- package/templates/months.template.d.ts +0 -6
- package/templates/months.template.d.ts.map +0 -1
- package/templates/months.template.js +0 -10
- package/templates/months.template.js.map +0 -1
- package/templates/years.template.d.ts +0 -6
- package/templates/years.template.d.ts.map +0 -1
- package/templates/years.template.js +0 -11
- package/templates/years.template.js.map +0 -1
- package/test/datepicker_test.d.ts +0 -2
- package/test/datepicker_test.d.ts.map +0 -1
- package/test/datepicker_test.js +0 -132
- package/test/datepicker_test.js.map +0 -1
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
7
|
+
import { DatePickerMode, DatePickerType, DatePickerSize, DatePickerVariant, DatePickerPlacement, INavigationDate, IDayPresentation, DatePickerState } from './datepicker.types.js';
|
|
8
|
+
import { DatePickerHost } from './interfaces/base-controller.interface.js';
|
|
9
|
+
import './utils/locale.helper.js';
|
|
10
|
+
import { INPUT_STATE } from '../input/input.types.js';
|
|
11
|
+
declare const HyDatePickerElement_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & typeof LitElement;
|
|
12
|
+
/**
|
|
13
|
+
* HyDatePicker - A comprehensive date picker component
|
|
14
|
+
*
|
|
15
|
+
* @element nr-datepicker
|
|
16
|
+
*
|
|
17
|
+
* @fires nr-date-change - Fired when a date is selected
|
|
18
|
+
* @fires nr-range-change - Fired when a date range is selected
|
|
19
|
+
* @fires nr-calendar-open - Fired when calendar is opened
|
|
20
|
+
* @fires nr-calendar-close - Fired when calendar is closed
|
|
21
|
+
* @fires nr-focus - Fired when component receives focus
|
|
22
|
+
* @fires nr-blur - Fired when component loses focus
|
|
23
|
+
* @fires nr-validation - Fired when validation state changes
|
|
24
|
+
*
|
|
25
|
+
* @slot label - Label content for the input field
|
|
26
|
+
* @slot helper-text - Helper text content below the input field
|
|
27
|
+
* @slot icon - Icon content for the input field
|
|
28
|
+
*
|
|
29
|
+
* @csspart input - The input field part
|
|
30
|
+
* @csspart calendar - The calendar container part
|
|
31
|
+
* @csspart header - The calendar header part
|
|
32
|
+
* @csspart days - The days grid part
|
|
33
|
+
* @csspart day - Individual day cell part
|
|
34
|
+
* @csspart months - The months grid part
|
|
35
|
+
* @csspart years - The years grid part
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```html
|
|
39
|
+
* <nr-datepicker
|
|
40
|
+
* label="Select Date"
|
|
41
|
+
* field-format="DD/MM/YYYY"
|
|
42
|
+
* @nr-date-change="${this.handleDateChange}">
|
|
43
|
+
* </nr-datepicker>
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example Range picker
|
|
47
|
+
* ```html
|
|
48
|
+
* <nr-datepicker
|
|
49
|
+
* range
|
|
50
|
+
* label="Select Date Range"
|
|
51
|
+
* @nr-range-change="${this.handleRangeChange}">
|
|
52
|
+
* </nr-datepicker>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare class HyDatePickerElement extends HyDatePickerElement_base implements DatePickerHost {
|
|
56
|
+
static styles: import("lit").CSSResult;
|
|
57
|
+
requiredComponents: string[];
|
|
58
|
+
private calendarController;
|
|
59
|
+
private selectionController;
|
|
60
|
+
private keyboardController;
|
|
61
|
+
private positioningController;
|
|
62
|
+
private dropdownController;
|
|
63
|
+
name: string;
|
|
64
|
+
value: string;
|
|
65
|
+
dateValue: string;
|
|
66
|
+
defaultValue: string;
|
|
67
|
+
disabled: boolean;
|
|
68
|
+
required: boolean;
|
|
69
|
+
locale: string;
|
|
70
|
+
fieldFormat: string;
|
|
71
|
+
range: boolean;
|
|
72
|
+
minDate?: string;
|
|
73
|
+
maxDate?: string;
|
|
74
|
+
disabledDates?: string[];
|
|
75
|
+
type: DatePickerType;
|
|
76
|
+
size: DatePickerSize;
|
|
77
|
+
variant: DatePickerVariant;
|
|
78
|
+
placement: DatePickerPlacement;
|
|
79
|
+
label: string;
|
|
80
|
+
helper: string;
|
|
81
|
+
state: DatePickerState | INPUT_STATE;
|
|
82
|
+
useSelectDropdowns: boolean;
|
|
83
|
+
openedCalendar: boolean;
|
|
84
|
+
mode: DatePickerMode;
|
|
85
|
+
private currentMode;
|
|
86
|
+
private monthsShort;
|
|
87
|
+
private months;
|
|
88
|
+
private days;
|
|
89
|
+
private weekdaysShort;
|
|
90
|
+
private inputFieldValue;
|
|
91
|
+
private currentYear;
|
|
92
|
+
private currentMonth;
|
|
93
|
+
private currentDay;
|
|
94
|
+
private endYear?;
|
|
95
|
+
private endMonth?;
|
|
96
|
+
private endDay?;
|
|
97
|
+
navigationDates: INavigationDate;
|
|
98
|
+
dateInput: HTMLElement;
|
|
99
|
+
calendarContainer: HTMLElement;
|
|
100
|
+
private readonly INPUT_TYPE;
|
|
101
|
+
connectedCallback(): void;
|
|
102
|
+
disconnectedCallback(): void;
|
|
103
|
+
firstUpdated(_changedProperties: PropertyValues): void;
|
|
104
|
+
private setupDropdownController;
|
|
105
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
106
|
+
/**
|
|
107
|
+
* Initialize component state
|
|
108
|
+
*/
|
|
109
|
+
private initializeComponent;
|
|
110
|
+
/**
|
|
111
|
+
* Initialize range properties if range mode is enabled
|
|
112
|
+
*/
|
|
113
|
+
private initializeRangeIfNeeded;
|
|
114
|
+
/**
|
|
115
|
+
* Handle property changes with proper delegation
|
|
116
|
+
*/
|
|
117
|
+
private handlePropertyChanges;
|
|
118
|
+
/**
|
|
119
|
+
* Check if date-related properties have changed
|
|
120
|
+
*/
|
|
121
|
+
private hasDatePropertiesChanged;
|
|
122
|
+
/**
|
|
123
|
+
* Handle date value change
|
|
124
|
+
*/
|
|
125
|
+
private handleDateValueChange;
|
|
126
|
+
getCurrentDate(): Date;
|
|
127
|
+
formatDate(date: Date): string;
|
|
128
|
+
parseDate(dateString: string): Date | null;
|
|
129
|
+
/**
|
|
130
|
+
* Get currently selected date - DELEGATES to selection controller
|
|
131
|
+
*/
|
|
132
|
+
getSelectedDate(): Date | null;
|
|
133
|
+
/**
|
|
134
|
+
* Select a date - DELEGATES to selection controller
|
|
135
|
+
*/
|
|
136
|
+
selectDate(date: Date): void;
|
|
137
|
+
/**
|
|
138
|
+
* Clear selection - DELEGATES to selection controller
|
|
139
|
+
*/
|
|
140
|
+
clearSelection(): void;
|
|
141
|
+
/**
|
|
142
|
+
* Open calendar - DELEGATES to dropdown controller for better positioning
|
|
143
|
+
*/
|
|
144
|
+
openCalendar(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Close calendar - DELEGATES to dropdown controller
|
|
147
|
+
*/
|
|
148
|
+
closeCalendar(): void;
|
|
149
|
+
/**
|
|
150
|
+
* Toggle calendar - DELEGATES to dropdown controller
|
|
151
|
+
*/
|
|
152
|
+
toggleCalendar(): void;
|
|
153
|
+
/**
|
|
154
|
+
* Handle keyboard events - DELEGATES to keyboard controller
|
|
155
|
+
*/
|
|
156
|
+
handleKeyDown(event: KeyboardEvent): void;
|
|
157
|
+
private updateInputField;
|
|
158
|
+
private dispatchDateChange;
|
|
159
|
+
private updateLocale;
|
|
160
|
+
inputChanged(event: CustomEvent): void;
|
|
161
|
+
onFocus(): void;
|
|
162
|
+
handleMonthChange: (event: CustomEvent) => void;
|
|
163
|
+
handleYearChange: (event: CustomEvent) => void;
|
|
164
|
+
prevMonth: () => void;
|
|
165
|
+
nextMonth: () => void;
|
|
166
|
+
prevYear: () => void;
|
|
167
|
+
nextYear: () => void;
|
|
168
|
+
selectMonth: (month: number) => void;
|
|
169
|
+
selectYear: (year: number) => void;
|
|
170
|
+
selectDay: (dayPresentation: IDayPresentation) => void;
|
|
171
|
+
private handleMonthSelected;
|
|
172
|
+
private handleYearSelected;
|
|
173
|
+
private handleMonthSelection;
|
|
174
|
+
private handleYearSelection;
|
|
175
|
+
protected render(): TemplateResult;
|
|
176
|
+
private renderSingle;
|
|
177
|
+
private renderRange;
|
|
178
|
+
private renderMultiple;
|
|
179
|
+
private renderCalendar;
|
|
180
|
+
private get monthOptions();
|
|
181
|
+
private get yearOptions();
|
|
182
|
+
private renderCalendarHeader;
|
|
183
|
+
private renderCalendarBody;
|
|
184
|
+
private renderDays;
|
|
185
|
+
private renderMonths;
|
|
186
|
+
private renderYears;
|
|
187
|
+
}
|
|
188
|
+
export {};
|
|
189
|
+
//# sourceMappingURL=datepicker.component.d.ts.map
|