monkey-style-guide 2.0.124 → 2.0.127
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/assets/scss/partials/components/_snackbar.scss +1 -0
- package/esm2020/lib/core/services/snackbar/mokey-style-guide-snackbar.service.mjs +26 -23
- package/fesm2015/monkey-style-guide.mjs +25 -22
- package/fesm2015/monkey-style-guide.mjs.map +1 -1
- package/fesm2020/monkey-style-guide.mjs +25 -22
- package/fesm2020/monkey-style-guide.mjs.map +1 -1
- package/lib/core/services/snackbar/mokey-style-guide-snackbar.service.d.ts +4 -3
- package/monkey-style-guide-2.0.127.tgz +0 -0
- package/package.json +1 -1
- package/monkey-style-guide-2.0.124.tgz +0 -0
|
@@ -500,31 +500,33 @@ class MonkeyStyleGuideSnackbarService {
|
|
|
500
500
|
buildAction(id) {
|
|
501
501
|
const { config: { type, action }, } = this;
|
|
502
502
|
if (action) {
|
|
503
|
-
const {
|
|
503
|
+
const { confirm, cancel } = action;
|
|
504
504
|
const actionElement = document.createElement('div');
|
|
505
505
|
let actionCancelElement = null, actionConfirmElement = null;
|
|
506
|
-
if (
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
actionCancelElement.href = 'javascript:void(0)';
|
|
510
|
-
actionCancelElement.innerText = cancel.label;
|
|
511
|
-
}
|
|
512
|
-
if (confirm) {
|
|
506
|
+
if (confirm) {
|
|
507
|
+
const { style, label } = confirm;
|
|
508
|
+
if (style === 'link') {
|
|
513
509
|
actionConfirmElement = document.createElement('a');
|
|
514
510
|
actionConfirmElement.href = 'javascript:void(0)';
|
|
515
|
-
actionConfirmElement.innerText =
|
|
511
|
+
actionConfirmElement.innerText = label;
|
|
512
|
+
}
|
|
513
|
+
else {
|
|
514
|
+
actionConfirmElement = document.createElement('button');
|
|
515
|
+
actionConfirmElement.className = `mecx-button-primary mecx-button-primary__${type}`;
|
|
516
|
+
actionConfirmElement.innerText = label;
|
|
516
517
|
}
|
|
517
518
|
}
|
|
518
|
-
|
|
519
|
-
|
|
519
|
+
if (cancel) {
|
|
520
|
+
const { style, label } = cancel;
|
|
521
|
+
if (style === 'link') {
|
|
522
|
+
actionCancelElement = document.createElement('a');
|
|
523
|
+
actionCancelElement.href = 'javascript:void(0)';
|
|
524
|
+
actionCancelElement.innerText = label;
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
520
527
|
actionCancelElement = document.createElement('button');
|
|
521
528
|
actionCancelElement.className = `mecx-button-tertiary mecx-button-tertiary__${type}`;
|
|
522
|
-
actionCancelElement.innerText =
|
|
523
|
-
}
|
|
524
|
-
if (confirm) {
|
|
525
|
-
actionConfirmElement = document.createElement('button');
|
|
526
|
-
actionConfirmElement.className = `mecx-button-primary mecx-button-primary__${type}`;
|
|
527
|
-
actionConfirmElement.innerText = confirm.label;
|
|
529
|
+
actionCancelElement.innerText = label;
|
|
528
530
|
}
|
|
529
531
|
}
|
|
530
532
|
if (actionCancelElement) {
|
|
@@ -560,11 +562,6 @@ class MonkeyStyleGuideSnackbarService {
|
|
|
560
562
|
snackbarElement.appendChild(snackbarBodyElement);
|
|
561
563
|
this.snackbarElements.add(snackbarElement, duration, () => (!keepOpen ? this.close(id) : null), verticalPosition);
|
|
562
564
|
}
|
|
563
|
-
close(id) {
|
|
564
|
-
const { snackbarElements } = this;
|
|
565
|
-
snackbarElements.remove(id);
|
|
566
|
-
this.stopBlinking();
|
|
567
|
-
}
|
|
568
565
|
show(config) {
|
|
569
566
|
this.config = config;
|
|
570
567
|
const id = `monkey-snackbar-${MonkeyUtils.getRandomString(30)}`;
|
|
@@ -578,11 +575,17 @@ class MonkeyStyleGuideSnackbarService {
|
|
|
578
575
|
if (config?.blinkTab) {
|
|
579
576
|
this.blinkTab();
|
|
580
577
|
}
|
|
578
|
+
return id;
|
|
581
579
|
}
|
|
582
580
|
closeAll() {
|
|
583
581
|
const { snackbarElements } = this;
|
|
584
582
|
snackbarElements.removeAll();
|
|
585
583
|
}
|
|
584
|
+
close(id) {
|
|
585
|
+
const { snackbarElements } = this;
|
|
586
|
+
snackbarElements.remove(id);
|
|
587
|
+
this.stopBlinking();
|
|
588
|
+
}
|
|
586
589
|
}
|
|
587
590
|
MonkeyStyleGuideSnackbarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: MonkeyStyleGuideSnackbarService, deps: [{ token: i1$1.Location }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
588
591
|
MonkeyStyleGuideSnackbarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: MonkeyStyleGuideSnackbarService });
|