monkey-front-core 0.0.389 → 0.0.391

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.
@@ -35,6 +35,7 @@ class AlertsComponent {
35
35
  this._img = '';
36
36
  this._title = '';
37
37
  this._message = '';
38
+ this._action = null;
38
39
  // not to do
39
40
  }
40
41
  ngOnInit() {
@@ -42,16 +43,23 @@ class AlertsComponent {
42
43
  this._img = config?.data?.img;
43
44
  this._title = config?.data?.title;
44
45
  this._message = config?.data?.message;
46
+ this._action = config?.data?.action;
45
47
  }
46
48
  onClose() {
47
49
  this.modalService.close(this.modalRef);
48
50
  }
51
+ onAction() {
52
+ const { _action } = this;
53
+ if (_action?.href) {
54
+ window.location.href = _action?.href;
55
+ }
56
+ }
49
57
  }
50
58
  AlertsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AlertsComponent, deps: [{ token: i1.MonkeyStyleGuideModalService }], target: i0.ɵɵFactoryTarget.Component });
51
- AlertsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: AlertsComponent, selector: "monkeyecx-alerts", inputs: { config: "config", modalRef: "modalRef" }, ngImport: i0, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\r\n <div class=\"alert-header\">\r\n <img [src]=\"_img\">\r\n </div>\r\n <div class=\"alert-body\">\r\n <span class=\"title\">\r\n {{ _title | translate }}\r\n </span>\r\n <span class=\"message\">\r\n {{ _message | translate }}\r\n </span>\r\n </div>\r\n <div class=\"alert-footer\">\r\n <monkey-button type=\"tertiary\" color=\"theme\" (click)=\"onClose()\">\r\n {{ 'BUTTONS.CLOSE' | translate }}\r\n </monkey-button>\r\n </div>\r\n</monkey-modal>", styles: [":host ::ng-deep monkey-modal mecx-monkey-modal{padding:0}:host ::ng-deep monkey-modal mecx-monkey-modal .body{margin-bottom:0}:host ::ng-deep monkey-modal .mecx-monkey-modal__size-md{max-width:448px}:host .alert-header{height:100%}@media screen and (max-width: 959px){:host .alert-header{min-height:212px}}:host .alert-header img{border-radius:12px 12px 0 0;-o-object-fit:cover;object-fit:cover;width:100%;max-height:280px}@media screen and (max-width: 959px){:host .alert-header img{height:200px}}:host .alert-body{display:flex;flex-direction:column;gap:16px;padding:24px;margin:auto}:host .alert-body .title{font-style:normal;font-weight:700;font-size:32px;line-height:40px;text-align:center;color:#1f2024}:host .alert-body .message{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;letter-spacing:.03em;color:#545a63}:host .alert-footer{display:flex;justify-content:flex-end;padding:0 24px 24px;position:sticky;bottom:0;background:#fafafa}\n"], components: [{ type: i1.MonkeyModalComponent, selector: "monkey-modal", inputs: ["config", "modalRef", "onHandleConfirm"] }, { type: i1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe } });
59
+ AlertsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: AlertsComponent, selector: "monkeyecx-alerts", inputs: { config: "config", modalRef: "modalRef" }, ngImport: i0, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\r\n <div class=\"alert-header\">\r\n <img [src]=\"_img\">\r\n </div>\r\n <div class=\"alert-body\">\r\n <span class=\"title\">\r\n {{ _title | translate }}\r\n </span>\r\n <span class=\"message\">\r\n {{ _message | translate }}\r\n </span>\r\n </div>\r\n <div class=\"alert-footer\">\r\n <monkey-button type=\"tertiary\" color=\"theme\" (click)=\"onClose()\">\r\n {{ 'BUTTONS.CLOSE' | translate }}\r\n </monkey-button>\r\n <ng-container *ngIf=\"_action\">\r\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onAction()\">\r\n {{ _action.label | translate }}\r\n </monkey-button>\r\n </ng-container>\r\n </div>\r\n</monkey-modal>", styles: [":host ::ng-deep monkey-modal mecx-monkey-modal{padding:0}:host ::ng-deep monkey-modal mecx-monkey-modal .body{margin-bottom:0}:host ::ng-deep monkey-modal .mecx-monkey-modal__size-md{max-width:448px}:host .alert-header{height:100%}@media screen and (max-width: 959px){:host .alert-header{min-height:212px}}:host .alert-header img{border-radius:12px 12px 0 0;-o-object-fit:cover;object-fit:cover;width:100%;max-height:280px}@media screen and (max-width: 959px){:host .alert-header img{height:200px}}:host .alert-body{display:flex;flex-direction:column;gap:16px;padding:24px;margin:auto}:host .alert-body .title{font-style:normal;font-weight:700;font-size:32px;line-height:40px;text-align:center;color:#1f2024}:host .alert-body .message{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;letter-spacing:.03em;color:#545a63}:host .alert-footer{display:flex;justify-content:flex-end;padding:0 24px 24px;position:sticky;bottom:0;background:#fafafa}\n"], components: [{ type: i1.MonkeyModalComponent, selector: "monkey-modal", inputs: ["config", "modalRef", "onHandleConfirm"] }, { type: i1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe } });
52
60
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AlertsComponent, decorators: [{
53
61
  type: Component,
54
- args: [{ selector: 'monkeyecx-alerts', template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\r\n <div class=\"alert-header\">\r\n <img [src]=\"_img\">\r\n </div>\r\n <div class=\"alert-body\">\r\n <span class=\"title\">\r\n {{ _title | translate }}\r\n </span>\r\n <span class=\"message\">\r\n {{ _message | translate }}\r\n </span>\r\n </div>\r\n <div class=\"alert-footer\">\r\n <monkey-button type=\"tertiary\" color=\"theme\" (click)=\"onClose()\">\r\n {{ 'BUTTONS.CLOSE' | translate }}\r\n </monkey-button>\r\n </div>\r\n</monkey-modal>", styles: [":host ::ng-deep monkey-modal mecx-monkey-modal{padding:0}:host ::ng-deep monkey-modal mecx-monkey-modal .body{margin-bottom:0}:host ::ng-deep monkey-modal .mecx-monkey-modal__size-md{max-width:448px}:host .alert-header{height:100%}@media screen and (max-width: 959px){:host .alert-header{min-height:212px}}:host .alert-header img{border-radius:12px 12px 0 0;-o-object-fit:cover;object-fit:cover;width:100%;max-height:280px}@media screen and (max-width: 959px){:host .alert-header img{height:200px}}:host .alert-body{display:flex;flex-direction:column;gap:16px;padding:24px;margin:auto}:host .alert-body .title{font-style:normal;font-weight:700;font-size:32px;line-height:40px;text-align:center;color:#1f2024}:host .alert-body .message{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;letter-spacing:.03em;color:#545a63}:host .alert-footer{display:flex;justify-content:flex-end;padding:0 24px 24px;position:sticky;bottom:0;background:#fafafa}\n"] }]
62
+ args: [{ selector: 'monkeyecx-alerts', template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\r\n <div class=\"alert-header\">\r\n <img [src]=\"_img\">\r\n </div>\r\n <div class=\"alert-body\">\r\n <span class=\"title\">\r\n {{ _title | translate }}\r\n </span>\r\n <span class=\"message\">\r\n {{ _message | translate }}\r\n </span>\r\n </div>\r\n <div class=\"alert-footer\">\r\n <monkey-button type=\"tertiary\" color=\"theme\" (click)=\"onClose()\">\r\n {{ 'BUTTONS.CLOSE' | translate }}\r\n </monkey-button>\r\n <ng-container *ngIf=\"_action\">\r\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onAction()\">\r\n {{ _action.label | translate }}\r\n </monkey-button>\r\n </ng-container>\r\n </div>\r\n</monkey-modal>", styles: [":host ::ng-deep monkey-modal mecx-monkey-modal{padding:0}:host ::ng-deep monkey-modal mecx-monkey-modal .body{margin-bottom:0}:host ::ng-deep monkey-modal .mecx-monkey-modal__size-md{max-width:448px}:host .alert-header{height:100%}@media screen and (max-width: 959px){:host .alert-header{min-height:212px}}:host .alert-header img{border-radius:12px 12px 0 0;-o-object-fit:cover;object-fit:cover;width:100%;max-height:280px}@media screen and (max-width: 959px){:host .alert-header img{height:200px}}:host .alert-body{display:flex;flex-direction:column;gap:16px;padding:24px;margin:auto}:host .alert-body .title{font-style:normal;font-weight:700;font-size:32px;line-height:40px;text-align:center;color:#1f2024}:host .alert-body .message{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;letter-spacing:.03em;color:#545a63}:host .alert-footer{display:flex;justify-content:flex-end;padding:0 24px 24px;position:sticky;bottom:0;background:#fafafa}\n"] }]
55
63
  }], ctorParameters: function () { return [{ type: i1.MonkeyStyleGuideModalService }]; }, propDecorators: { config: [{
56
64
  type: Input
57
65
  }], modalRef: [{
@@ -3484,7 +3492,7 @@ class MonkeyEcxAlertsConfigService {
3484
3492
  }
3485
3493
  handleValidation(config) {
3486
3494
  if (config.alert) {
3487
- const { img, title, message, endDate, noEndDate } = config.alert;
3495
+ const { img, title, message, endDate, noEndDate, action } = config.alert;
3488
3496
  if (moment.default().isSameOrBefore(moment.default(endDate)) || noEndDate) {
3489
3497
  this.modalService.open(AlertsComponent, {
3490
3498
  color: 'theme',
@@ -3492,7 +3500,8 @@ class MonkeyEcxAlertsConfigService {
3492
3500
  data: {
3493
3501
  img,
3494
3502
  title,
3495
- message
3503
+ message,
3504
+ action
3496
3505
  }
3497
3506
  });
3498
3507
  }