@apexara/ng-components 1.0.2 → 1.0.3

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.
@@ -58,7 +58,7 @@ class ApexTextAreaComponent {
58
58
  this.controlError = '';
59
59
  }
60
60
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexTextAreaComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
61
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexTextAreaComponent, isStandalone: true, selector: "apex-textarea", inputs: { options: "options" }, outputs: { textAreaChange: "textAreaChange" }, ngImport: i0, template: "@if (options) {\n @if (options.label !== '') {\n <div class=\"header\">\n <label> {{ options.label }}</label>\n </div>\n }\n\n @if (!options.formGroup) {\n <div class=\"textArea\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [ariaLabel]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea [placeholder]=\"options.placeholder ? options.placeholder : ''\" autocomplete=\"off\" (input)=\"onInput($event)\"></textarea>\n </div>\n </div>\n }\n\n @if (options.formGroup && options.formControlName) {\n <div class=\"textArea\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': controlInvalid, 'disabled': control.disabled }\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [ariaLabel]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea autocomplete=\"off\" [placeholder]=\"options.placeholder ? options.placeholder : ''\" [formControlName]=\"options.formControlName\"></textarea>\n </div>\n </div>\n\n <div class=\"footer\">\n {{ controlError }}\n </div>\n }\n}\n", styles: [":host{display:block;touch-action:manipulation}:host(.fluid) .textArea{width:100%}.header{width:100%;min-height:20px;display:flex;align-items:center;justify-content:space-between;column-gap:4px;color:var(--apex-textarea-header-color, #0B1222);text-wrap:nowrap;margin-bottom:2px}label{font-size:14px;font-weight:600;text-wrap:wrap;margin-right:4px}.label-wrapper{display:flex;align-items:center}.textArea{width:264px;height:100px;display:inline-block;box-sizing:border-box;background-color:var(--apex-textarea-background-color, transparent);border:var(--apex-textarea-border, 1px solid #E9E9E9);border-radius:var(--apex-textarea-border-radius, 4px);transition:border 1s;padding:12px}.textArea.disabled{opacity:.8;cursor:not-allowed;border:var(--apex-textarea-border-disabled, 1px dashed #F2F2F2)}.textArea .container{height:100%;display:flex;position:relative;box-sizing:border-box}.container apex-img{width:16px;height:16px;display:flex;justify-content:center;align-items:center;transition:all .2s;z-index:2;margin-right:12px}.container apex-img svg path{fill:var(--apex-textarea-icon-fill, #C6C6C6)}.textArea textarea{width:100%;height:100%;position:relative;resize:none;border:none;outline:none;background-color:var(--apex-textarea-background-color, transparent);color:var(--apex-textarea-text-color, #0B1222);font-size:14px;padding:0}textarea::placeholder{color:var(--apex-textarea-text-placeholder-color, #C6C6C6)}.textArea.disabled{cursor:not-allowed}.textArea.invalid{border:var(--apex-textarea-border-invalid, 1px solid #F96138)}.textArea.invalid+.footer,.textArea.disabled+.footer{color:var(--apex-textarea-footer-color, #F96138)}textarea::-webkit-scrollbar{width:8px;padding:8px}textarea::-webkit-scrollbar-thumb{background-color:var(--apex-textarea-scrollbar-color, #E2E2E2bb);border-radius:25px}textarea::-webkit-scrollbar-thumb:hover{background-color:var(--apex-textarea-scrollbar-hover-color, #e2e2e2)}textarea::-webkit-scrollbar-button{display:none}.footer{height:14px;font-size:12px;margin-top:2px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: ApexImageComponent, selector: "apex-img", inputs: ["src", "ariaLabel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
61
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexTextAreaComponent, isStandalone: true, selector: "apex-textarea", inputs: { options: "options" }, outputs: { textAreaChange: "textAreaChange" }, ngImport: i0, template: "@if (options) {\n @if (options.label !== '') {\n <div class=\"header\">\n <label> {{ options.label }}</label>\n </div>\n }\n\n @if (!options.formGroup) {\n <div class=\"textArea\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [alt]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea [placeholder]=\"options.placeholder ? options.placeholder : ''\" autocomplete=\"off\" (input)=\"onInput($event)\"></textarea>\n </div>\n </div>\n }\n\n @if (options.formGroup && options.formControlName) {\n <div class=\"textArea\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': controlInvalid, 'disabled': control.disabled }\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [alt]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea autocomplete=\"off\" [placeholder]=\"options.placeholder ? options.placeholder : ''\" [formControlName]=\"options.formControlName\"></textarea>\n </div>\n </div>\n\n <div class=\"footer\">\n {{ controlError }}\n </div>\n }\n}\n", styles: [":host{display:block;touch-action:manipulation}:host(.fluid) .textArea{width:100%}.header{width:100%;min-height:20px;display:flex;align-items:center;justify-content:space-between;column-gap:4px;color:var(--apex-textarea-header-color, #0B1222);text-wrap:nowrap;margin-bottom:2px}label{font-size:14px;font-weight:600;text-wrap:wrap;margin-right:4px}.label-wrapper{display:flex;align-items:center}.textArea{width:264px;height:100px;display:inline-block;box-sizing:border-box;background-color:var(--apex-textarea-background-color, transparent);border:var(--apex-textarea-border, 1px solid #E9E9E9);border-radius:var(--apex-textarea-border-radius, 4px);transition:border 1s;padding:12px}.textArea.disabled{opacity:.8;cursor:not-allowed;border:var(--apex-textarea-border-disabled, 1px dashed #F2F2F2)}.textArea .container{height:100%;display:flex;position:relative;box-sizing:border-box}.container apex-img{width:16px;height:16px;display:flex;justify-content:center;align-items:center;transition:all .2s;z-index:2;margin-right:12px}.container apex-img svg path{fill:var(--apex-textarea-icon-fill, #C6C6C6)}.textArea textarea{width:100%;height:100%;position:relative;resize:none;border:none;outline:none;background-color:var(--apex-textarea-background-color, transparent);color:var(--apex-textarea-text-color, #0B1222);font-size:14px;padding:0}textarea::placeholder{color:var(--apex-textarea-text-placeholder-color, #C6C6C6)}.textArea.disabled{cursor:not-allowed}.textArea.invalid{border:var(--apex-textarea-border-invalid, 1px solid #F96138)}.textArea.invalid+.footer,.textArea.disabled+.footer{color:var(--apex-textarea-footer-color, #F96138)}textarea::-webkit-scrollbar{width:8px;padding:8px}textarea::-webkit-scrollbar-thumb{background-color:var(--apex-textarea-scrollbar-color, #E2E2E2bb);border-radius:25px}textarea::-webkit-scrollbar-thumb:hover{background-color:var(--apex-textarea-scrollbar-hover-color, #e2e2e2)}textarea::-webkit-scrollbar-button{display:none}.footer{height:14px;font-size:12px;margin-top:2px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: ApexImageComponent, selector: "apex-img", inputs: ["src", "alt"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
62
62
  }
63
63
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexTextAreaComponent, decorators: [{
64
64
  type: Component,
@@ -67,7 +67,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
67
67
  FormsModule,
68
68
  ApexImageComponent,
69
69
  ReactiveFormsModule,
70
- ], template: "@if (options) {\n @if (options.label !== '') {\n <div class=\"header\">\n <label> {{ options.label }}</label>\n </div>\n }\n\n @if (!options.formGroup) {\n <div class=\"textArea\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [ariaLabel]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea [placeholder]=\"options.placeholder ? options.placeholder : ''\" autocomplete=\"off\" (input)=\"onInput($event)\"></textarea>\n </div>\n </div>\n }\n\n @if (options.formGroup && options.formControlName) {\n <div class=\"textArea\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': controlInvalid, 'disabled': control.disabled }\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [ariaLabel]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea autocomplete=\"off\" [placeholder]=\"options.placeholder ? options.placeholder : ''\" [formControlName]=\"options.formControlName\"></textarea>\n </div>\n </div>\n\n <div class=\"footer\">\n {{ controlError }}\n </div>\n }\n}\n", styles: [":host{display:block;touch-action:manipulation}:host(.fluid) .textArea{width:100%}.header{width:100%;min-height:20px;display:flex;align-items:center;justify-content:space-between;column-gap:4px;color:var(--apex-textarea-header-color, #0B1222);text-wrap:nowrap;margin-bottom:2px}label{font-size:14px;font-weight:600;text-wrap:wrap;margin-right:4px}.label-wrapper{display:flex;align-items:center}.textArea{width:264px;height:100px;display:inline-block;box-sizing:border-box;background-color:var(--apex-textarea-background-color, transparent);border:var(--apex-textarea-border, 1px solid #E9E9E9);border-radius:var(--apex-textarea-border-radius, 4px);transition:border 1s;padding:12px}.textArea.disabled{opacity:.8;cursor:not-allowed;border:var(--apex-textarea-border-disabled, 1px dashed #F2F2F2)}.textArea .container{height:100%;display:flex;position:relative;box-sizing:border-box}.container apex-img{width:16px;height:16px;display:flex;justify-content:center;align-items:center;transition:all .2s;z-index:2;margin-right:12px}.container apex-img svg path{fill:var(--apex-textarea-icon-fill, #C6C6C6)}.textArea textarea{width:100%;height:100%;position:relative;resize:none;border:none;outline:none;background-color:var(--apex-textarea-background-color, transparent);color:var(--apex-textarea-text-color, #0B1222);font-size:14px;padding:0}textarea::placeholder{color:var(--apex-textarea-text-placeholder-color, #C6C6C6)}.textArea.disabled{cursor:not-allowed}.textArea.invalid{border:var(--apex-textarea-border-invalid, 1px solid #F96138)}.textArea.invalid+.footer,.textArea.disabled+.footer{color:var(--apex-textarea-footer-color, #F96138)}textarea::-webkit-scrollbar{width:8px;padding:8px}textarea::-webkit-scrollbar-thumb{background-color:var(--apex-textarea-scrollbar-color, #E2E2E2bb);border-radius:25px}textarea::-webkit-scrollbar-thumb:hover{background-color:var(--apex-textarea-scrollbar-hover-color, #e2e2e2)}textarea::-webkit-scrollbar-button{display:none}.footer{height:14px;font-size:12px;margin-top:2px}\n"] }]
70
+ ], template: "@if (options) {\n @if (options.label !== '') {\n <div class=\"header\">\n <label> {{ options.label }}</label>\n </div>\n }\n\n @if (!options.formGroup) {\n <div class=\"textArea\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [alt]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea [placeholder]=\"options.placeholder ? options.placeholder : ''\" autocomplete=\"off\" (input)=\"onInput($event)\"></textarea>\n </div>\n </div>\n }\n\n @if (options.formGroup && options.formControlName) {\n <div class=\"textArea\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': controlInvalid, 'disabled': control.disabled }\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [alt]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea autocomplete=\"off\" [placeholder]=\"options.placeholder ? options.placeholder : ''\" [formControlName]=\"options.formControlName\"></textarea>\n </div>\n </div>\n\n <div class=\"footer\">\n {{ controlError }}\n </div>\n }\n}\n", styles: [":host{display:block;touch-action:manipulation}:host(.fluid) .textArea{width:100%}.header{width:100%;min-height:20px;display:flex;align-items:center;justify-content:space-between;column-gap:4px;color:var(--apex-textarea-header-color, #0B1222);text-wrap:nowrap;margin-bottom:2px}label{font-size:14px;font-weight:600;text-wrap:wrap;margin-right:4px}.label-wrapper{display:flex;align-items:center}.textArea{width:264px;height:100px;display:inline-block;box-sizing:border-box;background-color:var(--apex-textarea-background-color, transparent);border:var(--apex-textarea-border, 1px solid #E9E9E9);border-radius:var(--apex-textarea-border-radius, 4px);transition:border 1s;padding:12px}.textArea.disabled{opacity:.8;cursor:not-allowed;border:var(--apex-textarea-border-disabled, 1px dashed #F2F2F2)}.textArea .container{height:100%;display:flex;position:relative;box-sizing:border-box}.container apex-img{width:16px;height:16px;display:flex;justify-content:center;align-items:center;transition:all .2s;z-index:2;margin-right:12px}.container apex-img svg path{fill:var(--apex-textarea-icon-fill, #C6C6C6)}.textArea textarea{width:100%;height:100%;position:relative;resize:none;border:none;outline:none;background-color:var(--apex-textarea-background-color, transparent);color:var(--apex-textarea-text-color, #0B1222);font-size:14px;padding:0}textarea::placeholder{color:var(--apex-textarea-text-placeholder-color, #C6C6C6)}.textArea.disabled{cursor:not-allowed}.textArea.invalid{border:var(--apex-textarea-border-invalid, 1px solid #F96138)}.textArea.invalid+.footer,.textArea.disabled+.footer{color:var(--apex-textarea-footer-color, #F96138)}textarea::-webkit-scrollbar{width:8px;padding:8px}textarea::-webkit-scrollbar-thumb{background-color:var(--apex-textarea-scrollbar-color, #E2E2E2bb);border-radius:25px}textarea::-webkit-scrollbar-thumb:hover{background-color:var(--apex-textarea-scrollbar-hover-color, #e2e2e2)}textarea::-webkit-scrollbar-button{display:none}.footer{height:14px;font-size:12px;margin-top:2px}\n"] }]
71
71
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { options: [{
72
72
  type: Input
73
73
  }], textAreaChange: [{
@@ -1 +1 @@
1
- {"version":3,"file":"apexara-ng-components-textarea.mjs","sources":["../../../../projects/apexara/ng-components/textarea/src/textarea.component.ts","../../../../projects/apexara/ng-components/textarea/src/textarea.component.html","../../../../projects/apexara/ng-components/textarea/apexara-ng-components-textarea.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef } from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport { AbstractControl, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';\n\nimport { Subscription } from 'rxjs';\n\nimport { ApexImageComponent } from '@apexara/ng-components/image';\n\nimport { ApexControlErrors } from '@apexara/ng-components/input';\n\nexport interface ApexTextAreaOptions {\n label: string;\n icon?: string;\n placeholder?: string;\n formGroup?: FormGroup;\n formControlName?: string;\n errors?: ApexControlErrors;\n}\n\n@Component({\n selector: 'apex-textarea',\n templateUrl: './textarea.component.html',\n styleUrls: ['./textarea.component.css'],\n imports: [\n NgClass,\n FormsModule,\n ApexImageComponent,\n ReactiveFormsModule,\n ],\n})\n\nexport class ApexTextAreaComponent {\n\n constructor(private changeDetectorRef: ChangeDetectorRef) {\n this.changeDetectorRef.detach();\n }\n\n @Input() options!: ApexTextAreaOptions;\n\n @Output() textAreaChange = new EventEmitter<string>();\n\n public controlError!: string;\n public controlInvalid = false;\n public control!: AbstractControl;\n\n private controlSubscription!: Subscription;\n\n public ngOnInit(): void {\n this.setControl();\n\n this.changeDetectorRef.detectChanges();\n }\n\n public ngOnDestroy(): void {\n if (this.controlSubscription) {\n this.controlSubscription.unsubscribe();\n }\n }\n\n public onInput(event: Event): void {\n const input = event.target as HTMLTextAreaElement;\n\n const sanitizedValue = input.value.replace(/([\\u2700-\\u27BF]|[\\uE000-\\uF8FF]|[\\uD83C-\\uDBFF\\uDC00-\\uDFFF])/g, '');\n \n input.value = sanitizedValue;\n \n this.textAreaChange.emit(sanitizedValue);\n\n this.changeDetectorRef.detectChanges();\n }\n\n private setControl(): void{\n if (!this.options.formGroup || !this.options.formControlName) {\n return;\n }\n\n this.control = this.options.formGroup.controls[this.options.formControlName];\n\n this.control.markAsTouched();\n\n this.controlSubscription = this.control.statusChanges.subscribe(() => {\n this.setControlInvalid(this.control);\n\n this.getErrors();\n\n this.changeDetectorRef.detectChanges();\n })\n }\n\n private setControlInvalid(control: AbstractControl): void {\n this.controlInvalid = control.touched && control.invalid;\n }\n\n private getErrors(): void {\n const options = this.options!;\n const formGroup = options.formGroup;\n const formControlName = options.formControlName;\n\n if (formGroup && formControlName && options.errors && this.controlInvalid) {\n\n for (const error in options.errors) {\n if (formGroup.controls[formControlName].hasError(error)) {\n this.controlError = options.errors[error];\n\n return;\n }\n }\n\n }\n\n this.controlError = '';\n }\n\n}\n","@if (options) {\n @if (options.label !== '') {\n <div class=\"header\">\n <label> {{ options.label }}</label>\n </div>\n }\n\n @if (!options.formGroup) {\n <div class=\"textArea\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [ariaLabel]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea [placeholder]=\"options.placeholder ? options.placeholder : ''\" autocomplete=\"off\" (input)=\"onInput($event)\"></textarea>\n </div>\n </div>\n }\n\n @if (options.formGroup && options.formControlName) {\n <div class=\"textArea\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': controlInvalid, 'disabled': control.disabled }\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [ariaLabel]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea autocomplete=\"off\" [placeholder]=\"options.placeholder ? options.placeholder : ''\" [formControlName]=\"options.formControlName\"></textarea>\n </div>\n </div>\n\n <div class=\"footer\">\n {{ controlError }}\n </div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA+Ba,qBAAqB,CAAA;AAEhC,IAAA,WAAA,CAAoB,iBAAoC,EAAA;QAApC,IAAA,CAAA,iBAAiB,GAAjB,iBAAiB;AAM3B,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,YAAY,EAAU;QAG9C,IAAA,CAAA,cAAc,GAAG,KAAK;AAR3B,QAAA,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE;IACjC;IAYO,QAAQ,GAAA;QACb,IAAI,CAAC,UAAU,EAAE;AAEjB,QAAA,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE;IACxC;IAEO,WAAW,GAAA;AAChB,QAAA,IAAI,IAAI,CAAC,mBAAmB,EAAE;AAC5B,YAAA,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE;QACxC;IACF;AAEO,IAAA,OAAO,CAAC,KAAY,EAAA;AACzB,QAAA,MAAM,KAAK,GAAG,KAAK,CAAC,MAA6B;AAEjD,QAAA,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,iEAAiE,EAAE,EAAE,CAAC;AAEjH,QAAA,KAAK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A,aAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAIV,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAZjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,OAAA,EAGhB;wBACP,OAAO;wBACP,WAAW;wBACX,kBAAkB;wBAClB,mBAAmB;AACpB,qBAAA,EAAA,QAAA,EAAA,g2CAAA,EAAA,MAAA,EAAA,CAAA,g+DAAA,CAAA,EAAA;;sBASA;;sBAEA;;;AEvCH;;AAEG;;;;"}
1
+ {"version":3,"file":"apexara-ng-components-textarea.mjs","sources":["../../../../projects/apexara/ng-components/textarea/src/textarea.component.ts","../../../../projects/apexara/ng-components/textarea/src/textarea.component.html","../../../../projects/apexara/ng-components/textarea/apexara-ng-components-textarea.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef } from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport { AbstractControl, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';\n\nimport { Subscription } from 'rxjs';\n\nimport { ApexImageComponent } from '@apexara/ng-components/image';\n\nimport { ApexControlErrors } from '@apexara/ng-components/input';\n\nexport interface ApexTextAreaOptions {\n label: string;\n icon?: string;\n placeholder?: string;\n formGroup?: FormGroup;\n formControlName?: string;\n errors?: ApexControlErrors;\n}\n\n@Component({\n selector: 'apex-textarea',\n templateUrl: './textarea.component.html',\n styleUrls: ['./textarea.component.css'],\n imports: [\n NgClass,\n FormsModule,\n ApexImageComponent,\n ReactiveFormsModule,\n ],\n})\n\nexport class ApexTextAreaComponent {\n\n constructor(private changeDetectorRef: ChangeDetectorRef) {\n this.changeDetectorRef.detach();\n }\n\n @Input() options!: ApexTextAreaOptions;\n\n @Output() textAreaChange = new EventEmitter<string>();\n\n public controlError!: string;\n public controlInvalid = false;\n public control!: AbstractControl;\n\n private controlSubscription!: Subscription;\n\n public ngOnInit(): void {\n this.setControl();\n\n this.changeDetectorRef.detectChanges();\n }\n\n public ngOnDestroy(): void {\n if (this.controlSubscription) {\n this.controlSubscription.unsubscribe();\n }\n }\n\n public onInput(event: Event): void {\n const input = event.target as HTMLTextAreaElement;\n\n const sanitizedValue = input.value.replace(/([\\u2700-\\u27BF]|[\\uE000-\\uF8FF]|[\\uD83C-\\uDBFF\\uDC00-\\uDFFF])/g, '');\n \n input.value = sanitizedValue;\n \n this.textAreaChange.emit(sanitizedValue);\n\n this.changeDetectorRef.detectChanges();\n }\n\n private setControl(): void{\n if (!this.options.formGroup || !this.options.formControlName) {\n return;\n }\n\n this.control = this.options.formGroup.controls[this.options.formControlName];\n\n this.control.markAsTouched();\n\n this.controlSubscription = this.control.statusChanges.subscribe(() => {\n this.setControlInvalid(this.control);\n\n this.getErrors();\n\n this.changeDetectorRef.detectChanges();\n })\n }\n\n private setControlInvalid(control: AbstractControl): void {\n this.controlInvalid = control.touched && control.invalid;\n }\n\n private getErrors(): void {\n const options = this.options!;\n const formGroup = options.formGroup;\n const formControlName = options.formControlName;\n\n if (formGroup && formControlName && options.errors && this.controlInvalid) {\n\n for (const error in options.errors) {\n if (formGroup.controls[formControlName].hasError(error)) {\n this.controlError = options.errors[error];\n\n return;\n }\n }\n\n }\n\n this.controlError = '';\n }\n\n}\n","@if (options) {\n @if (options.label !== '') {\n <div class=\"header\">\n <label> {{ options.label }}</label>\n </div>\n }\n\n @if (!options.formGroup) {\n <div class=\"textArea\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [alt]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea [placeholder]=\"options.placeholder ? options.placeholder : ''\" autocomplete=\"off\" (input)=\"onInput($event)\"></textarea>\n </div>\n </div>\n }\n\n @if (options.formGroup && options.formControlName) {\n <div class=\"textArea\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': controlInvalid, 'disabled': control.disabled }\">\n <div class=\"container\">\n @if (options.icon) {\n <apex-img class=\"icon\" [src]=\"'assets/img/' + options.icon\" [alt]=\"'textarea icon'\"></apex-img>\n }\n\n <textarea autocomplete=\"off\" [placeholder]=\"options.placeholder ? options.placeholder : ''\" [formControlName]=\"options.formControlName\"></textarea>\n </div>\n </div>\n\n <div class=\"footer\">\n {{ controlError }}\n </div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA+Ba,qBAAqB,CAAA;AAEhC,IAAA,WAAA,CAAoB,iBAAoC,EAAA;QAApC,IAAA,CAAA,iBAAiB,GAAjB,iBAAiB;AAM3B,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,YAAY,EAAU;QAG9C,IAAA,CAAA,cAAc,GAAG,KAAK;AAR3B,QAAA,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE;IACjC;IAYO,QAAQ,GAAA;QACb,IAAI,CAAC,UAAU,EAAE;AAEjB,QAAA,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE;IACxC;IAEO,WAAW,GAAA;AAChB,QAAA,IAAI,IAAI,CAAC,mBAAmB,EAAE;AAC5B,YAAA,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE;QACxC;IACF;AAEO,IAAA,OAAO,CAAC,KAAY,EAAA;AACzB,QAAA,MAAM,KAAK,GAAG,KAAK,CAAC,MAA6B;AAEjD,QAAA,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,iEAAiE,EAAE,EAAE,CAAC;AAEjH,QAAA,K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EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAIV,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAZjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,OAAA,EAGhB;wBACP,OAAO;wBACP,WAAW;wBACX,kBAAkB;wBAClB,mBAAmB;AACpB,qBAAA,EAAA,QAAA,EAAA,o1CAAA,EAAA,MAAA,EAAA,CAAA,g+DAAA,CAAA,EAAA;;sBASA;;sBAEA;;;AEvCH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexara/ng-components",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/animations": ">=20 <22",
@@ -25,7 +25,7 @@ declare class ApexImageComponent {
25
25
  private changeDetectorRef;
26
26
  constructor(element: ElementRef, renderer: Renderer2, imgService: ApexImgService, document: Document, changeDetectorRef: ChangeDetectorRef);
27
27
  src: string;
28
- ariaLabel: string;
28
+ alt: string;
29
29
  private helper;
30
30
  ngOnInit(): void;
31
31
  ngOnDestroy(): void;
@@ -34,13 +34,13 @@ declare class ApexImageComponent {
34
34
  private destroy;
35
35
  private initImage;
36
36
  private initSvg;
37
- private setAriaLabel;
37
+ private setAlt;
38
38
  private setStyling;
39
39
  private onImgError;
40
40
  private copyNgContentAttribute;
41
41
  private setNgContentAttribute;
42
42
  static ɵfac: i0.ɵɵFactoryDeclaration<ApexImageComponent, never>;
43
- static ɵcmp: i0.ɵɵComponentDeclaration<ApexImageComponent, "apex-img", never, { "src": { "alias": "src"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; }, {}, never, ["*"], true, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<ApexImageComponent, "apex-img", never, { "src": { "alias": "src"; "required": false; }; "alt": { "alias": "alt"; "required": false; }; }, {}, never, ["*"], true, never>;
44
44
  }
45
45
 
46
46
  export { ApexImageComponent, ApexImgService };