@tekus/design-system 5.8.2 → 5.9.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.
|
@@ -214,7 +214,7 @@ class TextareaComponent {
|
|
|
214
214
|
return this.getControl();
|
|
215
215
|
}
|
|
216
216
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
217
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TextareaComponent, isStandalone: true, selector: "tk-textarea", 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 }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, cols: { classPropertyName: "cols", publicName: "cols", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", 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-textarea-wrapper\">\n <textarea\n pTextarea\n [autoResize]=\"true\"\n [id]=\"id()\"\n [rows]=\"rows()\"\n [cols]=\"cols()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [attr.maxlength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"></textarea>\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 } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">\n {{ hint() }}\n </p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message\n severity=\"secondary\"\n size=\"small\"\n variant=\"simple\"\n class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>\n", styles: [":host ::ng-deep .p-textarea{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:var(--tk-borderRadius-null, 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-textarea:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-textarea.ng-invalid.ng-dirty,:host ::ng-deep .p-textarea.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-textarea.has-icon{padding-left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-textarea:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}: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(.p-textarea) label{top:var(--tk-spacing-base-125, 1.25rem)}:host ::ng-deep .p-floatlabel:has(textarea:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(textarea.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(textarea:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(.p-textarea.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-textarea.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}: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-messages{flex:1;margin-right:1rem}:host ::ng-deep .tk-character-counter{white-space:nowrap;display:flex;justify-content:flex-end}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: TextareaModule }, { kind: "directive", type: i1.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "variant", "fluid", "pSize"], outputs: ["onResize"] }, { 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"], outputs: ["onClose"] }] }); }
|
|
217
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TextareaComponent, isStandalone: true, selector: "tk-textarea", 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 }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, cols: { classPropertyName: "cols", publicName: "cols", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", 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-textarea-wrapper\">\n <textarea\n pTextarea\n [autoResize]=\"true\"\n [id]=\"id()\"\n [rows]=\"rows()\"\n [cols]=\"cols()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [attr.maxlength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [class.p-filled]=\"!!value()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"></textarea>\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 } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">\n {{ hint() }}\n </p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message\n severity=\"secondary\"\n size=\"small\"\n variant=\"simple\"\n class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>\n", styles: [":host ::ng-deep .p-textarea{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:var(--tk-borderRadius-null, 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-textarea:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-textarea.ng-invalid.ng-dirty,:host ::ng-deep .p-textarea.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-textarea.has-icon{padding-left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-textarea:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}: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(.p-textarea) label{top:var(--tk-spacing-base-125, 1.25rem)}:host ::ng-deep .p-floatlabel:has(textarea:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(textarea.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(textarea:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(.p-textarea.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-textarea.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}: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-messages{flex:1;margin-right:1rem}:host ::ng-deep .tk-character-counter{white-space:nowrap;display:flex;justify-content:flex-end}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: TextareaModule }, { kind: "directive", type: i1.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "variant", "fluid", "pSize"], outputs: ["onResize"] }, { 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"], outputs: ["onClose"] }] }); }
|
|
218
218
|
}
|
|
219
219
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
220
220
|
type: Component,
|
|
@@ -224,7 +224,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
224
224
|
TextareaModule,
|
|
225
225
|
FloatLabelModule,
|
|
226
226
|
MessageModule,
|
|
227
|
-
], template: "<p-floatlabel>\n <div class=\"tk-textarea-wrapper\">\n <textarea\n pTextarea\n [autoResize]=\"true\"\n [id]=\"id()\"\n [rows]=\"rows()\"\n [cols]=\"cols()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [attr.maxlength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"></textarea>\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 } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">\n {{ hint() }}\n </p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message\n severity=\"secondary\"\n size=\"small\"\n variant=\"simple\"\n class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>\n", styles: [":host ::ng-deep .p-textarea{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:var(--tk-borderRadius-null, 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-textarea:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-textarea.ng-invalid.ng-dirty,:host ::ng-deep .p-textarea.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-textarea.has-icon{padding-left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-textarea:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}: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(.p-textarea) label{top:var(--tk-spacing-base-125, 1.25rem)}:host ::ng-deep .p-floatlabel:has(textarea:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(textarea.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(textarea:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(.p-textarea.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-textarea.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}: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-messages{flex:1;margin-right:1rem}:host ::ng-deep .tk-character-counter{white-space:nowrap;display:flex;justify-content:flex-end}\n"] }]
|
|
227
|
+
], template: "<p-floatlabel>\n <div class=\"tk-textarea-wrapper\">\n <textarea\n pTextarea\n [autoResize]=\"true\"\n [id]=\"id()\"\n [rows]=\"rows()\"\n [cols]=\"cols()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [attr.maxlength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [class.p-filled]=\"!!value()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"></textarea>\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 } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">\n {{ hint() }}\n </p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message\n severity=\"secondary\"\n size=\"small\"\n variant=\"simple\"\n class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>\n", styles: [":host ::ng-deep .p-textarea{width:100%;flex:1;border:none;border-bottom:.0625rem solid var(--tk-color-base-surface-300, #d2d2d2);border-radius:var(--tk-borderRadius-null, 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-textarea:focus{border-color:var(--tk-color-base-primary-600, #140065);box-shadow:none}:host ::ng-deep .p-textarea.ng-invalid.ng-dirty,:host ::ng-deep .p-textarea.ng-invalid.ng-touched{border-color:var(--tk-color-base-red-700, #cf2604)}:host ::ng-deep .p-textarea.has-icon{padding-left:var(--tk-spacing-base-200, 2rem)}:host ::ng-deep .p-textarea:disabled{background-color:var(--tk-color-base-surface-200, #e4e4e4);color:var(--tk-color-base-surface-500, #8a8a8b);opacity:1}: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(.p-textarea) label{top:var(--tk-spacing-base-125, 1.25rem)}:host ::ng-deep .p-floatlabel:has(textarea:disabled) label{display:none}:host ::ng-deep .p-floatlabel:has(.p-inputwrapper-filled) label,:host ::ng-deep .p-floatlabel:has(textarea.p-filled) label{top:-.75rem;color:var(--tk-color-base-surface-950, #191a1b)}:host ::ng-deep .p-floatlabel:has(textarea:focus) label{top:-.75rem;color:var(--tk-color-base-primary-600, #140065)}:host ::ng-deep .p-floatlabel:has(.p-textarea.ng-invalid.ng-dirty) label,:host ::ng-deep .p-floatlabel:has(.p-textarea.ng-invalid.ng-touched) label{color:var(--tk-color-base-red-700, #cf2604)}: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-messages{flex:1;margin-right:1rem}:host ::ng-deep .tk-character-counter{white-space:nowrap;display:flex;justify-content:flex-end}\n"] }]
|
|
228
228
|
}], ctorParameters: () => [] });
|
|
229
229
|
|
|
230
230
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tekus-design-system-components-textarea.mjs","sources":["../../../projects/design-system/components/textarea/src/textarea.component.ts","../../../projects/design-system/components/textarea/src/textarea.component.html","../../../projects/design-system/components/textarea/tekus-design-system-components-textarea.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n Component,\n input,\n model,\n signal,\n computed,\n inject,\n OnInit,\n OnDestroy,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n ReactiveFormsModule,\n NgControl,\n} from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { FloatLabelModule } from 'primeng/floatlabel';\nimport { TextareaModule } from 'primeng/textarea';\nimport { MessageModule } from 'primeng/message';\n\n@Component({\n selector: 'tk-textarea',\n standalone: true,\n imports: [\n CommonModule,\n ReactiveFormsModule,\n TextareaModule,\n FloatLabelModule,\n MessageModule,\n ],\n templateUrl: './textarea.component.html',\n styleUrl: './textarea.component.scss',\n})\nexport class TextareaComponent\n implements ControlValueAccessor, OnInit, OnDestroy\n{\n /* ───────────── Dependency injection ───────────── */\n private readonly ngControl = inject(NgControl, {\n self: true,\n optional: true,\n });\n\n constructor() {\n this.bindValueAccessor();\n }\n\n /* ───────────── Inputs / State ───────────── */\n\n /**\n * @property {ModelSignal<string>} value\n * @description\n * The value of the textarea. 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 textarea 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 textarea.\n */\n label = input<string>('');\n\n /**\n * @property {InputSignal<string>} id\n * @description\n * HTML id attribute for the textarea.\n * @default 'tk-textarea'\n */\n id = input<string>('tk-textarea');\n\n /**\n * @property {InputSignal<number>} rows\n * @description\n * Number of visible text lines for the textarea.\n * @default 1\n */\n rows = input<number>(1);\n\n /**\n * @property {InputSignal<number>} cols\n * @description\n * Visible width of the textarea in average character widths.\n * @default 30\n */\n cols = input<number>(30);\n\n /**\n * @property {InputSignal<string>} hint\n * @description\n * Hint text to display below the textarea.\n */\n hint = input<string>('');\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<number | null>} maxLength\n * @description\n * Maximum number of characters allowed in the textarea.\n */\n maxLength = input<number | null>(null);\n\n /**\n * @property {boolean} disabled\n * @description\n * Whether the textarea is disabled.\n */\n disabled = signal<boolean>(false);\n\n /* ───────────── Derived state ───────────── */\n\n counterText = computed(() => {\n const limit = this.maxLength();\n return limit ? `${this.value().length}/${limit}` : '';\n });\n\n /* ───────────── CVA callbacks ───────────── */\n\n private propagateChange: (value: string) => void = () => {};\n private propagateTouched: () => void = () => {};\n\n /* ───────────── Internals ───────────── */\n\n private syncingFromView = false;\n private readonly subscriptions = new Subscription();\n\n /* ───────────── Lifecycle ───────────── */\n\n ngOnInit(): void {\n this.initializeFromControl();\n this.listenToControlChanges();\n }\n\n ngOnDestroy(): void {\n this.subscriptions.unsubscribe();\n }\n\n /* ───────────── ControlValueAccessor ───────────── */\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 const safeValue = value ?? '';\n this.value.set(safeValue);\n this.control().setValue(safeValue, { 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.propagateChange = 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.propagateTouched = 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 /* ───────────── Template handlers ───────────── */\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 nextValue = (event.target as HTMLTextAreaElement).value;\n this.syncFromUserInput(nextValue);\n }\n\n /**\n * @method onBlur\n * @description\n * Handles blur events to mark the control as touched.\n */\n onBlur(): void {\n this.markControlAsTouched();\n }\n\n /* ───────────── Private helpers ───────────── */\n\n private bindValueAccessor(): void {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n private initializeFromControl(): void {\n const control = this.getControl();\n\n if (control.value !== null && control.value !== undefined) {\n this.value.set(control.value);\n }\n\n this.disabled.set(control.disabled);\n }\n\n private listenToControlChanges(): void {\n const control = this.getControl();\n\n this.subscriptions.add(\n control.valueChanges.subscribe(value => {\n if (this.syncingFromView) return;\n if (value !== this.value()) {\n this.value.set(value ?? '');\n this.propagateChange(value);\n }\n })\n );\n\n this.subscriptions.add(\n control.statusChanges.subscribe(() => {\n this.disabled.set(control.disabled);\n })\n );\n }\n\n private syncFromUserInput(value: string): void {\n this.syncingFromView = true;\n\n this.value.set(value);\n this.propagateChange(value);\n\n const control = this.getControl();\n control.setValue(value);\n control.markAsDirty();\n\n this.syncingFromView = false;\n }\n\n private markControlAsTouched(): void {\n this.propagateTouched();\n this.getControl().markAsTouched();\n }\n\n private getControl(): FormControl {\n return (this.ngControl?.control as FormControl) || this.control();\n }\n\n get effectiveControl(): FormControl {\n return this.getControl();\n }\n}\n","<p-floatlabel>\n <div class=\"tk-textarea-wrapper\">\n <textarea\n pTextarea\n [autoResize]=\"true\"\n [id]=\"id()\"\n [rows]=\"rows()\"\n [cols]=\"cols()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [attr.maxlength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"></textarea>\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 } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">\n {{ hint() }}\n </p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message\n severity=\"secondary\"\n size=\"small\"\n variant=\"simple\"\n class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAmCa,iBAAiB,CAAA;AAS5B,IAAA,WAAA,GAAA;;AALiB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE;AAC7C,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA,CAAC;;AAQF;;;;AAIG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC;AAEzB;;;;;AAKG;QACH,IAAO,CAAA,OAAA,GAAG,KAAK,CAAc,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;AAEjD;;;;AAIG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC;AAEzB;;;;;AAKG;AACH,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,aAAa,CAAC;AAEjC;;;;;AAKG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CA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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,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAKJ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAb7B,SAAS;+BACE,aAAa,EAAA,UAAA,EACX,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBACd,gBAAgB;wBAChB,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,mvCAAA,EAAA,MAAA,EAAA,CAAA,onEAAA,CAAA,EAAA;;;AE/BH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"tekus-design-system-components-textarea.mjs","sources":["../../../projects/design-system/components/textarea/src/textarea.component.ts","../../../projects/design-system/components/textarea/src/textarea.component.html","../../../projects/design-system/components/textarea/tekus-design-system-components-textarea.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n Component,\n input,\n model,\n signal,\n computed,\n inject,\n OnInit,\n OnDestroy,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n ReactiveFormsModule,\n NgControl,\n} from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { FloatLabelModule } from 'primeng/floatlabel';\nimport { TextareaModule } from 'primeng/textarea';\nimport { MessageModule } from 'primeng/message';\n\n@Component({\n selector: 'tk-textarea',\n standalone: true,\n imports: [\n CommonModule,\n ReactiveFormsModule,\n TextareaModule,\n FloatLabelModule,\n MessageModule,\n ],\n templateUrl: './textarea.component.html',\n styleUrl: './textarea.component.scss',\n})\nexport class TextareaComponent\n implements ControlValueAccessor, OnInit, OnDestroy\n{\n /* ───────────── Dependency injection ───────────── */\n private readonly ngControl = inject(NgControl, {\n self: true,\n optional: true,\n });\n\n constructor() {\n this.bindValueAccessor();\n }\n\n /* ───────────── Inputs / State ───────────── */\n\n /**\n * @property {ModelSignal<string>} value\n * @description\n * The value of the textarea. 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 textarea 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 textarea.\n */\n label = input<string>('');\n\n /**\n * @property {InputSignal<string>} id\n * @description\n * HTML id attribute for the textarea.\n * @default 'tk-textarea'\n */\n id = input<string>('tk-textarea');\n\n /**\n * @property {InputSignal<number>} rows\n * @description\n * Number of visible text lines for the textarea.\n * @default 1\n */\n rows = input<number>(1);\n\n /**\n * @property {InputSignal<number>} cols\n * @description\n * Visible width of the textarea in average character widths.\n * @default 30\n */\n cols = input<number>(30);\n\n /**\n * @property {InputSignal<string>} hint\n * @description\n * Hint text to display below the textarea.\n */\n hint = input<string>('');\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<number | null>} maxLength\n * @description\n * Maximum number of characters allowed in the textarea.\n */\n maxLength = input<number | null>(null);\n\n /**\n * @property {boolean} disabled\n * @description\n * Whether the textarea is disabled.\n */\n disabled = signal<boolean>(false);\n\n /* ───────────── Derived state ───────────── */\n\n counterText = computed(() => {\n const limit = this.maxLength();\n return limit ? `${this.value().length}/${limit}` : '';\n });\n\n /* ───────────── CVA callbacks ───────────── */\n\n private propagateChange: (value: string) => void = () => {};\n private propagateTouched: () => void = () => {};\n\n /* ───────────── Internals ───────────── */\n\n private syncingFromView = false;\n private readonly subscriptions = new Subscription();\n\n /* ───────────── Lifecycle ───────────── */\n\n ngOnInit(): void {\n this.initializeFromControl();\n this.listenToControlChanges();\n }\n\n ngOnDestroy(): void {\n this.subscriptions.unsubscribe();\n }\n\n /* ───────────── ControlValueAccessor ───────────── */\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 const safeValue = value ?? '';\n this.value.set(safeValue);\n this.control().setValue(safeValue, { 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.propagateChange = 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.propagateTouched = 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 /* ───────────── Template handlers ───────────── */\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 nextValue = (event.target as HTMLTextAreaElement).value;\n this.syncFromUserInput(nextValue);\n }\n\n /**\n * @method onBlur\n * @description\n * Handles blur events to mark the control as touched.\n */\n onBlur(): void {\n this.markControlAsTouched();\n }\n\n /* ───────────── Private helpers ───────────── */\n\n private bindValueAccessor(): void {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n private initializeFromControl(): void {\n const control = this.getControl();\n\n if (control.value !== null && control.value !== undefined) {\n this.value.set(control.value);\n }\n\n this.disabled.set(control.disabled);\n }\n\n private listenToControlChanges(): void {\n const control = this.getControl();\n\n this.subscriptions.add(\n control.valueChanges.subscribe(value => {\n if (this.syncingFromView) return;\n if (value !== this.value()) {\n this.value.set(value ?? '');\n this.propagateChange(value);\n }\n })\n );\n\n this.subscriptions.add(\n control.statusChanges.subscribe(() => {\n this.disabled.set(control.disabled);\n })\n );\n }\n\n private syncFromUserInput(value: string): void {\n this.syncingFromView = true;\n\n this.value.set(value);\n this.propagateChange(value);\n\n const control = this.getControl();\n control.setValue(value);\n control.markAsDirty();\n\n this.syncingFromView = false;\n }\n\n private markControlAsTouched(): void {\n this.propagateTouched();\n this.getControl().markAsTouched();\n }\n\n private getControl(): FormControl {\n return (this.ngControl?.control as FormControl) || this.control();\n }\n\n get effectiveControl(): FormControl {\n return this.getControl();\n }\n}\n","<p-floatlabel>\n <div class=\"tk-textarea-wrapper\">\n <textarea\n pTextarea\n [autoResize]=\"true\"\n [id]=\"id()\"\n [rows]=\"rows()\"\n [cols]=\"cols()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [attr.maxlength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [class.p-filled]=\"!!value()\"\n [class.ng-invalid]=\"effectiveControl.invalid\"\n [class.ng-dirty]=\"effectiveControl.dirty\"\n [class.ng-touched]=\"effectiveControl.touched\"></textarea>\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 } @else if (hint()) {\n <p-message severity=\"secondary\" size=\"small\" variant=\"simple\">\n {{ hint() }}\n </p-message>\n }\n </div>\n\n @if (maxLength()) {\n <p-message\n severity=\"secondary\"\n size=\"small\"\n variant=\"simple\"\n class=\"tk-character-counter\">\n {{ counterText() }}\n </p-message>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAmCa,iBAAiB,CAAA;AAS5B,IAAA,WAAA,GAAA;;AALiB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE;AAC7C,Y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,YAAA,EAAA,SAAA,EAAA,OAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACd,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,UAAA,EAAA,IAAA,EAChB,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,OAAA,EAAA,YAAA,EAAA,UAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAKJ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAb7B,SAAS;+BACE,aAAa,EAAA,UAAA,EACX,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBACd,gBAAgB;wBAChB,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,yxCAAA,EAAA,MAAA,EAAA,CAAA,onEAAA,CAAA,EAAA;;;AE/BH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tekus/design-system",
|
|
3
3
|
"description": "Tekus design system library",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.9.0",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"@angular/core": "^19.2.15",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"types": "./components/autocomplete/index.d.ts",
|
|
44
44
|
"default": "./fesm2022/tekus-design-system-components-autocomplete.mjs"
|
|
45
45
|
},
|
|
46
|
-
"./components/checkbox": {
|
|
47
|
-
"types": "./components/checkbox/index.d.ts",
|
|
48
|
-
"default": "./fesm2022/tekus-design-system-components-checkbox.mjs"
|
|
49
|
-
},
|
|
50
46
|
"./components/button": {
|
|
51
47
|
"types": "./components/button/index.d.ts",
|
|
52
48
|
"default": "./fesm2022/tekus-design-system-components-button.mjs"
|
|
53
49
|
},
|
|
50
|
+
"./components/checkbox": {
|
|
51
|
+
"types": "./components/checkbox/index.d.ts",
|
|
52
|
+
"default": "./fesm2022/tekus-design-system-components-checkbox.mjs"
|
|
53
|
+
},
|
|
54
54
|
"./components/date-picker": {
|
|
55
55
|
"types": "./components/date-picker/index.d.ts",
|
|
56
56
|
"default": "./fesm2022/tekus-design-system-components-date-picker.mjs"
|