@tekus/design-system 5.24.0 → 5.25.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-date-picker.mjs +50 -20
- package/fesm2022/tekus-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-drawer.mjs +40 -24
- package/fesm2022/tekus-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-modal.mjs +37 -23
- package/fesm2022/tekus-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/tekus-design-system-core-types.mjs +71 -2
- package/fesm2022/tekus-design-system-core-types.mjs.map +1 -1
- package/fesm2022/tekus-design-system-core.mjs +71 -2
- package/fesm2022/tekus-design-system-core.mjs.map +1 -1
- package/package.json +2 -2
- package/types/tekus-design-system-components-date-picker.d.ts +24 -6
- package/types/tekus-design-system-components-drawer.d.ts +12 -7
- package/types/tekus-design-system-components-modal.d.ts +12 -10
- package/types/tekus-design-system-core-types.d.ts +45 -1
- package/types/tekus-design-system-core.d.ts +45 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, DestroyRef, input, model, output, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { inject, DestroyRef, input, model, output, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { NgControl, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -9,7 +9,6 @@ import * as i3 from 'primeng/floatlabel';
|
|
|
9
9
|
import { FloatLabelModule } from 'primeng/floatlabel';
|
|
10
10
|
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
|
11
11
|
import { faCalendarDay, faClock } from '@fortawesome/pro-regular-svg-icons';
|
|
12
|
-
import { Subscription } from 'rxjs';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* @component DatePickerComponent
|
|
@@ -106,6 +105,13 @@ class DatePickerComponent {
|
|
|
106
105
|
* @default false
|
|
107
106
|
*/
|
|
108
107
|
this.showSeconds = input(false, ...(ngDevMode ? [{ debugName: "showSeconds" }] : /* istanbul ignore next */ []));
|
|
108
|
+
/**
|
|
109
|
+
* @property {InputSignal<boolean>} disabled
|
|
110
|
+
* @description
|
|
111
|
+
* Whether the component is disabled.
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
109
115
|
/**
|
|
110
116
|
* @property {InputSignal<boolean>} inline
|
|
111
117
|
* @description
|
|
@@ -133,7 +139,7 @@ class DatePickerComponent {
|
|
|
133
139
|
* Target element to attach the overlay to.
|
|
134
140
|
* @default 'null'
|
|
135
141
|
*/
|
|
136
|
-
this.appendTo = input(
|
|
142
|
+
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : /* istanbul ignore next */ []));
|
|
137
143
|
/**
|
|
138
144
|
* @property {InputSignal<number>} baseZIndex
|
|
139
145
|
* @description
|
|
@@ -186,6 +192,18 @@ class DatePickerComponent {
|
|
|
186
192
|
* Emitted when the value is cleared.
|
|
187
193
|
*/
|
|
188
194
|
this.handleClear = output();
|
|
195
|
+
/**
|
|
196
|
+
* @property {WritableSignal<boolean>} disabledStatus
|
|
197
|
+
* @description
|
|
198
|
+
* Internal signal to track disabled state.
|
|
199
|
+
*/
|
|
200
|
+
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
|
+
*/
|
|
206
|
+
this.effectiveDisabled = computed(() => this.disabled() || this.disabledStatus(), ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
189
207
|
/** Computed properties */
|
|
190
208
|
/**
|
|
191
209
|
* @property {Signal<'single' | 'range'>} effectiveSelectionMode
|
|
@@ -233,8 +251,8 @@ class DatePickerComponent {
|
|
|
233
251
|
/** CVA Logic */
|
|
234
252
|
this.onChange = () => { };
|
|
235
253
|
this.onTouched = () => { };
|
|
236
|
-
this.sub = new Subscription();
|
|
237
254
|
this.lastValue = null;
|
|
255
|
+
this.isWriting = false;
|
|
238
256
|
if (this.ngControl) {
|
|
239
257
|
this.ngControl.valueAccessor = this;
|
|
240
258
|
}
|
|
@@ -246,23 +264,26 @@ class DatePickerComponent {
|
|
|
246
264
|
}
|
|
247
265
|
ngOnInit() {
|
|
248
266
|
const control = this.effectiveControl;
|
|
249
|
-
// Synchronize
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
control.valueChanges
|
|
267
|
+
// Synchronize initial disabled state
|
|
268
|
+
this.disabledStatus.set(control.disabled);
|
|
269
|
+
// Watch for status changes (to support [control].disable() etc. from outside)
|
|
270
|
+
control.statusChanges
|
|
254
271
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
255
|
-
.subscribe(
|
|
256
|
-
this.
|
|
257
|
-
this.lastValue = value;
|
|
272
|
+
.subscribe(() => {
|
|
273
|
+
this.disabledStatus.set(control.disabled);
|
|
258
274
|
});
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
275
|
+
// Synchronize signal model with initial control value
|
|
276
|
+
const initialValue = control.value;
|
|
277
|
+
if (initialValue !== null && initialValue !== undefined) {
|
|
278
|
+
this.modelValue.set(initialValue);
|
|
279
|
+
this.lastValue = initialValue;
|
|
280
|
+
}
|
|
262
281
|
}
|
|
263
282
|
writeValue(value) {
|
|
283
|
+
this.isWriting = true;
|
|
264
284
|
this.modelValue.set(value);
|
|
265
285
|
this.lastValue = value;
|
|
286
|
+
this.isWriting = false;
|
|
266
287
|
}
|
|
267
288
|
registerOnChange(fn) {
|
|
268
289
|
this.onChange = fn;
|
|
@@ -271,8 +292,14 @@ class DatePickerComponent {
|
|
|
271
292
|
this.onTouched = fn;
|
|
272
293
|
}
|
|
273
294
|
setDisabledState(isDisabled) {
|
|
274
|
-
|
|
275
|
-
this.effectiveControl
|
|
295
|
+
this.disabledStatus.set(isDisabled);
|
|
296
|
+
const control = this.effectiveControl;
|
|
297
|
+
if (isDisabled && control.enabled) {
|
|
298
|
+
control.disable({ emitEvent: false });
|
|
299
|
+
}
|
|
300
|
+
else if (!isDisabled && control.disabled) {
|
|
301
|
+
control.enable({ emitEvent: false });
|
|
302
|
+
}
|
|
276
303
|
}
|
|
277
304
|
/**
|
|
278
305
|
* @method onModelChange
|
|
@@ -280,6 +307,9 @@ class DatePickerComponent {
|
|
|
280
307
|
* Called when the PrimeNG DatePicker template updates the value.
|
|
281
308
|
*/
|
|
282
309
|
onModelChange(value) {
|
|
310
|
+
if (this.isWriting) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
283
313
|
let finalValue = value;
|
|
284
314
|
// Time cascading logic (single mode only)
|
|
285
315
|
if (this.selectionMode() === 'single' &&
|
|
@@ -349,7 +379,7 @@ class DatePickerComponent {
|
|
|
349
379
|
this.onModelChange(null);
|
|
350
380
|
}
|
|
351
381
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
352
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: DatePickerComponent, isStandalone: true, selector: "tk-date-picker", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, readonlyInput: { classPropertyName: "readonlyInput", publicName: "readonlyInput", 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 }, timeFormat: { classPropertyName: "timeFormat", publicName: "timeFormat", 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 }, 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 }, 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=\"datepicker\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"readonlyInput()\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"
|
|
382
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: DatePickerComponent, isStandalone: true, selector: "tk-date-picker", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, readonlyInput: { classPropertyName: "readonlyInput", publicName: "readonlyInput", 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 }, timeFormat: { classPropertyName: "timeFormat", publicName: "timeFormat", 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 }, 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=\"datepicker\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"readonlyInput()\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"effectiveDisabled()\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"variant() === 'time'\"\n [inline]=\"true\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"hourFormat()\"\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=\"datepicker\"\n iconDisplay=\"input\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"readonlyInput()\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"effectiveDisabled()\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"variant() === 'time'\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"hourFormat()\"\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 <fa-icon\n tabindex=\"0\"\n [icon]=\"variant() === 'time' ? faClock : faCalendarDay\"\n (keydown.enter)=\"clickCallBack($event)\"\n (keydown.space)=\"clickCallBack($event)\"\n (click)=\"clickCallBack($event)\">\n </fa-icon>\n </ng-template>\n </p-datepicker>\n\n <label for=\"datepicker\">{{ labelText() }}</label>\n </p-floatlabel>\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-accent-default, #16006f)}: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: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}.datepicker-container{margin-top:var(--tk-spacing-base-200, 2rem)}.datepicker-container.inline{margin-top:0}\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: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
353
383
|
}
|
|
354
384
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DatePickerComponent, decorators: [{
|
|
355
385
|
type: Component,
|
|
@@ -359,8 +389,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImpor
|
|
|
359
389
|
DatePickerModule,
|
|
360
390
|
FloatLabelModule,
|
|
361
391
|
FaIconComponent,
|
|
362
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"datepicker-container\" [class.inline]=\"inline()\">\n @if (inline()) {\n <p-datepicker\n inputId=\"datepicker\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"readonlyInput()\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"
|
|
363
|
-
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], readonlyInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonlyInput", 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 }] }], timeFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeFormat", 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 }] }], 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 }] }], 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"] }] } });
|
|
392
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"datepicker-container\" [class.inline]=\"inline()\">\n @if (inline()) {\n <p-datepicker\n inputId=\"datepicker\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"readonlyInput()\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"effectiveDisabled()\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"variant() === 'time'\"\n [inline]=\"true\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"hourFormat()\"\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=\"datepicker\"\n iconDisplay=\"input\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"readonlyInput()\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"effectiveDisabled()\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"variant() === 'time'\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"hourFormat()\"\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 <fa-icon\n tabindex=\"0\"\n [icon]=\"variant() === 'time' ? faClock : faCalendarDay\"\n (keydown.enter)=\"clickCallBack($event)\"\n (keydown.space)=\"clickCallBack($event)\"\n (click)=\"clickCallBack($event)\">\n </fa-icon>\n </ng-template>\n </p-datepicker>\n\n <label for=\"datepicker\">{{ labelText() }}</label>\n </p-floatlabel>\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-accent-default, #16006f)}: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: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}.datepicker-container{margin-top:var(--tk-spacing-base-200, 2rem)}.datepicker-container.inline{margin-top:0}\n"] }]
|
|
393
|
+
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], readonlyInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonlyInput", 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 }] }], timeFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeFormat", 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 }] }], 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"] }] } });
|
|
364
394
|
|
|
365
395
|
/**
|
|
366
396
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tekus-design-system-components-date-picker.mjs","sources":["../../../projects/design-system/components/date-picker/src/date-picker.component.ts","../../../projects/design-system/components/date-picker/src/date-picker.component.html","../../../projects/design-system/components/date-picker/tekus-design-system-components-date-picker.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n OnInit,\n inject,\n input,\n model,\n computed,\n output,\n OnDestroy,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n FormsModule,\n ReactiveFormsModule,\n FormControl,\n ControlValueAccessor,\n NgControl,\n} from '@angular/forms';\n\nimport { DatePickerModule } from 'primeng/datepicker';\nimport { FloatLabelModule } from 'primeng/floatlabel';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faCalendarDay, faClock } from '@fortawesome/pro-regular-svg-icons';\nimport { Subscription } from 'rxjs';\n\nexport type DateValue = Date | [Date, Date] | null;\n\n@Component({\n selector: 'tk-date-picker',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n DatePickerModule,\n FloatLabelModule,\n FaIconComponent,\n ],\n templateUrl: './date-picker.component.html',\n styleUrl: './date-picker.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * @component DatePickerComponent\n * @description\n * A wrapper around PrimeNG's DatePicker component with support for single-date,\n * range selection, and time-only modes. It uses Angular Signals for reactivity\n * and strictly implements the ControlValueAccessor interface via NgControl.\n */\nexport class DatePickerComponent\n implements OnInit, ControlValueAccessor, OnDestroy\n{\n /** Internal references and injections */\n readonly ngControl = inject(NgControl, { self: true, optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n /**\n * @property {InputSignal<'date' | 'time' | 'both'>} variant\n * @description\n * Defines the visual and functional mode:\n * - `'date'`: standard date/range picker\n * - `'time'`: time-only picker\n * - `'both'`: date and time picker\n * @default 'date'\n */\n variant = input<'date' | 'time' | 'both'>('date');\n\n /**\n * @property {InputSignal<'single' | 'range'>} selectionMode\n * @description\n * Defines how the datepicker behaves:\n * - `'single'`: select one date\n * - `'range'`: select a pair of dates [start, end]\n * @default 'range'\n */\n selectionMode = input<'single' | 'range'>('range');\n\n /**\n * @property {InputSignal<boolean>} readonlyInput\n * @description\n * Disables manual typing in the input and forces the user to select via the calendar.\n * @default true\n */\n readonlyInput = input<boolean>(true);\n\n /**\n * @property {InputSignal<boolean>} showClear\n * @description\n * Displays a clear button that resets the datepicker value.\n * @default true\n */\n showClear = input<boolean>(true);\n\n /**\n * @property {InputSignal<boolean>} showIcon\n * @description\n * Shows the calendar or clock icon inside the input.\n * @default true\n */\n showIcon = input<boolean>(true);\n\n /**\n * @property {InputSignal<string>} dateFormat\n * @description\n * Format used by PrimeNG for displaying dates.\n * @default 'dd/mm/yy'\n */\n dateFormat = input<string>('dd/mm/yy');\n\n /**\n * @property {InputSignal<string>} timeFormat\n * @description\n * Format used by PrimeNG for displaying times.\n * @default 'HH:mm'\n */\n timeFormat = input<string>('HH:mm');\n\n /**\n * @property {InputSignal<number>} stepHour\n * @description\n * Hours to skip when clicking up/down.\n * @default 1\n */\n stepHour = input<number>(1);\n\n /**\n * @property {InputSignal<number>} stepMinute\n * @description\n * Minutes to skip when clicking up/down.\n * @default 1\n */\n stepMinute = input<number>(1);\n\n /**\n * @property {InputSignal<number>} stepSecond\n * @description\n * Seconds to skip when clicking up/down.\n * @default 1\n */\n stepSecond = input<number>(1);\n\n /**\n * @property {InputSignal<boolean>} showSeconds\n * @description\n * Whether to show seconds in the time picker.\n * Only applicable when hourFormat is '24'.\n * @default false\n */\n showSeconds = input<boolean>(false);\n\n /**\n * @property {InputSignal<boolean>} inline\n * @description\n * Whether to display the datepicker inline.\n * @default false\n */\n inline = input<boolean>(false);\n\n /**\n * @property {InputSignal<boolean>} showTime\n * @description\n * Whether to show the time picker along with the date picker.\n * @default false\n */\n showTime = input<boolean>(false);\n\n /**\n * @property {InputSignal<'12' | '24'>} hourFormat\n * @description\n * Format of the hours: '12' or '24'.\n * @default '24'\n */\n hourFormat = input<'12' | '24'>('24');\n\n /**\n * @property {InputSignal<string | HTMLElement | null | undefined>} appendTo\n * @description\n * Target element to attach the overlay to.\n * @default 'null'\n */\n appendTo = input<string | HTMLElement | null | undefined>(null);\n\n /**\n * @property {InputSignal<number>} baseZIndex\n * @description\n * Base z-index value for the overlay.\n * @default 10000\n */\n baseZIndex = input<number>(10000);\n\n /**\n * @property {InputSignal<Date | null>} maxDate\n * @description\n * Maximum selectable date.\n * @default null\n */\n maxDate = input<Date | null>(null);\n\n /**\n * @property {InputSignal<Date | null>} minDate\n * @description\n * Minimum selectable date.\n * @default null\n */\n minDate = input<Date | null>(null);\n\n /**\n * @property {InputSignal<string>} labelText\n * @description\n * Label shown by the float-label wrapper.\n */\n labelText = input<string>('Select a date');\n\n /**\n * @property {InputSignal<FormControl>} control\n * @description\n * External FormControl used to read/set the datepicker value.\n * If not provided, an internal FormControl is created.\n */\n control = input<FormControl | undefined>(undefined);\n\n /**\n * @property {ModelSignal<DateValue>} modelValue\n * @description\n * The value of the datepicker model. Supports two-way binding.\n */\n modelValue = model<DateValue>(null);\n\n /**\n * @property {OutputRef<DateValue>} handleSelect\n * @description\n * Emitted when a value is selected.\n */\n handleSelect = output<DateValue>();\n\n /**\n * @property {OutputRef<void>} handleClear\n * @description\n * Emitted when the value is cleared.\n */\n handleClear = output<void>();\n\n /** Computed properties */\n\n /**\n * @property {Signal<'single' | 'range'>} effectiveSelectionMode\n * @description\n * Returns 'single' automatically if variant is 'time', otherwise returns the user-provided selectionMode.\n */\n effectiveSelectionMode = computed(() => {\n return this.variant() === 'time' ? 'single' : this.selectionMode();\n });\n\n /**\n * @property {Signal<string>} effectiveDateFormat\n * @description\n * Returns the user-provided dateFormat or timeFormat based on the variant.\n */\n effectiveDateFormat = computed(() => {\n return this.variant() === 'time' ? this.timeFormat() : this.dateFormat();\n });\n\n /**\n * @property {Signal<boolean>} effectiveShowSeconds\n * @description\n * Returns whether seconds should be shown, restricted to 24h format.\n */\n effectiveShowSeconds = computed(() => {\n return (\n (this.effectiveShowTime() || this.variant() === 'time') &&\n this.hourFormat() === '24' &&\n this.showSeconds()\n );\n });\n\n /**\n * @property {Signal<boolean>} effectiveShowTime\n * @description\n * Returns whether the time picker should be shown.\n */\n effectiveShowTime = computed(() => {\n return this.variant() === 'both' || this.showTime();\n });\n\n /**\n * @property {Signal<FormControl>} effectiveControl\n * @description\n * Returns the external FormControl from NgControl or a local fallback.\n */\n internalControl = new FormControl<DateValue>(null);\n get effectiveControl(): FormControl {\n return (\n (this.ngControl?.control as FormControl) ||\n this.control() ||\n this.internalControl\n );\n }\n\n /** Icons */\n faCalendarDay = faCalendarDay;\n faClock = faClock;\n\n /** CVA Logic */\n onChange: (value: DateValue) => void = () => {};\n onTouched: () => void = () => {};\n private readonly sub = new Subscription();\n private lastValue: DateValue = null;\n\n ngOnInit(): void {\n const control = this.effectiveControl;\n\n // Synchronize signal model with control value\n const initialValue = control.value;\n this.modelValue.set(initialValue);\n this.lastValue = initialValue;\n\n control.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(value => {\n this.modelValue.set(value);\n this.lastValue = value;\n });\n }\n\n ngOnDestroy(): void {\n this.sub.unsubscribe();\n }\n\n writeValue(value: DateValue): void {\n this.modelValue.set(value);\n this.lastValue = value;\n }\n\n registerOnChange(fn: (value: DateValue) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n const action = isDisabled ? 'disable' : 'enable';\n this.effectiveControl[action]({ emitEvent: false });\n }\n\n /**\n * @method onModelChange\n * @description\n * Called when the PrimeNG DatePicker template updates the value.\n */\n onModelChange(value: DateValue): void {\n let finalValue = value;\n\n // Time cascading logic (single mode only)\n if (\n this.selectionMode() === 'single' &&\n finalValue instanceof Date &&\n this.lastValue instanceof Date\n ) {\n finalValue = this.applyTimeCascading(this.lastValue, finalValue);\n }\n\n this.lastValue = finalValue;\n this.modelValue.set(finalValue);\n this.onChange(finalValue);\n this.effectiveControl.setValue(finalValue, { emitEvent: false });\n this.effectiveControl.markAsDirty();\n\n if (finalValue === null) {\n this.handleClear.emit();\n } else if (this.selectionMode() === 'range') {\n if (Array.isArray(finalValue)) {\n const [start, end] = finalValue;\n if (start instanceof Date && end instanceof Date) {\n this.handleSelect.emit(finalValue);\n }\n }\n } else if (finalValue instanceof Date) {\n this.handleSelect.emit(finalValue);\n }\n }\n\n /**\n * @method applyTimeCascading\n * @private\n * @description\n * Adjusts the date when minutes or seconds wrap around.\n */\n private applyTimeCascading(prev: Date, curr: Date): Date {\n const updated = new Date(curr);\n\n // Cascade seconds to minutes\n if (prev.getSeconds() === 59 && updated.getSeconds() === 0) {\n updated.setMinutes(updated.getMinutes() + 1);\n } else if (prev.getSeconds() === 0 && updated.getSeconds() === 59) {\n updated.setMinutes(updated.getMinutes() - 1);\n }\n\n // Cascade minutes to hours\n if (prev.getMinutes() === 59 && updated.getMinutes() === 0) {\n updated.setHours(updated.getHours() + 1);\n } else if (prev.getMinutes() === 0 && updated.getMinutes() === 59) {\n updated.setHours(updated.getHours() - 1);\n }\n\n return updated;\n }\n\n /**\n * @method onBlur\n * @description\n * Triggered when the component loses focus.\n */\n onBlur(): void {\n this.onTouched();\n this.effectiveControl.markAsTouched();\n }\n\n /**\n * @method clear\n * @description\n * Programmatically clears the value.\n */\n clear() {\n this.onModelChange(null);\n }\n}\n","<div class=\"datepicker-container\" [class.inline]=\"inline()\">\n @if (inline()) {\n <p-datepicker\n inputId=\"datepicker\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"readonlyInput()\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"effectiveControl.disabled\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"variant() === 'time'\"\n [inline]=\"true\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"hourFormat()\"\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=\"datepicker\"\n iconDisplay=\"input\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"readonlyInput()\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"effectiveControl.disabled\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"variant() === 'time'\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"hourFormat()\"\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 <fa-icon\n tabindex=\"0\"\n [icon]=\"variant() === 'time' ? faClock : faCalendarDay\"\n (keydown.enter)=\"clickCallBack($event)\"\n (keydown.space)=\"clickCallBack($event)\"\n (click)=\"clickCallBack($event)\">\n </fa-icon>\n </ng-template>\n </p-datepicker>\n\n <label for=\"datepicker\">{{ labelText() }}</label>\n </p-floatlabel>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AA0CA;;;;;;AAMG;MACU,mBAAmB,CAAA;AAO9B,IAAA,WAAA,GAAA;;AAHS,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACrD,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAQhD;;;;;;;;AAQG;AACH,QAAA,IAAA,CAAA,OAAO,GA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,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,OAAA,EACjB;wBACP,WAAW;wBACX,mBAAmB;wBACnB,gBAAgB;wBAChB,gBAAgB;wBAChB,eAAe;qBAChB,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,myEAAA,EAAA,MAAA,EAAA,CAAA,02CAAA,CAAA,EAAA;;;AExCjD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"tekus-design-system-components-date-picker.mjs","sources":["../../../projects/design-system/components/date-picker/src/date-picker.component.ts","../../../projects/design-system/components/date-picker/src/date-picker.component.html","../../../projects/design-system/components/date-picker/tekus-design-system-components-date-picker.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n OnInit,\n inject,\n input,\n model,\n signal,\n computed,\n output,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n FormsModule,\n ReactiveFormsModule,\n FormControl,\n ControlValueAccessor,\n NgControl,\n} from '@angular/forms';\n\nimport { DatePickerModule } from 'primeng/datepicker';\nimport { FloatLabelModule } from 'primeng/floatlabel';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faCalendarDay, faClock } from '@fortawesome/pro-regular-svg-icons';\n\nexport type DateValue = Date | [Date, Date] | null;\n\n@Component({\n selector: 'tk-date-picker',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n DatePickerModule,\n FloatLabelModule,\n FaIconComponent,\n ],\n templateUrl: './date-picker.component.html',\n styleUrl: './date-picker.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * @component DatePickerComponent\n * @description\n * A wrapper around PrimeNG's DatePicker component with support for single-date,\n * range selection, and time-only modes. It uses Angular Signals for reactivity\n * and strictly implements the ControlValueAccessor interface via NgControl.\n */\nexport class DatePickerComponent implements OnInit, ControlValueAccessor {\n /** Internal references and injections */\n readonly ngControl = inject(NgControl, { self: true, optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n /**\n * @property {InputSignal<'date' | 'time' | 'both'>} variant\n * @description\n * Defines the visual and functional mode:\n * - `'date'`: standard date/range picker\n * - `'time'`: time-only picker\n * - `'both'`: date and time picker\n * @default 'date'\n */\n variant = input<'date' | 'time' | 'both'>('date');\n\n /**\n * @property {InputSignal<'single' | 'range'>} selectionMode\n * @description\n * Defines how the datepicker behaves:\n * - `'single'`: select one date\n * - `'range'`: select a pair of dates [start, end]\n * @default 'range'\n */\n selectionMode = input<'single' | 'range'>('range');\n\n /**\n * @property {InputSignal<boolean>} readonlyInput\n * @description\n * Disables manual typing in the input and forces the user to select via the calendar.\n * @default true\n */\n readonlyInput = input<boolean>(true);\n\n /**\n * @property {InputSignal<boolean>} showClear\n * @description\n * Displays a clear button that resets the datepicker value.\n * @default true\n */\n showClear = input<boolean>(true);\n\n /**\n * @property {InputSignal<boolean>} showIcon\n * @description\n * Shows the calendar or clock icon inside the input.\n * @default true\n */\n showIcon = input<boolean>(true);\n\n /**\n * @property {InputSignal<string>} dateFormat\n * @description\n * Format used by PrimeNG for displaying dates.\n * @default 'dd/mm/yy'\n */\n dateFormat = input<string>('dd/mm/yy');\n\n /**\n * @property {InputSignal<string>} timeFormat\n * @description\n * Format used by PrimeNG for displaying times.\n * @default 'HH:mm'\n */\n timeFormat = input<string>('HH:mm');\n\n /**\n * @property {InputSignal<number>} stepHour\n * @description\n * Hours to skip when clicking up/down.\n * @default 1\n */\n stepHour = input<number>(1);\n\n /**\n * @property {InputSignal<number>} stepMinute\n * @description\n * Minutes to skip when clicking up/down.\n * @default 1\n */\n stepMinute = input<number>(1);\n\n /**\n * @property {InputSignal<number>} stepSecond\n * @description\n * Seconds to skip when clicking up/down.\n * @default 1\n */\n stepSecond = input<number>(1);\n\n /**\n * @property {InputSignal<boolean>} showSeconds\n * @description\n * Whether to show seconds in the time picker.\n * Only applicable when hourFormat is '24'.\n * @default false\n */\n showSeconds = input<boolean>(false);\n \n /**\n * @property {InputSignal<boolean>} disabled\n * @description\n * Whether the component is disabled.\n * @default false\n */\n disabled = input<boolean>(false);\n\n /**\n * @property {InputSignal<boolean>} inline\n * @description\n * Whether to display the datepicker inline.\n * @default false\n */\n inline = input<boolean>(false);\n\n /**\n * @property {InputSignal<boolean>} showTime\n * @description\n * Whether to show the time picker along with the date picker.\n * @default false\n */\n showTime = input<boolean>(false);\n\n /**\n * @property {InputSignal<'12' | '24'>} hourFormat\n * @description\n * Format of the hours: '12' or '24'.\n * @default '24'\n */\n hourFormat = input<'12' | '24'>('24');\n\n /**\n * @property {InputSignal<string | HTMLElement | null | undefined>} appendTo\n * @description\n * Target element to attach the overlay to.\n * @default 'null'\n */\n appendTo = input<string | HTMLElement | null | undefined>('body');\n\n /**\n * @property {InputSignal<number>} baseZIndex\n * @description\n * Base z-index value for the overlay.\n * @default 10000\n */\n baseZIndex = input<number>(10000);\n\n /**\n * @property {InputSignal<Date | null>} maxDate\n * @description\n * Maximum selectable date.\n * @default null\n */\n maxDate = input<Date | null>(null);\n\n /**\n * @property {InputSignal<Date | null>} minDate\n * @description\n * Minimum selectable date.\n * @default null\n */\n minDate = input<Date | null>(null);\n\n /**\n * @property {InputSignal<string>} labelText\n * @description\n * Label shown by the float-label wrapper.\n */\n labelText = input<string>('Select a date');\n\n /**\n * @property {InputSignal<FormControl>} control\n * @description\n * External FormControl used to read/set the datepicker value.\n * If not provided, an internal FormControl is created.\n */\n control = input<FormControl | undefined>(undefined);\n\n /**\n * @property {ModelSignal<DateValue>} modelValue\n * @description\n * The value of the datepicker model. Supports two-way binding.\n */\n modelValue = model<DateValue>(null);\n\n /**\n * @property {OutputRef<DateValue>} handleSelect\n * @description\n * Emitted when a value is selected.\n */\n handleSelect = output<DateValue>();\n\n /**\n * @property {OutputRef<void>} handleClear\n * @description\n * Emitted when the value is cleared.\n */\n handleClear = output<void>();\n\n /**\n * @property {WritableSignal<boolean>} disabledStatus\n * @description\n * Internal signal to track disabled state.\n */\n disabledStatus = signal<boolean>(false);\n \n /**\n * @property {Signal<boolean>} effectiveDisabled\n * @description\n * Returns true if either the [disabled] input is true OR the FormControl is disabled.\n */\n effectiveDisabled = computed(() => this.disabled() || this.disabledStatus());\n\n /** Computed properties */\n\n /**\n * @property {Signal<'single' | 'range'>} effectiveSelectionMode\n * @description\n * Returns 'single' automatically if variant is 'time', otherwise returns the user-provided selectionMode.\n */\n effectiveSelectionMode = computed(() => {\n return this.variant() === 'time' ? 'single' : this.selectionMode();\n });\n\n /**\n * @property {Signal<string>} effectiveDateFormat\n * @description\n * Returns the user-provided dateFormat or timeFormat based on the variant.\n */\n effectiveDateFormat = computed(() => {\n return this.variant() === 'time' ? this.timeFormat() : this.dateFormat();\n });\n\n /**\n * @property {Signal<boolean>} effectiveShowSeconds\n * @description\n * Returns whether seconds should be shown, restricted to 24h format.\n */\n effectiveShowSeconds = computed(() => {\n return (\n (this.effectiveShowTime() || this.variant() === 'time') &&\n this.hourFormat() === '24' &&\n this.showSeconds()\n );\n });\n\n /**\n * @property {Signal<boolean>} effectiveShowTime\n * @description\n * Returns whether the time picker should be shown.\n */\n effectiveShowTime = computed(() => {\n return this.variant() === 'both' || this.showTime();\n });\n\n /**\n * @property {Signal<FormControl>} effectiveControl\n * @description\n * Returns the external FormControl from NgControl or a local fallback.\n */\n private readonly internalControl = new FormControl<DateValue>(null);\n get effectiveControl(): FormControl {\n return (\n (this.ngControl?.control as FormControl) ||\n this.control() ||\n this.internalControl\n );\n }\n\n /** Icons */\n faCalendarDay = faCalendarDay;\n faClock = faClock;\n\n /** CVA Logic */\n onChange: (value: DateValue) => void = () => {};\n onTouched: () => void = () => {};\n private lastValue: DateValue = null;\n private isWriting = false;\n\n ngOnInit(): void {\n const control = this.effectiveControl;\n\n // Synchronize initial disabled state\n this.disabledStatus.set(control.disabled);\n\n // Watch for status changes (to support [control].disable() etc. from outside)\n control.statusChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.disabledStatus.set(control.disabled);\n });\n\n // Synchronize signal model with initial control value\n const initialValue = control.value;\n if (initialValue !== null && initialValue !== undefined) {\n this.modelValue.set(initialValue);\n this.lastValue = initialValue;\n }\n }\n\n writeValue(value: DateValue): void {\n this.isWriting = true;\n this.modelValue.set(value);\n this.lastValue = value;\n this.isWriting = false;\n }\n\n registerOnChange(fn: (value: DateValue) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabledStatus.set(isDisabled);\n const control = this.effectiveControl;\n if (isDisabled && control.enabled) {\n control.disable({ emitEvent: false });\n } else if (!isDisabled && control.disabled) {\n control.enable({ emitEvent: false });\n }\n }\n\n /**\n * @method onModelChange\n * @description\n * Called when the PrimeNG DatePicker template updates the value.\n */\n onModelChange(value: DateValue): void {\n if (this.isWriting) {\n return;\n }\n let finalValue = value;\n\n // Time cascading logic (single mode only)\n if (\n this.selectionMode() === 'single' &&\n finalValue instanceof Date &&\n this.lastValue instanceof Date\n ) {\n finalValue = this.applyTimeCascading(this.lastValue, finalValue);\n }\n\n this.lastValue = finalValue;\n this.modelValue.set(finalValue);\n this.onChange(finalValue);\n this.effectiveControl.setValue(finalValue, { emitEvent: false });\n this.effectiveControl.markAsDirty();\n\n if (finalValue === null) {\n this.handleClear.emit();\n } else if (this.selectionMode() === 'range') {\n if (Array.isArray(finalValue)) {\n const [start, end] = finalValue;\n if (start instanceof Date && end instanceof Date) {\n this.handleSelect.emit(finalValue);\n }\n }\n } else if (finalValue instanceof Date) {\n this.handleSelect.emit(finalValue);\n }\n }\n\n /**\n * @method applyTimeCascading\n * @private\n * @description\n * Adjusts the date when minutes or seconds wrap around.\n */\n private applyTimeCascading(prev: Date, curr: Date): Date {\n const updated = new Date(curr);\n\n // Cascade seconds to minutes\n if (prev.getSeconds() === 59 && updated.getSeconds() === 0) {\n updated.setMinutes(updated.getMinutes() + 1);\n } else if (prev.getSeconds() === 0 && updated.getSeconds() === 59) {\n updated.setMinutes(updated.getMinutes() - 1);\n }\n\n // Cascade minutes to hours\n if (prev.getMinutes() === 59 && updated.getMinutes() === 0) {\n updated.setHours(updated.getHours() + 1);\n } else if (prev.getMinutes() === 0 && updated.getMinutes() === 59) {\n updated.setHours(updated.getHours() - 1);\n }\n\n return updated;\n }\n\n /**\n * @method onBlur\n * @description\n * Triggered when the component loses focus.\n */\n onBlur(): void {\n this.onTouched();\n this.effectiveControl.markAsTouched();\n }\n\n /**\n * @method clear\n * @description\n * Programmatically clears the value.\n */\n clear() {\n this.onModelChange(null);\n }\n}\n","<div class=\"datepicker-container\" [class.inline]=\"inline()\">\n @if (inline()) {\n <p-datepicker\n inputId=\"datepicker\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"readonlyInput()\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"effectiveDisabled()\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"variant() === 'time'\"\n [inline]=\"true\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"hourFormat()\"\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=\"datepicker\"\n iconDisplay=\"input\"\n [ngModel]=\"modelValue()\"\n (ngModelChange)=\"onModelChange($event)\"\n (onBlur)=\"onBlur()\"\n [selectionMode]=\"effectiveSelectionMode()\"\n [readonlyInput]=\"readonlyInput()\"\n [showClear]=\"showClear()\"\n [showIcon]=\"showIcon()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [disabled]=\"effectiveDisabled()\"\n [dateFormat]=\"effectiveDateFormat()\"\n [timeOnly]=\"variant() === 'time'\"\n [showTime]=\"effectiveShowTime()\"\n [hourFormat]=\"hourFormat()\"\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 <fa-icon\n tabindex=\"0\"\n [icon]=\"variant() === 'time' ? faClock : faCalendarDay\"\n (keydown.enter)=\"clickCallBack($event)\"\n (keydown.space)=\"clickCallBack($event)\"\n (click)=\"clickCallBack($event)\">\n </fa-icon>\n </ng-template>\n </p-datepicker>\n\n <label for=\"datepicker\">{{ labelText() }}</label>\n </p-floatlabel>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAyCA;;;;;;AAMG;MACU,mBAAmB,CAAA;AAK9B,IAAA,WAAA,GAAA;;AAHS,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACrD,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAQhD;;;;;;;;AAQG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA2B,MAAM,8EAAC;AAEjD;;;;;;;AAOG;AACH,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAqB,OAAO,oFAAC;AAElD;;;;;AAKG;AACH,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAU,IAAI,oFAAC;AAEpC;;;;;AAKG;AACH,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAU,IAAI,gFAAC;AAEhC;;;;;AAKG;AACH,QAAA,IAA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A,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,WAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,SAAA,EAAA,QAAA,EAAA,QAAA,EAAA,YAAA,EAAA,WAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,YAAA,EAAA,aAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,YAAA,EAAA,YAAA,EAAA,YAAA,EAAA,cAAA,EAAA,eAAA,EAAA,cAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,iBAAA,EAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAaN,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBApB/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,OAAA,EACjB;wBACP,WAAW;wBACX,mBAAmB;wBACnB,gBAAgB;wBAChB,gBAAgB;wBAChB,eAAe;qBAChB,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,uxEAAA,EAAA,MAAA,EAAA,CAAA,02CAAA,CAAA,EAAA;;;AEvCjD;;AAEG;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, viewChild, ViewContainerRef, input, computed, model, output, effect, untracked, afterEveryRender, ChangeDetectionStrategy, Component, ApplicationRef, createComponent, Injectable } from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, Injector, viewChild, ViewContainerRef, input, computed, model, output, effect, untracked, afterEveryRender, ChangeDetectionStrategy, Component, ApplicationRef, createComponent, Injectable } from '@angular/core';
|
|
3
3
|
import { ButtonComponent } from '@tekus/design-system/components/button';
|
|
4
4
|
import * as i1 from 'primeng/drawer';
|
|
5
5
|
import { DrawerModule } from 'primeng/drawer';
|
|
6
|
+
import { TkDialogRef } from '@tekus/design-system/core/types';
|
|
6
7
|
import * as i2 from 'primeng/api';
|
|
7
|
-
import { Subject } from 'rxjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @component DrawerComponent
|
|
@@ -43,7 +43,10 @@ import { Subject } from 'rxjs';
|
|
|
43
43
|
class DrawerComponent {
|
|
44
44
|
constructor() {
|
|
45
45
|
this.elementRef = inject(ElementRef);
|
|
46
|
+
this.injector = inject(Injector);
|
|
46
47
|
this.contentHost = viewChild('contentHost', { ...(ngDevMode ? { debugName: "contentHost" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
|
|
48
|
+
/** The dialog ref associated with this drawer */
|
|
49
|
+
this.dialogRef = input(null, ...(ngDevMode ? [{ debugName: "dialogRef" }] : /* istanbul ignore next */ []));
|
|
47
50
|
/** The required title displayed at the top left of the drawer header */
|
|
48
51
|
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
49
52
|
/** The main content of the drawer. Can be a string or a Component Type. */
|
|
@@ -79,12 +82,14 @@ class DrawerComponent {
|
|
|
79
82
|
this.closed = output();
|
|
80
83
|
this.alreadyEmitted = false;
|
|
81
84
|
this.returnValueOnClose = null;
|
|
85
|
+
this.wasOpened = false;
|
|
82
86
|
/**
|
|
83
87
|
* @summary Orchestrates the reactive dynamic lifecycle.
|
|
84
88
|
*/
|
|
85
89
|
effect(() => {
|
|
86
90
|
const opened = this.isOpened();
|
|
87
91
|
const host = this.contentHost();
|
|
92
|
+
this.dialogRef();
|
|
88
93
|
untracked(() => {
|
|
89
94
|
if (opened && host) {
|
|
90
95
|
this.attachDynamicContent();
|
|
@@ -111,7 +116,13 @@ class DrawerComponent {
|
|
|
111
116
|
if (!type || typeof type === 'string' || !host)
|
|
112
117
|
return;
|
|
113
118
|
this.detachDynamicContent();
|
|
114
|
-
|
|
119
|
+
const customInjector = Injector.create({
|
|
120
|
+
providers: [{ provide: TkDialogRef, useValue: this.dialogRef() }],
|
|
121
|
+
parent: this.injector,
|
|
122
|
+
});
|
|
123
|
+
this.componentRef = host.createComponent(type, {
|
|
124
|
+
injector: customInjector,
|
|
125
|
+
});
|
|
115
126
|
this.syncDynamicInputs(this.data());
|
|
116
127
|
}
|
|
117
128
|
syncDynamicInputs(data) {
|
|
@@ -141,6 +152,10 @@ class DrawerComponent {
|
|
|
141
152
|
this.isOpened.set(true);
|
|
142
153
|
this.resetClosureState();
|
|
143
154
|
}
|
|
155
|
+
/** Marks the drawer as shown to enable closure emission guards */
|
|
156
|
+
handleShow() {
|
|
157
|
+
this.wasOpened = true;
|
|
158
|
+
}
|
|
144
159
|
/**
|
|
145
160
|
* @summary Main entry point for closure requests.
|
|
146
161
|
* @returns true if closure was executed.
|
|
@@ -172,6 +187,7 @@ class DrawerComponent {
|
|
|
172
187
|
this.returnValueOnClose = returnValue;
|
|
173
188
|
}
|
|
174
189
|
this.isOpened.set(false);
|
|
190
|
+
this.handleClose();
|
|
175
191
|
}
|
|
176
192
|
/** Handles external visibility changes (from p-drawer close button or mask) */
|
|
177
193
|
onVisibleChange(visible) {
|
|
@@ -208,32 +224,32 @@ class DrawerComponent {
|
|
|
208
224
|
this.returnValueOnClose = null;
|
|
209
225
|
}
|
|
210
226
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
211
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: DrawerComponent, isStandalone: true, selector: "tk-drawer", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, headerAction: { classPropertyName: "headerAction", publicName: "headerAction", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, interceptor: { classPropertyName: "interceptor", publicName: "interceptor", isSignal: true, isRequired: false, transformFunction: null }, isOpened: { classPropertyName: "isOpened", publicName: "isOpened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpened: "isOpenedChange", closed: "closed" }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<p-drawer\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissible]=\"dismissible()\"\n [closeOnEscape]=\"true\"\n position=\"right\"\n [style]=\"drawerStyle()\"\n [styleClass]=\"'tk-drawer'\"\n [class.tk-drawer--has-scroll]=\"hasScroll\"
|
|
227
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: DrawerComponent, isStandalone: true, selector: "tk-drawer", inputs: { dialogRef: { classPropertyName: "dialogRef", publicName: "dialogRef", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, headerAction: { classPropertyName: "headerAction", publicName: "headerAction", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, interceptor: { classPropertyName: "interceptor", publicName: "interceptor", isSignal: true, isRequired: false, transformFunction: null }, isOpened: { classPropertyName: "isOpened", publicName: "isOpened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpened: "isOpenedChange", closed: "closed" }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<p-drawer\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissible]=\"dismissible()\"\n [closeOnEscape]=\"true\"\n position=\"right\"\n [style]=\"drawerStyle()\"\n [styleClass]=\"'tk-drawer'\"\n [class.tk-drawer--has-scroll]=\"hasScroll\">\n @if (title() || hasHeaderAction()) {\n <ng-template pTemplate=\"header\">\n <div class=\"tk-drawer__header\">\n <h2 class=\"tk-drawer__title\" [title]=\"title()\">{{ title() }}</h2>\n @if (hasHeaderAction()) {\n <div class=\"tk-drawer__actions\">\n <tk-button\n [label]=\"headerAction()!.label\"\n [severity]=\"headerAction()!.severity\"\n [variant]=\"headerAction()!.variant\"\n (clicked)=\"\n handleHeaderAction(\n headerAction()!.action,\n headerAction()!.returnValue\n )\n \" />\n </div>\n }\n </div>\n </ng-template>\n }\n\n <section class=\"tk-drawer__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n</p-drawer>\n", styles: [":host ::ng-deep .tk-drawer{max-height:100vh;display:flex;flex-direction:column}:host ::ng-deep .tk-drawer__content{flex:1;overflow-y:auto;padding:var(--tk-spacing-paddingX-m, 1.5rem)}:host ::ng-deep .p-drawer-content{overflow-y:auto;display:flex;flex-direction:column;flex:1}:host ::ng-deep .p-drawer-close-button{color:var(--tk-color-base-surface-500, #8a8a8b)}:host ::ng-deep .p-drawer-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-color-base-surface-500, #8a8a8b)}.tk-drawer--has-scroll .p-drawer-header{border-bottom:1px solid var(--tk-color-base-surface-200, #e2e8f0);box-shadow:0 2px 4px #00000005}.tk-drawer__header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--tk-spacing-base-100, 1rem);flex-shrink:0;width:calc(100% - var(--tk-spacing-base-250, 2.5rem))}.tk-drawer__title{margin:0;font-size:var(--tk-font-size-headers-s, 1.125rem);font-weight:var(--tk-font-weight-600, 600);color:var(--tk-color-text-default, #212121);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.tk-drawer__actions{display:flex;flex-direction:row;align-items:center;gap:var(--tk-spacing-base-50, .5rem);flex-shrink:0;padding-right:var(--tk-spacing-paddingX-xs, .25rem)}\n"], dependencies: [{ kind: "ngmodule", type: DrawerModule }, { kind: "component", type: i1.Drawer, selector: "p-drawer", inputs: ["appendTo", "motionOptions", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: ButtonComponent, selector: "tk-button", inputs: ["label", "disabled", "type", "severity", "variant", "link", "icon", "tooltipText"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
212
228
|
}
|
|
213
229
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
214
230
|
type: Component,
|
|
215
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'tk-drawer', imports: [DrawerModule, ButtonComponent], template: "<p-drawer\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissible]=\"dismissible()\"\n [closeOnEscape]=\"true\"\n position=\"right\"\n [style]=\"drawerStyle()\"\n [styleClass]=\"'tk-drawer'\"\n [class.tk-drawer--has-scroll]=\"hasScroll\"
|
|
231
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'tk-drawer', imports: [DrawerModule, ButtonComponent], template: "<p-drawer\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissible]=\"dismissible()\"\n [closeOnEscape]=\"true\"\n position=\"right\"\n [style]=\"drawerStyle()\"\n [styleClass]=\"'tk-drawer'\"\n [class.tk-drawer--has-scroll]=\"hasScroll\">\n @if (title() || hasHeaderAction()) {\n <ng-template pTemplate=\"header\">\n <div class=\"tk-drawer__header\">\n <h2 class=\"tk-drawer__title\" [title]=\"title()\">{{ title() }}</h2>\n @if (hasHeaderAction()) {\n <div class=\"tk-drawer__actions\">\n <tk-button\n [label]=\"headerAction()!.label\"\n [severity]=\"headerAction()!.severity\"\n [variant]=\"headerAction()!.variant\"\n (clicked)=\"\n handleHeaderAction(\n headerAction()!.action,\n headerAction()!.returnValue\n )\n \" />\n </div>\n }\n </div>\n </ng-template>\n }\n\n <section class=\"tk-drawer__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n</p-drawer>\n", styles: [":host ::ng-deep .tk-drawer{max-height:100vh;display:flex;flex-direction:column}:host ::ng-deep .tk-drawer__content{flex:1;overflow-y:auto;padding:var(--tk-spacing-paddingX-m, 1.5rem)}:host ::ng-deep .p-drawer-content{overflow-y:auto;display:flex;flex-direction:column;flex:1}:host ::ng-deep .p-drawer-close-button{color:var(--tk-color-base-surface-500, #8a8a8b)}:host ::ng-deep .p-drawer-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-color-base-surface-500, #8a8a8b)}.tk-drawer--has-scroll .p-drawer-header{border-bottom:1px solid var(--tk-color-base-surface-200, #e2e8f0);box-shadow:0 2px 4px #00000005}.tk-drawer__header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--tk-spacing-base-100, 1rem);flex-shrink:0;width:calc(100% - var(--tk-spacing-base-250, 2.5rem))}.tk-drawer__title{margin:0;font-size:var(--tk-font-size-headers-s, 1.125rem);font-weight:var(--tk-font-weight-600, 600);color:var(--tk-color-text-default, #212121);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.tk-drawer__actions{display:flex;flex-direction:row;align-items:center;gap:var(--tk-spacing-base-50, .5rem);flex-shrink:0;padding-right:var(--tk-spacing-paddingX-xs, .25rem)}\n"] }]
|
|
216
232
|
}], ctorParameters: () => [], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ['contentHost', { ...{
|
|
217
233
|
read: ViewContainerRef,
|
|
218
|
-
}, isSignal: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], headerAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerAction", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], interceptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "interceptor", required: false }] }], isOpened: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpened", required: false }] }, { type: i0.Output, args: ["isOpenedChange"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
234
|
+
}, isSignal: true }] }], dialogRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "dialogRef", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], headerAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerAction", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], interceptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "interceptor", required: false }] }], isOpened: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpened", required: false }] }, { type: i0.Output, args: ["isOpenedChange"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
219
235
|
|
|
220
236
|
class DrawerService {
|
|
221
237
|
constructor() {
|
|
222
238
|
this.appRef = inject(ApplicationRef);
|
|
223
|
-
this.
|
|
239
|
+
this.dialogRef = null;
|
|
224
240
|
}
|
|
225
|
-
get
|
|
226
|
-
return this.
|
|
241
|
+
get drawerRefForTesting() {
|
|
242
|
+
return (this.dialogRef?.componentRef || null);
|
|
227
243
|
}
|
|
228
|
-
set
|
|
229
|
-
this.
|
|
244
|
+
set drawerRefForTesting(ref) {
|
|
245
|
+
this.dialogRef = ref ? new TkDialogRef(ref) : null;
|
|
230
246
|
}
|
|
231
247
|
open(config) {
|
|
232
|
-
if (this.
|
|
233
|
-
|
|
234
|
-
this.
|
|
235
|
-
this.
|
|
236
|
-
this.
|
|
248
|
+
if (this.dialogRef) {
|
|
249
|
+
// Clear the previous one without triggering a real "null" result
|
|
250
|
+
this.dialogRef.emitClose();
|
|
251
|
+
this.dialogRef.componentRef.destroy();
|
|
252
|
+
this.dialogRef = null;
|
|
237
253
|
}
|
|
238
254
|
const componentRef = createComponent(DrawerComponent, {
|
|
239
255
|
environmentInjector: this.appRef.injector,
|
|
@@ -250,19 +266,19 @@ class DrawerService {
|
|
|
250
266
|
componentRef.setInput('dismissible', config.dismissible ?? true);
|
|
251
267
|
componentRef.setInput('data', config.data ?? {});
|
|
252
268
|
componentRef.setInput('interceptor', config.interceptor ?? undefined);
|
|
253
|
-
const
|
|
254
|
-
componentRef.
|
|
255
|
-
|
|
256
|
-
|
|
269
|
+
const dialogRef = new TkDialogRef(componentRef);
|
|
270
|
+
componentRef.setInput('dialogRef', dialogRef);
|
|
271
|
+
this.dialogRef = dialogRef;
|
|
272
|
+
componentRef.instance.closed.subscribe((value) => {
|
|
273
|
+
dialogRef.emitClose(value);
|
|
257
274
|
this.appRef.detachView(componentRef.hostView);
|
|
258
275
|
componentRef.destroy();
|
|
259
|
-
if (this.
|
|
260
|
-
this.
|
|
276
|
+
if (this.dialogRef === dialogRef) {
|
|
277
|
+
this.dialogRef = null;
|
|
261
278
|
}
|
|
262
279
|
});
|
|
263
280
|
componentRef.instance.open();
|
|
264
|
-
|
|
265
|
-
return close$.asObservable();
|
|
281
|
+
return dialogRef;
|
|
266
282
|
}
|
|
267
283
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
268
284
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DrawerService, providedIn: 'root' }); }
|