rd-outer-component 0.0.72 → 0.0.73
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/esm2020/lib/modules/custom-textarea/custom-textarea.component.mjs +16 -8
- package/fesm2015/rd-outer-component.mjs +14 -7
- package/fesm2015/rd-outer-component.mjs.map +1 -1
- package/fesm2020/rd-outer-component.mjs +14 -7
- package/fesm2020/rd-outer-component.mjs.map +1 -1
- package/lib/modules/custom-textarea/custom-textarea.component.d.ts +2 -1
- package/package.json +1 -1
|
@@ -532,16 +532,20 @@ class CustomTextareaComponent {
|
|
|
532
532
|
const msg = this.errorMessages[firstError];
|
|
533
533
|
switch (firstError) {
|
|
534
534
|
case 'required':
|
|
535
|
-
return msg ||
|
|
535
|
+
return (msg ||
|
|
536
|
+
`${getTranslation(this.lang, 'pleaseEnter')} ${this.label.toLowerCase()}`);
|
|
536
537
|
case 'minLength':
|
|
537
538
|
return (msg ||
|
|
538
|
-
|
|
539
|
+
`${getTranslation(this.lang, 'lengthCannotBeLess')} ${this.minLength}`);
|
|
539
540
|
case 'maxLength':
|
|
540
|
-
return (msg ||
|
|
541
|
+
return (msg ||
|
|
542
|
+
`${getTranslation(this.lang, 'lengthCannotExceed')} ${this.maxLength}`);
|
|
541
543
|
case 'custom':
|
|
542
|
-
return this.control?.errors['custom'] ||
|
|
544
|
+
return (this.control?.errors['custom'] ||
|
|
545
|
+
getTranslation(this.lang, 'validationFailed'));
|
|
543
546
|
default:
|
|
544
|
-
return this.errorMessages[firstError] ||
|
|
547
|
+
return (this.errorMessages[firstError] ||
|
|
548
|
+
getTranslation(this.lang, 'validationFailed'));
|
|
545
549
|
}
|
|
546
550
|
}
|
|
547
551
|
get showError() {
|
|
@@ -549,6 +553,7 @@ class CustomTextareaComponent {
|
|
|
549
553
|
}
|
|
550
554
|
constructor(cdr) {
|
|
551
555
|
this.cdr = cdr;
|
|
556
|
+
this.lang = 'en';
|
|
552
557
|
this.label = '';
|
|
553
558
|
this.name = '';
|
|
554
559
|
this.disabled = false;
|
|
@@ -640,7 +645,7 @@ class CustomTextareaComponent {
|
|
|
640
645
|
}
|
|
641
646
|
}
|
|
642
647
|
CustomTextareaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomTextareaComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
643
|
-
CustomTextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomTextareaComponent, selector: "app-rd-textarea", inputs: { label: "label", name: "name", disabled: "disabled", required: "required", minLength: "minLength", maxLength: "maxLength", pattern: "pattern", customValidator: "customValidator", nzAutosize: "nzAutosize", errorMessages: "errorMessages" }, outputs: { valueChange: "valueChange", focus: "focus", blur: "blur" }, providers: [
|
|
648
|
+
CustomTextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomTextareaComponent, selector: "app-rd-textarea", inputs: { lang: "lang", label: "label", name: "name", disabled: "disabled", required: "required", minLength: "minLength", maxLength: "maxLength", pattern: "pattern", customValidator: "customValidator", nzAutosize: "nzAutosize", errorMessages: "errorMessages" }, outputs: { valueChange: "valueChange", focus: "focus", blur: "blur" }, providers: [
|
|
644
649
|
{
|
|
645
650
|
provide: NG_VALUE_ACCESSOR,
|
|
646
651
|
useExisting: forwardRef(() => CustomTextareaComponent),
|
|
@@ -666,7 +671,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
666
671
|
multi: true,
|
|
667
672
|
},
|
|
668
673
|
], template: "<div>\n <div\n class=\"rd-form-item rd-form-textarea\"\n [ngClass]=\"{ disabled: disabled, error: showError }\"\n >\n <textarea\n nz-input\n nzBorderless\n [name]=\"name\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"handleValueChange($event)\"\n (blur)=\"onBlur()\"\n [nzAutosize]=\"nzAutosize\"\n placeholder=\" \"\n class=\"rd-form-item-input\"\n ></textarea>\n <div class=\"rd-form-item-label\">{{ label }}</div>\n </div>\n <div *ngIf=\"showError\" class=\"rd-form-item-error\">\n <img *ngIf=\"currentErrorMessage\" src=\"/assets/img/icon/icon-error.svg\" />\n {{ currentErrorMessage }}\n </div>\n</div>\n", styles: [":host .rd-form-textarea{height:auto;min-height:64px}:host .rd-form-textarea .rd-form-item-input{position:static;line-height:1.5;min-height:58px}:host .rd-form-textarea .rd-form-item-input:focus,:host .rd-form-textarea .rd-form-item-input:not(:placeholder-shown){padding-top:28px}\n", ".rd-form-item{position:relative;border-radius:4px;padding:2px 0;border:1px solid #e5e7eb;background-color:#fff;width:100%;height:64px}.rd-form-item .rd-form-item-select-icon{position:absolute;right:12px;top:50%;transform:translateY(-50%);width:16px;height:16px;pointer-events:none}.rd-form-item-label{position:absolute;left:16px;top:50%;transform:translateY(-50%);color:#6b7280;transition:all .3s ease;pointer-events:none;z-index:1;font-size:14px;font-weight:600;line-height:1}.rd-form-item-input{color:#030712;font-size:14px;width:100%;font-weight:500;padding:22px 16px 12px;height:52px}.rd-form-item-input:focus,.rd-form-item-input:not(:placeholder-shown){top:10px}.rd-form-item .rd-form-item-input:focus~.rd-form-item-label,.rd-form-item .rd-form-item-input:not(:placeholder-shown)~.rd-form-item-label{top:18px;font-size:12px}.rd-form-item-select{width:100%}.rd-form-item-select ::ng-deep .ant-select-selection-item{color:#030712;font-size:14px;font-weight:500}.rd-form-item.rd-selected .rd-form-item-label{top:16px;font-size:12px}.rd-form-item.rd-selected .rd-form-item-select{top:10px}.rd-form-item.rd-disabled{background-color:#f3f4f6;border-color:#d1d5db}.rd-form-item.rd-disabled .rd-form-item-label,.rd-form-item.rd-disabled .rd-form-item-input{color:#9ca3af}.rd-form-item.rd-disabled ::ng-deep .ant-select-selection-item{color:#9ca3af}.rd-form-item.rd-error{border-color:#e51c36}.rd-form-item-error{color:#d2152e;font-size:12px;font-weight:500;display:flex;align-items:center;gap:4px;margin-top:4px}.rd-form-item-error img{width:16px}.rd-form-number-item{position:relative;border-radius:4px;padding:12px 16px;background-color:#fff;border:1px solid #e5e7eb;width:100%}.rd-form-number-item .rd-item-label{color:#6b7280;font-size:12px;font-weight:600}.rd-form-number-item .rd-item-content{display:flex;align-items:center;font-size:32px;font-weight:600;line-height:48px;color:#9ca3af}.rd-form-number-item .rd-item-content-value{flex:1;font-size:32px;font-weight:600;line-height:48px;color:#030712;border:none;padding:4px 0}.rd-form-number-item .rd-item-content-value:focus,.rd-form-number-item .rd-item-content-value:active,.rd-form-number-item .rd-item-content-value:hover{outline:none;box-shadow:none}.rd-form-number-item .rd-item-content-value ::ng-deep .ant-input-number-handler-wrap{display:none}.rd-form-number-item .rd-item-content-value ::ng-deep .ant-input-number-input{font-size:32px;font-weight:600;line-height:48px}.rd-form-number-item .rd-item-content-value ::ng-deep .ant-input-number-input::placeholder{color:#9ca3af}.rd-form-number-item .rd-item-content-symbol{flex-shrink:0}.rd-form-number-item ::ng-deep .rd-item-warning{font-weight:500;font-size:12px;color:#6b7280;margin-top:4px;padding:0 12px}.rd-form-number-item.rd-disabled{background-color:#f3f4f6;border-color:#d1d5db}.rd-form-number-item.rd-disabled .rd-item-label,.rd-form-number-item.rd-disabled .rd-item-content-value{color:#9ca3af}.rd-form-number-item.rd-error{border-color:#e51c36}\n"] }]
|
|
669
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: {
|
|
674
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { lang: [{
|
|
675
|
+
type: Input
|
|
676
|
+
}], label: [{
|
|
670
677
|
type: Input
|
|
671
678
|
}], name: [{
|
|
672
679
|
type: Input
|