@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,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, model, input, signal, Component } from '@angular/core';
|
|
2
|
+
import { inject, DestroyRef, model, input, signal, 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, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
5
|
-
import { Subscription } from 'rxjs';
|
|
6
6
|
import * as i2 from 'primeng/floatlabel';
|
|
7
7
|
import { FloatLabelModule } from 'primeng/floatlabel';
|
|
8
8
|
import { InputNumber } from 'primeng/inputnumber';
|
|
@@ -11,6 +11,7 @@ import { Message } from 'primeng/message';
|
|
|
11
11
|
class InputNumberComponent {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
14
|
+
this.destroyRef = inject(DestroyRef);
|
|
14
15
|
/**
|
|
15
16
|
* @property {ModelSignal<number | null>} value
|
|
16
17
|
* @description
|
|
@@ -59,7 +60,6 @@ class InputNumberComponent {
|
|
|
59
60
|
this.onChange = () => { };
|
|
60
61
|
this.onTouched = () => { };
|
|
61
62
|
this.isWriting = false;
|
|
62
|
-
this.subscription = new Subscription();
|
|
63
63
|
if (this.ngControl) {
|
|
64
64
|
this.ngControl.valueAccessor = this;
|
|
65
65
|
}
|
|
@@ -73,20 +73,21 @@ class InputNumberComponent {
|
|
|
73
73
|
this.value.set(control.value);
|
|
74
74
|
}
|
|
75
75
|
this.disabled.set(control?.disabled ?? false);
|
|
76
|
-
|
|
76
|
+
control?.valueChanges
|
|
77
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
78
|
+
.subscribe(val => {
|
|
77
79
|
if (this.isWriting)
|
|
78
80
|
return;
|
|
79
81
|
if (val !== this.value()) {
|
|
80
82
|
this.value.set(val ?? null);
|
|
81
83
|
this.onChange(val);
|
|
82
84
|
}
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
+
});
|
|
86
|
+
control?.statusChanges
|
|
87
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
88
|
+
.subscribe(() => {
|
|
85
89
|
this.disabled.set(control?.disabled ?? false);
|
|
86
|
-
})
|
|
87
|
-
}
|
|
88
|
-
ngOnDestroy() {
|
|
89
|
-
this.subscription.unsubscribe();
|
|
90
|
+
});
|
|
90
91
|
}
|
|
91
92
|
/**
|
|
92
93
|
* @method writeValue
|
|
@@ -148,17 +149,17 @@ class InputNumberComponent {
|
|
|
148
149
|
this.effectiveControl?.markAsTouched();
|
|
149
150
|
}
|
|
150
151
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: InputNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
151
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: InputNumberComponent, isStandalone: true, selector: "tk-input-number", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, showButtons: { classPropertyName: "showButtons", publicName: "showButtons", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n <p-inputnumber\n [inputId]=\"id()\"\n [ngModel]=\"value()\"\n (ngModelChange)=\"onInput($event)\"\n (onBlur)=\"onBlur()\"\n [showButtons]=\"showButtons()\"\n [disabled]=\"disabled()\"\n mode=\"decimal\"\n [useGrouping]=\"false\"\n [class.ng-invalid]=\"effectiveControl?.invalid\"\n [class.ng-dirty]=\"effectiveControl?.dirty\"\n [class.ng-touched]=\"effectiveControl?.touched\" />\n\n <label [for]=\"id()\">{{ label() }}</label>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl?.invalid && (effectiveControl?.dirty ||\n effectiveControl?.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{\n errorMessage()\n }}</p-message>\n }\n </div>\n</div>\n", styles: [":host ::ng-deep .p-inputnumber-input{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:0;padding:var(--tk-spacing-base-75, .75rem);padding-left:var(--tk-spacing-paddingX-xs, .25rem);color:var(--tk-color-base-surface-950, #191a1b);background-color:transparent}:host ::ng-deep .p-inputnumber-input:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-inputnumber-input.ng-invalid.ng-dirty,:host ::ng-deep .p-inputnumber-input.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-inputnumber-input:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}:host ::ng-deep .p-inputnumber{display:flex}:host ::ng-deep .p-floatlabel label{color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400);left:var(--tk-spacing-base-25, .25rem);transition-duration:.2s}:host ::ng-deep .p-floatlabel:has(input:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(input.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(input:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(input.has-icon) label{left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-floatlabel:has(.p-inputnumber-input.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-inputnumber-input.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-wrapper{position:relative}:host ::ng-deep p-message[severity=error] .p-inline-message-text,:host ::ng-deep p-message[severity=error] span{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-bottom{display:flex;justify-content:space-between;align-items:flex-start;margin-top:var(--tk-spacing-base-25, .25rem);min-height:var(--tk-spacing-base-125, 1.25rem)}:host ::ng-deep .tk-input-messages{flex:1;margin-right:var(--tk-spacing-base-100, 1rem)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i2.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }] }); }
|
|
152
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: InputNumberComponent, isStandalone: true, selector: "tk-input-number", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, showButtons: { classPropertyName: "showButtons", publicName: "showButtons", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n <p-inputnumber\n [inputId]=\"id()\"\n [ngModel]=\"value()\"\n (ngModelChange)=\"onInput($event)\"\n (onBlur)=\"onBlur()\"\n [showButtons]=\"showButtons()\"\n [disabled]=\"disabled()\"\n mode=\"decimal\"\n [useGrouping]=\"false\"\n [class.ng-invalid]=\"effectiveControl?.invalid\"\n [class.ng-dirty]=\"effectiveControl?.dirty\"\n [class.ng-touched]=\"effectiveControl?.touched\" />\n\n <label [for]=\"id()\">{{ label() }}</label>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl?.invalid && (effectiveControl?.dirty ||\n effectiveControl?.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{\n errorMessage()\n }}</p-message>\n }\n </div>\n</div>\n", styles: [":host ::ng-deep .p-inputnumber-input{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:0;padding:var(--tk-spacing-base-75, .75rem);padding-left:var(--tk-spacing-paddingX-xs, .25rem);color:var(--tk-color-base-surface-950, #191a1b);background-color:transparent}:host ::ng-deep .p-inputnumber-input:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-inputnumber-input.ng-invalid.ng-dirty,:host ::ng-deep .p-inputnumber-input.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-inputnumber-input:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}:host ::ng-deep .p-inputnumber{display:flex}:host ::ng-deep .p-floatlabel label{color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400);left:var(--tk-spacing-base-25, .25rem);transition-duration:.2s}:host ::ng-deep .p-floatlabel:has(input:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(input.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(input:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(input.has-icon) label{left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-floatlabel:has(.p-inputnumber-input.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-inputnumber-input.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-wrapper{position:relative}:host ::ng-deep p-message[severity=error] .p-inline-message-text,:host ::ng-deep p-message[severity=error] span{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-bottom{display:flex;justify-content:space-between;align-items:flex-start;margin-top:var(--tk-spacing-base-25, .25rem);min-height:var(--tk-spacing-base-125, 1.25rem)}:host ::ng-deep .tk-input-messages{flex:1;margin-right:var(--tk-spacing-base-100, 1rem)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i2.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
152
153
|
}
|
|
153
154
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: InputNumberComponent, decorators: [{
|
|
154
155
|
type: Component,
|
|
155
|
-
args: [{ selector: 'tk-input-number',
|
|
156
|
+
args: [{ selector: 'tk-input-number', imports: [
|
|
156
157
|
ReactiveFormsModule,
|
|
157
158
|
FormsModule,
|
|
158
159
|
InputNumber,
|
|
159
160
|
FloatLabelModule,
|
|
160
|
-
Message
|
|
161
|
-
], template: "<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n <p-inputnumber\n [inputId]=\"id()\"\n [ngModel]=\"value()\"\n (ngModelChange)=\"onInput($event)\"\n (onBlur)=\"onBlur()\"\n [showButtons]=\"showButtons()\"\n [disabled]=\"disabled()\"\n mode=\"decimal\"\n [useGrouping]=\"false\"\n [class.ng-invalid]=\"effectiveControl?.invalid\"\n [class.ng-dirty]=\"effectiveControl?.dirty\"\n [class.ng-touched]=\"effectiveControl?.touched\" />\n\n <label [for]=\"id()\">{{ label() }}</label>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl?.invalid && (effectiveControl?.dirty ||\n effectiveControl?.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{\n errorMessage()\n }}</p-message>\n }\n </div>\n</div>\n", styles: [":host ::ng-deep .p-inputnumber-input{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:0;padding:var(--tk-spacing-base-75, .75rem);padding-left:var(--tk-spacing-paddingX-xs, .25rem);color:var(--tk-color-base-surface-950, #191a1b);background-color:transparent}:host ::ng-deep .p-inputnumber-input:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-inputnumber-input.ng-invalid.ng-dirty,:host ::ng-deep .p-inputnumber-input.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-inputnumber-input:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}:host ::ng-deep .p-inputnumber{display:flex}:host ::ng-deep .p-floatlabel label{color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400);left:var(--tk-spacing-base-25, .25rem);transition-duration:.2s}:host ::ng-deep .p-floatlabel:has(input:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(input.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(input:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(input.has-icon) label{left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-floatlabel:has(.p-inputnumber-input.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-inputnumber-input.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-wrapper{position:relative}:host ::ng-deep p-message[severity=error] .p-inline-message-text,:host ::ng-deep p-message[severity=error] span{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-bottom{display:flex;justify-content:space-between;align-items:flex-start;margin-top:var(--tk-spacing-base-25, .25rem);min-height:var(--tk-spacing-base-125, 1.25rem)}:host ::ng-deep .tk-input-messages{flex:1;margin-right:var(--tk-spacing-base-100, 1rem)}\n"] }]
|
|
161
|
+
Message,
|
|
162
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n <p-inputnumber\n [inputId]=\"id()\"\n [ngModel]=\"value()\"\n (ngModelChange)=\"onInput($event)\"\n (onBlur)=\"onBlur()\"\n [showButtons]=\"showButtons()\"\n [disabled]=\"disabled()\"\n mode=\"decimal\"\n [useGrouping]=\"false\"\n [class.ng-invalid]=\"effectiveControl?.invalid\"\n [class.ng-dirty]=\"effectiveControl?.dirty\"\n [class.ng-touched]=\"effectiveControl?.touched\" />\n\n <label [for]=\"id()\">{{ label() }}</label>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl?.invalid && (effectiveControl?.dirty ||\n effectiveControl?.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{\n errorMessage()\n }}</p-message>\n }\n </div>\n</div>\n", styles: [":host ::ng-deep .p-inputnumber-input{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:0;padding:var(--tk-spacing-base-75, .75rem);padding-left:var(--tk-spacing-paddingX-xs, .25rem);color:var(--tk-color-base-surface-950, #191a1b);background-color:transparent}:host ::ng-deep .p-inputnumber-input:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-inputnumber-input.ng-invalid.ng-dirty,:host ::ng-deep .p-inputnumber-input.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-inputnumber-input:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}:host ::ng-deep .p-inputnumber{display:flex}:host ::ng-deep .p-floatlabel label{color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400);left:var(--tk-spacing-base-25, .25rem);transition-duration:.2s}:host ::ng-deep .p-floatlabel:has(input:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(input.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(input:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(input.has-icon) label{left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-floatlabel:has(.p-inputnumber-input.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-inputnumber-input.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-wrapper{position:relative}:host ::ng-deep p-message[severity=error] .p-inline-message-text,:host ::ng-deep p-message[severity=error] span{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-bottom{display:flex;justify-content:space-between;align-items:flex-start;margin-top:var(--tk-spacing-base-25, .25rem);min-height:var(--tk-spacing-base-125, 1.25rem)}:host ::ng-deep .tk-input-messages{flex:1;margin-right:var(--tk-spacing-base-100, 1rem)}\n"] }]
|
|
162
163
|
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], showButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtons", required: false }] }] } });
|
|
163
164
|
|
|
164
165
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tekus-design-system-components-input-number.mjs","sources":["../../../projects/design-system/components/input-number/src/input-number.component.ts","../../../projects/design-system/components/input-number/src/input-number.component.html","../../../projects/design-system/components/input-number/tekus-design-system-components-input-number.ts"],"sourcesContent":["\nimport {\n Component,\n input,\n model,\n signal,\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 { FloatLabelModule } from 'primeng/floatlabel';\nimport { InputNumber } from 'primeng/inputnumber';\nimport { Message } from 'primeng/message';\n\n@Component({\n selector: 'tk-input-number',\n standalone: true,\n imports: [\n ReactiveFormsModule,\n FormsModule,\n InputNumber,\n FloatLabelModule,\n Message\n],\n templateUrl: './input-number.component.html',\n styleUrl: './input-number.component.scss',\n})\nexport class InputNumberComponent\n implements ControlValueAccessor, OnInit, OnDestroy\n{\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 {ModelSignal<number | null>} value\n * @description\n * The value of the input. Supports two-way binding via signals.\n */\n value = model<number | null>(null);\n\n /**\n * @property {InputSignal<FormControl>} control\n * @description\n * External FormControl used to read/set the input value.\n * If not provided, an internal FormControl is created.\n */\n control = input<FormControl>(new FormControl(null));\n\n /**\n * @property {InputSignal<string>} label\n * @description\n * Label displayed above the input.\n */\n label = input<string>('');\n\n /**\n * @property {InputSignal<string>} id\n * @description\n * HTML id attribute for the input.\n * @default 'tk-input-number'\n */\n id = input<string>('tk-input-number');\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 {InputSignal<boolean>} showButtons\n * @description\n * Whether to display spinner buttons.\n * @default false\n */\n showButtons = input<boolean>(false);\n\n /**\n * @property {boolean} disabled\n * @description\n * Whether the input is disabled.\n */\n disabled = signal<boolean>(false);\n\n get effectiveControl(): FormControl | null {\n return (this.ngControl?.control as FormControl) || this.control();\n }\n\n onChange: (value: number | null) => void = () => {};\n onTouched: () => void = () => {};\n private isWriting = false;\n private readonly subscription = new Subscription();\n\n ngOnInit(): void {\n const control = this.effectiveControl;\n if (control?.value !== null && control?.value !== undefined) {\n this.value.set(control.value);\n }\n\n this.disabled.set(control?.disabled ?? false);\n this.subscription.add(\n control?.valueChanges.subscribe(val => {\n if (this.isWriting) return;\n if (val !== this.value()) {\n this.value.set(val ?? null);\n this.onChange(val);\n }\n })\n );\n\n this.subscription.add(\n control?.statusChanges.subscribe(() => {\n this.disabled.set(control?.disabled ?? false);\n })\n );\n }\n\n ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n\n /**\n * @method writeValue\n * @description\n * Writes a new value to the element.\n * @param value The new value.\n */\n writeValue(value: number | null): void {\n this.value.set(value ?? null);\n }\n\n /**\n * @method registerOnChange\n * @description\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function.\n */\n registerOnChange(fn: (value: number | null) => void): void {\n this.onChange = fn;\n }\n\n /**\n * @method registerOnTouched\n * @description\n * Registers a callback function that is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function.\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * @method setDisabledState\n * @description\n * Function that is called by the forms API when the control status changes to or from 'DISABLED'.\n * @param isDisabled The disabled status to set on the element.\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n /**\n * @method onInput\n * @description\n * Handles input events to update the model and notify forms.\n * @param value The new numeric value.\n */\n onInput(value: number | null): void {\n this.isWriting = true;\n this.value.set(value);\n this.onChange(value);\n this.effectiveControl?.setValue(value);\n this.effectiveControl?.markAsDirty();\n this.isWriting = false;\n }\n\n /**\n * @method onBlur\n * @description\n * Handles blur events to mark the control as touched.\n */\n onBlur(): void {\n this.onTouched();\n this.effectiveControl?.markAsTouched();\n }\n}\n","<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n <p-inputnumber\n [inputId]=\"id()\"\n [ngModel]=\"value()\"\n (ngModelChange)=\"onInput($event)\"\n (onBlur)=\"onBlur()\"\n [showButtons]=\"showButtons()\"\n [disabled]=\"disabled()\"\n mode=\"decimal\"\n [useGrouping]=\"false\"\n [class.ng-invalid]=\"effectiveControl?.invalid\"\n [class.ng-dirty]=\"effectiveControl?.dirty\"\n [class.ng-touched]=\"effectiveControl?.touched\" />\n\n <label [for]=\"id()\">{{ label() }}</label>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl?.invalid && (effectiveControl?.dirty ||\n effectiveControl?.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{\n err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P;wBACP,mBAAmB;wBACnB,WAAW;wBACX,WAAW;wBACX,gBAAgB;wBAChB;AACH,qBAAA,EAAA,QAAA,EAAA,04BAAA,EAAA,MAAA,EAAA,CAAA,+mEAAA,CAAA,EAAA;;;AE/BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"tekus-design-system-components-input-number.mjs","sources":["../../../projects/design-system/components/input-number/src/input-number.component.ts","../../../projects/design-system/components/input-number/src/input-number.component.html","../../../projects/design-system/components/input-number/tekus-design-system-components-input-number.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n input,\n model,\n signal,\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 { FloatLabelModule } from 'primeng/floatlabel';\nimport { InputNumber } from 'primeng/inputnumber';\nimport { Message } from 'primeng/message';\n\n@Component({\n selector: 'tk-input-number',\n imports: [\n ReactiveFormsModule,\n FormsModule,\n InputNumber,\n FloatLabelModule,\n Message,\n ],\n templateUrl: './input-number.component.html',\n styleUrl: './input-number.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class InputNumberComponent\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 /**\n * @property {ModelSignal<number | null>} value\n * @description\n * The value of the input. Supports two-way binding via signals.\n */\n value = model<number | null>(null);\n\n /**\n * @property {InputSignal<FormControl>} control\n * @description\n * External FormControl used to read/set the input value.\n * If not provided, an internal FormControl is created.\n */\n control = input<FormControl>(new FormControl(null));\n\n /**\n * @property {InputSignal<string>} label\n * @description\n * Label displayed above the input.\n */\n label = input<string>('');\n\n /**\n * @property {InputSignal<string>} id\n * @description\n * HTML id attribute for the input.\n * @default 'tk-input-number'\n */\n id = input<string>('tk-input-number');\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 {InputSignal<boolean>} showButtons\n * @description\n * Whether to display spinner buttons.\n * @default false\n */\n showButtons = input<boolean>(false);\n\n /**\n * @property {boolean} disabled\n * @description\n * Whether the input is disabled.\n */\n disabled = signal<boolean>(false);\n\n get effectiveControl(): FormControl | null {\n return (this.ngControl?.control as FormControl) || this.control();\n }\n\n onChange: (value: number | null) => void = () => {};\n onTouched: () => void = () => {};\n private isWriting = false;\n\n ngOnInit(): void {\n const control = this.effectiveControl;\n if (control?.value !== null && control?.value !== undefined) {\n this.value.set(control.value);\n }\n\n this.disabled.set(control?.disabled ?? false);\n\n control?.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(val => {\n if (this.isWriting) return;\n if (val !== this.value()) {\n this.value.set(val ?? null);\n this.onChange(val);\n }\n });\n\n control?.statusChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.disabled.set(control?.disabled ?? false);\n });\n }\n\n /**\n * @method writeValue\n * @description\n * Writes a new value to the element.\n * @param value The new value.\n */\n writeValue(value: number | null): void {\n this.value.set(value ?? null);\n }\n\n /**\n * @method registerOnChange\n * @description\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function.\n */\n registerOnChange(fn: (value: number | null) => void): void {\n this.onChange = fn;\n }\n\n /**\n * @method registerOnTouched\n * @description\n * Registers a callback function that is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function.\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * @method setDisabledState\n * @description\n * Function that is called by the forms API when the control status changes to or from 'DISABLED'.\n * @param isDisabled The disabled status to set on the element.\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n /**\n * @method onInput\n * @description\n * Handles input events to update the model and notify forms.\n * @param value The new numeric value.\n */\n onInput(value: number | null): void {\n this.isWriting = true;\n this.value.set(value);\n this.onChange(value);\n this.effectiveControl?.setValue(value);\n this.effectiveControl?.markAsDirty();\n this.isWriting = false;\n }\n\n /**\n * @method onBlur\n * @description\n * Handles blur events to mark the control as touched.\n */\n onBlur(): void {\n this.onTouched();\n this.effectiveControl?.markAsTouched();\n }\n}\n","<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n <p-inputnumber\n [inputId]=\"id()\"\n [ngModel]=\"value()\"\n (ngModelChange)=\"onInput($event)\"\n (onBlur)=\"onBlur()\"\n [showButtons]=\"showButtons()\"\n [disabled]=\"disabled()\"\n mode=\"decimal\"\n [useGrouping]=\"false\"\n [class.ng-invalid]=\"effectiveControl?.invalid\"\n [class.ng-dirty]=\"effectiveControl?.dirty\"\n [class.ng-touched]=\"effectiveControl?.touched\" />\n\n <label [for]=\"id()\">{{ label() }}</label>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl?.invalid && (effectiveControl?.dirty ||\n effectiveControl?.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{\n errorMessage()\n }}</p-message>\n }\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAmCa,oBAAoB,CAAA;AAM/B,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;;;;AAIG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAgB,IAAI,4EAAC;AAElC;;;;;AAKG;QACH,IAAA,CAAA,OAAO,GAAG,KAAK,CAAc,IAAI,WA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AA,OAAA,EAAA,CAAA,SAAA,EAAA,SAAA,EAAA,QAAA,EAAA,WAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACX,gBAAgB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAChB,OAAO,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,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAME,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAbhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,OAAA,EAClB;wBACP,mBAAmB;wBACnB,WAAW;wBACX,WAAW;wBACX,gBAAgB;wBAChB,OAAO;qBACR,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,04BAAA,EAAA,MAAA,EAAA,CAAA,+mEAAA,CAAA,EAAA;;;AEjCjD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, model, input, signal, computed, Component } from '@angular/core';
|
|
2
|
+
import { inject, DestroyRef, model, input, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
4
|
import { NgControl, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { Subscription } from 'rxjs';
|
|
5
5
|
import * as i2 from 'primeng/floatlabel';
|
|
6
6
|
import { FloatLabelModule } from 'primeng/floatlabel';
|
|
7
7
|
import * as i1 from 'primeng/inputtext';
|
|
@@ -13,6 +13,12 @@ import { IconComponent } from '@tekus/design-system/components/icon';
|
|
|
13
13
|
class InputTextComponent {
|
|
14
14
|
constructor() {
|
|
15
15
|
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
16
|
+
this.destroyRef = inject(DestroyRef);
|
|
17
|
+
this.init = (() => {
|
|
18
|
+
if (this.ngControl) {
|
|
19
|
+
this.ngControl.valueAccessor = this;
|
|
20
|
+
}
|
|
21
|
+
})();
|
|
16
22
|
/**
|
|
17
23
|
* @property {ModelSignal<string>} value
|
|
18
24
|
* @description
|
|
@@ -65,11 +71,6 @@ class InputTextComponent {
|
|
|
65
71
|
* Message to display when the control is invalid and touched.
|
|
66
72
|
*/
|
|
67
73
|
this.errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
68
|
-
/**
|
|
69
|
-
* @property {InputSignal<string>} hint
|
|
70
|
-
* @description
|
|
71
|
-
* Hint text to display below the input.
|
|
72
|
-
*/
|
|
73
74
|
/**
|
|
74
75
|
* @property {InputSignal<string>} hint
|
|
75
76
|
* @description
|
|
@@ -95,10 +96,6 @@ class InputTextComponent {
|
|
|
95
96
|
this.onChange = () => { };
|
|
96
97
|
this.onTouched = () => { };
|
|
97
98
|
this.isWriting = false;
|
|
98
|
-
this.subscription = new Subscription();
|
|
99
|
-
if (this.ngControl) {
|
|
100
|
-
this.ngControl.valueAccessor = this;
|
|
101
|
-
}
|
|
102
99
|
}
|
|
103
100
|
get effectiveControl() {
|
|
104
101
|
return this.ngControl?.control || this.control();
|
|
@@ -110,21 +107,22 @@ class InputTextComponent {
|
|
|
110
107
|
}
|
|
111
108
|
// Sync initial disabled state
|
|
112
109
|
this.disabled.set(control.disabled);
|
|
113
|
-
|
|
110
|
+
control.valueChanges
|
|
111
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
112
|
+
.subscribe(val => {
|
|
114
113
|
if (this.isWriting)
|
|
115
114
|
return;
|
|
116
115
|
if (val !== this.value()) {
|
|
117
116
|
this.value.set(val || '');
|
|
118
117
|
this.onChange(val);
|
|
119
118
|
}
|
|
120
|
-
})
|
|
119
|
+
});
|
|
121
120
|
// Sync disabled state on status change
|
|
122
|
-
|
|
121
|
+
control.statusChanges
|
|
122
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
123
|
+
.subscribe(() => {
|
|
123
124
|
this.disabled.set(control.disabled);
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
ngOnDestroy() {
|
|
127
|
-
this.subscription.unsubscribe();
|
|
125
|
+
});
|
|
128
126
|
}
|
|
129
127
|
/**
|
|
130
128
|
* @method writeValue
|
|
@@ -206,12 +204,12 @@ class InputTextComponent {
|
|
|
206
204
|
this.isWriting = false;
|
|
207
205
|
}
|
|
208
206
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: InputTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
209
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: InputTextComponent, isStandalone: true, selector: "tk-input-text", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n @if (icon()) {\n <tk-icon [icon]=\"icon()\" class=\"tk-input-icon\"></tk-icon>\n }\n <div class=\"tk-input-prefix\">\n <ng-content select=\"[tk-prefix]\"></ng-content>\n </div>\n \n <input \n pInputText \n [id]=\"id()\" \n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [type]=\"type()\" \n [attr.maxlength]=\"maxLength()\"\n [class.has-icon]=\"icon()\"\n [class.has-clear]=\"clearable()\"\n [disabled]=\"disabled()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"\n />\n \n <label [for]=\"id()\">{{ label() }}</label>\n \n @if (clearable() && value()) {\n <tk-icon \n icon=\"xmark\" \n class=\"tk-clear-icon\" \n (click)=\"clear()\" \n (keydown.enter)=\"clear()\" \n (keydown.space)=\"clear()\">\n </tk-icon>\n }\n <div class=\"tk-input-suffix\">\n <ng-content select=\"[tk-suffix]\"></ng-content>\n </div>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl.invalid && (effectiveControl.dirty || effectiveControl.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{ errorMessage() }}</p-message>\n } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">{{ hint() }}</p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\" class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>", styles: [":host ::ng-deep .p-inputtext{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:0;padding:var(--tk-spacing-base-75, .75rem);padding-left:var(--tk-spacing-paddingX-xs, .25rem);color:var(--tk-color-base-surface-950, #191a1b);background-color:transparent}:host ::ng-deep .p-inputtext:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-inputtext.ng-invalid.ng-dirty,:host ::ng-deep .p-inputtext.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-inputtext.has-icon{padding-left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-inputtext:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}:host ::ng-deep .tk-input-wrapper:has(.tk-input-suffix:not(:empty)) .p-inputtext{padding-right:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .tk-input-wrapper:has(.tk-input-prefix:not(:empty)) .p-inputtext{padding-left:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .p-floatlabel label{color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400);left:var(--tk-spacing-base-25, .25rem);transition-duration:.2s}:host ::ng-deep .p-floatlabel:has(input:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(input.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(input:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(input.has-icon) label{left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-floatlabel:has(.tk-input-prefix:not(:empty)) label{left:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .p-floatlabel:has(.p-inputtext.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-inputtext.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-wrapper{position:relative;display:flex;align-items:center;width:100%}:host ::ng-deep .tk-input-icon{position:absolute;left:0;top:50%;transform:translateY(-50%);color:var(--tk-color-base-surface-400, #cecdcd);pointer-events:none;z-index:1}:host ::ng-deep .tk-input-prefix{position:absolute;left:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;padding-left:var(--tk-spacing-base-25, .25rem);z-index:1}:host ::ng-deep .tk-input-prefix:empty{display:none}:host ::ng-deep .tk-clear-icon{position:absolute;right:0;top:50%;transform:translateY(-50%);cursor:pointer;color:var(--tk-color-base-surface-700, #424243);z-index:1}:host ::ng-deep .tk-input-suffix{position:absolute;right:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;padding-right:var(--tk-spacing-base-25, .25rem);z-index:1}:host ::ng-deep .tk-input-suffix:empty{display:none}:host ::ng-deep p-message[severity=error] .p-inline-message-text,:host ::ng-deep p-message[severity=error] span{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep p-message[severity=secondary] .p-inline-message-text,:host ::ng-deep p-message[severity=secondary] span{color:var(--tk-color-base-surface-600, #5d5d5e)}:host ::ng-deep .tk-input-bottom{display:flex;justify-content:space-between;align-items:flex-start;margin-top:.25rem;min-height:1.25rem}:host ::ng-deep .tk-input-messages{flex:1;margin-right:1rem}:host ::ng-deep .tk-character-counter{white-space:nowrap;align-self:flex-start}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i1.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i2.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i3.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "component", type: IconComponent, selector: "tk-icon", inputs: ["icon", "styleIcon", "color", "size", "disabled"],
|
|
207
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: InputTextComponent, isStandalone: true, selector: "tk-input-text", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n @if (icon()) {\n <tk-icon [icon]=\"icon()\" class=\"tk-input-icon\"></tk-icon>\n }\n <div class=\"tk-input-prefix\">\n <ng-content select=\"[tk-prefix]\"></ng-content>\n </div>\n \n <input \n pInputText \n [id]=\"id()\" \n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [type]=\"type()\" \n [attr.maxlength]=\"maxLength()\"\n [class.has-icon]=\"icon()\"\n [class.has-clear]=\"clearable()\"\n [disabled]=\"disabled()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"\n />\n \n <label [for]=\"id()\">{{ label() }}</label>\n \n @if (clearable() && value()) {\n <tk-icon \n icon=\"xmark\" \n class=\"tk-clear-icon\" \n (click)=\"clear()\" \n (keydown.enter)=\"clear()\" \n (keydown.space)=\"clear()\">\n </tk-icon>\n }\n <div class=\"tk-input-suffix\">\n <ng-content select=\"[tk-suffix]\"></ng-content>\n </div>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl.invalid && (effectiveControl.dirty || effectiveControl.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{ errorMessage() }}</p-message>\n } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">{{ hint() }}</p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\" class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>", styles: [":host ::ng-deep .p-inputtext{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:0;padding:var(--tk-spacing-base-75, .75rem);padding-left:var(--tk-spacing-paddingX-xs, .25rem);color:var(--tk-color-base-surface-950, #191a1b);background-color:transparent}:host ::ng-deep .p-inputtext:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-inputtext.ng-invalid.ng-dirty,:host ::ng-deep .p-inputtext.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-inputtext.has-icon{padding-left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-inputtext:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}:host ::ng-deep .tk-input-wrapper:has(.tk-input-suffix:not(:empty)) .p-inputtext{padding-right:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .tk-input-wrapper:has(.tk-input-prefix:not(:empty)) .p-inputtext{padding-left:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .p-floatlabel label{color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400);left:var(--tk-spacing-base-25, .25rem);transition-duration:.2s}:host ::ng-deep .p-floatlabel:has(input:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(input.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(input:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(input.has-icon) label{left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-floatlabel:has(.tk-input-prefix:not(:empty)) label{left:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .p-floatlabel:has(.p-inputtext.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-inputtext.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-wrapper{position:relative;display:flex;align-items:center;width:100%}:host ::ng-deep .tk-input-icon{position:absolute;left:0;top:50%;transform:translateY(-50%);color:var(--tk-color-base-surface-400, #cecdcd);pointer-events:none;z-index:1}:host ::ng-deep .tk-input-prefix{position:absolute;left:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;padding-left:var(--tk-spacing-base-25, .25rem);z-index:1}:host ::ng-deep .tk-input-prefix:empty{display:none}:host ::ng-deep .tk-clear-icon{position:absolute;right:0;top:50%;transform:translateY(-50%);cursor:pointer;color:var(--tk-color-base-surface-700, #424243);z-index:1}:host ::ng-deep .tk-input-suffix{position:absolute;right:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;padding-right:var(--tk-spacing-base-25, .25rem);z-index:1}:host ::ng-deep .tk-input-suffix:empty{display:none}:host ::ng-deep p-message[severity=error] .p-inline-message-text,:host ::ng-deep p-message[severity=error] span{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep p-message[severity=secondary] .p-inline-message-text,:host ::ng-deep p-message[severity=secondary] span{color:var(--tk-color-base-surface-600, #5d5d5e)}:host ::ng-deep .tk-input-bottom{display:flex;justify-content:space-between;align-items:flex-start;margin-top:.25rem;min-height:1.25rem}:host ::ng-deep .tk-input-messages{flex:1;margin-right:1rem}:host ::ng-deep .tk-character-counter{white-space:nowrap;align-self:flex-start}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i1.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i2.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i3.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "component", type: IconComponent, selector: "tk-icon", inputs: ["icon", "styleIcon", "color", "size", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
210
208
|
}
|
|
211
209
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: InputTextComponent, decorators: [{
|
|
212
210
|
type: Component,
|
|
213
|
-
args: [{ selector: 'tk-input-text', imports: [ReactiveFormsModule, InputTextModule, FloatLabelModule, MessageModule, IconComponent], template: "<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n @if (icon()) {\n <tk-icon [icon]=\"icon()\" class=\"tk-input-icon\"></tk-icon>\n }\n <div class=\"tk-input-prefix\">\n <ng-content select=\"[tk-prefix]\"></ng-content>\n </div>\n \n <input \n pInputText \n [id]=\"id()\" \n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [type]=\"type()\" \n [attr.maxlength]=\"maxLength()\"\n [class.has-icon]=\"icon()\"\n [class.has-clear]=\"clearable()\"\n [disabled]=\"disabled()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"\n />\n \n <label [for]=\"id()\">{{ label() }}</label>\n \n @if (clearable() && value()) {\n <tk-icon \n icon=\"xmark\" \n class=\"tk-clear-icon\" \n (click)=\"clear()\" \n (keydown.enter)=\"clear()\" \n (keydown.space)=\"clear()\">\n </tk-icon>\n }\n <div class=\"tk-input-suffix\">\n <ng-content select=\"[tk-suffix]\"></ng-content>\n </div>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl.invalid && (effectiveControl.dirty || effectiveControl.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{ errorMessage() }}</p-message>\n } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">{{ hint() }}</p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\" class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>", styles: [":host ::ng-deep .p-inputtext{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:0;padding:var(--tk-spacing-base-75, .75rem);padding-left:var(--tk-spacing-paddingX-xs, .25rem);color:var(--tk-color-base-surface-950, #191a1b);background-color:transparent}:host ::ng-deep .p-inputtext:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-inputtext.ng-invalid.ng-dirty,:host ::ng-deep .p-inputtext.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-inputtext.has-icon{padding-left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-inputtext:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}:host ::ng-deep .tk-input-wrapper:has(.tk-input-suffix:not(:empty)) .p-inputtext{padding-right:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .tk-input-wrapper:has(.tk-input-prefix:not(:empty)) .p-inputtext{padding-left:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .p-floatlabel label{color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400);left:var(--tk-spacing-base-25, .25rem);transition-duration:.2s}:host ::ng-deep .p-floatlabel:has(input:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(input.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(input:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(input.has-icon) label{left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-floatlabel:has(.tk-input-prefix:not(:empty)) label{left:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .p-floatlabel:has(.p-inputtext.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-inputtext.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-wrapper{position:relative;display:flex;align-items:center;width:100%}:host ::ng-deep .tk-input-icon{position:absolute;left:0;top:50%;transform:translateY(-50%);color:var(--tk-color-base-surface-400, #cecdcd);pointer-events:none;z-index:1}:host ::ng-deep .tk-input-prefix{position:absolute;left:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;padding-left:var(--tk-spacing-base-25, .25rem);z-index:1}:host ::ng-deep .tk-input-prefix:empty{display:none}:host ::ng-deep .tk-clear-icon{position:absolute;right:0;top:50%;transform:translateY(-50%);cursor:pointer;color:var(--tk-color-base-surface-700, #424243);z-index:1}:host ::ng-deep .tk-input-suffix{position:absolute;right:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;padding-right:var(--tk-spacing-base-25, .25rem);z-index:1}:host ::ng-deep .tk-input-suffix:empty{display:none}:host ::ng-deep p-message[severity=error] .p-inline-message-text,:host ::ng-deep p-message[severity=error] span{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep p-message[severity=secondary] .p-inline-message-text,:host ::ng-deep p-message[severity=secondary] span{color:var(--tk-color-base-surface-600, #5d5d5e)}:host ::ng-deep .tk-input-bottom{display:flex;justify-content:space-between;align-items:flex-start;margin-top:.25rem;min-height:1.25rem}:host ::ng-deep .tk-input-messages{flex:1;margin-right:1rem}:host ::ng-deep .tk-character-counter{white-space:nowrap;align-self:flex-start}\n"] }]
|
|
214
|
-
}],
|
|
211
|
+
args: [{ selector: 'tk-input-text', imports: [ReactiveFormsModule, InputTextModule, FloatLabelModule, MessageModule, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n @if (icon()) {\n <tk-icon [icon]=\"icon()\" class=\"tk-input-icon\"></tk-icon>\n }\n <div class=\"tk-input-prefix\">\n <ng-content select=\"[tk-prefix]\"></ng-content>\n </div>\n \n <input \n pInputText \n [id]=\"id()\" \n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [type]=\"type()\" \n [attr.maxlength]=\"maxLength()\"\n [class.has-icon]=\"icon()\"\n [class.has-clear]=\"clearable()\"\n [disabled]=\"disabled()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"\n />\n \n <label [for]=\"id()\">{{ label() }}</label>\n \n @if (clearable() && value()) {\n <tk-icon \n icon=\"xmark\" \n class=\"tk-clear-icon\" \n (click)=\"clear()\" \n (keydown.enter)=\"clear()\" \n (keydown.space)=\"clear()\">\n </tk-icon>\n }\n <div class=\"tk-input-suffix\">\n <ng-content select=\"[tk-suffix]\"></ng-content>\n </div>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl.invalid && (effectiveControl.dirty || effectiveControl.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{ errorMessage() }}</p-message>\n } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">{{ hint() }}</p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\" class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>", styles: [":host ::ng-deep .p-inputtext{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:0;padding:var(--tk-spacing-base-75, .75rem);padding-left:var(--tk-spacing-paddingX-xs, .25rem);color:var(--tk-color-base-surface-950, #191a1b);background-color:transparent}:host ::ng-deep .p-inputtext:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-inputtext.ng-invalid.ng-dirty,:host ::ng-deep .p-inputtext.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-inputtext.has-icon{padding-left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-inputtext:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}:host ::ng-deep .tk-input-wrapper:has(.tk-input-suffix:not(:empty)) .p-inputtext{padding-right:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .tk-input-wrapper:has(.tk-input-prefix:not(:empty)) .p-inputtext{padding-left:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .p-floatlabel label{color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400);left:var(--tk-spacing-base-25, .25rem);transition-duration:.2s}:host ::ng-deep .p-floatlabel:has(input:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(input.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(input:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(input.has-icon) label{left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-floatlabel:has(.tk-input-prefix:not(:empty)) label{left:var(--tk-spacing-base-300, 3rem)}:host ::ng-deep .p-floatlabel:has(.p-inputtext.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-inputtext.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .tk-input-wrapper{position:relative;display:flex;align-items:center;width:100%}:host ::ng-deep .tk-input-icon{position:absolute;left:0;top:50%;transform:translateY(-50%);color:var(--tk-color-base-surface-400, #cecdcd);pointer-events:none;z-index:1}:host ::ng-deep .tk-input-prefix{position:absolute;left:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;padding-left:var(--tk-spacing-base-25, .25rem);z-index:1}:host ::ng-deep .tk-input-prefix:empty{display:none}:host ::ng-deep .tk-clear-icon{position:absolute;right:0;top:50%;transform:translateY(-50%);cursor:pointer;color:var(--tk-color-base-surface-700, #424243);z-index:1}:host ::ng-deep .tk-input-suffix{position:absolute;right:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;padding-right:var(--tk-spacing-base-25, .25rem);z-index:1}:host ::ng-deep .tk-input-suffix:empty{display:none}:host ::ng-deep p-message[severity=error] .p-inline-message-text,:host ::ng-deep p-message[severity=error] span{color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep p-message[severity=secondary] .p-inline-message-text,:host ::ng-deep p-message[severity=secondary] span{color:var(--tk-color-base-surface-600, #5d5d5e)}:host ::ng-deep .tk-input-bottom{display:flex;justify-content:space-between;align-items:flex-start;margin-top:.25rem;min-height:1.25rem}:host ::ng-deep .tk-input-messages{flex:1;margin-right:1rem}:host ::ng-deep .tk-character-counter{white-space:nowrap;align-self:flex-start}\n"] }]
|
|
212
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }] } });
|
|
215
213
|
|
|
216
214
|
/**
|
|
217
215
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tekus-design-system-components-input-text.mjs","sources":["../../../projects/design-system/components/input-text/src/input-text.component.ts","../../../projects/design-system/components/input-text/src/input-text.component.html","../../../projects/design-system/components/input-text/tekus-design-system-components-input-text.ts"],"sourcesContent":["\nimport { Component, input, model, signal, computed, OnInit, inject, OnDestroy } from '@angular/core';\nimport { ControlValueAccessor, FormControl, ReactiveFormsModule, NgControl } from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { FloatLabelModule } from 'primeng/floatlabel';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { MessageModule } from 'primeng/message';\nimport { IconComponent } from '@tekus/design-system/components/icon';\n\n@Component({\n selector: 'tk-input-text',\n imports: [ReactiveFormsModule, InputTextModule, FloatLabelModule, MessageModule, IconComponent],\n templateUrl: './input-text.component.html',\n styleUrl: './input-text.component.scss',\n})\nexport class InputTextComponent implements ControlValueAccessor, OnInit, OnDestroy {\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 {ModelSignal<string>} value\n * @description\n * The value of the input. Supports two-way binding via signals.\n */\n value = model<string>('');\n\n /**\n * @property {InputSignal<FormControl>} control\n * @description\n * External FormControl used to read/set the input value.\n * If not provided, an internal FormControl is created.\n */\n control = input<FormControl>(new FormControl(''));\n\n /**\n * @property {InputSignal<string>} label\n * @description\n * Label displayed above the input.\n */\n label = input<string>('');\n\n /**\n * @property {InputSignal<string>} type\n * @description\n * Type of the input (text, password, email, etc.).\n * @default 'text'\n */\n type = input<string>('text');\n\n /**\n * @property {InputSignal<string>} id\n * @description\n * HTML id attribute for the input.\n * @default 'tk-input-text'\n */\n id = input<string>('tk-input-text');\n\n /**\n * @property {InputSignal<string>} icon\n * @description\n * Icon to display next to the input (e.g., 'pi pi-search').\n */\n icon = input<string>('');\n\n /**\n * @property {InputSignal<boolean>} clearable\n * @description\n * Whether to show a clear button when the input has a value.\n * @default false\n */\n clearable = input<boolean>(false);\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 {InputSignal<string>} hint\n * @description\n * Hint text to display below the input.\n */\n /**\n * @property {InputSignal<string>} hint\n * @description\n * Hint text to display below the input.\n */\n hint = input<string>('');\n\n /**\n * @property {InputSignal<number | null>} maxLength\n * @description\n * Maximum number of characters allowed in the input.\n */\n maxLength = input<number | null>(null);\n\n /**\n * @property {boolean} disabled\n * @description\n * Whether the input is disabled.\n */\n disabled = signal<boolean>(false);\n\n get effectiveControl(): FormControl {\n return (this.ngControl?.control as FormControl) || this.control();\n }\n\n counterText = computed(() => {\n const max = this.maxLength();\n return max ? `${this.value().length}/${max}` : '';\n });\n\n\n onChange: (value: string) => void = () => {};\n onTouched: () => void = () => {};\n private isWriting = false;\n private readonly subscription = new Subscription();\n\n ngOnInit(): void {\n const control = this.effectiveControl;\n if (control.value) {\n this.value.set(control.value);\n }\n\n // Sync initial disabled state\n this.disabled.set(control.disabled);\n\n this.subscription.add(\n control.valueChanges.subscribe(val => {\n if (this.isWriting) return;\n if (val !== this.value()) {\n this.value.set(val || '');\n this.onChange(val);\n }\n })\n );\n\n // Sync disabled state on status change\n this.subscription.add(\n control.statusChanges.subscribe(() => {\n this.disabled.set(control.disabled);\n })\n );\n }\n\n ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n\n /**\n * @method writeValue\n * @description\n * Writes a new value to the element.\n * @param value The new value.\n */\n writeValue(value: string): void {\n this.value.set(value || '');\n this.control().setValue(value || '', { emitEvent: false });\n }\n\n /**\n * @method registerOnChange\n * @description\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function.\n */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n /**\n * @method registerOnTouched\n * @description\n * Registers a callback function that is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function.\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * @method setDisabledState\n * @description\n * Function that is called by the forms API when the control status changes to or from 'DISABLED'.\n * @param isDisabled The disabled status to set on the element.\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 * @method onInput\n * @description\n * Handles input events to update the model and notify forms.\n * @param event The input event.\n */\n onInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.isWriting = true;\n this.value.set(input.value);\n this.onChange(input.value);\n this.effectiveControl.setValue(input.value);\n this.effectiveControl.markAsDirty();\n this.isWriting = false;\n }\n\n /**\n * @method onBlur\n * @description\n * Handles blur events to mark the control as touched.\n */\n onBlur(): void {\n this.onTouched();\n this.effectiveControl.markAsTouched();\n }\n\n /**\n * @method clear\n * @description\n * Clears the input value.\n */\n clear(): void {\n this.isWriting = true;\n this.value.set('');\n this.onChange('');\n this.control().setValue('');\n this.isWriting = false;\n }\n}\n","<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n @if (icon()) {\n <tk-icon [icon]=\"icon()\" class=\"tk-input-icon\"></tk-icon>\n }\n <div class=\"tk-input-prefix\">\n <ng-content select=\"[tk-prefix]\"></ng-content>\n </div>\n \n <input \n pInputText \n [id]=\"id()\" \n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [type]=\"type()\" \n [attr.maxlength]=\"maxLength()\"\n [class.has-icon]=\"icon()\"\n [class.has-clear]=\"clearable()\"\n [disabled]=\"disabled()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"\n />\n \n <label [for]=\"id()\">{{ label() }}</label>\n \n @if (clearable() && value()) {\n <tk-icon \n icon=\"xmark\" \n class=\"tk-clear-icon\" \n (click)=\"clear()\" \n (keydown.enter)=\"clear()\" \n (keydown.space)=\"clear()\">\n </tk-icon>\n }\n <div class=\"tk-input-suffix\">\n <ng-content select=\"[tk-suffix]\"></ng-content>\n </div>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl.invalid && (effectiveControl.dirty || effectiveControl.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{ errorMessage() }}</p-message>\n } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">{{ hint() }}</p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\" class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAea,kBAAkB,CAAA;AAG7B,IAAA,WAAA,GAAA;AAFS,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAQtE;;;;AAIG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AAEzB;;;;;AAKG;QACH,IAAA,CAAA,OAAO,GAAG,KAAK,CAAc,IAAI,WAAW,CAAC,EAAE,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;AAEjD;;;;AAIG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AAEzB;;;;;AAKG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,MAAM,2EAAC;AAE5B;;;;;AAKG;AACH,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,eAAe,yEAAC;AAEnC;;;;AAIG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE,2EAAC;AAExB;;;;;AAKG;AACH,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAU,KAAK,gFAAC;AAEjC;;;;AAIG;AACH,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAS,EAAE,mFAAC;AAEhC;;;;AAIG;AACH;;;;AAIG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE,2EAAC;AAExB;;;;AAIG;AACH,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;AAEtC;;;;AAIG;AACH,QAAA,IAAA,CAAA,QAAQ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iBAAA,EAAA,aAAA,EAAA,YAAA,EAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAInF,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAN9B,SAAS;+BACE,eAAe,EAAA,OAAA,EAChB,CAAC,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,4wDAAA,EAAA,MAAA,EAAA,CAAA,67GAAA,CAAA,EAAA;;;AEXjG;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"tekus-design-system-components-input-text.mjs","sources":["../../../projects/design-system/components/input-text/src/input-text.component.ts","../../../projects/design-system/components/input-text/src/input-text.component.html","../../../projects/design-system/components/input-text/tekus-design-system-components-input-text.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, DestroyRef, input, model, signal, computed, OnInit, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, FormControl, ReactiveFormsModule, NgControl } from '@angular/forms';\nimport { FloatLabelModule } from 'primeng/floatlabel';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { MessageModule } from 'primeng/message';\nimport { IconComponent } from '@tekus/design-system/components/icon';\n\n@Component({\n selector: 'tk-input-text',\n imports: [ReactiveFormsModule, InputTextModule, FloatLabelModule, MessageModule, IconComponent],\n templateUrl: './input-text.component.html',\n styleUrl: './input-text.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class InputTextComponent implements ControlValueAccessor, OnInit {\n readonly ngControl = inject(NgControl, { self: true, optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly init = (() => {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n })();\n\n /**\n * @property {ModelSignal<string>} value\n * @description\n * The value of the input. Supports two-way binding via signals.\n */\n value = model<string>('');\n\n /**\n * @property {InputSignal<FormControl>} control\n * @description\n * External FormControl used to read/set the input value.\n * If not provided, an internal FormControl is created.\n */\n control = input<FormControl>(new FormControl(''));\n\n /**\n * @property {InputSignal<string>} label\n * @description\n * Label displayed above the input.\n */\n label = input<string>('');\n\n /**\n * @property {InputSignal<string>} type\n * @description\n * Type of the input (text, password, email, etc.).\n * @default 'text'\n */\n type = input<string>('text');\n\n /**\n * @property {InputSignal<string>} id\n * @description\n * HTML id attribute for the input.\n * @default 'tk-input-text'\n */\n id = input<string>('tk-input-text');\n\n /**\n * @property {InputSignal<string>} icon\n * @description\n * Icon to display next to the input (e.g., 'pi pi-search').\n */\n icon = input<string>('');\n\n /**\n * @property {InputSignal<boolean>} clearable\n * @description\n * Whether to show a clear button when the input has a value.\n * @default false\n */\n clearable = input<boolean>(false);\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 {InputSignal<string>} hint\n * @description\n * Hint text to display below the input.\n */\n hint = input<string>('');\n\n /**\n * @property {InputSignal<number | null>} maxLength\n * @description\n * Maximum number of characters allowed in the input.\n */\n maxLength = input<number | null>(null);\n\n /**\n * @property {boolean} disabled\n * @description\n * Whether the input is disabled.\n */\n disabled = signal<boolean>(false);\n\n get effectiveControl(): FormControl {\n return (this.ngControl?.control as FormControl) || this.control();\n }\n\n counterText = computed(() => {\n const max = this.maxLength();\n return max ? `${this.value().length}/${max}` : '';\n });\n\n onChange: (value: string) => void = () => {};\n onTouched: () => void = () => {};\n private isWriting = false;\n\n ngOnInit(): void {\n const control = this.effectiveControl;\n if (control.value) {\n this.value.set(control.value);\n }\n\n // Sync initial disabled state\n this.disabled.set(control.disabled);\n\n control.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(val => {\n if (this.isWriting) return;\n if (val !== this.value()) {\n this.value.set(val || '');\n this.onChange(val);\n }\n });\n\n // Sync disabled state on status change\n control.statusChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.disabled.set(control.disabled);\n });\n }\n\n /**\n * @method writeValue\n * @description\n * Writes a new value to the element.\n * @param value The new value.\n */\n writeValue(value: string): void {\n this.value.set(value || '');\n this.control().setValue(value || '', { emitEvent: false });\n }\n\n /**\n * @method registerOnChange\n * @description\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function.\n */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n /**\n * @method registerOnTouched\n * @description\n * Registers a callback function that is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function.\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * @method setDisabledState\n * @description\n * Function that is called by the forms API when the control status changes to or from 'DISABLED'.\n * @param isDisabled The disabled status to set on the element.\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 * @method onInput\n * @description\n * Handles input events to update the model and notify forms.\n * @param event The input event.\n */\n onInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.isWriting = true;\n this.value.set(input.value);\n this.onChange(input.value);\n this.effectiveControl.setValue(input.value);\n this.effectiveControl.markAsDirty();\n this.isWriting = false;\n }\n\n /**\n * @method onBlur\n * @description\n * Handles blur events to mark the control as touched.\n */\n onBlur(): void {\n this.onTouched();\n this.effectiveControl.markAsTouched();\n }\n\n /**\n * @method clear\n * @description\n * Clears the input value.\n */\n clear(): void {\n this.isWriting = true;\n this.value.set('');\n this.onChange('');\n this.control().setValue('');\n this.isWriting = false;\n }\n}\n","<p-floatlabel>\n <div class=\"tk-input-wrapper\">\n @if (icon()) {\n <tk-icon [icon]=\"icon()\" class=\"tk-input-icon\"></tk-icon>\n }\n <div class=\"tk-input-prefix\">\n <ng-content select=\"[tk-prefix]\"></ng-content>\n </div>\n \n <input \n pInputText \n [id]=\"id()\" \n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [type]=\"type()\" \n [attr.maxlength]=\"maxLength()\"\n [class.has-icon]=\"icon()\"\n [class.has-clear]=\"clearable()\"\n [disabled]=\"disabled()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"\n />\n \n <label [for]=\"id()\">{{ label() }}</label>\n \n @if (clearable() && value()) {\n <tk-icon \n icon=\"xmark\" \n class=\"tk-clear-icon\" \n (click)=\"clear()\" \n (keydown.enter)=\"clear()\" \n (keydown.space)=\"clear()\">\n </tk-icon>\n }\n <div class=\"tk-input-suffix\">\n <ng-content select=\"[tk-suffix]\"></ng-content>\n </div>\n </div>\n</p-floatlabel>\n\n<div class=\"tk-input-bottom\">\n <div class=\"tk-input-messages\">\n @if ((effectiveControl.invalid && (effectiveControl.dirty || effectiveControl.touched)) && errorMessage()) {\n <p-message severity=\"error\" size=\"small\" variant=\"simple\">{{ errorMessage() }}</p-message>\n } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">{{ hint() }}</p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\" class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAea,kBAAkB,CAAA;AAP/B,IAAA,WAAA,GAAA;AAQW,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;QAE/B,IAAA,CAAA,IAAI,GAAG,CAAC,MAAK;AAC5B,YAAA,IAAI,IAAI,CAAC,SAAS,EAAE;AAClB,gBAAA,IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,IAAI;YACrC;QACF,CAAC,GA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|
2
|
+
import { inject, ElementRef, viewChild, ViewContainerRef, input, computed, model, output, effect, untracked, afterEveryRender, ChangeDetectionStrategy, Component, Injector, ApplicationRef, createComponent, Injectable } from '@angular/core';
|
|
3
3
|
import { ButtonComponent } from '@tekus/design-system/components/button';
|
|
4
4
|
import * as i1 from 'primeng/dialog';
|
|
5
5
|
import { DialogModule } from 'primeng/dialog';
|
|
6
6
|
import * as i2 from 'primeng/api';
|
|
7
|
+
import { outputToObservable } from '@angular/core/rxjs-interop';
|
|
7
8
|
import { Subject } from 'rxjs';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -52,7 +53,7 @@ class ModalComponent {
|
|
|
52
53
|
this.hasScroll = false;
|
|
53
54
|
// --- Internals ---
|
|
54
55
|
/** Emits when the modal closes, passing the return value from footer buttons or null */
|
|
55
|
-
this.
|
|
56
|
+
this.closed = output();
|
|
56
57
|
this.alreadyEmitted = false;
|
|
57
58
|
this.returnValueOnClose = null;
|
|
58
59
|
/** Computed: calculates modal max-width based on `size` */
|
|
@@ -195,7 +196,7 @@ class ModalComponent {
|
|
|
195
196
|
*/
|
|
196
197
|
handleClose() {
|
|
197
198
|
const valueToEmit = this.alreadyEmitted ? this.returnValueOnClose : null;
|
|
198
|
-
this.
|
|
199
|
+
this.closed.emit(valueToEmit);
|
|
199
200
|
this.resetClosureState();
|
|
200
201
|
}
|
|
201
202
|
/**
|
|
@@ -221,14 +222,14 @@ class ModalComponent {
|
|
|
221
222
|
this.returnValueOnClose = null;
|
|
222
223
|
}
|
|
223
224
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
224
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: ModalComponent, isStandalone: true, selector: "tk-modal", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, footerButtons: { classPropertyName: "footerButtons", publicName: "footerButtons", 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 }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "closeOnOutsideClick", 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 }, responsive: { classPropertyName: "responsive", publicName: "responsive", 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-dialog\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissableMask]=\"closeOnOutsideClick()\"\n [draggable]=\"false\"\n [focusOnShow]=\"false\"\n [header]=\"title()\"\n [style]=\"{\n 'max-width': modalMaxWidth(),\n width: 'calc(100% - var(--tk-spacing-base-200))',\n }\"\n (onHide)=\"handleClose()\"\n (onShow)=\"checkScroll()\"\n class=\"tk-modal\">\n <section class=\"tk-modal__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\n <ng-template pTemplate=\"footer\">\n @if (hasFooter()) {\n <section\n class=\"tk-modal__footer\"\n [class.tk-modal__footer--with-content]=\"hasScroll\">\n @for (btn of footerButtons()!; track $index) {\n <tk-button\n [label]=\"btn.label\"\n [severity]=\"btn.severity\"\n [variant]=\"btn.variant\"\n (clicked)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.enter)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.space)=\"handleAction(btn.action, btn.returnValue)\" />\n }\n </section>\n }\n </ng-template>\n</p-dialog>\n", styles: [":host ::ng-deep .p-dialog{max-height:90vh;display:flex;flex-direction:column}:host ::ng-deep .p-dialog-content{overflow-y:auto}:host ::ng-deep .p-dialog-title{color:var(--tk-color-text-default, #212121)}:host ::ng-deep .p-dialog-close-button{color:var(--tk-surface-500, #8a8a8b)}:host ::ng-deep .p-dialog-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-surface-500, #8a8a8b)}.tk-modal__content{padding-bottom:var(--tk-spacing-paddingY-l, 1.25rem);color:var(--tk-surface-1000, #000000)}.tk-modal__footer{display:flex;flex-direction:row;justify-content:end;align-items:center;gap:var(--tk-spacing-base-50, .5rem)}.tk-modal__footer--with-content{padding-right:var(--tk-spacing-paddingX-l, 1.25rem)}\n"], dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1.Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "maskMotionOptions", "motionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { 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"] }] }); }
|
|
225
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: ModalComponent, isStandalone: true, selector: "tk-modal", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, footerButtons: { classPropertyName: "footerButtons", publicName: "footerButtons", 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 }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "closeOnOutsideClick", 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 }, responsive: { classPropertyName: "responsive", publicName: "responsive", 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-dialog\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissableMask]=\"closeOnOutsideClick()\"\n [draggable]=\"false\"\n [focusOnShow]=\"false\"\n [header]=\"title()\"\n [style]=\"{\n 'max-width': modalMaxWidth(),\n width: 'calc(100% - var(--tk-spacing-base-200))',\n }\"\n (onHide)=\"handleClose()\"\n (onShow)=\"checkScroll()\"\n class=\"tk-modal\">\n <section class=\"tk-modal__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\n <ng-template pTemplate=\"footer\">\n @if (hasFooter()) {\n <section\n class=\"tk-modal__footer\"\n [class.tk-modal__footer--with-content]=\"hasScroll\">\n @for (btn of footerButtons()!; track $index) {\n <tk-button\n [label]=\"btn.label\"\n [severity]=\"btn.severity\"\n [variant]=\"btn.variant\"\n (clicked)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.enter)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.space)=\"handleAction(btn.action, btn.returnValue)\" />\n }\n </section>\n }\n </ng-template>\n</p-dialog>\n", styles: [":host ::ng-deep .p-dialog{max-height:90vh;display:flex;flex-direction:column}:host ::ng-deep .p-dialog-content{overflow-y:auto}:host ::ng-deep .p-dialog-title{color:var(--tk-color-text-default, #212121)}:host ::ng-deep .p-dialog-close-button{color:var(--tk-surface-500, #8a8a8b)}:host ::ng-deep .p-dialog-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-surface-500, #8a8a8b)}.tk-modal__content{padding-bottom:var(--tk-spacing-paddingY-l, 1.25rem);color:var(--tk-surface-1000, #000000)}.tk-modal__footer{display:flex;flex-direction:row;justify-content:end;align-items:center;gap:var(--tk-spacing-base-50, .5rem)}.tk-modal__footer--with-content{padding-right:var(--tk-spacing-paddingX-l, 1.25rem)}\n"], dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1.Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "maskMotionOptions", "motionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { 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 }); }
|
|
225
226
|
}
|
|
226
227
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: ModalComponent, decorators: [{
|
|
227
228
|
type: Component,
|
|
228
|
-
args: [{ selector: 'tk-modal',
|
|
229
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'tk-modal', imports: [DialogModule, ButtonComponent], template: "<p-dialog\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissableMask]=\"closeOnOutsideClick()\"\n [draggable]=\"false\"\n [focusOnShow]=\"false\"\n [header]=\"title()\"\n [style]=\"{\n 'max-width': modalMaxWidth(),\n width: 'calc(100% - var(--tk-spacing-base-200))',\n }\"\n (onHide)=\"handleClose()\"\n (onShow)=\"checkScroll()\"\n class=\"tk-modal\">\n <section class=\"tk-modal__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\n <ng-template pTemplate=\"footer\">\n @if (hasFooter()) {\n <section\n class=\"tk-modal__footer\"\n [class.tk-modal__footer--with-content]=\"hasScroll\">\n @for (btn of footerButtons()!; track $index) {\n <tk-button\n [label]=\"btn.label\"\n [severity]=\"btn.severity\"\n [variant]=\"btn.variant\"\n (clicked)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.enter)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.space)=\"handleAction(btn.action, btn.returnValue)\" />\n }\n </section>\n }\n </ng-template>\n</p-dialog>\n", styles: [":host ::ng-deep .p-dialog{max-height:90vh;display:flex;flex-direction:column}:host ::ng-deep .p-dialog-content{overflow-y:auto}:host ::ng-deep .p-dialog-title{color:var(--tk-color-text-default, #212121)}:host ::ng-deep .p-dialog-close-button{color:var(--tk-surface-500, #8a8a8b)}:host ::ng-deep .p-dialog-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-surface-500, #8a8a8b)}.tk-modal__content{padding-bottom:var(--tk-spacing-paddingY-l, 1.25rem);color:var(--tk-surface-1000, #000000)}.tk-modal__footer{display:flex;flex-direction:row;justify-content:end;align-items:center;gap:var(--tk-spacing-base-50, .5rem)}.tk-modal__footer--with-content{padding-right:var(--tk-spacing-paddingX-l, 1.25rem)}\n"] }]
|
|
229
230
|
}], ctorParameters: () => [], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ['contentHost', { ...{
|
|
230
231
|
read: ViewContainerRef,
|
|
231
|
-
}, isSignal: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], footerButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtons", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], closeOnOutsideClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnOutsideClick", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], interceptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "interceptor", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], isOpened: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpened", required: false }] }, { type: i0.Output, args: ["isOpenedChange"] }] } });
|
|
232
|
+
}, isSignal: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], footerButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtons", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], closeOnOutsideClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnOutsideClick", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], interceptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "interceptor", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], isOpened: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpened", required: false }] }, { type: i0.Output, args: ["isOpenedChange"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
232
233
|
|
|
233
234
|
/**
|
|
234
235
|
* @service ModalService
|
|
@@ -259,7 +260,7 @@ class ModalService {
|
|
|
259
260
|
*/
|
|
260
261
|
open(config) {
|
|
261
262
|
if (this.modalRef) {
|
|
262
|
-
return this.modalRef.instance.
|
|
263
|
+
return outputToObservable(this.modalRef.instance.closed);
|
|
263
264
|
}
|
|
264
265
|
const componentRef = createComponent(ModalComponent, {
|
|
265
266
|
environmentInjector: this.appRef.injector,
|
|
@@ -276,7 +277,7 @@ class ModalService {
|
|
|
276
277
|
componentRef.setInput('interceptor', config.interceptor);
|
|
277
278
|
componentRef.setInput('data', config.data || {});
|
|
278
279
|
const close$ = new Subject();
|
|
279
|
-
componentRef.instance.
|
|
280
|
+
componentRef.instance.closed.subscribe((value) => {
|
|
280
281
|
close$.next(value);
|
|
281
282
|
close$.complete();
|
|
282
283
|
this.appRef.detachView(componentRef.hostView);
|