rd-outer-component 0.0.72 → 0.0.74

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.
@@ -247,13 +247,13 @@ function numberToBig(value, precision = 6, mode = 'cut') {
247
247
 
248
248
  const translations = {
249
249
  en: {
250
- pleaseEnter: 'Please enter',
251
- lengthCannotBeLess: 'Length cannot be less than the minimum length',
252
- lengthCannotExceed: 'Length cannot exceed the maximum length',
250
+ pleaseEnter: 'Please enter ',
251
+ lengthCannotBeLess: ' Length cannot be less than the minimum length ',
252
+ lengthCannotExceed: ' Length cannot exceed the maximum length ',
253
253
  validationFailed: 'Validation failed',
254
- cannotBeLessThan: 'cannot be less than the minimum value',
255
- cannotExceed: 'cannot exceed the maximum value',
256
- maxDecimalPlaces: 'The maximum number of decimal places is',
254
+ cannotBeLessThan: ' cannot be less than the minimum value ',
255
+ cannotExceed: ' cannot exceed the maximum value ',
256
+ maxDecimalPlaces: 'The maximum number of decimal places is ',
257
257
  clearFilter: 'Clear filter',
258
258
  },
259
259
  zh: {
@@ -282,22 +282,22 @@ class CustomInputComponent {
282
282
  switch (firstError) {
283
283
  case 'required':
284
284
  return (msg ||
285
- `${getTranslation(this.lang, 'pleaseEnter')} ${this.label.toLowerCase()}`);
285
+ `${getTranslation(this.lang, 'pleaseEnter')}${this.label.toLowerCase()}`);
286
286
  case 'min':
287
287
  return (msg ||
288
- `${this.label} ${getTranslation(this.lang, 'cannotBeLessThan')} ${formatBigNumber(this.min)}`);
288
+ `${this.label}${getTranslation(this.lang, 'cannotBeLessThan')}${formatBigNumber(this.min)}`);
289
289
  case 'max':
290
290
  return (msg ||
291
- `${this.label} ${getTranslation(this.lang, 'cannotExceed')} ${formatBigNumber(this.max)}`);
291
+ `${this.label} ${getTranslation(this.lang, 'cannotExceed')}${formatBigNumber(this.max)}`);
292
292
  case 'precision':
293
293
  return (msg ||
294
- `${getTranslation(this.lang, 'maxDecimalPlaces')} ${this.maskNumber}`);
294
+ `${getTranslation(this.lang, 'maxDecimalPlaces')}${this.maskNumber}`);
295
295
  case 'minLength':
296
296
  return (msg ||
297
- `${getTranslation(this.lang, 'lengthCannotBeLess')} ${this.minLength}`);
297
+ `${getTranslation(this.lang, 'lengthCannotBeLess')}${this.minLength}`);
298
298
  case 'maxLength':
299
299
  return (msg ||
300
- `${getTranslation(this.lang, 'lengthCannotExceed')} ${this.maxLength}`);
300
+ `${getTranslation(this.lang, 'lengthCannotExceed')}${this.maxLength}`);
301
301
  case 'custom':
302
302
  return (((_c = this.control) === null || _c === void 0 ? void 0 : _c.errors['custom']) ||
303
303
  getTranslation(this.lang, 'validationFailed'));
