monkey-style-guide 2.0.125 → 2.0.126
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/esm2020/lib/core/services/snackbar/mokey-style-guide-snackbar.service.mjs +20 -18
- package/fesm2015/monkey-style-guide.mjs +19 -17
- package/fesm2015/monkey-style-guide.mjs.map +1 -1
- package/fesm2020/monkey-style-guide.mjs +19 -17
- package/fesm2020/monkey-style-guide.mjs.map +1 -1
- package/lib/core/services/snackbar/mokey-style-guide-snackbar.service.d.ts +2 -1
- package/monkey-style-guide-2.0.126.tgz +0 -0
- package/package.json +1 -1
- package/monkey-style-guide-2.0.125.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) {
|