@tekus/design-system 5.22.1 → 5.24.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-autocomplete.mjs +24 -17
- package/fesm2022/tekus-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-badge.mjs +3 -3
- package/fesm2022/tekus-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-button.mjs +48 -31
- package/fesm2022/tekus-design-system-components-button.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-checkbox.mjs +13 -16
- package/fesm2022/tekus-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-date-picker.mjs +117 -21
- package/fesm2022/tekus-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-drawer.mjs +7 -7
- package/fesm2022/tekus-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-fallback-view.mjs +18 -38
- package/fesm2022/tekus-design-system-components-fallback-view.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-icon.mjs +11 -17
- package/fesm2022/tekus-design-system-components-icon.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-input-number.mjs +15 -14
- package/fesm2022/tekus-design-system-components-input-number.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-input-text.mjs +19 -21
- package/fesm2022/tekus-design-system-components-input-text.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-modal.mjs +9 -8
- package/fesm2022/tekus-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-multiselect.mjs +3 -3
- package/fesm2022/tekus-design-system-components-multiselect.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-pagination.mjs +3 -3
- package/fesm2022/tekus-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-panel.mjs +21 -30
- package/fesm2022/tekus-design-system-components-panel.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-radio-button.mjs +14 -16
- package/fesm2022/tekus-design-system-components-radio-button.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-select.mjs +13 -11
- package/fesm2022/tekus-design-system-components-select.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-table.mjs +27 -23
- package/fesm2022/tekus-design-system-components-table.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-tabs.mjs +3 -3
- package/fesm2022/tekus-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-tag.mjs +3 -3
- package/fesm2022/tekus-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-textarea.mjs +15 -14
- package/fesm2022/tekus-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-toolbar.mjs +3 -3
- package/fesm2022/tekus-design-system-components-toolbar.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-tooltip.mjs +3 -3
- package/fesm2022/tekus-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-topbar.mjs +3 -3
- package/fesm2022/tekus-design-system-components-topbar.mjs.map +1 -1
- package/fesm2022/tekus-design-system-core-types.mjs +5 -0
- package/fesm2022/tekus-design-system-core-types.mjs.map +1 -1
- package/fesm2022/tekus-design-system-core.mjs +5 -0
- package/fesm2022/tekus-design-system-core.mjs.map +1 -1
- package/fesm2022/tekus-design-system-directives-gird-item.mjs +19 -24
- package/fesm2022/tekus-design-system-directives-gird-item.mjs.map +1 -1
- package/package.json +1 -1
- package/types/tekus-design-system-components-autocomplete.d.ts +10 -2
- package/types/tekus-design-system-components-button.d.ts +15 -19
- package/types/tekus-design-system-components-checkbox.d.ts +3 -8
- package/types/tekus-design-system-components-date-picker.d.ts +63 -5
- package/types/tekus-design-system-components-drawer.d.ts +3 -3
- package/types/tekus-design-system-components-fallback-view.d.ts +17 -18
- package/types/tekus-design-system-components-icon.d.ts +7 -16
- package/types/tekus-design-system-components-input-number.d.ts +3 -4
- package/types/tekus-design-system-components-input-text.d.ts +4 -10
- package/types/tekus-design-system-components-modal.d.ts +3 -3
- package/types/tekus-design-system-components-panel.d.ts +10 -18
- package/types/tekus-design-system-components-radio-button.d.ts +3 -7
- package/types/tekus-design-system-components-select.d.ts +14 -1
- package/types/tekus-design-system-components-table.d.ts +5 -5
- package/types/tekus-design-system-components-textarea.d.ts +3 -4
- package/types/tekus-design-system-directives-gird-item.d.ts +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tekus-design-system-components-checkbox.mjs","sources":["../../../projects/design-system/components/checkbox/src/checkbox.component.ts","../../../projects/design-system/components/checkbox/src/checkbox.component.html","../../../projects/design-system/components/checkbox/tekus-design-system-components-checkbox.ts"],"sourcesContent":["import {\n Component,\n input,\n model,\n OnInit,\n inject,\n OnDestroy,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n ReactiveFormsModule,\n NgControl,\n FormsModule,\n} from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { CheckboxModule } from 'primeng/checkbox';\nimport { MessageModule } from 'primeng/message';\n\n@Component({\n selector: 'tk-checkbox',\n imports: [\n ReactiveFormsModule,\n FormsModule,\n CheckboxModule,\n MessageModule,\n ],\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n})\nexport class CheckboxComponent\n implements ControlValueAccessor, OnInit, OnDestroy\n{\n /** Internal references and injections */\n readonly ngControl = inject(NgControl, { self: true, optional: true });\n\n /**\n * Initialize the component and register it as a ControlValueAccessor.\n */\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n /** Properties and Signals */\n\n /**\n * @property {ModelSignal<any>} model\n * @description\n * The value of the checkbox model (checked state or array of values).\n * Supports two-way binding via signals.\n */\n model = model<unknown>();\n\n /**\n * @property {InputSignal<any>} value\n * @description\n * The value of the checkbox itself (used when part of a group).\n */\n value = input<unknown>();\n\n /**\n * @property {InputSignal<string>} label\n * @description\n * Label displayed next to the checkbox.\n */\n label = input<string>('');\n\n /**\n * @property {InputSignal<string>} name\n * @description\n * Name attribute for the checkbox.\n */\n name = input<string>('');\n\n /**\n * @property {InputSignal<string>} inputId\n * @description\n * HTML id attribute for the checkbox input.\n */\n inputId = input<string>('');\n\n /**\n * @property {InputSignal<boolean>} binary\n * @description\n * Boolean property to indicate if the checkbox is a binary toggle.\n * @default false\n */\n binary = input<boolean>(false);\n\n /**\n * @property {InputSignal<FormControl>} control\n * @description\n * External FormControl used to read/set the checkbox value.\n * If not provided, an internal FormControl is created.\n */\n control = input<FormControl>(new FormControl());\n\n /**\n * @property {InputSignal<string>} errorMessage\n * @description\n * Message to display when the control is invalid and touched.\n */\n errorMessage = input<string>('');\n\n /**\n * @property {ModelSignal<boolean>} indeterminate\n * @description\n * Indeterminate state of the checkbox (reactive).\n * Useful for parent checkboxes in lists with partial selection.\n */\n indeterminate = model<boolean>(false);\n\n /**\n * @property {boolean} disabled\n * @description\n * Whether the checkbox is disabled.\n */\n disabled = model<boolean>(false);\n\n /** Component Methods */\n\n get effectiveControl(): FormControl {\n return (this.ngControl?.control as FormControl) || this.control();\n }\n\n onChange: (value: unknown) => void = () => {};\n onTouched: () => void = () => {};\n private readonly subscription = new Subscription();\n\n ngOnInit(): void {\n const control = this.effectiveControl;\n\n if (control.value !== undefined && control.value !== null) {\n this.model.set(control.value);\n }\n\n if (this.control() === control && this.disabled()) {\n control.disable({ emitEvent: false });\n } else {\n this.disabled.set(control.disabled);\n }\n\n this.subscription.add(\n control.statusChanges.subscribe(() => {\n this.disabled.set(control.disabled);\n })\n );\n\n this.subscription.add(\n control.valueChanges.subscribe(value => {\n this.model.set(value);\n })\n );\n }\n\n ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n\n /**\n * Implementation of ControlValueAccessor: Writes a new value from the form.\n */\n writeValue(value: unknown): void {\n this.model.set(value);\n }\n\n /**\n * Implementation of ControlValueAccessor: Registers a callback for change events.\n */\n registerOnChange(fn: (value: unknown) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Implementation of ControlValueAccessor: Registers a callback for touched events.\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Implementation of ControlValueAccessor: Sets the disabled state.\n */\n setDisabledState?(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n if (isDisabled) {\n this.control().disable({ emitEvent: false });\n } else {\n this.control().enable({ emitEvent: false });\n }\n }\n\n /**\n * Handle model change events from the template.\n */\n onModelChange(value: unknown): void {\n this.model.set(value);\n this.onChange(value);\n this.effectiveControl.setValue(value, { emitEvent: false });\n this.effectiveControl.markAsDirty();\n this.onTouched();\n }\n\n /**\n * Handle blur events to trigger onTouched.\n */\n onBlur(): void {\n this.onTouched();\n this.effectiveControl.markAsTouched();\n }\n}\n","<div class=\"tk-checkbox-wrapper\">\n <div class=\"tk-checkbox-group\" [class.tk-disabled]=\"disabled()\">\n <p-checkbox\n [inputId]=\"inputId()\"\n [name]=\"name()\"\n [value]=\"value()\"\n [binary]=\"binary()\"\n [disabled]=\"disabled()\"\n [indeterminate]=\"indeterminate()\"\n [ngModel]=\"model()\"\n (ngModelChange)=\"onModelChange($event)\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\">\n </p-checkbox>\n @if (label()) {\n <label [for]=\"inputId()\" class=\"tk-checkbox-label\"> {{ label() }} </label>\n }\n </div>\n @if (\n effectiveControl.invalid &&\n (effectiveControl.dirty || effectiveControl.touched) &&\n errorMessage()\n ) {\n <div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{\n errorMessage()\n }}</p-message>\n </div>\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MA8Ba,iBAAiB,CAAA;AAM5B;;AAEG;AACH,IAAA,WAAA,GAAA;;AALS,QA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,UAAA,EAAA,IAAA,EACd,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,OAAA,EAAA,YAAA,EAAA,UAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,SAAA,EAAA,eAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAKJ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAX7B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,OAAA,EACd;wBACP,mBAAmB;wBACnB,WAAW;wBACX,cAAc;wBACd,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,gjCAAA,EAAA,MAAA,EAAA,CAAA,uyCAAA,CAAA,EAAA;;;AE1BH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"tekus-design-system-components-checkbox.mjs","sources":["../../../projects/design-system/components/checkbox/src/checkbox.component.ts","../../../projects/design-system/components/checkbox/src/checkbox.component.html","../../../projects/design-system/components/checkbox/tekus-design-system-components-checkbox.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n input,\n model,\n OnInit,\n inject,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n ControlValueAccessor,\n FormControl,\n ReactiveFormsModule,\n NgControl,\n FormsModule,\n} from '@angular/forms';\nimport { CheckboxModule } from 'primeng/checkbox';\nimport { MessageModule } from 'primeng/message';\n\n@Component({\n selector: 'tk-checkbox',\n imports: [\n ReactiveFormsModule,\n FormsModule,\n CheckboxModule,\n MessageModule,\n ],\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CheckboxComponent\n implements ControlValueAccessor, OnInit\n{\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 /** Properties and Signals */\n\n /**\n * @property {ModelSignal<any>} model\n * @description\n * The value of the checkbox model (checked state or array of values).\n * Supports two-way binding via signals.\n */\n model = model<unknown>();\n\n /**\n * @property {InputSignal<any>} value\n * @description\n * The value of the checkbox itself (used when part of a group).\n */\n value = input<unknown>();\n\n /**\n * @property {InputSignal<string>} label\n * @description\n * Label displayed next to the checkbox.\n */\n label = input<string>('');\n\n /**\n * @property {InputSignal<string>} name\n * @description\n * Name attribute for the checkbox.\n */\n name = input<string>('');\n\n /**\n * @property {InputSignal<string>} inputId\n * @description\n * HTML id attribute for the checkbox input.\n */\n inputId = input<string>('');\n\n /**\n * @property {InputSignal<boolean>} binary\n * @description\n * Boolean property to indicate if the checkbox is a binary toggle.\n * @default false\n */\n binary = input<boolean>(false);\n\n /**\n * @property {InputSignal<FormControl>} control\n * @description\n * External FormControl used to read/set the checkbox value.\n * If not provided, an internal FormControl is created.\n */\n control = input<FormControl>(new FormControl());\n\n /**\n * @property {InputSignal<string>} errorMessage\n * @description\n * Message to display when the control is invalid and touched.\n */\n errorMessage = input<string>('');\n\n /**\n * @property {ModelSignal<boolean>} indeterminate\n * @description\n * Indeterminate state of the checkbox (reactive).\n * Useful for parent checkboxes in lists with partial selection.\n */\n indeterminate = model<boolean>(false);\n\n /**\n * @property {boolean} disabled\n * @description\n * Whether the checkbox is disabled.\n */\n disabled = model<boolean>(false);\n\n /** Component Methods */\n\n get effectiveControl(): FormControl {\n return (this.ngControl?.control as FormControl) || this.control();\n }\n\n onChange: (value: unknown) => void = () => {};\n onTouched: () => void = () => {};\n\n ngOnInit(): void {\n const control = this.effectiveControl;\n\n if (control.value !== undefined && control.value !== null) {\n this.model.set(control.value);\n }\n\n if (this.control() === control && this.disabled()) {\n control.disable({ emitEvent: false });\n } else {\n this.disabled.set(control.disabled);\n }\n\n control.statusChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.disabled.set(control.disabled);\n });\n\n control.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(value => {\n this.model.set(value);\n });\n }\n\n /**\n * Implementation of ControlValueAccessor: Writes a new value from the form.\n */\n writeValue(value: unknown): void {\n this.model.set(value);\n }\n\n /**\n * Implementation of ControlValueAccessor: Registers a callback for change events.\n */\n registerOnChange(fn: (value: unknown) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Implementation of ControlValueAccessor: Registers a callback for touched events.\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Implementation of ControlValueAccessor: Sets the disabled state.\n */\n setDisabledState?(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n if (isDisabled) {\n this.control().disable({ emitEvent: false });\n } else {\n this.control().enable({ emitEvent: false });\n }\n }\n\n /**\n * Handle model change events from the template.\n */\n onModelChange(value: unknown): void {\n this.model.set(value);\n this.onChange(value);\n this.effectiveControl.setValue(value, { emitEvent: false });\n this.effectiveControl.markAsDirty();\n this.onTouched();\n }\n\n /**\n * Handle blur events to trigger onTouched.\n */\n onBlur(): void {\n this.onTouched();\n this.effectiveControl.markAsTouched();\n }\n}\n","<div class=\"tk-checkbox-wrapper\">\n <div class=\"tk-checkbox-group\" [class.tk-disabled]=\"disabled()\">\n <p-checkbox\n [inputId]=\"inputId()\"\n [name]=\"name()\"\n [value]=\"value()\"\n [binary]=\"binary()\"\n [disabled]=\"disabled()\"\n [indeterminate]=\"indeterminate()\"\n [ngModel]=\"model()\"\n (ngModelChange)=\"onModelChange($event)\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\">\n </p-checkbox>\n @if (label()) {\n <label [for]=\"inputId()\" class=\"tk-checkbox-label\"> {{ label() }} </label>\n }\n </div>\n @if (\n effectiveControl.invalid &&\n (effectiveControl.dirty || effectiveControl.touched) &&\n errorMessage()\n ) {\n <div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{\n errorMessage()\n }}</p-message>\n </div>\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAgCa,iBAAiB,CAAA;AAM5B,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;;AAUhD;;;;;AAKG;QACH,IAAA,CAAA,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAW;AAExB;;;;AAIG;QACH,IAAA,CAAA,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAW;AAExB;;;;AAIG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AAEzB;;;;AAIG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE,2EAAC;AAExB;;;;AAIG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAS,EAAE,8EAAC;AAE3B;;;;;AAKG;AACH,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAU,KAAK,6EAAC;AAE9B;;;;;AAKG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAc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DestroyRef, input, model, output, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
4
|
import * as i1 from '@angular/forms';
|
|
4
5
|
import { NgControl, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import { Subscription } from 'rxjs';
|
|
6
6
|
import * as i2 from 'primeng/datepicker';
|
|
7
7
|
import { DatePickerModule } from 'primeng/datepicker';
|
|
8
8
|
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';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* @component DatePickerComponent
|
|
@@ -21,12 +22,14 @@ class DatePickerComponent {
|
|
|
21
22
|
constructor() {
|
|
22
23
|
/** Internal references and injections */
|
|
23
24
|
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
25
|
+
this.destroyRef = inject(DestroyRef);
|
|
24
26
|
/**
|
|
25
|
-
* @property {InputSignal<'date' | 'time'>} variant
|
|
27
|
+
* @property {InputSignal<'date' | 'time' | 'both'>} variant
|
|
26
28
|
* @description
|
|
27
29
|
* Defines the visual and functional mode:
|
|
28
30
|
* - `'date'`: standard date/range picker
|
|
29
31
|
* - `'time'`: time-only picker
|
|
32
|
+
* - `'both'`: date and time picker
|
|
30
33
|
* @default 'date'
|
|
31
34
|
*/
|
|
32
35
|
this.variant = input('date', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
@@ -64,9 +67,9 @@ class DatePickerComponent {
|
|
|
64
67
|
* @property {InputSignal<string>} dateFormat
|
|
65
68
|
* @description
|
|
66
69
|
* Format used by PrimeNG for displaying dates.
|
|
67
|
-
* @default 'mm/
|
|
70
|
+
* @default 'dd/mm/yy'
|
|
68
71
|
*/
|
|
69
|
-
this.dateFormat = input('mm/
|
|
72
|
+
this.dateFormat = input('dd/mm/yy', ...(ngDevMode ? [{ debugName: "dateFormat" }] : /* istanbul ignore next */ []));
|
|
70
73
|
/**
|
|
71
74
|
* @property {InputSignal<string>} timeFormat
|
|
72
75
|
* @description
|
|
@@ -99,9 +102,45 @@ class DatePickerComponent {
|
|
|
99
102
|
* @property {InputSignal<boolean>} showSeconds
|
|
100
103
|
* @description
|
|
101
104
|
* Whether to show seconds in the time picker.
|
|
105
|
+
* Only applicable when hourFormat is '24'.
|
|
102
106
|
* @default false
|
|
103
107
|
*/
|
|
104
108
|
this.showSeconds = input(false, ...(ngDevMode ? [{ debugName: "showSeconds" }] : /* istanbul ignore next */ []));
|
|
109
|
+
/**
|
|
110
|
+
* @property {InputSignal<boolean>} inline
|
|
111
|
+
* @description
|
|
112
|
+
* Whether to display the datepicker inline.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
this.inline = input(false, ...(ngDevMode ? [{ debugName: "inline" }] : /* istanbul ignore next */ []));
|
|
116
|
+
/**
|
|
117
|
+
* @property {InputSignal<boolean>} showTime
|
|
118
|
+
* @description
|
|
119
|
+
* Whether to show the time picker along with the date picker.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
this.showTime = input(false, ...(ngDevMode ? [{ debugName: "showTime" }] : /* istanbul ignore next */ []));
|
|
123
|
+
/**
|
|
124
|
+
* @property {InputSignal<'12' | '24'>} hourFormat
|
|
125
|
+
* @description
|
|
126
|
+
* Format of the hours: '12' or '24'.
|
|
127
|
+
* @default '24'
|
|
128
|
+
*/
|
|
129
|
+
this.hourFormat = input('24', ...(ngDevMode ? [{ debugName: "hourFormat" }] : /* istanbul ignore next */ []));
|
|
130
|
+
/**
|
|
131
|
+
* @property {InputSignal<string | HTMLElement | null | undefined>} appendTo
|
|
132
|
+
* @description
|
|
133
|
+
* Target element to attach the overlay to.
|
|
134
|
+
* @default 'null'
|
|
135
|
+
*/
|
|
136
|
+
this.appendTo = input(null, ...(ngDevMode ? [{ debugName: "appendTo" }] : /* istanbul ignore next */ []));
|
|
137
|
+
/**
|
|
138
|
+
* @property {InputSignal<number>} baseZIndex
|
|
139
|
+
* @description
|
|
140
|
+
* Base z-index value for the overlay.
|
|
141
|
+
* @default 10000
|
|
142
|
+
*/
|
|
143
|
+
this.baseZIndex = input(10000, ...(ngDevMode ? [{ debugName: "baseZIndex" }] : /* istanbul ignore next */ []));
|
|
105
144
|
/**
|
|
106
145
|
* @property {InputSignal<Date | null>} maxDate
|
|
107
146
|
* @description
|
|
@@ -164,6 +203,24 @@ class DatePickerComponent {
|
|
|
164
203
|
this.effectiveDateFormat = computed(() => {
|
|
165
204
|
return this.variant() === 'time' ? this.timeFormat() : this.dateFormat();
|
|
166
205
|
}, ...(ngDevMode ? [{ debugName: "effectiveDateFormat" }] : /* istanbul ignore next */ []));
|
|
206
|
+
/**
|
|
207
|
+
* @property {Signal<boolean>} effectiveShowSeconds
|
|
208
|
+
* @description
|
|
209
|
+
* Returns whether seconds should be shown, restricted to 24h format.
|
|
210
|
+
*/
|
|
211
|
+
this.effectiveShowSeconds = computed(() => {
|
|
212
|
+
return ((this.effectiveShowTime() || this.variant() === 'time') &&
|
|
213
|
+
this.hourFormat() === '24' &&
|
|
214
|
+
this.showSeconds());
|
|
215
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveShowSeconds" }] : /* istanbul ignore next */ []));
|
|
216
|
+
/**
|
|
217
|
+
* @property {Signal<boolean>} effectiveShowTime
|
|
218
|
+
* @description
|
|
219
|
+
* Returns whether the time picker should be shown.
|
|
220
|
+
*/
|
|
221
|
+
this.effectiveShowTime = computed(() => {
|
|
222
|
+
return this.variant() === 'both' || this.showTime();
|
|
223
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveShowTime" }] : /* istanbul ignore next */ []));
|
|
167
224
|
/**
|
|
168
225
|
* @property {Signal<FormControl>} effectiveControl
|
|
169
226
|
* @description
|
|
@@ -177,6 +234,7 @@ class DatePickerComponent {
|
|
|
177
234
|
this.onChange = () => { };
|
|
178
235
|
this.onTouched = () => { };
|
|
179
236
|
this.sub = new Subscription();
|
|
237
|
+
this.lastValue = null;
|
|
180
238
|
if (this.ngControl) {
|
|
181
239
|
this.ngControl.valueAccessor = this;
|
|
182
240
|
}
|
|
@@ -189,16 +247,22 @@ class DatePickerComponent {
|
|
|
189
247
|
ngOnInit() {
|
|
190
248
|
const control = this.effectiveControl;
|
|
191
249
|
// Synchronize signal model with control value
|
|
192
|
-
|
|
193
|
-
this.
|
|
250
|
+
const initialValue = control.value;
|
|
251
|
+
this.modelValue.set(initialValue);
|
|
252
|
+
this.lastValue = initialValue;
|
|
253
|
+
control.valueChanges
|
|
254
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
255
|
+
.subscribe(value => {
|
|
194
256
|
this.modelValue.set(value);
|
|
195
|
-
|
|
257
|
+
this.lastValue = value;
|
|
258
|
+
});
|
|
196
259
|
}
|
|
197
260
|
ngOnDestroy() {
|
|
198
261
|
this.sub.unsubscribe();
|
|
199
262
|
}
|
|
200
263
|
writeValue(value) {
|
|
201
264
|
this.modelValue.set(value);
|
|
265
|
+
this.lastValue = value;
|
|
202
266
|
}
|
|
203
267
|
registerOnChange(fn) {
|
|
204
268
|
this.onChange = fn;
|
|
@@ -216,24 +280,56 @@ class DatePickerComponent {
|
|
|
216
280
|
* Called when the PrimeNG DatePicker template updates the value.
|
|
217
281
|
*/
|
|
218
282
|
onModelChange(value) {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
this.
|
|
283
|
+
let finalValue = value;
|
|
284
|
+
// Time cascading logic (single mode only)
|
|
285
|
+
if (this.selectionMode() === 'single' &&
|
|
286
|
+
finalValue instanceof Date &&
|
|
287
|
+
this.lastValue instanceof Date) {
|
|
288
|
+
finalValue = this.applyTimeCascading(this.lastValue, finalValue);
|
|
289
|
+
}
|
|
290
|
+
this.lastValue = finalValue;
|
|
291
|
+
this.modelValue.set(finalValue);
|
|
292
|
+
this.onChange(finalValue);
|
|
293
|
+
this.effectiveControl.setValue(finalValue, { emitEvent: false });
|
|
222
294
|
this.effectiveControl.markAsDirty();
|
|
223
|
-
if (
|
|
295
|
+
if (finalValue === null) {
|
|
224
296
|
this.handleClear.emit();
|
|
225
297
|
}
|
|
226
298
|
else if (this.selectionMode() === 'range') {
|
|
227
|
-
if (Array.isArray(
|
|
228
|
-
const [start, end] =
|
|
299
|
+
if (Array.isArray(finalValue)) {
|
|
300
|
+
const [start, end] = finalValue;
|
|
229
301
|
if (start instanceof Date && end instanceof Date) {
|
|
230
|
-
this.handleSelect.emit(
|
|
302
|
+
this.handleSelect.emit(finalValue);
|
|
231
303
|
}
|
|
232
304
|
}
|
|
233
305
|
}
|
|
234
|
-
else if (
|
|
235
|
-
this.handleSelect.emit(
|
|
306
|
+
else if (finalValue instanceof Date) {
|
|
307
|
+
this.handleSelect.emit(finalValue);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* @method applyTimeCascading
|
|
312
|
+
* @private
|
|
313
|
+
* @description
|
|
314
|
+
* Adjusts the date when minutes or seconds wrap around.
|
|
315
|
+
*/
|
|
316
|
+
applyTimeCascading(prev, curr) {
|
|
317
|
+
const updated = new Date(curr);
|
|
318
|
+
// Cascade seconds to minutes
|
|
319
|
+
if (prev.getSeconds() === 59 && updated.getSeconds() === 0) {
|
|
320
|
+
updated.setMinutes(updated.getMinutes() + 1);
|
|
321
|
+
}
|
|
322
|
+
else if (prev.getSeconds() === 0 && updated.getSeconds() === 59) {
|
|
323
|
+
updated.setMinutes(updated.getMinutes() - 1);
|
|
324
|
+
}
|
|
325
|
+
// Cascade minutes to hours
|
|
326
|
+
if (prev.getMinutes() === 59 && updated.getMinutes() === 0) {
|
|
327
|
+
updated.setHours(updated.getHours() + 1);
|
|
328
|
+
}
|
|
329
|
+
else if (prev.getMinutes() === 0 && updated.getMinutes() === 59) {
|
|
330
|
+
updated.setHours(updated.getHours() - 1);
|
|
236
331
|
}
|
|
332
|
+
return updated;
|
|
237
333
|
}
|
|
238
334
|
/**
|
|
239
335
|
* @method onBlur
|
|
@@ -253,18 +349,18 @@ class DatePickerComponent {
|
|
|
253
349
|
this.onModelChange(null);
|
|
254
350
|
}
|
|
255
351
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
256
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
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]=\"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", 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 }); }
|
|
257
353
|
}
|
|
258
354
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DatePickerComponent, decorators: [{
|
|
259
355
|
type: Component,
|
|
260
|
-
args: [{ selector: 'tk-date-picker',
|
|
356
|
+
args: [{ selector: 'tk-date-picker', imports: [
|
|
261
357
|
FormsModule,
|
|
262
358
|
ReactiveFormsModule,
|
|
263
359
|
DatePickerModule,
|
|
264
360
|
FloatLabelModule,
|
|
265
361
|
FaIconComponent,
|
|
266
|
-
], template: "<div class=\"datepicker-container\">\n
|
|
267
|
-
}], 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 }] }], 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"] }] } });
|
|
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]=\"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", 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"] }]
|
|
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"] }] } });
|
|
268
364
|
|
|
269
365
|
/**
|
|
270
366
|
* 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 Component,\n OnInit,\n OnDestroy,\n inject,\n input,\n model,\n computed,\n output,\n} from '@angular/core';\nimport {\n FormsModule,\n ReactiveFormsModule,\n FormControl,\n ControlValueAccessor,\n NgControl,\n} from '@angular/forms';\nimport { Subscription } from 'rxjs';\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 standalone: true,\n imports: [\n FormsModule,\n ReactiveFormsModule,\n DatePickerModule,\n FloatLabelModule,\n FaIconComponent,\n ],\n templateUrl: './date-picker.component.html',\n styleUrls: ['./date-picker.component.scss'],\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, OnDestroy, ControlValueAccessor\n{\n /** Internal references and injections */\n readonly ngControl = inject(NgControl, { self: true, optional: true });\n\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n /**\n * @property {InputSignal<'date' | 'time'>} variant\n * @description\n * Defines the visual and functional mode:\n * - `'date'`: standard date/range picker\n * - `'time'`: time-only picker\n * @default 'date'\n */\n variant = input<'date' | 'time'>('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 'mm/dd/yy'\n */\n dateFormat = input<string>('mm/dd/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 * @default false\n */\n showSeconds = input<boolean>(false);\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<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\n ngOnInit(): void {\n const control = this.effectiveControl;\n\n // Synchronize signal model with control value\n this.modelValue.set(control.value);\n\n this.sub.add(\n control.valueChanges.subscribe(value => {\n this.modelValue.set(value);\n })\n );\n }\n\n ngOnDestroy(): void {\n this.sub.unsubscribe();\n }\n\n writeValue(value: DateValue): void {\n this.modelValue.set(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 this.modelValue.set(value);\n this.onChange(value);\n this.effectiveControl.setValue(value, { emitEvent: false });\n this.effectiveControl.markAsDirty();\n\n if (value === null) {\n this.handleClear.emit();\n } else if (this.selectionMode() === 'range') {\n if (Array.isArray(value)) {\n const [start, end] = value;\n if (start instanceof Date && end instanceof Date) {\n this.handleSelect.emit(value);\n }\n }\n } else if (value instanceof Date) {\n this.handleSelect.emit(value);\n }\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\">\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 [stepHour]=\"stepHour()\"\n [stepMinute]=\"stepMinute()\"\n [stepSecond]=\"stepSecond()\"\n [showSeconds]=\"showSeconds()\">\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</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAuCA;;;;;;AAMG;MACU,mBAAmB,CAAA;AAM9B,IAAA,WAAA,GAAA;;AAFS,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAQtE;;;;;;;AAOG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAkB,MAAM,8EAAC;AAExC;;;;;;;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,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,IAAI,+EAAC;AAE/B;;;;;AAKG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAS,UAAU,iFAA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AA,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,CAAA,CAAA;;2FAYN,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBApB/B,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP;wBACP,WAAW;wBACX,mBAAmB;wBACnB,gBAAgB;wBAChB,gBAAgB;wBAChB,eAAe;AAChB,qBAAA,EAAA,QAAA,EAAA,utCAAA,EAAA,MAAA,EAAA,CAAA,g0CAAA,CAAA,EAAA;;;AEnCH;;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 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,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,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,IAAI,+EAAC;AAE/B;;;;;AAKG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAS,UAAU,iFAAC;AAEtC;;;;;AAKG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAS,OAAO,iFAAC;AAEnC;;;;;AAKG;AACH,QAAA,IAAA,CAAA,Q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EAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAChB,eAAe,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,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,myEAAA,EAAA,MAAA,EAAA,CAAA,02CAAA,CAAA,EAAA;;;AExCjD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, viewChild, ViewContainerRef, input, computed, model,
|
|
2
|
+
import { inject, ElementRef, 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';
|
|
@@ -76,7 +76,7 @@ class DrawerComponent {
|
|
|
76
76
|
/** Whether the drawer content has a scrollbar */
|
|
77
77
|
this.hasScroll = false;
|
|
78
78
|
/** Emits when the drawer closes, passing the return value from header action or null */
|
|
79
|
-
this.
|
|
79
|
+
this.closed = output();
|
|
80
80
|
this.alreadyEmitted = false;
|
|
81
81
|
this.returnValueOnClose = null;
|
|
82
82
|
/**
|
|
@@ -188,7 +188,7 @@ class DrawerComponent {
|
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
190
|
const valueToEmit = this.alreadyEmitted ? this.returnValueOnClose : null;
|
|
191
|
-
this.
|
|
191
|
+
this.closed.emit(valueToEmit);
|
|
192
192
|
this.resetClosureState();
|
|
193
193
|
}
|
|
194
194
|
/** Forcefully closes the drawer without checks */
|
|
@@ -208,14 +208,14 @@ class DrawerComponent {
|
|
|
208
208
|
this.returnValueOnClose = null;
|
|
209
209
|
}
|
|
210
210
|
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" }, 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 (onHide)=\"handleClose()\">\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 <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"] }] }); }
|
|
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\"\n (onHide)=\"handleClose()\">\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 <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
212
|
}
|
|
213
213
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
214
214
|
type: Component,
|
|
215
|
-
args: [{ selector: 'tk-drawer',
|
|
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\"\n (onHide)=\"handleClose()\">\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 <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
216
|
}], ctorParameters: () => [], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ['contentHost', { ...{
|
|
217
217
|
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"] }] } });
|
|
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"] }] } });
|
|
219
219
|
|
|
220
220
|
class DrawerService {
|
|
221
221
|
constructor() {
|
|
@@ -251,7 +251,7 @@ class DrawerService {
|
|
|
251
251
|
componentRef.setInput('data', config.data ?? {});
|
|
252
252
|
componentRef.setInput('interceptor', config.interceptor ?? undefined);
|
|
253
253
|
const close$ = new Subject();
|
|
254
|
-
componentRef.instance.
|
|
254
|
+
componentRef.instance.closed.subscribe(value => {
|
|
255
255
|
close$.next(value);
|
|
256
256
|
close$.complete();
|
|
257
257
|
this.appRef.detachView(componentRef.hostView);
|