@@ -538,16 +538,20 @@ class CustomTextareaComponent {
538
538
  const msg = this.errorMessages[firstError];
539
539
  switch (firstError) {
540
540
  case 'required':
541
- return msg || `Please enter ${this.label.toLowerCase()}`;
541
+ return (msg ||
542
+ `${getTranslation(this.lang, 'pleaseEnter')}${this.label.toLowerCase()}`);
542
543
  case 'minLength':
543
544
  return (msg ||
544
- `Length cannot be less than the minimum length ${this.minLength}`);
545
+ `${getTranslation(this.lang, 'lengthCannotBeLess')}${this.minLength}`);
545
546
  case 'maxLength':
546
- return (msg || `Length cannot exceed the maximum length ${this.maxLength}`);
547
+ return (msg ||
548
+ `${getTranslation(this.lang, 'lengthCannotExceed')}${this.maxLength}`);
547
549
  case 'custom':
548
- return ((_c = this.control) === null || _c === void 0 ? void 0 : _c.errors['custom']) || 'Validation failed';
550
+ return (((_c = this.control) === null || _c === void 0 ? void 0 : _c.errors['custom']) ||
551
+ getTranslation(this.lang, 'validationFailed'));
549
552
  default:
550
- return this.errorMessages[firstError] || 'Validation failed';
553
+ return (this.errorMessages[firstError] ||
554
+ getTranslation(this.lang, 'validationFailed'));
551
555
  }
552
556
  }
553
557
  get showError() {
@@ -556,6 +560,7 @@ class CustomTextareaComponent {
556
560
  }
557
561
  constructor(cdr) {
558
562
  this.cdr = cdr;
563
+ this.lang = 'en';
559
564
  this.label = '';
560
565
  this.name = '';
561
566
  this.disabled = false;
@@ -648,7 +653,7 @@ class CustomTextareaComponent {
648
653
  }
649
654
  }
650
655
  CustomTextareaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomTextareaComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
651
- 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: [
656
+ 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: [
652
657
  {
653
658
  provide: NG_VALUE_ACCESSOR,
654
659
  useExisting: forwardRef(() => CustomTextareaComponent),
@@ -674,7 +679,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
674
679
  multi: true,
675
680
  },
676
681
  ], 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"] }]
677
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { label: [{
682
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { lang: [{
683
+ type: Input
684
+ }], label: [{
678
685
  type: Input
679
686
  }], name: [{
680
687
  type: Input
@@ -751,16 +758,16 @@ class CustomInputAmountComponent {
751
758
  switch (firstError) {
752
759
  case 'required':
753
760
  return (msg ||
754
- `${getTranslation(this.lang, 'pleaseEnter')} ${this.label.toLowerCase()}`);
761
+ `${getTranslation(this.lang, 'pleaseEnter')}${this.label.toLowerCase()}`);
755
762
  case 'min':
756
763
  return (msg ||
757
- `${this.label} ${getTranslation(this.lang, 'cannotBeLessThan')} ${formatBigNumber(this.min)}`);
764
+ `${this.label}${getTranslation(this.lang, 'cannotBeLessThan')}${formatBigNumber(this.min)}`);
758
765
  case 'max':
759
766
  return (msg ||
760
- `${this.label} ${getTranslation(this.lang, 'cannotExceed')} ${formatBigNumber(this.max)}`);
767
+ `${this.label} ${getTranslation(this.lang, 'cannotExceed')}${formatBigNumber(this.max)}`);
761
768
  case 'precision':
762
769
  return (msg ||
763
- `${getTranslation(this.lang, 'maxDecimalPlaces')} ${this.nzPrecision}`);
770
+ `${getTranslation(this.lang, 'maxDecimalPlaces')}${this.nzPrecision}`);
764
771
  case 'custom':
765
772
  return (((_c = this.control) === null || _c === void 0 ? void 0 : _c.errors['custom']) ||
766
773
  getTranslation(this.lang, 'validationFailed'));
@@ -1081,7 +1088,7 @@ class CustomSelectComponent {
1081
1088
  switch (firstError) {
1082
1089
  case 'required':
1083
1090
  return (msg ||
1084
- `${getTranslation(this.lang, 'pleaseEnter')} ${this.label.toLowerCase()}`);
1091
+ `${getTranslation(this.lang, 'pleaseEnter')}${this.label.toLowerCase()}`);
1085
1092
  case 'custom':
1086
1093
  return (((_c = this.control) === null || _c === void 0 ? void 0 : _c.errors['custom']) ||
1087
1094
  getTranslation(this.lang, 'validationFailed'));