metag-sdk-ionic 1.2.4 → 1.2.5
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/dist/src/app/pages/id-vision/components/message-modal/message-modal.component.d.ts +4 -1
- package/dist/src/app/pages/id-vision/components/message-modal/message-modal.component.js +23 -12
- package/dist/src/app/pages/id-vision/components/message-modal/message-modal.component.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,10 @@ export declare class MessageModalComponent {
|
|
|
6
6
|
variant: 'dpi' | 'video';
|
|
7
7
|
message: string;
|
|
8
8
|
errorMessages: string[];
|
|
9
|
-
|
|
9
|
+
private readonly fallbackMessage;
|
|
10
|
+
set errors(value: string | string[] | null | undefined);
|
|
11
|
+
get hasErrors(): boolean;
|
|
12
|
+
get effectiveMessage(): string;
|
|
10
13
|
constructor(modalCtrl: ModalController);
|
|
11
14
|
closeModal(): void;
|
|
12
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageModalComponent, never>;
|
|
@@ -42,34 +42,47 @@ function MessageModalComponent_ng_template_9_Template(rf, ctx) { if (rf & 1) {
|
|
|
42
42
|
} if (rf & 2) {
|
|
43
43
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
44
44
|
i0.ɵɵadvance();
|
|
45
|
-
i0.ɵɵtextInterpolate(ctx_r2.
|
|
45
|
+
i0.ɵɵtextInterpolate(ctx_r2.effectiveMessage);
|
|
46
46
|
} }
|
|
47
47
|
export class MessageModalComponent {
|
|
48
48
|
set errors(value) {
|
|
49
49
|
if (Array.isArray(value)) {
|
|
50
|
-
|
|
50
|
+
// Filtra falsy y trims
|
|
51
|
+
this.errorMessages = value.map(v => (v ?? '').trim()).filter(Boolean);
|
|
51
52
|
}
|
|
52
|
-
else if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
else if (typeof value === 'string') {
|
|
54
|
+
const trimmed = value.trim();
|
|
55
|
+
this.errorMessages = trimmed.length
|
|
56
|
+
? (trimmed.includes(',')
|
|
57
|
+
? trimmed.split(',').map(msg => msg.trim()).filter(Boolean)
|
|
58
|
+
: [trimmed])
|
|
59
|
+
: [];
|
|
56
60
|
}
|
|
57
61
|
else {
|
|
58
62
|
this.errorMessages = [];
|
|
59
63
|
}
|
|
60
64
|
}
|
|
65
|
+
get hasErrors() {
|
|
66
|
+
return this.errorMessages.length > 0;
|
|
67
|
+
}
|
|
68
|
+
get effectiveMessage() {
|
|
69
|
+
// Si no hay errores, usa message si viene; si no, el fallback.
|
|
70
|
+
const m = (this.message ?? '').trim();
|
|
71
|
+
return m.length ? m : this.fallbackMessage;
|
|
72
|
+
}
|
|
61
73
|
constructor(modalCtrl) {
|
|
62
74
|
this.modalCtrl = modalCtrl;
|
|
63
75
|
this.title = '';
|
|
64
76
|
this.variant = 'dpi';
|
|
65
77
|
this.message = '';
|
|
66
78
|
this.errorMessages = [];
|
|
79
|
+
this.fallbackMessage = 'Ha sucedido un error al realizar el proceso.';
|
|
67
80
|
}
|
|
68
81
|
closeModal() {
|
|
69
82
|
this.modalCtrl.dismiss();
|
|
70
83
|
}
|
|
71
84
|
static { this.ɵfac = function MessageModalComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MessageModalComponent)(i0.ɵɵdirectiveInject(i1.ModalController)); }; }
|
|
72
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MessageModalComponent, selectors: [["app-modal-error"]], inputs: { title: "title", variant: "variant", message: "message", errors: "errors" }, decls: 13, vars: 6, consts: [["
|
|
85
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MessageModalComponent, selectors: [["app-modal-error"]], inputs: { title: "title", variant: "variant", message: "message", errors: "errors" }, decls: 13, vars: 6, consts: [["showMessage", ""], ["id", "custom-modal-error"], [1, "modal-wrapper-error"], [3, "ngSwitch"], [4, "ngSwitchCase"], [4, "ngSwitchDefault"], [1, "modal-title"], [4, "ngIf", "ngIfElse"], ["expand", "block", 1, "modal-button-error", 3, "click"], ["src", "assets/imagesIdvision/icons/dpi-error.svg", "alt", "Icono DPI", 1, "modal-icon"], ["src", "assets/imagesIdvision/icons/video-error.svg", "alt", "Icono Video", 1, "modal-icon"], [1, "error-list"], [4, "ngFor", "ngForOf"], [1, "modal-message"]], template: function MessageModalComponent_Template(rf, ctx) { if (rf & 1) {
|
|
73
86
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
74
87
|
i0.ɵɵelementStart(0, "ion-content", 1)(1, "div", 2);
|
|
75
88
|
i0.ɵɵelementContainerStart(2, 3);
|
|
@@ -84,7 +97,7 @@ export class MessageModalComponent {
|
|
|
84
97
|
i0.ɵɵtext(12, " Ok ");
|
|
85
98
|
i0.ɵɵelementEnd()()();
|
|
86
99
|
} if (rf & 2) {
|
|
87
|
-
const
|
|
100
|
+
const showMessage_r4 = i0.ɵɵreference(10);
|
|
88
101
|
i0.ɵɵadvance(2);
|
|
89
102
|
i0.ɵɵproperty("ngSwitch", ctx.variant);
|
|
90
103
|
i0.ɵɵadvance();
|
|
@@ -94,12 +107,12 @@ export class MessageModalComponent {
|
|
|
94
107
|
i0.ɵɵadvance(3);
|
|
95
108
|
i0.ɵɵtextInterpolate(ctx.title);
|
|
96
109
|
i0.ɵɵadvance();
|
|
97
|
-
i0.ɵɵproperty("ngIf", ctx.
|
|
110
|
+
i0.ɵɵproperty("ngIf", ctx.hasErrors)("ngIfElse", showMessage_r4);
|
|
98
111
|
} }, dependencies: [i2.NgForOf, i2.NgIf, i2.NgSwitch, i2.NgSwitchCase, i2.NgSwitchDefault, i1.IonButton, i1.IonContent], styles: ["#custom-modal-error[_ngcontent-%COMP%] {\n --background: transparent !important; // Para que el fondo del ion-content sea transparente\n }\n \n .modal-wrapper-error[_ngcontent-%COMP%] {\n background-color: #fff;\n margin: auto;\n margin-top: 50%;\n width: 80%;\n max-width: 320px;\n border-radius: 8px;\n text-align: center;\n padding: 20px;\n box-shadow: 0 2px 8px rgba(0,0,0,0.2);\n }\n \n .modal-icon[_ngcontent-%COMP%] {\n font-size: 3rem;\n color: var(--orange-primary);\n margin-bottom: 8px;\n }\n \n \n\n .modal-title[_ngcontent-%COMP%] {\n font-size: 1.2rem;\n font-weight: bold;\n color: #333;\n margin-bottom: 8px;\n }\n \n \n\n .modal-message[_ngcontent-%COMP%] {\n font-size: 1rem;\n color: #666;\n margin-bottom: 16px;\n }\n \n.error-list[_ngcontent-%COMP%] {\n list-style-type: disc;\n padding-left: 20px;\n margin-bottom: 16px;\n text-align: left;\n color: #666;\n font-size: 1rem;\n }\n \n .error-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] {\n margin-bottom: 8px;\n }\n\n .modal-button-error[_ngcontent-%COMP%] {\n // --background: #F8AA00; \n\n // --color: #fff;\n // --border-radius: 4px;\n // max-width: 300px; // anteriormente 300\n width: auto;\n margin: 0 auto;\n background-color: #ffcc00;\n color: #ffffff;\n font-weight: bold;\n border-radius: 20px;\n \n --background: var(--orange-primary);\n --background-hover: var(--orange-secondary);\n --background-activated: var(--orange-secondary);\n --background-focused: var(--orange-secondary);\n \n --color: var(--orange-primary);\n \n --border-radius: 20px;\n --border-color: var(--orange-primary);\n --border-style: solid;\n --border-width: 1px;\n \n --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\n \n --ripple-color: var(--orange-secondary);\n \n \n &:hover {\n background-color: #ffb300;\n }\n \n &:active {\n background-color: #e6a800;\n }\n \n }"] }); }
|
|
99
112
|
}
|
|
100
113
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageModalComponent, [{
|
|
101
114
|
type: Component,
|
|
102
|
-
args: [{ selector: 'app-modal-error', template: "<ion-content id=\"custom-modal-error\">\n <div class=\"modal-wrapper-error\">\n <ng-container [ngSwitch]=\"variant\">\n <ng-container *ngSwitchCase=\"'dpi'\">\n <img src=\"assets/imagesIdvision/icons/dpi-error.svg\" alt=\"Icono DPI\" class=\"modal-icon\"
|
|
115
|
+
args: [{ selector: 'app-modal-error', template: "<ion-content id=\"custom-modal-error\">\n <div class=\"modal-wrapper-error\">\n <ng-container [ngSwitch]=\"variant\">\n <ng-container *ngSwitchCase=\"'dpi'\">\n <img src=\"assets/imagesIdvision/icons/dpi-error.svg\" alt=\"Icono DPI\" class=\"modal-icon\" />\n </ng-container>\n <ng-container *ngSwitchCase=\"'video'\">\n <img src=\"assets/imagesIdvision/icons/video-error.svg\" alt=\"Icono Video\" class=\"modal-icon\" />\n </ng-container>\n <ng-container *ngSwitchDefault>\n <img src=\"assets/imagesIdvision/icons/dpi-error.svg\" alt=\"Icono DPI\" class=\"modal-icon\" />\n </ng-container>\n </ng-container>\n\n <h2 class=\"modal-title\">{{ title }}</h2>\n\n <div *ngIf=\"hasErrors; else showMessage\">\n <ul class=\"error-list\">\n <li *ngFor=\"let error of errorMessages\">{{ error }}</li>\n </ul>\n </div>\n\n <ng-template #showMessage>\n <p class=\"modal-message\">{{ effectiveMessage }}</p>\n </ng-template>\n\n <ion-button (click)=\"closeModal()\" expand=\"block\" class=\"modal-button-error\">\n Ok\n </ion-button>\n </div>\n</ion-content>\n", styles: ["#custom-modal-error {\n --background: transparent !important; // Para que el fondo del ion-content sea transparente\n }\n \n .modal-wrapper-error {\n background-color: #fff;\n margin: auto;\n margin-top: 50%;\n width: 80%;\n max-width: 320px;\n border-radius: 8px;\n text-align: center;\n padding: 20px;\n box-shadow: 0 2px 8px rgba(0,0,0,0.2);\n }\n \n .modal-icon {\n font-size: 3rem;\n color: var(--orange-primary);\n margin-bottom: 8px;\n }\n \n /* T\u00EDtulo */\n .modal-title {\n font-size: 1.2rem;\n font-weight: bold;\n color: #333;\n margin-bottom: 8px;\n }\n \n /* Mensaje */\n .modal-message {\n font-size: 1rem;\n color: #666;\n margin-bottom: 16px;\n }\n \n.error-list {\n list-style-type: disc;\n padding-left: 20px;\n margin-bottom: 16px;\n text-align: left;\n color: #666;\n font-size: 1rem;\n }\n \n .error-list li {\n margin-bottom: 8px;\n }\n\n .modal-button-error {\n // --background: #F8AA00; /* Mismo color del \u00EDcono */\n // --color: #fff;\n // --border-radius: 4px;\n // max-width: 300px; // anteriormente 300\n width: auto;\n margin: 0 auto;\n background-color: #ffcc00;\n color: #ffffff;\n font-weight: bold;\n border-radius: 20px;\n \n --background: var(--orange-primary);\n --background-hover: var(--orange-secondary);\n --background-activated: var(--orange-secondary);\n --background-focused: var(--orange-secondary);\n \n --color: var(--orange-primary);\n \n --border-radius: 20px;\n --border-color: var(--orange-primary);\n --border-style: solid;\n --border-width: 1px;\n \n --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\n \n --ripple-color: var(--orange-secondary);\n \n \n &:hover {\n background-color: #ffb300;\n }\n \n &:active {\n background-color: #e6a800;\n }\n \n }\n "] }]
|
|
103
116
|
}], () => [{ type: i1.ModalController }], { title: [{
|
|
104
117
|
type: Input
|
|
105
118
|
}], variant: [{
|
|
@@ -108,8 +121,6 @@ export class MessageModalComponent {
|
|
|
108
121
|
type: Input
|
|
109
122
|
}], errors: [{
|
|
110
123
|
type: Input
|
|
111
|
-
}, {
|
|
112
|
-
type: Input
|
|
113
124
|
}] }); })();
|
|
114
125
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MessageModalComponent, { className: "MessageModalComponent" }); })();
|
|
115
126
|
//# sourceMappingURL=message-modal.component.js.map
|
package/dist/src/app/pages/id-vision/components/message-modal/message-modal.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-modal.component.js","sourceRoot":"","sources":["../../../../../../../src/app/pages/id-vision/components/message-modal/message-modal.component.ts","../../../../../../../src/app/pages/id-vision/components/message-modal/message-modal.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;;;ICG3C,6BAAoC;IAClC,
|
|
1
|
+
{"version":3,"file":"message-modal.component.js","sourceRoot":"","sources":["../../../../../../../src/app/pages/id-vision/components/message-modal/message-modal.component.ts","../../../../../../../src/app/pages/id-vision/components/message-modal/message-modal.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;;;ICG3C,6BAAoC;IAClC,yBAA0F;;;;IAE5F,6BAAsC;IACpC,0BAA8F;;;;IAEhG,6BAA+B;IAC7B,yBAA0F;;;;IAQ1F,0BAAwC;IAAA,YAAW;IAAA,iBAAK;;;IAAhB,cAAW;IAAX,8BAAW;;;IADrD,AADF,2BAAyC,aAChB;IACrB,2EAAwC;IAE5C,AADE,iBAAK,EACD;;;IAFoB,eAAgB;IAAhB,8CAAgB;;;IAKxC,6BAAyB;IAAA,YAAsB;IAAA,iBAAI;;;IAA1B,cAAsB;IAAtB,6CAAsB;;ADfrD,MAAM,OAAO,qBAAqB;IAShC,IACI,MAAM,CAAC,KAA2C;QACpD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,uBAAuB;YACvB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACxE,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACrC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;YAC7B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM;gBACjC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;oBACpB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;oBAC3D,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC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