@nethserver/ns8-ui-lib 1.12.3 → 1.12.4
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/ns8-ui-lib.esm.js +53 -25
- package/dist/ns8-ui-lib.min.js +1 -1
- package/dist/ns8-ui-lib.ssr.js +30 -29
- package/package.json +1 -1
- package/src/lib-components/NsToastNotification.vue +69 -21
package/dist/ns8-ui-lib.ssr.js
CHANGED
|
@@ -7015,9 +7015,17 @@ var script$t = {
|
|
|
7015
7015
|
type: String,
|
|
7016
7016
|
default: "Abort"
|
|
7017
7017
|
},
|
|
7018
|
+
confirmCancelText: {
|
|
7019
|
+
type: String,
|
|
7020
|
+
default: "Abort this task? This action can't be undone"
|
|
7021
|
+
},
|
|
7022
|
+
keepRunningLabel: {
|
|
7023
|
+
type: String,
|
|
7024
|
+
default: "Keep running"
|
|
7025
|
+
},
|
|
7018
7026
|
confirmCancelLabel: {
|
|
7019
7027
|
type: String,
|
|
7020
|
-
default: "
|
|
7028
|
+
default: "Yes, abort"
|
|
7021
7029
|
},
|
|
7022
7030
|
closeAriaLabel: {
|
|
7023
7031
|
type: String,
|
|
@@ -7035,24 +7043,21 @@ var script$t = {
|
|
|
7035
7043
|
data: function data() {
|
|
7036
7044
|
return {
|
|
7037
7045
|
isConfirmCancelShown: false,
|
|
7038
|
-
isCancelButtonDisabled: false
|
|
7046
|
+
isCancelButtonDisabled: false,
|
|
7047
|
+
isKeepRunningButtonDisabled: false
|
|
7039
7048
|
};
|
|
7040
7049
|
},
|
|
7041
7050
|
methods: {
|
|
7042
7051
|
cancelTask: function cancelTask() {
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
// cancel task
|
|
7053
|
-
this.$emit("cancelTask", this.id);
|
|
7054
|
-
this.isCancelButtonDisabled = true;
|
|
7055
|
-
}
|
|
7052
|
+
this.isConfirmCancelShown = true;
|
|
7053
|
+
},
|
|
7054
|
+
handleKeepRunning: function handleKeepRunning() {
|
|
7055
|
+
this.isConfirmCancelShown = false;
|
|
7056
|
+
},
|
|
7057
|
+
confirmCancelTask: function confirmCancelTask() {
|
|
7058
|
+
this.$emit("cancelTask", this.id);
|
|
7059
|
+
this.isCancelButtonDisabled = true;
|
|
7060
|
+
this.isKeepRunningButtonDisabled = true;
|
|
7056
7061
|
}
|
|
7057
7062
|
}
|
|
7058
7063
|
};/* script */
|
|
@@ -7070,21 +7075,17 @@ var __vue_render__$F = function __vue_render__() {
|
|
|
7070
7075
|
|
|
7071
7076
|
return _c('div', [_vm._ssrNode("<div data-notification" + _vm._ssrAttr("role", _vm.isAlert ? 'alert' : undefined) + _vm._ssrAttr("aria-live", !_vm.isAlert ? 'polite' : false) + _vm._ssrClass(null, ["cv-notifiation " + _vm.carbonPrefix + "--toast-notification", _vm.carbonPrefix + "--toast-notification--" + _vm.kind.toLowerCase(), (_obj = {}, _obj[_vm.carbonPrefix + "--toast-notification--low-contrast"] = _vm.lowContrast, _obj), "notification", {
|
|
7072
7077
|
'notification-read': _vm.isRead
|
|
7073
|
-
}]) + " data-v-
|
|
7078
|
+
}]) + " data-v-4769db45>", "</div>", [_c(_vm.icon, {
|
|
7074
7079
|
tag: "component",
|
|
7075
7080
|
class: _vm.carbonPrefix + "--toast-notification__icon"
|
|
7076
|
-
}), _vm._ssrNode(" "), _vm._ssrNode("<div" + _vm._ssrClass(null, _vm.carbonPrefix + "--toast-notification__details") + " data-v-
|
|
7081
|
+
}), _vm._ssrNode(" "), _vm._ssrNode("<div" + _vm._ssrClass(null, _vm.carbonPrefix + "--toast-notification__details") + " data-v-4769db45>", "</div>", [_vm._ssrNode("<h3" + _vm._ssrClass(null, _vm.carbonPrefix + "--toast-notification__title") + " data-v-4769db45>" + _vm._ssrEscape("\n " + _vm._s(_vm.title) + "\n ") + "</h3> "), _vm._ssrNode("<div" + _vm._ssrClass(null, [_vm.carbonPrefix + "--toast-notification__subtitle", "notification-description-and-progress", "row", {
|
|
7077
7082
|
'fix-margin-bottom': _vm.actionLabel || _vm.isProgressShown
|
|
7078
|
-
}]) + " data-v-
|
|
7083
|
+
}]) + " data-v-4769db45>", "</div>", [_vm.$slots.description ? _vm._t("description") : _c('span', [_vm._v(_vm._s(_vm.description))]), _vm._ssrNode(" "), _vm.isProgressShown ? _vm._ssrNode("<div class=\"progress\" data-v-4769db45>", "</div>", [_c('NsProgressBar', {
|
|
7079
7084
|
attrs: {
|
|
7080
7085
|
"value": _vm.progress,
|
|
7081
7086
|
"indeterminate": !_vm.progress
|
|
7082
7087
|
}
|
|
7083
|
-
}), _vm._ssrNode(" <div class=\"progress-bar-spacer\" data-v-
|
|
7084
|
-
'bx--btn--ghost': !_vm.isConfirmCancelShown
|
|
7085
|
-
}, {
|
|
7086
|
-
'bx--btn--danger': _vm.isConfirmCancelShown
|
|
7087
|
-
}]) + " data-v-014a0a7f>" + _vm._ssrEscape("\n " + _vm._s(_vm.isConfirmCancelShown ? _vm.confirmCancelLabel : _vm.cancelLabel) + "\n ") + "</button></div>" : _vm.actionLabel ? "<div" + _vm._ssrClass(null, [_vm.carbonPrefix + "--toast-notification__caption", "action", "row"]) + " data-v-014a0a7f><button type=\"button\"" + _vm._ssrClass(null, [_vm.carbonPrefix + "--inline-notification__action-button", _vm.carbonPrefix + "--btn", _vm.carbonPrefix + "--btn--sm", _vm.carbonPrefix + "--btn--ghost"]) + " data-v-014a0a7f>" + _vm._ssrEscape("\n " + _vm._s(_vm.actionLabel) + "\n ") + "</button></div>" : "<!---->") + " "), _vm.timestamp && !_vm.isProgressShown ? _vm._ssrNode("<div class=\"timestamp row\" data-v-014a0a7f>", "</div>", [_c('cv-tooltip', {
|
|
7088
|
+
}), _vm._ssrNode(" <div class=\"progress-bar-spacer\" data-v-4769db45></div> " + (_vm.progress ? "<div class=\"progress-number\" data-v-4769db45>" + _vm._ssrEscape(_vm._s(_vm.progress) + " %") + "</div>" : "<!---->"))], 2) : _vm._e()], 2), _vm._ssrNode(" " + (_vm.isCancelShown && _vm.isProgressShown && !_vm.isConfirmCancelShown ? "<div" + _vm._ssrClass(null, [_vm.carbonPrefix + "--toast-notification__caption", "action", "row"]) + " data-v-4769db45><button type=\"button\"" + _vm._ssrClass(null, [_vm.carbonPrefix + "--inline-notification__action-button", _vm.carbonPrefix + "--btn", _vm.carbonPrefix + "--btn--sm", "bx--btn--ghost"]) + " data-v-4769db45>" + _vm._ssrEscape("\n " + _vm._s(_vm.cancelLabel) + "\n ") + "</button></div>" : _vm.isCancelShown && _vm.isProgressShown && _vm.isConfirmCancelShown ? "<div class=\"cancel-confirmation\" data-v-4769db45><p class=\"cancel-confirmation__text\" data-v-4769db45>" + _vm._ssrEscape(_vm._s(_vm.confirmCancelText)) + "</p> <div class=\"cancel-confirmation__buttons\" data-v-4769db45><button type=\"button\"" + _vm._ssrAttr("disabled", _vm.isKeepRunningButtonDisabled) + _vm._ssrClass(null, [_vm.carbonPrefix + "--inline-notification__action-button", _vm.carbonPrefix + "--btn", _vm.carbonPrefix + "--btn--sm", "bx--btn--ghost"]) + " data-v-4769db45>" + _vm._ssrEscape("\n " + _vm._s(_vm.keepRunningLabel) + "\n ") + "</button> <button" + _vm._ssrAttr("disabled", _vm.isCancelButtonDisabled) + " type=\"button\"" + _vm._ssrClass(null, [_vm.carbonPrefix + "--inline-notification__action-button", _vm.carbonPrefix + "--btn", _vm.carbonPrefix + "--btn--sm", "bx--btn--danger"]) + " data-v-4769db45>" + _vm._ssrEscape("\n " + _vm._s(_vm.confirmCancelLabel) + "\n ") + "</button></div></div>" : _vm.actionLabel ? "<div" + _vm._ssrClass(null, [_vm.carbonPrefix + "--toast-notification__caption", "action", "row"]) + " data-v-4769db45><button type=\"button\"" + _vm._ssrClass(null, [_vm.carbonPrefix + "--inline-notification__action-button", _vm.carbonPrefix + "--btn", _vm.carbonPrefix + "--btn--sm", _vm.carbonPrefix + "--btn--ghost"]) + " data-v-4769db45>" + _vm._ssrEscape("\n " + _vm._s(_vm.actionLabel) + "\n ") + "</button></div>" : "<!---->") + " "), _vm.timestamp && !_vm.isProgressShown ? _vm._ssrNode("<div class=\"timestamp row\" data-v-4769db45>", "</div>", [_c('cv-tooltip', {
|
|
7088
7089
|
attrs: {
|
|
7089
7090
|
"alignment": "center",
|
|
7090
7091
|
"direction": "bottom",
|
|
@@ -7092,7 +7093,7 @@ var __vue_render__$F = function __vue_render__() {
|
|
|
7092
7093
|
}
|
|
7093
7094
|
}, [_vm._v("\n " + _vm._s(_vm.formatDateDistance(_vm.timestamp, new Date(), {
|
|
7094
7095
|
addSuffix: true
|
|
7095
|
-
})) + "\n ")])], 1) : _vm._e()], 2), _vm._ssrNode(" "), _vm.showCloseButton ? _vm._ssrNode("<button" + _vm._ssrAttr("aria-label", _vm.closeAriaLabel) + " type=\"button\" data-notification-btn" + _vm._ssrClass(null, _vm.carbonPrefix + "--toast-notification__close-button") + " data-v-
|
|
7096
|
+
})) + "\n ")])], 1) : _vm._e()], 2), _vm._ssrNode(" "), _vm.showCloseButton ? _vm._ssrNode("<button" + _vm._ssrAttr("aria-label", _vm.closeAriaLabel) + " type=\"button\" data-notification-btn" + _vm._ssrClass(null, _vm.carbonPrefix + "--toast-notification__close-button") + " data-v-4769db45>", "</button>", [_c('Close20', {
|
|
7096
7097
|
class: _vm.carbonPrefix + "--toast-notification__close-icon"
|
|
7097
7098
|
})], 1) : _vm._e()], 2)]);
|
|
7098
7099
|
};
|
|
@@ -7102,11 +7103,11 @@ var __vue_staticRenderFns__$F = [];
|
|
|
7102
7103
|
|
|
7103
7104
|
var __vue_inject_styles__$H = function __vue_inject_styles__(inject) {
|
|
7104
7105
|
if (!inject) return;
|
|
7105
|
-
inject("data-v-
|
|
7106
|
-
source: ".notification[data-v-
|
|
7106
|
+
inject("data-v-4769db45_0", {
|
|
7107
|
+
source: ".notification[data-v-4769db45]{margin-bottom:0;margin-right:0}.action[data-v-4769db45]{padding-top:0;margin-bottom:0}.cancel-confirmation[data-v-4769db45]{margin-top:1rem}.cancel-confirmation__buttons[data-v-4769db45]{margin-top:.5rem;margin-bottom:1.5rem;display:flex;gap:2rem}.bx--toast-notification .bx--inline-notification__action-button[data-v-4769db45]{margin-left:-1rem}.bx--toast-notification .bx--inline-notification__action-button.bx--btn--danger[data-v-4769db45]{margin:.5rem 0 .5rem -1rem}.notification-description-and-progress[data-v-4769db45]{margin-top:.75rem;margin-bottom:.75rem}.fix-margin-bottom[data-v-4769db45]{margin-bottom:0}.progress[data-v-4769db45]{margin-top:.75rem}.progress-bar-spacer[data-v-4769db45]{height:.5rem}.cv-notifiation.bx--toast-notification.notification[data-v-4769db45]{width:26vw;min-width:20rem;margin-top:0}.notification-drawer .cv-notifiation.bx--toast-notification.notification[data-v-4769db45]{margin-top:1rem}.notification-drawer .cv-notifiation.bx--toast-notification.notification[data-v-4769db45]{width:100%}.notification-read[data-v-4769db45]{border-color:#8d8d8d;color:#c6c6c6}.notification-read .bx--toast-notification__icon[data-v-4769db45]{fill:currentColor}.notification-read .bx--toast-notification__subtitle[data-v-4769db45]{color:#c6c6c6}.notification-read .bx--toast-notification__title[data-v-4769db45]{font-weight:400}.cv-notifiation .timestamp[data-v-4769db45]{margin-bottom:.75rem;line-height:1.29;color:#fff;text-decoration:underline}.cv-notifiation .timestamp button[data-v-4769db45]{color:#c6c6c6}.bx--tooltip__trigger[data-v-4769db45]:not(.bx--btn--icon-only){font-size:inherit}.cv-notifiation .timestamp .bx--tooltip__trigger[data-v-4769db45]::before{border-bottom-color:#161616}div.row[data-v-4769db45]:last-child{margin-bottom:1.5rem}.bx--toast-notification__details[data-v-4769db45]{flex-grow:1}",
|
|
7107
7108
|
map: undefined,
|
|
7108
7109
|
media: undefined
|
|
7109
|
-
}), inject("data-v-
|
|
7110
|
+
}), inject("data-v-4769db45_1", {
|
|
7110
7111
|
source: ".cv-notifiation .timestamp button span{background-color:#161616!important;border-left:1px solid #393939;border-right:1px solid #393939;border-bottom:1px solid #393939}",
|
|
7111
7112
|
map: undefined,
|
|
7112
7113
|
media: undefined
|
|
@@ -7115,10 +7116,10 @@ var __vue_inject_styles__$H = function __vue_inject_styles__(inject) {
|
|
|
7115
7116
|
/* scoped */
|
|
7116
7117
|
|
|
7117
7118
|
|
|
7118
|
-
var __vue_scope_id__$H = "data-v-
|
|
7119
|
+
var __vue_scope_id__$H = "data-v-4769db45";
|
|
7119
7120
|
/* module identifier */
|
|
7120
7121
|
|
|
7121
|
-
var __vue_module_identifier__$H = "data-v-
|
|
7122
|
+
var __vue_module_identifier__$H = "data-v-4769db45";
|
|
7122
7123
|
/* functional template */
|
|
7123
7124
|
|
|
7124
7125
|
var __vue_is_functional_template__$H = false;
|
package/package.json
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
<!-- cancel button -->
|
|
47
47
|
<div
|
|
48
|
-
v-if="isCancelShown && isProgressShown"
|
|
48
|
+
v-if="isCancelShown && isProgressShown && !isConfirmCancelShown"
|
|
49
49
|
:class="[
|
|
50
50
|
`${carbonPrefix}--toast-notification__caption`,
|
|
51
51
|
`action`,
|
|
@@ -58,16 +58,50 @@
|
|
|
58
58
|
`${carbonPrefix}--inline-notification__action-button`,
|
|
59
59
|
`${carbonPrefix}--btn`,
|
|
60
60
|
`${carbonPrefix}--btn--sm`,
|
|
61
|
-
|
|
62
|
-
{ 'bx--btn--danger': isConfirmCancelShown }
|
|
61
|
+
`bx--btn--ghost`,
|
|
63
62
|
]"
|
|
64
|
-
:disabled="isCancelButtonDisabled"
|
|
65
63
|
type="button"
|
|
66
64
|
>
|
|
67
|
-
{{
|
|
65
|
+
{{ cancelLabel }}
|
|
68
66
|
</button>
|
|
69
67
|
</div>
|
|
70
68
|
|
|
69
|
+
<!-- cancel confirmation -->
|
|
70
|
+
<div
|
|
71
|
+
v-else-if="isCancelShown && isProgressShown && isConfirmCancelShown"
|
|
72
|
+
class="cancel-confirmation"
|
|
73
|
+
>
|
|
74
|
+
<p class="cancel-confirmation__text">{{ confirmCancelText }}</p>
|
|
75
|
+
<div class="cancel-confirmation__buttons">
|
|
76
|
+
<button
|
|
77
|
+
@click="handleKeepRunning"
|
|
78
|
+
:class="[
|
|
79
|
+
`${carbonPrefix}--inline-notification__action-button`,
|
|
80
|
+
`${carbonPrefix}--btn`,
|
|
81
|
+
`${carbonPrefix}--btn--sm`,
|
|
82
|
+
`bx--btn--ghost`,
|
|
83
|
+
]"
|
|
84
|
+
type="button"
|
|
85
|
+
:disabled="isKeepRunningButtonDisabled"
|
|
86
|
+
>
|
|
87
|
+
{{ keepRunningLabel }}
|
|
88
|
+
</button>
|
|
89
|
+
<button
|
|
90
|
+
@click="confirmCancelTask"
|
|
91
|
+
:class="[
|
|
92
|
+
`${carbonPrefix}--inline-notification__action-button`,
|
|
93
|
+
`${carbonPrefix}--btn`,
|
|
94
|
+
`${carbonPrefix}--btn--sm`,
|
|
95
|
+
`bx--btn--danger`,
|
|
96
|
+
]"
|
|
97
|
+
:disabled="isCancelButtonDisabled"
|
|
98
|
+
type="button"
|
|
99
|
+
>
|
|
100
|
+
{{ confirmCancelLabel }}
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
71
105
|
<!-- action button -->
|
|
72
106
|
<div
|
|
73
107
|
v-else-if="actionLabel"
|
|
@@ -153,7 +187,12 @@ export default {
|
|
|
153
187
|
default: false
|
|
154
188
|
},
|
|
155
189
|
cancelLabel: { type: String, default: "Abort" },
|
|
156
|
-
|
|
190
|
+
confirmCancelText: {
|
|
191
|
+
type: String,
|
|
192
|
+
default: "Abort this task? This action can't be undone",
|
|
193
|
+
},
|
|
194
|
+
keepRunningLabel: { type: String, default: "Keep running" },
|
|
195
|
+
confirmCancelLabel: { type: String, default: "Yes, abort" },
|
|
157
196
|
closeAriaLabel: { type: String, default: "Dismiss notification" },
|
|
158
197
|
kind: {
|
|
159
198
|
type: String,
|
|
@@ -165,25 +204,23 @@ export default {
|
|
|
165
204
|
data() {
|
|
166
205
|
return {
|
|
167
206
|
isConfirmCancelShown: false,
|
|
168
|
-
isCancelButtonDisabled: false
|
|
207
|
+
isCancelButtonDisabled: false,
|
|
208
|
+
isKeepRunningButtonDisabled: false,
|
|
169
209
|
};
|
|
170
210
|
},
|
|
171
211
|
methods: {
|
|
172
212
|
cancelTask() {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
213
|
+
this.isConfirmCancelShown = true;
|
|
214
|
+
},
|
|
215
|
+
handleKeepRunning() {
|
|
216
|
+
this.isConfirmCancelShown = false;
|
|
217
|
+
},
|
|
218
|
+
confirmCancelTask() {
|
|
219
|
+
this.$emit("cancelTask", this.id);
|
|
220
|
+
this.isCancelButtonDisabled = true;
|
|
221
|
+
this.isKeepRunningButtonDisabled = true;
|
|
222
|
+
},
|
|
223
|
+
},
|
|
187
224
|
};
|
|
188
225
|
</script>
|
|
189
226
|
|
|
@@ -198,6 +235,17 @@ export default {
|
|
|
198
235
|
margin-bottom: 0;
|
|
199
236
|
}
|
|
200
237
|
|
|
238
|
+
.cancel-confirmation {
|
|
239
|
+
margin-top: 1rem;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.cancel-confirmation__buttons {
|
|
243
|
+
margin-top: 0.5rem;
|
|
244
|
+
margin-bottom: 1.5rem;
|
|
245
|
+
display: flex;
|
|
246
|
+
gap: 2rem;
|
|
247
|
+
}
|
|
248
|
+
|
|
201
249
|
.bx--toast-notification .bx--inline-notification__action-button {
|
|
202
250
|
// following rule uses branding color so it's inside core _core.scss
|
|
203
251
|
// color: $inverse-link;
|