@miden-npm/angular 0.0.27 → 0.0.29
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.
|
@@ -593,6 +593,7 @@ class InputComponent {
|
|
|
593
593
|
disabled = false;
|
|
594
594
|
loading = false;
|
|
595
595
|
showCopyIcon = false;
|
|
596
|
+
preventPaste = false; // NEW
|
|
596
597
|
onInputChange = new EventEmitter();
|
|
597
598
|
onInputBlur = new EventEmitter();
|
|
598
599
|
constructor() { }
|
|
@@ -604,9 +605,12 @@ class InputComponent {
|
|
|
604
605
|
copyHandler() {
|
|
605
606
|
this.copyToClipboard(this.value)
|
|
606
607
|
.then(() => {
|
|
608
|
+
// Clear any previous error and show hint
|
|
609
|
+
this.validationError = '';
|
|
607
610
|
this.hint = 'Text copied to clipboard';
|
|
608
611
|
})
|
|
609
612
|
.catch(() => {
|
|
613
|
+
this.hint = '';
|
|
610
614
|
this.validationError = 'Failed to copy text to clipboard';
|
|
611
615
|
});
|
|
612
616
|
}
|
|
@@ -636,6 +640,14 @@ class InputComponent {
|
|
|
636
640
|
restrictToNumericKeys(event);
|
|
637
641
|
}
|
|
638
642
|
}
|
|
643
|
+
onPaste(event) {
|
|
644
|
+
if (this.preventPaste) {
|
|
645
|
+
event.preventDefault();
|
|
646
|
+
// Clear any previous hint and set error
|
|
647
|
+
this.hint = '';
|
|
648
|
+
this.validationError = 'Pasting is disabled for this input';
|
|
649
|
+
}
|
|
650
|
+
}
|
|
639
651
|
registerOnChange(fn) {
|
|
640
652
|
this.onChange = fn;
|
|
641
653
|
}
|
|
@@ -643,13 +655,13 @@ class InputComponent {
|
|
|
643
655
|
this.onTouched = fn;
|
|
644
656
|
}
|
|
645
657
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
646
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", type: InputComponent, isStandalone: true, selector: "base-input", inputs: { label: "label", type: "type", placeholder: "placeholder", validationError: "validationError", hint: "hint", mask: "mask", rules: "rules", isAmountInput: "isAmountInput", required: "required", disabled: "disabled", loading: "loading", showCopyIcon: "showCopyIcon" }, outputs: { onInputChange: "onInputChange", onInputBlur: "onInputBlur" }, providers: [
|
|
658
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", type: InputComponent, isStandalone: true, selector: "base-input", inputs: { label: "label", type: "type", placeholder: "placeholder", validationError: "validationError", hint: "hint", mask: "mask", rules: "rules", isAmountInput: "isAmountInput", required: "required", disabled: "disabled", loading: "loading", showCopyIcon: "showCopyIcon", preventPaste: "preventPaste" }, outputs: { onInputChange: "onInputChange", onInputBlur: "onInputBlur" }, providers: [
|
|
647
659
|
{
|
|
648
660
|
provide: NG_VALUE_ACCESSOR,
|
|
649
661
|
useExisting: forwardRef(() => InputComponent),
|
|
650
662
|
multi: true,
|
|
651
663
|
},
|
|
652
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <div\n class=\"border-c px-3 py-2 flex items-center justify-between rounded-md h-12\"\n [ngClass]=\"[\n disabled ? 'bg-grey-50 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300 bg-red-50' : 'border-grey-100',\n ]\"\n >\n <ng-content select=\"[slot=prefix]\"></ng-content>\n <input\n [type]=\"type\"\n [imask]=\"mask ? { mask, lazy: true } : undefined\"\n [unmask]=\"mask ? 'typed' : false\"\n [(ngModel)]=\"formattedValue\"\n [disabled]=\"disabled\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n [placeholder]=\"placeholder ? placeholder : 'Enter ' + label.toLowerCase()\"\n inputmode=\"decimal\"\n class=\"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full\"\n />\n\n @if (!loading) {\n <ng-container>\n <ng-content select=\"[slot=suffix]\"></ng-content>\n <!-- Copy icon -->\n @if (showCopyIcon && value && value.trim() !== '') {\n <div class=\"ml-2 flex items-center\">\n <base-image\n src=\"assets/images/copyIcon.svg\"\n alt=\"copy\"\n [width]=\"16\"\n [height]=\"16\"\n class=\"cursor-pointer hover:opacity-70 transition-opacity\"\n (onClick)=\"copyHandler()\"\n ></base-image>\n </div>\n }\n </ng-container>\n } @else {\n <ng-template>\n <icon-loader></icon-loader>\n </ng-template>\n }\n </div>\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n", styles: [":host{--select-placeholder-color: #9dbfde}:host .search-input::placeholder{color:var(--select-placeholder-color);opacity:1}:host .search-input::-webkit-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-moz-placeholder{color:var(--select-placeholder-color)}:host .search-input:-ms-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-ms-input-placeholder{color:var(--select-placeholder-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconLoaderComponent, selector: "icon-loader", inputs: ["color", "size"] }, { kind: "component", type: HintComponent, selector: "base-hint", inputs: ["hint"] }, { kind: "component", type: InputErrorComponent, selector: "base-input-error", inputs: ["errorMessage"] }, { kind: "component", type: ImageComponent, selector: "base-image", inputs: ["src", "alt", "isFullWidth", "width", "height", "customClass"], outputs: ["onClick"] }, { kind: "ngmodule", type: IMaskModule }, { kind: "directive", type: i2.IMaskDirective, selector: "[imask]", inputs: ["imask", "unmask", "imaskElement"], outputs: ["accept", "complete"], exportAs: ["imask"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
664
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <div\n class=\"border-c px-3 py-2 flex items-center justify-between rounded-md h-12\"\n [ngClass]=\"[\n disabled ? 'bg-grey-50 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300 bg-red-50' : 'border-grey-100',\n ]\"\n >\n <ng-content select=\"[slot=prefix]\"></ng-content>\n\n <input\n [type]=\"type\"\n [imask]=\"mask ? { mask, lazy: true } : undefined\"\n [unmask]=\"mask ? 'typed' : false\"\n [(ngModel)]=\"formattedValue\"\n [disabled]=\"disabled\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n (paste)=\"onPaste($event)\"\n [placeholder]=\"placeholder ? placeholder : 'Enter ' + label.toLowerCase()\"\n [attr.inputmode]=\"isAmountInput ? 'decimal' : null\"\n class=\"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full\"\n />\n\n @if (!loading) {\n <ng-container>\n <ng-content select=\"[slot=suffix]\"></ng-content>\n <!-- Copy icon -->\n @if (showCopyIcon && value && value.trim() !== '') {\n <div class=\"ml-2 flex items-center\">\n <base-image\n src=\"assets/images/copyIcon.svg\"\n alt=\"copy\"\n [width]=\"16\"\n [height]=\"16\"\n class=\"cursor-pointer hover:opacity-70 transition-opacity\"\n (onClick)=\"copyHandler()\"\n ></base-image>\n </div>\n }\n </ng-container>\n } @else {\n <ng-template>\n <icon-loader></icon-loader>\n </ng-template>\n }\n </div>\n\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n", styles: [":host{--select-placeholder-color: #9dbfde}:host .search-input::placeholder{color:var(--select-placeholder-color);opacity:1}:host .search-input::-webkit-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-moz-placeholder{color:var(--select-placeholder-color)}:host .search-input:-ms-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-ms-input-placeholder{color:var(--select-placeholder-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconLoaderComponent, selector: "icon-loader", inputs: ["color", "size"] }, { kind: "component", type: HintComponent, selector: "base-hint", inputs: ["hint"] }, { kind: "component", type: InputErrorComponent, selector: "base-input-error", inputs: ["errorMessage"] }, { kind: "component", type: ImageComponent, selector: "base-image", inputs: ["src", "alt", "isFullWidth", "width", "height", "customClass"], outputs: ["onClick"] }, { kind: "ngmodule", type: IMaskModule }, { kind: "directive", type: i2.IMaskDirective, selector: "[imask]", inputs: ["imask", "unmask", "imaskElement"], outputs: ["accept", "complete"], exportAs: ["imask"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
653
665
|
}
|
|
654
666
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: InputComponent, decorators: [{
|
|
655
667
|
type: Component,
|
|
@@ -667,7 +679,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
|
|
|
667
679
|
useExisting: forwardRef(() => InputComponent),
|
|
668
680
|
multi: true,
|
|
669
681
|
},
|
|
670
|
-
], template: "<div class=\"flex flex-col gap-2\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <div\n class=\"border-c px-3 py-2 flex items-center justify-between rounded-md h-12\"\n [ngClass]=\"[\n disabled ? 'bg-grey-50 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300 bg-red-50' : 'border-grey-100',\n ]\"\n >\n <ng-content select=\"[slot=prefix]\"></ng-content>\n <input\n [type]=\"type\"\n [imask]=\"mask ? { mask, lazy: true } : undefined\"\n [unmask]=\"mask ? 'typed' : false\"\n [(ngModel)]=\"formattedValue\"\n [disabled]=\"disabled\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n [placeholder]=\"placeholder ? placeholder : 'Enter ' + label.toLowerCase()\"\n inputmode=\"decimal\"\n class=\"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full\"\n />\n\n @if (!loading) {\n <ng-container>\n <ng-content select=\"[slot=suffix]\"></ng-content>\n <!-- Copy icon -->\n @if (showCopyIcon && value && value.trim() !== '') {\n <div class=\"ml-2 flex items-center\">\n <base-image\n src=\"assets/images/copyIcon.svg\"\n alt=\"copy\"\n [width]=\"16\"\n [height]=\"16\"\n class=\"cursor-pointer hover:opacity-70 transition-opacity\"\n (onClick)=\"copyHandler()\"\n ></base-image>\n </div>\n }\n </ng-container>\n } @else {\n <ng-template>\n <icon-loader></icon-loader>\n </ng-template>\n }\n </div>\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n", styles: [":host{--select-placeholder-color: #9dbfde}:host .search-input::placeholder{color:var(--select-placeholder-color);opacity:1}:host .search-input::-webkit-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-moz-placeholder{color:var(--select-placeholder-color)}:host .search-input:-ms-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-ms-input-placeholder{color:var(--select-placeholder-color)}\n"] }]
|
|
682
|
+
], template: "<div class=\"flex flex-col gap-2\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <div\n class=\"border-c px-3 py-2 flex items-center justify-between rounded-md h-12\"\n [ngClass]=\"[\n disabled ? 'bg-grey-50 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300 bg-red-50' : 'border-grey-100',\n ]\"\n >\n <ng-content select=\"[slot=prefix]\"></ng-content>\n\n <input\n [type]=\"type\"\n [imask]=\"mask ? { mask, lazy: true } : undefined\"\n [unmask]=\"mask ? 'typed' : false\"\n [(ngModel)]=\"formattedValue\"\n [disabled]=\"disabled\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n (paste)=\"onPaste($event)\"\n [placeholder]=\"placeholder ? placeholder : 'Enter ' + label.toLowerCase()\"\n [attr.inputmode]=\"isAmountInput ? 'decimal' : null\"\n class=\"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full\"\n />\n\n @if (!loading) {\n <ng-container>\n <ng-content select=\"[slot=suffix]\"></ng-content>\n <!-- Copy icon -->\n @if (showCopyIcon && value && value.trim() !== '') {\n <div class=\"ml-2 flex items-center\">\n <base-image\n src=\"assets/images/copyIcon.svg\"\n alt=\"copy\"\n [width]=\"16\"\n [height]=\"16\"\n class=\"cursor-pointer hover:opacity-70 transition-opacity\"\n (onClick)=\"copyHandler()\"\n ></base-image>\n </div>\n }\n </ng-container>\n } @else {\n <ng-template>\n <icon-loader></icon-loader>\n </ng-template>\n }\n </div>\n\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n", styles: [":host{--select-placeholder-color: #9dbfde}:host .search-input::placeholder{color:var(--select-placeholder-color);opacity:1}:host .search-input::-webkit-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-moz-placeholder{color:var(--select-placeholder-color)}:host .search-input:-ms-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-ms-input-placeholder{color:var(--select-placeholder-color)}\n"] }]
|
|
671
683
|
}], ctorParameters: () => [], propDecorators: { label: [{
|
|
672
684
|
type: Input
|
|
673
685
|
}], type: [{
|
|
@@ -692,6 +704,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
|
|
|
692
704
|
type: Input
|
|
693
705
|
}], showCopyIcon: [{
|
|
694
706
|
type: Input
|
|
707
|
+
}], preventPaste: [{
|
|
708
|
+
type: Input
|
|
695
709
|
}], onInputChange: [{
|
|
696
710
|
type: Output
|
|
697
711
|
}], onInputBlur: [{
|
|
@@ -1235,6 +1249,14 @@ class ResourceService {
|
|
|
1235
1249
|
const baseUrl = getBaseUrl(environment);
|
|
1236
1250
|
return this.http.get(`${baseUrl}/api/v1/checkout/networks/${stableCoin}`);
|
|
1237
1251
|
}
|
|
1252
|
+
getMerchantById(merchantId, environment, secretKey) {
|
|
1253
|
+
const baseUrl = getBaseUrl(environment);
|
|
1254
|
+
return this.http.get(`${baseUrl}/api/v1/merchant-by-id/${merchantId}`, {
|
|
1255
|
+
headers: {
|
|
1256
|
+
merchantId: secretKey,
|
|
1257
|
+
},
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1238
1260
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ResourceService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1239
1261
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ResourceService, providedIn: 'root' });
|
|
1240
1262
|
}
|