@tekus/design-system 5.31.0 → 5.32.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/fesm2022/tekus-design-system-components-color-picker.mjs +1028 -0
- package/fesm2022/tekus-design-system-components-color-picker.mjs.map +1 -0
- package/fesm2022/tekus-design-system-components-date-picker.mjs +269 -204
- package/fesm2022/tekus-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-icon.mjs +119 -7
- package/fesm2022/tekus-design-system-components-icon.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-table.mjs +38 -6
- package/fesm2022/tekus-design-system-components-table.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-time-picker.mjs +443 -0
- package/fesm2022/tekus-design-system-components-time-picker.mjs.map +1 -0
- package/fesm2022/tekus-design-system-utils-wcag-contrast.mjs +97 -0
- package/fesm2022/tekus-design-system-utils-wcag-contrast.mjs.map +1 -0
- package/package.json +13 -1
- package/types/tekus-design-system-components-color-picker.d.ts +356 -0
- package/types/tekus-design-system-components-date-picker.d.ts +191 -141
- package/types/tekus-design-system-components-icon.d.ts +10 -1
- package/types/tekus-design-system-components-table.d.ts +26 -1
- package/types/tekus-design-system-components-time-picker.d.ts +203 -0
- package/types/tekus-design-system-utils-wcag-contrast.d.ts +55 -0
|
@@ -1,299 +1,382 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, DestroyRef, input, model, output, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
2
|
+
import { inject, DestroyRef, input, model, output, signal, computed, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { switchMap } from 'rxjs';
|
|
4
5
|
import * as i1 from '@angular/forms';
|
|
5
6
|
import { NgControl, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
7
|
import * as i2 from 'primeng/datepicker';
|
|
7
8
|
import { DatePickerModule } from 'primeng/datepicker';
|
|
8
9
|
import * as i3 from 'primeng/floatlabel';
|
|
9
10
|
import { FloatLabelModule } from 'primeng/floatlabel';
|
|
10
|
-
import {
|
|
11
|
-
import { faCalendarDay, faClock } from '@fortawesome/pro-regular-svg-icons';
|
|
11
|
+
import { IconComponent } from '@tekus/design-system/components/icon';
|
|
12
12
|
|
|
13
|
+
let _datePickerUid = 0;
|
|
13
14
|
/**
|
|
14
|
-
* @component DatePickerComponent
|
|
15
15
|
* @description
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* Wrapper around PrimeNG's DatePicker with support for single-date, date-range,
|
|
17
|
+
* and combined date+time modes. Implements `ControlValueAccessor` and `Validator`
|
|
18
|
+
* so it works transparently with reactive forms (`[formControl]`, `[control]`)
|
|
19
|
+
* and template-driven forms (`[(ngModel)]`). A signal model (`[(modelValue)]`)
|
|
20
|
+
* is also available for standalone usage without Angular forms.
|
|
21
|
+
*
|
|
22
|
+
* For time-only selection use `tk-time-picker` instead.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <!-- Date range with reactive form -->
|
|
26
|
+
* <tk-date-picker
|
|
27
|
+
* [control]="form.controls.stayRange"
|
|
28
|
+
* selectionMode="range"
|
|
29
|
+
* labelText="Stay dates"
|
|
30
|
+
* [showClear]="true">
|
|
31
|
+
* </tk-date-picker>
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* <!-- Combined date + time -->
|
|
35
|
+
* <tk-date-picker
|
|
36
|
+
* [showTime]="true"
|
|
37
|
+
* hourFormat="24"
|
|
38
|
+
* [(modelValue)]="appointmentDateTime"
|
|
39
|
+
* labelText="Appointment">
|
|
40
|
+
* </tk-date-picker>
|
|
19
41
|
*/
|
|
20
42
|
class DatePickerComponent {
|
|
21
43
|
constructor() {
|
|
22
|
-
/**
|
|
44
|
+
/** @internal */
|
|
23
45
|
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
46
|
+
/** @internal */
|
|
24
47
|
this.destroyRef = inject(DestroyRef);
|
|
25
48
|
/**
|
|
26
|
-
* @property {InputSignal<'date' | 'time' | 'both'>} variant
|
|
27
49
|
* @description
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
50
|
+
* Marks the field as required. When `true`, the component returns a
|
|
51
|
+
* `{ required: true }` validation error when no date is selected.
|
|
52
|
+
*
|
|
53
|
+
* @default false
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* <tk-date-picker [required]="true" errorMessage="Date is required" />
|
|
33
57
|
*/
|
|
34
|
-
this.
|
|
58
|
+
this.required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
35
59
|
/**
|
|
36
|
-
* @property {InputSignal<'single' | 'range'>} selectionMode
|
|
37
60
|
* @description
|
|
38
|
-
*
|
|
39
|
-
* - `'single'
|
|
40
|
-
* - `'range'
|
|
61
|
+
* Selection behaviour for the date calendar.
|
|
62
|
+
* - `'single'` — one date.
|
|
63
|
+
* - `'range'` — a pair of dates `[start, end]`.
|
|
64
|
+
*
|
|
41
65
|
* @default 'range'
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* <tk-date-picker selectionMode="single" />
|
|
42
69
|
*/
|
|
43
70
|
this.selectionMode = input('range', ...(ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []));
|
|
44
71
|
/**
|
|
45
|
-
* @property {InputSignal<boolean>} readonlyInput
|
|
46
|
-
* @description
|
|
47
|
-
* Disables manual typing in the input and forces the user to select via the calendar.
|
|
48
|
-
* @default true
|
|
49
|
-
*/
|
|
50
|
-
this.readonlyInput = input(true, ...(ngDevMode ? [{ debugName: "readonlyInput" }] : /* istanbul ignore next */ []));
|
|
51
|
-
/**
|
|
52
|
-
* @property {InputSignal<boolean>} showClear
|
|
53
72
|
* @description
|
|
54
|
-
*
|
|
73
|
+
* Shows a clear (×) button that resets the value to `null`.
|
|
74
|
+
*
|
|
55
75
|
* @default true
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* <tk-date-picker [showClear]="false" />
|
|
56
79
|
*/
|
|
57
80
|
this.showClear = input(true, ...(ngDevMode ? [{ debugName: "showClear" }] : /* istanbul ignore next */ []));
|
|
58
81
|
/**
|
|
59
|
-
* @property {InputSignal<boolean>} showIcon
|
|
60
82
|
* @description
|
|
61
|
-
* Shows the calendar
|
|
83
|
+
* Shows the calendar icon inside the input field.
|
|
84
|
+
* When `false`, the overlay can only be opened by clicking the input itself.
|
|
85
|
+
*
|
|
62
86
|
* @default true
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* <tk-date-picker [showIcon]="false" />
|
|
63
90
|
*/
|
|
64
91
|
this.showIcon = input(true, ...(ngDevMode ? [{ debugName: "showIcon" }] : /* istanbul ignore next */ []));
|
|
65
92
|
/**
|
|
66
|
-
* @property {InputSignal<string>} dateFormat
|
|
67
93
|
* @description
|
|
68
|
-
*
|
|
94
|
+
* Date display format forwarded to PrimeNG (e.g. `'dd/mm/yy'`, `'yy-mm-dd'`).
|
|
95
|
+
*
|
|
69
96
|
* @default 'dd/mm/yy'
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* <tk-date-picker dateFormat="yy-mm-dd" />
|
|
70
100
|
*/
|
|
71
101
|
this.dateFormat = input('dd/mm/yy', ...(ngDevMode ? [{ debugName: "dateFormat" }] : /* istanbul ignore next */ []));
|
|
72
102
|
/**
|
|
73
|
-
* @
|
|
74
|
-
* @description
|
|
75
|
-
* Format used by PrimeNG for displaying times.
|
|
76
|
-
* @default 'HH:mm'
|
|
77
|
-
*/
|
|
78
|
-
this.timeFormat = input('HH:mm', ...(ngDevMode ? [{ debugName: "timeFormat" }] : /* istanbul ignore next */ []));
|
|
79
|
-
/**
|
|
80
|
-
* @property {InputSignal<number>} stepHour
|
|
81
|
-
* @description
|
|
82
|
-
* Hours to skip when clicking up/down.
|
|
103
|
+
* @description Hour increment/decrement step for the time spinner (used when `showTime=true`).
|
|
83
104
|
* @default 1
|
|
84
105
|
*/
|
|
85
106
|
this.stepHour = input(1, ...(ngDevMode ? [{ debugName: "stepHour" }] : /* istanbul ignore next */ []));
|
|
86
107
|
/**
|
|
87
|
-
* @
|
|
88
|
-
* @description
|
|
89
|
-
* Minutes to skip when clicking up/down.
|
|
108
|
+
* @description Minute increment/decrement step for the time spinner (used when `showTime=true`).
|
|
90
109
|
* @default 1
|
|
91
110
|
*/
|
|
92
111
|
this.stepMinute = input(1, ...(ngDevMode ? [{ debugName: "stepMinute" }] : /* istanbul ignore next */ []));
|
|
93
112
|
/**
|
|
94
|
-
* @
|
|
95
|
-
* @description
|
|
96
|
-
* Seconds to skip when clicking up/down.
|
|
113
|
+
* @description Second increment/decrement step for the time spinner (used when `showTime=true`).
|
|
97
114
|
* @default 1
|
|
98
115
|
*/
|
|
99
116
|
this.stepSecond = input(1, ...(ngDevMode ? [{ debugName: "stepSecond" }] : /* istanbul ignore next */ []));
|
|
100
117
|
/**
|
|
101
|
-
* @property {InputSignal<boolean>} showSeconds
|
|
102
118
|
* @description
|
|
103
|
-
* Whether to show seconds in the time
|
|
104
|
-
* Only
|
|
119
|
+
* Whether to show the seconds segment in the time spinner.
|
|
120
|
+
* Only active when `showTime=true` and `hourFormat="24"`.
|
|
121
|
+
*
|
|
105
122
|
* @default false
|
|
106
123
|
*/
|
|
107
124
|
this.showSeconds = input(false, ...(ngDevMode ? [{ debugName: "showSeconds" }] : /* istanbul ignore next */ []));
|
|
108
125
|
/**
|
|
109
|
-
* @property {InputSignal<boolean>} disabled
|
|
110
126
|
* @description
|
|
111
|
-
*
|
|
127
|
+
* Disables the entire component. Can also be controlled through the bound
|
|
128
|
+
* form control via `control.disable()` / `control.enable()`.
|
|
129
|
+
*
|
|
112
130
|
* @default false
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* <tk-date-picker [disabled]="isReadonly()" />
|
|
113
134
|
*/
|
|
114
135
|
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
115
136
|
/**
|
|
116
|
-
* @property {InputSignal<boolean>} inline
|
|
117
137
|
* @description
|
|
118
|
-
*
|
|
138
|
+
* Renders the calendar inline (always visible) instead of in a dropdown overlay.
|
|
139
|
+
*
|
|
119
140
|
* @default false
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* <tk-date-picker [inline]="true" selectionMode="single" />
|
|
120
144
|
*/
|
|
121
145
|
this.inline = input(false, ...(ngDevMode ? [{ debugName: "inline" }] : /* istanbul ignore next */ []));
|
|
122
146
|
/**
|
|
123
|
-
* @property {InputSignal<boolean>} showTime
|
|
124
147
|
* @description
|
|
125
|
-
*
|
|
148
|
+
* Adds a time spinner alongside the date calendar.
|
|
149
|
+
*
|
|
126
150
|
* @default false
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* <tk-date-picker [showTime]="true" hourFormat="24" />
|
|
127
154
|
*/
|
|
128
155
|
this.showTime = input(false, ...(ngDevMode ? [{ debugName: "showTime" }] : /* istanbul ignore next */ []));
|
|
129
156
|
/**
|
|
130
|
-
* @property {InputSignal<'12' | '24'>} hourFormat
|
|
131
157
|
* @description
|
|
132
|
-
*
|
|
158
|
+
* Hour format for the time spinner (only relevant when `showTime=true`).
|
|
159
|
+
* - `'24'` — 0–23 hours.
|
|
160
|
+
* - `'12'` — 1–12 hours with AM/PM toggle.
|
|
161
|
+
*
|
|
133
162
|
* @default '24'
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* <tk-date-picker [showTime]="true" hourFormat="12" />
|
|
134
166
|
*/
|
|
135
167
|
this.hourFormat = input('24', ...(ngDevMode ? [{ debugName: "hourFormat" }] : /* istanbul ignore next */ []));
|
|
136
168
|
/**
|
|
137
|
-
* @property {InputSignal<string | HTMLElement | null | undefined>} appendTo
|
|
138
169
|
* @description
|
|
139
|
-
* Target element to
|
|
140
|
-
*
|
|
170
|
+
* Target element or CSS selector to which the overlay panel is appended.
|
|
171
|
+
* Use `'body'` to escape `overflow:hidden` parent containers (e.g. modals).
|
|
172
|
+
*
|
|
173
|
+
* @default 'body'
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* <tk-date-picker appendTo="body" />
|
|
141
177
|
*/
|
|
142
178
|
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : /* istanbul ignore next */ []));
|
|
143
179
|
/**
|
|
144
|
-
* @
|
|
145
|
-
* @description
|
|
146
|
-
* Base z-index value for the overlay.
|
|
180
|
+
* @description Base z-index applied to the overlay panel.
|
|
147
181
|
* @default 10000
|
|
148
182
|
*/
|
|
149
183
|
this.baseZIndex = input(10000, ...(ngDevMode ? [{ debugName: "baseZIndex" }] : /* istanbul ignore next */ []));
|
|
150
184
|
/**
|
|
151
|
-
* @property {InputSignal<Date | null>} maxDate
|
|
152
185
|
* @description
|
|
153
|
-
*
|
|
186
|
+
* Latest selectable date. Enforced both by PrimeNG (disables calendar days)
|
|
187
|
+
* and by Angular form validation.
|
|
188
|
+
*
|
|
154
189
|
* @default null
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* <tk-date-picker [maxDate]="today" errorMessage="Date cannot be in the future" />
|
|
155
193
|
*/
|
|
156
194
|
this.maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
157
195
|
/**
|
|
158
|
-
* @property {InputSignal<Date | null>} minDate
|
|
159
196
|
* @description
|
|
160
|
-
*
|
|
197
|
+
* Earliest selectable date. Enforced both by PrimeNG (disables calendar days)
|
|
198
|
+
* and by Angular form validation.
|
|
199
|
+
*
|
|
161
200
|
* @default null
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* <tk-date-picker [minDate]="today" errorMessage="Date must be today or later" />
|
|
162
204
|
*/
|
|
163
205
|
this.minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
164
206
|
/**
|
|
165
|
-
* @
|
|
166
|
-
* @
|
|
167
|
-
*
|
|
207
|
+
* @description Floating label text shown above the input field.
|
|
208
|
+
* @default 'Select a date'
|
|
209
|
+
* @example
|
|
210
|
+
* <tk-date-picker labelText="Check-in date" />
|
|
168
211
|
*/
|
|
169
212
|
this.labelText = input('Select a date', ...(ngDevMode ? [{ debugName: "labelText" }] : /* istanbul ignore next */ []));
|
|
170
213
|
/**
|
|
171
|
-
* @property {InputSignal<FormControl>} control
|
|
172
214
|
* @description
|
|
173
|
-
*
|
|
174
|
-
*
|
|
215
|
+
* Validation error message rendered beneath the field when the bound control
|
|
216
|
+
* is invalid and the field has been dirtied or touched.
|
|
217
|
+
*
|
|
218
|
+
* @default null
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* <tk-date-picker [minDate]="minDate" errorMessage="Date is required" />
|
|
222
|
+
*/
|
|
223
|
+
this.errorMessage = input(null, ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
224
|
+
/**
|
|
225
|
+
* @description
|
|
226
|
+
* Optional external `FormControl` to bind when not using the standard
|
|
227
|
+
* `formControl` / `formControlName` / `ngModel` directives.
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* <tk-date-picker [control]="form.controls.startDate" />
|
|
175
231
|
*/
|
|
176
232
|
this.control = input(undefined, ...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
|
|
177
233
|
/**
|
|
178
|
-
* @property {ModelSignal<DateValue>} modelValue
|
|
179
234
|
* @description
|
|
180
|
-
*
|
|
235
|
+
* Two-way signal binding for the selected value.
|
|
236
|
+
* Accepts `Date` (single), `[Date, Date]` (range), or `null` (cleared).
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* <tk-date-picker [(modelValue)]="selectedDate" />
|
|
181
240
|
*/
|
|
182
241
|
this.modelValue = model(null, ...(ngDevMode ? [{ debugName: "modelValue" }] : /* istanbul ignore next */ []));
|
|
183
242
|
/**
|
|
184
|
-
* @property {OutputRef<DateValue>} handleSelect
|
|
185
243
|
* @description
|
|
186
|
-
*
|
|
244
|
+
* Emits the selected value whenever a complete selection is made.
|
|
245
|
+
* In range mode, fires only when both start and end dates are chosen.
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* <tk-date-picker (handleSelect)="onDateSelected($event)" />
|
|
187
249
|
*/
|
|
188
250
|
this.handleSelect = output();
|
|
189
251
|
/**
|
|
190
|
-
* @
|
|
191
|
-
* @
|
|
192
|
-
*
|
|
252
|
+
* @description Emits when the user clears the field via the clear button.
|
|
253
|
+
* @example
|
|
254
|
+
* <tk-date-picker (handleClear)="onCleared()" />
|
|
193
255
|
*/
|
|
194
256
|
this.handleClear = output();
|
|
195
|
-
/**
|
|
196
|
-
* @property {WritableSignal<boolean>} disabledStatus
|
|
197
|
-
* @description
|
|
198
|
-
* Internal signal to track disabled state.
|
|
199
|
-
*/
|
|
257
|
+
/** @internal */
|
|
200
258
|
this.disabledStatus = signal(false, ...(ngDevMode ? [{ debugName: "disabledStatus" }] : /* istanbul ignore next */ []));
|
|
201
|
-
/**
|
|
202
|
-
* @property {Signal<boolean>} effectiveDisabled
|
|
203
|
-
* @description
|
|
204
|
-
* Returns true if either the [disabled] input is true OR the FormControl is disabled.
|
|
205
|
-
*/
|
|
259
|
+
/** @internal */
|
|
206
260
|
this.effectiveDisabled = computed(() => this.disabled() || this.disabledStatus(), ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
207
|
-
/**
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}, ...(ngDevMode ? [{ debugName: "effectiveDateFormat" }] : /* istanbul ignore next */ []));
|
|
224
|
-
/**
|
|
225
|
-
* @property {Signal<boolean>} effectiveShowSeconds
|
|
226
|
-
* @description
|
|
227
|
-
* Returns whether seconds should be shown, restricted to 24h format.
|
|
228
|
-
*/
|
|
229
|
-
this.effectiveShowSeconds = computed(() => {
|
|
230
|
-
return ((this.effectiveShowTime() || this.variant() === 'time') &&
|
|
231
|
-
this.hourFormat() === '24' &&
|
|
232
|
-
this.showSeconds());
|
|
233
|
-
}, ...(ngDevMode ? [{ debugName: "effectiveShowSeconds" }] : /* istanbul ignore next */ []));
|
|
234
|
-
/**
|
|
235
|
-
* @property {Signal<boolean>} effectiveShowTime
|
|
236
|
-
* @description
|
|
237
|
-
* Returns whether the time picker should be shown.
|
|
238
|
-
*/
|
|
239
|
-
this.effectiveShowTime = computed(() => {
|
|
240
|
-
return this.variant() === 'both' || this.showTime();
|
|
241
|
-
}, ...(ngDevMode ? [{ debugName: "effectiveShowTime" }] : /* istanbul ignore next */ []));
|
|
261
|
+
/** @internal */
|
|
262
|
+
this.effectiveMinDate = computed(() => this.minDate(), ...(ngDevMode ? [{ debugName: "effectiveMinDate" }] : /* istanbul ignore next */ []));
|
|
263
|
+
/** @internal */
|
|
264
|
+
this.effectiveMaxDate = computed(() => this.maxDate(), ...(ngDevMode ? [{ debugName: "effectiveMaxDate" }] : /* istanbul ignore next */ []));
|
|
265
|
+
/** @internal */
|
|
266
|
+
this.effectiveSelectionMode = computed(() => this.selectionMode(), ...(ngDevMode ? [{ debugName: "effectiveSelectionMode" }] : /* istanbul ignore next */ []));
|
|
267
|
+
/** @internal */
|
|
268
|
+
this.effectiveHourFormat = computed(() => this.hourFormat(), ...(ngDevMode ? [{ debugName: "effectiveHourFormat" }] : /* istanbul ignore next */ []));
|
|
269
|
+
/** @internal */
|
|
270
|
+
this.effectiveDateFormat = computed(() => this.dateFormat(), ...(ngDevMode ? [{ debugName: "effectiveDateFormat" }] : /* istanbul ignore next */ []));
|
|
271
|
+
/** @internal */
|
|
272
|
+
this.effectiveShowSeconds = computed(() => this.showTime() && this.hourFormat() === '24' && this.showSeconds(), ...(ngDevMode ? [{ debugName: "effectiveShowSeconds" }] : /* istanbul ignore next */ []));
|
|
273
|
+
/** @internal */
|
|
274
|
+
this.effectiveShowTime = computed(() => this.showTime(), ...(ngDevMode ? [{ debugName: "effectiveShowTime" }] : /* istanbul ignore next */ []));
|
|
275
|
+
/** @internal */
|
|
276
|
+
this.internalControl = new FormControl(null);
|
|
242
277
|
/**
|
|
243
|
-
* @property {Signal<FormControl>} effectiveControl
|
|
244
278
|
* @description
|
|
245
|
-
*
|
|
279
|
+
* Memoised signal returning the active `FormControl` in priority order:
|
|
280
|
+
* `NgControl` (reactive forms) → `control` input → internal fallback control.
|
|
246
281
|
*/
|
|
247
|
-
this.
|
|
248
|
-
/**
|
|
249
|
-
this.
|
|
250
|
-
this.
|
|
251
|
-
/**
|
|
252
|
-
this.
|
|
253
|
-
this.
|
|
254
|
-
this.
|
|
255
|
-
this.isWriting = false;
|
|
282
|
+
this.effectiveControl = computed(() => this.ngControl?.control ?? this.control() ?? this.internalControl, ...(ngDevMode ? [{ debugName: "effectiveControl" }] : /* istanbul ignore next */ []));
|
|
283
|
+
/** @internal Unique DOM id used for `inputId` / `for` binding on every instance. */
|
|
284
|
+
this.uid = `tk-datepicker-${++_datePickerUid}`;
|
|
285
|
+
/** @internal */ this.onChange = () => { };
|
|
286
|
+
/** @internal */ this.onTouched = () => { };
|
|
287
|
+
/** @internal */ this.onValidatorChange = () => { };
|
|
288
|
+
/** @internal */ this.lastValue = null;
|
|
289
|
+
/** @internal */ this.boundValidate = this.validate.bind(this);
|
|
256
290
|
if (this.ngControl) {
|
|
257
291
|
this.ngControl.valueAccessor = this;
|
|
258
292
|
}
|
|
293
|
+
toObservable(this.effectiveControl)
|
|
294
|
+
.pipe(switchMap(ctrl => {
|
|
295
|
+
this.disabledStatus.set(ctrl.disabled);
|
|
296
|
+
return ctrl.statusChanges;
|
|
297
|
+
}), takeUntilDestroyed())
|
|
298
|
+
.subscribe(() => {
|
|
299
|
+
this.disabledStatus.set(this.effectiveControl().disabled);
|
|
300
|
+
});
|
|
301
|
+
effect(() => {
|
|
302
|
+
this.required();
|
|
303
|
+
this.minDate();
|
|
304
|
+
this.maxDate();
|
|
305
|
+
untracked(() => {
|
|
306
|
+
this.onValidatorChange();
|
|
307
|
+
this.effectiveControl().updateValueAndValidity({ emitEvent: false });
|
|
308
|
+
});
|
|
309
|
+
});
|
|
259
310
|
}
|
|
260
|
-
|
|
261
|
-
return (this.ngControl?.control ||
|
|
262
|
-
this.control() ||
|
|
263
|
-
this.internalControl);
|
|
264
|
-
}
|
|
311
|
+
/** @inheritdoc */
|
|
265
312
|
ngOnInit() {
|
|
266
|
-
const control = this.effectiveControl;
|
|
267
|
-
// Synchronize initial disabled state
|
|
313
|
+
const control = this.effectiveControl();
|
|
268
314
|
this.disabledStatus.set(control.disabled);
|
|
269
|
-
// Watch for status changes (to support [control].disable() etc. from outside)
|
|
270
|
-
control.statusChanges
|
|
271
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
272
|
-
.subscribe(() => {
|
|
273
|
-
this.disabledStatus.set(control.disabled);
|
|
274
|
-
});
|
|
275
|
-
// Synchronize signal model with initial control value
|
|
276
315
|
const initialValue = control.value;
|
|
277
316
|
if (initialValue !== null && initialValue !== undefined) {
|
|
278
317
|
this.modelValue.set(initialValue);
|
|
279
318
|
this.lastValue = initialValue;
|
|
280
319
|
}
|
|
320
|
+
if (!this.ngControl) {
|
|
321
|
+
const currentModel = this.modelValue();
|
|
322
|
+
if (currentModel !== null && currentModel !== undefined) {
|
|
323
|
+
this.handleSelect.emit(currentModel);
|
|
324
|
+
this.onChange(currentModel);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
control.addValidators(this.boundValidate);
|
|
328
|
+
control.updateValueAndValidity({ emitEvent: false });
|
|
329
|
+
this.destroyRef.onDestroy(() => {
|
|
330
|
+
control.removeValidators(this.boundValidate);
|
|
331
|
+
});
|
|
281
332
|
}
|
|
333
|
+
/** @inheritdoc */
|
|
282
334
|
writeValue(value) {
|
|
283
|
-
this.isWriting = true;
|
|
284
335
|
this.modelValue.set(value);
|
|
285
336
|
this.lastValue = value;
|
|
286
|
-
this.isWriting = false;
|
|
287
337
|
}
|
|
338
|
+
/** @inheritdoc */
|
|
288
339
|
registerOnChange(fn) {
|
|
289
340
|
this.onChange = fn;
|
|
290
341
|
}
|
|
342
|
+
/** @inheritdoc */
|
|
291
343
|
registerOnTouched(fn) {
|
|
292
344
|
this.onTouched = fn;
|
|
293
345
|
}
|
|
346
|
+
/** @inheritdoc */
|
|
347
|
+
registerOnValidatorChange(fn) {
|
|
348
|
+
this.onValidatorChange = fn;
|
|
349
|
+
}
|
|
350
|
+
/** @inheritdoc */
|
|
351
|
+
validate() {
|
|
352
|
+
const value = this.modelValue();
|
|
353
|
+
if (!value)
|
|
354
|
+
return this.required() ? { required: true } : null;
|
|
355
|
+
const min = this.minDate();
|
|
356
|
+
const max = this.maxDate();
|
|
357
|
+
if (value instanceof Date)
|
|
358
|
+
return this.validateBounds(value, min, max);
|
|
359
|
+
if (!Array.isArray(value))
|
|
360
|
+
return null;
|
|
361
|
+
const [start, end] = value;
|
|
362
|
+
if (start instanceof Date) {
|
|
363
|
+
const err = this.validateBounds(start, min, max);
|
|
364
|
+
if (err)
|
|
365
|
+
return err;
|
|
366
|
+
}
|
|
367
|
+
return end instanceof Date ? this.validateBounds(end, min, max) : null;
|
|
368
|
+
}
|
|
369
|
+
validateBounds(date, min, max) {
|
|
370
|
+
if (min && date < min)
|
|
371
|
+
return { minDate: { min, actual: date } };
|
|
372
|
+
if (max && date > max)
|
|
373
|
+
return { maxDate: { max, actual: date } };
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
/** @inheritdoc */
|
|
294
377
|
setDisabledState(isDisabled) {
|
|
295
378
|
this.disabledStatus.set(isDisabled);
|
|
296
|
-
const control = this.effectiveControl;
|
|
379
|
+
const control = this.effectiveControl();
|
|
297
380
|
if (isDisabled && control.enabled) {
|
|
298
381
|
control.disable({ emitEvent: false });
|
|
299
382
|
}
|
|
@@ -301,58 +384,57 @@ class DatePickerComponent {
|
|
|
301
384
|
control.enable({ emitEvent: false });
|
|
302
385
|
}
|
|
303
386
|
}
|
|
304
|
-
/**
|
|
305
|
-
* @method onModelChange
|
|
306
|
-
* @description
|
|
307
|
-
* Called when the PrimeNG DatePicker template updates the value.
|
|
308
|
-
*/
|
|
387
|
+
/** @description Central change handler for PrimeNG's `ngModelChange`. */
|
|
309
388
|
onModelChange(value) {
|
|
310
|
-
if (this.isWriting) {
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
389
|
let finalValue = value;
|
|
314
|
-
|
|
315
|
-
if (this.selectionMode() === 'single' &&
|
|
390
|
+
if (this.effectiveSelectionMode() === 'single' &&
|
|
316
391
|
finalValue instanceof Date &&
|
|
317
|
-
this.lastValue instanceof Date
|
|
392
|
+
this.lastValue instanceof Date &&
|
|
393
|
+
finalValue.toDateString() === this.lastValue.toDateString()) {
|
|
318
394
|
finalValue = this.applyTimeCascading(this.lastValue, finalValue);
|
|
319
395
|
}
|
|
320
396
|
this.lastValue = finalValue;
|
|
321
397
|
this.modelValue.set(finalValue);
|
|
322
398
|
this.onChange(finalValue);
|
|
323
|
-
this.effectiveControl.setValue(finalValue, { emitEvent: false });
|
|
324
|
-
|
|
399
|
+
this.effectiveControl().setValue(finalValue, { emitEvent: false });
|
|
400
|
+
if (finalValue !== null) {
|
|
401
|
+
this.effectiveControl().markAsDirty();
|
|
402
|
+
}
|
|
325
403
|
if (finalValue === null) {
|
|
326
404
|
this.handleClear.emit();
|
|
327
405
|
}
|
|
328
|
-
else if (
|
|
329
|
-
|
|
330
|
-
const [start, end] = finalValue;
|
|
331
|
-
if (start instanceof Date && end instanceof Date) {
|
|
332
|
-
this.handleSelect.emit(finalValue);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
else if (finalValue instanceof Date) {
|
|
406
|
+
else if (finalValue instanceof Date ||
|
|
407
|
+
(Array.isArray(finalValue) && finalValue[0] instanceof Date && finalValue[1] instanceof Date)) {
|
|
337
408
|
this.handleSelect.emit(finalValue);
|
|
338
409
|
}
|
|
339
410
|
}
|
|
411
|
+
/** @description Marks the control as touched when the user leaves the field. */
|
|
412
|
+
onBlur() {
|
|
413
|
+
this.onTouched();
|
|
414
|
+
this.effectiveControl().markAsTouched();
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* @description Programmatically clears the selected value, resetting it to `null`.
|
|
418
|
+
*
|
|
419
|
+
* @example
|
|
420
|
+
* <tk-date-picker #picker />
|
|
421
|
+
* <button (click)="picker.clear()">Reset</button>
|
|
422
|
+
*/
|
|
423
|
+
clear() {
|
|
424
|
+
this.onModelChange(null);
|
|
425
|
+
}
|
|
340
426
|
/**
|
|
341
|
-
* @method applyTimeCascading
|
|
342
|
-
* @private
|
|
343
427
|
* @description
|
|
344
|
-
* Adjusts
|
|
428
|
+
* Adjusts hours or minutes when the spinner rolls over a unit boundary.
|
|
345
429
|
*/
|
|
346
430
|
applyTimeCascading(prev, curr) {
|
|
347
431
|
const updated = new Date(curr);
|
|
348
|
-
// Cascade seconds to minutes
|
|
349
432
|
if (prev.getSeconds() === 59 && updated.getSeconds() === 0) {
|
|
350
433
|
updated.setMinutes(updated.getMinutes() + 1);
|
|
351
434
|
}
|
|
352
435
|
else if (prev.getSeconds() === 0 && updated.getSeconds() === 59) {
|
|
353
436
|
updated.setMinutes(updated.getMinutes() - 1);
|
|
354
437
|
}
|
|
355
|
-
// Cascade minutes to hours
|
|
356
438
|
if (prev.getMinutes() === 59 && updated.getMinutes() === 0) {
|
|
357
439
|
updated.setHours(updated.getHours() + 1);
|
|
358
440
|
}
|
|
@@ -361,25 +443,8 @@ class DatePickerComponent {
|
|
|
361
443
|
}
|
|
362
444
|
return updated;
|
|
363
445
|
}
|
|
364
|
-
/**
|
|
365
|
-
* @method onBlur
|
|
366
|
-
* @description
|
|
367
|
-
* Triggered when the component loses focus.
|
|
368
|
-
*/
|
|
369
|
-
onBlur() {
|
|
370
|
-
this.onTouched();
|
|
371
|
-
this.effectiveControl.markAsTouched();
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* @method clear
|
|
375
|
-
* @description
|
|
376
|
-
* Programmatically clears the value.
|
|
377
|
-
*/
|
|
378
|
-
clear() {
|
|
379
|
-
this.onModelChange(null);
|
|
380
|
-
}
|
|
381
446
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
382
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: DatePickerComponent, isStandalone: true, selector: "tk-date-picker", inputs: {
|
|
447
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: DatePickerComponent, isStandalone: true, selector: "tk-date-picker", inputs: { required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, stepHour: { classPropertyName: "stepHour", publicName: "stepHour", isSignal: true, isRequired: false, transformFunction: null }, stepMinute: { classPropertyName: "stepMinute", publicName: "stepMinute", isSignal: true, isRequired: false, transformFunction: null }, stepSecond: { classPropertyName: "stepSecond", publicName: "stepSecond", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, baseZIndex: { classPropertyName: "baseZIndex", publicName: "baseZIndex", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, labelText: { classPropertyName: "labelText", publicName: "labelText", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, modelValue: { classPropertyName: "modelValue", publicName: "modelValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { modelValue: "modelValueChange", handleSelect: "handleSelect", handleClear: "handleClear" }, ngImport: i0, template: "<div class=\"datepicker-container\" [class.inline]=\"inline()\">\n @if (inline()) {\n <p-datepicker\n [inputId]=\"uid\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"true\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"effectiveMinDate()\"\n [maxDate]=\"effectiveMaxDate()\"\n [disabled]=\"effectiveDisabled()\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"false\"\n [inline]=\"true\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"effectiveHourFormat()\"\n [stepHour]=\"stepHour()\"\n [stepMinute]=\"stepMinute()\"\n [stepSecond]=\"stepSecond()\"\n [showSeconds]=\"effectiveShowSeconds()\">\n </p-datepicker>\n } @else {\n <p-floatlabel>\n <p-datepicker\n [inputId]=\"uid\"\n iconDisplay=\"input\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"true\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"effectiveMinDate()\"\n [maxDate]=\"effectiveMaxDate()\"\n [disabled]=\"effectiveDisabled()\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"false\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"effectiveHourFormat()\"\n [appendTo]=\"appendTo()\"\n [baseZIndex]=\"baseZIndex()\"\n [stepHour]=\"stepHour()\"\n [stepMinute]=\"stepMinute()\"\n [stepSecond]=\"stepSecond()\"\n [showSeconds]=\"effectiveShowSeconds()\">\n <ng-template #inputicon let-clickCallBack=\"clickCallBack\">\n <tk-icon\n icon=\"calendar-day\"\n tabindex=\"0\"\n (keydown.enter)=\"clickCallBack($event)\"\n (keydown.space)=\"clickCallBack($event)\"\n (click)=\"clickCallBack($event)\">\n </tk-icon>\n </ng-template>\n </p-datepicker>\n <label [for]=\"uid\">{{ labelText() }}</label>\n </p-floatlabel>\n }\n @if (errorMessage() && effectiveControl().invalid && (effectiveControl().dirty || effectiveControl().touched)) {\n <small class=\"p-error\">{{ errorMessage() }}</small>\n }\n</div>\n", styles: [":host ::ng-deep .p-datepicker{width:100%}:host ::ng-deep .p-datepicker-input{border:none;border-bottom:1px solid var(--tk-color-border-default, #cecdcd);border-radius:0;background-color:transparent;padding:var(--tk-spacing-base-75, 12px) var(--tk-spacing-base-75, 12px) var(--tk-spacing-base-75, 12px) var(--tk-spacing-base-25, 4px)!important}:host ::ng-deep .p-datepicker-input:focus{border-color:var(--tk-color-primary-default, #16006f)}:host ::ng-deep .p-datepicker.p-disabled{opacity:1!important}:host ::ng-deep .p-datepicker.p-disabled .p-datepicker-input{background-color:var(--tk-color-base-surface-200, #e4e4e4)!important;color:var(--tk-color-base-surface-500, #8a8a8b);border-bottom-color:var(--tk-color-base-surface-300, #d2d2d2);cursor:not-allowed}:host ::ng-deep .p-datepicker.p-disabled .p-datepicker-input-icon-container{color:var(--tk-color-base-surface-500, #8a8a8b);pointer-events:none}:host ::ng-deep .p-floatlabel:has(.p-disabled) label{color:var(--tk-color-base-surface-500, #8a8a8b)!important}:host ::ng-deep .p-datepicker-decade{color:var(--tk-color-text-default, #121214)}:host ::ng-deep .p-datepicker-clear-icon{color:var(--tk-surface-700, #424243);inset-inline-end:2.5rem!important}:host ::ng-deep .p-floatlabel{position:relative}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(input:focus) label{color:var(--tk-primary-500, #16006f)}:host ::ng-deep .p-floatlabel label{color:var(--tk-surface-700, #8a8a8b);font-family:var(--tk-font-family, Poppins, sans-serif);font-size:var(--tk-font-size-2xs, 1rem);font-weight:var(--tk-font-weight-400, 400);left:var(--tk-spacing-base-25, .25rem)}:host ::ng-deep .p-datepicker-day-selected-range{background-color:var(--tk-primary-100, #b7b0d2);color:var(--tk-primary-700, #10004f)}:host ::ng-deep .p-datepicker-panel{min-width:0!important;max-width:300px!important;width:100%!important}:host ::ng-deep .p-inputtext:disabled{background:var(--tk-color-base-surface-200, #e4e4e4)!important}.datepicker-container{margin-top:var(--tk-spacing-base-200, 2rem)}.datepicker-container.inline{margin-top:0}small.p-error{display:block;margin-top:var(--tk-spacing-base-25, .25rem);color:var(--tk-color-base-red-700, #cf2604);font-size:var(--tk-font-size-xs, .75rem)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i2.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "component", type: IconComponent, selector: "tk-icon", inputs: ["icon", "styleIcon", "color", "size", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
383
448
|
}
|
|
384
449
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DatePickerComponent, decorators: [{
|
|
385
450
|
type: Component,
|
|
@@ -388,9 +453,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImpor
|
|
|
388
453
|
ReactiveFormsModule,
|
|
389
454
|
DatePickerModule,
|
|
390
455
|
FloatLabelModule,
|
|
391
|
-
|
|
392
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"datepicker-container\" [class.inline]=\"inline()\">\n @if (inline()) {\n <p-datepicker\n inputId=\"
|
|
393
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
456
|
+
IconComponent,
|
|
457
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"datepicker-container\" [class.inline]=\"inline()\">\n @if (inline()) {\n <p-datepicker\n [inputId]=\"uid\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"true\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"effectiveMinDate()\"\n [maxDate]=\"effectiveMaxDate()\"\n [disabled]=\"effectiveDisabled()\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"false\"\n [inline]=\"true\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"effectiveHourFormat()\"\n [stepHour]=\"stepHour()\"\n [stepMinute]=\"stepMinute()\"\n [stepSecond]=\"stepSecond()\"\n [showSeconds]=\"effectiveShowSeconds()\">\n </p-datepicker>\n } @else {\n <p-floatlabel>\n <p-datepicker\n [inputId]=\"uid\"\n iconDisplay=\"input\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"true\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"effectiveMinDate()\"\n [maxDate]=\"effectiveMaxDate()\"\n [disabled]=\"effectiveDisabled()\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"false\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"effectiveHourFormat()\"\n [appendTo]=\"appendTo()\"\n [baseZIndex]=\"baseZIndex()\"\n [stepHour]=\"stepHour()\"\n [stepMinute]=\"stepMinute()\"\n [stepSecond]=\"stepSecond()\"\n [showSeconds]=\"effectiveShowSeconds()\">\n <ng-template #inputicon let-clickCallBack=\"clickCallBack\">\n <tk-icon\n icon=\"calendar-day\"\n tabindex=\"0\"\n (keydown.enter)=\"clickCallBack($event)\"\n (keydown.space)=\"clickCallBack($event)\"\n (click)=\"clickCallBack($event)\">\n </tk-icon>\n </ng-template>\n </p-datepicker>\n <label [for]=\"uid\">{{ labelText() }}</label>\n </p-floatlabel>\n }\n @if (errorMessage() && effectiveControl().invalid && (effectiveControl().dirty || effectiveControl().touched)) {\n <small class=\"p-error\">{{ errorMessage() }}</small>\n }\n</div>\n", styles: [":host ::ng-deep .p-datepicker{width:100%}:host ::ng-deep .p-datepicker-input{border:none;border-bottom:1px solid var(--tk-color-border-default, #cecdcd);border-radius:0;background-color:transparent;padding:var(--tk-spacing-base-75, 12px) var(--tk-spacing-base-75, 12px) var(--tk-spacing-base-75, 12px) var(--tk-spacing-base-25, 4px)!important}:host ::ng-deep .p-datepicker-input:focus{border-color:var(--tk-color-primary-default, #16006f)}:host ::ng-deep .p-datepicker.p-disabled{opacity:1!important}:host ::ng-deep .p-datepicker.p-disabled .p-datepicker-input{background-color:var(--tk-color-base-surface-200, #e4e4e4)!important;color:var(--tk-color-base-surface-500, #8a8a8b);border-bottom-color:var(--tk-color-base-surface-300, #d2d2d2);cursor:not-allowed}:host ::ng-deep .p-datepicker.p-disabled .p-datepicker-input-icon-container{color:var(--tk-color-base-surface-500, #8a8a8b);pointer-events:none}:host ::ng-deep .p-floatlabel:has(.p-disabled) label{color:var(--tk-color-base-surface-500, #8a8a8b)!important}:host ::ng-deep .p-datepicker-decade{color:var(--tk-color-text-default, #121214)}:host ::ng-deep .p-datepicker-clear-icon{color:var(--tk-surface-700, #424243);inset-inline-end:2.5rem!important}:host ::ng-deep .p-floatlabel{position:relative}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(input:focus) label{color:var(--tk-primary-500, #16006f)}:host ::ng-deep .p-floatlabel label{color:var(--tk-surface-700, #8a8a8b);font-family:var(--tk-font-family, Poppins, sans-serif);font-size:var(--tk-font-size-2xs, 1rem);font-weight:var(--tk-font-weight-400, 400);left:var(--tk-spacing-base-25, .25rem)}:host ::ng-deep .p-datepicker-day-selected-range{background-color:var(--tk-primary-100, #b7b0d2);color:var(--tk-primary-700, #10004f)}:host ::ng-deep .p-datepicker-panel{min-width:0!important;max-width:300px!important;width:100%!important}:host ::ng-deep .p-inputtext:disabled{background:var(--tk-color-base-surface-200, #e4e4e4)!important}.datepicker-container{margin-top:var(--tk-spacing-base-200, 2rem)}.datepicker-container.inline{margin-top:0}small.p-error{display:block;margin-top:var(--tk-spacing-base-25, .25rem);color:var(--tk-color-base-red-700, #cf2604);font-size:var(--tk-font-size-xs, .75rem)}\n"] }]
|
|
458
|
+
}], ctorParameters: () => [], propDecorators: { required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], dateFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateFormat", required: false }] }], stepHour: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepHour", required: false }] }], stepMinute: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepMinute", required: false }] }], stepSecond: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepSecond", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], showTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTime", required: false }] }], hourFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourFormat", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], baseZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseZIndex", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], labelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelText", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: false }] }], modelValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "modelValue", required: false }] }, { type: i0.Output, args: ["modelValueChange"] }], handleSelect: [{ type: i0.Output, args: ["handleSelect"] }], handleClear: [{ type: i0.Output, args: ["handleClear"] }] } });
|
|
394
459
|
|
|
395
460
|
/**
|
|
396
461
|
* Generated bundle index. Do not edit.
|